Skip to content

Commit

Permalink
Fix updateTemplatePermission when the UI is set to a language other…
Browse files Browse the repository at this point in the history
… than English (#9766)

* Fix updateTemplatePermission UI in non-english language

* Improve fix

---------

Co-authored-by: Lucas Martins <[email protected]>
  • Loading branch information
lucas-a-martins and Lucas Martins authored Oct 4, 2024
1 parent c087de4 commit d6181d5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions ui/public/locales/pt_BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
18 changes: 9 additions & 9 deletions ui/src/views/image/UpdateTemplateIsoPermissions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,21 @@
<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
optionFilterProp="value"
: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>
Expand Down Expand Up @@ -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,
Expand All @@ -163,15 +163,15 @@ 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
},
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
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit d6181d5

Please sign in to comment.