mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Removing unused files
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
parent
6cf0000c25
commit
f4febce32a
@ -1,22 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { computed } from "mobx";
|
||||
import { clusterFrameChildComponentInjectionToken } from "../frames/cluster-frame/cluster-frame-child-component-injection-token";
|
||||
import { ClusterModals } from "./cluster-modals";
|
||||
|
||||
const clusterModalsClusterFrameChildComponentInjectable = getInjectable({
|
||||
id: "cluster-modals-cluster-frame-child-component",
|
||||
|
||||
instantiate: () => ({
|
||||
id: "cluster-modals",
|
||||
shouldRender: computed(() => true),
|
||||
Component: ClusterModals,
|
||||
}),
|
||||
|
||||
injectionToken: clusterFrameChildComponentInjectionToken,
|
||||
});
|
||||
|
||||
export default clusterModalsClusterFrameChildComponentInjectable;
|
||||
@ -1,11 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
import { getInjectionToken } from "@ogre-tools/injectable";
|
||||
import type { ClusterModalRegistration } from "../../extensions/registries";
|
||||
|
||||
export const clusterModalsInjectionToken = getInjectionToken<
|
||||
ClusterModalRegistration
|
||||
>({ id: "cluster-modals-injection-token" });
|
||||
@ -1,40 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { pipeline } from "@ogre-tools/fp";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { map } from "lodash/fp";
|
||||
import { extensionRegistratorInjectionToken } from "../../extensions/extension-loader/extension-registrator-injection-token";
|
||||
import type { ExtensionRegistrator } from "../../extensions/extension-loader/extension-registrator-injection-token";
|
||||
import type { LensRendererExtension } from "../../extensions/lens-renderer-extension";
|
||||
import { clusterModalsInjectionToken } from "./cluster-modals-injection-token";
|
||||
|
||||
const clusterModalsRegistratorInjectable = getInjectable({
|
||||
id: "cluster-modals-registrator",
|
||||
|
||||
instantiate: (): ExtensionRegistrator => {
|
||||
return (ext) => {
|
||||
const extension = ext as LensRendererExtension;
|
||||
|
||||
return pipeline(
|
||||
extension.clusterModals,
|
||||
|
||||
map((modal) => {
|
||||
return getInjectable({
|
||||
id: modal.id,
|
||||
injectionToken: clusterModalsInjectionToken,
|
||||
instantiate: () => ({
|
||||
id: `${modal.id}-id`,
|
||||
visible: modal.visible,
|
||||
Component: modal.Component,
|
||||
}),
|
||||
});
|
||||
}),
|
||||
);
|
||||
};
|
||||
},
|
||||
injectionToken: extensionRegistratorInjectionToken,
|
||||
});
|
||||
|
||||
export default clusterModalsRegistratorInjectable;
|
||||
@ -1,20 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { computedInjectManyInjectable } from "@ogre-tools/injectable-extension-for-mobx";
|
||||
import { clusterModalsInjectionToken } from "./cluster-modals-injection-token";
|
||||
|
||||
const clusterModalsInjectable = getInjectable({
|
||||
id: "cluster-modals",
|
||||
|
||||
instantiate: (di) => {
|
||||
const computedInjectMany = di.inject(computedInjectManyInjectable);
|
||||
const modalRegistrations = computedInjectMany(clusterModalsInjectionToken);
|
||||
|
||||
return modalRegistrations;
|
||||
},
|
||||
});
|
||||
|
||||
export default clusterModalsInjectable;
|
||||
@ -1,3 +0,0 @@
|
||||
.clusterModals {
|
||||
overflow: visible;
|
||||
}
|
||||
@ -1,33 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import styles from "./cluster-modals.module.css";
|
||||
|
||||
import { withInjectables } from "@ogre-tools/injectable-react";
|
||||
import React from "react";
|
||||
import type { ClusterModalRegistration } from "../../extensions/registries";
|
||||
import clusterModalsInjectable from "./cluster-modals.injectable";
|
||||
import { observer } from "mobx-react";
|
||||
import type { IComputedValue } from "mobx";
|
||||
|
||||
interface Dependencies {
|
||||
clusterModals: IComputedValue<ClusterModalRegistration[]>;
|
||||
}
|
||||
|
||||
export const NonInjectedClusterModals = observer(({ clusterModals }: Dependencies) => {
|
||||
return (
|
||||
<div className={styles.clusterModals} style={{ height: 0 }}>
|
||||
{clusterModals.get().map((modal) => {
|
||||
return modal.visible.get() ? <modal.Component key={modal.id} /> : null;
|
||||
})}
|
||||
</div>
|
||||
);
|
||||
});
|
||||
|
||||
export const ClusterModals = withInjectables<Dependencies>(NonInjectedClusterModals, {
|
||||
getProps: (di, props) => ({
|
||||
...props,
|
||||
clusterModals: di.inject(clusterModalsInjectable),
|
||||
}),
|
||||
});
|
||||
Loading…
Reference in New Issue
Block a user