refactor: remove unneeded divider in storage class action menu (#460) (#461)

(cherry picked from commit 76605fdc07be2f59f82049c42a7ad753e3baab8c)

Signed-off-by: Andy Lee <andy.lee@suse.com>
Co-authored-by: Andy Lee <andy.lee@suse.com>
This commit is contained in:
mergify[bot] 2025-08-15 10:53:56 +08:00 committed by GitHub
parent e82ba9d9f5
commit 1a176960bc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -94,13 +94,14 @@ export default class HciStorageClass extends StorageClass {
get availableActions() { get availableActions() {
let out = super.availableActions || []; let out = super.availableActions || [];
out = out.map((action) => { if (this.isInternalStorageClass()) {
if ((action.action === 'setDefault' || action.action === 'setAsDefault' || action.action === 'promptRemove') && this.isInternalStorageClass()) { out = out.filter((action) => {
return { ...action, enabled: false }; return !['setDefault', 'setAsDefault', 'promptRemove'].includes(action.action);
}
return action;
}); });
}
if (out[0] && out[0].divider === true) {
out = out.slice(1);
}
return out; return out;
} }