mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Show extension preferences in separate page (#5284)
Co-authored-by: Alex Andreev <alex.andreev.email@gmail.com> Co-authored-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
1 parent
91ee7bd785
commit
0784085bf4
39 files changed
+2535
-204
No files matched your search
+8
-2
@@ -5,12 +5,18 @@
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { computed } from "mobx";
|
||||
import { frontEndRouteInjectionToken } from "../../../front-end-route-injection-token";
|
||||
import type { Route } from "../../../front-end-route-injection-token";
|
||||
|
||||
interface ExtensionPreferenceRouteParams {
|
||||
extensionId: string;
|
||||
tabId?: string;
|
||||
}
|
||||
|
||||
const extensionPreferencesRouteInjectable = getInjectable({
|
||||
id: "extension-preferences-route",
|
||||
|
||||
instantiate: () => ({
|
||||
path: "/preferences/extensions",
|
||||
instantiate: (): Route<ExtensionPreferenceRouteParams> => ({
|
||||
path: "/preferences/extension/:extensionId/:tabId?",
|
||||
clusterFrame: false,
|
||||
isEnabled: computed(() => true),
|
||||
}),
|
||||
|
||||
+4
-1
@@ -13,7 +13,10 @@ const navigateToExtensionPreferencesInjectable = getInjectable({
|
||||
const navigateToRoute = di.inject(navigateToRouteInjectionToken);
|
||||
const route = di.inject(extensionPreferencesRouteInjectable);
|
||||
|
||||
return () => navigateToRoute(route);
|
||||
return (extensionId: string, tabId?: string) => navigateToRoute(route, { parameters: {
|
||||
extensionId,
|
||||
tabId,
|
||||
}});
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ describe("runManyFor", () => {
|
||||
let actualPromise: Promise<void>;
|
||||
|
||||
beforeEach(() => {
|
||||
const rootDi = createContainer();
|
||||
const rootDi = createContainer("irrelevant");
|
||||
|
||||
runMock = asyncFn();
|
||||
|
||||
@@ -67,7 +67,7 @@ describe("runManyFor", () => {
|
||||
let actualPromise: Promise<void>;
|
||||
|
||||
beforeEach(() => {
|
||||
const di = createContainer();
|
||||
const di = createContainer("irrelevant");
|
||||
|
||||
runMock = asyncFn();
|
||||
|
||||
@@ -170,7 +170,7 @@ describe("runManyFor", () => {
|
||||
});
|
||||
|
||||
it("given invalid hierarchy, when running runnables, throws", () => {
|
||||
const rootDi = createContainer();
|
||||
const rootDi = createContainer("irrelevant");
|
||||
|
||||
const runMock = asyncFn<(...args: unknown[]) => void>();
|
||||
|
||||
@@ -218,7 +218,7 @@ describe("runManyFor", () => {
|
||||
let runMock: AsyncFnMock<(...args: unknown[]) => Promise<void>>;
|
||||
|
||||
beforeEach(() => {
|
||||
const rootDi = createContainer();
|
||||
const rootDi = createContainer("irrelevant");
|
||||
|
||||
runMock = asyncFn();
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ describe("runManySyncFor", () => {
|
||||
let runMock: jest.Mock;
|
||||
|
||||
beforeEach(() => {
|
||||
const rootDi = createContainer();
|
||||
const rootDi = createContainer("irrelevant");
|
||||
|
||||
runMock = jest.fn();
|
||||
|
||||
@@ -50,7 +50,7 @@ describe("runManySyncFor", () => {
|
||||
let runMock: jest.Mock<(arg: string) => void>;
|
||||
|
||||
beforeEach(() => {
|
||||
const di = createContainer();
|
||||
const di = createContainer("irrelevant");
|
||||
|
||||
runMock = jest.fn();
|
||||
|
||||
@@ -99,7 +99,7 @@ describe("runManySyncFor", () => {
|
||||
});
|
||||
|
||||
it("given invalid hierarchy, when running runnables, throws", () => {
|
||||
const rootDi = createContainer();
|
||||
const rootDi = createContainer("irrelevant");
|
||||
|
||||
const runMock = jest.fn();
|
||||
|
||||
@@ -147,7 +147,7 @@ describe("runManySyncFor", () => {
|
||||
let runMock: jest.Mock<(arg: string, arg2: string) => void>;
|
||||
|
||||
beforeEach(() => {
|
||||
const rootDi = createContainer();
|
||||
const rootDi = createContainer("irrelevant");
|
||||
|
||||
runMock = jest.fn();
|
||||
|
||||
|
||||
Reference in new issue
Block a user