mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Linter fixes
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
parent
81c276f3a3
commit
cc8db57def
@ -1,3 +1,7 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
// Extensions-api -> Cluster frame custom modal registration
|
||||
|
||||
@ -12,4 +16,4 @@ export interface ClusterModalRegistration {
|
||||
|
||||
export const clusterModalsInjectionToken = getInjectionToken<
|
||||
IComputedValue<ClusterModalRegistration[]>
|
||||
>({ id: "cluster-modals-injection-token" });
|
||||
>({ id: "cluster-modals-injection-token" });
|
||||
|
||||
@ -1,9 +1,15 @@
|
||||
/**
|
||||
* 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 type { RenderResult } from "@testing-library/react";
|
||||
import { computed, runInAction } from "mobx";
|
||||
import React from "react";
|
||||
import { ClusterModalRegistration, clusterModalsInjectionToken } from "../../extensions/registries";
|
||||
import { ApplicationBuilder, getApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
||||
import type { ClusterModalRegistration } from "../../extensions/registries";
|
||||
import { clusterModalsInjectionToken } from "../../extensions/registries";
|
||||
import type { ApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
||||
import { getApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
||||
|
||||
describe("cluster modal elements", () => {
|
||||
let builder: ApplicationBuilder;
|
||||
@ -50,8 +56,8 @@ const testClusterModalsInjectable = getInjectable({
|
||||
id: "test-modal-id",
|
||||
Component: () => <div data-testid="test-modal">test modal</div>,
|
||||
visible: computed(() => true),
|
||||
}])
|
||||
}]);
|
||||
},
|
||||
|
||||
injectionToken: clusterModalsInjectionToken
|
||||
});
|
||||
injectionToken: clusterModalsInjectionToken,
|
||||
});
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
/**
|
||||
* 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";
|
||||
@ -15,4 +19,4 @@ const clusterModalsClusterFrameChildComponentInjectable = getInjectable({
|
||||
injectionToken: clusterFrameChildComponentInjectionToken,
|
||||
});
|
||||
|
||||
export default clusterModalsClusterFrameChildComponentInjectable;
|
||||
export default clusterModalsClusterFrameChildComponentInjectable;
|
||||
|
||||
@ -1,5 +1,10 @@
|
||||
/**
|
||||
* 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 { ExtensionRegistrator, extensionRegistratorInjectionToken } from "../../extensions/extension-loader/extension-registrator-injection-token";
|
||||
import type { ExtensionRegistrator } from "../../extensions/extension-loader/extension-registrator-injection-token";
|
||||
import { extensionRegistratorInjectionToken } from "../../extensions/extension-loader/extension-registrator-injection-token";
|
||||
import type { LensRendererExtension } from "../../extensions/lens-renderer-extension";
|
||||
|
||||
const clusterModalsRegistratorInjectable = getInjectable({
|
||||
@ -24,4 +29,4 @@ const clusterModalsRegistratorInjectable = getInjectable({
|
||||
injectionToken: extensionRegistratorInjectionToken,
|
||||
});
|
||||
|
||||
export default clusterModalsRegistratorInjectable;
|
||||
export default clusterModalsRegistratorInjectable;
|
||||
|
||||
@ -1,9 +1,14 @@
|
||||
/**
|
||||
* 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 { computedInjectManyInjectable } from "@ogre-tools/injectable-extension-for-mobx";
|
||||
import { flatMap } from "lodash/fp";
|
||||
import type { IComputedValue } from "mobx";
|
||||
import { ClusterModalRegistration, clusterModalsInjectionToken } from "../../extensions/registries";
|
||||
import type { ClusterModalRegistration } from "../../extensions/registries";
|
||||
import { clusterModalsInjectionToken } from "../../extensions/registries";
|
||||
|
||||
const clusterModalsInjectable = getInjectable({
|
||||
id: "cluster-modals",
|
||||
@ -18,10 +23,10 @@ const clusterModalsInjectable = getInjectable({
|
||||
);
|
||||
|
||||
return registrations;
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
const dereference = (items: IComputedValue<ClusterModalRegistration[]>) =>
|
||||
items.get();
|
||||
|
||||
export default clusterModalsInjectable;
|
||||
export default clusterModalsInjectable;
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
/**
|
||||
* 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";
|
||||
@ -17,11 +21,11 @@ export const NonInjectedClusterModals = ({ clusterModals }: Dependencies) => {
|
||||
})}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
export const ClusterModals = withInjectables<Dependencies>(NonInjectedClusterModals, {
|
||||
getProps: (di, props) => ({
|
||||
...props,
|
||||
clusterModals: di.inject(clusterModalsInjectable),
|
||||
}),
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user