mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
fix: observableHistoryInjectionToken and 1 revert for GlobalOverride
Signed-off-by: Gabriel <gaccettola@mirantis.com>
This commit is contained in:
1 parent
db9a3675e1
commit
8c0220c353
22 files changed
+51
-45
No files matched your search
@@ -6,7 +6,7 @@ import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { action } from "mobx";
|
||||
import { byOrderNumber } from "../../../common/utils/composable-responsibilities/orderable/orderable";
|
||||
import type { CatalogEntity } from "../../api/catalog-entity";
|
||||
import { observableHistoryInjectable } from "@k8slens/routing";
|
||||
import { observableHistoryInjectionToken } from "@k8slens/routing";
|
||||
import type { RegisteredEntitySetting } from "./extension-registrator.injectable";
|
||||
import catalogEntitySettingItemsInjectable from "./settings.injectable";
|
||||
|
||||
@@ -54,7 +54,7 @@ const getSettingGroups = (items: RegisteredEntitySetting[]): SettingGroup[] => {
|
||||
const activeEntitySettingsTabInjectable = getInjectable({
|
||||
id: "active-entity-settings-tab",
|
||||
instantiate: (di, entity): ActiveEntitySettings => {
|
||||
const observableHistory = di.inject(observableHistoryInjectable);
|
||||
const observableHistory = di.inject(observableHistoryInjectionToken);
|
||||
const items = di.inject(catalogEntitySettingItemsInjectable, entity);
|
||||
|
||||
return {
|
||||
|
||||
@@ -13,7 +13,7 @@ import { Animate } from "../animate";
|
||||
import { cssNames, noop, stopPropagation } from "@k8slens/utilities";
|
||||
import type { ObservableHistory } from "mobx-observable-history";
|
||||
import { withInjectables } from "@ogre-tools/injectable-react";
|
||||
import { observableHistoryInjectable } from "@k8slens/routing";
|
||||
import { observableHistoryInjectionToken } from "@k8slens/routing";
|
||||
import requestAnimationFrameInjectable from "../animate/request-animation-frame.injectable";
|
||||
|
||||
// todo: refactor + handle animation-end in props.onClose()?
|
||||
@@ -181,7 +181,7 @@ class NonInjectedDialog extends React.PureComponent<DialogProps & Dependencies &
|
||||
export const Dialog = withInjectables<Dependencies, DialogProps>((props) => <NonInjectedDialog {...props} />, {
|
||||
getProps: (di, props) => ({
|
||||
...props,
|
||||
navigation: di.inject(observableHistoryInjectable),
|
||||
navigation: di.inject(observableHistoryInjectionToken),
|
||||
requestAnimationFrame: di.inject(requestAnimationFrameInjectable),
|
||||
}),
|
||||
});
|
||||
@@ -13,7 +13,7 @@ import { issuesTrackerUrl, forumsUrl } from "../../../common/vars";
|
||||
import type { SingleOrMany } from "@k8slens/utilities";
|
||||
import type { ObservableHistory } from "mobx-observable-history";
|
||||
import { withInjectables } from "@ogre-tools/injectable-react";
|
||||
import { observableHistoryInjectable } from "@k8slens/routing";
|
||||
import { observableHistoryInjectionToken } from "@k8slens/routing";
|
||||
|
||||
export interface ErrorBoundaryProps {
|
||||
children?: SingleOrMany<React.ReactNode>;
|
||||
@@ -98,6 +98,6 @@ class NonInjectedErrorBoundary extends React.Component<ErrorBoundaryProps & Depe
|
||||
export const ErrorBoundary = withInjectables<Dependencies, ErrorBoundaryProps>(NonInjectedErrorBoundary, {
|
||||
getProps: (di, props) => ({
|
||||
...props,
|
||||
observableHistory: di.inject(observableHistoryInjectable),
|
||||
observableHistory: di.inject(observableHistoryInjectionToken),
|
||||
}),
|
||||
});
|
||||
+2
-2
@@ -3,7 +3,7 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { observableHistoryInjectable } from "@k8slens/routing";
|
||||
import { observableHistoryInjectionToken } from "@k8slens/routing";
|
||||
import kubeDetailsUrlParamInjectable from "./kube-details-url.injectable";
|
||||
import kubeSelectedUrlParamInjectable from "./kube-selected-url.injectable";
|
||||
|
||||
@@ -12,7 +12,7 @@ export type GetDetailsUrl = (selfLink: string, resetSelected?: boolean, mergeGlo
|
||||
const getDetailsUrlInjectable = getInjectable({
|
||||
id: "get-details-url",
|
||||
instantiate: (di): GetDetailsUrl => {
|
||||
const observableHistory = di.inject(observableHistoryInjectable);
|
||||
const observableHistory = di.inject(observableHistoryInjectionToken);
|
||||
const kubeDetailsUrlParam = di.inject(kubeDetailsUrlParamInjectable);
|
||||
const kubeSelectedUrlParam = di.inject(kubeSelectedUrlParamInjectable);
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { observableHistoryInjectable } from "@k8slens/routing";
|
||||
import { observableHistoryInjectionToken } from "@k8slens/routing";
|
||||
import getDetailsUrlInjectable from "./get-details-url.injectable";
|
||||
|
||||
/**
|
||||
@@ -16,7 +16,7 @@ export type ShowDetails = (selfLink: string | undefined, resetSelected?: boolean
|
||||
const showDetailsInjectable = getInjectable({
|
||||
id: "show-details",
|
||||
instantiate: (di): ShowDetails => {
|
||||
const observableHistory = di.inject(observableHistoryInjectable);
|
||||
const observableHistory = di.inject(observableHistoryInjectionToken);
|
||||
const getDetailsUrl = di.inject(getDetailsUrlInjectable);
|
||||
|
||||
return (selfLink = "", resetSelected = true) => {
|
||||
|
||||
@@ -12,7 +12,7 @@ import { cssNames } from "@k8slens/utilities";
|
||||
import { CloseButton } from "./close-button";
|
||||
import { getLegacyGlobalDiForExtensionApi } from "../../../extensions/as-legacy-globals-for-extension-api/legacy-global-di-for-extension-api";
|
||||
import navigateToCatalogInjectable from "../../../common/front-end-routing/routes/catalog/navigate-to-catalog.injectable";
|
||||
import { observableHistoryInjectable } from "@k8slens/routing";
|
||||
import { observableHistoryInjectionToken } from "@k8slens/routing";
|
||||
|
||||
export interface SettingLayoutProps extends React.DOMAttributes<any> {
|
||||
className?: IClassName;
|
||||
@@ -31,7 +31,7 @@ const defaultProps: Partial<SettingLayoutProps> = {
|
||||
back: () => {
|
||||
const di = getLegacyGlobalDiForExtensionApi();
|
||||
const navigateToCatalog = di.inject(navigateToCatalogInjectable);
|
||||
const observableHistory = di.inject(observableHistoryInjectable);
|
||||
const observableHistory = di.inject(observableHistoryInjectionToken);
|
||||
|
||||
if (observableHistory.length <= 1) {
|
||||
navigateToCatalog();
|
||||
|
||||
@@ -15,7 +15,7 @@ import { Tab, Tabs } from "../tabs";
|
||||
import { ErrorBoundary } from "../error-boundary";
|
||||
import type { ObservableHistory } from "mobx-observable-history";
|
||||
import { withInjectables } from "@ogre-tools/injectable-react";
|
||||
import { observableHistoryInjectable } from "@k8slens/routing";
|
||||
import { observableHistoryInjectionToken } from "@k8slens/routing";
|
||||
import type { Navigate } from "../../navigation/navigate.injectable";
|
||||
import navigateInjectable from "../../navigation/navigate.injectable";
|
||||
|
||||
@@ -94,7 +94,7 @@ const NonInjectedTabLayout = observer((props: TabLayoutProps & Dependencies) =>
|
||||
export const TabLayout = withInjectables<Dependencies, TabLayoutProps>(NonInjectedTabLayout, {
|
||||
getProps: (di, props) => ({
|
||||
...props,
|
||||
observableHistory: di.inject(observableHistoryInjectable),
|
||||
observableHistory: di.inject(observableHistoryInjectionToken),
|
||||
navigate: di.inject(navigateInjectable),
|
||||
}),
|
||||
});
|
||||
Reference in new issue
Block a user