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.setting": "Configura\u00e7\u00e3o",
"label.settings": "Configura\u00e7\u00f5es", "label.settings": "Configura\u00e7\u00f5es",
"label.setup": "Configura\u00e7\u00e3o", "label.setup": "Configura\u00e7\u00e3o",
"label.shared": "Compatilhado", "label.shared": "Compartilhado",
"label.sharedexecutable": "Compatilhado", "label.sharedexecutable": "Compartilhado",
"label.sharedmountpoint": "SharedMountPoint", "label.sharedmountpoint": "SharedMountPoint",
"label.sharedrouterip": "Endere\u00e7os IPv4 para o roteador dentro da rede compartilhada", "label.sharedrouterip": "Endere\u00e7os IPv4 para o roteador dentro da rede compartilhada",
"label.sharedrouteripv6": "Endere\u00e7os IPv6 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> <p class="form__label">{{ $t('label.operation') }}</p>
<a-select <a-select
v-model:value="selectedOperation" v-model:value="selectedOperation"
:defaultValue="$t('label.add')" :defaultValue="'add'"
@change="fetchData" @change="fetchData"
v-focus="true" v-focus="true"
showSearch showSearch
@ -33,13 +33,13 @@
:filterOption="(input, option) => { :filterOption="(input, option) => {
return option.value.toLowerCase().indexOf(input.toLowerCase()) >= 0 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="'add'">{{ $t('label.add') }}</a-select-option>
<a-select-option :value="$t('label.remove')">{{ $t('label.remove') }}</a-select-option> <a-select-option :value="'remove'">{{ $t('label.remove') }}</a-select-option>
<a-select-option :value="$t('label.reset')">{{ $t('label.reset') }}</a-select-option> <a-select-option :value="'reset'">{{ $t('label.reset') }}</a-select-option>
</a-select> </a-select>
</div> </div>
<template v-if="selectedOperation !== $t('label.reset')"> <template v-if="selectedOperation !== 'reset'">
<div class="form__item"> <div class="form__item">
<p class="form__label"> <p class="form__label">
<span class="required">*</span> <span class="required">*</span>
@ -150,7 +150,7 @@ export default {
selectedAccounts: [], selectedAccounts: [],
selectedProjects: [], selectedProjects: [],
selectedAccountsList: '', selectedAccountsList: '',
selectedOperation: this.$t('label.add'), selectedOperation: 'add',
selectedShareWith: this.$t('label.account'), selectedShareWith: this.$t('label.account'),
accountError: false, accountError: false,
projectError: false, projectError: false,
@ -163,7 +163,7 @@ export default {
accountsList () { accountsList () {
return this.accounts.length > 0 ? this.accounts return this.accounts.length > 0 ? this.accounts
.filter(a => .filter(a =>
this.selectedOperation === this.$t('label.add') this.selectedOperation === 'add'
? !this.permittedAccounts.includes(a.name) ? !this.permittedAccounts.includes(a.name)
: this.permittedAccounts.includes(a.name) : this.permittedAccounts.includes(a.name)
) : this.accounts ) : this.accounts
@ -171,7 +171,7 @@ export default {
projectsList () { projectsList () {
return this.projects > 0 ? this.projects return this.projects > 0 ? this.projects
.filter(p => .filter(p =>
this.selectedOperation === this.$t('label.add') this.selectedOperation === 'add'
? !this.permittedProjects.includes(p.id) ? !this.permittedProjects.includes(p.id)
: this.permittedProjects.includes(p.id) : this.permittedProjects.includes(p.id)
) : this.projects ) : this.projects
@ -252,7 +252,7 @@ export default {
}) })
}, },
handleChange (selectedItems) { 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')) { if (this.selectedShareWith === this.$t('label.account')) {
this.selectedAccounts = selectedItems this.selectedAccounts = selectedItems
} else { } else {