mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Add navigateTo method allowing open different paths within Preferences
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
parent
88cce075ec
commit
558b337256
@ -52,6 +52,8 @@ import { getDiForUnitTesting as getMainDi } from "../../../main/getDiForUnitTest
|
|||||||
import { overrideChannels } from "../../../test-utils/channel-fakes/override-channels";
|
import { overrideChannels } from "../../../test-utils/channel-fakes/override-channels";
|
||||||
import type { TrayMenuItem } from "../../../main/tray/tray-menu-item/tray-menu-item-injection-token";
|
import type { TrayMenuItem } from "../../../main/tray/tray-menu-item/tray-menu-item-injection-token";
|
||||||
import trayIconPathsInjectable from "../../../main/tray/tray-icon-path.injectable";
|
import trayIconPathsInjectable from "../../../main/tray/tray-icon-path.injectable";
|
||||||
|
import type { Route } from "../../../common/front-end-routing/route-injection-token";
|
||||||
|
import { navigateToRouteInjectionToken, NavigateToRouteOptions } from "../../../common/front-end-routing/navigate-to-route-injection-token";
|
||||||
|
|
||||||
type Callback = (dis: DiContainers) => void | Promise<void>;
|
type Callback = (dis: DiContainers) => void | Promise<void>;
|
||||||
|
|
||||||
@ -77,6 +79,7 @@ export interface ApplicationBuilder {
|
|||||||
preferences: {
|
preferences: {
|
||||||
close: () => void;
|
close: () => void;
|
||||||
navigate: () => void;
|
navigate: () => void;
|
||||||
|
navigateTo: (route: Route<any>, params: Partial<NavigateToRouteOptions<any>>) => void;
|
||||||
navigation: {
|
navigation: {
|
||||||
click: (id: string) => void;
|
click: (id: string) => void;
|
||||||
};
|
};
|
||||||
@ -181,7 +184,7 @@ export const getApplicationBuilder = () => {
|
|||||||
setMenuItems: (items) => {
|
setMenuItems: (items) => {
|
||||||
trayMenuItemsStateFake = items;
|
trayMenuItemsStateFake = items;
|
||||||
},
|
},
|
||||||
setIconPath: (path) => {
|
setIconPath: (path: string) => {
|
||||||
trayMenuIconPath = path;
|
trayMenuIconPath = path;
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
@ -268,6 +271,12 @@ export const getApplicationBuilder = () => {
|
|||||||
navigateToPreferences();
|
navigateToPreferences();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
navigateTo: (route: Route<any>, params: Partial<NavigateToRouteOptions<any>>) => {
|
||||||
|
const navigateToRoute = rendererDi.inject(navigateToRouteInjectionToken);
|
||||||
|
|
||||||
|
navigateToRoute(route, params);
|
||||||
|
},
|
||||||
|
|
||||||
navigation: {
|
navigation: {
|
||||||
click: (id: string) => {
|
click: (id: string) => {
|
||||||
const link = rendered.queryByTestId(`tab-link-for-${id}`);
|
const link = rendered.queryByTestId(`tab-link-for-${id}`);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user