core-recommendedapps.js 8.4 KB

123
  1. /*! For license information please see core-recommendedapps.js.LICENSE.txt */
  2. !function(){"use strict";var n,t={64810:function(n,t,e){var o,a=e(22200),i=e(9944),r=e(20144),c=e(17499),s=null===(o=(0,a.getCurrentUser)())?(0,c.getLoggerBuilder)().setApp("core").build():(0,c.getLoggerBuilder)().setApp("core").setUid(o.uid).build(),p=e(4820),l=e(79753),d=e(16453),u=e(72260),f={calendar:{description:(0,i.translate)("core","Schedule work & meetings, synced with all your devices."),icon:(0,l.imagePath)("core","places/calendar.svg")},contacts:{description:(0,i.translate)("core","Keep your colleagues and friends in one place without leaking their private info."),icon:(0,l.imagePath)("core","places/contacts.svg")},mail:{description:(0,i.translate)("core","Simple email app nicely integrated with Files, Contacts and Calendar."),icon:(0,l.imagePath)("core","actions/mail.svg")},spreed:{description:(0,i.translate)("core","Chatting, video calls, screensharing, online meetings and web conferencing – in your browser and with mobile apps."),icon:(0,l.imagePath)("core","apps/spreed.svg")},richdocuments:{description:(0,i.translate)("core","Collaboratively edit office documents."),icon:(0,l.imagePath)("core","apps/richdocuments.svg")},richdocumentscode:{description:(0,i.translate)("core","Local document editing back-end used by the Collabora Online app."),icon:(0,l.imagePath)("core","apps/richdocumentscode.svg")}},g=Object.keys(f),m=(0,d.loadState)("core","defaultPageUrl"),h={name:"RecommendedApps",data:function(){return{loadingApps:!0,loadingAppsError:!1,apps:[],defaultPageUrl:m}},computed:{recommendedApps:function(){return this.apps.filter((function(n){return g.includes(n.id)}))}},mounted:function(){var n=this;return p.default.get((0,l.generateUrl)("settings/apps/list")).then((function(n){return n.data})).then((function(t){s.info("".concat(t.apps.length," apps fetched")),n.apps=t.apps.map((function(n){return Object.assign(n,{loading:!1,installationError:!1})})),s.debug("".concat(n.recommendedApps.length," recommended apps found"),{apps:n.recommendedApps}),n.installApps()})).catch((function(t){s.error("could not fetch app list",{error:t}),n.loadingAppsError=!0})).then((function(){n.loadingApps=!1}))},methods:{installApps:function(){var n=(0,u.Z)(1),t=this.recommendedApps.filter((function(n){return!n.active&&n.isCompatible&&n.canInstall})).map((function(t){return n((function(){return s.info("installing ".concat(t.id)),t.loading=!0,p.default.post((0,l.generateUrl)("settings/apps/enable"),{appIds:[t.id],groups:[]}).catch((function(n){s.error("could not install ".concat(t.id),{error:n}),t.installationError=!0})).then((function(){s.info("installed ".concat(t.id)),t.loading=!1}))}))}));s.debug("installing ".concat(t.length," recommended apps")),Promise.all(t).then((function(){s.info("all recommended apps installed, redirecting …"),window.location=m})).catch((function(n){return s.error("could not install recommended apps",{error:n})}))},customIcon:function(n){return n in f&&f[n].icon?f[n].icon:(s.warn("no app icon for recommended app ".concat(n)),(0,l.imagePath)("core","places/default-app-icon.svg"))},customDescription:function(n){return n in f?f[n].description:(s.warn("no app description for recommended app ".concat(n)),"")}}},A=e(93379),v=e.n(A),C=e(22487),b=(v()(C.Z,{insert:"head",singleton:!1}),C.Z.locals,(0,e(51900).Z)(h,(function(){var n=this,t=n.$createElement,e=n._self._c||t;return e("div",{staticClass:"body-login-container"},[e("h2",[n._v(n._s(n.t("core","Recommended apps")))]),n._v(" "),n.loadingApps?e("p",{staticClass:"loading text-center"},[n._v("\n\t\t"+n._s(n.t("core","Loading apps …"))+"\n\t")]):n.loadingAppsError?e("p",{staticClass:"loading-error text-center"},[n._v("\n\t\t"+n._s(n.t("core","Could not fetch list of apps from the App Store."))+"\n\t")]):e("p",{staticClass:"text-center"},[n._v("\n\t\t"+n._s(n.t("core","Installing apps …"))+"\n\t")]),n._v(" "),n._l(n.recommendedApps,(function(t){return e("div",{key:t.id,staticClass:"app"},[e("img",{attrs:{src:n.customIcon(t.id),alt:""}}),n._v(" "),e("div",{staticClass:"info"},[e("h3",[n._v("\n\t\t\t\t"+n._s(t.name)+"\n\t\t\t\t"),t.loading?e("span",{staticClass:"icon icon-loading-small-dark"}):t.active?e("span",{staticClass:"icon icon-checkmark-white"}):n._e()]),n._v(" "),e("p",{domProps:{innerHTML:n._s(n.customDescription(t.id))}}),n._v(" "),t.installationError?e("p",[e("strong",[n._v(n._s(n.t("core","App download or installation failed")))])]):t.isCompatible?t.canInstall?n._e():e("p",[e("strong",[n._v(n._s(n.t("core","Cannot install this app")))])]):e("p",[e("strong",[n._v(n._s(n.t("core","Cannot install this app because it is not compatible")))])])])])})),n._v(" "),e("p",{staticClass:"text-center"},[e("a",{attrs:{href:n.defaultPageUrl}},[n._v(n._s(n.t("core","Cancel")))])])],2)}),[],!1,null,"19d2676a",null).exports);e.nc=btoa((0,a.getRequestToken)()),r.default.mixin({methods:{t:i.translate}}),(new(r.default.extend(b))).$mount("#recommended-apps"),s.debug("recommended apps view rendered")},22487:function(n,t,e){var o=e(94015),a=e.n(o),i=e(23645),r=e.n(i)()(a());r.push([n.id,"p.loading[data-v-19d2676a],p.loading-error[data-v-19d2676a]{height:100px}.text-center[data-v-19d2676a]{text-align:center}.app[data-v-19d2676a]{display:flex;flex-direction:row}.app img[data-v-19d2676a]{height:50px;width:50px;filter:invert(1)}.app img[data-v-19d2676a],.app .info[data-v-19d2676a]{padding:12px}.app .info h3[data-v-19d2676a],.app .info p[data-v-19d2676a]{text-align:left}.app .info h3[data-v-19d2676a]{color:#fff;margin-top:0}.app .info h3>span.icon[data-v-19d2676a]{display:inline-block}","",{version:3,sources:["webpack://./core/src/components/setup/RecommendedApps.vue"],names:[],mappings:"AAsLA,4DACC,YAAA,CAGD,8BACC,iBAAA,CAGD,sBACC,YAAA,CACA,kBAAA,CAEA,0BACC,WAAA,CACA,UAAA,CACA,gBAAA,CAGD,sDACC,YAAA,CAIA,6DACC,eAAA,CAGD,+BACC,UAAA,CACA,YAAA,CAGD,yCACC,oBAAA",sourcesContent:["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n.body-login-container {\n\n}\n\np.loading, p.loading-error {\n\theight: 100px;\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: invert(1);\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: left;\n\t\t}\n\n\t\th3 {\n\t\t\tcolor: #fff;\n\t\t\tmargin-top: 0;\n\t\t}\n\n\t\th3 > span.icon {\n\t\t\tdisplay: inline-block;\n\t\t}\n\t}\n}\n"],sourceRoot:""}]),t.Z=r}},e={};function o(n){var a=e[n];if(void 0!==a)return a.exports;var i=e[n]={id:n,loaded:!1,exports:{}};return t[n].call(i.exports,i,i.exports,o),i.loaded=!0,i.exports}o.m=t,o.amdD=function(){throw new Error("define cannot be used indirect")},o.amdO={},n=[],o.O=function(t,e,a,i){if(!e){var r=1/0;for(l=0;l<n.length;l++){e=n[l][0],a=n[l][1],i=n[l][2];for(var c=!0,s=0;s<e.length;s++)(!1&i||r>=i)&&Object.keys(o.O).every((function(n){return o.O[n](e[s])}))?e.splice(s--,1):(c=!1,i<r&&(r=i));if(c){n.splice(l--,1);var p=a();void 0!==p&&(t=p)}}return t}i=i||0;for(var l=n.length;l>0&&n[l-1][2]>i;l--)n[l]=n[l-1];n[l]=[e,a,i]},o.n=function(n){var t=n&&n.__esModule?function(){return n.default}:function(){return n};return o.d(t,{a:t}),t},o.d=function(n,t){for(var e in t)o.o(t,e)&&!o.o(n,e)&&Object.defineProperty(n,e,{enumerable:!0,get:t[e]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(n){if("object"==typeof window)return window}}(),o.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},o.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},o.nmd=function(n){return n.paths=[],n.children||(n.children=[]),n},o.j=33,function(){var n={33:0};o.O.j=function(t){return 0===n[t]};var t=function(t,e){var a,i,r=e[0],c=e[1],s=e[2],p=0;for(a in c)o.o(c,a)&&(o.m[a]=c[a]);if(s)var l=s(o);for(t&&t(e);p<r.length;p++)i=r[p],o.o(n,i)&&n[i]&&n[i][0](),n[r[p]]=0;return o.O(l)},e=self.webpackChunknextcloud=self.webpackChunknextcloud||[];e.forEach(t.bind(null,0)),e.push=t.bind(null,e.push.bind(e))}();var a=o.O(void 0,[874],(function(){return o(64810)}));a=o.O(a)}();
  3. //# sourceMappingURL=core-recommendedapps.js.map?v=b9c6591838c91af9560b