refactor: allow editConfig when status is empty

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

View File

@ -14,8 +14,8 @@ export default class MIGCONFIGURATION extends SteveModel {
if (action.action === 'goToEditYaml') {
return { ...action, enabled: true };
} else if (action.action === 'goToEdit') {
// need to wait for status to be disabled, then allow user to editConfig
return { ...action, enabled: !this.spec.enabled && this.configStatus === 'disabled' };
// 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) };
} else {
return action;
}
@ -48,6 +48,8 @@ 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;
}