{"version":3,"sources":["webpack:///./src/modules/profile/api/profile.ts","webpack:///./src/modules/devices/api/device.ts","webpack:///./src/modules/core/enums/languages.ts","webpack:///./src/modules/profile/classes/profile.ts","webpack:///./src/modules/devices/components/List.vue?71a7","webpack:///./src/modules/devices/components/List.vue?4b6a","webpack:///./src/modules/devices/components/List.vue?8431","webpack:///./src/modules/devices/enums/deviceStatus.ts","webpack:///./src/modules/profile/classes/subscription.ts","webpack:///./src/modules/devices/components/List.vue?3ba6","webpack:///./src/modules/devices/components/List.vue?6bab","webpack:///./src/modules/devices/components/List.vue"],"names":["this","MasterAccountId","state","auth","user","getProfile","Promise","get","response","Error","appResponse","data","IsSuccess","Result","ErrorCodes","join","getSubscription","updateProfile","profile","post","name","language","defaultPhoneNumberPrefix","marketingConsent","newsletterConsent","accountName","updatePassword","passwdChange","currentPassword","newPassword","confirmPassword","newPasswordRepeat","getSteps","list","devices","phoneNr","PhoneNumber","device","add","delete","updateStatus","Status","updateName","Name","updateGroupIds","ToAdd","ToRemove","assign","Languages","hasShopifyIntegration","hadShopifyIntegration","email","EN","integrations","some","i","type","phoneNumber","DeviceStatus","render","_vm","_h","$createElement","_c","_self","directives","rawName","value","expression","staticClass","attrs","slot","_v","_s","$t","subscription","includedDevices","allowedDevices","on","$event","refresh","ref","staticStyle","tableData","_l","column","key","prop","label","sortable","scopedSlots","_u","fn","scope","property","isEditMode","$index","_e","row","groupId","index","enableEditMode","rerenderTable","model","editGroupIds","callback","$$v","$set","editModeLoading","saveGroupIds","deviceStatus","saveName","savePhoneNumber","activate","disable","deleteDevice","staticRenderFns","tableColumns","loading","editModeFields","oldPhoneNumber","api","profileApi","Subscription","created","includes","push","disableEditMode","filter","item","result","record","newDeviceGroups","unshift","deviceGroupList","substr","$router","ACTIVE","show","INACTIVE","$confirm","confirmButtonText","cancelButtonText","customClass","then","List","component"],"mappings":"wMASA,aAGE,aACEA,KAAKC,gBAAkB,OAAMC,MAAMC,MAAQ,OAAMD,MAAMC,KAAKC,K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ff197006.js","sourcesContent":["import { PasswdChangeModel } from './../classes/passwdChange';\nimport { ProfileModel } from './../classes/profile';\nimport { Subscription } from './../classes/subscription';\nimport { AxiosResponse } from 'axios';\nimport AuthorizedApiClient from 'modules/auth/models/authorizedApiClient';\nimport { AppResponse } from 'modules/core/interfaces/appResponse';\nimport store from '@/store/index';\nimport { UserSteps } from '../classes/userSteps';\n\nexport class ProfileApi {\n public MasterAccountId: string;\n\n public constructor() {\n this.MasterAccountId = store.state.auth && store.state.auth.user\n ? store.state.auth.user.MasterAccountId\n : null;\n }\n\n public async getProfile(): Promise {\n const response: AxiosResponse> = await AuthorizedApiClient.get('/Account/GetProfileInfo');\n if(!response)\n {\n throw new Error();\n }\n const appResponse: AppResponse = response.data;\n if (appResponse.IsSuccess) {\n const user: ProfileModel = new ProfileModel(appResponse.Result);\n return user;\n } else {\n throw new Error(appResponse.ErrorCodes.join(','));\n }\n }\n\n public async getSubscription(): Promise {\n const response: AxiosResponse> =\n await AuthorizedApiClient.get('/Account/GetSubscription');\n const appResponse: AppResponse = response.data;\n\n if (appResponse.IsSuccess) {\n const user: Subscription = appResponse.Result;\n return user;\n } else {\n throw new Error(appResponse.ErrorCodes.join(','));\n }\n }\n\n public async updateProfile(profile: ProfileModel): Promise {\n const response: AxiosResponse<\n AppResponse\n > = await AuthorizedApiClient.post('/Account/SetProfileInfo', {\n name: profile.name,\n language: profile.language,\n defaultPhoneNumberPrefix: profile.defaultPhoneNumberPrefix,\n marketingConsent: profile.marketingConsent,\n newsletterConsent: profile.newsletterConsent,\n accountName: profile.accountName\n });\n const appResponse: AppResponse = response.data;\n if (appResponse.IsSuccess) {\n return true;\n } else {\n throw new Error(appResponse.ErrorCodes.join(','));\n }\n }\n\n public async updatePassword(passwdChange: PasswdChangeModel): Promise {\n const response: AxiosResponse<\n AppResponse\n > = await AuthorizedApiClient.post('/Account/ChangePassword', {\n currentPassword: passwdChange.currentPassword,\n newPassword: passwdChange.newPassword,\n confirmPassword: passwdChange.newPasswordRepeat,\n });\n const appResponse: AppResponse = response.data;\n if (appResponse.IsSuccess) {\n return true;\n } else {\n throw new Error(appResponse.ErrorCodes.join(','));\n }\n }\n\n public async getSteps() : Promise {\n const response : AxiosResponse> \n = await AuthorizedApiClient.get('/Account/UserSteps')\n const appResponse: AppResponse = response.data;\n if(appResponse.IsSuccess)\n {\n return appResponse.Result;\n }\n else {\n throw new Error(appResponse.ErrorCodes.join(','));\n }\n }\n}\n\ndeclare global {\n var tidioChatApi: any;\n}\n","import { DeviceStatus } from './../enums/deviceStatus';\nimport { Device } from './../classes/device';\nimport { DeviceVm } from './../classes/deviceVm';\nimport { AppResponse } from 'modules/core/interfaces/appResponse';\nimport AuthorizedApiClient from 'modules/auth/models/authorizedApiClient';\nimport { AxiosResponse } from 'axios';\nimport store from '@/store/index';\n\nexport class DeviceApi {\n public MasterAccountId: string;\n\n public constructor() {\n this.MasterAccountId = store.state.auth && store.state.auth.user\n ? store.state.auth.user.MasterAccountId\n : null;\n }\n\n public async list(): Promise {\n const MasterAccountId = this.MasterAccountId;\n const response: AxiosResponse<\n AppResponse\n > = await AuthorizedApiClient.post('/device/getDevices', {\n MasterAccountId,\n });\n const appResponse: AppResponse = response.data;\n if (appResponse.IsSuccess) {\n const devices: DeviceVm[] = appResponse.Result ? appResponse.Result : [];\n return devices;\n } else {\n throw new Error(appResponse.ErrorCodes.join(','));\n }\n }\n\n public async get(phoneNr: string): Promise {\n const MasterAccountId = this.MasterAccountId;\n const response: AxiosResponse<\n AppResponse\n > = await AuthorizedApiClient.post('/device/getDevice', {\n PhoneNumber: phoneNr,\n MasterAccountId,\n });\n const appResponse: AppResponse = response.data;\n if (appResponse.IsSuccess) {\n const device: DeviceVm = appResponse.Result;\n return device;\n } else {\n throw new Error(appResponse.ErrorCodes.join(','));\n }\n }\n\n public async add(device: Device): Promise {\n const MasterAccountId = this.MasterAccountId;\n const response: AxiosResponse<\n AppResponse\n > = await AuthorizedApiClient.post('/device/create', {\n ...device,\n MasterAccountId,\n });\n const appResponse: AppResponse = response.data;\n if (appResponse.IsSuccess) {\n return true;\n } else {\n throw new Error(appResponse.ErrorCodes.join(','));\n }\n }\n\n public async delete(PhoneNumber: string): Promise {\n const MasterAccountId = this.MasterAccountId;\n const response: AxiosResponse<\n AppResponse\n > = await AuthorizedApiClient.post('/device/Delete', {\n PhoneNumber,\n MasterAccountId,\n });\n const appResponse: AppResponse = response.data;\n if (appResponse.IsSuccess) {\n return true;\n } else {\n throw new Error(appResponse.ErrorCodes.join(','));\n }\n }\n\n public async updateStatus(\n PhoneNumber: string,\n Status: DeviceStatus,\n ): Promise {\n const MasterAccountId = this.MasterAccountId;\n const response: AxiosResponse<\n AppResponse\n > = await AuthorizedApiClient.post('/device/ChangeStatus', {\n PhoneNumber,\n Status,\n MasterAccountId,\n });\n const appResponse: AppResponse = response.data;\n if (appResponse.IsSuccess) {\n return true;\n } else {\n throw new Error(appResponse.ErrorCodes.join(','));\n }\n }\n\n public async updateName(PhoneNumber: string, Name: string): Promise {\n const MasterAccountId = this.MasterAccountId;\n const response: AxiosResponse<\n AppResponse\n > = await AuthorizedApiClient.post('/device/ChangeName', {\n PhoneNumber,\n Name,\n MasterAccountId,\n });\n const appResponse: AppResponse = response.data;\n if (appResponse.IsSuccess) {\n return true;\n } else {\n throw new Error(appResponse.ErrorCodes.join(','));\n }\n }\n\n public async updateGroupIds(\n PhoneNumber: string,\n ToAdd: string[],\n ToRemove: string[],\n ): Promise {\n const MasterAccountId = this.MasterAccountId;\n const response: AxiosResponse<\n AppResponse\n > = await AuthorizedApiClient.post('/device/ChangeGroupIds', {\n PhoneNumber,\n ToAdd,\n ToRemove,\n MasterAccountId,\n });\n const appResponse: AppResponse = response.data;\n if (appResponse.IsSuccess) {\n return true;\n } else {\n throw new Error(appResponse.ErrorCodes.join(','));\n }\n }\n\n public async assign(device: Device): Promise {\n const MasterAccountId = this.MasterAccountId;\n const response: AxiosResponse<\n AppResponse\n > = await AuthorizedApiClient.post('/device/AssignDeviceToAccount', {\n ...device,\n MasterAccountId,\n });\n const appResponse: AppResponse = response.data;\n if (appResponse.IsSuccess) {\n return true;\n } else {\n throw new Error(appResponse.ErrorCodes.join(','));\n }\n }\n}\n","export enum Languages {\n PL = 'pl',\n EN = 'en',\n}\n","import { Languages } from '@/modules/core/enums/languages';\nimport { IntegrationDefinition } from './integrationDefinition';\n\nexport class ProfileModel {\n public email: string;\n public name: string;\n public accountName: string;\n public language: Languages;\n public integrations: IntegrationDefinition[];\n public hasShopifyIntegration: boolean = false;\n public hadShopifyIntegration: boolean = false;\n public defaultPhoneNumberPrefix: string;\n public phoneNumber: string;\n public marketingConsent: boolean;\n public newsletterConsent: boolean;\n public constructor(data?: ProfileModel) {\n this.email = (data && data.email) ? data.email : '';\n this.name = (data && data.name) ? data.name : '';\n this.accountName = (data && data.accountName) ? data.accountName : '';\n this.language = (data && data.language) ? data.language : Languages.EN;\n this.integrations = (data && data.integrations) ? data.integrations : [];\n this.hadShopifyIntegration = (data && data.hadShopifyIntegration) ? data.hadShopifyIntegration : false;\n this.hasShopifyIntegration = this.integrations.some((i) => i.type === 'shopify');\n this.defaultPhoneNumberPrefix = (data && data.defaultPhoneNumberPrefix) ? data.defaultPhoneNumberPrefix : '+48';\n this.phoneNumber = (data && data.phoneNumber) ? data.phoneNumber : '+48';\n this.marketingConsent = (data && data.marketingConsent) ? data.marketingConsent : false;\n this.newsletterConsent = (data && data.newsletterConsent) ? data.newsletterConsent : false;\n }\n}\n","export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./List.vue?vue&type=style&index=0&id=2752b38a&prod&lang=scss\"","export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./List.vue?vue&type=style&index=1&id=2752b38a&prod&lang=scss&scoped=true\"","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{directives:[{name:\"loading\",rawName:\"v-loading\",value:(_vm.loading),expression:\"loading\"}],staticClass:\"page-devices\"},[_c('el-card',{staticClass:\"box-card\"},[_c('div',{attrs:{\"slot\":\"header\"},slot:\"header\"},[_c('span',{staticClass:\"card-title\"},[_vm._v(_vm._s(_vm.$t('devices.title')))])]),_c('div',{staticClass:\"buttons-set double-columns\"},[_c('div',[_vm._v(\"\\n \"+_vm._s(_vm.$t('devices.summaryTitle'))+\" \"+_vm._s(this.subscription.includedDevices)+\"/\"+_vm._s(this.subscription.allowedDevices)+\"\\n \")]),_c('div',[_c('el-tooltip',{staticClass:\"edit-item-btn\",attrs:{\"open-delay\":500,\"content\":\"Odśwież tabelę\",\"placement\":\"top-start\"}},[_c('el-button',{attrs:{\"size\":\"medium\"},on:{\"click\":function($event){_vm.refresh()}}},[_c('i',{staticClass:\"el-icon-refresh-left\"})])],1),_c('el-button',{attrs:{\"size\":\"medium\",\"type\":\"primary\",\"disabled\":_vm.subscription.includedDevices === _vm.subscription.allowedDevices},on:{\"click\":function($event){_vm.add()}}},[_vm._v(_vm._s(_vm.$t('devices.addNew')))])],1)]),_c('div',{staticClass:\"table-wrapper\"},[_c('el-table',{ref:\"dataTable\",staticStyle:{\"width\":\"100%\",\"min-width\":\"800px\"},attrs:{\"data\":_vm.tableData,\"stripe\":\"\",\"border\":\"\",\"height\":\"400\"}},[_vm._l((_vm.tableColumns),function(column){return _c('el-table-column',{key:column.prop,attrs:{\"prop\":column.prop,\"label\":column.label,\"sortable\":column.sortable},scopedSlots:_vm._u([{key:\"default\",fn:function(scope){return [(scope.column.property === 'deviceGroupList')?[(!_vm.isEditMode(scope.column.property, scope.$index))?[_vm._l((scope.row.deviceGroupList),function(groupId,index){return _c('el-tag',{key:index,staticClass:\"device-group-tag\",attrs:{\"type\":\"info\"}},[_vm._v(_vm._s(groupId))])}),_c('el-tooltip',{staticClass:\"edit-item-btn\",attrs:{\"open-delay\":500,\"content\":\"Edit value\",\"placement\":\"top-start\"}},[_c('el-link',{on:{\"click\":function($event){_vm.enableEditMode(scope.column.property, scope.$index)}}},[_c('i',{staticClass:\"el-icon-edit\"})])],1)]:_vm._e(),(_vm.isEditMode(scope.column.property, scope.$index))?_c('div',{staticClass:\"edit-mode\"},[_c('el-select',{attrs:{\"multiple\":\"\",\"filterable\":\"\",\"allow-create\":\"\",\"default-first-option\":\"\",\"no-data-text\":_vm.$t('devices.add.deviceGroupsAdd'),\"placeholder\":_vm.$t('devices.add.deviceGroups')},on:{\"change\":function($event){_vm.rerenderTable()}},model:{value:(_vm.editGroupIds[scope.$index]),callback:function ($$v) {_vm.$set(_vm.editGroupIds, scope.$index, $$v)},expression:\"editGroupIds[scope.$index]\"}}),(!_vm.editModeLoading)?_c('el-tooltip',{staticClass:\"edit-item-btn\",attrs:{\"open-delay\":500,\"content\":\"Save changes\",\"placement\":\"top-start\"}},[_c('el-link',{on:{\"click\":function($event){_vm.saveGroupIds(scope.$index)}}},[_c('i',{staticClass:\"el-icon-check\"})])],1):_vm._e(),(_vm.editModeLoading)?_c('i',{staticClass:\"el-icon-loading\"}):_vm._e()],1):_vm._e()]:(scope.column.property === 'deviceStatus')?[(scope.row.deviceStatus === 'active')?_c('el-tag',{attrs:{\"type\":\"success\"}},[_vm._v(_vm._s(_vm.$t('devices.active')))]):_vm._e(),(scope.row.deviceStatus === 'inactive')?_c('el-tag',{attrs:{\"type\":\"danger\"}},[_vm._v(_vm._s(_vm.$t('devices.inactive')))]):_vm._e(),(scope.row.deviceStatus === 'pending')?_c('el-tag',{attrs:{\"type\":\"warning\"}},[_vm._v(_vm._s(_vm.$t('devices.pending')))]):_vm._e()]:(scope.column.property === 'name')?[(!_vm.isEditMode(scope.column.property, scope.$index))?_c('div',{staticClass:\"no-edit-mode\"},[_vm._v(\"\\n \"+_vm._s(scope.row[scope.column.property])+\"\\n \"),_c('el-tooltip',{staticClass:\"edit-item-btn\",attrs:{\"open-delay\":500,\"content\":\"Edit value\",\"placement\":\"top-start\"}},[_c('el-link',{on:{\"click\":function($event){_vm.enableEditMode(scope.column.property, scope.$index)}}},[_c('i',{staticClass:\"el-icon-edit\"})])],1)],1):_vm._e(),(_vm.isEditMode(scope.column.property, scope.$index))?_c('div',{staticClass:\"edit-mode\"},[_c('el-input',{attrs:{\"size\":\"small\",\"type\":\"text\"},model:{value:(_vm.tableData[scope.$index][scope.column.property]),callback:function ($$v) {_vm.$set(_vm.tableData[scope.$index], scope.column.property, $$v)},expression:\"tableData[scope.$index][scope.column.property]\"}}),(!_vm.editModeLoading)?_c('el-tooltip',{staticClass:\"edit-item-btn\",attrs:{\"open-delay\":500,\"content\":\"Save changes\",\"placement\":\"top-start\"}},[_c('el-link',{on:{\"click\":function($event){_vm.saveName(scope.$index)}}},[_c('i',{staticClass:\"el-icon-check\"})])],1):_vm._e(),(_vm.editModeLoading)?_c('i',{staticClass:\"el-icon-loading\"}):_vm._e()],1):_vm._e()]:(scope.column.property === 'phoneNumber')?[(!_vm.isEditMode(scope.column.property, scope.$index))?_c('div',{staticClass:\"no-edit-mode\"},[_vm._v(\"\\n \"+_vm._s(scope.row[scope.column.property])+\"\\n \")]):_vm._e(),(_vm.isEditMode(scope.column.property, scope.$index))?_c('div',{staticClass:\"edit-mode\"},[_c('el-input',{attrs:{\"size\":\"small\",\"type\":\"text\"},model:{value:(_vm.tableData[scope.$index][scope.column.property]),callback:function ($$v) {_vm.$set(_vm.tableData[scope.$index], scope.column.property, $$v)},expression:\"tableData[scope.$index][scope.column.property]\"}}),(!_vm.editModeLoading)?_c('el-tooltip',{staticClass:\"edit-item-btn\",attrs:{\"open-delay\":500,\"content\":\"Save changes\",\"placement\":\"top-start\"}},[_c('el-link',{on:{\"click\":function($event){_vm.savePhoneNumber(scope.$index)}}},[_c('i',{staticClass:\"el-icon-check\"})])],1):_vm._e(),(_vm.editModeLoading)?_c('i',{staticClass:\"el-icon-loading\"}):_vm._e()],1):_vm._e()]:[_vm._v(\"\\n \"+_vm._s(scope.row[scope.column.property])+\"\\n \")]]}}])})}),_c('el-table-column',{attrs:{\"label\":_vm.$t('general.actions')},scopedSlots:_vm._u([{key:\"default\",fn:function(scope){return [(scope.row.deviceStatus === 'inactive')?_c('el-button',{staticClass:\"actionBtn\",attrs:{\"size\":\"mini\",\"type\":\"primary\"},on:{\"click\":function($event){_vm.activate(scope.row.phoneNumber)}}},[_vm._v(_vm._s(_vm.$t('devices.activate')))]):_vm._e(),(scope.row.deviceStatus === 'active')?_c('el-button',{staticClass:\"actionBtn\",attrs:{\"size\":\"mini\",\"type\":\"danger\"},on:{\"click\":function($event){_vm.disable(scope.row.phoneNumber)}}},[_vm._v(_vm._s(_vm.$t('devices.disable')))]):_vm._e(),_c('el-button',{staticClass:\"actionBtn\",attrs:{\"size\":\"mini\",\"type\":\"danger\"},on:{\"click\":function($event){_vm.deleteDevice(scope.row.phoneNumber, scope.row.email)}}},[_vm._v(_vm._s(_vm.$t('devices.delete')))])]}}])})],2)],1)])],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","export enum DeviceStatus {\n ACTIVE = 'active',\n INACTIVE = 'inactive',\n}\n","/**\n * @TODO: This model doesn't include all subscription\n * props fetched from the backend\n */\nexport class Subscription {\n public includedDevices: number;\n public allowedDevices: number;\n\n public constructor(data?: Subscription) {\n this.allowedDevices = (data && data.allowedDevices) ? data.allowedDevices : 0;\n this.includedDevices = (data && data.includedDevices) ? data.includedDevices : 0;\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\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\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\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\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport { Component, Vue } from 'vue-property-decorator';\nimport { Device } from '../classes/device';\nimport { DeviceApi } from '../api/device';\nimport { DeviceVm } from '../classes/deviceVm';\nimport { DeviceStatus } from '../enums/deviceStatus';\nimport AppMessage from 'modules/core/models/appMessage';\nimport { ElTable } from 'element-ui/types/table';\nimport { ProfileApi } from 'modules/profile/api/profile';\nimport { Subscription } from 'modules/profile/classes/subscription';\n\n@Component\nexport default class List extends Vue {\n public tableColumns: any[] = [];\n public tableData: DeviceVm[] = [];\n public loading: boolean = false;\n public editModeLoading: boolean = false;\n public editModeFields: any = {};\n public editGroupIds: any = {};\n public subscription: Subscription;\n private oldPhoneNumber: string = '';\n private api: DeviceApi;\n private profileApi: ProfileApi;\n\n constructor() {\n super();\n this.api = new DeviceApi();\n this.profileApi = new ProfileApi();\n this.subscription = new Subscription();\n }\n\n public async created() {\n this.tableColumns = [\n {\n prop: 'email',\n label: this.$t('devices.phoneNumber') + '/' + this.$t('devices.email'),\n sortable: true,\n },\n {\n prop: 'name',\n label: this.$t('devices.name'),\n sortable: true,\n },\n {\n prop: 'deviceGroupList',\n label: this.$t('devices.deviceGroupList'),\n sortable: false,\n },\n {\n prop: 'deviceStatus',\n label: this.$t('devices.deviceStatus'),\n sortable: true,\n },\n ];\n\n this.refresh();\n }\n\n public async refresh() {\n this.loading = true;\n this.tableData = await this.api.list();\n this.subscription = await this.profileApi.getSubscription();\n this.loading = false;\n }\n\n public enableEditMode(prop: string, index: number) {\n if (!this.editModeFields[prop]) {\n this.editModeFields[prop] = [];\n }\n\n if (this.editModeFields[prop].includes(index) === false) {\n this.editModeFields[prop].push(index);\n }\n\n if (prop === 'deviceGroupList') {\n this.editGroupIds[index] = this.tableData[index][prop];\n }\n\n this.rerenderTable();\n }\n\n public disableEditMode(prop: string, index: number) {\n if (this.editModeFields[prop]) {\n this.editModeFields[prop] = this.editModeFields[prop].filter((item: number) => {\n return item !== index;\n });\n }\n this.rerenderTable();\n }\n\n public isEditMode(prop: string, index: number) {\n let result = false;\n\n if (this.editModeFields[prop]) {\n result = (this.editModeFields[prop].includes(index) === true);\n }\n\n return result;\n }\n\n public async saveName(index: number) {\n this.editModeLoading = true;\n const record: DeviceVm = this.tableData[index];\n await this.api.updateName(record.phoneNumber, record.name);\n this.disableEditMode('name', index);\n this.editModeLoading = false;\n }\n\n public async saveGroupIds(index: number) {\n this.editModeLoading = true;\n const newDeviceGroups = this.editGroupIds[index];\n if (!newDeviceGroups.includes('default')) {\n newDeviceGroups.unshift('default');\n }\n const record: DeviceVm = this.tableData[index];\n await this.api.updateGroupIds(record.phoneNumber, newDeviceGroups, record.deviceGroupList);\n record.deviceGroupList = newDeviceGroups;\n this.disableEditMode('deviceGroupList', index);\n this.editModeLoading = false;\n }\n\n public rerenderTable() {\n /**\n * @TODO: Hack to rerender table - have to provide something better :)\n */\n this.tableData[0].phoneNumber = 'X' + this.tableData[0].phoneNumber;\n this.tableData[0].phoneNumber = this.tableData[0].phoneNumber.substr(1);\n }\n\n public add() {\n this.$router.push('/devices/add');\n }\n\n public async activate(phoneNumber: string) {\n this.loading = true;\n try {\n const result = await this.api.updateStatus(phoneNumber, DeviceStatus.ACTIVE);\n if (result) {\n await this.refresh();\n AppMessage.show(this.$t('devices.changeStatusSuccess'), 'success');\n }\n } catch (error) {\n this.loading = false;\n }\n this.loading = false;\n }\n\n public async disable(phoneNumber: string) {\n this.loading = true;\n try {\n const result = await this.api.updateStatus(phoneNumber, DeviceStatus.INACTIVE);\n if (result) {\n await this.refresh();\n AppMessage.show(this.$t('devices.changeStatusSuccess'), 'success');\n }\n } catch (err) {\n this.loading = false;\n }\n this.loading = false;\n }\n\n public deleteDevice(phoneNumber: string, email: string) {\n this.$confirm(\n this.$t('devices.deleteText') as string,\n this.$t('devices.deleteTitle', { email }) as string,\n {\n confirmButtonText: this.$t('general.yes') as string,\n cancelButtonText: this.$t('general.no') as string,\n type: 'warning',\n customClass: 'deviceRemoveDialog',\n },\n )\n .then(async () => {\n const result: boolean = await this.api.delete(phoneNumber);\n if (result) {\n await this.refresh();\n AppMessage.show(this.$t('devices.deleteSuccess'), 'success');\n }\n });\n }\n}\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/ts-loader/index.js??ref--12-2!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./List.vue?vue&type=script&lang=ts\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/ts-loader/index.js??ref--12-2!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./List.vue?vue&type=script&lang=ts\"","import { render, staticRenderFns } from \"./List.vue?vue&type=template&id=2752b38a&scoped=true\"\nimport script from \"./List.vue?vue&type=script&lang=ts\"\nexport * from \"./List.vue?vue&type=script&lang=ts\"\nimport style0 from \"./List.vue?vue&type=style&index=0&id=2752b38a&prod&lang=scss\"\nimport style1 from \"./List.vue?vue&type=style&index=1&id=2752b38a&prod&lang=scss&scoped=true\"\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 \"2752b38a\",\n null\n \n)\n\nexport default component.exports"],"sourceRoot":""}