From 26daa95f4ce61eb5850ed799269e630906569d8d Mon Sep 17 00:00:00 2001 From: Lucas Martins Date: Wed, 2 Oct 2024 15:25:02 -0300 Subject: [PATCH 1/2] Fix updateTemplatePermission UI in non-english language --- ui/public/locales/pt_BR.json | 4 ++-- ui/src/views/image/UpdateTemplateIsoPermissions.vue | 10 +++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ui/public/locales/pt_BR.json b/ui/public/locales/pt_BR.json index f02aee747eb8..6955d83a510e 100644 --- a/ui/public/locales/pt_BR.json +++ b/ui/public/locales/pt_BR.json @@ -1482,8 +1482,8 @@ "label.setting": "Configura\u00e7\u00e3o", "label.settings": "Configura\u00e7\u00f5es", "label.setup": "Configura\u00e7\u00e3o", -"label.shared": "Compatilhado", -"label.sharedexecutable": "Compatilhado", +"label.shared": "Compartilhado", +"label.sharedexecutable": "Compartilhado", "label.sharedmountpoint": "SharedMountPoint", "label.sharedrouterip": "Endere\u00e7os IPv4 para o roteador dentro da rede compartilhada", "label.sharedrouteripv6": "Endere\u00e7os IPv6 para o roteador dentro da rede compartilhada", diff --git a/ui/src/views/image/UpdateTemplateIsoPermissions.vue b/ui/src/views/image/UpdateTemplateIsoPermissions.vue index c7b0f9e5cf19..b617db6faf4d 100644 --- a/ui/src/views/image/UpdateTemplateIsoPermissions.vue +++ b/ui/src/views/image/UpdateTemplateIsoPermissions.vue @@ -267,6 +267,14 @@ export default { if (this.loading) return let variableKey = '' let variableValue = '' + let operation = '' + if (this.selectedOperation === this.$t('label.add')) { + operation = 'add' + } else if (this.selectedOperation === this.$t('label.remove')) { + operation = 'remove' + } else { + operation = 'reset' + } if (this.selectedShareWith === this.$t('label.account')) { variableKey = 'accounts' if (this.showAccountSelect) { @@ -287,7 +295,7 @@ export default { ispublic: this.resource.isPublic, isextractable: this.resource.isExtractable, featured: this.resource.featured, - op: this.selectedOperation.toLowerCase() + op: operation }).then(response => { this.$notification.success({ message: `${this.$t('label.success.updated')} ${resourceType} ${this.$t('label.permissions')}` From b71d6c59197597201f138a2f2ec585bc533c4f2c Mon Sep 17 00:00:00 2001 From: Lucas Martins Date: Thu, 3 Oct 2024 16:46:56 -0300 Subject: [PATCH 2/2] Improve fix --- .../image/UpdateTemplateIsoPermissions.vue | 28 +++++++------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/ui/src/views/image/UpdateTemplateIsoPermissions.vue b/ui/src/views/image/UpdateTemplateIsoPermissions.vue index b617db6faf4d..557574156b17 100644 --- a/ui/src/views/image/UpdateTemplateIsoPermissions.vue +++ b/ui/src/views/image/UpdateTemplateIsoPermissions.vue @@ -25,7 +25,7 @@

{{ $t('label.operation') }}

- {{ $t('label.add') }} - {{ $t('label.remove') }} - {{ $t('label.reset') }} + {{ $t('label.add') }} + {{ $t('label.remove') }} + {{ $t('label.reset') }} -