Update ownership selection component to be language independent (#10052)

This commit is contained in:
Bryan Lima 2024-12-27 06:34:51 -03:00 committed by GitHub
parent 330ed25a6c
commit 32af4a25d0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 15 additions and 15 deletions

View File

@ -2312,14 +2312,14 @@ export default {
domainid: store.getters.userInfo.domainid,
account: store.getters.userInfo.account
}
if (OwnerOptions.selectedAccountType === this.$t('label.account')) {
if (OwnerOptions.selectedAccountType === 'Account') {
if (!OwnerOptions.selectedAccount) {
return
}
this.owner.account = OwnerOptions.selectedAccount
this.owner.domainid = OwnerOptions.selectedDomain
this.owner.projectid = null
} else if (OwnerOptions.selectedAccountType === this.$t('label.project')) {
} else if (OwnerOptions.selectedAccountType === 'Project') {
if (!OwnerOptions.selectedProject) {
return
}

View File

@ -31,8 +31,8 @@
}
"
>
<a-select-option :value="$t('label.account')">{{ $t('label.account') }}</a-select-option>
<a-select-option :value="$t('label.project')">{{ $t('label.project') }}</a-select-option>
<a-select-option :value="'Account'">{{ $t('label.account') }}</a-select-option>
<a-select-option :value="'Project'">{{ $t('label.project') }}</a-select-option>
</a-select>
</a-form-item>
<a-form-item :label="$t('label.domain')" required>
@ -67,7 +67,7 @@
</a-select>
</a-form-item>
<template v-if="selectedAccountType === $t('label.account')">
<template v-if="selectedAccountType === 'Account'">
<a-form-item :label="$t('label.account')" required>
<a-select
@change="emitChangeEvent"
@ -139,7 +139,7 @@ export default {
domains: [],
accounts: [],
projects: [],
selectedAccountType: this.$store.getters.project?.id ? this.$t('label.project') : this.$t('label.account'),
selectedAccountType: this.$store.getters.project?.id ? 'Project' : 'Account',
selectedDomain: null,
selectedAccount: null,
selectedProject: null,
@ -243,7 +243,7 @@ export default {
})
},
changeDomain () {
if (this.selectedAccountType === this.$t('label.account')) {
if (this.selectedAccountType === 'Account') {
this.fetchAccounts()
} else {
this.fetchProjects()

View File

@ -492,14 +492,14 @@ export default {
domainid: this.$store.getters.userInfo.domainid,
account: this.$store.getters.userInfo.account
}
if (OwnerOptions.selectedAccountType === this.$t('label.account')) {
if (OwnerOptions.selectedAccountType === 'Account') {
if (!OwnerOptions.selectedAccount) {
return
}
this.owner.account = OwnerOptions.selectedAccount
this.owner.domainid = OwnerOptions.selectedDomain
this.owner.projectid = null
} else if (OwnerOptions.selectedAccountType === this.$t('label.project')) {
} else if (OwnerOptions.selectedAccountType === 'Project') {
if (!OwnerOptions.selectedProject) {
return
}

View File

@ -294,14 +294,14 @@ export default {
domainid: this.$store.getters.userInfo.domainid,
account: this.$store.getters.userInfo.account
}
if (OwnerOptions.selectedAccountType === this.$t('label.account')) {
if (OwnerOptions.selectedAccountType === 'Account') {
if (!OwnerOptions.selectedAccount) {
return
}
this.owner.account = OwnerOptions.selectedAccount
this.owner.domainid = OwnerOptions.selectedDomain
this.owner.projectid = null
} else if (OwnerOptions.selectedAccountType === this.$t('label.project')) {
} else if (OwnerOptions.selectedAccountType === 'Project') {
if (!OwnerOptions.selectedProject) {
return
}

View File

@ -273,14 +273,14 @@ export default {
fetchOwnerOptions (OwnerOptions) {
this.owner = {}
console.log('fetching owner')
if (OwnerOptions.selectedAccountType === this.$t('label.account')) {
if (OwnerOptions.selectedAccountType === 'Account') {
if (!OwnerOptions.selectedAccount) {
return
}
console.log('fetched account')
this.owner.account = OwnerOptions.selectedAccount
this.owner.domainid = OwnerOptions.selectedDomain
} else if (OwnerOptions.selectedAccountType === this.$t('label.project')) {
} else if (OwnerOptions.selectedAccountType === 'Project') {
if (!OwnerOptions.selectedProject) {
return
}

View File

@ -211,13 +211,13 @@ export default {
},
fetchOwnerOptions (OwnerOptions) {
this.owner = {}
if (OwnerOptions.selectedAccountType === this.$t('label.account')) {
if (OwnerOptions.selectedAccountType === 'Account') {
if (!OwnerOptions.selectedAccount) {
return
}
this.owner.account = OwnerOptions.selectedAccount
this.owner.domainid = OwnerOptions.selectedDomain
} else if (OwnerOptions.selectedAccountType === this.$t('label.project')) {
} else if (OwnerOptions.selectedAccountType === 'Project') {
if (!OwnerOptions.selectedProject) {
return
}