mirror of
https://github.com/nextcloud/server.git
synced 2026-06-11 01:30:50 -04:00
Wire the password-confirmation interceptors into the recommendedapps entry point and switch the installer to a single bulk enable call so the strict password confirmation on enableApps is satisfied. Fixes #60068 -e Signed-off-by: Peter Ringelmann <peter.ringelmann@nextcloud.com>
2 lines
No EOL
11 KiB
JavaScript
2 lines
No EOL
11 KiB
JavaScript
(()=>{"use strict";var e,t,n,a={44549(e,t,n){var a=n(21777),i=n(19051),o=n(53334),r=n(56760),s=n(85471),c=n(35947);const d=null===(p=(0,a.HW)())?(0,c.YK)().setApp("core").build():(0,c.YK)().setApp("core").setUid(p.uid).build();var p;(0,c.YK)().setApp("unified-search").detectUser().build();var l=n(32981),u=n(63814),A=n(74095),g=n(32073);const m={calendar:{description:(0,o.t)("core","Schedule work & meetings, synced with all your devices."),icon:(0,u.d0)("core","places/calendar.svg")},contacts:{description:(0,o.t)("core","Keep your colleagues and friends in one place without leaking their private info."),icon:(0,u.d0)("core","places/contacts.svg")},mail:{description:(0,o.t)("core","Simple email app nicely integrated with Files, Contacts and Calendar."),icon:(0,u.d0)("core","actions/mail.svg")},spreed:{description:(0,o.t)("core","Chatting, video calls, screen sharing, online meetings and web conferencing – in your browser and with mobile apps."),icon:(0,u.d0)("core","apps/spreed.svg")},richdocuments:{name:"Nextcloud Office",description:(0,o.t)("core","Collaborative documents, spreadsheets and presentations, built on Collabora Online."),icon:(0,u.d0)("core","apps/richdocuments.svg")},notes:{description:(0,o.t)("core","Distraction free note taking app."),icon:(0,u.d0)("core","apps/notes.svg")},richdocumentscode:{hidden:!0}},h=Object.keys(m),f={name:"RecommendedApps",components:{NcCheckboxRadioSwitch:g.A,NcButton:A.A},data:()=>({showInstallButton:!1,installingApps:!1,loadingApps:!0,loadingAppsError:!1,apps:[],defaultPageUrl:(0,l.C)("core","defaultPageUrl")}),computed:{recommendedApps(){return this.apps.filter((e=>h.includes(e.id)))},isAnyAppSelected(){return this.recommendedApps.some((e=>e.isSelected))}},async mounted(){try{const{data:e}=await i.Ay.get((0,u.Jv)("settings/apps/list"));d.info(`${e.apps.length} apps fetched`),this.apps=e.apps.map((e=>Object.assign(e,{loading:!1,installationError:!1,isSelected:e.isCompatible}))),d.debug(`${this.recommendedApps.length} recommended apps found`,{apps:this.recommendedApps}),this.showInstallButton=!0}catch(e){d.error("could not fetch app list",{error:e}),this.loadingAppsError=!0}finally{this.loadingApps=!1}},methods:{async installApps(){const e=this.recommendedApps.filter((e=>!e.active&&e.isCompatible&&e.canInstall&&e.isSelected));if(0===e.length)return;this.installingApps=!0,e.forEach((e=>{e.loading=!0}));const t=e.map((e=>e.id));d.debug(`installing ${e.length} recommended apps`,{appIds:t});try{await i.Ay.post((0,u.Jv)("settings/apps/enable"),{appIds:t,groups:[]},{confirmPassword:r.mH.Strict}),e.forEach((e=>{e.loading=!1,e.active=!0})),d.info("all recommended apps installed, redirecting …"),window.location=this.defaultPageUrl}catch(t){d.error("could not install recommended apps",{error:t}),e.forEach((e=>{e.loading=!1,e.isSelected=!1,e.installationError=!0})),this.installingApps=!1}},customIcon:e=>e in m&&m[e].icon?m[e].icon:(d.warn(`no app icon for recommended app ${e}`),(0,u.d0)("core","places/default-app-icon.svg")),customName:e=>e.id in m&&m[e.id].name||e.name,customDescription:e=>e in m?m[e].description:(d.warn(`no app description for recommended app ${e}`),""),isHidden:e=>e in m&&!!m[e].hidden,toggleSelect(e){if(!(e in m)||!this.showInstallButton)return;const t=this.apps.findIndex((t=>t.id===e));this.$set(this.apps[t],"isSelected",!this.apps[t].isSelected)}}};var v=n(85072),b=n.n(v),C=n(97825),y=n.n(C),x=n(77659),w=n.n(x),_=n(55056),k=n.n(_),S=n(10540),I=n.n(S),B=n(41113),E=n.n(B),O=n(38168),P={};P.styleTagTransform=E(),P.setAttributes=k(),P.insert=w().bind(null,"head"),P.domAPI=y(),P.insertStyleElement=I(),b()(O.A,P),O.A&&O.A.locals&&O.A.locals;var T=(0,n(14486).A)(f,(function(){var e=this,t=e._self._c;return t("div",{staticClass:"guest-box"},[t("h2",[e._v(e._s(e.t("core","Recommended apps")))]),e._v(" "),e.loadingApps?t("p",{staticClass:"loading text-center"},[e._v("\n\t\t"+e._s(e.t("core","Loading apps …"))+"\n\t")]):e.loadingAppsError?t("p",{staticClass:"loading-error text-center"},[e._v("\n\t\t"+e._s(e.t("core","Could not fetch list of apps from the App Store."))+"\n\t")]):e._e(),e._v(" "),e._l(e.recommendedApps,(function(n){return t("div",{key:n.id,staticClass:"app"},[e.isHidden(n.id)?e._e():[t("img",{attrs:{src:e.customIcon(n.id),alt:""}}),e._v(" "),t("div",{staticClass:"info"},[t("h3",[e._v(e._s(e.customName(n)))]),e._v(" "),t("p",{domProps:{textContent:e._s(e.customDescription(n.id))}}),e._v(" "),n.installationError?t("p",[t("strong",[e._v(e._s(e.t("core","App download or installation failed")))])]):n.isCompatible?n.canInstall?e._e():t("p",[t("strong",[e._v(e._s(e.t("core","Cannot install this app")))])]):t("p",[t("strong",[e._v(e._s(e.t("core","Cannot install this app because it is not compatible")))])])]),e._v(" "),t("NcCheckboxRadioSwitch",{attrs:{checked:n.isSelected||n.active,disabled:!n.isCompatible||n.active,loading:n.loading},on:{"update:checked":function(t){return e.toggleSelect(n.id)}}})]],2)})),e._v(" "),t("div",{staticClass:"dialog-row"},[e.showInstallButton&&!e.installingApps?t("NcButton",{attrs:{type:"tertiary",role:"link",href:e.defaultPageUrl}},[e._v("\n\t\t\t"+e._s(e.t("core","Skip"))+"\n\t\t")]):e._e(),e._v(" "),e.showInstallButton?t("NcButton",{attrs:{type:"primary",disabled:e.installingApps||!e.isAnyAppSelected},on:{click:function(t){return t.stopPropagation(),t.preventDefault(),e.installApps.apply(null,arguments)}}},[e._v("\n\t\t\t"+e._s(e.installingApps?e.t("core","Installing apps …"):e.t("core","Install recommended apps"))+"\n\t\t")]):e._e()],1)],2)}),[],!1,null,"d0c5ec54",null);const j=T.exports;(0,r.IF)(i.Ay),n.nc=(0,a.aV)(),s.Ay.mixin({methods:{t:o.Tl}}),(new(s.Ay.extend(j))).$mount("#recommended-apps"),d.debug("recommended apps view rendered")},38168(e,t,n){n.d(t,{A:()=>s});var a=n(71354),i=n.n(a),o=n(76314),r=n.n(o)()(i());r.push([e.id,".dialog-row[data-v-d0c5ec54]{display:flex;justify-content:end;margin-top:8px}p.loading[data-v-d0c5ec54],p.loading-error[data-v-d0c5ec54]{height:100px}p[data-v-d0c5ec54]:last-child{margin-top:10px}.text-center[data-v-d0c5ec54]{text-align:center}.app[data-v-d0c5ec54]{display:flex;flex-direction:row}.app img[data-v-d0c5ec54]{height:50px;width:50px;filter:var(--background-invert-if-dark)}.app img[data-v-d0c5ec54],.app .info[data-v-d0c5ec54]{padding:12px}.app .info h3[data-v-d0c5ec54],.app .info p[data-v-d0c5ec54]{text-align:start}.app .info h3[data-v-d0c5ec54]{margin-top:0}.app .checkbox-radio-switch[data-v-d0c5ec54]{margin-inline-start:auto;padding:0 2px}","",{version:3,sources:["webpack://./core/src/components/setup/RecommendedApps.vue"],names:[],mappings:"AACA,6BACC,YAAA,CACA,mBAAA,CACA,cAAA,CAIA,4DAEC,YAAA,CAGD,8BACC,eAAA,CAIF,8BACC,iBAAA,CAGD,sBACC,YAAA,CACA,kBAAA,CAEA,0BACC,WAAA,CACA,UAAA,CACA,uCAAA,CAGD,sDACC,YAAA,CAIA,6DACC,gBAAA,CAGD,+BACC,YAAA,CAIF,6CACC,wBAAA,CACA,aAAA",sourcesContent:["\n.dialog-row {\n\tdisplay: flex;\n\tjustify-content: end;\n\tmargin-top: 8px;\n}\n\np {\n\t&.loading,\n\t&.loading-error {\n\t\theight: 100px;\n\t}\n\n\t&:last-child {\n\t\tmargin-top: 10px;\n\t}\n}\n\n.text-center {\n\ttext-align: center;\n}\n\n.app {\n\tdisplay: flex;\n\tflex-direction: row;\n\n\timg {\n\t\theight: 50px;\n\t\twidth: 50px;\n\t\tfilter: var(--background-invert-if-dark);\n\t}\n\n\timg, .info {\n\t\tpadding: 12px;\n\t}\n\n\t.info {\n\t\th3, p {\n\t\t\ttext-align: start;\n\t\t}\n\n\t\th3 {\n\t\t\tmargin-top: 0;\n\t\t}\n\t}\n\n\t.checkbox-radio-switch {\n\t\tmargin-inline-start: auto;\n\t\tpadding: 0 2px;\n\t}\n}\n"],sourceRoot:""}]);const s=r}},i={};function o(e){var t=i[e];if(void 0!==t)return t.exports;var n=i[e]={id:e,loaded:!1,exports:{}};return a[e].call(n.exports,n,n.exports,o),n.loaded=!0,n.exports}o.m=a,e=[],o.O=(t,n,a,i)=>{if(!n){var r=1/0;for(p=0;p<e.length;p++){for(var[n,a,i]=e[p],s=!0,c=0;c<n.length;c++)(!1&i||r>=i)&&Object.keys(o.O).every((e=>o.O[e](n[c])))?n.splice(c--,1):(s=!1,i<r&&(r=i));if(s){e.splice(p--,1);var d=a();void 0!==d&&(t=d)}}return t}i=i||0;for(var p=e.length;p>0&&e[p-1][2]>i;p--)e[p]=e[p-1];e[p]=[n,a,i]},o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((t,n)=>(o.f[n](e,t),t)),[])),o.u=e=>e+"-"+e+".js?v="+{256:"8da30012aeb0f023e7bd",3731:"03a157235c000f83910a",6329:"da6ad198a7ca85dde977",7471:"c2afd3e83467ce503d3e"}[e],o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),t={},n="nextcloud:",o.l=(e,a,i,r)=>{if(t[e])t[e].push(a);else{var s,c;if(void 0!==i)for(var d=document.getElementsByTagName("script"),p=0;p<d.length;p++){var l=d[p];if(l.getAttribute("src")==e||l.getAttribute("data-webpack")==n+i){s=l;break}}s||(c=!0,(s=document.createElement("script")).charset="utf-8",o.nc&&s.setAttribute("nonce",o.nc),s.setAttribute("data-webpack",n+i),s.src=e),t[e]=[a];var u=(n,a)=>{s.onerror=s.onload=null,clearTimeout(A);var i=t[e];if(delete t[e],s.parentNode&&s.parentNode.removeChild(s),i&&i.forEach((e=>e(a))),n)return n(a)},A=setTimeout(u.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=u.bind(null,s.onerror),s.onload=u.bind(null,s.onload),c&&document.head.appendChild(s)}},o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),o.j=2696,(()=>{var e;globalThis.importScripts&&(e=globalThis.location+"");var t=globalThis.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var a=n.length-1;a>-1&&(!e||!/^http(s?):/.test(e));)e=n[a--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=e})(),(()=>{o.b="undefined"!=typeof document&&document.baseURI||self.location.href;var e={2696:0};o.f.j=(t,n)=>{var a=o.o(e,t)?e[t]:void 0;if(0!==a)if(a)n.push(a[2]);else{var i=new Promise(((n,i)=>a=e[t]=[n,i]));n.push(a[2]=i);var r=o.p+o.u(t),s=new Error;o.l(r,(n=>{if(o.o(e,t)&&(0!==(a=e[t])&&(e[t]=void 0),a)){var i=n&&("load"===n.type?"missing":n.type),r=n&&n.target&&n.target.src;s.message="Loading chunk "+t+" failed.\n("+i+": "+r+")",s.name="ChunkLoadError",s.type=i,s.request=r,a[1](s)}}),"chunk-"+t,t)}},o.O.j=t=>0===e[t];var t=(t,n)=>{var a,i,[r,s,c]=n,d=0;if(r.some((t=>0!==e[t]))){for(a in s)o.o(s,a)&&(o.m[a]=s[a]);if(c)var p=c(o)}for(t&&t(n);d<r.length;d++)i=r[d],o.o(e,i)&&e[i]&&e[i][0](),e[i]=0;return o.O(p)},n=globalThis.webpackChunknextcloud=globalThis.webpackChunknextcloud||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})(),o.nc=void 0;var r=o.O(void 0,[4208],(()=>o(44549)));r=o.O(r)})();
|
||
//# sourceMappingURL=core-recommendedapps.js.map?v=0b30801384df6d5919c7
|