{"version":3,"sources":["webpack:///./src/components/Apis/ModalAddApplication.vue","webpack:///src/components/Apis/ModalAddApplication.vue","webpack:///./src/components/Apis/ModalAddApplication.vue?b44b","webpack:///./src/components/Apis/ModalAddApplication.vue?1f80"],"names":["render","_vm","this","_c","_self","attrs","isSaving","isSavingSuccess","isSavingError","onClickCancel","createApplication","showModal","on","scopedSlots","_u","key","fn","_v","directives","name","rawName","value","newApplication","ApplicationName","expression","staticClass","domProps","$event","target","composing","$set","proxy","slot","staticRenderFns","components","props","type","Boolean","default","Function","required","locationId","Number","data","LocationId","computed","_objectSpread","mapState","created","methods","mapMutations","self","applicationProvider","registerApplication","then","response","status","applicationsPageState","applications","push","Application","setApplicationsPageState","setTimeout","catch","error","finally","component"],"mappings":"yHAAA,IAAIA,EAAS,WAAkB,IAAIC,EAAIC,KAAKC,EAAGF,EAAIG,MAAMD,GAAG,OAAOA,EAAG,qBAAqB,CAACE,MAAM,CAAC,WAAa,GAAG,SAAWJ,EAAIK,SAAS,gBAAkBL,EAAIM,gBAAgB,cAAgBN,EAAIO,cAAc,kBAAoBP,EAAIO,eAAiBP,EAAIM,gBAAgB,cAAgBN,EAAIQ,cAAc,YAAcR,EAAIS,kBAAkB,UAAYT,EAAIU,WAAWC,GAAG,CAAC,WAAaX,EAAIQ,eAAeI,YAAYZ,EAAIa,GAAG,CAAC,CAACC,IAAI,UAAUC,GAAG,WAAW,MAAO,CAACb,EAAG,MAAM,CAACA,EAAG,QAAQ,CAACF,EAAIgB,GAAG,sBAAsBd,EAAG,QAAQ,CAACe,WAAW,CAAC,CAACC,KAAK,QAAQC,QAAQ,UAAUC,MAAOpB,EAAIqB,eAAeC,gBAAiBC,WAAW,mCAAmCC,YAAY,QAAQpB,MAAM,CAAC,KAAO,QAAQqB,SAAS,CAAC,MAASzB,EAAIqB,eAAeC,iBAAkBX,GAAG,CAAC,MAAQ,SAASe,GAAWA,EAAOC,OAAOC,WAAiB5B,EAAI6B,KAAK7B,EAAIqB,eAAgB,kBAAmBK,EAAOC,OAAOP,eAAeU,OAAM,MAAS,CAAC5B,EAAG,WAAW,CAAC6B,KAAK,gBAAgB,IAEh7BC,EAAkB,G,gFC8BP,GACfC,WAAA,GAEAC,MAAA,CACAxB,UAAA,CACAyB,KAAAC,QACAC,SAAA,GAGA7B,cAAA,CACA2B,KAAAG,SACAC,UAAA,GAGAC,WAAA,CACAL,KAAAM,OACAJ,QAAA,IAIAK,KAAA,WACA,OACArB,eAAA,CACAsB,WAAA,KAAAH,WACAlB,gBAAA,IAEAjB,UAAA,EACAC,iBAAA,EACAC,eAAA,IAIAqC,SAAAC,eAAA,GACAC,eAAA,+CAGAC,QAAA,aAEAC,QAAAH,8BAAA,GACAI,eAAA,sDAEAxC,kBAAA,WACA,IAAAyC,EAAA,KAEAA,EAAA7C,WACA6C,EAAA7C,UAAA,EAEA8C,OAAAH,QACAI,oBAAAF,EAAA7B,gBACAgC,MAAA,SAAAC,GACA,MAAAA,EAAAC,SACAL,EAAA5C,iBAAA,EAEA4C,EAAAM,sBAAAC,aAAAC,KACAJ,EAAAZ,KAAAiB,aAGAT,EAAAU,yBAAAV,EAAAM,uBAEAK,YAAA,WACAX,EAAA1C,kBACA,SAGAsD,OAAA,SAAAC,GACAb,EAAA3C,eAAA,KAEAyD,SAAA,WACAd,EAAA7C,UAAA,UCpG2W,I,YCOvW4D,EAAY,eACd,EACAlE,EACAiC,GACA,EACA,KACA,KACA,MAIa,aAAAiC,E","file":"js/chunk-2d0de2e6.js?id=d90846736d51db24a749","sourcesContent":["var render = function render(){var _vm=this,_c=_vm._self._c;return _c('ui-component-modal',{attrs:{\"modalTitle\":\"\",\"isSaving\":_vm.isSaving,\"isSavingSuccess\":_vm.isSavingSuccess,\"isSavingError\":_vm.isSavingError,\"hideFooterButtons\":_vm.isSavingError || _vm.isSavingSuccess,\"onClickCancel\":_vm.onClickCancel,\"onClickSave\":_vm.createApplication,\"showModal\":_vm.showModal},on:{\"closeModal\":_vm.onClickCancel},scopedSlots:_vm._u([{key:\"content\",fn:function(){return [_c('div',[_c('label',[_vm._v(\"Application name\")]),_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.newApplication.ApplicationName),expression:\"newApplication.ApplicationName\"}],staticClass:\"input\",attrs:{\"type\":\"text\"},domProps:{\"value\":(_vm.newApplication.ApplicationName)},on:{\"input\":function($event){if($event.target.composing)return;_vm.$set(_vm.newApplication, \"ApplicationName\", $event.target.value)}}})])]},proxy:true}])},[_c('template',{slot:\"modalTitle\"})],2)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\n  <ui-component-modal\n    modalTitle=\"\"\n    :isSaving=\"isSaving\"\n    :isSavingSuccess=\"isSavingSuccess\"\n    :isSavingError=\"isSavingError\"\n    :hideFooterButtons=\"isSavingError || isSavingSuccess\"\n    :onClickCancel=\"onClickCancel\"\n    :onClickSave=\"createApplication\"\n    :showModal=\"showModal\"\n    @closeModal=\"onClickCancel\"\n  >\n    <template slot=\"modalTitle\"></template>\n    <template v-slot:content>\n      <div>\n        <label>Application name</label>\n        <input\n          type=\"text\"\n          v-model=\"newApplication.ApplicationName\"\n          class=\"input\"\n        />\n      </div>\n    </template>\n  </ui-component-modal>\n</template>\n\n<script>\nimport Vue from 'vue'\nimport { mapState, mapMutations } from 'vuex'\nimport { EventBus } from '@/eventbus/event-bus'\nimport applicationProvider from '@/providers/application'\n\nexport default {\n  components: {},\n\n  props: {\n    showModal: {\n      type: Boolean,\n      default: false,\n    },\n\n    onClickCancel: {\n      type: Function,\n      required: true,\n    },\n\n    locationId: {\n      type: Number,\n      default: 0,\n    },\n  },\n\n  data() {\n    return {\n      newApplication: {\n        LocationId: this.locationId,\n        ApplicationName: '',\n      },\n      isSaving: false,\n      isSavingSuccess: false,\n      isSavingError: false,\n    }\n  },\n\n  computed: {\n    ...mapState('applicationStore', ['applicationsPageState']),\n  },\n\n  created() {},\n\n  methods: {\n    ...mapMutations('applicationStore', ['setApplicationsPageState']),\n\n    createApplication() {\n      let self = this\n\n      if (!self.isSaving) {\n        self.isSaving = true\n\n        applicationProvider.methods\n          .registerApplication(self.newApplication)\n          .then((response) => {\n            if (response.status === 200) {\n              self.isSavingSuccess = true\n\n              self.applicationsPageState.applications.push(\n                response.data.Application\n              )\n\n              self.setApplicationsPageState(self.applicationsPageState)\n\n              setTimeout(() => {\n                self.onClickCancel()\n              }, 1000)\n            }\n          })\n          .catch((error) => {\n            self.isSavingError = true\n          })\n          .finally(() => {\n            self.isSaving = false\n          })\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!./ModalAddApplication.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!./ModalAddApplication.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./ModalAddApplication.vue?vue&type=template&id=59b084a8\"\nimport script from \"./ModalAddApplication.vue?vue&type=script&lang=js\"\nexport * from \"./ModalAddApplication.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":""}