mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-02-04 23:11:44 +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;
|
let out = super._availableActions;
|
||||||
|
|
||||||
out = out.map((action) => {
|
out = out.map((action) => {
|
||||||
if (action.action === 'goToEditYaml') {
|
if(action.action === "showConfiguration"){
|
||||||
return { ...action, enabled: true };
|
return { ...action, enabled: !this.spec.enabled };
|
||||||
|
}else if (action.action === 'goToEditYaml') {
|
||||||
|
return { ...action, enabled: !this.spec.enabled };
|
||||||
} else if (action.action === 'goToEdit') {
|
} else if (action.action === 'goToEdit') {
|
||||||
// need to wait for status to be disabled or empty value, then allow user to editConfig
|
// 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) };
|
return { ...action, enabled: !this.spec.enabled && ['disabled', ''].includes(this.configStatus) };
|
||||||
@ -48,8 +50,6 @@ export default class MIGCONFIGURATION extends SteveModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get configStatus() {
|
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;
|
return this.status.status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user