-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* format code * PAYOSWXP-131: implement acl
- Loading branch information
1 parent
dc3533d
commit 470a22c
Showing
18 changed files
with
175 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 35 additions & 25 deletions
60
src/Resources/app/administration/src/module/sw-order/page/sw-order-detail/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,47 @@ | ||
import template from './sw-order-detail.html.twig'; | ||
|
||
export default { | ||
template, | ||
template, | ||
|
||
methods: { | ||
hasPayoneTransaction(order) { | ||
let me = this; | ||
let isPayone = false; | ||
inject: ['acl'], | ||
|
||
if (!order.transactions) { | ||
return false; | ||
} | ||
methods: { | ||
hasPayoneTransaction(order) { | ||
let me = this; | ||
let isPayone = false; | ||
|
||
order.transactions.map(function(transaction) { | ||
if (me.isPayoneTransaction(transaction) && me.isActiveTransaction(transaction)) { | ||
isPayone = true; | ||
} | ||
}); | ||
if (!order.transactions) { | ||
return false; | ||
} | ||
|
||
order.transactions.map(function (transaction) { | ||
if (me.isPayoneTransaction(transaction) && me.isActiveTransaction(transaction)) { | ||
isPayone = true; | ||
} | ||
}); | ||
|
||
|
||
return isPayone; | ||
}, | ||
return isPayone; | ||
}, | ||
|
||
isPayoneTransaction(transaction) { | ||
if (!transaction.extensions || !transaction.extensions.payonePaymentOrderTransactionData || !transaction.extensions.payonePaymentOrderTransactionData.transactionId) { | ||
return false; | ||
} | ||
isPayoneTransaction(transaction) { | ||
if (!transaction.extensions || !transaction.extensions.payonePaymentOrderTransactionData || !transaction.extensions.payonePaymentOrderTransactionData.transactionId) { | ||
return false; | ||
} | ||
|
||
return transaction.extensions.payonePaymentOrderTransactionData.transactionId; | ||
}, | ||
return transaction.extensions.payonePaymentOrderTransactionData.transactionId; | ||
}, | ||
|
||
isActiveTransaction(transaction) { | ||
return transaction.stateMachineState.technicalName !== 'cancelled'; | ||
}, | ||
} | ||
isActiveTransaction(transaction) { | ||
return transaction.stateMachineState.technicalName !== 'cancelled'; | ||
}, | ||
|
||
canAccessPayoneTab() { | ||
return (this.acl.can('payone_order_management') | ||
|| this.acl.can('payone_payment_order_action_log:read') | ||
|| this.acl.can('payone_payment_notification_forward:read') | ||
|| this.acl.can('payone_payment_webhook_log:read')) | ||
&& this.order && this.hasPayoneTransaction(this.order); | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.