Fix updateTemplatePermission when the UI is set to a language other than English (#9766)

* Fix updateTemplatePermission UI in non-english language

* Improve fix

---------

Co-authored-by: Lucas Martins <lucas.martins@scclouds.com.br>
This commit is contained in:
Lucas Martins 2024-10-04 16:41:30 -03:00 committed by Wei Zhou
parent bcc81799ea
commit c0add074ac
No known key found for this signature in database
GPG Key ID: 1503DFE7C8226103
2 changed files with 11 additions and 11 deletions

View File

@ -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",

View File

@ -25,7 +25,7 @@
<p class="form__label">{{ $t('label.operation') }}</p>
<a-select
v-model:value="selectedOperation"
:defaultValue="$t('label.add')"
:defaultValue="'add'"
@change="fetchData"
v-focus="true"
showSearch
@ -33,13 +33,13 @@
:filterOption="(input, option) => {
return option.value.toLowerCase().indexOf(input.toLowerCase()) >= 0
}" >
<a-select-option :value="$t('label.add')">{{ $t('label.add') }}</a-select-option>
<a-select-option :value="$t('label.remove')">{{ $t('label.remove') }}</a-select-option>
<a-select-option :value="$t('label.reset')">{{ $t('label.reset') }}</a-select-option>
<a-select-option :value="'add'">{{ $t('label.add') }}</a-select-option>
<a-select-option :value="'remove'">{{ $t('label.remove') }}</a-select-option>
<a-select-option :value="'reset'">{{ $t('label.reset') }}</a-select-option>
</a-select>
</div>
<template v-if="selectedOperation !== $t('label.reset')">
<template v-if="selectedOperation !== 'reset'">
<div class="form__item">
<p class="form__label">
<span class="required">*</span>
@ -150,7 +150,7 @@ export default {
selectedAccounts: [],
selectedProjects: [],
selectedAccountsList: '',
selectedOperation: this.$t('label.add'),
selectedOperation: 'add',
selectedShareWith: this.$t('label.account'),
accountError: false,
projectError: false,
@ -163,7 +163,7 @@ export default {
accountsList () {
return this.accounts.length > 0 ? this.accounts
.filter(a =>
this.selectedOperation === this.$t('label.add')
this.selectedOperation === 'add'
? !this.permittedAccounts.includes(a.name)
: this.permittedAccounts.includes(a.name)
) : this.accounts
@ -171,7 +171,7 @@ export default {
projectsList () {
return this.projects > 0 ? this.projects
.filter(p =>
this.selectedOperation === this.$t('label.add')
this.selectedOperation === 'add'
? !this.permittedProjects.includes(p.id)
: this.permittedProjects.includes(p.id)
) : this.projects
@ -252,7 +252,7 @@ export default {
})
},
handleChange (selectedItems) {
if (this.selectedOperation === this.$t('label.add') || this.selectedOperation === this.$t('label.remove')) {
if (this.selectedOperation === 'add' || this.selectedOperation === 'remove') {
if (this.selectedShareWith === this.$t('label.account')) {
this.selectedAccounts = selectedItems
} else {