{"version":3,"sources":["webpack:///./src/views/CompanySettingsInputFieldPage.vue","webpack:///src/views/CompanySettingsInputFieldPage.vue","webpack:///./src/views/CompanySettingsInputFieldPage.vue?3aa4","webpack:///./src/views/CompanySettingsInputFieldPage.vue?90b1"],"names":["_l","_vm","userContextInputs","_c","key","index","attrs","staticClass","cursor","value","inputField","name","expression","staticRenderFns","components","draggable","data","unchangedUserContextInputs","computed","isSaveDisabled","field","isChanges","JSON","stringify","mounted","url","params","loaderText","orgId","$store","getters","user","companyId","$axios","post","then","response","populateList","createEmptyFields","methods","save","inputFields","filter","_inputField$name","length","id","numItems","push","position","parse","component"],"mappings":"mQAA2S,W,IAAuB,OAAkB,aAAC,OAAMA,EAAIC,OAAIC,CAA8C,MAAOC,CAAkBC,MAAIC,K,CAA4CC,SAAM,W,YAAS,uB,GAAS,6BAAQ,U,YAAE,QAAE,GAAEH,OAAG,GAAO,OAAC,gB,MAACI,CAA0B,KAAK,EAAO,kBAAEA,mB,EAA8BC,KAAQ,iC,OAAS,UAACF,IAAK,G,CAAE,SAAO,WAAE,OAAIH,MAAG,SAA4DI,MAAW,KAAkCD,GAAK,OAAC,C,YAAU,e,CAA2B,U,YAA0C,S,MAAI,CAAa,OAAO,Q,MAAqB,CAAc,U,CAAQG,SAAOC,MAAWC,wBAAK,iB,YAAU,a,GAAgBV,OAASS,C,MAAgE,CAACE,uBAAW,KAAiB,oBAAI,UAAO,GAA4B,QAAQ,GAAaN,MAAM,GAAC,UAAQ,KAAE,aAAgBA,MAAM,CAAC,MAAQ,OAAO,qBAAO,OAAQ,0CAAmCA,WAAM,sBAA+B,4BAAG,IAAC,iB,MAAC,CAAgB,WACjvC,WACGO,OAEJ,MAAe,U,yLCwDA,GACfF,KAAA,gCACAG,WAAA,CACAC,eAEAC,OACA,OAEAd,kBAAA,GACAe,2BAAA,KAGAC,SAAA,CACAC,iBAEA,UAAAC,KAAA,KAAAlB,kBACA,MAAAkB,EAAAT,OACAS,EAAAT,KAAA,IAIA,MAAAU,EACAC,KAAAC,UAAA,KAAArB,oBACAoB,KAAAC,UAAA,KAAAN,4BAEA,OAAAI,IAOAG,UACA,MAAAC,EAAA,gDACAC,EAAA,CACAC,WAAA,aACAC,MAAA,KAAAC,OAAAC,QAAAC,KAAAC,WAGA,KAAAC,OAAAC,KAAAT,EAAAC,GAAAS,KAAAC,IACA,KAAAC,aAAAD,GACA,KAAAE,uBAGAC,QAAA,CACAC,OACA,MAAAf,EAAA,mDACAC,EAAA,CACAC,WAAA,aAEAc,YAAA,KAAAvC,kBAAAwC,OAAAhC,IAAA,IAAAiC,EACA,eAAAA,EAAAjC,EAAAC,YAAA,IAAAgC,OAAA,EAAAA,EAAAC,UAAA,OAAAlC,QAAA,IAAAA,OAAA,EAAAA,EAAAmC,OAIA,KAAAZ,OAAAC,KAAAT,EAAAC,GAAAS,KAAAC,IACA,KAAAC,aAAAD,GACA,KAAAE,uBAGAA,oBACA,QAAApC,kBAAA0C,OAAA,EACA,IACA,IAAAE,EAAA,KAAA5C,kBAAA0C,OACAE,EAAA,EACAA,IAEA,KAAA5C,kBAAA6C,KAAA,CACApC,KAAA,GACAqC,SAAA,KAAA9C,kBAAA0C,SAEA,KAAA3B,2BAAA8B,KAAA,CACApC,KAAA,GACAqC,SAAA,KAAA/B,2BAAA2B,UAKAP,aAAAD,GACA,KAAAlC,kBAAAkC,EAAApB,KACA,KAAAC,2BAAAK,KAAA2B,MACA3B,KAAAC,UAAAa,EAAApB,UC7IsW,I,YCOlWkC,EAAY,eACd,EACA,EACArC,GACA,EACA,KACA,KACA,MAIa,aAAAqC,E","file":"js/chunk-2d0d748a-2025-3-19-12-4.js","sourcesContent":["var render = function render(){var _vm=this,_c=_vm._self._c;return _c('v-container',{attrs:{\"fluid\":\"\"}},[_c('v-card',[_c('v-card-title',{staticClass:\"msaBlue white--text\"},[_vm._v(\" Custom User Fields \")]),_c('v-card-text',{staticClass:\"pa-4\"},[_c('v-row',[_c('v-col',[_c('draggable',{attrs:{\"list\":_vm.userContextInputs,\"handle\":\".handle\"}},_vm._l((_vm.userContextInputs),function(inputField,index){return _c('v-list-item',{key:index},[_c('v-list-item-title',[_c('v-row',{attrs:{\"align\":\"center\",\"dense\":\"\"}},[_c('v-col',{staticClass:\"shrink mb-7\"},[_c('v-btn',{staticClass:\"handle\",style:({ cursor: 'grab' }),attrs:{\"icon\":\"\"}},[_c('v-icon',[_vm._v(\"mdi-swap-vertical\")])],1)],1),_c('v-col',{staticClass:\"grow py-2\"},[_c('v-text-field',{attrs:{\"label\":`Custom field ${index + 1}`,\"placeholder\":inputField.label,\"clearable\":\"\",\"counter\":\"\",\"dense\":\"\",\"maxlength\":\"75\",\"outlined\":\"\"},model:{value:(inputField.name),callback:function ($$v) {_vm.$set(inputField, \"name\", (typeof $$v === 'string'? $$v.trim(): $$v))},expression:\"inputField.name\"}})],1),_c('v-spacer')],1)],1)],1)}),1)],1)],1),_c('v-row',{attrs:{\"dense\":\"\"}},[_c('v-col',{attrs:{\"align\":\"right\"}},[_c('v-btn',{staticClass:\"white--text msaBlue\",attrs:{\"disabled\":_vm.isSaveDisabled},on:{\"click\":_vm.save}},[_vm._v(\" SAVE \")])],1)],1)],1)],1)],1)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\n <v-container fluid>\n <v-card>\n <v-card-title class=\"msaBlue white--text\">\n Custom User Fields\n </v-card-title>\n <v-card-text class=\"pa-4\">\n <v-row>\n <v-col>\n <draggable :list=\"userContextInputs\" handle=\".handle\">\n <v-list-item\n v-for=\"(inputField, index) in userContextInputs\"\n :key=\"index\"\n >\n <v-list-item-title>\n <v-row align=\"center\" dense>\n <v-col class=\"shrink mb-7\">\n <v-btn :style=\"{ cursor: 'grab' }\" class=\"handle\" icon>\n <v-icon>mdi-swap-vertical</v-icon>\n </v-btn>\n </v-col>\n <v-col class=\"grow py-2\">\n <v-text-field\n v-model.trim=\"inputField.name\"\n :label=\"`Custom field ${index + 1}`\"\n :placeholder=\"inputField.label\"\n clearable\n counter\n dense\n maxlength=\"75\"\n outlined\n />\n </v-col>\n <v-spacer></v-spacer>\n </v-row>\n </v-list-item-title>\n </v-list-item>\n </draggable>\n </v-col>\n </v-row>\n\n <v-row dense>\n <v-col align=\"right\">\n <v-btn\n :disabled=\"isSaveDisabled\"\n @click=\"save\"\n class=\"white--text msaBlue\"\n >\n SAVE\n </v-btn>\n </v-col>\n </v-row>\n </v-card-text>\n </v-card>\n </v-container>\n</template>\n\n<script>\nimport draggable from 'vuedraggable';\n\nexport default {\n name: 'CompanySettingsInputFieldPage',\n components: {\n draggable,\n },\n data() {\n return {\n // In future, there will be custom Project fields (ProjectsContext) so I'm specifying that these for the UsersContext\n userContextInputs: [],\n unchangedUserContextInputs: [],\n };\n },\n computed: {\n isSaveDisabled() {\n // Handles CLEAR action on field\n for (const field of this.userContextInputs) {\n if (field.name == null) {\n field.name = '';\n }\n }\n\n const isChanges =\n JSON.stringify(this.userContextInputs) !=\n JSON.stringify(this.unchangedUserContextInputs);\n\n if (!isChanges) {\n return true;\n }\n\n return false;\n },\n },\n mounted() {\n const url = 'get-input-fields-for-organization?format=json';\n const params = {\n loaderText: 'Loading...',\n orgId: this.$store.getters.user.companyId,\n };\n\n this.$axios.post(url, params).then((response) => {\n this.populateList(response);\n this.createEmptyFields();\n });\n },\n methods: {\n save() {\n const url = 'update-input-fields-for-organization?format=json';\n const params = {\n loaderText: 'Loading...',\n // Remove fields that won't be used to action items\n inputFields: this.userContextInputs.filter((inputField) => {\n return inputField.name?.length || inputField?.id;\n }),\n };\n\n this.$axios.post(url, params).then((response) => {\n this.populateList(response);\n this.createEmptyFields();\n });\n },\n createEmptyFields() {\n if (this.userContextInputs.length < 3) {\n for (\n let numItems = this.userContextInputs.length;\n numItems < 3;\n numItems++\n ) {\n this.userContextInputs.push({\n name: '',\n position: this.userContextInputs.length,\n });\n this.unchangedUserContextInputs.push({\n name: '',\n position: this.unchangedUserContextInputs.length,\n });\n }\n }\n },\n populateList(response) {\n this.userContextInputs = response.data;\n this.unchangedUserContextInputs = JSON.parse(\n JSON.stringify(response.data),\n );\n },\n },\n};\n</script>\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/cache-loader/dist/cjs.js??ref--1-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CompanySettingsInputFieldPage.vue?vue&type=script&lang=js\"; 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/cache-loader/dist/cjs.js??ref--1-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CompanySettingsInputFieldPage.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./CompanySettingsInputFieldPage.vue?vue&type=template&id=745bb8d9\"\nimport script from \"./CompanySettingsInputFieldPage.vue?vue&type=script&lang=js\"\nexport * from \"./CompanySettingsInputFieldPage.vue?vue&type=script&lang=js\"\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"],"sourceRoot":""}