diff options
author | dizzy <diosmosis@users.noreply.github.com> | 2021-12-06 11:41:35 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-06 11:41:35 +0300 |
commit | 5c8d34d665487955b78c506aa871661209b9d5e4 (patch) | |
tree | 530856c17031d4f0d3bea46aa4942e90093ce51d /plugins/CoreHome/angularjs | |
parent | c8208c7fffca58ddfdae30bd11faa2ca45c9dbf2 (diff) |
[Vue] migrate reportingPagesModel and reportMetadataModel (#18389)
* add broadcast.js to Installation workflow + do not fail in pk_translate if no translations are loaded
* update expected screenshots (spacing of arrow changed because of angularjs comment no longer being there)
* start moving Notification class code to notifications store
* fix prop type
* fix html escaping
* built vue files
* get toast and other transitions to work + fix broken toast
* move all of notification.js to NotificationStore
* wait for angular to be initialized to post events to avoid loading race condition
* get scroll to notification to work + get initialization of notification groups to work
* correct unmount + remove notifications service file
* fix some test failures
* re add accidentally removed (?) file
* remove no longer needed file
* Add CoreHome UMD in CoreUpdater/Installation.
* self review
* fix type + add default value
* remove file from JS list
* fix test
* fix UI tests
* set correct type in users manager notification and allow scope values to be transformed in createAngularAdapter
* start converting form field directives
* start migrating siteselector
* small addition
* migrate rest of site selector code + make some breaking changes to function signatures in createAngularJsAdapter
* disable webpack asset size hints/warnings + get siteselector code to build
* fixing some bugs
* fix some more issues (allow specifing require in createAngularJsAdapter and make AjaxHelper promises abortable)
* get npm test to pass
* a couple more fixes
* remove existing files
* convert quick-access directive and use shared code/state with site selector
* remove site selector model
* fix more issues and get UI tests to pass for quickaccess
* remove debugging code / todo
* fix initial value
* add back a $timeout()
* fixing tests, the post blur scope.$apply()s are apparently required for angularjs to function properly
* migrate field-array
* fixing more UI test failures
* rebuild
* start converting multipairfield
* fix vue build
* why were these deleted?
* remove debug code
* first pass migrate multipairfield.vue
* move form-field code relevant to selects to FieldSelect.vue
* fix css class issue + update expected screenshots
* rebuild CoreHome
* move more of form-field.directive.js to new vue classes
* revert styling change
* finish converting last of form-field.directive.js code (completely untested)
* built vue files
* get focus-if to work and remove debugging return;
* rebuilt vue
* should not need to specify type there
* built CoreHome
* built vue files
* Fix for misaligned evolution trend icons (#18323)
* Aligned evolution trend icons, text tweak
* Update plugins/MultiSites/angularjs/dashboard/dashboard.directive.less
Co-authored-by: Stefan Giehl <stefan@matomo.org>
* apply review feedback
* Hide feedback banner in zen mode (#18329)
* [Vue] 4.6.0 fixes (#18334)
* feedback plugin may not be loaded
* fix copy paste
* async/await not supported
* built UMDs
* get local files to build
* built files
* get auto clearing behavior to work in site selector
* fix a couple more bugs
* use jQuery click for expand on click
* undo submodule change
* rebuild vue
* get vue files to run
* missing element
* more fixes
* get more fields working properly
* rebuild
* fix even more issues
* [Vue] use jQuery click for expand on click (#18341)
* use jQuery click for expand on click
* undo submodule change
* migrate piwik-field directive and fix some issues
* forgot to add migrated directive files and get demo.twig to work
* use event target
* make sure angularjs and vue do not share data
* fix ng model mapping
* fix a couple more issues
* fix a couple more bugs
* more fixes
* mimic existing behavior where an empty value will result in an extra field appearing in a select option list, but only at first
* another fix
* built vue files
* more fixes
* do not use UMD if vue/src is not present
* use non-minified angularjs if in development mode
* deprecate custom template file property
* remove angularjs properties in scope properties (ie, $$hashKey) otherwise vue will fail when it tries to process them
* fixing some more issues from ui tests
* more fixes
* fix form field issue + patch jquery so .trigger() will also trigger events added via addEventHandler()
* true bc fix
* get the jquery patch to work
* ignore polyfill map
* fix ng-model issue in report limit in report export directive
* full width property was not handled properly before in angularjs
* do not try and parseInt null values
* fix several more issues for tests
* fix some tests
* fix data binding
* fix css class
* fixing more ui test issues
* do not decode model value of site name in site selector, so it is always the same as what is in the DB
* 4.6.0-rc2
* more ng-model fixes
* rebuild
* html tweaks
* add timeout to test
* rebuild
* fix another UI test
* rebuild vue files
* update some expected screenshots
* fix more issues
* Revert "[Vue] do not decode model value of site name in site selector, so it is always matches the DB value (#18356)"
This reverts commit 8c7539f073e7a49311cbe6dc2474eb1bbfb8718d.
* update screenshots
* more fixes
* another fix + screenshot update
* more screenshot updates
* more fixes
* even more fixes
* another ui test fix
* more type fixes
* rebuilt vue JS
* couple more fixes
* undo debugging
* do not convert undefined to bool
* update screenshot
* another bool checking fix
* rebuild vue files
* more fixes
* initial site value in field is assumed to be encoded
* file headers and custom field component support
* get custom component field code to work
* rebuild vue
* allow using angularjs templateFile for custom field (for BC)
* get angularjs template embedding to work for rollupreporting at least
* deal with some in source TODO items
* fix a couple more issues
* Use separate div in modals to display notifications otherwise Vue will erase modal content when initializing NotificationGroup component.
* build again
* refactor some code and fix an issue with checkbox array field handling in angularjs
* more fixes
* another fix
* even more fixes
* remove more todo
* hopefully the last changes
* update vue files
* update submodule
* revert debugging change + fix issue
* built vue files
* fix another select issue
* rebuild vue files
* fix broken refactor
* update two screenshots
* add some more timeouts and update screenshots
* initial conversion, loading w/o error
* tweaks
* get period selector work in UI
* fix site selector model binding
* rebuild vue
* fix viewDate not being kept in sync
* rebuild CoreHome
* two fixes
* couple UI test fixes
* rebuild vue
* update files
* make getRef a utility method
* add return type
* remove unused properties
* convert reporting pages service
* migrate report metadata store
* remove angularjs files
* make store adapters more immutable
* get service adapters to work
* fix a UI test
* another html fix
* Use themed font family for input forms to override materialize.css styling
* rebuild vue
* add a missing div
* ui test fixes
* update styling
* update expected screenshot
* add wait just in case travis is slow
* add another wait
* fix field array title
* apply some pr feedback
* apply more pr feedback
* another fix
* tweak
* fix ng-change not executed before ng-model
* fix another set of issues
* fix another issue
* rebuild vue
* better ng-change/ng-model fix
* initiate initial ng-change ONLY for site selectors where this behavior applies
* built vue files
* fix function signature
* fix vue warning
* fix ajax request race condition
* rebuild vue
* update screenshot
* revert submodule change
Co-authored-by: sgiehl <stefan@matomo.org>
Co-authored-by: Ben Burgess <88810029+bx80@users.noreply.github.com>
Co-authored-by: Matthieu Aubry <mattab@users.noreply.github.com>
Diffstat (limited to 'plugins/CoreHome/angularjs')
4 files changed, 3 insertions, 153 deletions
diff --git a/plugins/CoreHome/angularjs/common/services/report-metadata-model.js b/plugins/CoreHome/angularjs/common/services/report-metadata-model.js deleted file mode 100644 index 125989ee6e..0000000000 --- a/plugins/CoreHome/angularjs/common/services/report-metadata-model.js +++ /dev/null @@ -1,53 +0,0 @@ -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ -(function () { - angular.module('piwikApp.service').factory('reportMetadataModel', reportMetadataModel); - - reportMetadataModel.$inject = ['piwik', 'piwikApi']; - - function reportMetadataModel (piwik, piwikApi) { - - var reportsPromise = null; - - var model = { - reports: [], - fetchReportMetadata: fetchReportMetadata, - findReport: findReport - }; - - return model; - - function findReport(module, action) - { - var found = []; - - angular.forEach(model.reports, function (report) { - if (report.module === module && report.action === action) { - found = report; - } - }); - - return found; - } - - function fetchReportMetadata() - { - if (!reportsPromise) { - reportsPromise = piwikApi.fetch({ - method: 'API.getReportMetadata', - filter_limit: '-1', - idSite: piwik.idSite || piwik.broadcast.getValueFromUrl('idSite') - }).then(function (response) { - model.reports = response; - return response; - }); - } - - return reportsPromise; - } - } -})();
\ No newline at end of file diff --git a/plugins/CoreHome/angularjs/common/services/reporting-pages-model.js b/plugins/CoreHome/angularjs/common/services/reporting-pages-model.js deleted file mode 100644 index c135aad2c5..0000000000 --- a/plugins/CoreHome/angularjs/common/services/reporting-pages-model.js +++ /dev/null @@ -1,76 +0,0 @@ -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ -(function () { - angular.module('piwikApp.service').factory('reportingPagesModel', reportingPagesModelService); - - reportingPagesModelService.$inject = ['piwikApi']; - - function reportingPagesModelService (piwikApi) { - var fetchAllPagesPromise = false; - - // those sites are going to be displayed - var model = { - pages : [], - findPage: findPage, - findPageInCategory: findPageInCategory, - reloadAllPages : reloadAllPages, - getAllPages : getAllPages - }; - - return model; - - function findPageInCategory(categoryId) { - var found = null; - - angular.forEach(model.pages, function (page) { - // happens when user switches between sites, in this case check if the same category exists and if so, - // select first entry from that category - if (!found && page && - page.category && page.subcategory && - page.category.id === categoryId && page.subcategory.id) { - found = page; - } - }); - - return found; - } - - function findPage(categoryId, subcategoryId) - { - var found = null; - - angular.forEach(model.pages, function (page) { - if (!found && - page && - page.category && page.subcategory && - page.category.id === categoryId && ('' + page.subcategory.id) === subcategoryId) { - found = page; - } - }); - - return found; - } - - function reloadAllPages() - { - fetchAllPagesPromise = null; - return getAllPages(); - } - - function getAllPages() - { - if (!fetchAllPagesPromise) { - fetchAllPagesPromise = piwikApi.fetch({method: 'API.getReportPagesMetadata', filter_limit: '-1'}).then(function (response) { - model.pages = response; - return response; - }); - } - - return fetchAllPagesPromise; - } - } -})();
\ No newline at end of file diff --git a/plugins/CoreHome/angularjs/reporting-menu/reportingmenu.controller.js b/plugins/CoreHome/angularjs/reporting-menu/reportingmenu.controller.js index 949d85a9b0..6da7b0898a 100644 --- a/plugins/CoreHome/angularjs/reporting-menu/reportingmenu.controller.js +++ b/plugins/CoreHome/angularjs/reporting-menu/reportingmenu.controller.js @@ -139,7 +139,7 @@ $scope.loadCategory = function (category) { var UI = require('piwik/UI'); UI.Notification.prototype.remove('reportingmenu-help'); - + if (category.active) { category.active = false; } else { diff --git a/plugins/CoreHome/angularjs/reporting-page/reportingpage-model.js b/plugins/CoreHome/angularjs/reporting-page/reportingpage-model.js index 45228eacc2..e91b5053a7 100644 --- a/plugins/CoreHome/angularjs/reporting-page/reportingpage-model.js +++ b/plugins/CoreHome/angularjs/reporting-page/reportingpage-model.js @@ -10,17 +10,12 @@ reportingPageModelService.$inject = ['$filter', 'reportingPagesModel', 'reportMetadataModel']; function reportingPageModelService ($filter, reportingPagesModel, reportMetadataModel) { - var init = false; - // those sites are going to be displayed var model = { fetchPage: fetchPage, resetPage: resetPage, widgets: [], page: null, - pageContentUrl: '', - evolutionReports: [], - sparklineReports: [] }; return model; @@ -29,9 +24,6 @@ { model.page = null; model.widgets = []; - model.pageContentUrl = ''; - model.evolutionReports = []; - model.sparklineReports = []; } function sortWidgets(widgets) @@ -61,8 +53,6 @@ } var widgets = []; - var evolutionReports = []; - var sparklineReports = []; var reportsToIgnore = []; angular.forEach(page.widgets, function (widget) { @@ -113,20 +103,9 @@ } var copyWidgets = angular.copy(groupedWidgets); - var copyEvolution = angular.copy(evolutionReports); - var copySparklines = angular.copy(sparklineReports); - - if (copyEvolution.length) { - copyEvolution = markWidgetsInFirstRowOfPage(copyEvolution); - } else if (copySparklines.length) { - copySparklines = markWidgetsInFirstRowOfPage(copySparklines); - } else { - copyWidgets = markWidgetsInFirstRowOfPage(copyWidgets); - } + copyWidgets = markWidgetsInFirstRowOfPage(copyWidgets); // angular.copy forces the page to re-render. Otherwise it won't reload some pages - model.evolutionReports = copyEvolution; - model.sparklineReports = copySparklines; model.widgets = copyWidgets; } @@ -191,4 +170,4 @@ }); } } -})();
\ No newline at end of file +})(); |