Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add second set of data table action icons below the report title #22827

Open
wants to merge 38 commits into
base: 5.x-dev
Choose a base branch
from

Conversation

michalkleiner
Copy link
Contributor

Description:

Ref. DEV-13900

Review

@michalkleiner
Copy link
Contributor Author

So far found a weird behaviour where the top actions don't display the settings icon when the report doesn't show data, need to dig into that.

Comment on lines -1490 to +1522
delete self.param.totalRows;
delete self.param.totalRows;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This actually fixes the alignment in IDE

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Transitions are not within the data table wrapper, so they don't get the top controls.

@michalkleiner
Copy link
Contributor Author

So far found a weird behaviour where the top actions don't display the settings icon when the report doesn't show data, need to dig into that.

This should be resolved.

@michalkleiner michalkleiner added Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. c: Design / UI For issues that impact Matomo's user interface or the design overall. labels Dec 10, 2024
@michalkleiner michalkleiner added this to the 5.3.0 milestone Dec 10, 2024
@michalkleiner
Copy link
Contributor Author

See internal Jira card for more details on the context of the change.

@michalkleiner michalkleiner marked this pull request as ready for review December 10, 2024 11:01
@michalkleiner michalkleiner added the Needs Review PRs that need a code review label Dec 10, 2024
@michalkleiner michalkleiner requested a review from a team December 10, 2024 11:02
@michalkleiner michalkleiner changed the title Add second set of data table action icons below report title Add second set of data table action icons below the report title Dec 10, 2024
@michalkleiner
Copy link
Contributor Author

Remaining failing UI tests come from submodules.

@caddoo
Copy link
Contributor

caddoo commented Dec 11, 2024

I've been reviewing the screenshots and found a few that don't look right.

All the ActionsDataTable_* have the icons bleed out over the top border.

This also applies to the GoalsTable_* as well and a lot more. I won't spend the time listing them all.

image

Looking at Goals_action_goals_visualization_page_urls, Goals_action_goals_visualization_page_urls, Goals_goals_by_entry_page_titles, Goals_goals_by_entry_pages it looks as though there where no controls before and now they are there, is that expected?

image

I'll stop reviewing now until those are corrected, as i think fixing them once will fix a lot of the screenshots.

@michalkleiner
Copy link
Contributor Author

Thanks for the feedback @caddoo.

I've been reviewing the screenshots and found a few that don't look right.

All the ActionsDataTable_* have the icons bleed out over the top border.

This also applies to the GoalsTable_* as well and a lot more. I won't spend the time listing them all.

image

They actually don't spill over, they are at the very edge with 0 pixels gap. My understanding is that is due to how the report screenshot is taken, not that there would be anything missing. However we do use -10px top margin to lower the gap between the actions and the title, so I can look into updating the styles to only do that when the card title is a sibling element. That should address that.

Looking at Goals_action_goals_visualization_page_urls, Goals_action_goals_visualization_page_urls, Goals_goals_by_entry_page_titles, Goals_goals_by_entry_pages it looks as though there where no controls before and now they are there, is that expected?

image

Again, this is due to how the screenshots are taken and where the mouse is during that event since the bottom actions were visible on hover. If the mouse is moved outside of the report or the report is not being interacted with, the hover effect is not there and the bottom action are not visible. The change makes both bottom and top controls visible at all times, which is why it is newly visible both at the bottom and at the top. Does that answer your question?

@sgiehl
Copy link
Member

sgiehl commented Dec 11, 2024

@michalkleiner there are still a couple of inconsistencies. For example if you search for something and the table then has no results:

report_search.mp4

And another problem I've spotted is, that the datatable setting do not always have the same options:

report_settings.mp4

@michalkleiner
Copy link
Contributor Author

Thanks for your testing @sgiehl. The inconsistency around the top controls being hidden came from it being hidden when there's no data initially, but it didn't occur to me that it would also apply when searching, so I guess I'll need to check if we can differentiate those two scenarios - initial table empty and empty search results.

For the latter, I have no idea why that would be happening, unless someone was adding the options via JS. I'll investigate, but any hints would be appreciated.

@mneudert
Copy link
Member

The flattening option is not added, it is removed from the table:

if ((typeof self.numberOfSubtables == 'undefined' || self.numberOfSubtables == 0)
&& (typeof self.param.flat == 'undefined' || self.param.flat != 1)
) {
// if there are no subtables, remove the flatten action
const dataTableActionsVueApp = $('[vue-entry="CoreHome.DataTableActions"]', domElem).data('vueAppInstance');
if (dataTableActionsVueApp) {
dataTableActionsVueApp.showFlattenTable_ = false;
}
}

So the top action row is correct, and the bottom one is not, because there is no loop over both $('[vue-entry="CoreHome.DataTableActions"]', domElem).

@michalkleiner
Copy link
Contributor Author

@sgiehl I've addressed both issues you raised, we now can identify if there are no data in the report based on search, or whether it's an empty report without search. With search, we display the top controls if they were visible before.

For the settings option, thanks to @mneudert's suggestion this is also fixed and the flattening option is correctly removed from both controls.

@caddoo I've checked reports without titles to see if the action icons bunched up against the top border of the screenshot is an issue and in the UI itself I couldn't find anywhere where this would be a problem, so I think it comes down to how the screenshots are taken.

@michalkleiner
Copy link
Contributor Author

I've rebased the branch on latest 5.x-dev to prevent UI screenshots braking on there being a new version of Matomo available.

# Conflicts:
#	plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_actions_segmented_visitorlog.png
#	plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_dashboard3.png
#	plugins/Live/tests/UI/expected-screenshots/Live_visitor_log.png
#	plugins/Live/tests/UI/expected-screenshots/Live_visitor_log_page_next.png
#	plugins/Referrers/tests/UI/expected-screenshots/ReferrersPages_search_engines_keywords.png
#	tests/UI/expected-screenshots/Comparison_normal_table.png
#	tests/UI/expected-screenshots/Comparison_normal_table_no_periods.png
#	tests/UI/expected-screenshots/Comparison_normal_table_no_segments.png
#	tests/UI/expected-screenshots/Comparison_row_evolution.png
#	tests/UI/expected-screenshots/Comparison_segmented_visitorlog.png
#	tests/UI/expected-screenshots/Comparison_subtables_loaded.png
#	tests/UI/expected-screenshots/Comparison_subtables_paginate.png
#	tests/UI/expected-screenshots/JSTracker_visitor_log.png
#	tests/UI/expected-screenshots/UIIntegrationTest_actions_outlinks_vlog.png
#	tests/UI/expected-screenshots/UIIntegrationTest_ecommerce_log_segmented.png
#	tests/UI/expected-screenshots/UIIntegrationTest_segmented_visitorlog.png
#	tests/UI/expected-screenshots/UIIntegrationTest_visitors_devices.png
#	tests/UI/expected-screenshots/UIIntegrationTest_visitors_software.png
#	tests/UI/expected-screenshots/UIIntegrationTest_widgetize_ecommercelog.png
#	tests/UI/expected-screenshots/UIIntegrationTest_widgetize_visitor_log.png
#	tests/UI/expected-screenshots/ViewDataTableTest_11_flattened.png
#	tests/UI/expected-screenshots/ViewDataTableTest_12_aggregate_shown.png
#	tests/UI/expected-screenshots/ViewDataTableTest_dimension_columns.png
#	tests/UI/expected-screenshots/ViewDataTableTest_dimension_search.png
#	tests/UI/expected-screenshots/ViewDataTableTest_flatten_search.png
#	tests/UI/expected-screenshots/ViewDataTableTest_related_report_click.png
#	tests/UI/expected-screenshots/ViewDataTableTest_subtables_loaded.png
@michalkleiner michalkleiner requested review from mneudert and a team December 18, 2024 10:35
@michalkleiner
Copy link
Contributor Author

There is a few other UI screenshots updated as a leftover from the icons update.

@@ -197,7 +197,7 @@ describe("EvolutionGraph", function () {
});
await page.reload();
await showDataTableFooter();
await page.click('.activatePeriodsSelection');
await page.click('.activatePeriodsSelection:last');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
await page.click('.activatePeriodsSelection:last');
await (await page.jQuery('.activatePeriodsSelection:last')).click();

(or something like that)

Otherwise the UI tests will keep failing:

      Evaluation failed: DOMException: Failed to execute 'querySelector' on 'Document': '.activatePeriodsSelection:last' is not a valid selector.

Or we could treat those "single module widget iframes" like the dashboard widgets and hide the duplicate controls. Adding and not isWidget to the showTableActionsInHeader template variable should do that well enough, and we can use the old selector again.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went with the and is not isWidget approach, let's see how that behaves.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, that didn't make any difference.

tests/UI/specs/EvolutionGraph_spec.js Outdated Show resolved Hide resolved
of moving the table actions to the top of the report for all reports, at which point the config for the report
can be renamed to show_header and show_header_icons
#}
{% set showTableActionsInHeader = properties.show_footer and properties.show_footer_icons %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{% set showTableActionsInHeader = properties.show_footer and properties.show_footer_icons %}
{% set showTableActionsInHeader = properties.show_footer and properties.show_footer_icons and not isWidget %}

I have not fully checked what more side effects this would have (other than the mentioned single widgets in EvolutionGraph_spec), but this would remove the slight layout change in the Dashboard_spec caused by some other CSS:

&:first-child {
padding-top:0;
}

@@ -50,6 +57,14 @@
{% if error is defined %}
<div vue-entry="CoreHome.Alert" severity="danger">{{ error.message }}</div>
{% else %}
{% if showTableActionsInHeader %}
<div class="row dataTableHeaderControls">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Live_spec tests have some selectors that get tripped by this new element:

var report = await page.$('.dataTableVizVisitorLog .card.row:first-child');

This would now need to be something like this:

var report = await page.jQuery('.dataTableVizVisitorLog .card.row:eq(1)');

And there are probably more selectors in that spec that need to be updated accordingly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't trip on this, as the Visits Log does not have a card on the top level, so the first row for the table controls is not within a card.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the selectors

@michalkleiner
Copy link
Contributor Author

Plugin PRs created

@michalkleiner michalkleiner requested review from mneudert and a team December 20, 2024 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Design / UI For issues that impact Matomo's user interface or the design overall. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants