Skip to content

Commit

Permalink
PAYOSWXP-139: fix sw 6.5 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
rommelfreddy authored and janteuber committed May 2, 2024
1 parent c33b55c commit cd90fc3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ export default {
watch: {
profiles(profiles) {
this.$emit('update:value', profiles);
this.$emit('input', profiles); // required for SW 6.5.x compatibility
this.$emit('change', profiles); // required for SW 6.5.x compatibility
},
},

Expand Down
2 changes: 1 addition & 1 deletion src/Resources/public/administration/js/payone-payment.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
{% endblock %}
</div>
{% endblock %}
`});var R={};r(R,{default:()=>Qe});var He,Qe,F=i(()=>{L();N();({Utils:He}=Shopware),Qe={template:O,props:{value:{type:Array,required:!1,default(){return[]}},name:{type:String,required:!0}},data(){return{selectedItems:{},newItem:null,showDuplicateAlert:!1,showEmptyAlert:!1,profiles:this.value}},computed:{getLineItemColumns(){return[{property:"shopId",dataIndex:"shopId",label:this.$tc("payone-payment.general.label.shopId"),allowResize:!1,inlineEdit:"string",width:"200px",primary:!0},{property:"currency",dataIndex:"currency",label:this.$tc("payone-payment.general.label.currency"),allowResize:!1,inlineEdit:"string",width:"200px",primary:!0},{property:"error",label:this.$tc("payone-payment.general.label.error"),allowResize:!1,width:"100px",primary:!0}]}},watch:{profiles(e){this.$emit("update:value",e)}},created(){this.createdComponent()},destroyed(){this.destroyedComponent()},methods:{createdComponent(){this.$root.$on("payone-ratepay-profiles-update-result",this.onProfilesUpdateResult)},destroyedComponent(){this.$root.$off("payone-ratepay-profiles-update-result")},onProfilesUpdateResult(e){if(e.updates[this.name]&&(this.profiles=e.updates[this.name]),e.errors[this.name])for(let t of e.errors[this.name])this.profiles.push(t)},onInlineEditCancel(e){e.shopId===""&&e.currency===""&&this.profiles.forEach(function(t,a,n){t.id===e.id&&n.splice(a,1)}),this.$emit("item-cancel")},onInlineEditSave(e){if(e.shopId!==""&&e.currency!==""){this.showEmptyAlert=!1;let t=!1;this.profiles.forEach(function(a){a.id!==e.id&&a.shopId===e.shopId&&(t=!0)}),t?(this.showDuplicateAlert=!0,this.$nextTick(()=>{this.$refs.shopIdsDataGrid.currentInlineEditId=e.id,this.$refs.shopIdsDataGrid.enableInlineEdit()})):this.showDuplicateAlert=!1}else this.showEmptyAlert=!0,this.$nextTick(()=>{this.$refs.shopIdsDataGrid.currentInlineEditId=e.id,this.$refs.shopIdsDataGrid.enableInlineEdit()});this.$emit("update-list",this.profiles)},createNewLineItem(){let e=!1;if(e=this.profiles.length===0,e){this.createLine();return}this.profiles[this.profiles.length-1].shopId!==""&&this.createLine()},createLine(){let e=He.createId();this.profiles.push({id:e,shopId:"",currency:""}),this.$nextTick(()=>{this.$refs.shopIdsDataGrid.currentInlineEditId=e,this.$refs.shopIdsDataGrid.enableInlineEdit()})},onDeleteSelectedItem(e){this.profiles=this.profiles.filter(t=>t.shopId!==e.shopId),this.$emit("deleted",this.profiles)}}}});var q,M=i(()=>{q=`{% block payone_payment %}
`});var R={};r(R,{default:()=>Qe});var He,Qe,F=i(()=>{L();N();({Utils:He}=Shopware),Qe={template:O,props:{value:{type:Array,required:!1,default(){return[]}},name:{type:String,required:!0}},data(){return{selectedItems:{},newItem:null,showDuplicateAlert:!1,showEmptyAlert:!1,profiles:this.value}},computed:{getLineItemColumns(){return[{property:"shopId",dataIndex:"shopId",label:this.$tc("payone-payment.general.label.shopId"),allowResize:!1,inlineEdit:"string",width:"200px",primary:!0},{property:"currency",dataIndex:"currency",label:this.$tc("payone-payment.general.label.currency"),allowResize:!1,inlineEdit:"string",width:"200px",primary:!0},{property:"error",label:this.$tc("payone-payment.general.label.error"),allowResize:!1,width:"100px",primary:!0}]}},watch:{profiles(e){this.$emit("update:value",e),this.$emit("input",e),this.$emit("change",e)}},created(){this.createdComponent()},destroyed(){this.destroyedComponent()},methods:{createdComponent(){this.$root.$on("payone-ratepay-profiles-update-result",this.onProfilesUpdateResult)},destroyedComponent(){this.$root.$off("payone-ratepay-profiles-update-result")},onProfilesUpdateResult(e){if(e.updates[this.name]&&(this.profiles=e.updates[this.name]),e.errors[this.name])for(let t of e.errors[this.name])this.profiles.push(t)},onInlineEditCancel(e){e.shopId===""&&e.currency===""&&this.profiles.forEach(function(t,a,n){t.id===e.id&&n.splice(a,1)}),this.$emit("item-cancel")},onInlineEditSave(e){if(e.shopId!==""&&e.currency!==""){this.showEmptyAlert=!1;let t=!1;this.profiles.forEach(function(a){a.id!==e.id&&a.shopId===e.shopId&&(t=!0)}),t?(this.showDuplicateAlert=!0,this.$nextTick(()=>{this.$refs.shopIdsDataGrid.currentInlineEditId=e.id,this.$refs.shopIdsDataGrid.enableInlineEdit()})):this.showDuplicateAlert=!1}else this.showEmptyAlert=!0,this.$nextTick(()=>{this.$refs.shopIdsDataGrid.currentInlineEditId=e.id,this.$refs.shopIdsDataGrid.enableInlineEdit()});this.$emit("update-list",this.profiles)},createNewLineItem(){let e=!1;if(e=this.profiles.length===0,e){this.createLine();return}this.profiles[this.profiles.length-1].shopId!==""&&this.createLine()},createLine(){let e=He.createId();this.profiles.push({id:e,shopId:"",currency:""}),this.$nextTick(()=>{this.$refs.shopIdsDataGrid.currentInlineEditId=e,this.$refs.shopIdsDataGrid.enableInlineEdit()})},onDeleteSelectedItem(e){this.profiles=this.profiles.filter(t=>t.shopId!==e.shopId),this.$emit("deleted",this.profiles)}}}});var q,M=i(()=>{q=`{% block payone_payment %}
<sw-page class="payone-payment">
{% block payone_payment_header %}
<template #smart-bar-header>
Expand Down

0 comments on commit cd90fc3

Please sign in to comment.