Expose reactive ways to hide items in cluster frame using Extension API - PART 7 (#5824)

* Kludge "isEnabledForCluster" work again for cluster pages

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

* Kludge "isEnabledForCluster" work again for kube object details

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

* Expose reactive way to hide kube object detail items in Extension API

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

* Expose reactive way to hide kube object menu items in Extension API

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

* Expose reactive way to hide kube object status items in Extension API

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

* Expose reactive way to hide workload overview detail items in Extension API

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

* Expose reactive way to disable pages in Extension API

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

* Expose a way to access active cluster from Extension API

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

* Deprecate "isEnabledForCluster" in favor of individual enabled or visible properties for each registration

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
Janne Savolainen authored and GitHub committed 2022-07-13 13:47:03 -04:00
1 parent ca40c51117
commit d66e6c23c5
19 files changed
+679 -33

No files matched your search

@@ -38,9 +38,13 @@ const workloadOverviewDetailRegistratorInjectable = getInjectable({
instantiate: () => ({
Component: registration.components.Details,
enabled: computed(() =>
extensionShouldBeEnabledForClusterFrame.value.get(),
),
enabled: computed(() => {
if (!extensionShouldBeEnabledForClusterFrame.value.get()) {
return false;
}
return registration.visible ? registration.visible.get() : true;
}),
orderNumber:
0.5 + (registration.priority ? 100 - registration.priority : 50),
@@ -1,3 +1,9 @@
/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import type { IComputedValue } from "mobx";
/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
@@ -9,4 +15,5 @@ interface WorkloadsOverviewDetailComponents {
export interface WorkloadsOverviewDetailRegistration {
components: WorkloadsOverviewDetailComponents;
priority?: number;
visible?: IComputedValue<boolean>;
}