refactor: forklift UI bug and enhancement (#989)

* fix: hide Virtul machine migration tabs if forklift addon is not enabled

Signed-off-by: Andy Lee <andy.lee@suse.com>

* fix: rename advanced to configurations

Signed-off-by: Andy Lee <andy.lee@suse.com>

* fix: fixed column width

Signed-off-by: Andy Lee <andy.lee@suse.com>

* refactor: review comment

Signed-off-by: Andy Lee <andy.lee@suse.com>

* revert: power on background color

Signed-off-by: Andy Lee <andy.lee@suse.com>

---------

Signed-off-by: Andy Lee <andy.lee@suse.com>
This commit is contained in:
Andy Lee
2026-07-14 12:04:00 +08:00
committed by GitHub
parent 7d09cb7142
commit 41cf44d231
7 changed files with 71 additions and 25 deletions
+4 -2
View File
@@ -8,9 +8,11 @@
* @param {String} config.resourceType - The schema ID for addons.
* @param {String} config.navGroup - The group name in the side nav.
* @param {Array<String>} config.types - Array of Resource IDs to show/hide.
* @param {Boolean} [config.requireSchema=true] - When true, only types with an
* accessible schema are shown. Set false for schema-less virtual types.
*/
export function registerAddonSideNav(store, productName, {
addonName, resourceType, navGroup, types
addonName, resourceType, navGroup, types, requireSchema = true
}) {
if (typeof window === 'undefined') {
return;
@@ -57,7 +59,7 @@ export function registerAddonSideNav(store, productName, {
// Adds or removes the resource IDs from the product visibility whitelist.
const setMenuVisibility = (visible) => {
const accessibleTypes = visible ? types.filter(hasAccessibleSchema) : [];
const accessibleTypes = visible ? (requireSchema ? types.filter(hasAccessibleSchema) : types) : [];
// Always clear first to remove any previously-registered types that are
// no longer accessible (e.g. partial permission changes like types=[A,B] where B is dropped).