mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2025-12-15 14:11:46 +00:00
refactor: only show disable action if MIGConfig is enabled
Signed-off-by: Andy Lee <andy.lee@suse.com>
This commit is contained in:
parent
16a0df8864
commit
57622f918d
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user