mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
UI: Fix selection of domain filters in the SearchView component (#10386)
This commit is contained in:
parent
07564b7933
commit
69285a62c9
@ -249,7 +249,8 @@ export default {
|
||||
this.fetchDynamicFieldData(fieldname, event.target.value)
|
||||
},
|
||||
onSelectFieldChange (fieldname) {
|
||||
if (fieldname === 'domainid') {
|
||||
const fetchAccountOptions = fieldname === 'domainid' && this.fields.some((field) => field.name === 'account')
|
||||
if (fetchAccountOptions) {
|
||||
this.fetchDynamicFieldData('account')
|
||||
}
|
||||
},
|
||||
@ -711,10 +712,6 @@ export default {
|
||||
if (Array.isArray(arrayField)) {
|
||||
this.fillFormFieldValues()
|
||||
}
|
||||
if (networkIndex > -1) {
|
||||
this.fields[networkIndex].loading = false
|
||||
}
|
||||
this.fillFormFieldValues()
|
||||
})
|
||||
},
|
||||
initFormFieldData () {
|
||||
@ -782,7 +779,7 @@ export default {
|
||||
params.domainid = this.form.domainid
|
||||
}
|
||||
api('listAccounts', params).then(json => {
|
||||
var account = json.listaccountsresponse.account
|
||||
let account = json?.listaccountsresponse?.account || []
|
||||
if (this.form.domainid) {
|
||||
account = account.filter(a => a.domainid === this.form.domainid)
|
||||
}
|
||||
@ -1323,7 +1320,7 @@ export default {
|
||||
this.searchQuery = value
|
||||
this.$emit('search', { searchQuery: this.searchQuery })
|
||||
},
|
||||
onClear () {
|
||||
async onClear () {
|
||||
this.formRef.value.resetFields()
|
||||
this.form = reactive({})
|
||||
this.isFiltered = false
|
||||
@ -1331,6 +1328,14 @@ export default {
|
||||
this.inputValue = null
|
||||
this.searchQuery = null
|
||||
this.paramsFilter = {}
|
||||
|
||||
const refreshAccountOptions = ['account', 'domainid'].every((field) => {
|
||||
return this.fields.some((searchViewField) => searchViewField.name === field)
|
||||
})
|
||||
if (refreshAccountOptions) {
|
||||
await this.fetchDynamicFieldData('account')
|
||||
}
|
||||
|
||||
this.$emit('search', this.paramsFilter)
|
||||
},
|
||||
handleSubmit () {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user