1"use strict";(self["webpackChunkgs_memberPortal"]=self["webpackChunkgs_memberPortal"]||[]).push([[2774],{2774:function(e,t,i){i.r(t),i.d(t,{default:function(){return m}});var a=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("p-container",[i("h2",{staticClass:"mb-4"},[e._v(" "+e._s(e.$t("core.page.fieldmapping.page.list.title"))+" ")]),i("p-row",[i("p-col",{attrs:{md3:""}},[i("p-select",{attrs:{"context-icon":"build",clearable:"",label:e.$t("core.page.fieldmapping.properties.appSystem1Id"),items:e.appSystems,loading:e.isAppSystemsLoading,disabled:e.isAppSystemsLoading,errors:e.getAppSystemsError},model:{value:e.filter.appSystemId,callback:function(t){e.$set(e.filter,"appSystemId",t)},expression:"filter.appSystemId"}})],1),i("p-col",{attrs:{md3:""}},[i("p-select",{attrs:{"context-icon":"build",clearable:"",label:e.$t("core.page.fieldmapping.properties.appSystem2Id"),items:e.appSystems,loading:e.isAppSystemsLoading,disabled:e.isAppSystemsLoading,errors:e.getAppSystemsError},model:{value:e.filter.otherAppSystemId,callback:function(t){e.$set(e.filter,"otherAppSystemId",t)},expression:"filter.otherAppSystemId"}})],1),i("p-col",{staticClass:"mt-4",attrs:{md1:""}})],1),i("p-request-alert",{model:{value:e.responseError,callback:function(t){e.responseError=t},expression:"responseError"}}),i("p-list-view",{ref:"mappingList",attrs:{pagination:e.pagination,columns:e.columns,"service-function":e.populateData},on:{"update:pagination":function(t){e.pagination=t},"row-double-click":e.onRowDoubleClick},scopedSlots:e._u([{key:"table-actions",fn:function(){return[i("p-button",{attrs:{disabled:e.isLoadingEntry,loading:e.isLoadingEntry},on:{click:e.refresh}},[i("p-icon",[e._v("cached")])],1),i("p-button",{attrs:{disabled:e.isLoadingEntry,loading:e.isLoadingEntry},on:{click:e.addNewEntry}},[i("p-icon",{attrs:{left:""}},[e._v(" add ")]),e._v(" "+e._s(e.$t("core.page.fieldmapping.action.newMapping"))+" ")],1)]},proxy:!0},{key:"icon-edit",fn:function(t){var a=t.row;return[void 0===a.id||void 0===a.id.value?i("p-icon",{attrs:{spacious:"",color:"success"}},[e._v(" fiber_new ")]):i("div")]}},{key:"appSystem1Id-edit",fn:function(t){var a=t.row;return[i("p-select",{attrs:{solo:"",items:e.appSystemsWithFields},model:{value:a.appSystem1Id.value,callback:function(t){e.$set(a.appSystem1Id,"value",t)},expression:"row.appSystem1Id.value"}})]}},{key:"appSystem2Id-edit",fn:function(t){var a=t.row;return[i("p-select",{attrs:{solo:"",items:e.appSystemsWithFields},model:{value:a.appSystem2Id.value,callback:function(t){e.$set(a.appSystem2Id,"value",t)},expression:"row.appSystem2Id.value"}})]}},{key:"field1Id-edit",fn:function(t){var a=t.row;return[i("p-select",{attrs:{loading:e.isLoadingFields,solo:"",items:e.customFieldsLookup[a.appSystem1Id.value]},model:{value:a.field1Id.value,callback:function(t){e.$set(a.field1Id,"value",t)},expression:"row.field1Id.value"}})]}},{key:"field1Id",fn:function(t){var i=t.row;return[e._v(" "+e._s(e.getCustomFieldCaption(i.field1Id.value,i.appSystem1Id.value))+" ")]}},{key:"field2Id-edit",fn:function(t){var a=t.row;return[i("p-select",{attrs:{loading:e.isLoadingFields,solo:"",items:e.customFieldsLookup[a.appSystem2Id.value]},model:{value:a.field2Id.value,callback:function(t){e.$set(a.field2Id,"value",t)},expression:"row.field2Id.value"}})]}},{key:"field2Id",fn:function(t){var i=t.row;return[e._v(" "+e._s(e.getCustomFieldCaption(i.field2Id.value,i.appSystem2Id.value))+" ")]}},{key:"entry-actions",fn:function(t){var a=t.row,n=t.rowIndex;return[i("p-row",{attrs:{nowrap:"","align-center":"","justify-end":"",dense:""}},[i("p-button",{attrs:{disabled:e.isLoadingEntry,loading:e.isLoadingEntry,dense:""},on:{click:function(e){a.editMode=!0}}},[i("p-icon",{attrs:{dense:""}},[e._v(" edit ")])],1),i("p-button",{attrs:{secondary:"",disabled:e.isLoadingEntry,loading:e.isLoadingEntry,dense:""},on:{click:function(t){return e.deleteEntry(a,n)}}},[i("p-icon",{attrs:{dense:"",color:"error"}},[e._v(" delete ")])],1)],1)]}},{key:"entry-actions-edit",fn:function(t){var a=t.row,n=t.rowIndex;return[i("p-row",{attrs:{nowrap:"","align-center":"","justify-end":"",dense:""}},[i("p-button",{attrs:{disabled:e.isLoadingEntry,loading:e.isLoadingEntry,dense:"",secondary:""},on:{click:function(t){return e.cancelEdit(a,n)}}},[i("p-icon",{attrs:{dense:""}},[e._v(" cancel ")])],1),i("p-button",{attrs:{disabled:e.isLoadingEntry||!e.getCanSave(a),loading:e.isLoadingEntry,dense:""},on:{click:function(t){return e.saveEdit(a)}}},[i("p-icon",{attrs:{dense:""}},[e._v(" save ")])],1)],1)]}}]),model:{value:e.list,callback:function(t){e.list=t},expression:"list"}})],1)},n=[],s=i(5471),o=i(7527),r=i(6530);class p extends r.A{get appSystemId(){return this.dto.appSystemId}set appSystemId(e){this.dto.appSystemId=e}get fieldId(){return this.dto.fieldId}set fieldId(e){this.dto.fieldId=e}get fieldValue(){return this.dto.fieldValue}set fieldValue(e){this.dto.fieldValue=e}get otherAppSystemId(){return this.dto.otherAppSystemId}set otherAppSystemId(e){this.dto.otherAppSystemId=e}get"paging.CurrentPage"(){return this.dto["paging.CurrentPage"]}set"paging.CurrentPage"(e){this.dto["paging.CurrentPage"]=e}get"paging.PageSize"(){return this.dto["paging.PageSize"]}set"paging.PageSize"(e){this.dto["paging.PageSize"]=e}get"paging.IncludeCount"(){return this.dto["paging.IncludeCount"]}set"paging.IncludeCount"(e){this.dto["paging.IncludeCount"]=e}get"paging.NoPaging"(){return this.dto["paging.NoPaging"]}set"paging.NoPaging"(e){this.dto["paging.NoPaging"]=e}transformFromQuery(e){const t={};let i;Object.keys(e).forEach(i=>
1{t[i.toLowerCase()]=e[i]}),i=Number.parseFloat(t.appsystemid),i=Number.isNaN(i)?void 0:i,this.dto.appSystemId=i,this.dto.fieldId=t.fieldid,this.dto.fieldValue=t.fieldvalue,i=Number.parseFloat(t.otherappsystemid),i=Number.isNaN(i)?void 0:i,this.dto.otherAppSystemId=i,i=Number.parseFloat(t["paging.currentpage"]),i=Number.isNaN(i)?void 0:i,this.dto["paging.CurrentPage"]=i,i=Number.parseFloat(t["paging.pagesize"]),i=Number.isNaN(i)?void 0:i,this.dto["paging.PageSize"]=i,i="true"===t["paging.IncludeCount"]||t["paging.includecount"],i="false"!==t["paging.IncludeCount"]&&void 0,this.dto["paging.IncludeCount"]=i,i="true"===t["paging.NoPaging"]||t["paging.nopaging"],i="false"!==t["paging.NoPaging"]&&void 0,this.dto["paging.NoPaging"]=i}}class d extends p{}var l=s.A.extend({auth:!0,role:["admin","hostadmin"],layout:"layout-hostadmin",data:()=>({customFieldsLookup:{},isLoadingEntry:!1,isLoadingFields:!1,responseError:void 0,isAppSystemsLoading:!1,getAppSystemsError:void 0,pagination:{},filter:{appSystemId:void 0,otherAppSystemId:void 0},innerPagination:{"paging.CurrentPage":void 0,"paging.PageSize":void 0,"paging.IncludeCount":void 0,"paging.NoPaging":void 0},list:[],columns:[],appSystems:[]}),computed:{request(){return(new d).fromModel(Object.assign(Object.assign({},this.filter),this.innerPagination))},appSystemsWithFields(){return this.appSystems.filter(e=>{var t;return(null===(t=this.customFieldsLookup[e.id])||void 0===t?void 0:t.length)>0})},queryAppSystemId(){return s.A.$router.currentRoute.query.appSystemId},queryOtherAppSystemId(){return s.A.$router.currentRoute.query.otherAppSystemId}},watch:{filter:{deep:!0,handler(){this.$debounce(()=>{this.pagination.currentPage=1,this.innerPagination["paging.CurrentPage"]=1,this.refresh()},300,this)()}},request(){this.writeRequestToQuery()}},beforeMount(){this.getQueryFromRequest(),this.pagination.currentPage=this.innerPagination["paging.CurrentPage"],this.pagination.pageSize=this.innerPagination["paging.PageSize"]},async mounted(){this.columns=[{value:"",textAlign:"left",field:"icon"},{value:this.$t("core.page.fieldmapping.properties.id"),textAlign:"left",field:"id"},{value:this.$t("core.page.fieldmapping.properties.appSystem1Id"),textAlign:"left",field:"appSystem1Id",format:this.getAppSystemCaption},{value:this.$t("core.page.fieldmapping.properties.field1Id"),textAlign:"left",field:"field1Id"},{value:this.$t("core.page.fieldmapping.properties.field1Value"),textAlign:"left",field:"field1Value"},{value:this.$t("core.page.fieldmapping.properties.appSystem2Id"),textAlign:"left",field:"appSystem2Id",format:this.getAppSystemCaption},{value:this.$t("core.page.fieldmapping.properties.field2Id"),textAlign:"left",field:"field2Id"},{value:this.$t("core.page.fieldmapping.properties.field2Value"),textAlign:"left",field:"field2Value"}],await this.getAppSystems(),await this.getCustomFields()},methods:{getQueryFromRequest(){const e=new d;e.fromQuery(this.$routerUtils.getQueryParams()),this.filter.appSystemId=e.appSystemId,this.filter.otherAppSystemId=e.otherAppSystemId,this.innerPagination["paging.CurrentPage"]=e["paging.CurrentPage"],this.innerPagination["paging.PageSize"]=e["paging.PageSize"],this.innerPagination["paging.IncludeCount"]=e["paging.IncludeCount"],this.innerPagination["paging.NoPaging"]=e["paging.NoPaging"]},async writeRequestToQuery(){this.$debounce(()=>{this.$routerUtils.updateQueryParams(this.request.toQuery(),{preserve:!1})},200,this.writeRequestToQuery)()},getCanSave(e){var t,i,a,n;return(null===(t=e.appSystem1Id)||void 0===t?void 0:t.value)&&(null===(i=e.field1Id)||void 0===i?void 0:i.value)&&(null===(a=e.appSystem2Id)||void 0===a?void 0:a.value)&&(null===(n=e.field2Id)||void 0===n?void 0:n.value)},getCustomFieldCaption(e,t){var i;let a=[];return Object.keys(this.customFieldsLookup).forEach(e=>{a=a.concat(this.customFieldsLookup[e])}),null===(i=a.find(i=>i.id===e&&i.appSystemId===t))||void 0===i?void 0:i.caption},async getCustomFields(){this.isLoadingFields=!0;const e=[];this.appSystems.forEach(t=>{if(t.id){const i=this.$service.v1.api.core.appSystem.getAppSystemCustomFields(t.id);e.push(i)}});const t=await Promise.allSettled(e);t.forEach((e,t)=>{var i;if("fulfilled"===e.status){const{value:i}=e;this.$set(this.customFieldsLookup,this.appSystems[t].id,i.items)}else 404!==(null===(i=e.reason)||void 0===i?void 0:i.status)&&(this.responseError=e.reason,this.$log.error(e.reason))}),this.isLoadingFields=!1},onRowDoubleClick(e){e.editMode=!0},addNewEntry(){this.list.unshift(new o.A),this.$nextTick(()=>{this.list[0].editMode=!0})},async deleteEntry(e,t){var i;
1const a=null===(i=e.id)||void 0===i?void 0:i.value,n=await this.$dialog.confirm(this.$t("core.page.fieldmapping.deleteMappingConfirmation.title"),this.$t("core.page.fieldmapping.deleteMappingConfirmation.message"));if(n)try{await this.$service.api.core.fieldMapping.deleteCampaignFieldMapping(a),this.list.splice(t,1)}catch(s){this.responseError=s}},async saveEdit(e){var t;this.isLoadingEntry=!0;const i=(new o.A).fromDTO(e.values),a=null===(t=e.id)||void 0===t?void 0:t.value;try{if(void 0===a){const t=await this.$service.api.core.fieldMapping.createCampaignFieldMapping(i);e.id={},e.id.value=t}else await this.$service.api.core.fieldMapping.updateCampaignFieldMapping(a,i);e.editMode=!1}catch(n){this.responseError=n}this.isLoadingEntry=!1},cancelEdit(e,t){var i;const a=void 0===(null===(i=e.id)||void 0===i?void 0:i.value);a?this.list.splice(t,1):e.editMode=!1},refresh(){const e=this.$refs.mappingList;null===e||void 0===e||e.populateList()},populateData(e){return this.innerPagination["paging.CurrentPage"]=e.query["paging.CurrentPage"],this.innerPagination["paging.PageSize"]=e.query["paging.PageSize"],this.innerPagination["paging.IncludeCount"]=e.query["paging.IncludeCount"],this.innerPagination["paging.NoPaging"]=e.query["paging.NoPaging"],this.$service.api.core.fieldMapping.getCampaignFieldMappings(this.request)},async getAppSystems(){var e;this.isAppSystemsLoading=!0;try{const e=await this.$service.v1.api.core.appSystem.getAppSystem();this.appSystems=e.items}catch(t){this.getAppSystemsError=null!==(e=null===t||void 0===t?void 0:t.message)&&void 0!==e?e:t}this.isAppSystemsLoading=!1},getAppSystemCaption(e){var t;return null===(t=this.appSystems.find(t=>t.id===e))||void 0===t?void 0:t.caption}}}),g=l,u=i(1656),c=(0,u.A)(g,a,n,!1,null,null,null),m=c.exports}}]); 2//# sourceMappingURL=2774.4eaabd80.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.