Skip to content

Commit

Permalink
Make EntitySettingRegistry fully injectable (#6604)
Browse files Browse the repository at this point in the history
* Make EntitySettingRegistry fully injectable

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Add behavioural tests

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Fix lint

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Revert tsconfig change

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Fix type errors

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Update snapshot

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Improve naming

Signed-off-by: Sebastian Malton <sebastian@malton.name>

Signed-off-by: Sebastian Malton <sebastian@malton.name>
  • Loading branch information
Nokel81 authored Nov 28, 2022
1 parent 8897bfc commit 9589175
Show file tree
Hide file tree
Showing 51 changed files with 2,103 additions and 540 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@ export const orderByOrderNumber = <T extends MaybeOrderable>(maybeOrderables: T[
: Number.MAX_SAFE_INTEGER,
maybeOrderables,
);

export const byOrderNumber = <T extends Orderable>(left: T, right: T) => (
left.orderNumber - right.orderNumber
);
1 change: 0 additions & 1 deletion src/extensions/extension-loader/extension-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,6 @@ export class ExtensionLoader {
return this.autoInitExtensions(async (ext) => {
const extension = ext as LensRendererExtension;
const removeItems = [
registries.EntitySettingRegistry.getInstance().add(extension.entitySettings),
registries.CatalogEntityDetailRegistry.getInstance().add(extension.catalogEntityDetailItems),
];

Expand Down
3 changes: 2 additions & 1 deletion src/extensions/lens-renderer-extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import type { KubeObjectHandlerRegistration } from "../renderer/kube-object/hand
import type { AppPreferenceTabRegistration } from "../features/preferences/renderer/compliance-for-legacy-extension-api/app-preference-tab-registration";
import type { KubeObjectDetailRegistration } from "../renderer/components/kube-object-details/kube-object-detail-registration";
import type { ClusterFrameChildComponent } from "../renderer/frames/cluster-frame/cluster-frame-child-component-injection-token";
import type { EntitySettingRegistration } from "../renderer/components/+entity-settings/extension-registrator.injectable";

export class LensRendererExtension extends LensExtension<LensRendererExtensionDependencies> {
globalPages: registries.PageRegistration[] = [];
Expand All @@ -38,7 +39,7 @@ export class LensRendererExtension extends LensExtension<LensRendererExtensionDe
kubeObjectStatusTexts: KubeObjectStatusRegistration[] = [];
appPreferences: AppPreferenceRegistration[] = [];
appPreferenceTabs: AppPreferenceTabRegistration[] = [];
entitySettings: registries.EntitySettingRegistration[] = [];
entitySettings: EntitySettingRegistration[] = [];
statusBarItems: StatusBarRegistration[] = [];
kubeObjectDetailItems: KubeObjectDetailRegistration[] = [];
kubeObjectMenuItems: KubeObjectMenuRegistration[] = [];
Expand Down
54 changes: 0 additions & 54 deletions src/extensions/registries/entity-setting-registry.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/extensions/registries/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@

export * from "./page-registry";
export * from "./page-menu-registry";
export * from "./entity-setting-registry";
export * from "./catalog-entity-detail-registry";
export * from "./protocol-handler";
Loading

0 comments on commit 9589175

Please sign in to comment.