mirror of https://github.com/apache/cloudstack.git
Update ownership selection component to be language independent (#10052)
This commit is contained in:
parent
330ed25a6c
commit
32af4a25d0
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue