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)
|
this.fetchDynamicFieldData(fieldname, event.target.value)
|
||||||
},
|
},
|
||||||
onSelectFieldChange (fieldname) {
|
onSelectFieldChange (fieldname) {
|
||||||
if (fieldname === 'domainid') {
|
const fetchAccountOptions = fieldname === 'domainid' && this.fields.some((field) => field.name === 'account')
|
||||||
|
if (fetchAccountOptions) {
|
||||||
this.fetchDynamicFieldData('account')
|
this.fetchDynamicFieldData('account')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -711,10 +712,6 @@ export default {
|
|||||||
if (Array.isArray(arrayField)) {
|
if (Array.isArray(arrayField)) {
|
||||||
this.fillFormFieldValues()
|
this.fillFormFieldValues()
|
||||||
}
|
}
|
||||||
if (networkIndex > -1) {
|
|
||||||
this.fields[networkIndex].loading = false
|
|
||||||
}
|
|
||||||
this.fillFormFieldValues()
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
initFormFieldData () {
|
initFormFieldData () {
|
||||||
@ -782,7 +779,7 @@ export default {
|
|||||||
params.domainid = this.form.domainid
|
params.domainid = this.form.domainid
|
||||||
}
|
}
|
||||||
api('listAccounts', params).then(json => {
|
api('listAccounts', params).then(json => {
|
||||||
var account = json.listaccountsresponse.account
|
let account = json?.listaccountsresponse?.account || []
|
||||||
if (this.form.domainid) {
|
if (this.form.domainid) {
|
||||||
account = account.filter(a => a.domainid === this.form.domainid)
|
account = account.filter(a => a.domainid === this.form.domainid)
|
||||||
}
|
}
|
||||||
@ -1323,7 +1320,7 @@ export default {
|
|||||||
this.searchQuery = value
|
this.searchQuery = value
|
||||||
this.$emit('search', { searchQuery: this.searchQuery })
|
this.$emit('search', { searchQuery: this.searchQuery })
|
||||||
},
|
},
|
||||||
onClear () {
|
async onClear () {
|
||||||
this.formRef.value.resetFields()
|
this.formRef.value.resetFields()
|
||||||
this.form = reactive({})
|
this.form = reactive({})
|
||||||
this.isFiltered = false
|
this.isFiltered = false
|
||||||
@ -1331,6 +1328,14 @@ export default {
|
|||||||
this.inputValue = null
|
this.inputValue = null
|
||||||
this.searchQuery = null
|
this.searchQuery = null
|
||||||
this.paramsFilter = {}
|
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)
|
this.$emit('search', this.paramsFilter)
|
||||||
},
|
},
|
||||||
handleSubmit () {
|
handleSubmit () {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user