mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2025-12-13 13:11:43 +00:00
refactor: remove unneeded divider in storage class action menu (#460)
Signed-off-by: Andy Lee <andy.lee@suse.com>
This commit is contained in:
parent
c289b001db
commit
76605fdc07
@ -94,13 +94,14 @@ export default class HciStorageClass extends StorageClass {
|
||||
get availableActions() {
|
||||
let out = super.availableActions || [];
|
||||
|
||||
out = out.map((action) => {
|
||||
if ((action.action === 'setDefault' || action.action === 'setAsDefault' || action.action === 'promptRemove') && this.isInternalStorageClass()) {
|
||||
return { ...action, enabled: false };
|
||||
}
|
||||
|
||||
return action;
|
||||
});
|
||||
if (this.isInternalStorageClass()) {
|
||||
out = out.filter((action) => {
|
||||
return !['setDefault', 'setAsDefault', 'promptRemove'].includes(action.action);
|
||||
});
|
||||
}
|
||||
if (out[0] && out[0].divider === true) {
|
||||
out = out.slice(1);
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user