settings-vue-settings-admin-delegation.mjs.map 5.2 KB

1
  1. {"version":3,"file":"settings-vue-settings-admin-delegation.mjs","sources":["../apps/settings/src/components/AdminDelegation/GroupSelect.vue","../apps/settings/src/components/AdminDelegating.vue","../apps/settings/src/main-admin-delegation.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n<template>\n\t<NcSelect v-model=\"selected\"\n\t\t:input-id=\"setting.id\"\n\t\tclass=\"group-select\"\n\t\t:placeholder=\"t('settings', 'None')\"\n\t\tlabel=\"displayName\"\n\t\t:options=\"availableGroups\"\n\t\t:multiple=\"true\"\n\t\t:close-on-select=\"false\" />\n</template>\n\n<script>\nimport NcSelect from '@nextcloud/vue/dist/Components/NcSelect.js'\nimport { generateUrl } from '@nextcloud/router'\nimport axios from '@nextcloud/axios'\nimport { showError } from '@nextcloud/dialogs'\nimport logger from '../../logger.ts'\n\nexport default {\n\tname: 'GroupSelect',\n\tcomponents: {\n\t\tNcSelect,\n\t},\n\tprops: {\n\t\tavailableGroups: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\t\tsetting: {\n\t\t\ttype: Object,\n\t\t\trequired: true,\n\t\t},\n\t\tauthorizedGroups: {\n\t\t\ttype: Array,\n\t\t\trequired: true,\n\t\t},\n\t},\n\tdata() {\n\t\treturn {\n\t\t\tselected: this.authorizedGroups\n\t\t\t\t.filter((group) => group.class === this.setting.class)\n\t\t\t\t.map((groupToMap) => this.availableGroups.find((group) => group.gid === groupToMap.group_id))\n\t\t\t\t.filter((group) => group !== undefined),\n\t\t}\n\t},\n\twatch: {\n\t\tselected() {\n\t\t\tthis.saveGroups()\n\t\t},\n\t},\n\tmethods: {\n\t\tasync saveGroups() {\n\t\t\tconst data = {\n\t\t\t\tnewGroups: this.selected,\n\t\t\t\tclass: this.setting.class,\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tawait axios.post(generateUrl('/apps/settings/') + '/settings/authorizedgroups/saveSettings', data)\n\t\t\t} catch (e) {\n\t\t\t\tshowError(t('settings', 'Unable to modify setting'))\n\t\t\t\tlogger.error('Unable to modify setting', e)\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\">\n.group-select {\n\twidth: 100%;\n}\n</style>\n","<!--\n - SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n<template>\n\t<NcSettingsSection :name=\"t('settings', 'Administration privileges')\"\n\t\t:description=\"t('settings', 'Here you can decide which group can access certain sections of the administration settings.')\"\n\t\t:doc-url=\"authorizedSettingsDocLink\">\n\t\t<div class=\"setting-list\">\n\t\t\t<div v-for=\"setting in availableSettings\" :key=\"setting.class\">\n\t\t\t\t<label :for=\"setting.id\">{{ setting.sectionName }}</label>\n\t\t\t\t<GroupSelect :available-groups=\"availableGroups\" :authorized-groups=\"authorizedGroups\" :setting=\"setting\" />\n\t\t\t</div>\n\t\t</div>\n\t</NcSettingsSection>\n</template>\n\n<script>\nimport GroupSelect from './AdminDelegation/GroupSelect.vue'\nimport NcSettingsSection from '@nextcloud/vue/dist/Components/NcSettingsSection.js'\nimport { loadState } from '@nextcloud/initial-state'\n\nexport default {\n\tname: 'AdminDelegating',\n\tcomponents: {\n\t\tGroupSelect,\n\t\tNcSettingsSection,\n\t},\n\tdata() {\n\t\treturn {\n\t\t\tavailableSettings: loadState('settings', 'available-settings'),\n\t\t\tavailableGroups: loadState('settings', 'available-groups'),\n\t\t\tauthorizedGroups: loadState('settings', 'authorized-groups'),\n\t\t\tauthorizedSettingsDocLink: loadState('settings', 'authorized-settings-doc-link'),\n\t\t}\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\nlabel {\n\tdisplay: block;\n\tfont-size: 16px;\n\tmargin: 12px 0;\n\tcolor: var(--color-text-light);\n}\n</style>\n","/**\n * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport Vue from 'vue'\nimport App from './components/AdminDelegating.vue'\n\n// bind to window\nVue.prototype.OC = OC\nVue.prototype.t = t\n\nconst View = Vue.extend(App)\nconst accessibility = new View()\naccessibility.$mount('#admin-right-sub-granting')\n"],"names":["_sfc_main","NcSelect","group","groupToMap","data","axios","generateUrl","e","showError","logger","GroupSelect","NcSettingsSection","loadState","Vue","View","App","accessibility"],"mappings":";8TAsBA,MAAAA,EAAA,CACA,KAAA,cACA,WAAA,CACA,SAAAC,CACA,EACA,MAAA,CACA,gBAAA,CACA,KAAA,MACA,QAAA,IAAA,CAAA,CACA,EACA,QAAA,CACA,KAAA,OACA,SAAA,EACA,EACA,iBAAA,CACA,KAAA,MACA,SAAA,EACA,CACA,EACA,MAAA,CACA,MAAA,CACA,SAAA,KAAA,iBACA,OAAAC,GAAAA,EAAA,QAAA,KAAA,QAAA,KAAA,EACA,IAAAC,GAAA,KAAA,gBAAA,KAAAD,GAAAA,EAAA,MAAAC,EAAA,QAAA,CAAA,EACA,OAAAD,GAAAA,IAAA,MAAA,CACA,CACA,EACA,MAAA,CACA,UAAA,CACA,KAAA,WAAA,CACA,CACA,EACA,QAAA,CACA,MAAA,YAAA,CACA,MAAAE,EAAA,CACA,UAAA,KAAA,SACA,MAAA,KAAA,QAAA,KACA,EACA,GAAA,CACA,MAAAC,EAAA,KAAAC,EAAA,iBAAA,EAAA,0CAAAF,CAAA,CACA,OAAAG,EAAA,CACAC,EAAA,EAAA,WAAA,0BAAA,CAAA,EACAC,EAAA,MAAA,2BAAAF,CAAA,CACA,CACA,CACA,CACA,iXC9CAP,EAAA,CACA,KAAA,kBACA,WAAA,CACA,YAAAU,EACA,kBAAAC,CACA,EACA,MAAA,CACA,MAAA,CACA,kBAAAC,EAAA,WAAA,oBAAA,EACA,gBAAAA,EAAA,WAAA,kBAAA,EACA,iBAAAA,EAAA,WAAA,mBAAA,EACA,0BAAAA,EAAA,WAAA,8BAAA,CACA,CACA,CACA,wnBC3BAC,EAAI,UAAU,GAAK,GACnBA,EAAI,UAAU,EAAI,EAElB,MAAMC,EAAOD,EAAI,OAAOE,CAAG,EACrBC,EAAgB,IAAIF,EAC1BE,EAAc,OAAO,2BAA2B"}