diff options
author | dizzy <diosmosis@users.noreply.github.com> | 2022-03-04 20:56:15 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-04 20:56:15 +0300 |
commit | 27faa3d8c008c97556a3ef27decd706d34b79a1a (patch) | |
tree | 782fc64cd6a6e4cbd6da365f478a90d2237cc394 /plugins | |
parent | b774954679f99ef190b9ef71043529563f764946 (diff) |
[Vue] Migrate Dashboard directive/model to Vue (#18883)
* get outputted typings to be used when compiling other plugins and fix typescript issues in CorePluginsAdmin
* readd corehome umd
* fix typescript errors in ExampleVue plugin
* fix feedback typescript errors
* rebuild
* migrate branding controller and get to build
* fix issues and get to work
* rebuild
* fix notification scroll
* migrate smtp settings controller in coreadminhome
* get to work
* migrate js tracking code generator and get to build
* migrate image tracking code generator and get to build
* get to work in UI
* get UI tests to pass locally
* forgot to add files + rebuild vue
* update screenshots
* Show a summary of new features (#18065)
* Added "What is new" notification display, populated by a new event
* Removed test example event hook
* Added support for applying a link attribute to menu items, fixes layout issue for mobile with html menu items
* Updated UI test screenshots
* Revert accidental edit
* Hide the "What's new" icon if there are no new features to show
* Changed to use changes.json, track user last viewed, added ui test
* Fix UserManager unit tests broken by new ts_changes_viewed user field
* Moved getChanges to separate helper class, added unit test, added user view access check
* Updated to add new changes table and populate only on plugin update/install
* Added missing fixture class, updated UI screenshots
* Updated matomo font to add ringing bell and new releases icons
* Fix for integration test
* Reworked class structure, removed unnecessary angular directive, merged templates, other tidy ups
* built vue files
* built vue files
* Added null user check, missing table exception handling, show plugin name in change title, better handling of missing change fields
* Added sample changes file, moved UserChanges db code to changes model, added return type hints, better db error code handling, various other improvements
* Revert accidental UI screenshot commit
* Fix for incorrect link name parameter in sample changes, switched back to using $db->query for INSERT IGNORE
* Integration test fix, UI screenshot updates
* Test fix
* Added link styling, show CoreHome changes without plugin prefix in title
* Update UI test screenshot
* Added styles to the popover, added event for filtering changes
* Test fix
* UI test screenshot updates
Co-authored-by: sgiehl <stefan@matomo.org>
Co-authored-by: bx80 <bx80@users.noreply.github.com>
* Update test translation (#18531)
update a test failed XML
* updates all submodules (#18541)
Co-authored-by: diosmosis <diosmosis@users.noreply.github.com>
* Translations update from Hosted Weblate (#18529)
* Translated using Weblate (Greek)
Currently translated at 100.0% (162 of 162 strings)
Translation: Matomo/Plugin CoreAdminHome
Translate-URL: https://hosted.weblate.org/projects/matomo/plugin-coreadminhome/el/
[ci skip]
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Vasilis Lourdas <dev@lourdas.eu>
* Translated using Weblate (Chinese (Simplified))
Currently translated at 83.9% (136 of 162 strings)
Translation: Matomo/Plugin CoreAdminHome
Translate-URL: https://hosted.weblate.org/projects/matomo/plugin-coreadminhome/zh_Hans/
[ci skip]
Translated using Weblate (Chinese (Simplified))
Currently translated at 99.6% (620 of 622 strings)
Translation: Matomo/Matomo Base
Translate-URL: https://hosted.weblate.org/projects/matomo/matomo-base/zh_Hans/
[ci skip]
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: 刘韬 <lyuutau@outlook.com>
* Update translation files
Updated by "Squash Git commits" hook in Weblate.
Translation: Matomo/Plugin CoreAdminHome
Translate-URL: https://hosted.weblate.org/projects/matomo/plugin-coreadminhome/
[ci skip]
Co-authored-by: Vasilis Lourdas <dev@lourdas.eu>
Co-authored-by: 刘韬 <lyuutau@outlook.com>
* [Vue] migrate report export directive and popover (#18440)
* update files
* sidenav start
* make getRef a utility method
* tweak
* add return type
* finish converting side-nav directive
* starting on reporting menu conversion
* remove unused properties
* convert reporting pages service
* migrate report metadata store
* remove angularjs files
* migrating reporting pages store
* make store adapters more immutable
* get service adapters to work
* fix a UI test
* another html fix
* migrate most of reporting menu directive and model
* Use themed font family for input forms to override materialize.css styling
* rebuild vue
* add a missing div
* ui test fixes
* update styling
* get to build
* get to load in the UI w/o error
* clone result of functions
* fix compile issue
* migrate widget loader and get to load in UI
* rebuild vue
* migrate widgetcontainer
* migrate widget bydimension container
* migrate widget + add tooltips directive
* quick fix
* Updating version to 4.6.0
* loading in page
* update expected screenshot
* add wait just in case travis is slow
* fix ordering bug
* add another wait
* rebuild vue
* css tweak
* fix some bugs and tests
* undo screenshot changes
* Menus test passing locally
* [Vue] date picker viewDate property is not kept up to date (#18385)
* viewDate ref is not kept up to date
* rebuild corehome
* reporting menu subcategory items are meant to be normal links
* update some screenshots
* use innerText instead of text() since angularjs maintains newlines in HTML that vue does not add
* trigger angularjs digest after ajaxhelper request
* rebuild vue
* update screenshots, fix bug in link generation in reporting menu and allow syncing multiple screenshot regexes at a time
* undo box-shadow change for UI tests
* fix more issues & update more tests
* update some screenshots
* fix some tests
* rebuild CoreHome
* quick fix
* built vue files
* fix angularjs issue
* add comment
* update umd files
* 4.6.1-rc1
* 4.6.1
* 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
* update some screenshots
* rebuild vue
* remove some TODOs
* initiate initial ng-change ONLY for site selectors where this behavior applies
* emit/broadcast on correct scope in wrapper
* rebuild vue
* fix some issues
* couple more fixes
* fix another title issue
* rebuild vue
* do not report on ajax errors in notifications if not logged in
* migrate reporting page and model
* rebuild vue
* create sites selector model adapter
* fix siteselector vue bug, initial site is only set if there is just one site available
* rebuild vue
* migrate plugin settings directive
* remove TODO
* migrate plugin filter directive
* migrate two more plugins directives
* migrate save button
* fix a bunch of bugs
* fix another widget bug
* allow change event name between angularjs and vue
* rebuild vue
* migrate plugin form directive
* get to work
* migrate select-on-focus directive and start migrating report-export directive
* finish migrating report export directive & popover component + create reusable function to create vue app and add globals to it
* rebuild vue
* remove angularjs files and move less contents to vue dir
* built vue files
* fix function signature
* fix vue warning
* fix ajax request race condition
* rebuild vue
* add new notification type "help" so the help notification is not cleared when clearing transient notifications
* fix some bugs and tests
* update screenshot
* update screenshot & fix a test
* allow using unminified jquery ui + fix bug in last fix
* fix error when enrichedheadline is used in modal
* add polyfill min.js
* remove two todos
* fix widget url logic
* update some screenshots and fix sanitization/escape issue
* update screenshots
* rebuild vue
* fix url location updating regression in MatomoUrl.updateLocation use
* submodule
* update screenshots and fix possible error in json parse
* built vue files
* Merge branch 'vue-period-selector-regression' into vue-reporting-menu
* rebuild vue
* use correct variable
* rebuild vue
* fix widget url logic
* segment parameter can be undefined now for some reason
* fix ngmodel binding in siteselector adapter (for last time hopefully)
* the original site selector only set the first site to the first site in the initial sites query if there was only one site in the entire matomo instance
* fix sitesmanager ui test failure
* fix usersettings test failure
* rebuild vue
* more siteselector tweaks.
* build CoreHome
* more siteselector tweaks.
* another siteselector issue
* update screenshots
* update screenshot and try to fix random failure
* fix some issues in widget.vue when containerid is specified
* fix couple tests
* fix several test failures
* fix string concat
* fix test failure
* extra change
* fix last change and random failure
* styling fix
* fix last fix
* real fix this time
* fix stray request
* proper fix
* update build files
* try to fix random failure
* do not submit form
* check for api errors in promise chain in ajaxhelper.ts
* force a digest after a location change
* use proper abortcontroller method instead of promise hack, have to add new polyfill + try to fix random test failure
* some UI test fixes
* fix some report export issues
* several save button fixes + make replace approximation in createAngularJsAdapter better
* apply after manual click triggering in savebutton
* add names to divs so they can still be queried as they were in angularjs
* rebuild vue
* now that format_metrics checkbox works, need to check it
* fix unintended changes
* updated expected screenshots
* update two more
* go back to previous format_metrics behavior in popover
Co-authored-by: Justin Velluppillai <justin@innocraft.com>
Co-authored-by: justinvelluppillai <justinvelluppillai@users.noreply.github.com>
Co-authored-by: Matthieu Aubry <mattab@users.noreply.github.com>
* [Vue] remove support in vue for FormField.allSettings (#18542)
* deprecate support in vue for FormField.allSettings since deep watching the property doesnt quite work
* built vue files
* update screenshots
* update screenshot
* Show a summary of new features (#18065)
* Added "What is new" notification display, populated by a new event
* Removed test example event hook
* Added support for applying a link attribute to menu items, fixes layout issue for mobile with html menu items
* Updated UI test screenshots
* Revert accidental edit
* Hide the "What's new" icon if there are no new features to show
* Changed to use changes.json, track user last viewed, added ui test
* Fix UserManager unit tests broken by new ts_changes_viewed user field
* Moved getChanges to separate helper class, added unit test, added user view access check
* Updated to add new changes table and populate only on plugin update/install
* Added missing fixture class, updated UI screenshots
* Updated matomo font to add ringing bell and new releases icons
* Fix for integration test
* Reworked class structure, removed unnecessary angular directive, merged templates, other tidy ups
* built vue files
* built vue files
* Added null user check, missing table exception handling, show plugin name in change title, better handling of missing change fields
* Added sample changes file, moved UserChanges db code to changes model, added return type hints, better db error code handling, various other improvements
* Revert accidental UI screenshot commit
* Fix for incorrect link name parameter in sample changes, switched back to using $db->query for INSERT IGNORE
* Integration test fix, UI screenshot updates
* Test fix
* Added link styling, show CoreHome changes without plugin prefix in title
* Update UI test screenshot
* Added styles to the popover, added event for filtering changes
* Test fix
* UI test screenshot updates
Co-authored-by: sgiehl <stefan@matomo.org>
Co-authored-by: bx80 <bx80@users.noreply.github.com>
* Update test translation (#18531)
update a test failed XML
* updates all submodules (#18541)
Co-authored-by: diosmosis <diosmosis@users.noreply.github.com>
* Translations update from Hosted Weblate (#18529)
* Translated using Weblate (Greek)
Currently translated at 100.0% (162 of 162 strings)
Translation: Matomo/Plugin CoreAdminHome
Translate-URL: https://hosted.weblate.org/projects/matomo/plugin-coreadminhome/el/
[ci skip]
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Vasilis Lourdas <dev@lourdas.eu>
* Translated using Weblate (Chinese (Simplified))
Currently translated at 83.9% (136 of 162 strings)
Translation: Matomo/Plugin CoreAdminHome
Translate-URL: https://hosted.weblate.org/projects/matomo/plugin-coreadminhome/zh_Hans/
[ci skip]
Translated using Weblate (Chinese (Simplified))
Currently translated at 99.6% (620 of 622 strings)
Translation: Matomo/Matomo Base
Translate-URL: https://hosted.weblate.org/projects/matomo/matomo-base/zh_Hans/
[ci skip]
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: 刘韬 <lyuutau@outlook.com>
* Update translation files
Updated by "Squash Git commits" hook in Weblate.
Translation: Matomo/Plugin CoreAdminHome
Translate-URL: https://hosted.weblate.org/projects/matomo/plugin-coreadminhome/
[ci skip]
Co-authored-by: Vasilis Lourdas <dev@lourdas.eu>
Co-authored-by: 刘韬 <lyuutau@outlook.com>
* [Vue] migrate report export directive and popover (#18440)
* update files
* sidenav start
* make getRef a utility method
* tweak
* add return type
* finish converting side-nav directive
* starting on reporting menu conversion
* remove unused properties
* convert reporting pages service
* migrate report metadata store
* remove angularjs files
* migrating reporting pages store
* make store adapters more immutable
* get service adapters to work
* fix a UI test
* another html fix
* migrate most of reporting menu directive and model
* Use themed font family for input forms to override materialize.css styling
* rebuild vue
* add a missing div
* ui test fixes
* update styling
* get to build
* get to load in the UI w/o error
* clone result of functions
* fix compile issue
* migrate widget loader and get to load in UI
* rebuild vue
* migrate widgetcontainer
* migrate widget bydimension container
* migrate widget + add tooltips directive
* quick fix
* Updating version to 4.6.0
* loading in page
* update expected screenshot
* add wait just in case travis is slow
* fix ordering bug
* add another wait
* rebuild vue
* css tweak
* fix some bugs and tests
* undo screenshot changes
* Menus test passing locally
* [Vue] date picker viewDate property is not kept up to date (#18385)
* viewDate ref is not kept up to date
* rebuild corehome
* reporting menu subcategory items are meant to be normal links
* update some screenshots
* use innerText instead of text() since angularjs maintains newlines in HTML that vue does not add
* trigger angularjs digest after ajaxhelper request
* rebuild vue
* update screenshots, fix bug in link generation in reporting menu and allow syncing multiple screenshot regexes at a time
* undo box-shadow change for UI tests
* fix more issues & update more tests
* update some screenshots
* fix some tests
* rebuild CoreHome
* quick fix
* built vue files
* fix angularjs issue
* add comment
* update umd files
* 4.6.1-rc1
* 4.6.1
* 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
* update some screenshots
* rebuild vue
* remove some TODOs
* initiate initial ng-change ONLY for site selectors where this behavior applies
* emit/broadcast on correct scope in wrapper
* rebuild vue
* fix some issues
* couple more fixes
* fix another title issue
* rebuild vue
* do not report on ajax errors in notifications if not logged in
* migrate reporting page and model
* rebuild vue
* create sites selector model adapter
* fix siteselector vue bug, initial site is only set if there is just one site available
* rebuild vue
* migrate plugin settings directive
* remove TODO
* migrate plugin filter directive
* migrate two more plugins directives
* migrate save button
* fix a bunch of bugs
* fix another widget bug
* allow change event name between angularjs and vue
* rebuild vue
* migrate plugin form directive
* get to work
* migrate select-on-focus directive and start migrating report-export directive
* finish migrating report export directive & popover component + create reusable function to create vue app and add globals to it
* rebuild vue
* remove angularjs files and move less contents to vue dir
* built vue files
* fix function signature
* fix vue warning
* fix ajax request race condition
* rebuild vue
* add new notification type "help" so the help notification is not cleared when clearing transient notifications
* fix some bugs and tests
* update screenshot
* update screenshot & fix a test
* allow using unminified jquery ui + fix bug in last fix
* fix error when enrichedheadline is used in modal
* add polyfill min.js
* remove two todos
* fix widget url logic
* update some screenshots and fix sanitization/escape issue
* update screenshots
* rebuild vue
* fix url location updating regression in MatomoUrl.updateLocation use
* submodule
* update screenshots and fix possible error in json parse
* built vue files
* Merge branch 'vue-period-selector-regression' into vue-reporting-menu
* rebuild vue
* use correct variable
* rebuild vue
* fix widget url logic
* segment parameter can be undefined now for some reason
* fix ngmodel binding in siteselector adapter (for last time hopefully)
* the original site selector only set the first site to the first site in the initial sites query if there was only one site in the entire matomo instance
* fix sitesmanager ui test failure
* fix usersettings test failure
* rebuild vue
* more siteselector tweaks.
* build CoreHome
* more siteselector tweaks.
* another siteselector issue
* update screenshots
* update screenshot and try to fix random failure
* fix some issues in widget.vue when containerid is specified
* fix couple tests
* fix several test failures
* fix string concat
* fix test failure
* extra change
* fix last change and random failure
* styling fix
* fix last fix
* real fix this time
* fix stray request
* proper fix
* update build files
* try to fix random failure
* do not submit form
* check for api errors in promise chain in ajaxhelper.ts
* force a digest after a location change
* use proper abortcontroller method instead of promise hack, have to add new polyfill + try to fix random test failure
* some UI test fixes
* fix some report export issues
* several save button fixes + make replace approximation in createAngularJsAdapter better
* apply after manual click triggering in savebutton
* add names to divs so they can still be queried as they were in angularjs
* rebuild vue
* now that format_metrics checkbox works, need to check it
* fix unintended changes
* updated expected screenshots
* update two more
* go back to previous format_metrics behavior in popover
Co-authored-by: Justin Velluppillai <justin@innocraft.com>
Co-authored-by: justinvelluppillai <justinvelluppillai@users.noreply.github.com>
Co-authored-by: Matthieu Aubry <mattab@users.noreply.github.com>
* [Vue] remove support in vue for FormField.allSettings (#18542)
* deprecate support in vue for FormField.allSettings since deep watching the property doesnt quite work
* built vue files
* update screenshots
* update screenshot
* fix tests
* rebuild
* rebuild
* order plugins by dependencies in vue:build and fix warning in corehome build
* built vue files
* built vue files
* remove unused imports
* built vue files
* remove multilinefield component, fieldtextareaarray does the same thing
* edit-trigger is not used anywhere
* migrate sitetypes model to store
* do not load nonexistant files
* remove reference nonexistant files
* start converting sitefields component
* more work on sitefields component
* undo submodule change
* rebuild
* get sitesmanager to build
* get SiteFields component to work in UI
* datepicker does not format times
* export other stores
* fix some typing issues and rebuild
* start on site management conversion
* add more comma delimited props to list + remove controller JS
* rebuild
* convert sites manager controller to sitesmanagement component
* remove TODOs
* finish migrating sitesmanager
* remove some TODO
* get to build
* fixes from testing
* rebuild
* rebuild and fix issue w/ globalsettings hash detection
* migrate capabilities-edit component.
* some fixes and get to build
* get to work
* built vue files
* get to work and rebuild
* migrate user edit form component
* some fixes
* fixes
* another fix
* more fixes
* update file
* more fixes
* fix ref
* rebuild vue
* couple more fixes
* migrate paged users list and get to build
* fixing issues
* workaround vue issue w/ directives that modify css classes on elements that also bind to :class
* dropdownmenu directive should be aware of data-target parameter that is required by materialize
* handle disabled options in fieldselect
* fix issues and rebuild vue
* migrate usersmanager component and get to build
* forgot to add files, fix some issues + rebuild
* migrate usersmanager controllers and twig template parts
* fix compile issues and get to build
* fix issues and rebuild
* fix bug and rebuild
* fix bug and rebuild
* fix issue
* fix issues and rebuild
* fix ui test
* fix UI test failure
* fixing some issues
* complete fixes
* fix some more issues
* fix ui test failures
* another fix
* several more fixes
* fix delete dialog
* more fixes
* fix styling issue
* more fixes
* fix another ui test + update other UI tests
* fixing edisiteid handling
* update screenshots
* fix UI tests somre more
* fix random failure
* fixes
* reference css class not attribute (since that is what is added in vue)
* fixing more ui tests
* try to fix vue css class in directive issue
* tweak
* in groupedsetting handle templateFile property for angularjs BC
* rebuild vue
* fix view tracking code link
* fixing UI tests
* fix selector in test for this branch only
* Update screenshot.
* update screenshot
* update screenshots
* style fix
* fix selectors and update screenshot
* built vue files
* Update screenshot + fix title and spacing.
* fix password changing
* fixing tests
* fix more issues
* fix styling
* built vue files
* more fixes
* more styling fixes
* more fixes
* Fix tests locally.
* Fixing more issues + getting UI tests to pass locally.
* update tagmanger module?
* fix UI tests
* remove unneeded event
* update screenshots
* start migrating series-picker
* get series picker component to work
* start migrating single metric view
* update style
* fix some issues
* get to work in UI
* fix percent evolution
* more migrating
* more changes
* migrate dashboard angularjs directives and get to work in the UI
* fix ajax loading race condition
* fix scope.fetchDashboard call and ui test random failures (hopefully)
* try fixing travis-ci failures
* rebuild
* rebuild CoreHome
* undo test change and fix another race condition
* remove TODO
* Update plugins/Dashboard/tests/UI/Dashboard_spec.js
Co-authored-by: Stefan Giehl <stefan@matomo.org>
Co-authored-by: Ben Burgess <88810029+bx80@users.noreply.github.com>
Co-authored-by: sgiehl <stefan@matomo.org>
Co-authored-by: bx80 <bx80@users.noreply.github.com>
Co-authored-by: Peter Zhang <peter@innocraft.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Weblate (bot) <hosted@weblate.org>
Co-authored-by: Vasilis Lourdas <dev@lourdas.eu>
Co-authored-by: 刘韬 <lyuutau@outlook.com>
Co-authored-by: Justin Velluppillai <justin@innocraft.com>
Co-authored-by: justinvelluppillai <justinvelluppillai@users.noreply.github.com>
Co-authored-by: Matthieu Aubry <mattab@users.noreply.github.com>
Diffstat (limited to 'plugins')
32 files changed, 962 insertions, 350 deletions
diff --git a/plugins/CoreHome/vue/dist/CoreHome.umd.js b/plugins/CoreHome/vue/dist/CoreHome.umd.js index 7c6549707e..34fe8f7c03 100644 --- a/plugins/CoreHome/vue/dist/CoreHome.umd.js +++ b/plugins/CoreHome/vue/dist/CoreHome.umd.js @@ -9877,9 +9877,9 @@ WidgetLoadervue_type_script_lang_ts.render = WidgetLoadervue_type_template_id_64 }, directiveName: 'piwikWidgetLoader' })); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/WidgetContainer/WidgetContainer.vue?vue&type=template&id=3b62b118 +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/WidgetContainer/WidgetContainer.vue?vue&type=template&id=41745e0f -function WidgetContainervue_type_template_id_3b62b118_render(_ctx, _cache, $props, $setup, $data, $options) { +function WidgetContainervue_type_template_id_41745e0f_render(_ctx, _cache, $props, $setup, $data, $options) { var _component_Widget = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("Widget"); return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", null, [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.actualContainer, function (widget, index) { @@ -9891,7 +9891,7 @@ function WidgetContainervue_type_template_id_3b62b118_render(_ctx, _cache, $prop }, null, 8, ["widget"])])]); }), 128))]); } -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/WidgetContainer/WidgetContainer.vue?vue&type=template&id=3b62b118 +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/WidgetContainer/WidgetContainer.vue?vue&type=template&id=41745e0f // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/WidgetContainer/WidgetContainer.vue?vue&type=script&lang=ts function WidgetContainervue_type_script_lang_ts_toConsumableArray(arr) { return WidgetContainervue_type_script_lang_ts_arrayWithoutHoles(arr) || WidgetContainervue_type_script_lang_ts_iterableToArray(arr) || WidgetContainervue_type_script_lang_ts_unsupportedIterableToArray(arr) || WidgetContainervue_type_script_lang_ts_nonIterableSpread(); } @@ -9959,7 +9959,7 @@ var Widget = useExternalPluginComponent('CoreHome', 'Widget'); -WidgetContainervue_type_script_lang_ts.render = WidgetContainervue_type_template_id_3b62b118_render +WidgetContainervue_type_script_lang_ts.render = WidgetContainervue_type_template_id_41745e0f_render /* harmony default export */ var WidgetContainer = (WidgetContainervue_type_script_lang_ts); // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/WidgetContainer/WidgetContainer.adapter.ts @@ -9980,37 +9980,37 @@ WidgetContainervue_type_script_lang_ts.render = WidgetContainervue_type_template }, directiveName: 'piwikWidgetContainer' })); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/WidgetByDimensionContainer/WidgetByDimensionContainer.vue?vue&type=template&id=2a665f7d +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/WidgetByDimensionContainer/WidgetByDimensionContainer.vue?vue&type=template&id=3681f928 -var WidgetByDimensionContainervue_type_template_id_2a665f7d_hoisted_1 = { +var WidgetByDimensionContainervue_type_template_id_3681f928_hoisted_1 = { class: "reportsByDimensionView" }; -var WidgetByDimensionContainervue_type_template_id_2a665f7d_hoisted_2 = { +var WidgetByDimensionContainervue_type_template_id_3681f928_hoisted_2 = { class: "entityList" }; -var WidgetByDimensionContainervue_type_template_id_2a665f7d_hoisted_3 = { +var WidgetByDimensionContainervue_type_template_id_3681f928_hoisted_3 = { class: "listCircle" }; -var WidgetByDimensionContainervue_type_template_id_2a665f7d_hoisted_4 = ["onClick"]; -var WidgetByDimensionContainervue_type_template_id_2a665f7d_hoisted_5 = { +var WidgetByDimensionContainervue_type_template_id_3681f928_hoisted_4 = ["onClick"]; +var WidgetByDimensionContainervue_type_template_id_3681f928_hoisted_5 = { class: "dimension" }; -var WidgetByDimensionContainervue_type_template_id_2a665f7d_hoisted_6 = { +var WidgetByDimensionContainervue_type_template_id_3681f928_hoisted_6 = { class: "reportContainer" }; -var WidgetByDimensionContainervue_type_template_id_2a665f7d_hoisted_7 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { +var WidgetByDimensionContainervue_type_template_id_3681f928_hoisted_7 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { class: "clear" }, null, -1); -function WidgetByDimensionContainervue_type_template_id_2a665f7d_render(_ctx, _cache, $props, $setup, $data, $options) { +function WidgetByDimensionContainervue_type_template_id_3681f928_render(_ctx, _cache, $props, $setup, $data, $options) { var _component_WidgetLoader = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("WidgetLoader"); - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", WidgetByDimensionContainervue_type_template_id_2a665f7d_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", WidgetByDimensionContainervue_type_template_id_2a665f7d_hoisted_2, [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.widgetsByCategory, function (category) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", WidgetByDimensionContainervue_type_template_id_3681f928_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", WidgetByDimensionContainervue_type_template_id_3681f928_hoisted_2, [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.widgetsByCategory, function (category) { return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", { class: "dimensionCategory", key: category.name - }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(category.name) + " ", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", WidgetByDimensionContainervue_type_template_id_2a665f7d_hoisted_3, [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(category.widgets, function (widget) { + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(category.name) + " ", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", WidgetByDimensionContainervue_type_template_id_3681f928_hoisted_3, [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(category.widgets, function (widget) { return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("li", { class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["reportDimension", { activeDimension: _ctx.selectedWidget.uniqueId === widget.uniqueId @@ -10019,15 +10019,15 @@ function WidgetByDimensionContainervue_type_template_id_2a665f7d_render(_ctx, _c onClick: function onClick($event) { return _ctx.selectWidget(widget); } - }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", WidgetByDimensionContainervue_type_template_id_2a665f7d_hoisted_5, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(widget.name), 1)], 10, WidgetByDimensionContainervue_type_template_id_2a665f7d_hoisted_4); + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", WidgetByDimensionContainervue_type_template_id_3681f928_hoisted_5, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(widget.name), 1)], 10, WidgetByDimensionContainervue_type_template_id_3681f928_hoisted_4); }), 128))])]); - }), 128))]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", WidgetByDimensionContainervue_type_template_id_2a665f7d_hoisted_6, [_ctx.selectedWidget.parameters ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(_component_WidgetLoader, { + }), 128))]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", WidgetByDimensionContainervue_type_template_id_3681f928_hoisted_6, [_ctx.selectedWidget.parameters ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(_component_WidgetLoader, { key: 0, "widget-params": _ctx.selectedWidget.parameters, class: "dimensionReport" - }, null, 8, ["widget-params"])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)]), WidgetByDimensionContainervue_type_template_id_2a665f7d_hoisted_7]); + }, null, 8, ["widget-params"])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)]), WidgetByDimensionContainervue_type_template_id_3681f928_hoisted_7]); } -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/WidgetByDimensionContainer/WidgetByDimensionContainer.vue?vue&type=template&id=2a665f7d +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/WidgetByDimensionContainer/WidgetByDimensionContainer.vue?vue&type=template&id=3681f928 // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/WidgetByDimensionContainer/WidgetByDimensionContainer.vue?vue&type=script&lang=ts function WidgetByDimensionContainervue_type_script_lang_ts_slicedToArray(arr, i) { return WidgetByDimensionContainervue_type_script_lang_ts_arrayWithHoles(arr) || WidgetByDimensionContainervue_type_script_lang_ts_iterableToArrayLimit(arr, i) || WidgetByDimensionContainervue_type_script_lang_ts_unsupportedIterableToArray(arr, i) || WidgetByDimensionContainervue_type_script_lang_ts_nonIterableRest(); } @@ -10103,7 +10103,7 @@ function WidgetByDimensionContainervue_type_script_lang_ts_arrayWithHoles(arr) { -WidgetByDimensionContainervue_type_script_lang_ts.render = WidgetByDimensionContainervue_type_template_id_2a665f7d_render +WidgetByDimensionContainervue_type_script_lang_ts.render = WidgetByDimensionContainervue_type_template_id_3681f928_render /* harmony default export */ var WidgetByDimensionContainer = (WidgetByDimensionContainervue_type_script_lang_ts); // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/WidgetByDimensionContainer/WidgetByDimensionContainer.adapter.ts @@ -10127,16 +10127,16 @@ WidgetByDimensionContainervue_type_script_lang_ts.render = WidgetByDimensionCont }, directiveName: 'piwikWidgetByDimensionContainer' })); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/Widget/Widget.vue?vue&type=template&id=4f52b268 +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/Widget/Widget.vue?vue&type=template&id=23f53472 -var Widgetvue_type_template_id_4f52b268_hoisted_1 = ["id"]; -var Widgetvue_type_template_id_4f52b268_hoisted_2 = { +var Widgetvue_type_template_id_23f53472_hoisted_1 = ["id"]; +var Widgetvue_type_template_id_23f53472_hoisted_2 = { key: 1 }; -var Widgetvue_type_template_id_4f52b268_hoisted_3 = { +var Widgetvue_type_template_id_23f53472_hoisted_3 = { key: 2 }; -function Widgetvue_type_template_id_4f52b268_render(_ctx, _cache, $props, $setup, $data, $options) { +function Widgetvue_type_template_id_23f53472_render(_ctx, _cache, $props, $setup, $data, $options) { var _component_WidgetLoader = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("WidgetLoader"); var _component_WidgetContainer = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("WidgetContainer"); @@ -10155,15 +10155,15 @@ function Widgetvue_type_template_id_4f52b268_render(_ctx, _cache, $props, $setup key: 0, "widget-params": _ctx.actualWidget.parameters, "widget-name": _ctx.actualWidget.name - }, null, 8, ["widget-params", "widget-name"])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.actualWidget.isContainer && _ctx.actualWidget.layout !== 'ByDimension' && !this.preventRecursion ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", Widgetvue_type_template_id_4f52b268_hoisted_2, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_WidgetContainer, { + }, null, 8, ["widget-params", "widget-name"])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.actualWidget.isContainer && _ctx.actualWidget.layout !== 'ByDimension' && !this.preventRecursion ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", Widgetvue_type_template_id_23f53472_hoisted_2, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_WidgetContainer, { container: _ctx.actualWidget.widgets - }, null, 8, ["container"])])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.actualWidget.isContainer && _ctx.actualWidget.layout === 'ByDimension' ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", Widgetvue_type_template_id_4f52b268_hoisted_3, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_WidgetByDimensionContainer, { + }, null, 8, ["container"])])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.actualWidget.isContainer && _ctx.actualWidget.layout === 'ByDimension' ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", Widgetvue_type_template_id_23f53472_hoisted_3, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_WidgetByDimensionContainer, { widgets: _ctx.actualWidget.widgets - }, null, 8, ["widgets"])])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)], 10, Widgetvue_type_template_id_4f52b268_hoisted_1)), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.showWidget], [_directive_tooltips, { + }, null, 8, ["widgets"])])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)], 10, Widgetvue_type_template_id_23f53472_hoisted_1)), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.showWidget], [_directive_tooltips, { content: _ctx.tooltipContent }]]) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true); } -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Widget/Widget.vue?vue&type=template&id=4f52b268 +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Widget/Widget.vue?vue&type=template&id=23f53472 // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/Widget/Widget.vue?vue&type=script&lang=ts @@ -10328,7 +10328,7 @@ function findContainer(widgetsByCategory, containerId) { -Widgetvue_type_script_lang_ts.render = Widgetvue_type_template_id_4f52b268_render +Widgetvue_type_script_lang_ts.render = Widgetvue_type_template_id_23f53472_render /* harmony default export */ var Widget_Widget = (Widgetvue_type_script_lang_ts); // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Widget/Widget.adapter.ts @@ -10355,25 +10355,25 @@ Widgetvue_type_script_lang_ts.render = Widgetvue_type_template_id_4f52b268_rende }, directiveName: 'piwikWidget' })); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/ReportingPage/ReportingPage.vue?vue&type=template&id=6531b4d8 +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/ReportingPage/ReportingPage.vue?vue&type=template&id=78ccc056 -var ReportingPagevue_type_template_id_6531b4d8_hoisted_1 = { +var ReportingPagevue_type_template_id_78ccc056_hoisted_1 = { class: "reporting-page" }; -var ReportingPagevue_type_template_id_6531b4d8_hoisted_2 = { +var ReportingPagevue_type_template_id_78ccc056_hoisted_2 = { key: 1, class: "col s12 l6 leftWidgetColumn" }; -var ReportingPagevue_type_template_id_6531b4d8_hoisted_3 = { +var ReportingPagevue_type_template_id_78ccc056_hoisted_3 = { key: 2, class: "col s12 l6 rightWidgetColumn" }; -function ReportingPagevue_type_template_id_6531b4d8_render(_ctx, _cache, $props, $setup, $data, $options) { +function ReportingPagevue_type_template_id_78ccc056_render(_ctx, _cache, $props, $setup, $data, $options) { var _component_ActivityIndicator = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("ActivityIndicator"); var _component_Widget = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("Widget"); - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", ReportingPagevue_type_template_id_6531b4d8_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_ActivityIndicator, { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", ReportingPagevue_type_template_id_78ccc056_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_ActivityIndicator, { loading: _ctx.loading }, null, 8, ["loading"]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('CoreHome_NoSuchPage')), 513), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.hasNoPage]]), (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.widgets, function (widget) { return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", { @@ -10383,12 +10383,12 @@ function ReportingPagevue_type_template_id_6531b4d8_render(_ctx, _cache, $props, key: 0, class: "col s12 fullWidgetColumn", widget: widget - }, null, 8, ["widget"])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), widget.group ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", ReportingPagevue_type_template_id_6531b4d8_hoisted_2, [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(widget.left, function (widgetInGroup) { + }, null, 8, ["widget"])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), widget.group ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", ReportingPagevue_type_template_id_78ccc056_hoisted_2, [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(widget.left, function (widgetInGroup) { return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(_component_Widget, { widget: widgetInGroup, key: widgetInGroup.uniqueId }, null, 8, ["widget"]); - }), 128))])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), widget.group ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", ReportingPagevue_type_template_id_6531b4d8_hoisted_3, [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(widget.right, function (widgetInGroup) { + }), 128))])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), widget.group ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", ReportingPagevue_type_template_id_78ccc056_hoisted_3, [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(widget.right, function (widgetInGroup) { return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(_component_Widget, { widget: widgetInGroup, key: widgetInGroup.uniqueId @@ -10396,7 +10396,7 @@ function ReportingPagevue_type_template_id_6531b4d8_render(_ctx, _cache, $props, }), 128))])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)]); }), 128))]); } -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ReportingPage/ReportingPage.vue?vue&type=template&id=6531b4d8 +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ReportingPage/ReportingPage.vue?vue&type=template&id=78ccc056 // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ReportingPage/ReportingPage.store.ts function ReportingPage_store_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -10702,19 +10702,15 @@ function hideOnlyRawDataNoticifation() { this.showOnlyRawDataMessageIfRequired(); } - if (category === 'Dashboard_Dashboard' && ReportingPagevue_type_script_lang_ts_$.isNumeric(subcategory) && ReportingPagevue_type_script_lang_ts_$('[piwik-dashboard]').length) { - // TODO: should be changed eventually - // hack to make loading of dashboards faster since all the information is already there - // in the piwik-dashboard widget, we can let the piwik-dashboard widget render the page. - // We need to find a proper solution for this. A workaround for now could be an event or - // something to let other components render a specific page. - this.loading = true; - var element = ReportingPagevue_type_script_lang_ts_$('[piwik-dashboard]'); - var scope = window.angular.element(element).scope(); // eslint-disable-line + var params = { + category: category, + subcategory: subcategory + }; + Matomo_Matomo.postEvent('ReportingPage.loadPage', params); - scope.fetchDashboard(parseInt(subcategory, 10)).then(function () { - _this2.loading = false; - }, function () { + if (params.promise) { + this.loading = true; + Promise.resolve(params.promise).finally(function () { _this2.loading = false; }); return; @@ -10815,7 +10811,7 @@ function hideOnlyRawDataNoticifation() { -ReportingPagevue_type_script_lang_ts.render = ReportingPagevue_type_template_id_6531b4d8_render +ReportingPagevue_type_script_lang_ts.render = ReportingPagevue_type_template_id_78ccc056_render /* harmony default export */ var ReportingPage = (ReportingPagevue_type_script_lang_ts); // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ReportingPage/ReportingPage.adapter.ts diff --git a/plugins/CoreHome/vue/dist/CoreHome.umd.min.js b/plugins/CoreHome/vue/dist/CoreHome.umd.min.js index 2b3aa2334a..4d83448c8e 100644 --- a/plugins/CoreHome/vue/dist/CoreHome.umd.min.js +++ b/plugins/CoreHome/vue/dist/CoreHome.umd.min.js @@ -4,7 +4,7 @@ * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */window.hasBlockedContent=!1},"8bbf":function(t,n){t.exports=e},fae3:function(e,t,n){"use strict";if(n.r(t),n.d(t,"createVueApp",(function(){return ut})),n.d(t,"useExternalPluginComponent",(function(){return _n})),n.d(t,"DirectiveUtilities",(function(){return _t})),n.d(t,"debounce",(function(){return Ji})),n.d(t,"lazyInitSingleton",(function(){return Nu})),n.d(t,"createAngularJsAdapter",(function(){return jt})),n.d(t,"transformAngularJsBoolAttr",(function(){return kt})),n.d(t,"transformAngularJsIntAttr",(function(){return St})),n.d(t,"removeAngularJsSpecificProperties",(function(){return Ot})),n.d(t,"clone",(function(){return Ct})),n.d(t,"cloneThenApply",(function(){return Et})),n.d(t,"activityIndicatorAdapter",(function(){return Tu})),n.d(t,"ActivityIndicator",(function(){return ho})),n.d(t,"translate",(function(){return C})),n.d(t,"Alert",(function(){return st})),n.d(t,"AjaxHelper",(function(){return Xe})),n.d(t,"setCookie",(function(){return Au})),n.d(t,"getCookie",(function(){return Iu})),n.d(t,"deleteCookie",(function(){return xu})),n.d(t,"MatomoUrl",(function(){return Ce})),n.d(t,"Matomo",(function(){return S})),n.d(t,"Periods",(function(){return p})),n.d(t,"Day",(function(){return G})),n.d(t,"Week",(function(){return X})),n.d(t,"Month",(function(){return re})),n.d(t,"Year",(function(){return ce})),n.d(t,"Range",(function(){return _})),n.d(t,"format",(function(){return E})),n.d(t,"getToday",(function(){return D})),n.d(t,"parseDate",(function(){return P})),n.d(t,"todayIsInRange",(function(){return V})),n.d(t,"DropdownMenu",(function(){return Dt})),n.d(t,"FocusAnywhereButHere",(function(){return xt})),n.d(t,"FocusIf",(function(){return Lt})),n.d(t,"Tooltips",(function(){return Lr})),n.d(t,"MatomoDialog",(function(){return Sn})),n.d(t,"ExpandOnClick",(function(){return Yt})),n.d(t,"ExpandOnHover",(function(){return nn})),n.d(t,"ShowSensitiveData",(function(){return ln})),n.d(t,"DropdownButton",(function(){return dn})),n.d(t,"SelectOnFocus",(function(){return gn})),n.d(t,"SideNav",(function(){return yn})),n.d(t,"EnrichedHeadline",(function(){return Un})),n.d(t,"ContentBlock",(function(){return er})),n.d(t,"Comparisons",(function(){return Rr})),n.d(t,"MenuDropdown",(function(){return ei})),n.d(t,"DatePicker",(function(){return li})),n.d(t,"DateRangePicker",(function(){return mi})),n.d(t,"PeriodDatePicker",(function(){return bi})),n.d(t,"Notification",(function(){return al})),n.d(t,"NotificationGroup",(function(){return yl})),n.d(t,"NotificationsStore",(function(){return fl})),n.d(t,"SitesStore",(function(){return qi})),n.d(t,"SiteSelector",(function(){return zi})),n.d(t,"QuickAccess",(function(){return da})),n.d(t,"FieldArray",(function(){return Ca})),n.d(t,"MultiPairField",(function(){return Ha})),n.d(t,"PeriodSelector",(function(){return Vo})),n.d(t,"ReportingMenu",(function(){return Xl})),n.d(t,"ReportingPagesStore",(function(){return Cl})),n.d(t,"ReportMetadataStore",(function(){return lc})),n.d(t,"WidgetsStore",(function(){return Yl})),n.d(t,"WidgetLoader",(function(){return fc})),n.d(t,"WidgetContainer",(function(){return Pc})),n.d(t,"WidgetByDimensionContainer",(function(){return qc})),n.d(t,"Widget",(function(){return Kc})),n.d(t,"ReportingPage",(function(){return Os})),n.d(t,"ReportExport",(function(){return Zs})),n.d(t,"Sparkline",(function(){return iu})),n.d(t,"Progressbar",(function(){return du})),n.d(t,"ContentIntro",(function(){return pu})),n.d(t,"ContentTable",(function(){return fu})),n.d(t,"AjaxForm",(function(){return Ou})),"undefined"!==typeof window){var r=window.document.currentScript,i=r&&r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);i&&(n.p=i[1])}n("2342");var a=n("8bbf");function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function c(e,t,n){return t&&l(e.prototype,t),n&&l(e,n),e}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} + */window.hasBlockedContent=!1},"8bbf":function(t,n){t.exports=e},fae3:function(e,t,n){"use strict";if(n.r(t),n.d(t,"createVueApp",(function(){return ut})),n.d(t,"useExternalPluginComponent",(function(){return _n})),n.d(t,"DirectiveUtilities",(function(){return _t})),n.d(t,"debounce",(function(){return Ji})),n.d(t,"lazyInitSingleton",(function(){return Vu})),n.d(t,"createAngularJsAdapter",(function(){return jt})),n.d(t,"transformAngularJsBoolAttr",(function(){return kt})),n.d(t,"transformAngularJsIntAttr",(function(){return St})),n.d(t,"removeAngularJsSpecificProperties",(function(){return Ot})),n.d(t,"clone",(function(){return Ct})),n.d(t,"cloneThenApply",(function(){return Et})),n.d(t,"activityIndicatorAdapter",(function(){return Nu})),n.d(t,"ActivityIndicator",(function(){return ho})),n.d(t,"translate",(function(){return C})),n.d(t,"Alert",(function(){return st})),n.d(t,"AjaxHelper",(function(){return Xe})),n.d(t,"setCookie",(function(){return Tu})),n.d(t,"getCookie",(function(){return Au})),n.d(t,"deleteCookie",(function(){return Iu})),n.d(t,"MatomoUrl",(function(){return Ce})),n.d(t,"Matomo",(function(){return S})),n.d(t,"Periods",(function(){return p})),n.d(t,"Day",(function(){return G})),n.d(t,"Week",(function(){return X})),n.d(t,"Month",(function(){return re})),n.d(t,"Year",(function(){return ce})),n.d(t,"Range",(function(){return _})),n.d(t,"format",(function(){return E})),n.d(t,"getToday",(function(){return D})),n.d(t,"parseDate",(function(){return P})),n.d(t,"todayIsInRange",(function(){return V})),n.d(t,"DropdownMenu",(function(){return Dt})),n.d(t,"FocusAnywhereButHere",(function(){return xt})),n.d(t,"FocusIf",(function(){return Lt})),n.d(t,"Tooltips",(function(){return Lr})),n.d(t,"MatomoDialog",(function(){return Sn})),n.d(t,"ExpandOnClick",(function(){return Yt})),n.d(t,"ExpandOnHover",(function(){return nn})),n.d(t,"ShowSensitiveData",(function(){return ln})),n.d(t,"DropdownButton",(function(){return dn})),n.d(t,"SelectOnFocus",(function(){return gn})),n.d(t,"SideNav",(function(){return yn})),n.d(t,"EnrichedHeadline",(function(){return Un})),n.d(t,"ContentBlock",(function(){return er})),n.d(t,"Comparisons",(function(){return Rr})),n.d(t,"MenuDropdown",(function(){return ei})),n.d(t,"DatePicker",(function(){return li})),n.d(t,"DateRangePicker",(function(){return mi})),n.d(t,"PeriodDatePicker",(function(){return bi})),n.d(t,"Notification",(function(){return al})),n.d(t,"NotificationGroup",(function(){return yl})),n.d(t,"NotificationsStore",(function(){return fl})),n.d(t,"SitesStore",(function(){return qi})),n.d(t,"SiteSelector",(function(){return zi})),n.d(t,"QuickAccess",(function(){return da})),n.d(t,"FieldArray",(function(){return Ca})),n.d(t,"MultiPairField",(function(){return Ha})),n.d(t,"PeriodSelector",(function(){return Vo})),n.d(t,"ReportingMenu",(function(){return Xl})),n.d(t,"ReportingPagesStore",(function(){return Cl})),n.d(t,"ReportMetadataStore",(function(){return lc})),n.d(t,"WidgetsStore",(function(){return Yl})),n.d(t,"WidgetLoader",(function(){return fc})),n.d(t,"WidgetContainer",(function(){return Pc})),n.d(t,"WidgetByDimensionContainer",(function(){return qc})),n.d(t,"Widget",(function(){return Kc})),n.d(t,"ReportingPage",(function(){return ws})),n.d(t,"ReportExport",(function(){return Xs})),n.d(t,"Sparkline",(function(){return ru})),n.d(t,"Progressbar",(function(){return uu})),n.d(t,"ContentIntro",(function(){return du})),n.d(t,"ContentTable",(function(){return mu})),n.d(t,"AjaxForm",(function(){return wu})),"undefined"!==typeof window){var r=window.document.currentScript,i=r&&r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);i&&(n.p=i[1])}n("2342");var a=n("8bbf");function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function c(e,t,n){return t&&l(e.prototype,t),n&&l(e,n),e}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} /*! * Matomo - free/libre analytics platform * @@ -491,13 +491,13 @@ window.angular.module("piwikApp.service").factory("reportMetadataModel",(functio * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function ps(e){return!!(e.isContainer&&e.layout&&"ByDimension"===e.layout||"bydimension"===e.viewDataTable)||(!!e.isWide||e.viewDataTable&&("tableAllColumns"===e.viewDataTable||"sparklines"===e.viewDataTable||"graphEvolution"===e.viewDataTable))}function ms(e){if(e&&e[0]){var t=os(e),n=e[0];return n.group?t[0]=Object.assign(Object.assign({},t[0]),{},{left:ms(n.left||[]),right:ms(n.right||[])}):t[0]=Object.assign(Object.assign({},t[0]),{},{isFirstInPage:!0}),t}return e}var fs=function(){function e(){var t=this;ns(this,e),as(this,"privateState",Object(a["reactive"])({})),as(this,"state",Object(a["computed"])((function(){return Object(a["readonly"])(t.privateState)}))),as(this,"page",Object(a["computed"])((function(){return t.state.value.page}))),as(this,"widgets",Object(a["computed"])((function(){var e=t.page.value;if(!e)return[];var n=[],r={},i=function(e){return e.isReport&&r["".concat(e.module,".").concat(e.action)]},a=function(e){if(!e.isReport)return[];var t=lc.findReport(e.module,e.action);return t&&t.relatedReports?t.relatedReports:[]};if((e.widgets||[]).forEach((function(e){i(e)||(a(e).forEach((function(e){r["".concat(e.module,".").concat(e.action)]=!0})),n.push(e))})),n=Al(n),1===n.length)return ms(n);for(var o=[],l=0;l<n.length;l+=1){var c=n[l];if(ps(c)||n[l+1]&&ps(n[l+1]))o.push(Object.assign(Object.assign({},c),{},{widgets:Al(Gl(c))}));else{var s=0,u=[c],d=[];while(n[l+1]&&!ps(n[l+1]))l+=1,s+=1,s%2===0?u.push(n[l]):d.push(n[l]);o.push({group:!0,left:u,right:d})}}var p=ms(o);return p})))}return is(e,[{key:"fetchPage",value:function(e,t){var n=this;return this.resetPage(),Promise.all([Cl.getAllPages(),lc.fetchReportMetadata()]).then((function(){return n.privateState.page=Cl.findPage(e,t),n.page.value}))}},{key:"resetPage",value:function(){this.privateState.page=void 0}}]),e}(),hs=new fs,gs=window,vs=gs.$;function bs(){var e="category=General_Visitors&subcategory=Live_VisitorLog",t=window.broadcast.buildReportingUrl(e);fl.show({id:"onlyRawData",animate:!1,context:"info",message:C("CoreHome_PeriodHasOnlyRawData",'<a href="'.concat(t,'">'),"</a>"),type:"transient"})}function ys(){fl.remove("onlyRawData")}var ws=Object(a["defineComponent"])({components:{ActivityIndicator:ho,Widget:Kc},data:function(){return{loading:!1,hasRawData:!1,hasNoVisits:!1,dateLastChecked:null,hasNoPage:!1}},created:function(){var e=this;hs.resetPage(),this.loading=!0,this.renderInitialPage(),Object(a["watch"])((function(){return Ce.parsed.value}),(function(t,n){t.category===n.category&&t.subcategory===n.subcategory&&t.period===n.period&&t.date===n.date&&t.segment===n.segment&&JSON.stringify(t.compareDates)===JSON.stringify(n.compareDates)&&JSON.stringify(t.comparePeriods)===JSON.stringify(n.comparePeriods)&&JSON.stringify(t.compareSegments)===JSON.stringify(n.compareSegments)&&JSON.stringify(t.columns||"")===JSON.stringify(n.columns||"")||(t.date===n.date&&t.period===n.period||(ys(),e.dateLastChecked=null,e.hasRawData=!1,e.hasNoVisits=!1),e.renderPage(t.category,t.subcategory))})),S.on("loadPage",(function(t,n){e.renderPage(t,n)}))},computed:{widgets:function(){return hs.widgets.value}},methods:{renderPage:function(e,t){var n=this;if(!e||!t)return hs.resetPage(),void(this.loading=!1);var r=Ce.parsed.value,i=r.period,a=r.date;try{p.parse(i,a)}catch(c){return fl.show({id:"invalidDate",animate:!1,context:"error",message:C("CoreHome_DateInvalid"),type:"transient"}),hs.resetPage(),void(this.loading=!1)}if(fl.remove("invalidDate"),S.postEvent("piwikPageChange",{}),fl.clearTransientNotifications(),p.parse(i,a).containsToday()&&this.showOnlyRawDataMessageIfRequired(),"Dashboard_Dashboard"===e&&vs.isNumeric(t)&&vs("[piwik-dashboard]").length){this.loading=!0;var o=vs("[piwik-dashboard]"),l=window.angular.element(o).scope();l.fetchDashboard(parseInt(t,10)).then((function(){n.loading=!1}),(function(){n.loading=!1}))}else hs.fetchPage(e,t).then((function(){var t=!hs.page.value;if(t){var r=Cl.findPageInCategory(e);if(r&&r.subcategory)return void Ce.updateHash(Object.assign(Object.assign({},Ce.hashParsed.value),{},{subcategory:r.subcategory.id}))}n.hasNoPage=t,n.loading=!1}))},renderInitialPage:function(){var e=Ce.parsed.value;this.renderPage(e.category,e.subcategory)},showOnlyRawDataMessageIfRequired:function(){var e=this;this.hasRawData&&this.hasNoVisits&&bs();var t=Ce.parsed.value,n=t.segment;if(n)ys();else{var r=["Live_VisitorLog","General_RealTime","UserCountryMap_RealTimeMap","MediaAnalytics_TypeAudienceLog","MediaAnalytics_TypeRealTime","FormAnalytics_TypeRealTime","Goals_AddNewGoal"],i=["HeatmapSessionRecording_Heatmaps","HeatmapSessionRecording_SessionRecordings","Marketplace_Marketplace"],a=t.subcategory,o=t.category;if(-1===r.indexOf(a)&&-1===i.indexOf(o)&&-1===a.toLowerCase().indexOf("manage")){var l=6e4;this.dateLastChecked&&(new Date).valueOf()-this.dateLastChecked.valueOf()<l||Xe.fetch({method:"VisitsSummary.getVisits"}).then((function(t){return e.dateLastChecked=new Date,t.value>0?(e.hasNoVisits=!1,void ys()):(e.hasNoVisits=!0,e.hasRawData?void bs():Xe.fetch({method:"Live.getLastVisitsDetails",filter_limit:1,doNotFetchActions:1}))})).then((function(t){if(!t||0===t.length)return e.hasRawData=!1,void ys();e.hasRawData=!0,bs()}))}else ys()}}}});ws.render=ts;var Os=ws,js=(jt({component:Os,directiveName:"piwikReportingPage"}),{class:"report-export-popover row",id:"reportExport"}),ks={class:"col l6"},Ss={name:"format"},Cs={name:"option_flat"},Es={name:"option_expanded"},Ds={name:"option_format_metrics"},Ps={class:"col l6"},Vs={name:"filter_type"},Ns={class:"filter_limit"},Ts={name:"filter_limit_all"},As={key:0,name:"filter_limit"},Is={key:1,name:"filter_limit"},xs={class:"col l12"},Bs=["value"],Ms=Object(a["createTextVNode"])("\n "),Ls=[Ms],Fs=["innerHTML"],Rs={class:"col l12"},_s=["href","title"]; + */function ps(e){return!!(e.isContainer&&e.layout&&"ByDimension"===e.layout||"bydimension"===e.viewDataTable)||(!!e.isWide||e.viewDataTable&&("tableAllColumns"===e.viewDataTable||"sparklines"===e.viewDataTable||"graphEvolution"===e.viewDataTable))}function ms(e){if(e&&e[0]){var t=os(e),n=e[0];return n.group?t[0]=Object.assign(Object.assign({},t[0]),{},{left:ms(n.left||[]),right:ms(n.right||[])}):t[0]=Object.assign(Object.assign({},t[0]),{},{isFirstInPage:!0}),t}return e}var fs=function(){function e(){var t=this;ns(this,e),as(this,"privateState",Object(a["reactive"])({})),as(this,"state",Object(a["computed"])((function(){return Object(a["readonly"])(t.privateState)}))),as(this,"page",Object(a["computed"])((function(){return t.state.value.page}))),as(this,"widgets",Object(a["computed"])((function(){var e=t.page.value;if(!e)return[];var n=[],r={},i=function(e){return e.isReport&&r["".concat(e.module,".").concat(e.action)]},a=function(e){if(!e.isReport)return[];var t=lc.findReport(e.module,e.action);return t&&t.relatedReports?t.relatedReports:[]};if((e.widgets||[]).forEach((function(e){i(e)||(a(e).forEach((function(e){r["".concat(e.module,".").concat(e.action)]=!0})),n.push(e))})),n=Al(n),1===n.length)return ms(n);for(var o=[],l=0;l<n.length;l+=1){var c=n[l];if(ps(c)||n[l+1]&&ps(n[l+1]))o.push(Object.assign(Object.assign({},c),{},{widgets:Al(Gl(c))}));else{var s=0,u=[c],d=[];while(n[l+1]&&!ps(n[l+1]))l+=1,s+=1,s%2===0?u.push(n[l]):d.push(n[l]);o.push({group:!0,left:u,right:d})}}var p=ms(o);return p})))}return is(e,[{key:"fetchPage",value:function(e,t){var n=this;return this.resetPage(),Promise.all([Cl.getAllPages(),lc.fetchReportMetadata()]).then((function(){return n.privateState.page=Cl.findPage(e,t),n.page.value}))}},{key:"resetPage",value:function(){this.privateState.page=void 0}}]),e}(),hs=new fs,gs=window;gs.$;function vs(){var e="category=General_Visitors&subcategory=Live_VisitorLog",t=window.broadcast.buildReportingUrl(e);fl.show({id:"onlyRawData",animate:!1,context:"info",message:C("CoreHome_PeriodHasOnlyRawData",'<a href="'.concat(t,'">'),"</a>"),type:"transient"})}function bs(){fl.remove("onlyRawData")}var ys=Object(a["defineComponent"])({components:{ActivityIndicator:ho,Widget:Kc},data:function(){return{loading:!1,hasRawData:!1,hasNoVisits:!1,dateLastChecked:null,hasNoPage:!1}},created:function(){var e=this;hs.resetPage(),this.loading=!0,this.renderInitialPage(),Object(a["watch"])((function(){return Ce.parsed.value}),(function(t,n){t.category===n.category&&t.subcategory===n.subcategory&&t.period===n.period&&t.date===n.date&&t.segment===n.segment&&JSON.stringify(t.compareDates)===JSON.stringify(n.compareDates)&&JSON.stringify(t.comparePeriods)===JSON.stringify(n.comparePeriods)&&JSON.stringify(t.compareSegments)===JSON.stringify(n.compareSegments)&&JSON.stringify(t.columns||"")===JSON.stringify(n.columns||"")||(t.date===n.date&&t.period===n.period||(bs(),e.dateLastChecked=null,e.hasRawData=!1,e.hasNoVisits=!1),e.renderPage(t.category,t.subcategory))})),S.on("loadPage",(function(t,n){e.renderPage(t,n)}))},computed:{widgets:function(){return hs.widgets.value}},methods:{renderPage:function(e,t){var n=this;if(!e||!t)return hs.resetPage(),void(this.loading=!1);var r=Ce.parsed.value,i=r.period,a=r.date;try{p.parse(i,a)}catch(l){return fl.show({id:"invalidDate",animate:!1,context:"error",message:C("CoreHome_DateInvalid"),type:"transient"}),hs.resetPage(),void(this.loading=!1)}fl.remove("invalidDate"),S.postEvent("piwikPageChange",{}),fl.clearTransientNotifications(),p.parse(i,a).containsToday()&&this.showOnlyRawDataMessageIfRequired();var o={category:e,subcategory:t};if(S.postEvent("ReportingPage.loadPage",o),o.promise)return this.loading=!0,void Promise.resolve(o.promise).finally((function(){n.loading=!1}));hs.fetchPage(e,t).then((function(){var t=!hs.page.value;if(t){var r=Cl.findPageInCategory(e);if(r&&r.subcategory)return void Ce.updateHash(Object.assign(Object.assign({},Ce.hashParsed.value),{},{subcategory:r.subcategory.id}))}n.hasNoPage=t,n.loading=!1}))},renderInitialPage:function(){var e=Ce.parsed.value;this.renderPage(e.category,e.subcategory)},showOnlyRawDataMessageIfRequired:function(){var e=this;this.hasRawData&&this.hasNoVisits&&vs();var t=Ce.parsed.value,n=t.segment;if(n)bs();else{var r=["Live_VisitorLog","General_RealTime","UserCountryMap_RealTimeMap","MediaAnalytics_TypeAudienceLog","MediaAnalytics_TypeRealTime","FormAnalytics_TypeRealTime","Goals_AddNewGoal"],i=["HeatmapSessionRecording_Heatmaps","HeatmapSessionRecording_SessionRecordings","Marketplace_Marketplace"],a=t.subcategory,o=t.category;if(-1===r.indexOf(a)&&-1===i.indexOf(o)&&-1===a.toLowerCase().indexOf("manage")){var l=6e4;this.dateLastChecked&&(new Date).valueOf()-this.dateLastChecked.valueOf()<l||Xe.fetch({method:"VisitsSummary.getVisits"}).then((function(t){return e.dateLastChecked=new Date,t.value>0?(e.hasNoVisits=!1,void bs()):(e.hasNoVisits=!0,e.hasRawData?void vs():Xe.fetch({method:"Live.getLastVisitsDetails",filter_limit:1,doNotFetchActions:1}))})).then((function(t){if(!t||0===t.length)return e.hasRawData=!1,void bs();e.hasRawData=!0,vs()}))}else bs()}}}});ys.render=ts;var ws=ys,Os=(jt({component:ws,directiveName:"piwikReportingPage"}),{class:"report-export-popover row",id:"reportExport"}),js={class:"col l6"},ks={name:"format"},Ss={name:"option_flat"},Cs={name:"option_expanded"},Es={name:"option_format_metrics"},Ds={class:"col l6"},Ps={name:"filter_type"},Vs={class:"filter_limit"},Ns={name:"filter_limit_all"},Ts={key:0,name:"filter_limit"},As={key:1,name:"filter_limit"},Is={class:"col l12"},xs=["value"],Bs=Object(a["createTextVNode"])("\n "),Ms=[Bs],Ls=["innerHTML"],Fs={class:"col l12"},Rs=["href","title"]; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function $s(e,t,n,r,i,o){var l=Object(a["resolveComponent"])("Field"),c=Object(a["resolveDirective"])("select-on-focus");return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",js,[Object(a["createElementVNode"])("div",ks,[Object(a["createElementVNode"])("div",Ss,[Object(a["createVNode"])(l,{uicontrol:"radio",name:"format",title:e.translate("CoreHome_ExportFormat"),modelValue:e.reportFormat,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.reportFormat=t}),"full-width":!0,options:e.availableReportFormats[e.reportType]},null,8,["title","modelValue","options"])]),Object(a["createElementVNode"])("div",null,[Object(a["createElementVNode"])("div",Cs,[Object(a["withDirectives"])(Object(a["createVNode"])(l,{uicontrol:"checkbox",name:"option_flat",title:e.translate("CoreHome_FlattenReport"),modelValue:e.optionFlat,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.optionFlat=t})},null,8,["title","modelValue"]),[[a["vShow"],e.hasSubtables]])])]),Object(a["createElementVNode"])("div",null,[Object(a["createElementVNode"])("div",Es,[Object(a["withDirectives"])(Object(a["createVNode"])(l,{uicontrol:"checkbox",name:"option_expanded",title:e.translate("CoreHome_ExpandSubtables"),modelValue:e.optionExpanded,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.optionExpanded=t})},null,8,["title","modelValue"]),[[a["vShow"],e.hasSubtables&&!e.optionFlat]])])]),Object(a["createElementVNode"])("div",null,[Object(a["createElementVNode"])("div",Ds,[Object(a["createVNode"])(l,{uicontrol:"checkbox",name:"option_format_metrics",title:e.translate("CoreHome_FormatMetrics"),modelValue:e.optionFormatMetrics,"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.optionFormatMetrics=t})},null,8,["title","modelValue"])])])]),Object(a["createElementVNode"])("div",Ps,[Object(a["createElementVNode"])("div",null,[Object(a["createElementVNode"])("div",Vs,[Object(a["createVNode"])(l,{uicontrol:"radio",name:"filter_type",title:e.translate("CoreHome_ReportType"),modelValue:e.reportType,"onUpdate:modelValue":t[4]||(t[4]=function(t){return e.reportType=t}),"full-width":!0,options:e.availableReportTypes},null,8,["title","modelValue","options"])])]),Object(a["createElementVNode"])("div",Ns,[Object(a["withDirectives"])(Object(a["createElementVNode"])("div",Ts,[Object(a["createVNode"])(l,{uicontrol:"radio",name:"filter_limit_all",title:e.translate("CoreHome_RowLimit"),modelValue:e.reportLimitAll,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.reportLimitAll=t}),"full-width":!0,options:e.limitAllOptions},null,8,["title","modelValue","options"])],512),[[a["vShow"],!e.maxFilterLimit||e.maxFilterLimit<=0]]),"no"===e.reportLimitAll&&e.maxFilterLimit<=0?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",As,[Object(a["createVNode"])(l,{uicontrol:"number",name:"filter_limit",min:1,modelValue:e.reportLimit,"onUpdate:modelValue":t[6]||(t[6]=function(t){return e.reportLimit=t}),"full-width":!0},null,8,["modelValue"])])):Object(a["createCommentVNode"])("",!0),"no"===e.reportLimitAll&&e.maxFilterLimit>0?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",Is,[Object(a["createVNode"])(l,{uicontrol:"number",name:"filter_limit",min:1,max:e.maxFilterLimit,modelValue:e.reportLimit,"onUpdate:modelValue":t[7]||(t[7]=function(t){return e.reportLimit=t}),value:e.reportLimit,"full-width":!0,title:e.filterLimitTooltip},null,8,["max","modelValue","value","title"])])):Object(a["createCommentVNode"])("",!0)])]),Object(a["withDirectives"])(Object(a["createElementVNode"])("div",xs,[Object(a["withDirectives"])(Object(a["createElementVNode"])("textarea",{readonly:"",class:"exportFullUrl",value:e.exportLinkWithoutToken},Ls,8,Bs),[[c,{}]]),Object(a["createElementVNode"])("div",{class:"tooltip",innerHTML:e.$sanitize(e.translate("CoreHome_ExportTooltipWithLink","<a target=_blank href='?module=UsersManager&action=userSecurity'>","</a>","ENTER_YOUR_TOKEN_AUTH_HERE"))},null,8,Fs)],512),[[a["vShow"],e.showUrl]]),Object(a["createElementVNode"])("div",Rs,[Object(a["createElementVNode"])("a",{class:"btn",href:e.exportLink,target:"_new",title:e.translate("CoreHome_ExportTooltip")},Object(a["toDisplayString"])(e.translate("General_Export")),9,_s),Object(a["createElementVNode"])("a",{href:"javascript:",onClick:t[8]||(t[8]=function(t){return e.showUrl=!e.showUrl}),class:"toggle-export-url"},[Object(a["withDirectives"])(Object(a["createElementVNode"])("span",null,Object(a["toDisplayString"])(e.translate("CoreHome_ShowExportUrl")),513),[[a["vShow"],!e.showUrl]]),Object(a["withDirectives"])(Object(a["createElementVNode"])("span",null,Object(a["toDisplayString"])(e.translate("CoreHome_HideExportUrl")),513),[[a["vShow"],e.showUrl]])])])])}function Hs(e,t){return Gs(e)||Js(e,t)||qs(e,t)||Us()}function Us(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function qs(e,t){if(e){if("string"===typeof e)return Ws(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ws(e,t):void 0}}function Ws(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Js(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done);o=!0)if(a.push(r.value),t&&a.length===t)break}catch(c){l=!0,i=c}finally{try{o||null==n["return"]||n["return"]()}finally{if(l)throw i}}return a}}function Gs(e){if(Array.isArray(e))return e}var zs=_n("CorePluginsAdmin","Field"),Ys=Object(a["defineComponent"])({components:{Field:zs},directives:{SelectOnFocus:gn},props:{hasSubtables:Boolean,availableReportTypes:Object,availableReportFormats:{type:Object,required:!0},maxFilterLimit:Number,limitAllOptions:Object,dataTable:{type:Object,required:!0},requestParams:[Object,String],apiMethod:{type:String,required:!0},initialReportType:{type:String,default:"default"},initialReportLimit:{type:[String,Number],default:100},initialReportLimitAll:{type:String,default:"yes"},initialOptionFlat:{type:Boolean,default:!1},initialOptionExpanded:{type:Boolean,default:!0},initialOptionFormatMetrics:{type:Boolean,default:!1},initialReportFormat:{type:String,default:"XML"}},data:function(){return{showUrl:!1,reportFormat:this.initialReportFormat,optionFlat:this.initialOptionFlat,optionExpanded:this.initialOptionExpanded,optionFormatMetrics:this.initialOptionFormatMetrics,reportType:this.initialReportType,reportLimitAll:this.initialReportLimitAll,reportLimit:"string"===typeof this.initialReportLimit?parseInt(this.initialReportLimit,10):this.initialReportLimit}},watch:{reportType:function(e){this.availableReportFormats[e][this.reportFormat]||(this.reportFormat="XML")},reportLimit:function(e,t){this.maxFilterLimit&&this.maxFilterLimit>0&&e>this.maxFilterLimit&&(this.reportLimit=t)}},computed:{filterLimitTooltip:function(){var e=C("CoreHome_RowLimit"),t=this.maxFilterLimit?C("General_ComputedMetricMax",this.maxFilterLimit.toString()):"";return"".concat(e," (").concat(t,")")},exportLink:function(){return this.getExportLink(!0)},exportLinkWithoutToken:function(){return this.getExportLink(!1)}},methods:{getExportLink:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.reportFormat,n=this.apiMethod,r=this.reportType,i=this.dataTable;if(t){var a={},o="yes"===this.reportLimitAll?-1:this.reportLimit;this.requestParams&&"string"===typeof this.requestParams&&(a=JSON.parse(this.requestParams));var l=i.param,c=l.segment,s=l.label,u=l.idGoal,d=l.idDimension,p=l.idSite,m=i.param,f=m.date,h=m.period;"RSS"===t&&(f="last10"),"undefined"!==typeof i.param.dateUsedInGraph&&(f=i.param.dateUsedInGraph);var g=S.config.datatable_export_range_as_day.toLowerCase();-1!==g.indexOf(t.toLowerCase())&&"range"===i.param.period&&(h="day"),"range"===i.param.period&&"graphEvolution"===i.param.viewDataTable&&(h="day");var v={module:"API",format:t,idSite:p,period:h,date:f};if("processed"===r){v.method="API.getProcessedReport";var b=n.split("."),y=Hs(b,2);v.apiModule=y[0],v.apiAction=y[1]}else v.method=n;if(i.param.compareDates&&i.param.compareDates.length&&(v.compareDates=i.param.compareDates,v.compare="1"),i.param.comparePeriods&&i.param.comparePeriods.length&&(v.comparePeriods=i.param.comparePeriods,v.compare="1"),i.param.compareSegments&&i.param.compareSegments.length&&(v.compareSegments=i.param.compareSegments,v.compare="1"),"undefined"!==typeof i.param.filter_pattern&&(v.filter_pattern=i.param.filter_pattern),"undefined"!==typeof i.param.filter_pattern_recursive&&(v.filter_pattern_recursive=i.param.filter_pattern_recursive),window.$.isPlainObject(a)&&Object.entries(a).forEach((function(e){var t=Hs(e,2),n=t[0],r=t[1],i=r;!0===i?i=1:!1===i&&(i=0),v[n]=i})),this.optionFlat&&(v.flat=1,"undefined"!==typeof i.param.include_aggregate_rows&&"1"===i.param.include_aggregate_rows&&(v.include_aggregate_rows=1)),!this.optionFlat&&this.optionExpanded&&(v.expanded=1),this.optionFormatMetrics&&(v.format_metrics=1),i.param.pivotBy&&(v.pivotBy=i.param.pivotBy,v.pivotByColumnLimit=20,i.props.pivot_by_column&&(v.pivotByColumn=i.props.pivot_by_column)),"CSV"!==t&&"TSV"!==t&&"RSS"!==t||(v.translateColumnNames=1,v.language=S.language),"undefined"!==typeof c&&(v.segment=decodeURIComponent(c)),"undefined"!==typeof u&&"-1"!==u&&(v.idGoal=u),"undefined"!==typeof d&&"-1"!==d&&(v.idDimension=d),s){var w=s.split(",");if(w.length>1)v.label=w;else{var O=Hs(w,1);v.label=O[0]}}v.token_auth="ENTER_YOUR_TOKEN_AUTH_HERE",!0===e&&(v.token_auth=S.token_auth,v.force_api_session=1),v.filter_limit=o;var j=window.location.href.split("?")[0];return"".concat(j,"?").concat(Ce.stringify(v))}}}});Ys.render=$s;var Qs=Ys,Ks=window,Xs=Ks.$,Zs={mounted:function(e,t){e.addEventListener("click",(function(){var n=Ce.hashParsed.value.popover,r=Xs(e).closest("[data-report]").data("uiControlObject"),i=window.Piwik_Popover.showLoading("Export"),a=t.value.reportFormats,o=r.param.filter_limit;t.value.maxFilterLimit>0&&(o=Math.min(o,t.value.maxFilterLimit));var l=!0===r.param.flat||1===r.param.flat||"1"===r.param.flat,c={initialReportType:"default",initialReportLimit:o>0?o:100,initialReportLimitAll:-1===o?"yes":"no",initialOptionFlat:l,initialOptionExpanded:!0,initialOptionFormatMetrics:!1,hasSubtables:l||r.numberOfSubtables>0,availableReportFormats:{default:a,processed:{XML:a.XML,JSON:a.JSON}},availableReportTypes:{default:C("CoreHome_StandardReport"),processed:C("CoreHome_ReportWithMetadata")},limitAllOptions:{yes:C("General_All"),no:C("CoreHome_CustomLimit")},maxFilterLimit:t.value.maxFilterLimit,dataTable:r,requestParams:t.value.requestParams,apiMethod:t.value.apiMethod},s=ut({template:'\n <popover v-bind="bind"/>',data:function(){return{bind:c}}});s.component("popover",Qs);var u=document.createElement("div");s.mount(u);var d=t.value.reportTitle;window.Piwik_Popover.setTitle("".concat(C("General_Export")," ").concat(S.helper.htmlEntities(d))),window.Piwik_Popover.setContent(u),window.Piwik_Popover.onClose((function(){s.unmount(),""!==n&&setTimeout((function(){Ce.updateHash(Object.assign(Object.assign({},Ce.hashParsed.value),{},{popover:n})),t.value.onClose&&t.value.onClose()}),100)})),setTimeout((function(){i.dialog(),Xs(".exportFullUrl, .btn",i).tooltip({track:!0,show:!1,hide:!1})}),100)}))}}; + */function _s(e,t,n,r,i,o){var l=Object(a["resolveComponent"])("Field"),c=Object(a["resolveDirective"])("select-on-focus");return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",Os,[Object(a["createElementVNode"])("div",js,[Object(a["createElementVNode"])("div",ks,[Object(a["createVNode"])(l,{uicontrol:"radio",name:"format",title:e.translate("CoreHome_ExportFormat"),modelValue:e.reportFormat,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.reportFormat=t}),"full-width":!0,options:e.availableReportFormats[e.reportType]},null,8,["title","modelValue","options"])]),Object(a["createElementVNode"])("div",null,[Object(a["createElementVNode"])("div",Ss,[Object(a["withDirectives"])(Object(a["createVNode"])(l,{uicontrol:"checkbox",name:"option_flat",title:e.translate("CoreHome_FlattenReport"),modelValue:e.optionFlat,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.optionFlat=t})},null,8,["title","modelValue"]),[[a["vShow"],e.hasSubtables]])])]),Object(a["createElementVNode"])("div",null,[Object(a["createElementVNode"])("div",Cs,[Object(a["withDirectives"])(Object(a["createVNode"])(l,{uicontrol:"checkbox",name:"option_expanded",title:e.translate("CoreHome_ExpandSubtables"),modelValue:e.optionExpanded,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.optionExpanded=t})},null,8,["title","modelValue"]),[[a["vShow"],e.hasSubtables&&!e.optionFlat]])])]),Object(a["createElementVNode"])("div",null,[Object(a["createElementVNode"])("div",Es,[Object(a["createVNode"])(l,{uicontrol:"checkbox",name:"option_format_metrics",title:e.translate("CoreHome_FormatMetrics"),modelValue:e.optionFormatMetrics,"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.optionFormatMetrics=t})},null,8,["title","modelValue"])])])]),Object(a["createElementVNode"])("div",Ds,[Object(a["createElementVNode"])("div",null,[Object(a["createElementVNode"])("div",Ps,[Object(a["createVNode"])(l,{uicontrol:"radio",name:"filter_type",title:e.translate("CoreHome_ReportType"),modelValue:e.reportType,"onUpdate:modelValue":t[4]||(t[4]=function(t){return e.reportType=t}),"full-width":!0,options:e.availableReportTypes},null,8,["title","modelValue","options"])])]),Object(a["createElementVNode"])("div",Vs,[Object(a["withDirectives"])(Object(a["createElementVNode"])("div",Ns,[Object(a["createVNode"])(l,{uicontrol:"radio",name:"filter_limit_all",title:e.translate("CoreHome_RowLimit"),modelValue:e.reportLimitAll,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.reportLimitAll=t}),"full-width":!0,options:e.limitAllOptions},null,8,["title","modelValue","options"])],512),[[a["vShow"],!e.maxFilterLimit||e.maxFilterLimit<=0]]),"no"===e.reportLimitAll&&e.maxFilterLimit<=0?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",Ts,[Object(a["createVNode"])(l,{uicontrol:"number",name:"filter_limit",min:1,modelValue:e.reportLimit,"onUpdate:modelValue":t[6]||(t[6]=function(t){return e.reportLimit=t}),"full-width":!0},null,8,["modelValue"])])):Object(a["createCommentVNode"])("",!0),"no"===e.reportLimitAll&&e.maxFilterLimit>0?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",As,[Object(a["createVNode"])(l,{uicontrol:"number",name:"filter_limit",min:1,max:e.maxFilterLimit,modelValue:e.reportLimit,"onUpdate:modelValue":t[7]||(t[7]=function(t){return e.reportLimit=t}),value:e.reportLimit,"full-width":!0,title:e.filterLimitTooltip},null,8,["max","modelValue","value","title"])])):Object(a["createCommentVNode"])("",!0)])]),Object(a["withDirectives"])(Object(a["createElementVNode"])("div",Is,[Object(a["withDirectives"])(Object(a["createElementVNode"])("textarea",{readonly:"",class:"exportFullUrl",value:e.exportLinkWithoutToken},Ms,8,xs),[[c,{}]]),Object(a["createElementVNode"])("div",{class:"tooltip",innerHTML:e.$sanitize(e.translate("CoreHome_ExportTooltipWithLink","<a target=_blank href='?module=UsersManager&action=userSecurity'>","</a>","ENTER_YOUR_TOKEN_AUTH_HERE"))},null,8,Ls)],512),[[a["vShow"],e.showUrl]]),Object(a["createElementVNode"])("div",Fs,[Object(a["createElementVNode"])("a",{class:"btn",href:e.exportLink,target:"_new",title:e.translate("CoreHome_ExportTooltip")},Object(a["toDisplayString"])(e.translate("General_Export")),9,Rs),Object(a["createElementVNode"])("a",{href:"javascript:",onClick:t[8]||(t[8]=function(t){return e.showUrl=!e.showUrl}),class:"toggle-export-url"},[Object(a["withDirectives"])(Object(a["createElementVNode"])("span",null,Object(a["toDisplayString"])(e.translate("CoreHome_ShowExportUrl")),513),[[a["vShow"],!e.showUrl]]),Object(a["withDirectives"])(Object(a["createElementVNode"])("span",null,Object(a["toDisplayString"])(e.translate("CoreHome_HideExportUrl")),513),[[a["vShow"],e.showUrl]])])])])}function $s(e,t){return Js(e)||Ws(e,t)||Us(e,t)||Hs()}function Hs(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Us(e,t){if(e){if("string"===typeof e)return qs(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?qs(e,t):void 0}}function qs(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ws(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done);o=!0)if(a.push(r.value),t&&a.length===t)break}catch(c){l=!0,i=c}finally{try{o||null==n["return"]||n["return"]()}finally{if(l)throw i}}return a}}function Js(e){if(Array.isArray(e))return e}var Gs=_n("CorePluginsAdmin","Field"),zs=Object(a["defineComponent"])({components:{Field:Gs},directives:{SelectOnFocus:gn},props:{hasSubtables:Boolean,availableReportTypes:Object,availableReportFormats:{type:Object,required:!0},maxFilterLimit:Number,limitAllOptions:Object,dataTable:{type:Object,required:!0},requestParams:[Object,String],apiMethod:{type:String,required:!0},initialReportType:{type:String,default:"default"},initialReportLimit:{type:[String,Number],default:100},initialReportLimitAll:{type:String,default:"yes"},initialOptionFlat:{type:Boolean,default:!1},initialOptionExpanded:{type:Boolean,default:!0},initialOptionFormatMetrics:{type:Boolean,default:!1},initialReportFormat:{type:String,default:"XML"}},data:function(){return{showUrl:!1,reportFormat:this.initialReportFormat,optionFlat:this.initialOptionFlat,optionExpanded:this.initialOptionExpanded,optionFormatMetrics:this.initialOptionFormatMetrics,reportType:this.initialReportType,reportLimitAll:this.initialReportLimitAll,reportLimit:"string"===typeof this.initialReportLimit?parseInt(this.initialReportLimit,10):this.initialReportLimit}},watch:{reportType:function(e){this.availableReportFormats[e][this.reportFormat]||(this.reportFormat="XML")},reportLimit:function(e,t){this.maxFilterLimit&&this.maxFilterLimit>0&&e>this.maxFilterLimit&&(this.reportLimit=t)}},computed:{filterLimitTooltip:function(){var e=C("CoreHome_RowLimit"),t=this.maxFilterLimit?C("General_ComputedMetricMax",this.maxFilterLimit.toString()):"";return"".concat(e," (").concat(t,")")},exportLink:function(){return this.getExportLink(!0)},exportLinkWithoutToken:function(){return this.getExportLink(!1)}},methods:{getExportLink:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.reportFormat,n=this.apiMethod,r=this.reportType,i=this.dataTable;if(t){var a={},o="yes"===this.reportLimitAll?-1:this.reportLimit;this.requestParams&&"string"===typeof this.requestParams&&(a=JSON.parse(this.requestParams));var l=i.param,c=l.segment,s=l.label,u=l.idGoal,d=l.idDimension,p=l.idSite,m=i.param,f=m.date,h=m.period;"RSS"===t&&(f="last10"),"undefined"!==typeof i.param.dateUsedInGraph&&(f=i.param.dateUsedInGraph);var g=S.config.datatable_export_range_as_day.toLowerCase();-1!==g.indexOf(t.toLowerCase())&&"range"===i.param.period&&(h="day"),"range"===i.param.period&&"graphEvolution"===i.param.viewDataTable&&(h="day");var v={module:"API",format:t,idSite:p,period:h,date:f};if("processed"===r){v.method="API.getProcessedReport";var b=n.split("."),y=$s(b,2);v.apiModule=y[0],v.apiAction=y[1]}else v.method=n;if(i.param.compareDates&&i.param.compareDates.length&&(v.compareDates=i.param.compareDates,v.compare="1"),i.param.comparePeriods&&i.param.comparePeriods.length&&(v.comparePeriods=i.param.comparePeriods,v.compare="1"),i.param.compareSegments&&i.param.compareSegments.length&&(v.compareSegments=i.param.compareSegments,v.compare="1"),"undefined"!==typeof i.param.filter_pattern&&(v.filter_pattern=i.param.filter_pattern),"undefined"!==typeof i.param.filter_pattern_recursive&&(v.filter_pattern_recursive=i.param.filter_pattern_recursive),window.$.isPlainObject(a)&&Object.entries(a).forEach((function(e){var t=$s(e,2),n=t[0],r=t[1],i=r;!0===i?i=1:!1===i&&(i=0),v[n]=i})),this.optionFlat&&(v.flat=1,"undefined"!==typeof i.param.include_aggregate_rows&&"1"===i.param.include_aggregate_rows&&(v.include_aggregate_rows=1)),!this.optionFlat&&this.optionExpanded&&(v.expanded=1),this.optionFormatMetrics&&(v.format_metrics=1),i.param.pivotBy&&(v.pivotBy=i.param.pivotBy,v.pivotByColumnLimit=20,i.props.pivot_by_column&&(v.pivotByColumn=i.props.pivot_by_column)),"CSV"!==t&&"TSV"!==t&&"RSS"!==t||(v.translateColumnNames=1,v.language=S.language),"undefined"!==typeof c&&(v.segment=decodeURIComponent(c)),"undefined"!==typeof u&&"-1"!==u&&(v.idGoal=u),"undefined"!==typeof d&&"-1"!==d&&(v.idDimension=d),s){var w=s.split(",");if(w.length>1)v.label=w;else{var O=$s(w,1);v.label=O[0]}}v.token_auth="ENTER_YOUR_TOKEN_AUTH_HERE",!0===e&&(v.token_auth=S.token_auth,v.force_api_session=1),v.filter_limit=o;var j=window.location.href.split("?")[0];return"".concat(j,"?").concat(Ce.stringify(v))}}}});zs.render=_s;var Ys=zs,Qs=window,Ks=Qs.$,Xs={mounted:function(e,t){e.addEventListener("click",(function(){var n=Ce.hashParsed.value.popover,r=Ks(e).closest("[data-report]").data("uiControlObject"),i=window.Piwik_Popover.showLoading("Export"),a=t.value.reportFormats,o=r.param.filter_limit;t.value.maxFilterLimit>0&&(o=Math.min(o,t.value.maxFilterLimit));var l=!0===r.param.flat||1===r.param.flat||"1"===r.param.flat,c={initialReportType:"default",initialReportLimit:o>0?o:100,initialReportLimitAll:-1===o?"yes":"no",initialOptionFlat:l,initialOptionExpanded:!0,initialOptionFormatMetrics:!1,hasSubtables:l||r.numberOfSubtables>0,availableReportFormats:{default:a,processed:{XML:a.XML,JSON:a.JSON}},availableReportTypes:{default:C("CoreHome_StandardReport"),processed:C("CoreHome_ReportWithMetadata")},limitAllOptions:{yes:C("General_All"),no:C("CoreHome_CustomLimit")},maxFilterLimit:t.value.maxFilterLimit,dataTable:r,requestParams:t.value.requestParams,apiMethod:t.value.apiMethod},s=ut({template:'\n <popover v-bind="bind"/>',data:function(){return{bind:c}}});s.component("popover",Ys);var u=document.createElement("div");s.mount(u);var d=t.value.reportTitle;window.Piwik_Popover.setTitle("".concat(C("General_Export")," ").concat(S.helper.htmlEntities(d))),window.Piwik_Popover.setContent(u),window.Piwik_Popover.onClose((function(){s.unmount(),""!==n&&setTimeout((function(){Ce.updateHash(Object.assign(Object.assign({},Ce.hashParsed.value),{},{popover:n})),t.value.onClose&&t.value.onClose()}),100)})),setTimeout((function(){i.dialog(),Ks(".exportFullUrl, .btn",i).tooltip({track:!0,show:!1,hide:!1})}),100)}))}}; /*! * Matomo - free/libre analytics platform * @@ -510,13 +510,13 @@ window.angular.module("piwikApp.service").factory("reportMetadataModel",(functio * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -function eu(e){return{restrict:"A",scope:{reportTitle:"@",requestParams:"@",reportFormats:"@",apiMethod:"@",maxFilterLimit:"@"},link:function(t,n){var r={instance:null,value:{reportTitle:t.reportTitle,requestParams:t.requestParams,reportFormats:"string"===typeof t.reportFormats?JSON.parse(t.reportFormats):t.reportFormats,apiMethod:t.apiMethod,maxFilterLimit:parseInt(t.maxFilterLimit,10),onClose:function(){e((function(){window.angular.element(document).injector().get("$rootScope").$apply()}),10)}},oldValue:null,modifiers:{},dir:{}};Zs.mounted(n[0],r)}}}eu.$inject=["$timeout"],window.angular.module("piwikApp").directive("piwikReportExport",eu);var tu=["src"];function nu(e,t,n,r,i,o){return Object(a["openBlock"])(),Object(a["createElementBlock"])("img",{src:e.sparklineUrl},null,8,tu)}var ru=Object(a["defineComponent"])({props:{seriesIndices:Array,params:Object},data:function(){return{isWidget:!1}},mounted:function(){this.isWidget=!!this.$el.closest("[widgetId]")},computed:{sparklineUrl:function(){var e=this.seriesIndices,t=this.params,n=S.getSparklineColors();e&&(n.lineColor=n.lineColor.filter((function(t,n){return-1!==e.indexOf(n)})));var r=JSON.stringify(n),i={forceView:"1",viewDataTable:"sparkline",widget:this.isWidget?"1":"0",showtitle:"1",colors:r,random:Date.now(),date:this.defaultDate},a=new Xe,o=a.mixinDefaultGetParams(Object.assign(Object.assign({},i),t)),l=Ce.parsed.value.token_auth;return l&&l.length&&S.shouldPropagateTokenAuth&&(o.token_auth=l),"?".concat(Ce.stringify(o))},defaultDate:function(){if("range"===S.period)return"".concat(S.startDateString,",").concat(S.endDateString);var e=_.getLastNRange(S.period,30,S.currentDateString).getDateRange(),t=new Date(S.minDateYear,S.minDateMonth-1,S.minDateDay);e[0]<t&&(e[0]=t);var n=E(e[0]),r=E(e[1]);return"".concat(n,",").concat(r)}}});ru.render=nu;var iu=ru,au=(jt({component:iu,scope:{seriesIndices:{angularJsBind:"<"},params:{angularJsBind:"<"}},directiveName:"piwikSparkline",restrict:"E"}),{class:"progressbar"}),ou={class:"progress"},lu=Object(a["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif"},null,-1),cu=["innerHTML"]; +function Zs(e){return{restrict:"A",scope:{reportTitle:"@",requestParams:"@",reportFormats:"@",apiMethod:"@",maxFilterLimit:"@"},link:function(t,n){var r={instance:null,value:{reportTitle:t.reportTitle,requestParams:t.requestParams,reportFormats:"string"===typeof t.reportFormats?JSON.parse(t.reportFormats):t.reportFormats,apiMethod:t.apiMethod,maxFilterLimit:parseInt(t.maxFilterLimit,10),onClose:function(){e((function(){window.angular.element(document).injector().get("$rootScope").$apply()}),10)}},oldValue:null,modifiers:{},dir:{}};Xs.mounted(n[0],r)}}}Zs.$inject=["$timeout"],window.angular.module("piwikApp").directive("piwikReportExport",Zs);var eu=["src"];function tu(e,t,n,r,i,o){return Object(a["openBlock"])(),Object(a["createElementBlock"])("img",{src:e.sparklineUrl},null,8,eu)}var nu=Object(a["defineComponent"])({props:{seriesIndices:Array,params:Object},data:function(){return{isWidget:!1}},mounted:function(){this.isWidget=!!this.$el.closest("[widgetId]")},computed:{sparklineUrl:function(){var e=this.seriesIndices,t=this.params,n=S.getSparklineColors();e&&(n.lineColor=n.lineColor.filter((function(t,n){return-1!==e.indexOf(n)})));var r=JSON.stringify(n),i={forceView:"1",viewDataTable:"sparkline",widget:this.isWidget?"1":"0",showtitle:"1",colors:r,random:Date.now(),date:this.defaultDate},a=new Xe,o=a.mixinDefaultGetParams(Object.assign(Object.assign({},i),t)),l=Ce.parsed.value.token_auth;return l&&l.length&&S.shouldPropagateTokenAuth&&(o.token_auth=l),"?".concat(Ce.stringify(o))},defaultDate:function(){if("range"===S.period)return"".concat(S.startDateString,",").concat(S.endDateString);var e=_.getLastNRange(S.period,30,S.currentDateString).getDateRange(),t=new Date(S.minDateYear,S.minDateMonth-1,S.minDateDay);e[0]<t&&(e[0]=t);var n=E(e[0]),r=E(e[1]);return"".concat(n,",").concat(r)}}});nu.render=tu;var ru=nu,iu=(jt({component:ru,scope:{seriesIndices:{angularJsBind:"<"},params:{angularJsBind:"<"}},directiveName:"piwikSparkline",restrict:"E"}),{class:"progressbar"}),au={class:"progress"},ou=Object(a["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif"},null,-1),lu=["innerHTML"]; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function su(e,t,n,r,i,o){return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",au,[Object(a["createElementVNode"])("div",ou,[Object(a["createElementVNode"])("div",{class:"determinate",style:Object(a["normalizeStyle"])([{width:"0"},{width:"".concat(e.actualProgress,"%")}])},null,4)]),Object(a["withDirectives"])(Object(a["createElementVNode"])("span",null,[lu,Object(a["createElementVNode"])("span",{class:"label",innerHTML:e.$sanitize(e.label)},null,8,cu)],512),[[a["vShow"],!!e.label]])])}var uu=Object(a["defineComponent"])({props:{progress:{type:Number,required:!0},label:String},computed:{actualProgress:function(){return this.progress>100?100:this.progress<0?0:this.progress}}});uu.render=su;var du=uu,pu=(jt({component:du,scope:{progress:{angularJsBind:"="},label:{angularJsBind:"="}},directiveName:"piwikProgressbar"}),{mounted:function(e){e.classList.add("piwik-content-intro")},updated:function(e){Object(a["nextTick"])((function(){e.classList.add("piwik-content-intro")}))}}); + */function cu(e,t,n,r,i,o){return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",iu,[Object(a["createElementVNode"])("div",au,[Object(a["createElementVNode"])("div",{class:"determinate",style:Object(a["normalizeStyle"])([{width:"0"},{width:"".concat(e.actualProgress,"%")}])},null,4)]),Object(a["withDirectives"])(Object(a["createElementVNode"])("span",null,[ou,Object(a["createElementVNode"])("span",{class:"label",innerHTML:e.$sanitize(e.label)},null,8,lu)],512),[[a["vShow"],!!e.label]])])}var su=Object(a["defineComponent"])({props:{progress:{type:Number,required:!0},label:String},computed:{actualProgress:function(){return this.progress>100?100:this.progress<0?0:this.progress}}});su.render=cu;var uu=su,du=(jt({component:uu,scope:{progress:{angularJsBind:"="},label:{angularJsBind:"="}},directiveName:"piwikProgressbar"}),{mounted:function(e){e.classList.add("piwik-content-intro")},updated:function(e){Object(a["nextTick"])((function(){e.classList.add("piwik-content-intro")}))}}); /*! * Matomo - free/libre analytics platform * @@ -529,37 +529,37 @@ function eu(e){return{restrict:"A",scope:{reportTitle:"@",requestParams:"@",repo * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -function mu(){return{restrict:"A",link:function(e,t){pu.mounted(t[0])}}}window.angular.module("piwikApp").directive("piwikContentIntro",mu); +function pu(){return{restrict:"A",link:function(e,t){du.mounted(t[0])}}}window.angular.module("piwikApp").directive("piwikContentIntro",pu); /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */var fu={mounted:function(e){e.classList.add("card","card-table","entityTable")},updated:function(e){Object(a["nextTick"])((function(){e.classList.add("card","card-table","entityTable")}))}}; + */var mu={mounted:function(e){e.classList.add("card","card-table","entityTable")},updated:function(e){Object(a["nextTick"])((function(){e.classList.add("card","card-table","entityTable")}))}}; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function hu(){return{restrict:"A",link:function(e,t){fu.mounted(t[0])}}}window.angular.module("piwikApp").directive("piwikContentTable",hu);var gu={ref:"root"};function vu(e,t,n,r,i,o){return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",gu,[Object(a["renderSlot"])(e.$slots,"default",{formData:e.formData,submitApiMethod:e.submitApiMethod,sendJsonPayload:e.sendJsonPayload,noErrorNotification:e.noErrorNotification,noSuccessNotification:e.noSuccessNotification,submitForm:e.submitForm,isSubmitting:e.isSubmitting,successfulPostResponse:e.successfulPostResponse,errorPostResponse:e.errorPostResponse})],512)}var bu=window,yu=bu.$,wu=Object(a["defineComponent"])({props:{formData:{type:Object,required:!0},submitApiMethod:{type:String,required:!0},sendJsonPayload:Boolean,noErrorNotification:Boolean,noSuccessNotification:Boolean},data:function(){return{isSubmitting:!1,successfulPostResponse:null,errorPostResponse:null}},emits:["update:modelValue"],mounted:function(){var e=this;yu(this.$refs.root).on("click","input[type=submit]",(function(){e.submitForm()}))},methods:{submitForm:function(){var e=this;this.successfulPostResponse=null,this.errorPostResponse=null;var t=this.formData;this.sendJsonPayload&&(t={data:JSON.stringify(this.formData)}),this.isSubmitting=!0,Xe.post({module:"API",method:this.submitApiMethod},t,{createErrorNotification:!this.noErrorNotification}).then((function(t){if(e.successfulPostResponse=t,!e.noSuccessNotification){var n=fl.show({message:C("General_YourChangesHaveBeenSaved"),context:"success",type:"toast",id:"ajaxHelper"});fl.scrollToNotification(n)}})).catch((function(t){e.errorPostResponse=t.message})).finally((function(){e.isSubmitting=!1}))}}});wu.render=vu;var Ou=wu,ju=window,ku=ju.$; + */function fu(){return{restrict:"A",link:function(e,t){mu.mounted(t[0])}}}window.angular.module("piwikApp").directive("piwikContentTable",fu);var hu={ref:"root"};function gu(e,t,n,r,i,o){return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",hu,[Object(a["renderSlot"])(e.$slots,"default",{formData:e.formData,submitApiMethod:e.submitApiMethod,sendJsonPayload:e.sendJsonPayload,noErrorNotification:e.noErrorNotification,noSuccessNotification:e.noSuccessNotification,submitForm:e.submitForm,isSubmitting:e.isSubmitting,successfulPostResponse:e.successfulPostResponse,errorPostResponse:e.errorPostResponse})],512)}var vu=window,bu=vu.$,yu=Object(a["defineComponent"])({props:{formData:{type:Object,required:!0},submitApiMethod:{type:String,required:!0},sendJsonPayload:Boolean,noErrorNotification:Boolean,noSuccessNotification:Boolean},data:function(){return{isSubmitting:!1,successfulPostResponse:null,errorPostResponse:null}},emits:["update:modelValue"],mounted:function(){var e=this;bu(this.$refs.root).on("click","input[type=submit]",(function(){e.submitForm()}))},methods:{submitForm:function(){var e=this;this.successfulPostResponse=null,this.errorPostResponse=null;var t=this.formData;this.sendJsonPayload&&(t={data:JSON.stringify(this.formData)}),this.isSubmitting=!0,Xe.post({module:"API",method:this.submitApiMethod},t,{createErrorNotification:!this.noErrorNotification}).then((function(t){if(e.successfulPostResponse=t,!e.noSuccessNotification){var n=fl.show({message:C("General_YourChangesHaveBeenSaved"),context:"success",type:"toast",id:"ajaxHelper"});fl.scrollToNotification(n)}})).catch((function(t){e.errorPostResponse=t.message})).finally((function(){e.isSubmitting=!1}))}}});yu.render=gu;var wu=yu,Ou=window,ju=Ou.$; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function Su(e){return{restrict:"A",scope:{submitApiMethod:"=",sendJsonPayload:"=",noErrorNotification:"=",noSuccessNotification:"=",useCustomDataBinding:"="},require:"?ngModel",transclude:!0,compile:function(t,n){return n.noErrorNotification=!!n.noErrorNotification,function(t,n,r,i,o){if(!t.submitApiMethod)throw new Error("submitApiMethod is required");if(t.ajaxForm={},t.ajaxForm.submitApiMethod=t.submitApiMethod,t.ajaxForm.sendJsonPayload=t.sendJsonPayload,t.ajaxForm.noErrorNotification=t.noErrorNotification,t.ajaxForm.noSuccessNotification=t.noSuccessNotification,t.ajaxForm.data={},i){var l=e(r.ngModel);t.ajaxForm.data=l(t.$parent)}var c={mounted:function(e,n){t.ajaxForm.submitForm=n.value.submitForm}},s='\n <AjaxForm\n :form-data="data"\n :submit-api-method="submitApiMethod"\n :send-json-payload="sendJsonPayload"\n :no-error-notification="noErrorNotification"\n :no-success-notification="noSuccessNotification"\n >\n <template v-slot:default="ajaxFormVue">\n <div\n ref="transcludeTarget"\n v-special-bind-directive="{ submitForm: ajaxFormVue.submitForm }"\n />\n </template>\n </AjaxForm>',u=ut({template:s,data:function(){return t.ajaxForm},setup:function(){var e=Object(a["ref"])(null);return{transcludeTarget:e}}});u.component("AjaxForm",Ou),u.directive("SpecialBindDirective",c);var d=u.mount(n[0]);function p(e,n){var r,i=ku(e).attr("name");r="checkbox"===ku(e).attr("type")?ku(e).is(":checked"):ku(e).val(),t.ajaxForm.data[i]=r,n||setTimeout((function(){t.$apply()}),0)}n.on("$destroy",(function(){u.unmount()})),t.useCustomDataBinding||n.on("change","input,select",(function(e){p(e.target)})),o(t,(function(e,t){if(!t.useCustomDataBinding){var n=e.find("input,select").not("[type=submit]");n.each((function(){p(this,!0)}))}ku(d.transcludeTarget).append(e)}))}}}}function Cu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Eu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Du(e,t,n){return t&&Eu(e.prototype,t),n&&Eu(e,n),e}function Pu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} + */function ku(e){return{restrict:"A",scope:{submitApiMethod:"=",sendJsonPayload:"=",noErrorNotification:"=",noSuccessNotification:"=",useCustomDataBinding:"="},require:"?ngModel",transclude:!0,compile:function(t,n){return n.noErrorNotification=!!n.noErrorNotification,function(t,n,r,i,o){if(!t.submitApiMethod)throw new Error("submitApiMethod is required");if(t.ajaxForm={},t.ajaxForm.submitApiMethod=t.submitApiMethod,t.ajaxForm.sendJsonPayload=t.sendJsonPayload,t.ajaxForm.noErrorNotification=t.noErrorNotification,t.ajaxForm.noSuccessNotification=t.noSuccessNotification,t.ajaxForm.data={},i){var l=e(r.ngModel);t.ajaxForm.data=l(t.$parent)}var c={mounted:function(e,n){t.ajaxForm.submitForm=n.value.submitForm}},s='\n <AjaxForm\n :form-data="data"\n :submit-api-method="submitApiMethod"\n :send-json-payload="sendJsonPayload"\n :no-error-notification="noErrorNotification"\n :no-success-notification="noSuccessNotification"\n >\n <template v-slot:default="ajaxFormVue">\n <div\n ref="transcludeTarget"\n v-special-bind-directive="{ submitForm: ajaxFormVue.submitForm }"\n />\n </template>\n </AjaxForm>',u=ut({template:s,data:function(){return t.ajaxForm},setup:function(){var e=Object(a["ref"])(null);return{transcludeTarget:e}}});u.component("AjaxForm",wu),u.directive("SpecialBindDirective",c);var d=u.mount(n[0]);function p(e,n){var r,i=ju(e).attr("name");r="checkbox"===ju(e).attr("type")?ju(e).is(":checked"):ju(e).val(),t.ajaxForm.data[i]=r,n||setTimeout((function(){t.$apply()}),0)}n.on("$destroy",(function(){u.unmount()})),t.useCustomDataBinding||n.on("change","input,select",(function(e){p(e.target)})),o(t,(function(e,t){if(!t.useCustomDataBinding){var n=e.find("input,select").not("[type=submit]");n.each((function(){p(this,!0)}))}ju(d.transcludeTarget).append(e)}))}}}}function Su(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Cu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Eu(e,t,n){return t&&Cu(e.prototype,t),n&&Cu(e,n),e}function Du(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */Su.$inject=["$parse"],window.angular.module("piwikApp").directive("piwikAjaxForm",Su);var Vu=function(){function e(t){Cu(this,e),Pu(this,"type",void 0),Pu(this,"instance",void 0),this.type=t}return Du(e,[{key:"get",value:function(e,t,n){if(!this.instance){var r=this.type;this.instance=new r}return Reflect.get(this.instance,t,n)}}]),e}();function Nu(e){return new Proxy({},new Vu(e))} + */ku.$inject=["$parse"],window.angular.module("piwikApp").directive("piwikAjaxForm",ku);var Pu=function(){function e(t){Su(this,e),Du(this,"type",void 0),Du(this,"instance",void 0),this.type=t}return Eu(e,[{key:"get",value:function(e,t,n){if(!this.instance){var r=this.type;this.instance=new r}return Reflect.get(this.instance,t,n)}}]),e}();function Vu(e){return new Proxy({},new Pu(e))} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */var Tu=jt({component:ho,scope:{loading:{vue:"loading",angularJsBind:"<"},loadingMessage:{vue:"loadingMessage",angularJsBind:"<",default:function(){return C("General_LoadingData")}}},$inject:[],directiveName:"piwikActivityIndicator"});function Au(e,t,n){var r=new Date;n||(n=432e4),r.setTime(r.getTime()+n),document.cookie="".concat(e,"=").concat(t,"; expires=").concat(r.toUTCString(),"; path=/")}function Iu(e){var t="; ".concat(document.cookie),n=t.split("; ".concat(e,"="));if(2==n.length){var r=n.pop().split(";").shift();if("undefined"!==typeof r)return r}return null}function xu(e){var t=new Date;t.setTime(t.getTime()+-864e5),document.cookie="".concat(e,"=; expires=").concat(t.toUTCString(),"; path=/")} + */var Nu=jt({component:ho,scope:{loading:{vue:"loading",angularJsBind:"<"},loadingMessage:{vue:"loadingMessage",angularJsBind:"<",default:function(){return C("General_LoadingData")}}},$inject:[],directiveName:"piwikActivityIndicator"});function Tu(e,t,n){var r=new Date;n||(n=432e4),r.setTime(r.getTime()+n),document.cookie="".concat(e,"=").concat(t,"; expires=").concat(r.toUTCString(),"; path=/")}function Au(e){var t="; ".concat(document.cookie),n=t.split("; ".concat(e,"="));if(2==n.length){var r=n.pop().split(";").shift();if("undefined"!==typeof r)return r}return null}function Iu(e){var t=new Date;t.setTime(t.getTime()+-864e5),document.cookie="".concat(e,"=; expires=").concat(t.toUTCString(),"; path=/")} /*! * Matomo - free/libre analytics platform * diff --git a/plugins/CoreHome/vue/src/ReportingPage/ReportingPage.store.ts b/plugins/CoreHome/vue/src/ReportingPage/ReportingPage.store.ts index 24016e11ba..869117dfc6 100644 --- a/plugins/CoreHome/vue/src/ReportingPage/ReportingPage.store.ts +++ b/plugins/CoreHome/vue/src/ReportingPage/ReportingPage.store.ts @@ -14,12 +14,12 @@ import { import ReportingPagesStoreInstance, { Page } from '../ReportingPages/ReportingPages.store'; import ReportMetadataStoreInstance from '../ReportMetadata/ReportMetadata.store'; import { sortOrderables } from '../Orderable'; +import { getWidgetChildren } from '../Widget/Widgets.store'; import { - getWidgetChildren, GroupedWidgets, Widget, WidgetContainer, -} from '../Widget/Widgets.store'; +} from '../Widget/types'; interface ReportingMenuStoreState { page?: DeepReadonly<Page>; diff --git a/plugins/CoreHome/vue/src/ReportingPage/ReportingPage.vue b/plugins/CoreHome/vue/src/ReportingPage/ReportingPage.vue index 61392f9dd8..d1cd8388c7 100644 --- a/plugins/CoreHome/vue/src/ReportingPage/ReportingPage.vue +++ b/plugins/CoreHome/vue/src/ReportingPage/ReportingPage.vue @@ -83,6 +83,12 @@ interface ReportingPageState { hasNoPage: boolean; } +interface LoadPageArgs { + category: string; + subcategory: string; + promise?: Promise<void>; +} + export default defineComponent({ components: { ActivityIndicator, @@ -175,24 +181,13 @@ export default defineComponent({ this.showOnlyRawDataMessageIfRequired(); } - if (category === 'Dashboard_Dashboard' - && $.isNumeric(subcategory) - && $('[piwik-dashboard]').length - ) { - // TODO: should be changed eventually - // hack to make loading of dashboards faster since all the information is already there - // in the piwik-dashboard widget, we can let the piwik-dashboard widget render the page. - // We need to find a proper solution for this. A workaround for now could be an event or - // something to let other components render a specific page. + const params: LoadPageArgs = { category, subcategory }; + Matomo.postEvent('ReportingPage.loadPage', params); + if (params.promise) { this.loading = true; - const element = $('[piwik-dashboard]'); - const scope = window.angular.element(element).scope() as any; // eslint-disable-line - scope.fetchDashboard(parseInt(subcategory, 10)).then(() => { - this.loading = false; - }, () => { + Promise.resolve(params.promise).finally(() => { this.loading = false; }); - return; } diff --git a/plugins/CoreHome/vue/src/ReportingPages/ReportingPages.store.ts b/plugins/CoreHome/vue/src/ReportingPages/ReportingPages.store.ts index 3f91b08ed8..e59986d6f6 100644 --- a/plugins/CoreHome/vue/src/ReportingPages/ReportingPages.store.ts +++ b/plugins/CoreHome/vue/src/ReportingPages/ReportingPages.store.ts @@ -10,7 +10,7 @@ import { computed, readonly, DeepReadonly, } from 'vue'; import AjaxHelper from '../AjaxHelper/AjaxHelper'; -import { Widget } from '../Widget/Widgets.store'; +import { Widget } from '../Widget/types'; interface CategoryRef { id: string; diff --git a/plugins/CoreHome/vue/src/Widget/Widget.vue b/plugins/CoreHome/vue/src/Widget/Widget.vue index 67f5838760..720970109e 100644 --- a/plugins/CoreHome/vue/src/Widget/Widget.vue +++ b/plugins/CoreHome/vue/src/Widget/Widget.vue @@ -39,11 +39,11 @@ import { DeepReadonly, defineComponent } from 'vue'; import WidgetLoader from '../WidgetLoader/WidgetLoader.vue'; import WidgetContainer from '../WidgetContainer/WidgetContainer.vue'; import WidgetByDimensionContainer from '../WidgetByDimensionContainer/WidgetByDimensionContainer.vue'; -import WidgetsStoreInstance, { - getWidgetChildren, +import WidgetsStoreInstance, { getWidgetChildren } from './Widgets.store'; +import { Widget as WidgetData, WidgetContainer as WidgetDataContainer, -} from './Widgets.store'; +} from './types'; import AjaxHelper from '../AjaxHelper/AjaxHelper'; import ReportMetadataStoreInstance from '../ReportMetadata/ReportMetadata.store'; import Tooltips from '../Tooltips/Tooltips'; diff --git a/plugins/CoreHome/vue/src/Widget/Widgets.store.ts b/plugins/CoreHome/vue/src/Widget/Widgets.store.ts index 30823bb0cb..0ef76bee1c 100644 --- a/plugins/CoreHome/vue/src/Widget/Widgets.store.ts +++ b/plugins/CoreHome/vue/src/Widget/Widgets.store.ts @@ -11,37 +11,8 @@ import { computed, DeepReadonly, } from 'vue'; -import { Subcategory } from '../ReportingMenu/Subcategory'; import MatomoUrl from '../MatomoUrl/MatomoUrl'; -import { Orderable } from '../Orderable'; - -export interface Widget extends Orderable { - uniqueId?: string; - module?: string; - action?: string; - viewDataTable?: string; - parameters?: Record<string, unknown>; - subcategory?: Subcategory; - isContainer?: boolean; - isReport?: boolean; - middlewareParameters?: Record<string, unknown>; - documentation?: string; - layout?: string; - isWide?: boolean; - isFirstInPage?: boolean; -} - -// get around DeepReadonly<> not being able to handle recursive types by moving the -// recursive properties to subtypes that are only referenced when needed -export interface WidgetContainer extends Widget { - widgets?: Widget[]; -} - -export interface GroupedWidgets { - group: boolean; - left?: Widget[]; - right?: Widget[]; -} +import { Widget, WidgetContainer } from './types'; interface WidgetsStoreState { isFetchedFirstTime: boolean; diff --git a/plugins/CoreHome/vue/src/Widget/types.ts b/plugins/CoreHome/vue/src/Widget/types.ts new file mode 100644 index 0000000000..598fe567b9 --- /dev/null +++ b/plugins/CoreHome/vue/src/Widget/types.ts @@ -0,0 +1,37 @@ +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +import { Orderable } from '../Orderable'; +import { Subcategory } from '../ReportingMenu/Subcategory'; + +export interface Widget extends Orderable { + uniqueId?: string; + module?: string; + action?: string; + viewDataTable?: string; + parameters?: Record<string, unknown>; + subcategory?: Subcategory; + isContainer?: boolean; + isReport?: boolean; + middlewareParameters?: Record<string, unknown>; + documentation?: string; + layout?: string; + isWide?: boolean; + isFirstInPage?: boolean; +} + +// get around DeepReadonly<> not being able to handle recursive types by moving the +// recursive properties to subtypes that are only referenced when needed +export interface WidgetContainer extends Widget { + widgets?: Widget[]; +} + +export interface GroupedWidgets { + group: boolean; + left?: Widget[]; + right?: Widget[]; +} diff --git a/plugins/CoreHome/vue/src/WidgetByDimensionContainer/WidgetByDimensionContainer.adapter.ts b/plugins/CoreHome/vue/src/WidgetByDimensionContainer/WidgetByDimensionContainer.adapter.ts index bf2a7e4b3a..7f3f2bfb65 100644 --- a/plugins/CoreHome/vue/src/WidgetByDimensionContainer/WidgetByDimensionContainer.adapter.ts +++ b/plugins/CoreHome/vue/src/WidgetByDimensionContainer/WidgetByDimensionContainer.adapter.ts @@ -7,7 +7,7 @@ import createAngularJsAdapter from '../createAngularJsAdapter'; import WidgetByDimensionContainer from './WidgetByDimensionContainer.vue'; -import { Widget } from '../Widget/Widgets.store'; +import { Widget } from '../Widget/types'; export default createAngularJsAdapter({ component: WidgetByDimensionContainer, diff --git a/plugins/CoreHome/vue/src/WidgetByDimensionContainer/WidgetByDimensionContainer.vue b/plugins/CoreHome/vue/src/WidgetByDimensionContainer/WidgetByDimensionContainer.vue index 0e1a0d081a..60e87a342b 100644 --- a/plugins/CoreHome/vue/src/WidgetByDimensionContainer/WidgetByDimensionContainer.vue +++ b/plugins/CoreHome/vue/src/WidgetByDimensionContainer/WidgetByDimensionContainer.vue @@ -40,11 +40,9 @@ <script lang="ts"> import { defineComponent } from 'vue'; import WidgetLoader from '../WidgetLoader/WidgetLoader.vue'; -import { Widget } from '../Widget/Widgets.store'; +import { Widget } from '../Widget/types'; import { sortOrderables } from '../Orderable'; -// TODO: is there a widget category ID or widget ID - interface WidgetByDimensionContainerState { selectedWidget: Widget|null; } diff --git a/plugins/CoreHome/vue/src/WidgetContainer/WidgetContainer.vue b/plugins/CoreHome/vue/src/WidgetContainer/WidgetContainer.vue index f581e0208a..5f294cbc0b 100644 --- a/plugins/CoreHome/vue/src/WidgetContainer/WidgetContainer.vue +++ b/plugins/CoreHome/vue/src/WidgetContainer/WidgetContainer.vue @@ -23,7 +23,7 @@ <script lang="ts"> import { defineComponent } from 'vue'; import useExternalPluginComponent from '../useExternalPluginComponent'; -import { Widget as WidgetData } from '../Widget/Widgets.store'; +import { Widget as WidgetData } from '../Widget/types'; // since we're recursing, don't import the plugin directly const Widget = useExternalPluginComponent('CoreHome', 'Widget'); diff --git a/plugins/CoreHome/vue/src/index.ts b/plugins/CoreHome/vue/src/index.ts index 9e44ab2249..965cd2002b 100644 --- a/plugins/CoreHome/vue/src/index.ts +++ b/plugins/CoreHome/vue/src/index.ts @@ -113,6 +113,11 @@ export { default as WidgetLoader } from './WidgetLoader/WidgetLoader.vue'; export { default as WidgetContainer } from './WidgetContainer/WidgetContainer.vue'; export { default as WidgetByDimensionContainer } from './WidgetByDimensionContainer/WidgetByDimensionContainer.vue'; export { default as Widget } from './Widget/Widget.vue'; +export { + Widget as WidgetType, + WidgetContainer as WidgetContainerType, + GroupedWidgets as GroupedWidgetsType, +} from './Widget/types'; export { default as ReportingPage } from './ReportingPage/ReportingPage.vue'; export { default as ReportExport } from './ReportExport/ReportExport'; export { default as Sparkline } from './Sparkline/Sparkline.vue'; diff --git a/plugins/CoreVue/types/index.d.ts b/plugins/CoreVue/types/index.d.ts index 5e742cdbb1..18b1e7fe34 100644 --- a/plugins/CoreVue/types/index.d.ts +++ b/plugins/CoreVue/types/index.d.ts @@ -165,6 +165,8 @@ declare global { interface WidgetsHelper { availableWidgets?: unknown[]; getAvailableWidgets(callback?: (widgets: Record<string, unknown[]>) => unknown); + + firstGetAvailableWidgetsCall?: Promise<void>; } let widgetsHelper: WidgetsHelper; @@ -191,6 +193,7 @@ declare global { require(p: string): any; initTopControls(): void; vueSanitize(content: string): string; + showEmptyDashboardNotification(): void; } } diff --git a/plugins/Dashboard/Dashboard.php b/plugins/Dashboard/Dashboard.php index 652bad1b4f..50898f119c 100644 --- a/plugins/Dashboard/Dashboard.php +++ b/plugins/Dashboard/Dashboard.php @@ -288,12 +288,10 @@ class Dashboard extends \Piwik\Plugin public function getJsFiles(&$jsFiles) { - $jsFiles[] = "plugins/Dashboard/angularjs/common/services/dashboards-model.js"; $jsFiles[] = "plugins/Dashboard/javascripts/widgetMenu.js"; $jsFiles[] = "plugins/Dashboard/javascripts/dashboardObject.js"; $jsFiles[] = "plugins/Dashboard/javascripts/dashboardWidget.js"; $jsFiles[] = "plugins/Dashboard/javascripts/dashboard.js"; - $jsFiles[] = "plugins/Dashboard/angularjs/dashboard/dashboard.directive.js"; } public function getStylesheetFiles(&$stylesheets) diff --git a/plugins/Dashboard/angularjs/common/services/dashboards-model.js b/plugins/Dashboard/angularjs/common/services/dashboards-model.js deleted file mode 100644 index 710e57220f..0000000000 --- a/plugins/Dashboard/angularjs/common/services/dashboards-model.js +++ /dev/null @@ -1,70 +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('dashboardsModel', dashboardsModel); - - dashboardsModel.$inject = ['piwikApi']; - - function dashboardsModel (piwikApi) { - - var dashboardsPromise = null; - - var model = { - dashboards: [], - getAllDashboards: getAllDashboards, - reloadAllDashboards: reloadAllDashboards, - getDashboard: getDashboard, - getDashboardLayout: getDashboardLayout - }; - - return model; - - function getDashboard(dashboardId) - { - return getAllDashboards().then(function (dashboards) { - var dashboard = null; - angular.forEach(dashboards, function (board) { - if (parseInt(board.id, 10) === parseInt(dashboardId, 10)) { - dashboard = board; - } - }); - return dashboard; - }); - } - - function getDashboardLayout(dashboardId) - { - piwikApi.withTokenInUrl(); - - return piwikApi.fetch({module: 'Dashboard', action: 'getDashboardLayout', idDashboard: dashboardId}); - } - - function reloadAllDashboards() - { - if (dashboardsPromise) { - dashboardsPromise = null; - } - - return getAllDashboards(); - } - - function getAllDashboards() - { - if (!dashboardsPromise) { - dashboardsPromise = piwikApi.fetch({method: 'Dashboard.getDashboards', filter_limit: '-1'}).then(function (response) { - if (response) { - model.dashboards = response; - } - - return response; - }); - } - - return dashboardsPromise; - } - } -})();
\ No newline at end of file diff --git a/plugins/Dashboard/angularjs/dashboard/dashboard.directive.js b/plugins/Dashboard/angularjs/dashboard/dashboard.directive.js deleted file mode 100644 index 092e314140..0000000000 --- a/plugins/Dashboard/angularjs/dashboard/dashboard.directive.js +++ /dev/null @@ -1,113 +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 - */ - -/** - * <div piwik-dashboard dashboard-id="5"></div> - */ -(function () { - angular.module('piwikApp').directive('piwikDashboard', piwikDashboard); - - piwikDashboard.$inject = ['dashboardsModel', '$rootScope', '$q']; - - function piwikDashboard(dashboardsModel, $rootScope, $q) { - - function renderDashboard(dashboardId, dashboard, layout) - { - $('.dashboardSettings').show(); - initTopControls(); - - // Embed dashboard / exported as widget - if (!$('#topBars').length) { - $('.dashboardSettings').after($('#Dashboard')); - $('#Dashboard ul li').removeClass('active'); - $('#Dashboard_embeddedIndex_' + dashboardId).addClass('active'); - } - - widgetsHelper.getAvailableWidgets(); - - $('#dashboardWidgetsArea').off('dashboardempty', showEmptyDashboardNotification); - $('#dashboardWidgetsArea') - .on('dashboardempty', showEmptyDashboardNotification) - .dashboard({ - idDashboard: dashboardId, - layout: layout, - name: dashboard ? dashboard.name : '' - }); - - var divElements = $('#columnPreview').find('>div'); - - divElements.each(function () { - var width = []; - $('div', this).each(function () { - width.push(this.className.replace(/width-/, '')); - }); - $(this).attr('layout', width.join('-')); - }); - - divElements.off('click.renderDashboard'); - divElements.on('click.renderDashboard', function () { - divElements.removeClass('choosen'); - $(this).addClass('choosen'); - }); - } - - function fetchDashboard(dashboardId) { - var dashboardElement = $('#dashboardWidgetsArea'); - dashboardElement.dashboard('destroyWidgets'); - dashboardElement.empty(); - globalAjaxQueue.abort(); - - var getDashboard = dashboardsModel.getDashboard(dashboardId); - var getLayout = dashboardsModel.getDashboardLayout(dashboardId); - - return $q.all([getDashboard, getLayout]).then(function (response) { - var dashboard = response[0]; - var layout = response[1]; - - $(function() { - renderDashboard(dashboardId, dashboard, layout); - }); - }); - } - - function clearDashboard () { - $('.top_controls .dashboard-manager').hide(); - $('#dashboardWidgetsArea').dashboard('destroy'); - } - - return { - restrict: 'A', - scope: { - dashboardid: '=', - layout: '=' - }, - link: function (scope, element, attrs) { - - scope.$parent.fetchDashboard = function (dashboardId) { - scope.dashboardId = dashboardId; - return fetchDashboard(dashboardId) - }; - - fetchDashboard(scope.dashboardid); - - function onLocationChange(event, newUrl, oldUrl) - { - if (broadcast.getValueFromUrl('module') != 'Widgetize' && newUrl !== oldUrl && - newUrl.indexOf('category=Dashboard_Dashboard') === -1) { - // we remove the dashboard only if we no longer show a dashboard. - clearDashboard(); - } - } - - // should be rather handled in route or so. - var unbind = $rootScope.$on('$locationChangeSuccess', onLocationChange); - scope.$on('$destroy', onLocationChange); - scope.$on('$destroy', unbind); - } - }; - } -})();
\ No newline at end of file diff --git a/plugins/Dashboard/javascripts/dashboard.js b/plugins/Dashboard/javascripts/dashboard.js index 7af6e407b5..cd7c62d5f6 100644 --- a/plugins/Dashboard/javascripts/dashboard.js +++ b/plugins/Dashboard/javascripts/dashboard.js @@ -28,9 +28,9 @@ function createDashboard() { ajaxRequest.setCallback( function (response) { var id = response.value; - angular.element(document).injector().invoke(function ($location, reportingMenuModel, dashboardsModel) { + angular.element(document).injector().invoke(function ($location, reportingMenuModel) { Promise.all([ - dashboardsModel.reloadAllDashboards(), + Dashboard.DashboardStore.reloadAllDashboards(), reportingMenuModel.reloadMenuItems(), ]).then(function () { $('#dashboardWidgetsArea').dashboard('loadDashboard', id); @@ -86,7 +86,9 @@ function showChangeDashboardLayoutDialog() { function showEmptyDashboardNotification() { piwikHelper.modalConfirm(makeSelectorLastId('dashboardEmptyNotification'), { resetDashboard: function () { $('#dashboardWidgetsArea').dashboard('resetLayout'); }, - addWidget: function () { $('.dashboardSettings > a').trigger('click'); } + addWidget: function () { + $('.dashboardSettings > a').trigger('click'); + } }); } diff --git a/plugins/Dashboard/javascripts/dashboardObject.js b/plugins/Dashboard/javascripts/dashboardObject.js index d7c20ca25b..1308d1a7a3 100644 --- a/plugins/Dashboard/javascripts/dashboardObject.js +++ b/plugins/Dashboard/javascripts/dashboardObject.js @@ -94,9 +94,7 @@ $location.search('subcategory', '' + dashboardIdToLoad); }); } else { - var element = $('[piwik-dashboard]'); - var scope = angular.element(element).scope(); - scope.fetchDashboard(dashboardIdToLoad); + piwik.postEvent('Dashboard.loadDashboard', dashboardIdToLoad); } return this; diff --git a/plugins/Dashboard/javascripts/widgetMenu.js b/plugins/Dashboard/javascripts/widgetMenu.js index 25d4a779d7..f79365c6a1 100644 --- a/plugins/Dashboard/javascripts/widgetMenu.js +++ b/plugins/Dashboard/javascripts/widgetMenu.js @@ -8,6 +8,11 @@ function widgetsHelper() { } +// a Promise for the first call to getAvailableWidgets. this should not be aborted, +// so any code that aborts all ajax requests should make sure this promise is resolved +// first. +widgetsHelper.firstGetAvailableWidgetsCall = null; + /** * Returns the available widgets fetched via AJAX (if not already done) * @@ -61,41 +66,50 @@ widgetsHelper.getAvailableWidgets = function (callback) { return moved; } - if (!widgetsHelper.availableWidgets) { + var promise = new Promise(function (resolve, reject) { + if (!widgetsHelper.availableWidgets) { var ajaxRequest = new ajaxHelper(); ajaxRequest._mixinDefaultGetParams = function (params) { - return params; + return params; }; ajaxRequest.addParams({ - module: 'API', - method: 'API.getWidgetMetadata', - filter_limit: '-1', - format: 'JSON', - deep: '1', - idSite: piwik.idSite || broadcast.getValueFromUrl('idSite') + module: 'API', + method: 'API.getWidgetMetadata', + filter_limit: '-1', + format: 'JSON', + deep: '1', + idSite: piwik.idSite || broadcast.getValueFromUrl('idSite') }, 'get'); ajaxRequest.setCallback( - function (data) { - widgetsHelper.availableWidgets = mergeCategoriesAndSubCategories(data); + function (data) { + widgetsHelper.availableWidgets = mergeCategoriesAndSubCategories(data); - if (callback) { - callback(widgetsHelper.availableWidgets); - } - } + resolve(); + } ); ajaxRequest.setErrorCallback(function (deferred, status) { - if (status == 'abort' || !deferred || deferred.status < 400 || deferred.status >= 600) { - return; - } - $('#loadingError').show(); + if (status == 'abort' || !deferred || deferred.status < 400 || deferred.status >= 600) { + return; + } + $('#loadingError').show(); + reject(); }); ajaxRequest.send(); return; + } + + resolve(); + }); + + if (!widgetsHelper.firstGetAvailableWidgetsCall) { + widgetsHelper.firstGetAvailableWidgetsCall = promise; } - if (callback) { + promise.then(function () { + if (callback) { callback(widgetsHelper.availableWidgets); - } + } + }); }; /** diff --git a/plugins/Dashboard/tests/UI/DashboardManager_spec.js b/plugins/Dashboard/tests/UI/DashboardManager_spec.js index 4fc6b9d64a..fe6e1d7b13 100644 --- a/plugins/Dashboard/tests/UI/DashboardManager_spec.js +++ b/plugins/Dashboard/tests/UI/DashboardManager_spec.js @@ -109,6 +109,9 @@ describe("DashboardManager", function () { await page.waitForTimeout(500); await page.waitForNetworkIdle(); + await page.waitForSelector('.widget'); + await page.waitForNetworkIdle(); + expect(await page.screenshot({ fullPage: true })).to.matchImage('removed'); }); }); diff --git a/plugins/Dashboard/tests/UI/Dashboard_spec.js b/plugins/Dashboard/tests/UI/Dashboard_spec.js index 269f6e4517..2140504911 100644 --- a/plugins/Dashboard/tests/UI/Dashboard_spec.js +++ b/plugins/Dashboard/tests/UI/Dashboard_spec.js @@ -130,6 +130,8 @@ describe("Dashboard", function () { it("should add a widget when a widget is selected in the dashboard manager", async function() { await page.click('.dashboard-manager .title'); + await page.waitForSelector('.widgetpreview-categorylist>li'); + var live = await page.jQuery('.widgetpreview-categorylist>li:contains(Goals)'); // have to mouse move twice... otherwise Live! will just be highlighted await live.hover(); await live.click(); @@ -233,6 +235,8 @@ describe("Dashboard", function () { await button.click(); await page.waitForNetworkIdle(); await page.mouse.move(-10, -10); + await page.waitForSelector('.widget'); + await page.waitForNetworkIdle(); expect(await page.screenshot({ fullPage: true })).to.matchImage('reset'); }); @@ -246,6 +250,8 @@ describe("Dashboard", function () { await page.mouse.move(-10, -10); await page.waitForTimeout(200); await page.waitForNetworkIdle(); + await page.waitForSelector('.widget'); + await page.waitForNetworkIdle(); expect(await page.screenshot({ fullPage: true })).to.matchImage('removed'); }); @@ -288,11 +294,11 @@ describe("Dashboard", function () { var button = await page.jQuery('.modal.open .modal-footer a:contains(Ok)'); await button.click(); await page.mouse.move(-10, -10); + await page.waitForSelector('.widget'); await page.waitForNetworkIdle(); expect(await page.screenshot({ fullPage: true })).to.matchImage('create_new'); }); - it("should load segmented dashboard", async function() { await removeAllExtraDashboards(); await page.goto(url + '&segment=' + encodeURIComponent("browserCode==FF")); diff --git a/plugins/Dashboard/vue/dist/Dashboard.umd.js b/plugins/Dashboard/vue/dist/Dashboard.umd.js new file mode 100644 index 0000000000..37eff018a6 --- /dev/null +++ b/plugins/Dashboard/vue/dist/Dashboard.umd.js @@ -0,0 +1,431 @@ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(require("CoreHome"), require("vue")); + else if(typeof define === 'function' && define.amd) + define(["CoreHome", ], factory); + else if(typeof exports === 'object') + exports["Dashboard"] = factory(require("CoreHome"), require("vue")); + else + root["Dashboard"] = factory(root["CoreHome"], root["Vue"]); +})((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__19dc__, __WEBPACK_EXTERNAL_MODULE__8bbf__) { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = "plugins/Dashboard/vue/dist/"; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "fae3"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "19dc": +/***/ (function(module, exports) { + +module.exports = __WEBPACK_EXTERNAL_MODULE__19dc__; + +/***/ }), + +/***/ "8bbf": +/***/ (function(module, exports) { + +module.exports = __WEBPACK_EXTERNAL_MODULE__8bbf__; + +/***/ }), + +/***/ "fae3": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +// ESM COMPAT FLAG +__webpack_require__.r(__webpack_exports__); + +// EXPORTS +__webpack_require__.d(__webpack_exports__, "DashboardStore", function() { return /* reexport */ Dashboard_store; }); +__webpack_require__.d(__webpack_exports__, "Dashboard", function() { return /* reexport */ Dashboard; }); + +// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js +// This file is imported into lib/wc client bundles. + +if (typeof window !== 'undefined') { + var currentScript = window.document.currentScript + if (false) { var getCurrentScript; } + + var src = currentScript && currentScript.src.match(/(.+\/)[^/]+\.js(\?.*)?$/) + if (src) { + __webpack_require__.p = src[1] // eslint-disable-line + } +} + +// Indicate to webpack that this file can be concatenated +/* harmony default export */ var setPublicPath = (null); + +// EXTERNAL MODULE: external {"commonjs":"vue","commonjs2":"vue","root":"Vue"} +var external_commonjs_vue_commonjs2_vue_root_Vue_ = __webpack_require__("8bbf"); + +// EXTERNAL MODULE: external "CoreHome" +var external_CoreHome_ = __webpack_require__("19dc"); + +// CONCATENATED MODULE: ./plugins/Dashboard/vue/src/Dashboard/Dashboard.store.ts +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + + + +var Dashboard_store_DashboardStore = /*#__PURE__*/function () { + function DashboardStore() { + var _this = this; + + _classCallCheck(this, DashboardStore); + + _defineProperty(this, "privateState", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["reactive"])({ + dashboards: [] + })); + + _defineProperty(this, "state", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(function () { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["readonly"])(_this.privateState); + })); + + _defineProperty(this, "dashboards", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(function () { + return _this.state.value.dashboards; + })); + + _defineProperty(this, "dashboardsPromise", null); + } + + _createClass(DashboardStore, [{ + key: "getDashboard", + value: function getDashboard(dashboardId) { + return this.getAllDashboards().then(function (dashboards) { + return dashboards.find(function (b) { + return parseInt("".concat(b.id), 10) === parseInt("".concat(dashboardId), 10); + }); + }); + } + }, { + key: "getDashboardLayout", + value: function getDashboardLayout(dashboardId) { + return external_CoreHome_["AjaxHelper"].fetch({ + module: 'Dashboard', + action: 'getDashboardLayout', + idDashboard: dashboardId + }, { + withTokenInUrl: true + }); + } + }, { + key: "reloadAllDashboards", + value: function reloadAllDashboards() { + this.dashboardsPromise = null; + return this.getAllDashboards(); + } + }, { + key: "getAllDashboards", + value: function getAllDashboards() { + var _this2 = this; + + if (!this.dashboardsPromise) { + this.dashboardsPromise = external_CoreHome_["AjaxHelper"].fetch({ + method: 'Dashboard.getDashboards', + filter_limit: '-1' + }).then(function (response) { + if (response) { + _this2.privateState.dashboards = response; + } + + return _this2.dashboards.value; + }); + } + + return this.dashboardsPromise; + } + }]); + + return DashboardStore; +}(); + +/* harmony default export */ var Dashboard_store = (new Dashboard_store_DashboardStore()); +// CONCATENATED MODULE: ./plugins/Dashboard/vue/src/Dashboard/Dashboard.store.adapter.ts +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +window.angular.module('piwikApp.service').factory('dashboardsModel', function () { + return Dashboard_store; +}); +// CONCATENATED MODULE: ./plugins/Dashboard/vue/src/Dashboard/Dashboard.ts +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } + +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + + + +var _window = window, + $ = _window.$; + +function renderDashboard(dashboardId, dashboard, layout) { + var $settings = $('.dashboardSettings'); + $settings.show(); + window.initTopControls(); // Embed dashboard / exported as widget + + if (!$('#topBars').length) { + $settings.after($('#Dashboard')); + $('#Dashboard ul li').removeClass('active'); + $("#Dashboard_embeddedIndex_".concat(dashboardId)).addClass('active'); + } + + window.widgetsHelper.getAvailableWidgets(); // eslint-disable-next-line @typescript-eslint/no-explicit-any + + $('#dashboardWidgetsArea').off('dashboardempty', window.showEmptyDashboardNotification).on('dashboardempty', window.showEmptyDashboardNotification).dashboard({ + idDashboard: dashboardId, + layout: layout, + name: dashboard ? dashboard.name : '' + }); + var divElements = $('#columnPreview').find('>div'); + divElements.each(function eachPreview() { + var width = []; + $('div', this).each(function eachDiv() { + width.push(this.className.replace(/width-/, '')); + }); + $(this).attr('layout', width.join('-')); + }); + divElements.off('click.renderDashboard'); + divElements.on('click.renderDashboard', function onRenderDashboard() { + divElements.removeClass('choosen'); + $(this).addClass('choosen'); + }); +} + +function fetchDashboard(dashboardId) { + window.globalAjaxQueue.abort(); + return new Promise(function (resolve) { + return setTimeout(resolve); + }).then(function () { + return Promise.resolve(window.widgetsHelper.firstGetAvailableWidgetsCall); + }).then(function () { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + var dashboardElement = $('#dashboardWidgetsArea'); + dashboardElement.dashboard('destroyWidgets'); + dashboardElement.empty(); + return Promise.all([Dashboard_store.getDashboard(dashboardId), Dashboard_store.getDashboardLayout(dashboardId)]); + }).then(function (_ref) { + var _ref2 = _slicedToArray(_ref, 2), + dashboard = _ref2[0], + layout = _ref2[1]; + + return new Promise(function (resolve) { + $(function () { + renderDashboard(dashboardId, dashboard, layout); + resolve(); + }); + }); + }); +} + +function clearDashboard() { + $('.top_controls .dashboard-manager').hide(); // eslint-disable-next-line @typescript-eslint/no-explicit-any + + $('#dashboardWidgetsArea').dashboard('destroy'); +} + +function onLocationChange(parsed) { + if (parsed.module !== 'Widgetize' && parsed.category !== 'Dashboard_Dashboard') { + // we remove the dashboard only if we no longer show a dashboard. + clearDashboard(); + } +} + +function onLoadPage(params) { + if (params.category === 'Dashboard_Dashboard' && $.isNumeric(params.subcategory)) { + params.promise = fetchDashboard(parseInt(params.subcategory, 10)); + } +} + +function onLoadDashboard(idDashboard) { + fetchDashboard(idDashboard); +} + +/* harmony default export */ var Dashboard = ({ + mounted: function mounted(el, binding) { + fetchDashboard(binding.value.idDashboard); + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["watch"])(function () { + return external_CoreHome_["MatomoUrl"].parsed.value; + }, function (parsed) { + onLocationChange(parsed); + }); // load dashboard directly since it will be faster than going through reporting page API + + external_CoreHome_["Matomo"].on('ReportingPage.loadPage', onLoadPage); + external_CoreHome_["Matomo"].on('Dashboard.loadDashboard', onLoadDashboard); + }, + unmounted: function unmounted() { + onLocationChange(external_CoreHome_["MatomoUrl"].parsed.value); + external_CoreHome_["Matomo"].off('ReportingPage.loadPage', onLoadPage); + external_CoreHome_["Matomo"].off('Dashboard.loadDashboard', onLoadDashboard); + } +}); +// CONCATENATED MODULE: ./plugins/Dashboard/vue/src/Dashboard/Dashboard.adapter.ts +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +function piwikDashboard() { + return { + restrict: 'A', + scope: { + dashboardid: '=', + layout: '=' + }, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + link: function expandOnClickLink(scope, element) { + var binding = { + instance: null, + value: { + idDashboard: scope.dashboardid, + layout: scope.layout + }, + oldValue: null, + modifiers: {}, + dir: {} + }; + Dashboard.mounted(element[0], binding); // using scope destroy instead of element destroy event, since piwik-dashboard elements + // are removed manually, outside of angularjs/vue workflow, so element destroy is not + // triggered + + scope.$on('$destroy', function () { + Dashboard.unmounted(); + }); + } + }; +} +window.angular.module('piwikApp').directive('piwikDashboard', piwikDashboard); +// CONCATENATED MODULE: ./plugins/Dashboard/vue/src/index.ts +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + + + + +// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib-no-default.js + + + + +/***/ }) + +/******/ }); +}); +//# sourceMappingURL=Dashboard.umd.js.map
\ No newline at end of file diff --git a/plugins/Dashboard/vue/dist/Dashboard.umd.min.js b/plugins/Dashboard/vue/dist/Dashboard.umd.min.js new file mode 100644 index 0000000000..15c79f8b71 --- /dev/null +++ b/plugins/Dashboard/vue/dist/Dashboard.umd.min.js @@ -0,0 +1,27 @@ +(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("CoreHome"),require("vue")):"function"===typeof define&&define.amd?define(["CoreHome"],t):"object"===typeof exports?exports["Dashboard"]=t(require("CoreHome"),require("vue")):e["Dashboard"]=t(e["CoreHome"],e["Vue"])})("undefined"!==typeof self?self:this,(function(e,t){return function(e){var t={};function r(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},r.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(o,n,function(t){return e[t]}.bind(null,n));return o},r.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="plugins/Dashboard/vue/dist/",r(r.s="fae3")}({"19dc":function(t,r){t.exports=e},"8bbf":function(e,r){e.exports=t},fae3:function(e,t,r){"use strict";if(r.r(t),r.d(t,"DashboardStore",(function(){return f})),r.d(t,"Dashboard",(function(){return S})),"undefined"!==typeof window){var o=window.document.currentScript,n=o&&o.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);n&&(r.p=n[1])}var a=r("8bbf"),i=r("19dc");function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function s(e,t,r){return t&&d(e.prototype,t),r&&d(e,r),e}function l(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e} +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */var c=function(){function e(){var t=this;u(this,e),l(this,"privateState",Object(a["reactive"])({dashboards:[]})),l(this,"state",Object(a["computed"])((function(){return Object(a["readonly"])(t.privateState)}))),l(this,"dashboards",Object(a["computed"])((function(){return t.state.value.dashboards}))),l(this,"dashboardsPromise",null)}return s(e,[{key:"getDashboard",value:function(e){return this.getAllDashboards().then((function(t){return t.find((function(t){return parseInt("".concat(t.id),10)===parseInt("".concat(e),10)}))}))}},{key:"getDashboardLayout",value:function(e){return i["AjaxHelper"].fetch({module:"Dashboard",action:"getDashboardLayout",idDashboard:e},{withTokenInUrl:!0})}},{key:"reloadAllDashboards",value:function(){return this.dashboardsPromise=null,this.getAllDashboards()}},{key:"getAllDashboards",value:function(){var e=this;return this.dashboardsPromise||(this.dashboardsPromise=i["AjaxHelper"].fetch({method:"Dashboard.getDashboards",filter_limit:"-1"}).then((function(t){return t&&(e.privateState.dashboards=t),e.dashboards.value}))),this.dashboardsPromise}}]),e}(),f=new c;function h(e,t){return v(e)||y(e,t)||p(e,t)||b()}function b(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function p(e,t){if(e){if("string"===typeof e)return m(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?m(e,t):void 0}}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}function y(e,t){var r=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o,n,a=[],i=!0,u=!1;try{for(r=r.call(e);!(i=(o=r.next()).done);i=!0)if(a.push(o.value),t&&a.length===t)break}catch(d){u=!0,n=d}finally{try{i||null==r["return"]||r["return"]()}finally{if(u)throw n}}return a}}function v(e){if(Array.isArray(e))return e} +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ +window.angular.module("piwikApp.service").factory("dashboardsModel",(function(){return f}));var g=window,w=g.$;function D(e,t,r){var o=w(".dashboardSettings");o.show(),window.initTopControls(),w("#topBars").length||(o.after(w("#Dashboard")),w("#Dashboard ul li").removeClass("active"),w("#Dashboard_embeddedIndex_".concat(e)).addClass("active")),window.widgetsHelper.getAvailableWidgets(),w("#dashboardWidgetsArea").off("dashboardempty",window.showEmptyDashboardNotification).on("dashboardempty",window.showEmptyDashboardNotification).dashboard({idDashboard:e,layout:r,name:t?t.name:""});var n=w("#columnPreview").find(">div");n.each((function(){var e=[];w("div",this).each((function(){e.push(this.className.replace(/width-/,""))})),w(this).attr("layout",e.join("-"))})),n.off("click.renderDashboard"),n.on("click.renderDashboard",(function(){n.removeClass("choosen"),w(this).addClass("choosen")}))}function j(e){return window.globalAjaxQueue.abort(),new Promise((function(e){return setTimeout(e)})).then((function(){return Promise.resolve(window.widgetsHelper.firstGetAvailableWidgetsCall)})).then((function(){var t=w("#dashboardWidgetsArea");return t.dashboard("destroyWidgets"),t.empty(),Promise.all([f.getDashboard(e),f.getDashboardLayout(e)])})).then((function(t){var r=h(t,2),o=r[0],n=r[1];return new Promise((function(t){w((function(){D(e,o,n),t()}))}))}))}function A(){w(".top_controls .dashboard-manager").hide(),w("#dashboardWidgetsArea").dashboard("destroy")}function P(e){"Widgetize"!==e.module&&"Dashboard_Dashboard"!==e.category&&A()}function x(e){"Dashboard_Dashboard"===e.category&&w.isNumeric(e.subcategory)&&(e.promise=j(parseInt(e.subcategory,10)))}function O(e){j(e)}var S={mounted:function(e,t){j(t.value.idDashboard),Object(a["watch"])((function(){return i["MatomoUrl"].parsed.value}),(function(e){P(e)})),i["Matomo"].on("ReportingPage.loadPage",x),i["Matomo"].on("Dashboard.loadDashboard",O)},unmounted:function(){P(i["MatomoUrl"].parsed.value),i["Matomo"].off("ReportingPage.loadPage",x),i["Matomo"].off("Dashboard.loadDashboard",O)}}; +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */function k(){return{restrict:"A",scope:{dashboardid:"=",layout:"="},link:function(e,t){var r={instance:null,value:{idDashboard:e.dashboardid,layout:e.layout},oldValue:null,modifiers:{},dir:{}};S.mounted(t[0],r),e.$on("$destroy",(function(){S.unmounted()}))}}}window.angular.module("piwikApp").directive("piwikDashboard",k)}})})); +//# sourceMappingURL=Dashboard.umd.min.js.map
\ No newline at end of file diff --git a/plugins/Dashboard/vue/dist/umd.metadata.json b/plugins/Dashboard/vue/dist/umd.metadata.json new file mode 100644 index 0000000000..9ecfcc0456 --- /dev/null +++ b/plugins/Dashboard/vue/dist/umd.metadata.json @@ -0,0 +1,5 @@ +{ + "dependsOn": [ + "CoreHome" + ] +}
\ No newline at end of file diff --git a/plugins/Dashboard/vue/src/Dashboard/Dashboard.adapter.ts b/plugins/Dashboard/vue/src/Dashboard/Dashboard.adapter.ts new file mode 100644 index 0000000000..5f31fce6f9 --- /dev/null +++ b/plugins/Dashboard/vue/src/Dashboard/Dashboard.adapter.ts @@ -0,0 +1,44 @@ +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +import { IDirective } from 'angular'; +import Dashboard from './Dashboard'; +import { DashboardLayout } from '../types'; + +export default function piwikDashboard(): IDirective { + return { + restrict: 'A', + scope: { + dashboardid: '=', + layout: '=', + }, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + link: function expandOnClickLink(scope: any, element: JQuery) { + const binding = { + instance: null, + value: { + idDashboard: scope.dashboardid as string, + layout: scope.layout as DashboardLayout, + }, + oldValue: null, + modifiers: {}, + dir: {}, + }; + + Dashboard.mounted(element[0], binding); + + // using scope destroy instead of element destroy event, since piwik-dashboard elements + // are removed manually, outside of angularjs/vue workflow, so element destroy is not + // triggered + scope.$on('$destroy', () => { + Dashboard.unmounted(); + }); + }, + }; +} + +window.angular.module('piwikApp').directive('piwikDashboard', piwikDashboard); diff --git a/plugins/Dashboard/vue/src/Dashboard/Dashboard.store.adapter.ts b/plugins/Dashboard/vue/src/Dashboard/Dashboard.store.adapter.ts new file mode 100644 index 0000000000..0fd299225d --- /dev/null +++ b/plugins/Dashboard/vue/src/Dashboard/Dashboard.store.adapter.ts @@ -0,0 +1,10 @@ +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +import DashboardStore from './Dashboard.store'; + +window.angular.module('piwikApp.service').factory('dashboardsModel', () => DashboardStore); diff --git a/plugins/Dashboard/vue/src/Dashboard/Dashboard.store.ts b/plugins/Dashboard/vue/src/Dashboard/Dashboard.store.ts new file mode 100644 index 0000000000..ed38275b37 --- /dev/null +++ b/plugins/Dashboard/vue/src/Dashboard/Dashboard.store.ts @@ -0,0 +1,76 @@ +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +import { + computed, + readonly, + reactive, + DeepReadonly, +} from 'vue'; +import { AjaxHelper } from 'CoreHome'; +import { DashboardLayout, Dashboard } from '../types'; + +interface DashboardStoreState { + dashboards: Dashboard[]; +} + +class DashboardStore { + private privateState = reactive<DashboardStoreState>({ + dashboards: [], + }); + + readonly state = computed(() => readonly(this.privateState)); + + readonly dashboards = computed(() => this.state.value.dashboards); + + private dashboardsPromise: Promise<DeepReadonly<Dashboard[]>>|null = null; + + getDashboard(dashboardId: string|number) { + return this.getAllDashboards().then( + (dashboards) => dashboards.find( + (b) => parseInt(`${b.id}`, 10) === parseInt(`${dashboardId}`, 10), + ), + ); + } + + getDashboardLayout(dashboardId: string|number): Promise<DashboardLayout> { + return AjaxHelper.fetch<DashboardLayout>( + { + module: 'Dashboard', + action: 'getDashboardLayout', + idDashboard: dashboardId, + }, + { + withTokenInUrl: true, + }, + ); + } + + reloadAllDashboards(): ReturnType<DashboardStore['getAllDashboards']> { + this.dashboardsPromise = null; + return this.getAllDashboards(); + } + + getAllDashboards(): Promise<DeepReadonly<Dashboard[]>> { + if (!this.dashboardsPromise) { + this.dashboardsPromise = AjaxHelper.fetch<Dashboard[]>({ + method: 'Dashboard.getDashboards', + filter_limit: '-1', + }).then((response) => { + if (response) { + this.privateState.dashboards = response; + } + + return this.dashboards.value; + }); + } + + return this.dashboardsPromise; + } +} + +export default new DashboardStore(); diff --git a/plugins/Dashboard/vue/src/Dashboard/Dashboard.ts b/plugins/Dashboard/vue/src/Dashboard/Dashboard.ts new file mode 100644 index 0000000000..d13c8ee3e2 --- /dev/null +++ b/plugins/Dashboard/vue/src/Dashboard/Dashboard.ts @@ -0,0 +1,137 @@ +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +import { DirectiveBinding, watch } from 'vue'; +import { Matomo, MatomoUrl } from 'CoreHome'; +import DashboardStore from './Dashboard.store'; +import { Dashboard, DashboardLayout } from '../types'; + +interface DashboardDirectiveArgs { + idDashboard: string|number; + layout?: unknown; +} + +const { $ } = window; + +function renderDashboard( + dashboardId: string|number, + dashboard: Dashboard, + layout: DashboardLayout, +) { + const $settings = $('.dashboardSettings'); + + $settings.show(); + window.initTopControls(); + + // Embed dashboard / exported as widget + if (!$('#topBars').length) { + $settings.after($('#Dashboard')); + $('#Dashboard ul li').removeClass('active'); + $(`#Dashboard_embeddedIndex_${dashboardId}`).addClass('active'); + } + + window.widgetsHelper.getAvailableWidgets(); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + ($('#dashboardWidgetsArea') as any) + .off('dashboardempty', window.showEmptyDashboardNotification) + .on('dashboardempty', window.showEmptyDashboardNotification) + .dashboard({ + idDashboard: dashboardId, + layout, + name: dashboard ? dashboard.name : '', + }); + + const divElements = $('#columnPreview').find('>div'); + divElements.each(function eachPreview() { + const width: string[] = []; + $('div', this).each(function eachDiv() { + width.push(this.className.replace(/width-/, '')); + }); + $(this).attr('layout', width.join('-')); + }); + + divElements.off('click.renderDashboard'); + divElements.on('click.renderDashboard', function onRenderDashboard() { + divElements.removeClass('choosen'); + $(this).addClass('choosen'); + }); +} + +function fetchDashboard(dashboardId: string|number) { + window.globalAjaxQueue.abort(); + + return new Promise((resolve) => setTimeout(resolve)).then( + () => Promise.resolve(window.widgetsHelper.firstGetAvailableWidgetsCall), + ).then(() => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const dashboardElement = $('#dashboardWidgetsArea') as any; + dashboardElement.dashboard('destroyWidgets'); + dashboardElement.empty(); + + return Promise.all([ + DashboardStore.getDashboard(dashboardId), + DashboardStore.getDashboardLayout(dashboardId), + ]); + }).then(([dashboard, layout]) => new Promise<void>((resolve) => { + $(() => { + renderDashboard(dashboardId, dashboard as Dashboard, layout as DashboardLayout); + resolve(); + }); + })); +} + +function clearDashboard() { + $('.top_controls .dashboard-manager').hide(); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + ($('#dashboardWidgetsArea') as any).dashboard('destroy'); +} + +function onLocationChange(parsed: (typeof MatomoUrl)['urlParsed']['value']) { + if (parsed.module !== 'Widgetize' && parsed.category !== 'Dashboard_Dashboard') { + // we remove the dashboard only if we no longer show a dashboard. + clearDashboard(); + } +} +interface LoadPageArgs { + category: string; + subcategory: string; + promise?: Promise<void>; +} + +function onLoadPage(params: LoadPageArgs) { + if (params.category === 'Dashboard_Dashboard' + && $.isNumeric(params.subcategory) + ) { + params.promise = fetchDashboard(parseInt(params.subcategory, 10)); + } +} + +function onLoadDashboard(idDashboard: string|number) { + fetchDashboard(idDashboard); +} + +export default { + mounted(el: HTMLElement, binding: DirectiveBinding<DashboardDirectiveArgs>): void { + fetchDashboard(binding.value.idDashboard); + + watch(() => MatomoUrl.parsed.value, (parsed) => { + onLocationChange(parsed); + }); + + // load dashboard directly since it will be faster than going through reporting page API + Matomo.on('ReportingPage.loadPage', onLoadPage); + + Matomo.on('Dashboard.loadDashboard', onLoadDashboard); + }, + unmounted(): void { + onLocationChange(MatomoUrl.parsed.value); + + Matomo.off('ReportingPage.loadPage', onLoadPage); + Matomo.off('Dashboard.loadDashboard', onLoadDashboard); + }, +}; diff --git a/plugins/Dashboard/vue/src/index.ts b/plugins/Dashboard/vue/src/index.ts new file mode 100644 index 0000000000..4d8b6c30d4 --- /dev/null +++ b/plugins/Dashboard/vue/src/index.ts @@ -0,0 +1,12 @@ +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +import './Dashboard/Dashboard.store.adapter'; +import './Dashboard/Dashboard.adapter'; + +export { default as DashboardStore } from './Dashboard/Dashboard.store'; +export { default as Dashboard } from './Dashboard/Dashboard'; diff --git a/plugins/Dashboard/vue/src/types.ts b/plugins/Dashboard/vue/src/types.ts new file mode 100644 index 0000000000..ff25f40e6e --- /dev/null +++ b/plugins/Dashboard/vue/src/types.ts @@ -0,0 +1,28 @@ +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +import { WidgetType } from 'CoreHome'; + +interface WidgetRef { + module: string; + action: string; +} + +export interface Dashboard { + id: string|number; + name: string; + widgets: WidgetRef[]; +} + +interface DashboardLayoutConfig { + layout: string; +} + +export interface DashboardLayout { + columns: WidgetType[][]; + config: DashboardLayoutConfig; +} diff --git a/plugins/UsersManager/vue/dist/UsersManager.umd.js b/plugins/UsersManager/vue/dist/UsersManager.umd.js index 6ffaf671af..e4ab913ac6 100644 --- a/plugins/UsersManager/vue/dist/UsersManager.umd.js +++ b/plugins/UsersManager/vue/dist/UsersManager.umd.js @@ -3587,38 +3587,38 @@ NewsletterSettingsvue_type_script_lang_ts.render = NewsletterSettingsvue_type_te scope: {}, directiveName: 'matomoNewsletterSettings' })); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/UsersManager/vue/src/PersonalSettings/PersonalSettings.vue?vue&type=template&id=02979bea +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/UsersManager/vue/src/PersonalSettings/PersonalSettings.vue?vue&type=template&id=d46d01d4 -var PersonalSettingsvue_type_template_id_02979bea_hoisted_1 = { +var PersonalSettingsvue_type_template_id_d46d01d4_hoisted_1 = { id: "userSettingsTable" }; -var PersonalSettingsvue_type_template_id_02979bea_hoisted_2 = { +var PersonalSettingsvue_type_template_id_d46d01d4_hoisted_2 = { key: 0 }; -var PersonalSettingsvue_type_template_id_02979bea_hoisted_3 = { +var PersonalSettingsvue_type_template_id_d46d01d4_hoisted_3 = { id: "languageHelp", class: "inline-help-node" }; -var PersonalSettingsvue_type_template_id_02979bea_hoisted_4 = { +var PersonalSettingsvue_type_template_id_d46d01d4_hoisted_4 = { target: "_blank", rel: "noreferrer noopener", href: "https://matomo.org/translations/" }; -var PersonalSettingsvue_type_template_id_02979bea_hoisted_5 = { +var PersonalSettingsvue_type_template_id_d46d01d4_hoisted_5 = { class: "sites_autocomplete" }; -var PersonalSettingsvue_type_template_id_02979bea_hoisted_6 = { +var PersonalSettingsvue_type_template_id_d46d01d4_hoisted_6 = { class: "modal", id: "confirmChangesWithPassword", ref: "confirmChangesWithPasswordModal" }; -var PersonalSettingsvue_type_template_id_02979bea_hoisted_7 = { +var PersonalSettingsvue_type_template_id_d46d01d4_hoisted_7 = { class: "modal-content" }; -var PersonalSettingsvue_type_template_id_02979bea_hoisted_8 = { +var PersonalSettingsvue_type_template_id_d46d01d4_hoisted_8 = { class: "modal-footer" }; -function PersonalSettingsvue_type_template_id_02979bea_render(_ctx, _cache, $props, $setup, $data, $options) { +function PersonalSettingsvue_type_template_id_d46d01d4_render(_ctx, _cache, $props, $setup, $data, $options) { var _component_Field = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("Field"); var _component_SiteSelector = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("SiteSelector"); @@ -3634,7 +3634,7 @@ function PersonalSettingsvue_type_template_id_02979bea_render(_ctx, _cache, $pro feature: 'true' }, { default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(function () { - return [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("form", PersonalSettingsvue_type_template_id_02979bea_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { + return [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("form", PersonalSettingsvue_type_template_id_d46d01d4_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { uicontrol: "text", name: "username", title: _ctx.translate('General_Username'), @@ -3644,7 +3644,7 @@ function PersonalSettingsvue_type_template_id_02979bea_render(_ctx, _cache, $pro return _ctx.username = $event; }), "inline-help": _ctx.translate('UsersManager_YourUsernameCannotBeChanged') - }, null, 8, ["title", "modelValue", "inline-help"])]), _ctx.isUsersAdminEnabled ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", PersonalSettingsvue_type_template_id_02979bea_hoisted_2, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { + }, null, 8, ["title", "modelValue", "inline-help"])]), _ctx.isUsersAdminEnabled ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", PersonalSettingsvue_type_template_id_d46d01d4_hoisted_2, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { uicontrol: "text", name: "email", "model-value": _ctx.email, @@ -3654,7 +3654,7 @@ function PersonalSettingsvue_type_template_id_02979bea_render(_ctx, _cache, $pro }), maxlength: 100, title: _ctx.translate('UsersManager_Email') - }, null, 8, ["model-value", "title"])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", PersonalSettingsvue_type_template_id_02979bea_hoisted_3, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", PersonalSettingsvue_type_template_id_02979bea_hoisted_4, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('LanguagesManager_AboutPiwikTranslations')), 1)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { + }, null, 8, ["model-value", "title"])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", PersonalSettingsvue_type_template_id_d46d01d4_hoisted_3, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", PersonalSettingsvue_type_template_id_d46d01d4_hoisted_4, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('LanguagesManager_AboutPiwikTranslations')), 1)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { uicontrol: "select", name: "language", modelValue: _ctx.language, @@ -3683,7 +3683,7 @@ function PersonalSettingsvue_type_template_id_02979bea_render(_ctx, _cache, $pro introduction: _ctx.translate('UsersManager_ReportToLoadByDefault'), title: _ctx.translate('General_AllWebsitesDashboard'), options: _ctx.defaultReportOptions - }, null, 8, ["modelValue", "introduction", "title", "options"])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", PersonalSettingsvue_type_template_id_02979bea_hoisted_5, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_SiteSelector, { + }, null, 8, ["modelValue", "introduction", "title", "options"])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", PersonalSettingsvue_type_template_id_d46d01d4_hoisted_5, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_SiteSelector, { modelValue: _ctx.site, "onUpdate:modelValue": _cache[5] || (_cache[5] = function ($event) { return _ctx.site = $event; @@ -3707,7 +3707,7 @@ function PersonalSettingsvue_type_template_id_02979bea_render(_ctx, _cache, $pro return _ctx.save(); }), saving: _ctx.loading - }, null, 8, ["saving"]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", PersonalSettingsvue_type_template_id_02979bea_hoisted_6, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", PersonalSettingsvue_type_template_id_02979bea_hoisted_7, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h2", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_ConfirmWithPassword')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { + }, null, 8, ["saving"]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", PersonalSettingsvue_type_template_id_d46d01d4_hoisted_6, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", PersonalSettingsvue_type_template_id_d46d01d4_hoisted_7, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h2", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_ConfirmWithPassword')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { uicontrol: "password", name: "currentPassword", autocomplete: false, @@ -3717,7 +3717,7 @@ function PersonalSettingsvue_type_template_id_02979bea_render(_ctx, _cache, $pro }), "full-width": true, title: _ctx.translate('UsersManager_YourCurrentPassword') - }, null, 8, ["modelValue", "title"])])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", PersonalSettingsvue_type_template_id_02979bea_hoisted_8, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { + }, null, 8, ["modelValue", "title"])])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", PersonalSettingsvue_type_template_id_d46d01d4_hoisted_8, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { href: "", class: "modal-action btn", onClick: _cache[9] || (_cache[9] = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withModifiers"])(function ($event) { @@ -3737,7 +3737,7 @@ function PersonalSettingsvue_type_template_id_02979bea_render(_ctx, _cache, $pro _: 1 }, 8, ["content-title"]); } -// CONCATENATED MODULE: ./plugins/UsersManager/vue/src/PersonalSettings/PersonalSettings.vue?vue&type=template&id=02979bea +// CONCATENATED MODULE: ./plugins/UsersManager/vue/src/PersonalSettings/PersonalSettings.vue?vue&type=template&id=d46d01d4 // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/UsersManager/vue/src/PersonalSettings/PersonalSettings.vue?vue&type=script&lang=ts @@ -3895,7 +3895,7 @@ var PersonalSettingsvue_type_script_lang_ts_window = window, -PersonalSettingsvue_type_script_lang_ts.render = PersonalSettingsvue_type_template_id_02979bea_render +PersonalSettingsvue_type_script_lang_ts.render = PersonalSettingsvue_type_template_id_d46d01d4_render /* harmony default export */ var PersonalSettings = (PersonalSettingsvue_type_script_lang_ts); // CONCATENATED MODULE: ./plugins/UsersManager/vue/src/PersonalSettings/PersonalSettings.adapter.ts diff --git a/plugins/UsersManager/vue/src/PersonalSettings/PersonalSettings.vue b/plugins/UsersManager/vue/src/PersonalSettings/PersonalSettings.vue index c4f88b93d5..927368a371 100644 --- a/plugins/UsersManager/vue/src/PersonalSettings/PersonalSettings.vue +++ b/plugins/UsersManager/vue/src/PersonalSettings/PersonalSettings.vue @@ -235,7 +235,6 @@ export default defineComponent({ site: { id: this.defaultReportIdSite, name: Matomo.helper.htmlDecode(this.defaultReportSiteName), - }, theDefaultDate: this.defaultDate, loading: false, |