refactor: only show disable action if MIGConfig is enabled

Signed-off-by: Andy Lee <andy.lee@suse.com>
This commit is contained in:
Andy Lee 2025-10-27 15:32:12 +08:00
parent 16a0df8864
commit 57622f918d
No known key found for this signature in database
GPG Key ID: EC774C32160918ED

View File

@ -11,8 +11,10 @@ export default class MIGCONFIGURATION extends SteveModel {
let out = super._availableActions;
out = out.map((action) => {
if (action.action === 'goToEditYaml') {
return { ...action, enabled: true };
if(action.action === "showConfiguration"){
return { ...action, enabled: !this.spec.enabled };
}else if (action.action === 'goToEditYaml') {
return { ...action, enabled: !this.spec.enabled };
} else if (action.action === 'goToEdit') {
// need to wait for status to be disabled or empty value, then allow user to editConfig
return { ...action, enabled: !this.spec.enabled && ['disabled', ''].includes(this.configStatus) };
@ -48,8 +50,6 @@ export default class MIGCONFIGURATION extends SteveModel {
}
get configStatus() {
// console.log("🚀 ~ MIGCONFIGURATION ~ configStatus ~ this.status.status:", this.status.status)
// console.log('this.status.status.length', this.status.status?.length);
return this.status.status;
}