diff --git a/src/frontend/sorted_en.json b/src/frontend/sorted_en.json new file mode 100644 index 000000000..e69de29bb diff --git a/src/frontend/src/assets/locales/en.json b/src/frontend/src/assets/locales/en.json index 647de33f2..988bc2f7e 100644 --- a/src/frontend/src/assets/locales/en.json +++ b/src/frontend/src/assets/locales/en.json @@ -150,8 +150,10 @@ "customerList": "Customer List", "deferredDebt": "Deferred Debt", "deferredPayment": "Deferred Payment", - "deleteAgent": "Delete Agent | Agent Deleted Successfully | Agent Updated Successfully | I confirm that {name} will be deleted", "deleteAgentCommission": "Delete Agent Commission | I confirm that {commissionName} will be deleted ", + "deleteAgentConfirm": "I confirm that {name} will be deleted", + "deleteAgentSuccess": "Agent Deleted Successfully", + "deleteAgentTitle": "Delete Agent", "deleteAppliance": "Delete Appliance", "deleteAssetType": "Delete Asset Type | Asset Type Deleted Successfully | Are you sure to delete the asset type ? | Asset Type Updated Successfully", "deleteCustomer": "Delete Customer | Customer Deleted Successfully", @@ -360,6 +362,7 @@ "transactionReference": "Transaction Reference", "untraceableTransaction": "Untraceable transaction", "updateAddress": "Update Address", + "updateAgentSuccess": "Agent Updated Successfully", "userForOutsourcing": "User for Outsourcing", "userId": "User ID", "userList": "User List", @@ -483,6 +486,7 @@ "no": "No", "notice": "Notice", "offline": "Offline", + "ok": "OK", "online": "Online", "open": "Open | Opened", "outgoing": "Outgoing", diff --git a/src/frontend/src/modules/Agent/AgentDetail.vue b/src/frontend/src/modules/Agent/AgentDetail.vue index 1900c5b87..7c4a08082 100644 --- a/src/frontend/src/modules/Agent/AgentDetail.vue +++ b/src/frontend/src/modules/Agent/AgentDetail.vue @@ -6,6 +6,19 @@ button-icon="delete" @widgetAction="confirmDelete" > +
+ +
@@ -186,11 +199,11 @@ import { AgentService } from "@/services/AgentService" import { AgentCommissionService } from "@/services/AgentCommissionService" import { EventBus } from "@/shared/eventbus" import { notify } from "@/mixins/notify" - +import ConfirmationBox from "@/shared/ConfirmationBox.vue" export default { name: "AgentDetail", mixins: [notify], - components: { Widget }, + components: { Widget, ConfirmationBox }, data() { return { agentService: new AgentService(), @@ -233,38 +246,17 @@ export default { this.alertNotify("error", e.message) } }, - confirmDelete() { - this.$swal({ - type: "question", - title: this.$tc("phrases.deleteAgent"), - width: "35%", - confirmButtonText: this.$tc("words.confirm"), - showCancelButton: true, - cancelButtonText: this.$tc("words.cancel"), - focusCancel: true, - html: - '
' + - " " + - "
", - }).then((result) => { - let answer = document.getElementById("confirmation").checked - if ("value" in result) { - if (answer) { - this.deleteAgent() - } - } - }) + async confirmDelete() { + const result = await this.$refs.deleteDialog.show() + if (result.confirmed && result.checked) { + await this.deleteAgent() + } }, async updateAgent() { try { this.loading = true await this.agentService.updateAgent(this.agent) - this.alertNotify("success", this.$tc("phrases.deleteAgent", 2)) + this.alertNotify("success", this.$t("phrases.updateAgentSuccess")) this.loading = false this.editAgent = false } catch (e) { @@ -275,9 +267,10 @@ export default { async deleteAgent() { try { await this.agentService.deleteAgent(this.agent) - this.alertNotify("success", this.$tc("phrases.deleteAgent", 1)) + this.alertNotify("success", this.$t("phrases.deleteAgentSuccess")) window.history.back() } catch (e) { + console.log(e) this.alertNotify("error", e.message) } }, diff --git a/src/frontend/src/modules/Agent/Commission/AgentCommissionList.vue b/src/frontend/src/modules/Agent/Commission/AgentCommissionList.vue index 263e1cab7..c2ee534c0 100644 --- a/src/frontend/src/modules/Agent/Commission/AgentCommissionList.vue +++ b/src/frontend/src/modules/Agent/Commission/AgentCommissionList.vue @@ -10,6 +10,20 @@ color="green" :subscriber="subscriber" > +
+ +
@@ -166,15 +180,19 @@
+ + diff --git a/src/frontend/src/shared/ConfirmationBox.vue b/src/frontend/src/shared/ConfirmationBox.vue index a8ed16d24..5901e4fc4 100644 --- a/src/frontend/src/shared/ConfirmationBox.vue +++ b/src/frontend/src/shared/ConfirmationBox.vue @@ -1,41 +1,107 @@ - - diff --git a/src/frontend/src/shared/PasswordProtection.vue b/src/frontend/src/shared/PasswordProtection.vue index 4d72a2d0e..a1715a577 100644 --- a/src/frontend/src/shared/PasswordProtection.vue +++ b/src/frontend/src/shared/PasswordProtection.vue @@ -1,13 +1,38 @@