From e61c632df9338e0aaedbdfe1544b0ed31fedad65 Mon Sep 17 00:00:00 2001 From: Stefan Giehl Date: Mon, 23 Apr 2018 22:56:58 +0200 Subject: [PATCH] Discard idGoal parameter for row evolution in goal visualizations (#12378) * Discard idGoal parameter for row evolution in goal visualizations * Adds UI test --- plugins/CoreHome/javascripts/dataTable_rowactions.js | 7 +++++++ ...IIntegrationTest_goals_individual_row_evolution.png | 3 +++ tests/UI/specs/UIIntegration_spec.js | 10 ++++++++++ 3 files changed, 20 insertions(+) create mode 100644 tests/UI/expected-screenshots/UIIntegrationTest_goals_individual_row_evolution.png diff --git a/plugins/CoreHome/javascripts/dataTable_rowactions.js b/plugins/CoreHome/javascripts/dataTable_rowactions.js index f8dfaefb2d4..9b155704444 100644 --- a/plugins/CoreHome/javascripts/dataTable_rowactions.js +++ b/plugins/CoreHome/javascripts/dataTable_rowactions.js @@ -413,6 +413,13 @@ DataTable_RowActions_RowEvolution.prototype.showRowEvolution = function (apiMeth } } + if (self.dataTable.jsViewDataTable === 'tableGoals') { + // remove idGoal param, when it's set for goal visualizations + if (extraParams['idGoal']) { + delete(extraParams['idGoal']); + } + } + $.extend(requestParams, extraParams); var ajaxRequest = new ajaxHelper(); diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_goals_individual_row_evolution.png b/tests/UI/expected-screenshots/UIIntegrationTest_goals_individual_row_evolution.png new file mode 100644 index 00000000000..0e69c9eab60 --- /dev/null +++ b/tests/UI/expected-screenshots/UIIntegrationTest_goals_individual_row_evolution.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8e7095535c139953ee76f09a037a0600366b61c1c816b4d5dcf2112f5154a4ac +size 64675 diff --git a/tests/UI/specs/UIIntegration_spec.js b/tests/UI/specs/UIIntegration_spec.js index 80f63f2f3ad..8dbbc238b52 100644 --- a/tests/UI/specs/UIIntegration_spec.js +++ b/tests/UI/specs/UIIntegration_spec.js @@ -317,6 +317,16 @@ describe("UIIntegrationTest", function () { // TODO: Rename to Piwik? }, done); }); + // should load the row evolution [see #11526] + it('should show rov evolution for goal tables', function (done) { + expect.screenshot('goals_individual_row_evolution').to.be.captureSelector('.ui-dialog', function (page) { + page.mouseMove('table.dataTable tbody tr:first-child'); + page.mouseMove('a.actionRowEvolution:visible'); // necessary to get popover to display + page.click('a.actionRowEvolution:visible'); + page.wait(2000); + }, done); + }); + // Events pages it('should load the Events > index page correctly', function (done) { expect.screenshot('events_overview').to.be.captureSelector('.pageWrap,.dataTable', function (page) {