{"version":3,"sources":["webpack:///./src/views/CustomFields.vue?923f","webpack:///./src/views/CustomFields.vue","webpack:///./src/views/CustomFields.vue?fe13","webpack:///./src/views/CustomFields.vue?7704"],"names":["render","_vm","this","_h","$createElement","_c","_self","ref","attrs","toolbar","scopedSlots","_u","key","fn","staticClass","on","goToExtensionCreate","proxy","selectedExtension","name","extOptionsActionsMenu","type","toProperCase","data","join","_e","$options","filters","chatDate","created_at","customFieldsExtensionOptions","extensionsPlaceholder","extOptionsTile","staticRenderFns","Vue","extend","mixins","extensionsMixin","content","img","button","color","text","callback","window","open","process","$store","getters","isApp","mounted","title","left","icon","back","tooltip","permission","right","beforeDestroy","id","$route","query","dispatch","computed","get","customFieldsSelectedExtensionOption","set","val","commit","methods","extensionDelete","dialog_result","extension","extensionDeleteConfirm","admin","result","extensionUpdate","payload","extensionPrep","ext","message","extOptionsActions","menu","action","IListActionType","actions","goToExtensionEdit","extOptionsDescription","toString","extOptionsIcon","listIcon","IListIconType","actionContent","leftIcon","line1","line2","onExtensionOptionSelected","form","model","inputs","extensionOptionInputs","component","props","closeable","$refs","customFieldsPanel","step","isNew","Object","assign","$router","push","watch","to","from","needsLoad","VRow"],"mappings":"sHAAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAQF,EAAW,QAAEI,EAAG,gBAAgB,CAACE,IAAI,oBAAoBC,MAAM,CAAC,QAAUP,EAAIQ,SAASC,YAAYT,EAAIU,GAAG,CAAC,CAACC,IAAI,WAAWC,GAAG,WAAW,MAAO,CAACR,EAAG,QAAQ,CAACS,YAAY,OAAON,MAAM,CAAC,aAAa,GAAG,MAAQ,SAAS,QAAU,QAAQ,CAACH,EAAG,mBAAmB,CAACG,MAAM,CAAC,MAAQ,GAAG,KAAO,6BAA6B,KAAO,oBAAoBO,GAAG,CAAC,MAAQd,EAAIe,wBAAwB,KAAKC,OAAM,GAAOhB,EAAqB,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a,EAAUb,GAGrBzD,KAAK4G,QAAQC,KAAK,CAAElD,aAG5BmD,MAAO,CACHpD,OADG,SACIqD,EAAIC,GAEP,IAAKD,EAAGpD,MAAMF,GAAI,OAAQzD,KAAKgB,kBAAoB,KAGnD,IAAMyC,EAAKsD,EAAGpD,MAAMF,GAGdwD,GAAajH,KAAKgB,mBAAqByC,GAAMzD,KAAKgB,kBAAkByC,GAGrEwD,GAGLjH,KAAK6C,OAAOe,SAAS,yCAA0CH,OCpQ4T,I,6CCOnY0C,EAAY,eACd,EACArG,EACAiC,GACA,EACA,KACA,KACA,MAIa,aAAAoE,EAAiB,QAKhC,IAAkBA,EAAW,CAACe,OAAA","file":"js/custom-fields.cb1a95fc.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.mounted)?_c('page-template',{ref:\"customFieldsPanel\",attrs:{\"toolbar\":_vm.toolbar},scopedSlots:_vm._u([{key:\"left-top\",fn:function(){return [_c('v-row',{staticClass:\"pa-3\",attrs:{\"no-gutters\":\"\",\"align\":\"center\",\"justify\":\"end\"}},[_c('tri-panel-button',{attrs:{\"small\":\"\",\"icon\":\"mdi-format-annotation-plus\",\"text\":\"Add Custom Field\"},on:{\"click\":_vm.goToExtensionCreate}})],1)]},proxy:true},(_vm.selectedExtension)?{key:\"content\",fn:function(){return [_c('i-toolbar',{attrs:{\"title\":_vm.selectedExtension.name,\"right\":_vm.extOptionsActionsMenu(_vm.selectedExtension, false)}}),_c('div',{staticClass:\"pa-3\"},[_c('person-show-item',{attrs:{\"display\":\"Field Name\",\"value\":_vm.selectedExtension.name}}),_c('person-show-item',{attrs:{\"display\":\"Type\",\"value\":_vm.selectedExtension.type.toProperCase()}}),(_vm.selectedExtension.type === 'dropdown')?_c('person-show-item',{attrs:{\"display\":\"Options\",\"value\":_vm.selectedExtension.data.join(', ')}}):_vm._e(),_c('person-show-item',{attrs:{\"display\":\"Created\",\"value\":_vm.$options.filters.chatDate(_vm.selectedExtension.created_at)}})],1)]},proxy:true}:null],null,true)},[_c('i-list',{ref:\"extensionsList\",attrs:{\"id\":\"customFieldsExtensionsList\",\"color\":\"primary\",\"items\":_vm.customFieldsExtensionOptions,\"placeholder\":_vm.extensionsPlaceholder,\"tile\":_vm.extOptionsTile()}})],1):_vm._e()}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\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\nimport Vue from 'vue'\nimport ExtensionOption from '@/types/ExtensionOption.interface'\nimport extensionsMixin from '@/mixins/extension-options-mixin'\nimport IListAction, { IListActionType } from '@/types/components/IListAction.interface'\nimport Button from '@/types/components/Button.interface'\nimport IListTile from '@/types/components/IListTile.interface'\nimport IListIcon, { IListIconType } from '@/types/components/IListIcon.interface'\nexport default Vue.extend({\n mixins: [extensionsMixin],\n data() {\n return {\n extensionsPlaceholder: {\n content:\n 'Not sure how to use Custom Fields? Check out our article below to learn more.',\n img: 'noCustomers',\n button: {\n color: 'primary',\n text: 'Learn Custom Fields',\n callback: () =>\n window.open(\n `${process.env.VUE_APP_URL_LEARN}/en/articles/4527055-how-to-create-and-edit-custom-fields`,\n this.$store.getters.isApp ? '_system' : '_blank'\n )\n }\n },\n // Determines if we display content\n mounted: false,\n toolbar: {\n title: 'Custom Fields',\n left: [\n {\n title: 'Back',\n icon: 'mdi-chevron-left',\n back: '/settings',\n tooltip: 'Back',\n permission: 0\n }\n ],\n right: []\n }\n }\n },\n beforeDestroy() {\n // Unset our selected extension\n this.selectedExtension = null\n },\n mounted() {\n // Check if a extension is set in the url params\n const id = this.$route.query.id\n\n // If a extension id is set, load it\n if (id) this.$store.dispatch('customFieldsSelectedExtensionOptionGet', id)\n\n // Set mounted to true to tell our component we are ready\n this.mounted = true\n },\n computed: {\n customFieldsExtensionOptions(): ExtensionOption[] {\n return this.$store.getters.customFieldsExtensionOptions\n },\n selectedExtension: {\n get(): ExtensionOption {\n return this.$store.getters.customFieldsSelectedExtensionOption\n },\n set(val: ExtensionOption): void {\n this.$store.commit('customFieldsSelectedExtensionOptionSet', val)\n }\n }\n },\n methods: {\n extensionDelete(dialog_result: boolean, extension: ExtensionOption): void {\n // If the user answer NO to dialog, do nothing\n if (!dialog_result) return\n\n // Else, send the request to the API\n this.$store.dispatch('extensionOptionsDelete', extension.id)\n },\n extensionDeleteConfirm(extension: ExtensionOption): void {\n // Pop a confirm dialog\n this.$store.dispatch('dialogOpen', {\n type: 'CONFIRM',\n title: 'Delete this custom field?',\n text: `Are you sure you want to delete this custom field? You will lose all data associated with the custom field.
THIS CANNOT BE UNDONE!`,\n icon: 'mdi-alert',\n color: 'red darken-2',\n admin: true,\n callback: (result: boolean) => this.extensionDelete(result, extension)\n })\n },\n async extensionUpdate(extension: ExtensionOption): Promise {\n // Prepare the extension data\n const payload = this.extensionPrep(extension)\n\n // Update the extension then close the dialog\n const ext = await this.$store.dispatch('extensionOptionsPut', payload)\n\n // If the request failed, do nothing\n if (!ext) return\n\n // Else, close the app dialog\n this.$store.dispatch('dialogClose', 'APP')\n\n // Notify the user of success\n this.$store.commit('appNotificationBarSet', {\n message: 'Custom Field Updated',\n type: 'success'\n })\n },\n extOptionsActions(extension: ExtensionOption): IListAction {\n // Get our menu buttons\n const menu = this.extOptionsActionsMenu(extension)\n\n // Create our list action\n const action: IListAction = {\n type: IListActionType.menu,\n menu: menu\n }\n\n // Return the created action\n return action\n },\n extOptionsActionsMenu(\n extension: ExtensionOption,\n actions: boolean = true\n ): Button[] {\n // Create our menu of buttons\n const menu: Button[] = [\n {\n icon: 'mdi-pencil',\n text: actions ? 'Edit Custom Field' : null,\n tooltip: 'Edit Custom Field',\n color: 'primary',\n callback: () => this.goToExtensionEdit(extension)\n },\n {\n icon: 'bi-trash-fill',\n text: actions ? 'Delete Custom Field' : null,\n tooltip: 'Delete Custom Field',\n color: 'primary',\n callback: () => this.extensionDeleteConfirm(extension)\n }\n ]\n\n // Return the buttons\n return menu\n },\n extOptionsDescription(extension: ExtensionOption): string {\n // If we are using a dropdown, then the description will include all items in it\n if (extension.type === 'dropdown' && extension.data) {\n return `Dropdown (${extension.data.toString()})`\n }\n\n // Else we can just use the type of our extension\n return extension.type.toProperCase()\n },\n extOptionsIcon(): IListIcon {\n // We always use the same icon\n const icon = 'mdi-format-annotation-plus'\n\n // Construct our list icon\n const listIcon: IListIcon = {\n type: IListIconType.icon,\n content: icon,\n color: 'primary'\n }\n\n // Return the created list icon\n return listIcon\n },\n extOptionsTile(): IListTile {\n return {\n actionContent: (ext: ExtensionOption) => this.extOptionsActions(ext),\n leftIcon: () => this.extOptionsIcon(),\n line1: (ext: ExtensionOption) => ext.name,\n line2: (ext: ExtensionOption) => this.extOptionsDescription(ext),\n callback: (ext: ExtensionOption) => this.onExtensionOptionSelected(ext)\n }\n },\n goToExtensionEdit(extension: ExtensionOption): void {\n // Create an app form object\n const form = {\n title: 'Edit Custom Field',\n icon: 'mdi-format-annotation-plus',\n model: extension,\n inputs: this.$store.getters.extensionOptionInputs(extension)\n }\n\n this.$store.dispatch('dialogOpen', {\n type: 'APP',\n title: form.title,\n icon: form.icon,\n component: 'app-form',\n props: form,\n closeable: true,\n callback: (extension: ExtensionOption) => this.extensionUpdate(extension)\n })\n },\n onExtensionOptionSelected(extension: ExtensionOption): void {\n // Set the step to 2 (for mobile layout only)\n this.$refs.customFieldsPanel.step = 2\n\n // Check if the extension is different form the currently selected extension\n const isNew =\n !this.selectedExtension || this.selectedExtension.id != extension.id\n\n // If the extension is NOT different from the current selected extension, do nothing\n if (!isNew) return\n\n // Clone the current query params (we do this to avoid the Vue duplicate naviagtion error)\n const query = Object.assign({}, this.$route.query)\n\n // Update the person query param (there is watcher on this value that handles fetching the person)\n query.id = extension.id\n\n // Update the current url\n this.$router.push({ query })\n }\n },\n watch: {\n $route(to, from): void {\n // If the 'id' query param does NOT exist, unset our data\n if (!to.query.id) return (this.selectedExtension = null)\n\n // Get the extension id from the query param\n const id = to.query.id\n\n // Check if the 'extension' param is different from the currently loaded campaign\n const needsLoad = !this.selectedExtension || id != this.selectedExtension.id\n\n // If we do NOT need to load, do nothing\n if (!needsLoad) return\n\n // Else, fetch the new extension\n this.$store.dispatch('customFieldsSelectedExtensionOptionGet', id)\n }\n }\n})\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js??ref--13-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CustomFields.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js??ref--13-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CustomFields.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./CustomFields.vue?vue&type=template&id=349b6947&\"\nimport script from \"./CustomFields.vue?vue&type=script&lang=ts&\"\nexport * from \"./CustomFields.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports\n\n/* vuetify-loader */\nimport installComponents from \"!../../node_modules/vuetify-loader/lib/runtime/installComponents.js\"\nimport { VRow } from 'vuetify/lib/components/VGrid';\ninstallComponents(component, {VRow})\n"],"sourceRoot":""}