1 line
12 KiB
Plaintext
1 line
12 KiB
Plaintext
{"version":3,"file":"TaskCreateDialog-oz4N92Ds.chunk.mjs","sources":["../node_modules/vue-material-design-icons/ViewHeadline.vue","../src/components/TaskCreateDialog.vue"],"sourcesContent":["<template>\n <span v-bind=\"$attrs\"\n :aria-hidden=\"title ? null : 'true'\"\n :aria-label=\"title\"\n class=\"material-design-icon view-headline-icon\"\n role=\"img\"\n @click=\"$emit('click', $event)\">\n <svg :fill=\"fillColor\"\n class=\"material-design-icon__svg\"\n :width=\"size\"\n :height=\"size\"\n viewBox=\"0 0 24 24\">\n <path d=\"M4,5V7H21V5M4,11H21V9H4M4,19H21V17H4M4,15H21V13H4V15Z\">\n <title v-if=\"title\">{{ title }}</title>\n </path>\n </svg>\n </span>\n</template>\n\n<script>\nexport default {\n name: \"ViewHeadlineIcon\",\n emits: ['click'],\n props: {\n title: {\n type: String,\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n}\n</script>","<!--\nNextcloud - Tasks\n\n@author Julius Härtl\n@copyright 2021 Julius Härtl <jus@bitgrid.net>\n\n@author Jakob Röhrl\n@copyright 2021 Jakob Röhrl <jakob.roehrl@web.de>\n\n@author Raimund Schlüßler\n@copyright 2021 Raimund Schlüßler <raimund.schluessler@mailbox.org>\n\nThis library is free software; you can redistribute it and/or\nmodify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE\nLicense as published by the Free Software Foundation; either\nversion 3 of the License, or any later version.\n\nThis library is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU AFFERO GENERAL PUBLIC LICENSE for more details.\n\nYou should have received a copy of the GNU Affero General Public\nLicense along with this library. If not, see <http://www.gnu.org/licenses/>.\n\n-->\n\n<template>\n\t<NcModal class=\"task-selector\" size=\"small\" @close=\"close\">\n\t\t<div v-if=\"!creating && !created\" id=\"modal-inner\">\n\t\t\t<div v-if=\"loading\" class=\"loading-overlay\">\n\t\t\t\t<NcLoadingIcon :size=\"40\" />\n\t\t\t</div>\n\t\t\t<h3>{{ t('tasks', 'Create a new task') }}</h3>\n\n\t\t\t<CalendarPickerItem :disabled=\"loading\"\n\t\t\t\t:calendar=\"pendingCalendar\"\n\t\t\t\t:calendars=\"writableCalendars\"\n\t\t\t\t@change-calendar=\"changeCalendar\" />\n\n\t\t\t<div class=\"property property__summary\">\n\t\t\t\t<ViewHeadline :size=\"20\" />\n\t\t\t\t<input v-model=\"pendingSummary\"\n\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t:placeholder=\"t('tasks', 'Task summary')\"\n\t\t\t\t\t:disabled=\"loading\">\n\t\t\t</div>\n\n\t\t\t<div class=\"property property__notes\">\n\t\t\t\t<TextBoxOutline :size=\"20\" />\n\t\t\t\t<textarea v-model=\"pendingDescription\"\n\t\t\t\t\t:disabled=\"loading\" />\n\t\t\t</div>\n\t\t\t<div class=\"modal-buttons\">\n\t\t\t\t<NcButton @click=\"close\">\n\t\t\t\t\t{{ t('tasks', 'Cancel') }}\n\t\t\t\t</NcButton>\n\t\t\t\t<NcButton :disabled=\"loading\"\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t@click=\"addTask\">\n\t\t\t\t\t{{ t('tasks', 'Create task') }}\n\t\t\t\t</NcButton>\n\t\t\t</div>\n\t\t</div>\n\t\t<div v-else id=\"modal-inner\">\n\t\t\t<NcEmptyContent v-if=\"creating\" key=\"creating\" :description=\"t('tasks', 'Creating the new task…')\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<NcLoadingIcon />\n\t\t\t\t</template>\n\t\t\t</NcEmptyContent>\n\t\t\t<NcEmptyContent v-else-if=\"created\" key=\"created\" :description=\"createdMessage\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<Check />\n\t\t\t\t</template>\n\t\t\t\t<template #action>\n\t\t\t\t\t<NcButton @click=\"close\">\n\t\t\t\t\t\t{{ t('tasks', 'Close') }}\n\t\t\t\t\t</NcButton>\n\t\t\t\t\t<NcButton type=\"primary\" @click=\"openNewTask\">\n\t\t\t\t\t\t{{ t('tasks', 'Open task') }}\n\t\t\t\t\t</NcButton>\n\t\t\t\t</template>\n\t\t\t</NcEmptyContent>\n\t\t</div>\n\t</NcModal>\n</template>\n\n<script>\n\nimport CalendarPickerItem from './AppSidebar/CalendarPickerItem.vue'\nimport client from '../services/cdav.js'\n\nimport { translate as t } from '@nextcloud/l10n'\nimport { generateUrl } from '@nextcloud/router'\nimport NcButton from '@nextcloud/vue/components/NcButton'\nimport NcEmptyContent from '@nextcloud/vue/components/NcEmptyContent'\nimport NcLoadingIcon from '@nextcloud/vue/components/NcLoadingIcon'\nimport NcModal from '@nextcloud/vue/components/NcModal'\n\nimport Check from 'vue-material-design-icons/Check.vue'\nimport TextBoxOutline from 'vue-material-design-icons/TextBoxOutline.vue'\nimport ViewHeadline from 'vue-material-design-icons/ViewHeadline.vue'\n\nimport { mapGetters, mapActions } from 'vuex'\n\nexport default {\n\tname: 'TaskCreateDialog',\n\tcomponents: {\n\t\tCalendarPickerItem,\n\t\tCheck,\n\t\tNcButton,\n\t\tNcEmptyContent,\n\t\tNcLoadingIcon,\n\t\tNcModal,\n\t\tTextBoxOutline,\n\t\tViewHeadline,\n\t},\n\tprops: {\n\t\tsummary: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t\tdescription: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t},\n\temits: ['close'],\n\tdata() {\n\t\treturn {\n\t\t\tpendingSummary: '',\n\t\t\tpendingDescription: '',\n\t\t\tpendingCalendar: null,\n\t\t\tloading: true,\n\t\t\tcreating: false,\n\t\t\tcreated: false,\n\t\t\tnewTask: null,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t...mapGetters({\n\t\t\twritableCalendars: 'getSortedWritableCalendars',\n\t\t\tdefaultCalendar: 'getDefaultCalendar',\n\t\t}),\n\t\tcreatedMessage() {\n\t\t\treturn t('tasks', '\"{task}\" was added to \"{calendar}\"', { task: this.pendingSummary, calendar: this.pendingCalendar.displayName }, undefined, { sanitize: false, escape: false })\n\t\t},\n\t},\n\n\tbeforeMount() {\n\t\tthis.fetchCalendars()\n\t},\n\n\tmounted() {\n\t\tthis.pendingSummary = this.summary\n\t\tthis.pendingDescription = this.description\n\t},\n\n\tmethods: {\n\t\t...mapActions([\n\t\t\t'createTask',\n\t\t]),\n\n\t\tt,\n\n\t\tchangeCalendar(calendar) {\n\t\t\tthis.pendingCalendar = calendar\n\t\t},\n\n\t\tclose() {\n\t\t\tthis.$emit('close')\n\t\t\tthis.$root.$emit('close')\n\t\t},\n\n\t\tasync fetchCalendars() {\n\t\t\tthis.loading = true\n\t\t\tawait client.connect({ enableCalDAV: true })\n\t\t\tawait this.$store.dispatch('fetchCurrentUserPrincipal')\n\t\t\tawait this.$store.dispatch('getCalendarsAndTrashBin')\n\t\t\t// TODO: Would be good to select the default calendar instead of the first one\n\t\t\tthis.pendingCalendar = this.writableCalendars[0]\n\t\t\tthis.loading = false\n\t\t},\n\n\t\tasync addTask() {\n\t\t\tthis.creating = true\n\t\t\tconst task = {\n\t\t\t\tsummary: this.pendingSummary,\n\t\t\t\tnote: this.pendingDescription,\n\t\t\t\tcalendar: this.pendingCalendar,\n\t\t\t}\n\t\t\tthis.newTask = await this.createTask(task)\n\t\t\tthis.creating = false\n\t\t\tthis.created = true\n\t\t},\n\t\topenNewTask() {\n\t\t\twindow.location = generateUrl('apps/tasks') + `/#/calendars/${this.pendingCalendar.id}/tasks/${this.newTask.uri}`\n\t\t},\n\t},\n\n}\n</script>\n\n<style lang=\"scss\" scoped>\n\n\t#modal-inner {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tpadding: 20px;\n\n\t\t.loading-overlay {\n\t\t\tposition: absolute;\n\t\t\ttop: calc(50% - 20px);\n\t\t\tleft: calc(50% - 20px);\n\t\t\tz-index: 1000;\n\t\t}\n\n\t\t.empty-content {\n\t\t\tmargin: 10vh 0;\n\n\t\t\t:deep(.empty-content__action) {\n\t\t\t\tdisplay: flex;\n\t\t\t}\n\t\t}\n\t}\n\n\t.property__item {\n\t\tborder-bottom: none;\n\t\tmargin-bottom: 3px;\n\n\t\t:deep(.multiselect .multiselect__tags) {\n\t\t\tborder: 2px solid var(--color-border-dark);\n\t\t}\n\t}\n\n\t.property {\n\t\tposition: relative;\n\n\t\t.material-design-icon {\n\t\t\tposition: absolute;\n\t\t\ttop: 14px;\n\t\t\tleft: 14px;\n\t\t}\n\n\t\tinput,\n\t\ttextarea {\n\t\t\twidth: 100%;\n\t\t\tpadding-left: 44px !important;\n\t\t}\n\n\t\tinput {\n\t\t\theight: 44px !important;\n\t\t\tmargin: 0;\n\t\t}\n\n\t\ttextarea {\n\t\t\tmin-width: 100%;\n\t\t\tmax-width: 100%;\n\t\t\tmin-height: 100px;\n\t\t}\n\t}\n\n.modal-buttons {\n\tdisplay: flex;\n\tjustify-content: flex-end;\n}\n\n\t:deep(.calendar-picker-option__label),\n\t:deep(.property__item .multiselect__tags) input.multiselect__input {\n\t\tfont-weight: normal;\n\t}\n</style>\n"],"names":["_sfc_main","_hoisted_3","_createElementBlock","_mergeProps","_ctx","$props","_cache","$event","_createElementVNode","_openBlock","CalendarPickerItem","Check","NcButton","NcEmptyContent","NcLoadingIcon","NcModal","TextBoxOutline","ViewHeadline","mapGetters","t","mapActions","calendar","client","task","generateUrl","_hoisted_5","_hoisted_7","_createBlock","_component_NcModal","$options","$data","_hoisted_1","_hoisted_2","_createVNode","_component_NcLoadingIcon","_component_CalendarPickerItem","_component_ViewHeadline","_component_TextBoxOutline","_component_NcButton","_hoisted_8","_component_NcEmptyContent","_component_Check"],"mappings":"8NAoBA,MAAKA,EAAU,CACb,KAAM,mBACN,MAAO,CAAC,OAAO,EACf,MAAO,CACL,MAAO,CACL,KAAM,QAER,UAAW,CACT,KAAM,OACN,QAAS,gBAEX,KAAM,CACJ,KAAM,OACN,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