diff options
author | dizzy <diosmosis@users.noreply.github.com> | 2022-03-17 04:21:09 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-17 04:21:09 +0300 |
commit | 39d5fbab4aaf6c4728ba4b42ed818bb4652f4f68 (patch) | |
tree | 60eac15e9c1b2dbf6441ebda308f24f2f9ed011e /plugins/UsersManager | |
parent | f3c9ee7652cad18ce815d60fdc564bcdd076c10b (diff) |
[Vue] migrate LanguagesManager to vue (#18931)
* migrate translation search directive to vue
* Allow specifying usable components in vue-entry and use in LanguagesManager configuration.twig
* migrate language selector, fix prop type in personalsettings.vue, and get selector to work in installation
* built vue files
Diffstat (limited to 'plugins/UsersManager')
3 files changed, 22 insertions, 22 deletions
diff --git a/plugins/UsersManager/vue/dist/UsersManager.umd.js b/plugins/UsersManager/vue/dist/UsersManager.umd.js index d39e14ac58..a79c88744d 100644 --- a/plugins/UsersManager/vue/dist/UsersManager.umd.js +++ b/plugins/UsersManager/vue/dist/UsersManager.umd.js @@ -3592,38 +3592,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=d46d01d4 +// 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=94ecac48 -var PersonalSettingsvue_type_template_id_d46d01d4_hoisted_1 = { +var PersonalSettingsvue_type_template_id_94ecac48_hoisted_1 = { id: "userSettingsTable" }; -var PersonalSettingsvue_type_template_id_d46d01d4_hoisted_2 = { +var PersonalSettingsvue_type_template_id_94ecac48_hoisted_2 = { key: 0 }; -var PersonalSettingsvue_type_template_id_d46d01d4_hoisted_3 = { +var PersonalSettingsvue_type_template_id_94ecac48_hoisted_3 = { id: "languageHelp", class: "inline-help-node" }; -var PersonalSettingsvue_type_template_id_d46d01d4_hoisted_4 = { +var PersonalSettingsvue_type_template_id_94ecac48_hoisted_4 = { target: "_blank", rel: "noreferrer noopener", href: "https://matomo.org/translations/" }; -var PersonalSettingsvue_type_template_id_d46d01d4_hoisted_5 = { +var PersonalSettingsvue_type_template_id_94ecac48_hoisted_5 = { class: "sites_autocomplete" }; -var PersonalSettingsvue_type_template_id_d46d01d4_hoisted_6 = { +var PersonalSettingsvue_type_template_id_94ecac48_hoisted_6 = { class: "modal", id: "confirmChangesWithPassword", ref: "confirmChangesWithPasswordModal" }; -var PersonalSettingsvue_type_template_id_d46d01d4_hoisted_7 = { +var PersonalSettingsvue_type_template_id_94ecac48_hoisted_7 = { class: "modal-content" }; -var PersonalSettingsvue_type_template_id_d46d01d4_hoisted_8 = { +var PersonalSettingsvue_type_template_id_94ecac48_hoisted_8 = { class: "modal-footer" }; -function PersonalSettingsvue_type_template_id_d46d01d4_render(_ctx, _cache, $props, $setup, $data, $options) { +function PersonalSettingsvue_type_template_id_94ecac48_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"); @@ -3639,7 +3639,7 @@ function PersonalSettingsvue_type_template_id_d46d01d4_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_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, { + return [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("form", PersonalSettingsvue_type_template_id_94ecac48_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'), @@ -3649,7 +3649,7 @@ function PersonalSettingsvue_type_template_id_d46d01d4_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_d46d01d4_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_94ecac48_hoisted_2, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { uicontrol: "text", name: "email", "model-value": _ctx.email, @@ -3659,7 +3659,7 @@ function PersonalSettingsvue_type_template_id_d46d01d4_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_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, { + }, 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_94ecac48_hoisted_3, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", PersonalSettingsvue_type_template_id_94ecac48_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, @@ -3688,7 +3688,7 @@ function PersonalSettingsvue_type_template_id_d46d01d4_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_d46d01d4_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_94ecac48_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; @@ -3712,7 +3712,7 @@ function PersonalSettingsvue_type_template_id_d46d01d4_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_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, { + }, null, 8, ["saving"]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", PersonalSettingsvue_type_template_id_94ecac48_hoisted_6, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", PersonalSettingsvue_type_template_id_94ecac48_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, @@ -3722,7 +3722,7 @@ function PersonalSettingsvue_type_template_id_d46d01d4_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_d46d01d4_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_94ecac48_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) { @@ -3742,7 +3742,7 @@ function PersonalSettingsvue_type_template_id_d46d01d4_render(_ctx, _cache, $pro _: 1 }, 8, ["content-title"]); } -// CONCATENATED MODULE: ./plugins/UsersManager/vue/src/PersonalSettings/PersonalSettings.vue?vue&type=template&id=d46d01d4 +// CONCATENATED MODULE: ./plugins/UsersManager/vue/src/PersonalSettings/PersonalSettings.vue?vue&type=template&id=94ecac48 // 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 @@ -3785,7 +3785,7 @@ var PersonalSettingsvue_type_script_lang_ts_window = window, required: true }, defaultReport: { - type: String, + type: [String, Number], required: true }, defaultReportOptions: { @@ -3900,7 +3900,7 @@ var PersonalSettingsvue_type_script_lang_ts_window = window, -PersonalSettingsvue_type_script_lang_ts.render = PersonalSettingsvue_type_template_id_d46d01d4_render +PersonalSettingsvue_type_script_lang_ts.render = PersonalSettingsvue_type_template_id_94ecac48_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/dist/UsersManager.umd.min.js b/plugins/UsersManager/vue/dist/UsersManager.umd.min.js index ca332199e1..370dfc72c5 100644 --- a/plugins/UsersManager/vue/dist/UsersManager.umd.min.js +++ b/plugins/UsersManager/vue/dist/UsersManager.umd.min.js @@ -46,7 +46,7 @@ * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function ks(e,t,n,s,r,i){var o=Object(a["resolveComponent"])("Field"),l=Object(a["resolveComponent"])("SiteSelector"),c=Object(a["resolveComponent"])("SaveButton"),d=Object(a["resolveComponent"])("ContentBlock"),u=Object(a["resolveDirective"])("form");return Object(a["openBlock"])(),Object(a["createBlock"])(d,{"content-title":e.title,feature:"true"},{default:Object(a["withCtx"])((function(){return[Object(a["withDirectives"])(Object(a["createElementVNode"])("form",vs,[Object(a["createElementVNode"])("div",null,[Object(a["createVNode"])(o,{uicontrol:"text",name:"username",title:e.translate("General_Username"),disabled:!0,modelValue:e.username,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.username=t}),"inline-help":e.translate("UsersManager_YourUsernameCannotBeChanged")},null,8,["title","modelValue","inline-help"])]),e.isUsersAdminEnabled?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",Cs,[Object(a["createVNode"])(o,{uicontrol:"text",name:"email","model-value":e.email,"onUpdate:modelValue":t[1]||(t[1]=function(t){e.email=t,e.doesRequirePasswordConfirmation=!0}),maxlength:100,title:e.translate("UsersManager_Email")},null,8,["model-value","title"])])):Object(a["createCommentVNode"])("",!0),Object(a["createElementVNode"])("div",Ss,[Object(a["createElementVNode"])("a",Ns,Object(a["toDisplayString"])(e.translate("LanguagesManager_AboutPiwikTranslations")),1)]),Object(a["createElementVNode"])("div",null,[Object(a["createVNode"])(o,{uicontrol:"select",name:"language",modelValue:e.language,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.language=t}),title:e.translate("General_Language"),options:e.languageOptions,"inline-help":"#languageHelp"},null,8,["modelValue","title","options"])]),Object(a["createElementVNode"])("div",null,[Object(a["createVNode"])(o,{uicontrol:"select",name:"timeformat",modelValue:e.timeformat,"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.timeformat=t}),title:e.translate("General_TimeFormat"),options:e.timeFormats},null,8,["modelValue","title","options"])]),Object(a["createElementVNode"])("div",null,[Object(a["createVNode"])(o,{uicontrol:"radio",name:"defaultReport",modelValue:e.theDefaultReport,"onUpdate:modelValue":t[4]||(t[4]=function(t){return e.theDefaultReport=t}),introduction:e.translate("UsersManager_ReportToLoadByDefault"),title:e.translate("General_AllWebsitesDashboard"),options:e.defaultReportOptions},null,8,["modelValue","introduction","title","options"])]),Object(a["createElementVNode"])("div",Us,[Object(a["createVNode"])(l,{modelValue:e.site,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.site=t}),"show-selected-site":!0,"switch-site-on-select":!1,"show-all-sites-item":!1,showselectedsite:!0,id:"defaultReportSiteSelector"},null,8,["modelValue"])]),Object(a["createElementVNode"])("div",null,[Object(a["createVNode"])(o,{uicontrol:"radio",name:"defaultDate",modelValue:e.theDefaultDate,"onUpdate:modelValue":t[6]||(t[6]=function(t){return e.theDefaultDate=t}),introduction:e.translate("UsersManager_ReportDateToLoadByDefault"),options:e.availableDefaultDates},null,8,["modelValue","introduction","options"])]),Object(a["createVNode"])(c,{onConfirm:t[7]||(t[7]=function(t){return e.save()}),saving:e.loading},null,8,["saving"]),Object(a["createElementVNode"])("div",ys,[Object(a["createElementVNode"])("div",Vs,[Object(a["createElementVNode"])("h2",null,Object(a["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1),Object(a["createElementVNode"])("div",null,[Object(a["createVNode"])(o,{uicontrol:"password",name:"currentPassword",autocomplete:!1,modelValue:e.passwordCurrent,"onUpdate:modelValue":t[8]||(t[8]=function(t){return e.passwordCurrent=t}),"full-width":!0,title:e.translate("UsersManager_YourCurrentPassword")},null,8,["modelValue","title"])])]),Object(a["createElementVNode"])("div",Es,[Object(a["createElementVNode"])("a",{href:"",class:"modal-action btn",onClick:t[9]||(t[9]=Object(a["withModifiers"])((function(t){return e.save()}),["prevent"])),style:{"margin-right":"3.5px"}},Object(a["toDisplayString"])(e.translate("General_Ok")),1),Object(a["createElementVNode"])("a",{href:"",class:"modal-action modal-close modal-no",onClick:t[10]||(t[10]=Object(a["withModifiers"])((function(t){return e.passwordCurrent=""}),["prevent"]))},Object(a["toDisplayString"])(e.translate("General_Cancel")),1)])],512)],512),[[u]])]})),_:1},8,["content-title"])}var As=window,ws=As.$,Ts=Object(a["defineComponent"])({props:{isUsersAdminEnabled:{type:Boolean,required:!0},title:{type:String,required:!0},userLogin:{type:String,required:!0},userEmail:{type:String,required:!0},currentLanguageCode:{type:String,required:!0},languageOptions:{type:Object,required:!0},currentTimeformat:{type:Number,required:!0},timeFormats:{type:Object,required:!0},defaultReport:{type:String,required:!0},defaultReportOptions:{type:Object,required:!0},defaultReportIdSite:{type:[String,Number],required:!0},defaultReportSiteName:{type:String,required:!0},defaultDate:{type:String,required:!0},availableDefaultDates:{type:Object,required:!0}},components:{ContentBlock:i["ContentBlock"],SaveButton:h["SaveButton"],Field:h["Field"],SiteSelector:i["SiteSelector"]},directives:{Form:h["Form"]},data:function(){return{doesRequirePasswordConfirmation:!1,username:this.userLogin,email:this.userEmail,language:this.currentLanguageCode,timeformat:this.currentTimeformat,theDefaultReport:this.defaultReport,site:{id:this.defaultReportIdSite,name:i["Matomo"].helper.htmlDecode(this.defaultReportSiteName)},theDefaultDate:this.defaultDate,loading:!1,passwordCurrent:""}},methods:{save:function(){var e=this;if(!this.doesRequirePasswordConfirmation||this.passwordCurrent){var t=M.Modal.getInstance(this.$refs.confirmChangesWithPasswordModal);t&&t.close();var n={email:this.email,defaultReport:"MultiSites"===this.theDefaultReport?this.theDefaultReport:this.site.id,defaultDate:this.theDefaultDate,language:this.language,timeformat:this.timeformat};this.passwordCurrent&&(n.passwordConfirmation=this.passwordCurrent),this.loading=!0,i["AjaxHelper"].post({module:"UsersManager",action:"recordUserSettings",format:"json"},n,{withTokenInUrl:!0}).then((function(){var t=i["NotificationsStore"].show({message:Object(i["translate"])("CoreAdminHome_SettingsSaveSuccess"),id:"PersonalSettingsSuccess",context:"success",type:"transient"});i["NotificationsStore"].scrollToNotification(t),e.doesRequirePasswordConfirmation=!1,e.passwordCurrent="",e.loading=!1})).catch((function(){e.loading=!1,e.passwordCurrent=""}))}else ws(this.$refs.confirmChangesWithPasswordModal).modal({dismissible:!1,ready:function(){ws(".modal.open #currentPassword").focus()}}).modal("open")}}});Ts.render=ks;var Ms=Ts; + */function ks(e,t,n,s,r,i){var o=Object(a["resolveComponent"])("Field"),l=Object(a["resolveComponent"])("SiteSelector"),c=Object(a["resolveComponent"])("SaveButton"),d=Object(a["resolveComponent"])("ContentBlock"),u=Object(a["resolveDirective"])("form");return Object(a["openBlock"])(),Object(a["createBlock"])(d,{"content-title":e.title,feature:"true"},{default:Object(a["withCtx"])((function(){return[Object(a["withDirectives"])(Object(a["createElementVNode"])("form",vs,[Object(a["createElementVNode"])("div",null,[Object(a["createVNode"])(o,{uicontrol:"text",name:"username",title:e.translate("General_Username"),disabled:!0,modelValue:e.username,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.username=t}),"inline-help":e.translate("UsersManager_YourUsernameCannotBeChanged")},null,8,["title","modelValue","inline-help"])]),e.isUsersAdminEnabled?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",Cs,[Object(a["createVNode"])(o,{uicontrol:"text",name:"email","model-value":e.email,"onUpdate:modelValue":t[1]||(t[1]=function(t){e.email=t,e.doesRequirePasswordConfirmation=!0}),maxlength:100,title:e.translate("UsersManager_Email")},null,8,["model-value","title"])])):Object(a["createCommentVNode"])("",!0),Object(a["createElementVNode"])("div",Ss,[Object(a["createElementVNode"])("a",Ns,Object(a["toDisplayString"])(e.translate("LanguagesManager_AboutPiwikTranslations")),1)]),Object(a["createElementVNode"])("div",null,[Object(a["createVNode"])(o,{uicontrol:"select",name:"language",modelValue:e.language,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.language=t}),title:e.translate("General_Language"),options:e.languageOptions,"inline-help":"#languageHelp"},null,8,["modelValue","title","options"])]),Object(a["createElementVNode"])("div",null,[Object(a["createVNode"])(o,{uicontrol:"select",name:"timeformat",modelValue:e.timeformat,"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.timeformat=t}),title:e.translate("General_TimeFormat"),options:e.timeFormats},null,8,["modelValue","title","options"])]),Object(a["createElementVNode"])("div",null,[Object(a["createVNode"])(o,{uicontrol:"radio",name:"defaultReport",modelValue:e.theDefaultReport,"onUpdate:modelValue":t[4]||(t[4]=function(t){return e.theDefaultReport=t}),introduction:e.translate("UsersManager_ReportToLoadByDefault"),title:e.translate("General_AllWebsitesDashboard"),options:e.defaultReportOptions},null,8,["modelValue","introduction","title","options"])]),Object(a["createElementVNode"])("div",Us,[Object(a["createVNode"])(l,{modelValue:e.site,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.site=t}),"show-selected-site":!0,"switch-site-on-select":!1,"show-all-sites-item":!1,showselectedsite:!0,id:"defaultReportSiteSelector"},null,8,["modelValue"])]),Object(a["createElementVNode"])("div",null,[Object(a["createVNode"])(o,{uicontrol:"radio",name:"defaultDate",modelValue:e.theDefaultDate,"onUpdate:modelValue":t[6]||(t[6]=function(t){return e.theDefaultDate=t}),introduction:e.translate("UsersManager_ReportDateToLoadByDefault"),options:e.availableDefaultDates},null,8,["modelValue","introduction","options"])]),Object(a["createVNode"])(c,{onConfirm:t[7]||(t[7]=function(t){return e.save()}),saving:e.loading},null,8,["saving"]),Object(a["createElementVNode"])("div",ys,[Object(a["createElementVNode"])("div",Vs,[Object(a["createElementVNode"])("h2",null,Object(a["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1),Object(a["createElementVNode"])("div",null,[Object(a["createVNode"])(o,{uicontrol:"password",name:"currentPassword",autocomplete:!1,modelValue:e.passwordCurrent,"onUpdate:modelValue":t[8]||(t[8]=function(t){return e.passwordCurrent=t}),"full-width":!0,title:e.translate("UsersManager_YourCurrentPassword")},null,8,["modelValue","title"])])]),Object(a["createElementVNode"])("div",Es,[Object(a["createElementVNode"])("a",{href:"",class:"modal-action btn",onClick:t[9]||(t[9]=Object(a["withModifiers"])((function(t){return e.save()}),["prevent"])),style:{"margin-right":"3.5px"}},Object(a["toDisplayString"])(e.translate("General_Ok")),1),Object(a["createElementVNode"])("a",{href:"",class:"modal-action modal-close modal-no",onClick:t[10]||(t[10]=Object(a["withModifiers"])((function(t){return e.passwordCurrent=""}),["prevent"]))},Object(a["toDisplayString"])(e.translate("General_Cancel")),1)])],512)],512),[[u]])]})),_:1},8,["content-title"])}var As=window,ws=As.$,Ts=Object(a["defineComponent"])({props:{isUsersAdminEnabled:{type:Boolean,required:!0},title:{type:String,required:!0},userLogin:{type:String,required:!0},userEmail:{type:String,required:!0},currentLanguageCode:{type:String,required:!0},languageOptions:{type:Object,required:!0},currentTimeformat:{type:Number,required:!0},timeFormats:{type:Object,required:!0},defaultReport:{type:[String,Number],required:!0},defaultReportOptions:{type:Object,required:!0},defaultReportIdSite:{type:[String,Number],required:!0},defaultReportSiteName:{type:String,required:!0},defaultDate:{type:String,required:!0},availableDefaultDates:{type:Object,required:!0}},components:{ContentBlock:i["ContentBlock"],SaveButton:h["SaveButton"],Field:h["Field"],SiteSelector:i["SiteSelector"]},directives:{Form:h["Form"]},data:function(){return{doesRequirePasswordConfirmation:!1,username:this.userLogin,email:this.userEmail,language:this.currentLanguageCode,timeformat:this.currentTimeformat,theDefaultReport:this.defaultReport,site:{id:this.defaultReportIdSite,name:i["Matomo"].helper.htmlDecode(this.defaultReportSiteName)},theDefaultDate:this.defaultDate,loading:!1,passwordCurrent:""}},methods:{save:function(){var e=this;if(!this.doesRequirePasswordConfirmation||this.passwordCurrent){var t=M.Modal.getInstance(this.$refs.confirmChangesWithPasswordModal);t&&t.close();var n={email:this.email,defaultReport:"MultiSites"===this.theDefaultReport?this.theDefaultReport:this.site.id,defaultDate:this.theDefaultDate,language:this.language,timeformat:this.timeformat};this.passwordCurrent&&(n.passwordConfirmation=this.passwordCurrent),this.loading=!0,i["AjaxHelper"].post({module:"UsersManager",action:"recordUserSettings",format:"json"},n,{withTokenInUrl:!0}).then((function(){var t=i["NotificationsStore"].show({message:Object(i["translate"])("CoreAdminHome_SettingsSaveSuccess"),id:"PersonalSettingsSuccess",context:"success",type:"transient"});i["NotificationsStore"].scrollToNotification(t),e.doesRequirePasswordConfirmation=!1,e.passwordCurrent="",e.loading=!1})).catch((function(){e.loading=!1,e.passwordCurrent=""}))}else ws(this.$refs.confirmChangesWithPasswordModal).modal({dismissible:!1,ready:function(){ws(".modal.open #currentPassword").focus()}}).modal("open")}}});Ts.render=ks;var Ms=Ts; /*! * Matomo - free/libre analytics platform * diff --git a/plugins/UsersManager/vue/src/PersonalSettings/PersonalSettings.vue b/plugins/UsersManager/vue/src/PersonalSettings/PersonalSettings.vue index 927368a371..1780e05675 100644 --- a/plugins/UsersManager/vue/src/PersonalSettings/PersonalSettings.vue +++ b/plugins/UsersManager/vue/src/PersonalSettings/PersonalSettings.vue @@ -147,7 +147,7 @@ interface PersonalSettingsState { email: string; language: string; timeformat: number; - theDefaultReport: string; + theDefaultReport: string|number; site: SiteRef; theDefaultDate: string; loading: boolean; @@ -191,7 +191,7 @@ export default defineComponent({ required: true, }, defaultReport: { - type: String, + type: [String, Number], required: true, }, defaultReportOptions: { |