From 6aa691c3da3d2ee18d90f116f1621f0eadf8ea37 Mon Sep 17 00:00:00 2001 From: Imvedansh Date: Tue, 25 Mar 2025 22:14:08 +0530 Subject: [PATCH 01/16] vpc fill gateway and netmask --- ui/src/views/network/VpcTiersTab.vue | 37 ++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/ui/src/views/network/VpcTiersTab.vue b/ui/src/views/network/VpcTiersTab.vue index ad06e3bdf0bd..9d4fd51111aa 100644 --- a/ui/src/views/network/VpcTiersTab.vue +++ b/ui/src/views/network/VpcTiersTab.vue @@ -617,6 +617,43 @@ export default { this.initForm() this.fetchNetworkAclList() this.fetchNetworkOfferings() + const cidr = this.resource.cidr + if (cidr && cidr.includes('/')) { + const [address, maskBits] = cidr.split('/') + this.form.gateway = address + + const prefix = Number(maskBits) + + const subnetMasks = { + 8: '255.0.0.0', + 9: '255.128.0.0', + 10: '255.192.0.0', + 11: '255.224.0.0', + 12: '255.240.0.0', + 13: '255.248.0.0', + 14: '255.252.0.0', + 15: '255.254.0.0', + 16: '255.255.0.0', + 17: '255.255.128.0', + 18: '255.255.192.0', + 19: '255.255.224.0', + 20: '255.255.240.0', + 21: '255.255.248.0', + 22: '255.255.252.0', + 23: '255.255.254.0', + 24: '255.255.255.0', + 25: '255.255.255.128', + 26: '255.255.255.192', + 27: '255.255.255.224', + 28: '255.255.255.240', + 29: '255.255.255.248', + 30: '255.255.255.252', + 31: '255.255.255.254', + 32: '255.255.255.255' + } + + this.form.netmask = subnetMasks[prefix] || '255.255.255.0' + } this.showCreateNetworkModal = true this.rules = { name: [{ required: true, message: this.$t('label.required') }], From 1d7fc2a29069bd05e2d7422516204987b25cf7cb Mon Sep 17 00:00:00 2001 From: Imvedansh Date: Wed, 26 Mar 2025 03:04:21 +0530 Subject: [PATCH 02/16] Suggestion for CIDR in placeholder instead of input --- ui/public/locales/en.json | 4 ++-- ui/src/views/network/VpcTiersTab.vue | 19 ++++++++++++------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/ui/public/locales/en.json b/ui/public/locales/en.json index c1c88da62d30..ede195440acc 100644 --- a/ui/public/locales/en.json +++ b/ui/public/locales/en.json @@ -576,9 +576,9 @@ "label.create.template": "Create Template", "label.create.tier.aclid.description": "The ACL associated with the Network Tier.", "label.create.tier.externalid.description": "ID of the Network in an external system.", -"label.create.tier.gateway.description": "The Network Tier's gateway in the super CIDR range, not overlapping with the CIDR of other Network Tiers in this VPC.", +"label.create.tier.gateway.description": "Gateway in range of VPC CIDR ({value})", "label.create.tier.name.description": "A unique name for the Network Tier.", -"label.create.tier.netmask.description": "The Network Tier's netmask. For example 255.255.255.0", +"label.create.tier.netmask.description": "The Network Tier's netmask. Your current is {value}", "label.create.tier.networkofferingid.description": "The Network offering for the Network Tier.", "label.create.tungsten.routing.policy": "Create Tungsten-Fabric routing policy", "label.create.user": "Create User", diff --git a/ui/src/views/network/VpcTiersTab.vue b/ui/src/views/network/VpcTiersTab.vue index 9d4fd51111aa..85c3532fd795 100644 --- a/ui/src/views/network/VpcTiersTab.vue +++ b/ui/src/views/network/VpcTiersTab.vue @@ -223,18 +223,18 @@ @@ -381,6 +381,8 @@ export default { selectedNetworkOffering: {}, privateMtuMax: 1500, errorPrivateMtu: '', + gatewayPlaceholder: '', + netmaskPlaceholder: '', algorithms: { Source: 'source', 'Round-robin': 'roundrobin', @@ -620,8 +622,6 @@ export default { const cidr = this.resource.cidr if (cidr && cidr.includes('/')) { const [address, maskBits] = cidr.split('/') - this.form.gateway = address - const prefix = Number(maskBits) const subnetMasks = { @@ -652,8 +652,13 @@ export default { 32: '255.255.255.255' } - this.form.netmask = subnetMasks[prefix] || '255.255.255.0' + const cidrValue = `${address}/${maskBits}` + const netmask = subnetMasks[prefix] || '255.255.255.0' + + this.gatewayPlaceholder = this.$t('label.create.tier.gateway.description', { value: cidrValue }) + this.netmaskPlaceholder = this.$t('label.create.tier.netmask.description', { value: netmask }) } + this.showCreateNetworkModal = true this.rules = { name: [{ required: true, message: this.$t('label.required') }], From 217789ee8d39846dfbe3fffbd92fcb997a989001 Mon Sep 17 00:00:00 2001 From: Imvedansh Date: Thu, 27 Mar 2025 01:19:59 +0530 Subject: [PATCH 03/16] netmask placeholder fix --- ui/public/locales/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/public/locales/en.json b/ui/public/locales/en.json index ede195440acc..da614168e82d 100644 --- a/ui/public/locales/en.json +++ b/ui/public/locales/en.json @@ -578,7 +578,7 @@ "label.create.tier.externalid.description": "ID of the Network in an external system.", "label.create.tier.gateway.description": "Gateway in range of VPC CIDR ({value})", "label.create.tier.name.description": "A unique name for the Network Tier.", -"label.create.tier.netmask.description": "The Network Tier's netmask. Your current is {value}", +"label.create.tier.netmask.description": "The Network Tier's netmask. For example {value}", "label.create.tier.networkofferingid.description": "The Network offering for the Network Tier.", "label.create.tungsten.routing.policy": "Create Tungsten-Fabric routing policy", "label.create.user": "Create User", From 873aaa3c841b23229f8ae9ce9ed5eaa42f4cf225 Mon Sep 17 00:00:00 2001 From: Imvedansh Date: Fri, 28 Mar 2025 14:22:21 +0530 Subject: [PATCH 04/16] Abstraction of logic and few minor fixes --- ui/public/locales/en.json | 2 +- ui/src/utils/network.js | 51 ++++++++++++++++++++++++++++ ui/src/views/network/VpcTiersTab.vue | 39 +++------------------ 3 files changed, 56 insertions(+), 36 deletions(-) create mode 100644 ui/src/utils/network.js diff --git a/ui/public/locales/en.json b/ui/public/locales/en.json index da614168e82d..af46ae933e4d 100644 --- a/ui/public/locales/en.json +++ b/ui/public/locales/en.json @@ -576,7 +576,7 @@ "label.create.template": "Create Template", "label.create.tier.aclid.description": "The ACL associated with the Network Tier.", "label.create.tier.externalid.description": "ID of the Network in an external system.", -"label.create.tier.gateway.description": "Gateway in range of VPC CIDR ({value})", +"label.create.tier.gateway.description": "Gateway IP must be within VPC CIDR ({value})", "label.create.tier.name.description": "A unique name for the Network Tier.", "label.create.tier.netmask.description": "The Network Tier's netmask. For example {value}", "label.create.tier.networkofferingid.description": "The Network offering for the Network Tier.", diff --git a/ui/src/utils/network.js b/ui/src/utils/network.js new file mode 100644 index 000000000000..166f77ac428a --- /dev/null +++ b/ui/src/utils/network.js @@ -0,0 +1,51 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +// Parsing CIDR into Gateway,Netmask Placehoolders + +export function getNetmaskFromCidr (cidr) { + if (!cidr?.includes('/')) return undefined + const [, maskBits] = cidr.split('/') + const subnetMasks = { + 8: '255.0.0.0', + 9: '255.128.0.0', + 10: '255.192.0.0', + 11: '255.224.0.0', + 12: '255.240.0.0', + 13: '255.248.0.0', + 14: '255.252.0.0', + 15: '255.254.0.0', + 16: '255.255.0.0', + 17: '255.255.128.0', + 18: '255.255.192.0', + 19: '255.255.224.0', + 20: '255.255.240.0', + 21: '255.255.248.0', + 22: '255.255.252.0', + 23: '255.255.254.0', + 24: '255.255.255.0', + 25: '255.255.255.128', + 26: '255.255.255.192', + 27: '255.255.255.224', + 28: '255.255.255.240', + 29: '255.255.255.248', + 30: '255.255.255.252', + 31: '255.255.255.254', + 32: '255.255.255.255' + } + return subnetMasks[+maskBits] || '255.255.255.0' +} diff --git a/ui/src/views/network/VpcTiersTab.vue b/ui/src/views/network/VpcTiersTab.vue index 85c3532fd795..cd4f719164a1 100644 --- a/ui/src/views/network/VpcTiersTab.vue +++ b/ui/src/views/network/VpcTiersTab.vue @@ -344,6 +344,7 @@ import { api } from '@/api' import { mixinForm } from '@/utils/mixin' import Status from '@/components/widgets/Status' import TooltipLabel from '@/components/widgets/TooltipLabel' +import { getNetmaskFromCidr } from '@/utils/network' export default { name: 'VpcTiersTab', @@ -620,42 +621,10 @@ export default { this.fetchNetworkAclList() this.fetchNetworkOfferings() const cidr = this.resource.cidr - if (cidr && cidr.includes('/')) { - const [address, maskBits] = cidr.split('/') - const prefix = Number(maskBits) + if (cidr?.includes('/')) { + const netmask = getNetmaskFromCidr(cidr) - const subnetMasks = { - 8: '255.0.0.0', - 9: '255.128.0.0', - 10: '255.192.0.0', - 11: '255.224.0.0', - 12: '255.240.0.0', - 13: '255.248.0.0', - 14: '255.252.0.0', - 15: '255.254.0.0', - 16: '255.255.0.0', - 17: '255.255.128.0', - 18: '255.255.192.0', - 19: '255.255.224.0', - 20: '255.255.240.0', - 21: '255.255.248.0', - 22: '255.255.252.0', - 23: '255.255.254.0', - 24: '255.255.255.0', - 25: '255.255.255.128', - 26: '255.255.255.192', - 27: '255.255.255.224', - 28: '255.255.255.240', - 29: '255.255.255.248', - 30: '255.255.255.252', - 31: '255.255.255.254', - 32: '255.255.255.255' - } - - const cidrValue = `${address}/${maskBits}` - const netmask = subnetMasks[prefix] || '255.255.255.0' - - this.gatewayPlaceholder = this.$t('label.create.tier.gateway.description', { value: cidrValue }) + this.gatewayPlaceholder = this.$t('label.create.tier.gateway.description', { value: cidr }) this.netmaskPlaceholder = this.$t('label.create.tier.netmask.description', { value: netmask }) } From d4b11efcffa5877fc49bdbd0a75fac2c2392e80e Mon Sep 17 00:00:00 2001 From: Imvedansh Date: Fri, 28 Mar 2025 14:27:49 +0530 Subject: [PATCH 05/16] Minor fix in network.js --- ui/src/utils/network.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/src/utils/network.js b/ui/src/utils/network.js index 166f77ac428a..c3054f48ff77 100644 --- a/ui/src/utils/network.js +++ b/ui/src/utils/network.js @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. -// Parsing CIDR into Gateway,Netmask Placehoolders +// Parsing CIDR into Gateway,Netmask Placeholders export function getNetmaskFromCidr (cidr) { if (!cidr?.includes('/')) return undefined From 6cd108e16016b78b6bec6beb838f02b67f85a13a Mon Sep 17 00:00:00 2001 From: Imvedansh Date: Fri, 28 Mar 2025 18:31:20 +0530 Subject: [PATCH 06/16] Removed repetitive code in VPCTierTab --- ui/src/views/network/VpcTiersTab.vue | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ui/src/views/network/VpcTiersTab.vue b/ui/src/views/network/VpcTiersTab.vue index cd4f719164a1..85211d41a800 100644 --- a/ui/src/views/network/VpcTiersTab.vue +++ b/ui/src/views/network/VpcTiersTab.vue @@ -621,9 +621,8 @@ export default { this.fetchNetworkAclList() this.fetchNetworkOfferings() const cidr = this.resource.cidr - if (cidr?.includes('/')) { - const netmask = getNetmaskFromCidr(cidr) - + const netmask = getNetmaskFromCidr(cidr) + if (netmask) { this.gatewayPlaceholder = this.$t('label.create.tier.gateway.description', { value: cidr }) this.netmaskPlaceholder = this.$t('label.create.tier.netmask.description', { value: netmask }) } From 60acacf482143bdc09bec4b56e800e6a34ef6733 Mon Sep 17 00:00:00 2001 From: Imvedansh <113465074+Imvedansh@users.noreply.github.com> Date: Fri, 28 Mar 2025 07:52:55 -0700 Subject: [PATCH 07/16] Update ui/public/locales/en.json MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Bernardo De Marco Gonçalves --- ui/public/locales/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/public/locales/en.json b/ui/public/locales/en.json index af46ae933e4d..ea2ab491fb5b 100644 --- a/ui/public/locales/en.json +++ b/ui/public/locales/en.json @@ -578,7 +578,7 @@ "label.create.tier.externalid.description": "ID of the Network in an external system.", "label.create.tier.gateway.description": "Gateway IP must be within VPC CIDR ({value})", "label.create.tier.name.description": "A unique name for the Network Tier.", -"label.create.tier.netmask.description": "The Network Tier's netmask. For example {value}", +"label.create.tier.netmask.description": "Network Tier's netmask must be more restrictive than {value}", "label.create.tier.networkofferingid.description": "The Network offering for the Network Tier.", "label.create.tungsten.routing.policy": "Create Tungsten-Fabric routing policy", "label.create.user": "Create User", From a69a86ad085bf3660b93e7e856e3a87eb7833fac Mon Sep 17 00:00:00 2001 From: Imvedansh Date: Mon, 21 Apr 2025 20:16:31 +0530 Subject: [PATCH 08/16] extra check to delete account --- ui/public/locales/en.json | 8 +- ui/src/config/section/account.js | 6 +- ui/src/views/iam/DeleteAccount.vue | 139 +++++++++++++++++++++++++++++ 3 files changed, 149 insertions(+), 4 deletions(-) create mode 100644 ui/src/views/iam/DeleteAccount.vue diff --git a/ui/public/locales/en.json b/ui/public/locales/en.json index ea2ab491fb5b..703fda5b24ee 100644 --- a/ui/public/locales/en.json +++ b/ui/public/locales/en.json @@ -855,6 +855,7 @@ "label.endipv6": "IPv6 end IP", "label.endpoint": "Endpoint", "label.endport": "End port", +"label.enter.account.name": "Enter the account name", "label.enter.code": "Enter 2FA code to verify", "label.enter.static.pin": "Enter static PIN to verify", "label.enter.token": "Enter token", @@ -2719,7 +2720,11 @@ "message.dedicating.host": "Dedicating host...", "message.dedicating.pod": "Dedicating pod...", "message.dedicating.zone": "Dedicating zone...", -"message.delete.account": "Please confirm that you want to delete this Account.", +"message.delete.account.confirm": "Please confirm that you want to delete this account by entering the name of the account below.", +"message.delete.account.failed": "Delete account failed", +"message.delete.account.processing": "Deleting account", +"message.delete.account.success": "Successfully deleted account", +"message.delete.account.warning": "Deleting this account will delete all of the instances, volumes and snapshots associated with the account.", "message.delete.acl.processing": "Removing ACL rule...", "message.delete.acl.rule": "Remove ACL rule", "message.delete.acl.rule.failed": "Failed to remove ACL rule.", @@ -2806,6 +2811,7 @@ "message.enabling.security.group.provider": "Enabling security group provider", "message.enter.valid.nic.ip": "Please enter a valid IP address for NIC", "message.error.access.key": "Please enter access key.", +"message.error.account.delete.name.mismatch": "Name entered doesn't match the account name.", "message.error.add.guest.network": "Either IPv4 fields or IPv6 fields need to be filled when adding a guest Network.", "message.error.add.interface.static.route": "Adding interface Static Route failed", "message.error.add.logical.router": "Adding Logical Router failed", diff --git a/ui/src/config/section/account.js b/ui/src/config/section/account.js index 28c0e3f556d6..f304566006e7 100644 --- a/ui/src/config/section/account.js +++ b/ui/src/config/section/account.js @@ -225,11 +225,11 @@ export default { message: 'message.delete.account', dataView: true, disabled: (record, store) => { - return record.id !== 'undefined' && store.userInfo.accountid === record.id + return (record.id !== 'undefined' && store.userInfo.accountid === record.id) || record.state !== 'disabled' }, - groupAction: true, + popup: true, - groupMap: (selection) => { return selection.map(x => { return { id: x } }) } + component: shallowRef(defineAsyncComponent(() => import('@/views/iam/DeleteAccount.vue'))) } ] } diff --git a/ui/src/views/iam/DeleteAccount.vue b/ui/src/views/iam/DeleteAccount.vue new file mode 100644 index 000000000000..86bc507ab6ef --- /dev/null +++ b/ui/src/views/iam/DeleteAccount.vue @@ -0,0 +1,139 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + + + + + + From 60c84d16966603170b51fe11e037199dc1efa5ab Mon Sep 17 00:00:00 2001 From: Imvedansh Date: Mon, 21 Apr 2025 20:58:27 +0530 Subject: [PATCH 09/16] extra checks for deleting account --- ui/public/locales/en.json | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/public/locales/en.json b/ui/public/locales/en.json index 703fda5b24ee..64f6d2b9b1a9 100644 --- a/ui/public/locales/en.json +++ b/ui/public/locales/en.json @@ -845,6 +845,7 @@ "label.encrypt": "Encrypt", "label.encryptroot": "Encrypt Root Disk", "label.end": "End", +"label.enter.account.name": "Enter the account name", "label.end.date.and.time": "End date and time", "label.end.ip": "End IP", "label.end.reserved.system.ip": "End reserved system IP", From c6e8e475fddb7c3237968851f3e50fe640d6e351 Mon Sep 17 00:00:00 2001 From: Imvedansh Date: Wed, 23 Apr 2025 23:11:58 +0530 Subject: [PATCH 10/16] Brute commit for warning feature disable account first --- ui/public/locales/en.json | 4 ++ ui/src/config/section/account.js | 5 +- ui/src/views/iam/DeleteAccount.vue | 8 ++- ui/src/views/iam/DeleteAccountWrapper.vue | 74 +++++++++++++++++++++++ 4 files changed, 85 insertions(+), 6 deletions(-) create mode 100644 ui/src/views/iam/DeleteAccountWrapper.vue diff --git a/ui/public/locales/en.json b/ui/public/locales/en.json index 64f6d2b9b1a9..2fd100332778 100644 --- a/ui/public/locales/en.json +++ b/ui/public/locales/en.json @@ -1,4 +1,8 @@ { +"message.delete.account.not.disabled": "First, disable the account to delete it.", +"label": { + "warning": "Warning" +}, "alert.service.domainrouter": "Domain router", "error.dedicate.cluster.failed": "Failed to dedicate cluster.", "error.dedicate.host.failed": "Failed to dedicate host.", diff --git a/ui/src/config/section/account.js b/ui/src/config/section/account.js index f304566006e7..33957e67bed6 100644 --- a/ui/src/config/section/account.js +++ b/ui/src/config/section/account.js @@ -225,11 +225,10 @@ export default { message: 'message.delete.account', dataView: true, disabled: (record, store) => { - return (record.id !== 'undefined' && store.userInfo.accountid === record.id) || record.state !== 'disabled' + return (record.id !== 'undefined' && store.userInfo.accountid === record.id) }, - popup: true, - component: shallowRef(defineAsyncComponent(() => import('@/views/iam/DeleteAccount.vue'))) + component: shallowRef(defineAsyncComponent(() => import('@/views/iam/DeleteAccountWrapper.vue'))) } ] } diff --git a/ui/src/views/iam/DeleteAccount.vue b/ui/src/views/iam/DeleteAccount.vue index 86bc507ab6ef..0d23431d4f8c 100644 --- a/ui/src/views/iam/DeleteAccount.vue +++ b/ui/src/views/iam/DeleteAccount.vue @@ -75,8 +75,7 @@ export default { methods: { initForm () { this.formRef = ref() - this.form = reactive({ - }) + this.form = reactive({}) this.rules = reactive({ name: [{ required: true, message: this.$t('label.required') }] }) @@ -91,6 +90,9 @@ export default { this.error = `${this.$t('message.error.account.delete.name.mismatch')}` return } + if (this.hasActiveResources) { + return + } api('deleteAccount', { id: this.resource.id }).then(response => { @@ -136,4 +138,4 @@ export default { color: red; margin-top: 10px; } - + \ No newline at end of file diff --git a/ui/src/views/iam/DeleteAccountWrapper.vue b/ui/src/views/iam/DeleteAccountWrapper.vue new file mode 100644 index 000000000000..2c6a07ca3c64 --- /dev/null +++ b/ui/src/views/iam/DeleteAccountWrapper.vue @@ -0,0 +1,74 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + + + + + + From 52a923355b30b15352de58da9c5a7d6895c970ee Mon Sep 17 00:00:00 2001 From: Imvedansh Date: Thu, 24 Apr 2025 00:02:22 +0530 Subject: [PATCH 11/16] Code Quality improved --- ui/src/config/section/account.js | 2 +- ui/src/views/iam/DeleteAccount.vue | 108 ++++++++++++++++++----------- 2 files changed, 70 insertions(+), 40 deletions(-) diff --git a/ui/src/config/section/account.js b/ui/src/config/section/account.js index 33957e67bed6..115da9522d0c 100644 --- a/ui/src/config/section/account.js +++ b/ui/src/config/section/account.js @@ -228,7 +228,7 @@ export default { return (record.id !== 'undefined' && store.userInfo.accountid === record.id) }, popup: true, - component: shallowRef(defineAsyncComponent(() => import('@/views/iam/DeleteAccountWrapper.vue'))) + component: shallowRef(defineAsyncComponent(() => import('@/views/iam/DeleteAccount.vue'))) } ] } diff --git a/ui/src/views/iam/DeleteAccount.vue b/ui/src/views/iam/DeleteAccount.vue index 0d23431d4f8c..32a8117bcd48 100644 --- a/ui/src/views/iam/DeleteAccount.vue +++ b/ui/src/views/iam/DeleteAccount.vue @@ -16,46 +16,64 @@ // under the License. - - From a730e03efc09957428bdca653ea6d82880d46b5b Mon Sep 17 00:00:00 2001 From: Imvedansh Date: Thu, 24 Apr 2025 00:31:38 +0530 Subject: [PATCH 13/16] New file DAW.vue added --- ui/src/config/section/account.js | 2 +- ui/src/views/iam/DeleteAccount.vue | 106 ++++++++-------------- ui/src/views/iam/DeleteAccountWrapper.vue | 74 +++++++++++++++ 3 files changed, 113 insertions(+), 69 deletions(-) create mode 100644 ui/src/views/iam/DeleteAccountWrapper.vue diff --git a/ui/src/config/section/account.js b/ui/src/config/section/account.js index 115da9522d0c..33957e67bed6 100644 --- a/ui/src/config/section/account.js +++ b/ui/src/config/section/account.js @@ -228,7 +228,7 @@ export default { return (record.id !== 'undefined' && store.userInfo.accountid === record.id) }, popup: true, - component: shallowRef(defineAsyncComponent(() => import('@/views/iam/DeleteAccount.vue'))) + component: shallowRef(defineAsyncComponent(() => import('@/views/iam/DeleteAccountWrapper.vue'))) } ] } diff --git a/ui/src/views/iam/DeleteAccount.vue b/ui/src/views/iam/DeleteAccount.vue index 32a8117bcd48..e5aa33001f9d 100644 --- a/ui/src/views/iam/DeleteAccount.vue +++ b/ui/src/views/iam/DeleteAccount.vue @@ -16,64 +16,46 @@ // under the License. + + From 422bcc052be95cac1e7c586675ec637d9da9622c Mon Sep 17 00:00:00 2001 From: Imvedansh Date: Thu, 24 Apr 2025 00:50:15 +0530 Subject: [PATCH 14/16] removed duplication in en.json --- ui/public/locales/en.json | 1 - 1 file changed, 1 deletion(-) diff --git a/ui/public/locales/en.json b/ui/public/locales/en.json index 2fd100332778..cf12d8c53738 100644 --- a/ui/public/locales/en.json +++ b/ui/public/locales/en.json @@ -849,7 +849,6 @@ "label.encrypt": "Encrypt", "label.encryptroot": "Encrypt Root Disk", "label.end": "End", -"label.enter.account.name": "Enter the account name", "label.end.date.and.time": "End date and time", "label.end.ip": "End IP", "label.end.reserved.system.ip": "End reserved system IP", From 99c17e9b871089e090dfb08ce774bc76de5e177e Mon Sep 17 00:00:00 2001 From: Imvedansh <113465074+Imvedansh@users.noreply.github.com> Date: Sat, 26 Apr 2025 08:56:44 -0700 Subject: [PATCH 15/16] Update ui/public/locales/en.json MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Bernardo De Marco Gonçalves --- ui/public/locales/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/public/locales/en.json b/ui/public/locales/en.json index cf12d8c53738..95beca5634a3 100644 --- a/ui/public/locales/en.json +++ b/ui/public/locales/en.json @@ -1,5 +1,5 @@ { -"message.delete.account.not.disabled": "First, disable the account to delete it.", +"message.delete.account.not.disabled": "Please disable the account before attempting to delete it.", "label": { "warning": "Warning" }, From 1d3e37493f4fd6f53f1175eba1c69145e5d4324a Mon Sep 17 00:00:00 2001 From: Imvedansh Date: Thu, 1 May 2025 00:04:46 +0530 Subject: [PATCH 16/16] Suggested fixes --- ui/public/locales/en.json | 3 -- ui/src/config/section/account.js | 2 +- ui/src/views/iam/DeleteAccount.vue | 67 +++++++++++++++++++++++------- 3 files changed, 52 insertions(+), 20 deletions(-) diff --git a/ui/public/locales/en.json b/ui/public/locales/en.json index 60079f28aaa8..f4a8f59017e0 100644 --- a/ui/public/locales/en.json +++ b/ui/public/locales/en.json @@ -1,8 +1,5 @@ { "message.delete.account.not.disabled": "Please disable the account before attempting to delete it.", -"label": { - "warning": "Warning" -}, "alert.service.domainrouter": "Domain router", "error.dedicate.cluster.failed": "Failed to dedicate cluster.", "error.dedicate.host.failed": "Failed to dedicate host.", diff --git a/ui/src/config/section/account.js b/ui/src/config/section/account.js index 33957e67bed6..bdd717386603 100644 --- a/ui/src/config/section/account.js +++ b/ui/src/config/section/account.js @@ -225,7 +225,7 @@ export default { message: 'message.delete.account', dataView: true, disabled: (record, store) => { - return (record.id !== 'undefined' && store.userInfo.accountid === record.id) + return store.userInfo.accountid === record?.id }, popup: true, component: shallowRef(defineAsyncComponent(() => import('@/views/iam/DeleteAccountWrapper.vue'))) diff --git a/ui/src/views/iam/DeleteAccount.vue b/ui/src/views/iam/DeleteAccount.vue index e5aa33001f9d..0e7c6139e4cc 100644 --- a/ui/src/views/iam/DeleteAccount.vue +++ b/ui/src/views/iam/DeleteAccount.vue @@ -56,6 +56,7 @@