From 878722f0585dfe52923aff71023d0debfcf00ac9 Mon Sep 17 00:00:00 2001 From: dizzy Date: Tue, 11 Jan 2022 19:06:10 -0800 Subject: [Vue] migrate smtp controller in coreadminhome (#18549) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 * migrate sparkline component * migrate progressbar component * migrate content intro & content table directives * rebuild vue * migrate piwik-ajax-form component to vue * migrate popover handler directive to service class * migrate dropdownbutton directive though it does not seem to be in use * migrate show sensitive data directive * build vue * 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 * fix sparkline * apply after manual click triggering in savebutton * css fixes and piwik-content-table was never applied by angularjs in installtion * rebuild vue * add names to divs so they can still be queried as they were in angularjs * rebuild vue * rebuild vue * now that format_metrics checkbox works, need to check it * small delay before processing first popover * fix dropdown class/directive name * fix overlay test * remove unintended changes * remove unintended changes * migrate archiving controller * do not do a passthrough transpile of vue typescript, and fix many typescript errors in existing code * more typescript fixes * even more fixes * workarounds to fix recursive typing issues * get corehome to build w/ full typescript build and output type definitions to local dir * 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 * 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 Co-authored-by: bx80 * Update test translation (#18531) update a test failed XML * updates all submodules (#18541) Co-authored-by: diosmosis * 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 Co-authored-by: Vasilis Lourdas * 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 Co-authored-by: 刘韬 * 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 Co-authored-by: 刘韬 * [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 Co-authored-by: justinvelluppillai Co-authored-by: Matthieu Aubry * [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 Co-authored-by: bx80 * Update test translation (#18531) update a test failed XML * updates all submodules (#18541) Co-authored-by: diosmosis * 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 Co-authored-by: Vasilis Lourdas * 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 Co-authored-by: 刘韬 * 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 Co-authored-by: 刘韬 * [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 Co-authored-by: justinvelluppillai Co-authored-by: Matthieu Aubry * [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 * fix bug and rebuild * fix bug and rebuild * fix issue Co-authored-by: Ben Burgess <88810029+bx80@users.noreply.github.com> Co-authored-by: sgiehl Co-authored-by: bx80 Co-authored-by: Peter Zhang Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Weblate (bot) Co-authored-by: Vasilis Lourdas Co-authored-by: 刘韬 Co-authored-by: Justin Velluppillai Co-authored-by: justinvelluppillai Co-authored-by: Matthieu Aubry --- plugins/CoreAdminHome/CoreAdminHome.php | 19 ++ .../angularjs/smtp/mail-smtp.controller.js | 59 ----- .../CoreAdminHome/templates/generalSettings.twig | 86 +------ .../CoreAdminHome/vue/dist/CoreAdminHome.umd.js | 259 +++++++++++++++++++++ .../vue/dist/CoreAdminHome.umd.min.js | 12 +- .../vue/src/SmtpSettings/SmtpSettings.adapter.ts | 25 ++ .../vue/src/SmtpSettings/SmtpSettings.vue | 241 +++++++++++++++++++ plugins/CoreAdminHome/vue/src/index.ts | 2 + plugins/CoreHome/CoreHome.php | 1 - 9 files changed, 561 insertions(+), 143 deletions(-) delete mode 100644 plugins/CoreAdminHome/angularjs/smtp/mail-smtp.controller.js create mode 100644 plugins/CoreAdminHome/vue/src/SmtpSettings/SmtpSettings.adapter.ts create mode 100644 plugins/CoreAdminHome/vue/src/SmtpSettings/SmtpSettings.vue (limited to 'plugins') diff --git a/plugins/CoreAdminHome/CoreAdminHome.php b/plugins/CoreAdminHome/CoreAdminHome.php index eeaff8dc59..5c06f5bccb 100644 --- a/plugins/CoreAdminHome/CoreAdminHome.php +++ b/plugins/CoreAdminHome/CoreAdminHome.php @@ -142,5 +142,24 @@ class CoreAdminHome extends \Piwik\Plugin $translationKeys[] = 'CoreAdminHome_LogoNotWriteableInstruction'; $translationKeys[] = 'General_GiveUsYourFeedback'; $translationKeys[] = 'CoreAdminHome_CustomLogoFeedbackInfo'; + $translationKeys[] = 'CoreAdminHome_EmailServerSettings'; + $translationKeys[] = 'General_UseSMTPServerForEmail'; + $translationKeys[] = 'General_SelectYesIfYouWantToSendEmailsViaServer'; + $translationKeys[] = 'General_SmtpServerAddress'; + $translationKeys[] = 'General_SmtpPort'; + $translationKeys[] = 'General_OptionalSmtpPort'; + $translationKeys[] = 'General_AuthenticationMethodSmtp'; + $translationKeys[] = 'General_OnlyUsedIfUserPwdIsSet'; + $translationKeys[] = 'General_SmtpUsername'; + $translationKeys[] = 'General_OnlyEnterIfRequired'; + $translationKeys[] = 'General_SmtpPassword'; + $translationKeys[] = 'General_SmtpFromAddress'; + $translationKeys[] = 'General_SmtpFromEmailHelp'; + $translationKeys[] = 'General_SmtpFromName'; + $translationKeys[] = 'General_NameShownInTheSenderColumn'; + $translationKeys[] = 'General_SmtpEncryption'; + $translationKeys[] = 'General_EncryptedSmtpTransport'; + $translationKeys[] = 'General_OnlyEnterIfRequiredPassword'; + $translationKeys[] = 'General_WarningPasswordStored'; } } diff --git a/plugins/CoreAdminHome/angularjs/smtp/mail-smtp.controller.js b/plugins/CoreAdminHome/angularjs/smtp/mail-smtp.controller.js deleted file mode 100644 index 2554464719..0000000000 --- a/plugins/CoreAdminHome/angularjs/smtp/mail-smtp.controller.js +++ /dev/null @@ -1,59 +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 - */ - -/** - * Controller to save mail smtp settings - */ -(function () { - angular.module('piwikApp').controller('MailSmtpController', MailSmtpController); - - MailSmtpController.$inject = ['$scope', 'piwikApi']; - - function MailSmtpController($scope, piwikApi) { - - var self = this; - this.isLoading = false; - this.passwordChanged = false; - - this.save = function () { - - this.isLoading = true; - - var mailSettings = { - mailUseSmtp: this.enabled ? '1' : '0', - mailPort: this.mailPort, - mailHost: this.mailHost, - mailType: this.mailType, - mailUsername: this.mailUsername, - mailFromAddress: this.mailFromAddress, - mailFromName: this.mailFromName, - mailEncryption: this.mailEncryption - }; - - if (this.passwordChanged) { - mailSettings.mailPassword = this.mailPassword; - } - - piwikApi.withTokenInUrl(); - piwikApi.post({module: 'CoreAdminHome', action: 'setMailSettings'}, mailSettings) - .then(function (success) { - - self.isLoading = false; - - var UI = require('piwik/UI'); - var notification = new UI.Notification(); - notification.show(_pk_translate('CoreAdminHome_SettingsSaveSuccess'), { - id: 'generalSettings', context: 'success' - }); - notification.scrollToNotification(); - - }, function () { - self.isLoading = false; - }); - }; - } -})(); \ No newline at end of file diff --git a/plugins/CoreAdminHome/templates/generalSettings.twig b/plugins/CoreAdminHome/templates/generalSettings.twig index 16ea9f847b..7758572734 100644 --- a/plugins/CoreAdminHome/templates/generalSettings.twig +++ b/plugins/CoreAdminHome/templates/generalSettings.twig @@ -41,86 +41,12 @@ > {% if not isMultiServerEnvironment %} -
- -
-
-
- -
- -
-
- -
-
- -
-
- -
-
- - {% set help -%} - {{ 'General_OnlyEnterIfRequiredPassword'|translate }}
- {{ 'General_WarningPasswordStored'|translate("","")|raw }} - {%- endset %} - -
-
- -
-
- -
-
- -
-
-
- -
-
-
+
{% endif %} {% endif %} diff --git a/plugins/CoreAdminHome/vue/dist/CoreAdminHome.umd.js b/plugins/CoreAdminHome/vue/dist/CoreAdminHome.umd.js index 5ae4ea3ced..465ab4c6ab 100644 --- a/plugins/CoreAdminHome/vue/dist/CoreAdminHome.umd.js +++ b/plugins/CoreAdminHome/vue/dist/CoreAdminHome.umd.js @@ -127,6 +127,7 @@ __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, "ArchivingSettings", function() { return /* reexport */ ArchivingSettings; }); __webpack_require__.d(__webpack_exports__, "BrandingSettings", function() { return /* reexport */ BrandingSettings; }); +__webpack_require__.d(__webpack_exports__, "SmtpSettings", function() { return /* reexport */ SmtpSettings; }); // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js // This file is imported into lib/wc client bundles. @@ -758,6 +759,262 @@ BrandingSettingsvue_type_script_lang_ts.render = BrandingSettingsvue_type_templa }, directiveName: 'matomoBrandingSettings' })); +// 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/CoreAdminHome/vue/src/SmtpSettings/SmtpSettings.vue?vue&type=template&id=a947f986 + +var SmtpSettingsvue_type_template_id_a947f986_hoisted_1 = { + id: "smtpSettings" +}; +function SmtpSettingsvue_type_template_id_a947f986_render(_ctx, _cache, $props, $setup, $data, $options) { + var _component_Field = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("Field"); + + var _component_SaveButton = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("SaveButton"); + + var _component_ContentBlock = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("ContentBlock"); + + var _directive_form = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveDirective"])("form"); + + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(_component_ContentBlock, { + "content-title": _ctx.translate('CoreAdminHome_EmailServerSettings'), + anchor: "mailSettings" + }, { + 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"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { + uicontrol: "checkbox", + name: "mailUseSmtp", + modelValue: _ctx.enabled, + "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) { + return _ctx.enabled = $event; + }), + title: _ctx.translate('General_UseSMTPServerForEmail'), + "inline-help": _ctx.translate('General_SelectYesIfYouWantToSendEmailsViaServer') + }, null, 8, ["modelValue", "title", "inline-help"]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", SmtpSettingsvue_type_template_id_a947f986_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { + uicontrol: "text", + name: "mailHost", + "model-value": _ctx.mailHost, + "onUpdate:modelValue": _cache[1] || (_cache[1] = function ($event) { + return _ctx.onUpdateMailHost($event); + }), + title: _ctx.translate('General_SmtpServerAddress') + }, null, 8, ["model-value", "title"]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { + uicontrol: "text", + name: "mailPort", + modelValue: _ctx.mailPort, + "onUpdate:modelValue": _cache[2] || (_cache[2] = function ($event) { + return _ctx.mailPort = $event; + }), + title: _ctx.translate('General_SmtpPort'), + "inline-help": _ctx.translate('General_OptionalSmtpPort') + }, null, 8, ["modelValue", "title", "inline-help"]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { + uicontrol: "select", + name: "mailType", + modelValue: _ctx.mailType, + "onUpdate:modelValue": _cache[3] || (_cache[3] = function ($event) { + return _ctx.mailType = $event; + }), + title: _ctx.translate('General_AuthenticationMethodSmtp'), + options: _ctx.mailTypes, + "inline-help": _ctx.translate('General_OnlyUsedIfUserPwdIsSet') + }, null, 8, ["modelValue", "title", "options", "inline-help"]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { + uicontrol: "text", + name: "mailUsername", + modelValue: _ctx.mailUsername, + "onUpdate:modelValue": _cache[4] || (_cache[4] = function ($event) { + return _ctx.mailUsername = $event; + }), + title: _ctx.translate('General_SmtpUsername'), + "inline-help": _ctx.translate('General_OnlyEnterIfRequired'), + autocomplete: false + }, null, 8, ["modelValue", "title", "inline-help"]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { + uicontrol: "password", + name: "mailPassword", + "model-value": _ctx.mailPassword, + "onUpdate:modelValue": _cache[5] || (_cache[5] = function ($event) { + return _ctx.onMailPasswordChange($event); + }), + onClick: _cache[6] || (_cache[6] = function ($event) { + !_ctx.passwordChanged && $event.target.select(); + }), + title: _ctx.translate('General_SmtpPassword'), + "inline-help": _ctx.passwordHelp, + autocomplete: false + }, null, 8, ["model-value", "title", "inline-help"]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { + uicontrol: "text", + name: "mailFromAddress", + modelValue: _ctx.mailFromAddress, + "onUpdate:modelValue": _cache[7] || (_cache[7] = function ($event) { + return _ctx.mailFromAddress = $event; + }), + title: _ctx.translate('General_SmtpFromAddress'), + "inline-help": _ctx.translate('General_SmtpFromEmailHelp', _ctx.mailHost), + autocomplete: false + }, null, 8, ["modelValue", "title", "inline-help"]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { + uicontrol: "text", + name: "mailFromName", + modelValue: _ctx.mailFromName, + "onUpdate:modelValue": _cache[8] || (_cache[8] = function ($event) { + return _ctx.mailFromName = $event; + }), + title: _ctx.translate('General_SmtpFromName'), + "inline-help": _ctx.translate('General_NameShownInTheSenderColumn'), + autocomplete: false + }, null, 8, ["modelValue", "title", "inline-help"]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { + uicontrol: "select", + name: "mailEncryption", + modelValue: _ctx.mailEncryption, + "onUpdate:modelValue": _cache[9] || (_cache[9] = function ($event) { + return _ctx.mailEncryption = $event; + }), + title: _ctx.translate('General_SmtpEncryption'), + options: _ctx.mailEncryptions, + "inline-help": _ctx.translate('General_EncryptedSmtpTransport') + }, null, 8, ["modelValue", "title", "options", "inline-help"])], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.enabled]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_SaveButton, { + onConfirm: _cache[10] || (_cache[10] = function ($event) { + return _ctx.save(); + }), + saving: _ctx.isLoading + }, null, 8, ["saving"])], 512), [[_directive_form]])]; + }), + _: 1 + }, 8, ["content-title"]); +} +// CONCATENATED MODULE: ./plugins/CoreAdminHome/vue/src/SmtpSettings/SmtpSettings.vue?vue&type=template&id=a947f986 + +// 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/CoreAdminHome/vue/src/SmtpSettings/SmtpSettings.vue?vue&type=script&lang=ts + + + +/* harmony default export */ var SmtpSettingsvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ + props: { + mail: { + type: Object, + required: true + }, + mailTypes: { + type: Object, + required: true + }, + mailEncryptions: { + type: Object, + required: true + } + }, + data: function data() { + var mail = this.mail; + return { + isLoading: false, + enabled: mail.transport === 'smtp', + mailHost: mail.host, + passwordChanged: false, + mailPort: mail.port, + mailType: mail.type, + mailUsername: mail.username, + mailPassword: mail.password ? '******' : '', + mailFromAddress: mail.noreply_email_address, + mailFromName: mail.noreply_email_name, + mailEncryption: mail.encryption + }; + }, + components: { + ContentBlock: external_CoreHome_["ContentBlock"], + Field: external_CorePluginsAdmin_["Field"], + SaveButton: external_CorePluginsAdmin_["SaveButton"] + }, + directives: { + Form: external_CorePluginsAdmin_["Form"] + }, + computed: { + passwordHelp: function passwordHelp() { + var part1 = "".concat(Object(external_CoreHome_["translate"])('General_OnlyEnterIfRequiredPassword'), "
"); + var part2 = "".concat(Object(external_CoreHome_["translate"])('General_WarningPasswordStored', '', ''), "
"); + return "".concat(part1, "\n").concat(part2); + } + }, + methods: { + onUpdateMailHost: function onUpdateMailHost(newValue) { + this.mailHost = newValue; + + if (this.passwordChanged) { + return; + } + + this.mailPassword = ''; + this.passwordChanged = true; + }, + onMailPasswordChange: function onMailPasswordChange(newValue) { + this.mailPassword = newValue; + this.passwordChanged = true; + }, + save: function save() { + var _this = this; + + this.isLoading = true; + var mailSettings = { + mailUseSmtp: this.enabled ? '1' : '0', + mailPort: this.mailPort, + mailHost: this.mailHost, + mailType: this.mailType, + mailUsername: this.mailUsername, + mailFromAddress: this.mailFromAddress, + mailFromName: this.mailFromName, + mailEncryption: this.mailEncryption + }; + + if (this.passwordChanged) { + mailSettings.mailPassword = this.mailPassword; + } + + external_CoreHome_["AjaxHelper"].post({ + module: 'CoreAdminHome', + action: 'setMailSettings' + }, mailSettings, { + withTokenInUrl: true + }).then(function () { + var notificationInstanceId = external_CoreHome_["NotificationsStore"].show({ + message: Object(external_CoreHome_["translate"])('CoreAdminHome_SettingsSaveSuccess'), + type: 'transient', + id: 'generalSettings', + context: 'success' + }); + external_CoreHome_["NotificationsStore"].scrollToNotification(notificationInstanceId); + }).finally(function () { + _this.isLoading = false; + }); + } + } +})); +// CONCATENATED MODULE: ./plugins/CoreAdminHome/vue/src/SmtpSettings/SmtpSettings.vue?vue&type=script&lang=ts + +// CONCATENATED MODULE: ./plugins/CoreAdminHome/vue/src/SmtpSettings/SmtpSettings.vue + + + +SmtpSettingsvue_type_script_lang_ts.render = SmtpSettingsvue_type_template_id_a947f986_render + +/* harmony default export */ var SmtpSettings = (SmtpSettingsvue_type_script_lang_ts); +// CONCATENATED MODULE: ./plugins/CoreAdminHome/vue/src/SmtpSettings/SmtpSettings.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 + */ + + +/* harmony default export */ var SmtpSettings_adapter = (Object(external_CoreHome_["createAngularJsAdapter"])({ + component: SmtpSettings, + scope: { + mail: { + angularJsBind: '<' + }, + mailTypes: { + angularJsBind: '<' + }, + mailEncryptions: { + angularJsBind: '<' + } + }, + directiveName: 'matomoSmtpSettings' +})); // CONCATENATED MODULE: ./plugins/CoreAdminHome/vue/src/index.ts /*! * Matomo - free/libre analytics platform @@ -769,6 +1026,8 @@ BrandingSettingsvue_type_script_lang_ts.render = BrandingSettingsvue_type_templa + + // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib-no-default.js diff --git a/plugins/CoreAdminHome/vue/dist/CoreAdminHome.umd.min.js b/plugins/CoreAdminHome/vue/dist/CoreAdminHome.umd.min.js index 2914e1a0b3..e0e3d6a966 100644 --- a/plugins/CoreAdminHome/vue/dist/CoreAdminHome.umd.min.js +++ b/plugins/CoreAdminHome/vue/dist/CoreAdminHome.umd.min.js @@ -1,14 +1,20 @@ -(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):"function"===typeof define&&define.amd?define(["CoreHome",,"CorePluginsAdmin"],t):"object"===typeof exports?exports["CoreAdminHome"]=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):e["CoreAdminHome"]=t(e["CoreHome"],e["Vue"],e["CorePluginsAdmin"])})("undefined"!==typeof self?self:this,(function(e,t,o){return function(e){var t={};function o(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}return o.m=e,o.c=t,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="plugins/CoreAdminHome/vue/dist/",o(o.s="fae3")}({"19dc":function(t,o){t.exports=e},"8bbf":function(e,o){e.exports=t},a5a2:function(e,t){e.exports=o},fae3:function(e,t,o){"use strict";if(o.r(t),o.d(t,"ArchivingSettings",(function(){return N})),o.d(t,"BrandingSettings",(function(){return Q})),"undefined"!==typeof window){var n=window.document.currentScript,r=n&&n.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);r&&(o.p=r[1])}var i=o("19dc"),a=o("8bbf"),c={class:"form-group row"},l={class:"col s12"},s={class:"col s12 m6"},d={class:"form-description",style:{"margin-left":"4px"}},u={for:"enableBrowserTriggerArchiving2"},g=["innerHTML"],m={class:"col s12 m6"},p=["innerHTML"],h={class:"form-group row"},v={class:"col s12"},b={class:"input-field col s12 m6"},f=["disabled"],j={class:"form-description"},O={class:"col s12 m6"},B={key:0,class:"form-help"},y={key:0},A=Object(a["createElementVNode"])("br",null,null,-1),C=Object(a["createElementVNode"])("br",null,null,-1),L=Object(a["createElementVNode"])("br",null,null,-1);function T(e,t,o,n,r,i){var T=Object(a["resolveComponent"])("SaveButton"),S=Object(a["resolveComponent"])("ContentBlock");return Object(a["openBlock"])(),Object(a["createBlock"])(S,{"content-title":e.translate("CoreAdminHome_ArchivingSettings"),anchor:"archivingSettings",class:"matomo-archiving-settings"},{default:Object(a["withCtx"])((function(){return[Object(a["createElementVNode"])("div",null,[Object(a["createElementVNode"])("div",c,[Object(a["createElementVNode"])("h3",l,Object(a["toDisplayString"])(e.translate("General_AllowPiwikArchivingToTriggerBrowser")),1),Object(a["createElementVNode"])("div",s,[Object(a["createElementVNode"])("p",null,[Object(a["createElementVNode"])("label",null,[Object(a["withDirectives"])(Object(a["createElementVNode"])("input",{type:"radio",id:"enableBrowserTriggerArchiving1",name:"enableBrowserTriggerArchiving",value:"1","onUpdate:modelValue":t[0]||(t[0]=function(t){return e.enableBrowserTriggerArchivingValue=t})},null,512),[[a["vModelRadio"],e.enableBrowserTriggerArchivingValue]]),Object(a["createElementVNode"])("span",null,Object(a["toDisplayString"])(e.translate("General_Yes")),1),Object(a["createElementVNode"])("span",d,Object(a["toDisplayString"])(e.translate("General_Default")),1)])]),Object(a["createElementVNode"])("p",null,[Object(a["createElementVNode"])("label",u,[Object(a["withDirectives"])(Object(a["createElementVNode"])("input",{type:"radio",id:"enableBrowserTriggerArchiving2",name:"enableBrowserTriggerArchiving",value:"0","onUpdate:modelValue":t[1]||(t[1]=function(t){return e.enableBrowserTriggerArchivingValue=t})},null,512),[[a["vModelRadio"],e.enableBrowserTriggerArchivingValue]]),Object(a["createElementVNode"])("span",null,Object(a["toDisplayString"])(e.translate("General_No")),1),Object(a["createElementVNode"])("span",{class:"form-description",innerHTML:e.archivingTriggerDesc,style:{"margin-left":"4px"}},null,8,g)])])]),Object(a["createElementVNode"])("div",m,[Object(a["createElementVNode"])("div",{class:"form-help",innerHTML:e.archivingInlineHelp},null,8,p)])]),Object(a["createElementVNode"])("div",h,[Object(a["createElementVNode"])("h3",v,Object(a["toDisplayString"])(e.translate("General_ReportsContainingTodayWillBeProcessedAtMostEvery")),1),Object(a["createElementVNode"])("div",b,[Object(a["withDirectives"])(Object(a["createElementVNode"])("input",{type:"text","onUpdate:modelValue":t[2]||(t[2]=function(t){return e.todayArchiveTimeToLiveValue=t}),id:"todayArchiveTimeToLive",disabled:!e.isGeneralSettingsAdminEnabled},null,8,f),[[a["vModelText"],e.todayArchiveTimeToLiveValue]]),Object(a["createElementVNode"])("span",j,Object(a["toDisplayString"])(e.translate("General_RearchiveTimeIntervalOnlyForTodayReports")),1)]),Object(a["createElementVNode"])("div",O,[e.isGeneralSettingsAdminEnabled?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",B,[e.showWarningCron?(Object(a["openBlock"])(),Object(a["createElementBlock"])("strong",y,[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.translate("General_NewReportsWillBeProcessedByCron")),1),A,Object(a["createTextVNode"])(" "+Object(a["toDisplayString"])(e.translate("General_ReportsWillBeProcessedAtMostEveryHour"))+" "+Object(a["toDisplayString"])(e.translate("General_IfArchivingIsFastYouCanSetupCronRunMoreOften")),1),C])):Object(a["createCommentVNode"])("",!0),Object(a["createTextVNode"])(" "+Object(a["toDisplayString"])(e.translate("General_SmallTrafficYouCanLeaveDefault",e.todayArchiveTimeToLiveDefault))+" ",1),L,Object(a["createTextVNode"])(" "+Object(a["toDisplayString"])(e.translate("General_MediumToHighTrafficItIsRecommendedTo",1800,3600)),1)])):Object(a["createCommentVNode"])("",!0)])]),Object(a["createElementVNode"])("div",null,[Object(a["createVNode"])(T,{saving:e.isLoading,onConfirm:t[3]||(t[3]=function(t){return e.save()})},null,8,["saving"])])])]})),_:1},8,["content-title"])}var S=o("a5a2"),V=Object(a["defineComponent"])({props:{enableBrowserTriggerArchiving:Boolean,showSegmentArchiveTriggerInfo:Boolean,isGeneralSettingsAdminEnabled:Boolean,showWarningCron:Boolean,todayArchiveTimeToLive:Number,todayArchiveTimeToLiveDefault:Number},components:{ContentBlock:i["ContentBlock"],SaveButton:S["SaveButton"]},data:function(){return{isLoading:!1,enableBrowserTriggerArchivingValue:this.enableBrowserTriggerArchiving?1:0,todayArchiveTimeToLiveValue:this.todayArchiveTimeToLive}},watch:{enableBrowserTriggerArchiving:function(e){this.enableBrowserTriggerArchivingValue=e?1:0},todayArchiveTimeToLive:function(e){this.todayArchiveTimeToLiveValue=e}},computed:{archivingTriggerDesc:function(){var e="";return e+=Object(i["translate"])("General_ArchivingTriggerDescription",'',""),this.showSegmentArchiveTriggerInfo&&(e+=Object(i["translate"])("General_ArchivingTriggerSegment")),e},archivingInlineHelp:function(){var e=Object(i["translate"])("General_ArchivingInlineHelp");return e+="
",e+=Object(i["translate"])("General_SeeTheOfficialDocumentationForMoreInformation",'',""),e}},methods:{save:function(){var e=this;this.isLoading=!0,i["AjaxHelper"].post({module:"API",method:"CoreAdminHome.setArchiveSettings"},{enableBrowserTriggerArchiving:this.enableBrowserTriggerArchivingValue,todayArchiveTimeToLive:this.todayArchiveTimeToLiveValue}).then((function(){e.isLoading=!1;var t=i["NotificationsStore"].show({message:Object(i["translate"])("CoreAdminHome_SettingsSaveSuccess"),type:"transient",id:"generalSettings",context:"success"});i["NotificationsStore"].scrollToNotification(t)})).finally((function(){e.isLoading=!1}))}}});V.render=T;var N=V,E=(Object(i["createAngularJsAdapter"])({component:N,scope:{enableBrowserTriggerArchiving:{angularJsBind:"<"},showSegmentArchiveTriggerInfo:{angularJsBind:"<"},isGeneralSettingsAdminEnabled:{angularJsBind:"<"},showWarningCron:{angularJsBind:"<"},todayArchiveTimeToLive:{angularJsBind:"<"},todayArchiveTimeToLiveDefault:{angularJsBind:"<"}},directiveName:"matomoArchivingSettings"}),{id:"logoSettings"}),w={id:"logoUploadForm",ref:"logoUploadForm",method:"post",enctype:"multipart/form-data",action:"index.php?module=CoreAdminHome&format=json&action=uploadCustomLogo"},U={key:0},_=["value"],F=Object(a["createElementVNode"])("input",{type:"hidden",name:"force_api_session",value:"1"},null,-1),k={key:0},H={key:0,class:"alert alert-warning uploaderror"},x={class:"row"},D={class:"col s12"},G=["src"],P={class:"row"},J={class:"col s12"},M=["src"],W={key:1},I=["innerHTML"],q={key:1},R={class:"alert alert-warning"}; +(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):"function"===typeof define&&define.amd?define(["CoreHome",,"CorePluginsAdmin"],t):"object"===typeof exports?exports["CoreAdminHome"]=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):e["CoreAdminHome"]=t(e["CoreHome"],e["Vue"],e["CorePluginsAdmin"])})("undefined"!==typeof self?self:this,(function(e,t,n){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="plugins/CoreAdminHome/vue/dist/",n(n.s="fae3")}({"19dc":function(t,n){t.exports=e},"8bbf":function(e,n){e.exports=t},a5a2:function(e,t){e.exports=n},fae3:function(e,t,n){"use strict";if(n.r(t),n.d(t,"ArchivingSettings",(function(){return w})),n.d(t,"BrandingSettings",(function(){return Q})),n.d(t,"SmtpSettings",(function(){return te})),"undefined"!==typeof window){var o=window.document.currentScript,r=o&&o.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);r&&(n.p=r[1])}var a=n("19dc"),i=n("8bbf"),l={class:"form-group row"},c={class:"col s12"},s={class:"col s12 m6"},d={class:"form-description",style:{"margin-left":"4px"}},m={for:"enableBrowserTriggerArchiving2"},u=["innerHTML"],p={class:"col s12 m6"},g=["innerHTML"],h={class:"form-group row"},v={class:"col s12"},b={class:"input-field col s12 m6"},f=["disabled"],j={class:"form-description"},O={class:"col s12 m6"},y={key:0,class:"form-help"},S={key:0},V=Object(i["createElementVNode"])("br",null,null,-1),C=Object(i["createElementVNode"])("br",null,null,-1),B=Object(i["createElementVNode"])("br",null,null,-1);function A(e,t,n,o,r,a){var A=Object(i["resolveComponent"])("SaveButton"),T=Object(i["resolveComponent"])("ContentBlock");return Object(i["openBlock"])(),Object(i["createBlock"])(T,{"content-title":e.translate("CoreAdminHome_ArchivingSettings"),anchor:"archivingSettings",class:"matomo-archiving-settings"},{default:Object(i["withCtx"])((function(){return[Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("div",l,[Object(i["createElementVNode"])("h3",c,Object(i["toDisplayString"])(e.translate("General_AllowPiwikArchivingToTriggerBrowser")),1),Object(i["createElementVNode"])("div",s,[Object(i["createElementVNode"])("p",null,[Object(i["createElementVNode"])("label",null,[Object(i["withDirectives"])(Object(i["createElementVNode"])("input",{type:"radio",id:"enableBrowserTriggerArchiving1",name:"enableBrowserTriggerArchiving",value:"1","onUpdate:modelValue":t[0]||(t[0]=function(t){return e.enableBrowserTriggerArchivingValue=t})},null,512),[[i["vModelRadio"],e.enableBrowserTriggerArchivingValue]]),Object(i["createElementVNode"])("span",null,Object(i["toDisplayString"])(e.translate("General_Yes")),1),Object(i["createElementVNode"])("span",d,Object(i["toDisplayString"])(e.translate("General_Default")),1)])]),Object(i["createElementVNode"])("p",null,[Object(i["createElementVNode"])("label",m,[Object(i["withDirectives"])(Object(i["createElementVNode"])("input",{type:"radio",id:"enableBrowserTriggerArchiving2",name:"enableBrowserTriggerArchiving",value:"0","onUpdate:modelValue":t[1]||(t[1]=function(t){return e.enableBrowserTriggerArchivingValue=t})},null,512),[[i["vModelRadio"],e.enableBrowserTriggerArchivingValue]]),Object(i["createElementVNode"])("span",null,Object(i["toDisplayString"])(e.translate("General_No")),1),Object(i["createElementVNode"])("span",{class:"form-description",innerHTML:e.archivingTriggerDesc,style:{"margin-left":"4px"}},null,8,u)])])]),Object(i["createElementVNode"])("div",p,[Object(i["createElementVNode"])("div",{class:"form-help",innerHTML:e.archivingInlineHelp},null,8,g)])]),Object(i["createElementVNode"])("div",h,[Object(i["createElementVNode"])("h3",v,Object(i["toDisplayString"])(e.translate("General_ReportsContainingTodayWillBeProcessedAtMostEvery")),1),Object(i["createElementVNode"])("div",b,[Object(i["withDirectives"])(Object(i["createElementVNode"])("input",{type:"text","onUpdate:modelValue":t[2]||(t[2]=function(t){return e.todayArchiveTimeToLiveValue=t}),id:"todayArchiveTimeToLive",disabled:!e.isGeneralSettingsAdminEnabled},null,8,f),[[i["vModelText"],e.todayArchiveTimeToLiveValue]]),Object(i["createElementVNode"])("span",j,Object(i["toDisplayString"])(e.translate("General_RearchiveTimeIntervalOnlyForTodayReports")),1)]),Object(i["createElementVNode"])("div",O,[e.isGeneralSettingsAdminEnabled?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",y,[e.showWarningCron?(Object(i["openBlock"])(),Object(i["createElementBlock"])("strong",S,[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("General_NewReportsWillBeProcessedByCron")),1),V,Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.translate("General_ReportsWillBeProcessedAtMostEveryHour"))+" "+Object(i["toDisplayString"])(e.translate("General_IfArchivingIsFastYouCanSetupCronRunMoreOften")),1),C])):Object(i["createCommentVNode"])("",!0),Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.translate("General_SmallTrafficYouCanLeaveDefault",e.todayArchiveTimeToLiveDefault))+" ",1),B,Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.translate("General_MediumToHighTrafficItIsRecommendedTo",1800,3600)),1)])):Object(i["createCommentVNode"])("",!0)])]),Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(A,{saving:e.isLoading,onConfirm:t[3]||(t[3]=function(t){return e.save()})},null,8,["saving"])])])]})),_:1},8,["content-title"])}var T=n("a5a2"),N=Object(i["defineComponent"])({props:{enableBrowserTriggerArchiving:Boolean,showSegmentArchiveTriggerInfo:Boolean,isGeneralSettingsAdminEnabled:Boolean,showWarningCron:Boolean,todayArchiveTimeToLive:Number,todayArchiveTimeToLiveDefault:Number},components:{ContentBlock:a["ContentBlock"],SaveButton:T["SaveButton"]},data:function(){return{isLoading:!1,enableBrowserTriggerArchivingValue:this.enableBrowserTriggerArchiving?1:0,todayArchiveTimeToLiveValue:this.todayArchiveTimeToLive}},watch:{enableBrowserTriggerArchiving:function(e){this.enableBrowserTriggerArchivingValue=e?1:0},todayArchiveTimeToLive:function(e){this.todayArchiveTimeToLiveValue=e}},computed:{archivingTriggerDesc:function(){var e="";return e+=Object(a["translate"])("General_ArchivingTriggerDescription",'',""),this.showSegmentArchiveTriggerInfo&&(e+=Object(a["translate"])("General_ArchivingTriggerSegment")),e},archivingInlineHelp:function(){var e=Object(a["translate"])("General_ArchivingInlineHelp");return e+="
",e+=Object(a["translate"])("General_SeeTheOfficialDocumentationForMoreInformation",'',""),e}},methods:{save:function(){var e=this;this.isLoading=!0,a["AjaxHelper"].post({module:"API",method:"CoreAdminHome.setArchiveSettings"},{enableBrowserTriggerArchiving:this.enableBrowserTriggerArchivingValue,todayArchiveTimeToLive:this.todayArchiveTimeToLiveValue}).then((function(){e.isLoading=!1;var t=a["NotificationsStore"].show({message:Object(a["translate"])("CoreAdminHome_SettingsSaveSuccess"),type:"transient",id:"generalSettings",context:"success"});a["NotificationsStore"].scrollToNotification(t)})).finally((function(){e.isLoading=!1}))}}});N.render=A;var w=N,E=(Object(a["createAngularJsAdapter"])({component:w,scope:{enableBrowserTriggerArchiving:{angularJsBind:"<"},showSegmentArchiveTriggerInfo:{angularJsBind:"<"},isGeneralSettingsAdminEnabled:{angularJsBind:"<"},showWarningCron:{angularJsBind:"<"},todayArchiveTimeToLive:{angularJsBind:"<"},todayArchiveTimeToLiveDefault:{angularJsBind:"<"}},directiveName:"matomoArchivingSettings"}),{id:"logoSettings"}),L={id:"logoUploadForm",ref:"logoUploadForm",method:"post",enctype:"multipart/form-data",action:"index.php?module=CoreAdminHome&format=json&action=uploadCustomLogo"},U={key:0},_=["value"],F=Object(i["createElementVNode"])("input",{type:"hidden",name:"force_api_session",value:"1"},null,-1),H={key:0},k={key:0,class:"alert alert-warning uploaderror"},x={class:"row"},G={class:"col s12"},P=["src"],D={class:"row"},M={class:"col s12"},I=["src"],J={key:1},q=["innerHTML"],W={key:1},R={class:"alert alert-warning"}; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function Y(e,t,o,n,r,i){var c=Object(a["resolveComponent"])("Field"),l=Object(a["resolveComponent"])("SaveButton"),s=Object(a["resolveComponent"])("ContentBlock"),d=Object(a["resolveDirective"])("form");return Object(a["openBlock"])(),Object(a["createBlock"])(s,{"content-title":e.translate("CoreAdminHome_BrandingSettings"),anchor:"brandingSettings"},{default:Object(a["withCtx"])((function(){return[Object(a["withDirectives"])(Object(a["createElementVNode"])("div",null,[Object(a["createElementVNode"])("p",null,Object(a["toDisplayString"])(e.translate("CoreAdminHome_CustomLogoHelpText")),1),Object(a["createVNode"])(c,{name:"useCustomLogo",uicontrol:"checkbox","model-value":e.enabled,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.onUseCustomLogoChange(t)}),title:e.translate("CoreAdminHome_UseCustomLogo"),"inline-help":e.help},null,8,["model-value","title","inline-help"]),Object(a["withDirectives"])(Object(a["createElementVNode"])("div",E,[Object(a["createElementVNode"])("form",w,[e.fileUploadEnabled?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",U,[Object(a["createElementVNode"])("input",{type:"hidden",name:"token_auth",value:e.tokenAuth},null,8,_),F,e.logosWriteable?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",k,[Object(a["createVNode"])(a["Transition"],{name:"fade-out"},{default:Object(a["withCtx"])((function(){return[e.showUploadError?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",H,Object(a["toDisplayString"])(e.translate("CoreAdminHome_LogoUploadFailed")),1)):Object(a["createCommentVNode"])("",!0)]})),_:1}),Object(a["createVNode"])(c,{uicontrol:"file",name:"customLogo","model-value":e.customLogo,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.onCustomLogoChange(t)}),title:e.translate("CoreAdminHome_LogoUpload"),"inline-help":e.translate("CoreAdminHome_LogoUploadHelp","JPG / PNG / GIF","110")},null,8,["model-value","title","inline-help"]),Object(a["createElementVNode"])("div",x,[Object(a["createElementVNode"])("div",D,[Object(a["createElementVNode"])("img",{src:e.pathUserLogoWithBuster,id:"currentLogo",style:{"max-height":"150px"},ref:"currentLogo"},null,8,G)])]),Object(a["createVNode"])(c,{uicontrol:"file",name:"customFavicon","model-value":e.customFavicon,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.onFaviconChange(t)}),title:e.translate("CoreAdminHome_FaviconUpload"),"inline-help":e.translate("CoreAdminHome_LogoUploadHelp","JPG / PNG / GIF","16")},null,8,["model-value","title","inline-help"]),Object(a["createElementVNode"])("div",P,[Object(a["createElementVNode"])("div",J,[Object(a["createElementVNode"])("img",{src:e.pathUserFaviconWithBuster,id:"currentFavicon",width:"16",height:"16",ref:"currentFavicon"},null,8,M)])])])):Object(a["createCommentVNode"])("",!0),e.logosWriteable?Object(a["createCommentVNode"])("",!0):(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",W,[Object(a["createElementVNode"])("div",{class:"alert alert-warning",innerHTML:e.logosNotWriteableWarning},null,8,I)]))])):Object(a["createCommentVNode"])("",!0),e.fileUploadEnabled?Object(a["createCommentVNode"])("",!0):(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",q,[Object(a["createElementVNode"])("div",R,Object(a["toDisplayString"])(e.translate("CoreAdminHome_FileUploadDisabled","file_uploads=1")),1)]))],512)],512),[[a["vShow"],e.enabled]]),Object(a["createVNode"])(l,{onConfirm:t[3]||(t[3]=function(t){return e.save()}),saving:e.isLoading},null,8,["saving"])],512),[[d]])]})),_:1},8,["content-title"])}var $=window,z=$.$,K=Object(a["defineComponent"])({props:{fileUploadEnabled:{type:Boolean,required:!0},logosWriteable:{type:Boolean,required:!0},useCustomLogo:{type:Boolean,required:!0},pathUserLogoDirectory:{type:String,required:!0},pathUserLogo:{type:String,required:!0},pathUserLogoSmall:{type:String,required:!0},pathUserLogoSvg:{type:String,required:!0},hasUserLogo:{type:Boolean,required:!0},pathUserFavicon:{type:String,required:!0},hasUserFavicon:{type:Boolean,required:!0},isPluginsAdminEnabled:{type:Boolean,required:!0}},components:{Field:S["Field"],ContentBlock:i["ContentBlock"],SaveButton:S["SaveButton"]},directives:{Form:S["Form"]},data:function(){return{isLoading:!1,enabled:this.useCustomLogo,customLogo:this.pathUserLogo,customFavicon:this.pathUserFavicon,showUploadError:!1,currentLogoSrcExists:this.hasUserLogo,currentFaviconSrcExists:this.hasUserFavicon,currentLogoCacheBuster:(new Date).getTime(),currentFaviconCacheBuster:(new Date).getTime()}},computed:{tokenAuth:function(){return i["Matomo"].token_auth},logosNotWriteableWarning:function(){return Object(i["translate"])("CoreAdminHome_LogoNotWriteableInstruction","".concat(this.pathUserLogoDirectory,"
"),"".concat(this.pathUserLogo,", ").concat(this.pathUserLogoSmall,", ").concat(this.pathUserLogoSvg))},help:function(){if(this.isPluginsAdminEnabled){var e='"'.concat(Object(i["translate"])("General_GiveUsYourFeedback"),'"'),t='';return Object(i["translate"])("CoreAdminHome_CustomLogoFeedbackInfo",e,t,"")}},pathUserLogoWithBuster:function(){return this.currentLogoSrcExists&&this.pathUserLogo?"".concat(this.pathUserLogo,"?").concat(this.currentLogoCacheBuster):""},pathUserFaviconWithBuster:function(){return this.currentFaviconSrcExists&&this.pathUserFavicon?"".concat(this.pathUserFavicon,"?").concat(this.currentFaviconCacheBuster):""}},methods:{onUseCustomLogoChange:function(e){this.enabled=e},onCustomLogoChange:function(e){this.customLogo=e,this.updateLogo()},onFaviconChange:function(e){this.customFavicon=e,this.updateLogo()},save:function(){var e=this;this.isLoading=!0,i["AjaxHelper"].post({module:"API",method:"CoreAdminHome.setBrandingSettings"},{useCustomLogo:this.enabled?"1":"0"}).then((function(){var e=i["NotificationsStore"].show({message:Object(i["translate"])("CoreAdminHome_SettingsSaveSuccess"),type:"transient",id:"generalSettings",context:"success"});i["NotificationsStore"].scrollToNotification(e)})).finally((function(){e.isLoading=!1}))},updateLogo:function(){var e=this,t=!!this.customLogo,o=!!this.customFavicon;if(t||o){this.showUploadError=!1;var n="upload".concat((new Date).getTime()),r=z('