1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Merge branch 'master' into download-all-pod-logs

This commit is contained in:
Alex Andreev 2022-08-11 14:15:50 +03:00
commit 59dc8c958d
101 changed files with 3427 additions and 1862 deletions

6
.adr.json Normal file
View File

@ -0,0 +1,6 @@
{
"language": "en",
"path": "docs/architecture/decisions/",
"prefix": "",
"digits": 4
}

View File

@ -18,7 +18,7 @@ exports.default = async function notarizing(context) {
const appName = context.packager.appInfo.productFilename;
return await notarize({
appBundleId: "io.kontena.lens-app",
appBundleId: process.env.APPBUNDLEID || "io.kontena.lens-app",
appPath: `${appOutDir}/${appName}.app`,
appleId: process.env.APPLEID,
appleIdPassword: process.env.APPLEIDPASS,

View File

@ -0,0 +1,2 @@
# Architecture Decision Records

View File

@ -12,6 +12,10 @@
"email": "info@k8slens.dev"
},
"scripts": {
"adr:create": "echo \"What is the title?\"; read title; adr new \"$title\"",
"adr:change-status": "echo \"Decision number?:\"; read decision; adr status $decision",
"adr:update-readme": "adr update",
"adr:list": "adr list",
"dev": "concurrently -i -k \"yarn run dev-run -C\" yarn:dev:*",
"dev-build": "concurrently yarn:compile:*",
"debug-build": "concurrently yarn:compile:main yarn:compile:extension-types",
@ -210,10 +214,10 @@
"@kubernetes/client-node": "^0.17.0",
"@material-ui/styles": "^4.11.5",
"@ogre-tools/fp": "9.0.1",
"@ogre-tools/injectable": "9.0.1",
"@ogre-tools/injectable-extension-for-auto-registration": "9.0.1",
"@ogre-tools/injectable-extension-for-mobx": "9.0.1",
"@ogre-tools/injectable-react": "9.0.1",
"@ogre-tools/injectable": "9.0.2",
"@ogre-tools/injectable-extension-for-auto-registration": "9.0.2",
"@ogre-tools/injectable-extension-for-mobx": "9.0.2",
"@ogre-tools/injectable-react": "9.0.2",
"@sentry/electron": "^3.0.7",
"@sentry/integrations": "^6.19.3",
"@side/jest-runtime": "^1.0.1",
@ -248,7 +252,7 @@
"mobx-observable-history": "^2.0.3",
"mobx-react": "^7.5.2",
"mobx-utils": "^6.0.4",
"mock-fs": "^5.1.2",
"mock-fs": "^5.1.4",
"moment": "^2.29.4",
"moment-timezone": "^0.5.34",
"monaco-editor": "^0.29.1",
@ -282,7 +286,8 @@
"winston": "^3.8.1",
"winston-console-format": "^1.0.8",
"winston-transport-browserconsole": "^1.0.5",
"ws": "^8.8.0"
"ws": "^8.8.1",
"xterm-link-provider": "^1.3.1"
},
"devDependencies": {
"@async-fn/jest": "1.6.4",
@ -291,7 +296,7 @@
"@material-ui/lab": "^4.0.0-alpha.60",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.7",
"@sentry/types": "^6.19.7",
"@swc/core": "^1.2.218",
"@swc/core": "^1.2.223",
"@swc/jest": "^0.2.22",
"@testing-library/dom": "^7.31.2",
"@testing-library/jest-dom": "^5.16.4",
@ -313,7 +318,7 @@
"@types/hapi__subtext": "^7.0.0",
"@types/html-webpack-plugin": "^3.2.6",
"@types/http-proxy": "^1.17.9",
"@types/jest": "^28.1.3",
"@types/jest": "^28.1.6",
"@types/js-yaml": "^4.0.5",
"@types/jsdom": "^16.2.14",
"@types/lodash": "^4.14.181",
@ -321,7 +326,7 @@
"@types/md5-file": "^4.0.2",
"@types/mini-css-extract-plugin": "^2.4.0",
"@types/mock-fs": "^4.13.1",
"@types/node": "^16.11.45",
"@types/node": "^16.11.47",
"@types/node-fetch": "^2.6.2",
"@types/npm": "^2.0.32",
"@types/proper-lockfile": "^4.1.2",
@ -351,8 +356,9 @@
"@types/webpack-dev-server": "^4.7.2",
"@types/webpack-env": "^1.17.0",
"@types/webpack-node-externals": "^2.5.3",
"@typescript-eslint/eslint-plugin": "^5.30.7",
"@typescript-eslint/parser": "^5.30.5",
"@typescript-eslint/eslint-plugin": "^5.32.0",
"@typescript-eslint/parser": "^5.31.0",
"adr": "^1.4.1",
"ansi_up": "^5.1.0",
"chart.js": "^2.9.4",
"circular-dependency-plugin": "^5.2.2",
@ -364,11 +370,11 @@
"deepdash": "^5.3.9",
"dompurify": "^2.3.10",
"electron": "^15.5.7",
"electron-builder": "^23.1.0",
"electron-builder": "^23.3.3",
"electron-notarize": "^0.3.0",
"esbuild": "^0.14.49",
"esbuild": "^0.14.53",
"esbuild-loader": "^2.19.0",
"eslint": "^8.20.0",
"eslint": "^8.21.0",
"eslint-plugin-header": "^3.1.1",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-react": "^7.30.1",
@ -381,7 +387,7 @@
"identity-obj-proxy": "^3.0.0",
"ignore-loader": "^0.1.2",
"include-media": "^1.4.9",
"jest": "^28.1.2",
"jest": "^28.1.3",
"jest-canvas-mock": "^2.3.1",
"jest-environment-jsdom": "^28.1.3",
"jest-fetch-mock": "^3.0.3",
@ -392,7 +398,7 @@
"node-gyp": "^8.3.0",
"node-loader": "^2.0.0",
"nodemon": "^2.0.19",
"playwright": "^1.24.1",
"playwright": "^1.24.2",
"postcss": "^8.4.14",
"postcss-loader": "^6.2.1",
"randomcolor": "^0.6.2",
@ -401,10 +407,10 @@
"react-refresh-typescript": "^2.0.7",
"react-router-dom": "^5.3.3",
"react-select": "^5.4.0",
"react-select-event": "^5.5.0",
"react-select-event": "^5.5.1",
"react-table": "^7.8.0",
"react-window": "^1.8.7",
"sass": "^1.53.0",
"sass": "^1.54.2",
"sass-loader": "^12.6.0",
"sharp": "^0.30.7",
"style-loader": "^3.3.1",
@ -418,7 +424,7 @@
"typedoc-plugin-markdown": "^3.13.1",
"typescript": "^4.7.4",
"typescript-plugin-css-modules": "^3.4.0",
"webpack": "^5.73.0",
"webpack": "^5.74.0",
"webpack-cli": "^4.9.2",
"webpack-dev-server": "^4.9.3",
"webpack-node-externals": "^3.0.0",

View File

@ -288,7 +288,11 @@ exports[`add-cluster - navigation using application menu when navigating to add
</p>
<div
class="flex column"
/>
>
<textarea
data-testid="monaco-editor-for-undefined"
/>
</div>
<div
class="actions-panel"
>
@ -299,6 +303,7 @@ exports[`add-cluster - navigation using application menu when navigating to add
>
Add clusters
</button>
<div />
</div>
</div>
<div

View File

@ -6,16 +6,6 @@
import type { RenderResult } from "@testing-library/react";
import type { ApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
import { getApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
import React from "react";
// TODO: Make components free of side effects by making them deterministic
jest.mock("../../renderer/components/tooltip/withTooltip", () => ({
withTooltip: (Target: any) => ({ tooltip, tooltipOverrideDisabled, ...props }: any) => <Target {...props} />,
}));
jest.mock("../../renderer/components/monaco-editor/monaco-editor", () => ({
MonacoEditor: () => null,
}));
describe("add-cluster - navigation using application menu", () => {
let applicationBuilder: ApplicationBuilder;

View File

@ -73,15 +73,14 @@ describe("encourage user to update when sufficient time passed since update was
});
describe("given the update check", () => {
let processCheckingForUpdates: (source: string) => Promise<void>;
let processCheckingForUpdatesPromise: Promise<void>;
let processCheckingForUpdates: (source: string) => Promise<{ updateIsReadyToBeInstalled: boolean }>;
beforeEach(async () => {
processCheckingForUpdates = applicationBuilder.dis.mainDi.inject(
processCheckingForUpdatesInjectable,
);
processCheckingForUpdatesPromise = processCheckingForUpdates("irrelevant");
processCheckingForUpdates("irrelevant");
});
describe("when update downloaded", () => {
@ -94,7 +93,6 @@ describe("encourage user to update when sufficient time passed since update was
});
await downloadPlatformUpdateMock.resolve({ downloadWasSuccessful: true });
await processCheckingForUpdatesPromise;
button = rendered.getByTestId("update-button");
});
@ -107,6 +105,11 @@ describe("encourage user to update when sufficient time passed since update was
expect(button).toHaveAttribute("data-warning-level", "light");
});
// TODO: Implement after starting main and renderer is separated in ApplicationBuilder
xit("given closing the application window, when starting the application window again, still shows the button", () => {
expect(button).toBeInTheDocument();
});
describe("given some time passes, when checking for updates again", () => {
beforeEach(() => {
advanceFakeTime(daysToMilliseconds(2));

View File

@ -13,13 +13,14 @@ import type { AsyncFnMock } from "@async-fn/jest";
import asyncFn from "@async-fn/jest";
import type { DownloadPlatformUpdate } from "../../main/application-update/download-platform-update/download-platform-update.injectable";
import downloadPlatformUpdateInjectable from "../../main/application-update/download-platform-update/download-platform-update.injectable";
import showApplicationWindowInjectable from "../../main/start-main-application/lens-window/show-application-window.injectable";
import closeAllWindowsInjectable from "../../main/start-main-application/lens-window/hide-all-windows/close-all-windows.injectable";
import applicationWindowInjectable from "../../main/start-main-application/lens-window/application-window/application-window.injectable";
import type { LensWindow } from "../../main/start-main-application/lens-window/application-window/lens-window-injection-token";
describe("installing update using tray", () => {
let applicationBuilder: ApplicationBuilder;
let checkForPlatformUpdatesMock: AsyncFnMock<CheckForPlatformUpdates>;
let downloadPlatformUpdateMock: AsyncFnMock<DownloadPlatformUpdate>;
let showApplicationWindowMock: jest.Mock;
beforeEach(() => {
applicationBuilder = getApplicationBuilder();
@ -27,9 +28,6 @@ describe("installing update using tray", () => {
applicationBuilder.beforeApplicationStart(({ mainDi }) => {
checkForPlatformUpdatesMock = asyncFn();
downloadPlatformUpdateMock = asyncFn();
showApplicationWindowMock = jest.fn();
mainDi.override(showApplicationWindowInjectable, () => showApplicationWindowMock);
mainDi.override(
checkForPlatformUpdatesInjectable,
@ -61,15 +59,77 @@ describe("installing update using tray", () => {
expect(applicationBuilder.tray.get("install-update")).toBeNull();
});
describe("when user checks for updates using tray", () => {
let processCheckingForUpdatesPromise: Promise<void>;
describe("given all application windows are closed, when checking for updates", () => {
let applicationWindow: LensWindow;
let closeAllWindows: () => void;
beforeEach(async () => {
processCheckingForUpdatesPromise = applicationBuilder.tray.click("check-for-updates");
beforeEach(() => {
const mainDi = applicationBuilder.dis.mainDi;
closeAllWindows = mainDi.inject(closeAllWindowsInjectable);
applicationWindow = mainDi.inject(applicationWindowInjectable);
closeAllWindows();
applicationBuilder.tray.click("check-for-updates");
});
it("does not show application window yet", () => {
expect(showApplicationWindowMock).not.toHaveBeenCalled();
describe("when check for update resolves with new update", () => {
beforeEach(async () => {
await checkForPlatformUpdatesMock.resolve({
updateWasDiscovered: true,
version: "some-version",
});
});
it("does not show application window yet", () => {
expect(applicationWindow.isVisible).toBe(false);
});
describe("when download of update resolves with success", () => {
beforeEach(async () => {
await downloadPlatformUpdateMock.resolve({ downloadWasSuccessful: true });
});
it("shows the application window", () => {
expect(applicationWindow.isVisible).toBe(true);
});
it("given closing application window again and checking for updates again using tray, when check resolves with same version that was earlier downloaded, shows the application window", async () => {
closeAllWindows();
applicationBuilder.tray.click("check-for-updates");
await checkForPlatformUpdatesMock.resolve({
updateWasDiscovered: true,
version: "some-version",
});
expect(applicationWindow.isVisible).toBe(true);
});
});
it("when download of update resolves with failure, does not show the application window", async () => {
await downloadPlatformUpdateMock.resolve({ downloadWasSuccessful: false });
expect(applicationWindow.isVisible).toBe(false);
});
});
it("when process resolves without new update, does not show the application window", async () => {
await checkForPlatformUpdatesMock.resolve({
updateWasDiscovered: false,
});
expect(applicationWindow.isVisible).toBe(false);
});
});
describe("when user checks for updates using tray", () => {
beforeEach(() => {
applicationBuilder.tray.click("check-for-updates");
});
it("user cannot check for updates again", () => {
@ -97,12 +157,6 @@ describe("installing update using tray", () => {
await checkForPlatformUpdatesMock.resolve({
updateWasDiscovered: false,
});
await processCheckingForUpdatesPromise;
});
it("shows application window", () => {
expect(showApplicationWindowMock).toHaveBeenCalled();
});
it("user cannot install update", () => {
@ -132,12 +186,6 @@ describe("installing update using tray", () => {
updateWasDiscovered: true,
version: "some-version",
});
await processCheckingForUpdatesPromise;
});
it("shows application window", () => {
expect(showApplicationWindowMock).toHaveBeenCalled();
});
it("user cannot check for updates again yet", () => {

View File

@ -63,7 +63,7 @@ describe("installing update", () => {
describe("when started", () => {
let rendered: RenderResult;
let processCheckingForUpdates: (source: string) => Promise<void>;
let processCheckingForUpdates: (source: string) => Promise<{ updateIsReadyToBeInstalled: boolean }>;
beforeEach(async () => {
rendered = await applicationBuilder.render();
@ -84,10 +84,8 @@ describe("installing update", () => {
});
describe("when user checks for updates", () => {
let processCheckingForUpdatesPromise: Promise<void>;
beforeEach(async () => {
processCheckingForUpdatesPromise = processCheckingForUpdates("irrelevant");
beforeEach(() => {
processCheckingForUpdates("irrelevant");
});
it("checks for updates", () => {
@ -112,8 +110,6 @@ describe("installing update", () => {
await checkForPlatformUpdatesMock.resolve({
updateWasDiscovered: false,
});
await processCheckingForUpdatesPromise;
});
it("shows tray icon for normal", () => {
@ -137,8 +133,6 @@ describe("installing update", () => {
updateWasDiscovered: true,
version: "some-version",
});
await processCheckingForUpdatesPromise;
});
it("starts downloading the update", () => {
@ -243,7 +237,6 @@ describe("installing update", () => {
"/some-static-files-directory/icons/trayIconCheckingForUpdatesTemplate.png",
);
});
});
});
});

View File

@ -7,8 +7,6 @@ import { getApplicationBuilder } from "../../renderer/components/test-utils/get-
import type { RenderResult } from "@testing-library/react";
import electronUpdaterIsActiveInjectable from "../../main/electron-app/features/electron-updater-is-active.injectable";
import publishIsConfiguredInjectable from "../../main/application-update/publish-is-configured.injectable";
import type { AsyncFnMock } from "@async-fn/jest";
import asyncFn from "@async-fn/jest";
import processCheckingForUpdatesInjectable from "../../main/application-update/check-for-updates/process-checking-for-updates.injectable";
import periodicalCheckForUpdatesInjectable from "../../main/application-update/periodical-check-for-updates/periodical-check-for-updates.injectable";
import { advanceFakeTime, useFakeTime } from "../../common/test-utils/use-fake-time";
@ -17,7 +15,7 @@ const ENOUGH_TIME = 1000 * 60 * 60 * 2;
describe("periodical checking of updates", () => {
let applicationBuilder: ApplicationBuilder;
let processCheckingForUpdatesMock: AsyncFnMock<() => Promise<void>>;
let processCheckingForUpdatesMock: jest.Mock;
beforeEach(() => {
useFakeTime("2015-10-21T07:28:00Z");
@ -28,7 +26,7 @@ describe("periodical checking of updates", () => {
mainDi.unoverride(periodicalCheckForUpdatesInjectable);
mainDi.permitSideEffects(periodicalCheckForUpdatesInjectable);
processCheckingForUpdatesMock = asyncFn();
processCheckingForUpdatesMock = jest.fn();
mainDi.override(
processCheckingForUpdatesInjectable,

View File

@ -67,7 +67,7 @@ describe("selection of update stability", () => {
describe("when started", () => {
let rendered: RenderResult;
let processCheckingForUpdates: (source: string) => Promise<void>;
let processCheckingForUpdates: (source: string) => Promise<{ updateIsReadyToBeInstalled: boolean }>;
beforeEach(async () => {
rendered = await applicationBuilder.render();

View File

@ -503,7 +503,6 @@ exports[`cluster - order of sidebar items when rendered renders 1`] = `
>
<i
class="Icon material interactive focusable small"
id="tooltip_target_14"
tabindex="0"
>
<span
@ -512,8 +511,10 @@ exports[`cluster - order of sidebar items when rendered renders 1`] = `
>
close
</span>
<div />
</i>
<div>
Close ⌘+W
</div>
</div>
</div>
</div>
@ -537,12 +538,13 @@ exports[`cluster - order of sidebar items when rendered renders 1`] = `
>
add
</span>
<div />
</i>
<div>
New tab
</div>
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_16"
tabindex="0"
>
<span
@ -551,11 +553,12 @@ exports[`cluster - order of sidebar items when rendered renders 1`] = `
>
fullscreen
</span>
<div />
</i>
<div>
Fit to window
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_17"
tabindex="0"
>
<span
@ -564,8 +567,10 @@ exports[`cluster - order of sidebar items when rendered renders 1`] = `
>
keyboard_arrow_up
</span>
<div />
</i>
<div>
Open
</div>
</div>
</div>
</div>
@ -1135,7 +1140,6 @@ exports[`cluster - order of sidebar items when rendered when parent is expanded
>
<i
class="Icon material interactive focusable small"
id="tooltip_target_52"
tabindex="0"
>
<span
@ -1144,8 +1148,10 @@ exports[`cluster - order of sidebar items when rendered when parent is expanded
>
close
</span>
<div />
</i>
<div>
Close ⌘+W
</div>
</div>
</div>
</div>
@ -1169,12 +1175,13 @@ exports[`cluster - order of sidebar items when rendered when parent is expanded
>
add
</span>
<div />
</i>
<div>
New tab
</div>
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_54"
tabindex="0"
>
<span
@ -1183,11 +1190,12 @@ exports[`cluster - order of sidebar items when rendered when parent is expanded
>
fullscreen
</span>
<div />
</i>
<div>
Fit to window
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_55"
tabindex="0"
>
<span
@ -1196,8 +1204,10 @@ exports[`cluster - order of sidebar items when rendered when parent is expanded
>
keyboard_arrow_up
</span>
<div />
</i>
<div>
Open
</div>
</div>
</div>
</div>

View File

@ -472,7 +472,6 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
>
<i
class="Icon material interactive focusable small"
id="tooltip_target_177"
tabindex="0"
>
<span
@ -481,8 +480,10 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
>
close
</span>
<div />
</i>
<div>
Close ⌘+W
</div>
</div>
</div>
</div>
@ -506,12 +507,13 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
>
add
</span>
<div />
</i>
<div>
New tab
</div>
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_179"
tabindex="0"
>
<span
@ -520,11 +522,12 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
>
fullscreen
</span>
<div />
</i>
<div>
Fit to window
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_180"
tabindex="0"
>
<span
@ -533,8 +536,10 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
>
keyboard_arrow_up
</span>
<div />
</i>
<div>
Open
</div>
</div>
</div>
</div>
@ -1015,7 +1020,6 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
>
<i
class="Icon material interactive focusable small"
id="tooltip_target_215"
tabindex="0"
>
<span
@ -1024,8 +1028,10 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
>
close
</span>
<div />
</i>
<div>
Close ⌘+W
</div>
</div>
</div>
</div>
@ -1049,12 +1055,13 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
>
add
</span>
<div />
</i>
<div>
New tab
</div>
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_217"
tabindex="0"
>
<span
@ -1063,11 +1070,12 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
>
fullscreen
</span>
<div />
</i>
<div>
Fit to window
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_218"
tabindex="0"
>
<span
@ -1076,8 +1084,10 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
>
keyboard_arrow_up
</span>
<div />
</i>
<div>
Open
</div>
</div>
</div>
</div>
@ -1580,7 +1590,6 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
>
<i
class="Icon material interactive focusable small"
id="tooltip_target_272"
tabindex="0"
>
<span
@ -1589,8 +1598,10 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
>
close
</span>
<div />
</i>
<div>
Close ⌘+W
</div>
</div>
</div>
</div>
@ -1614,12 +1625,13 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
>
add
</span>
<div />
</i>
<div>
New tab
</div>
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_274"
tabindex="0"
>
<span
@ -1628,11 +1640,12 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
>
fullscreen
</span>
<div />
</i>
<div>
Fit to window
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_275"
tabindex="0"
>
<span
@ -1641,8 +1654,10 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
>
keyboard_arrow_up
</span>
<div />
</i>
<div>
Open
</div>
</div>
</div>
</div>
@ -2026,7 +2041,6 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
>
<i
class="Icon material interactive focusable small"
id="tooltip_target_332"
tabindex="0"
>
<span
@ -2035,8 +2049,10 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
>
close
</span>
<div />
</i>
<div>
Close ⌘+W
</div>
</div>
</div>
</div>
@ -2060,12 +2076,13 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
>
add
</span>
<div />
</i>
<div>
New tab
</div>
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_334"
tabindex="0"
>
<span
@ -2074,11 +2091,12 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
>
fullscreen
</span>
<div />
</i>
<div>
Fit to window
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_335"
tabindex="0"
>
<span
@ -2087,8 +2105,10 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
>
keyboard_arrow_up
</span>
<div />
</i>
<div>
Open
</div>
</div>
</div>
</div>
@ -2449,7 +2469,6 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
>
<i
class="Icon material interactive focusable small"
id="tooltip_target_14"
tabindex="0"
>
<span
@ -2458,8 +2477,10 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
>
close
</span>
<div />
</i>
<div>
Close ⌘+W
</div>
</div>
</div>
</div>
@ -2483,12 +2504,13 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
>
add
</span>
<div />
</i>
<div>
New tab
</div>
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_16"
tabindex="0"
>
<span
@ -2497,11 +2519,12 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
>
fullscreen
</span>
<div />
</i>
<div>
Fit to window
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_17"
tabindex="0"
>
<span
@ -2510,8 +2533,10 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
>
keyboard_arrow_up
</span>
<div />
</i>
<div>
Open
</div>
</div>
</div>
</div>
@ -3014,7 +3039,6 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
>
<i
class="Icon material interactive focusable small"
id="tooltip_target_82"
tabindex="0"
>
<span
@ -3023,8 +3047,10 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
>
close
</span>
<div />
</i>
<div>
Close ⌘+W
</div>
</div>
</div>
</div>
@ -3048,12 +3074,13 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
>
add
</span>
<div />
</i>
<div>
New tab
</div>
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_84"
tabindex="0"
>
<span
@ -3062,11 +3089,12 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
>
fullscreen
</span>
<div />
</i>
<div>
Fit to window
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_85"
tabindex="0"
>
<span
@ -3075,8 +3103,10 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
>
keyboard_arrow_up
</span>
<div />
</i>
<div>
Open
</div>
</div>
</div>
</div>
@ -3557,7 +3587,6 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
>
<i
class="Icon material interactive focusable small"
id="tooltip_target_139"
tabindex="0"
>
<span
@ -3566,8 +3595,10 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
>
close
</span>
<div />
</i>
<div>
Close ⌘+W
</div>
</div>
</div>
</div>
@ -3591,12 +3622,13 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
>
add
</span>
<div />
</i>
<div>
New tab
</div>
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_141"
tabindex="0"
>
<span
@ -3605,11 +3637,12 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
>
fullscreen
</span>
<div />
</i>
<div>
Fit to window
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_142"
tabindex="0"
>
<span
@ -3618,8 +3651,10 @@ exports[`cluster - sidebar and tab navigation for core given core registrations
>
keyboard_arrow_up
</span>
<div />
</i>
<div>
Open
</div>
</div>
</div>
</div>

View File

@ -473,7 +473,6 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
<i
class="Icon material interactive focusable small"
tabindex="0"
tooltip="Close ⌘+W"
>
<span
class="icon"
@ -482,6 +481,9 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
close
</span>
</i>
<div>
Close ⌘+W
</div>
</div>
</div>
</div>
@ -498,7 +500,6 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
class="Icon new-dock-tab material interactive focusable"
id="menu-actions-for-dock"
tabindex="0"
tooltip="New tab"
>
<span
class="icon"
@ -507,11 +508,13 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
add
</span>
</i>
<div>
New tab
</div>
</div>
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Fit to window"
>
<span
class="icon"
@ -520,10 +523,12 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
fullscreen
</span>
</i>
<div>
Fit to window
</div>
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Open"
>
<span
class="icon"
@ -532,6 +537,9 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
keyboard_arrow_up
</span>
</i>
<div>
Open
</div>
</div>
</div>
</div>
@ -1013,7 +1021,6 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
<i
class="Icon material interactive focusable small"
tabindex="0"
tooltip="Close ⌘+W"
>
<span
class="icon"
@ -1022,6 +1029,9 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
close
</span>
</i>
<div>
Close ⌘+W
</div>
</div>
</div>
</div>
@ -1038,7 +1048,6 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
class="Icon new-dock-tab material interactive focusable"
id="menu-actions-for-dock"
tabindex="0"
tooltip="New tab"
>
<span
class="icon"
@ -1047,11 +1056,13 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
add
</span>
</i>
<div>
New tab
</div>
</div>
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Fit to window"
>
<span
class="icon"
@ -1060,10 +1071,12 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
fullscreen
</span>
</i>
<div>
Fit to window
</div>
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Open"
>
<span
class="icon"
@ -1072,6 +1085,9 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
keyboard_arrow_up
</span>
</i>
<div>
Open
</div>
</div>
</div>
</div>
@ -1593,7 +1609,6 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
<i
class="Icon material interactive focusable small"
tabindex="0"
tooltip="Close ⌘+W"
>
<span
class="icon"
@ -1602,6 +1617,9 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
close
</span>
</i>
<div>
Close ⌘+W
</div>
</div>
</div>
</div>
@ -1618,7 +1636,6 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
class="Icon new-dock-tab material interactive focusable"
id="menu-actions-for-dock"
tabindex="0"
tooltip="New tab"
>
<span
class="icon"
@ -1627,11 +1644,13 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
add
</span>
</i>
<div>
New tab
</div>
</div>
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Fit to window"
>
<span
class="icon"
@ -1640,10 +1659,12 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
fullscreen
</span>
</i>
<div>
Fit to window
</div>
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Open"
>
<span
class="icon"
@ -1652,6 +1673,9 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
keyboard_arrow_up
</span>
</i>
<div>
Open
</div>
</div>
</div>
</div>
@ -2093,7 +2117,6 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
<i
class="Icon material interactive focusable small"
tabindex="0"
tooltip="Close ⌘+W"
>
<span
class="icon"
@ -2102,6 +2125,9 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
close
</span>
</i>
<div>
Close ⌘+W
</div>
</div>
</div>
</div>
@ -2118,7 +2144,6 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
class="Icon new-dock-tab material interactive focusable"
id="menu-actions-for-dock"
tabindex="0"
tooltip="New tab"
>
<span
class="icon"
@ -2127,11 +2152,13 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
add
</span>
</i>
<div>
New tab
</div>
</div>
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Fit to window"
>
<span
class="icon"
@ -2140,10 +2167,12 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
fullscreen
</span>
</i>
<div>
Fit to window
</div>
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Open"
>
<span
class="icon"
@ -2152,6 +2181,9 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
keyboard_arrow_up
</span>
</i>
<div>
Open
</div>
</div>
</div>
</div>
@ -2593,7 +2625,6 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
<i
class="Icon material interactive focusable small"
tabindex="0"
tooltip="Close ⌘+W"
>
<span
class="icon"
@ -2602,6 +2633,9 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
close
</span>
</i>
<div>
Close ⌘+W
</div>
</div>
</div>
</div>
@ -2618,7 +2652,6 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
class="Icon new-dock-tab material interactive focusable"
id="menu-actions-for-dock"
tabindex="0"
tooltip="New tab"
>
<span
class="icon"
@ -2627,11 +2660,13 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
add
</span>
</i>
<div>
New tab
</div>
</div>
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Fit to window"
>
<span
class="icon"
@ -2640,10 +2675,12 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
fullscreen
</span>
</i>
<div>
Fit to window
</div>
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Open"
>
<span
class="icon"
@ -2652,6 +2689,9 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
keyboard_arrow_up
</span>
</i>
<div>
Open
</div>
</div>
</div>
</div>
@ -3052,7 +3092,6 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
<i
class="Icon material interactive focusable small"
tabindex="0"
tooltip="Close ⌘+W"
>
<span
class="icon"
@ -3061,6 +3100,9 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
close
</span>
</i>
<div>
Close ⌘+W
</div>
</div>
</div>
</div>
@ -3077,7 +3119,6 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
class="Icon new-dock-tab material interactive focusable"
id="menu-actions-for-dock"
tabindex="0"
tooltip="New tab"
>
<span
class="icon"
@ -3086,11 +3127,13 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
add
</span>
</i>
<div>
New tab
</div>
</div>
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Fit to window"
>
<span
class="icon"
@ -3099,10 +3142,12 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
fullscreen
</span>
</i>
<div>
Fit to window
</div>
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Open"
>
<span
class="icon"
@ -3111,6 +3156,9 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
keyboard_arrow_up
</span>
</i>
<div>
Open
</div>
</div>
</div>
</div>
@ -3632,7 +3680,6 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
<i
class="Icon material interactive focusable small"
tabindex="0"
tooltip="Close ⌘+W"
>
<span
class="icon"
@ -3641,6 +3688,9 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
close
</span>
</i>
<div>
Close ⌘+W
</div>
</div>
</div>
</div>
@ -3657,7 +3707,6 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
class="Icon new-dock-tab material interactive focusable"
id="menu-actions-for-dock"
tabindex="0"
tooltip="New tab"
>
<span
class="icon"
@ -3666,11 +3715,13 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
add
</span>
</i>
<div>
New tab
</div>
</div>
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Fit to window"
>
<span
class="icon"
@ -3679,10 +3730,12 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
fullscreen
</span>
</i>
<div>
Fit to window
</div>
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Open"
>
<span
class="icon"
@ -3691,6 +3744,9 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
keyboard_arrow_up
</span>
</i>
<div>
Open
</div>
</div>
</div>
</div>
@ -4172,7 +4228,6 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
<i
class="Icon material interactive focusable small"
tabindex="0"
tooltip="Close ⌘+W"
>
<span
class="icon"
@ -4181,6 +4236,9 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
close
</span>
</i>
<div>
Close ⌘+W
</div>
</div>
</div>
</div>
@ -4197,7 +4255,6 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
class="Icon new-dock-tab material interactive focusable"
id="menu-actions-for-dock"
tabindex="0"
tooltip="New tab"
>
<span
class="icon"
@ -4206,11 +4263,13 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
add
</span>
</i>
<div>
New tab
</div>
</div>
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Fit to window"
>
<span
class="icon"
@ -4219,10 +4278,12 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
fullscreen
</span>
</i>
<div>
Fit to window
</div>
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Open"
>
<span
class="icon"
@ -4231,6 +4292,9 @@ exports[`cluster - sidebar and tab navigation for extensions given extension wit
keyboard_arrow_up
</span>
</i>
<div>
Open
</div>
</div>
</div>
</div>

View File

@ -442,7 +442,6 @@ exports[`cluster - visibility of sidebar items given kube resource for route is
>
<i
class="Icon material interactive focusable small"
id="tooltip_target_13"
tabindex="0"
>
<span
@ -451,8 +450,10 @@ exports[`cluster - visibility of sidebar items given kube resource for route is
>
close
</span>
<div />
</i>
<div>
Close ⌘+W
</div>
</div>
</div>
</div>
@ -476,12 +477,13 @@ exports[`cluster - visibility of sidebar items given kube resource for route is
>
add
</span>
<div />
</i>
<div>
New tab
</div>
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_15"
tabindex="0"
>
<span
@ -490,11 +492,12 @@ exports[`cluster - visibility of sidebar items given kube resource for route is
>
fullscreen
</span>
<div />
</i>
<div>
Fit to window
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_16"
tabindex="0"
>
<span
@ -503,8 +506,10 @@ exports[`cluster - visibility of sidebar items given kube resource for route is
>
keyboard_arrow_up
</span>
<div />
</i>
<div>
Open
</div>
</div>
</div>
</div>
@ -999,7 +1004,6 @@ exports[`cluster - visibility of sidebar items given kube resource for route is
>
<i
class="Icon material interactive focusable small"
id="tooltip_target_49"
tabindex="0"
>
<span
@ -1008,8 +1012,10 @@ exports[`cluster - visibility of sidebar items given kube resource for route is
>
close
</span>
<div />
</i>
<div>
Close ⌘+W
</div>
</div>
</div>
</div>
@ -1033,12 +1039,13 @@ exports[`cluster - visibility of sidebar items given kube resource for route is
>
add
</span>
<div />
</i>
<div>
New tab
</div>
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_51"
tabindex="0"
>
<span
@ -1047,11 +1054,12 @@ exports[`cluster - visibility of sidebar items given kube resource for route is
>
fullscreen
</span>
<div />
</i>
<div>
Fit to window
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_52"
tabindex="0"
>
<span
@ -1060,8 +1068,10 @@ exports[`cluster - visibility of sidebar items given kube resource for route is
>
keyboard_arrow_up
</span>
<div />
</i>
<div>
Open
</div>
</div>
</div>
</div>

View File

@ -324,7 +324,6 @@ exports[`disable-cluster-pages-when-cluster-is-not-relevant given extension shou
>
<i
class="Icon material interactive focusable small"
id="tooltip_target_129"
tabindex="0"
>
<span
@ -333,8 +332,10 @@ exports[`disable-cluster-pages-when-cluster-is-not-relevant given extension shou
>
close
</span>
<div />
</i>
<div>
Close ⌘+W
</div>
</div>
</div>
</div>
@ -358,12 +359,13 @@ exports[`disable-cluster-pages-when-cluster-is-not-relevant given extension shou
>
add
</span>
<div />
</i>
<div>
New tab
</div>
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_131"
tabindex="0"
>
<span
@ -372,11 +374,12 @@ exports[`disable-cluster-pages-when-cluster-is-not-relevant given extension shou
>
fullscreen
</span>
<div />
</i>
<div>
Fit to window
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_132"
tabindex="0"
>
<span
@ -385,8 +388,10 @@ exports[`disable-cluster-pages-when-cluster-is-not-relevant given extension shou
>
keyboard_arrow_up
</span>
<div />
</i>
<div>
Open
</div>
</div>
</div>
</div>
@ -839,7 +844,6 @@ exports[`disable-cluster-pages-when-cluster-is-not-relevant given extension shou
>
<i
class="Icon material interactive focusable small"
id="tooltip_target_71"
tabindex="0"
>
<span
@ -848,8 +852,10 @@ exports[`disable-cluster-pages-when-cluster-is-not-relevant given extension shou
>
close
</span>
<div />
</i>
<div>
Close ⌘+W
</div>
</div>
</div>
</div>
@ -873,12 +879,13 @@ exports[`disable-cluster-pages-when-cluster-is-not-relevant given extension shou
>
add
</span>
<div />
</i>
<div>
New tab
</div>
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_73"
tabindex="0"
>
<span
@ -887,11 +894,12 @@ exports[`disable-cluster-pages-when-cluster-is-not-relevant given extension shou
>
fullscreen
</span>
<div />
</i>
<div>
Fit to window
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_74"
tabindex="0"
>
<span
@ -900,8 +908,10 @@ exports[`disable-cluster-pages-when-cluster-is-not-relevant given extension shou
>
keyboard_arrow_up
</span>
<div />
</i>
<div>
Open
</div>
</div>
</div>
</div>
@ -1354,7 +1364,6 @@ exports[`disable-cluster-pages-when-cluster-is-not-relevant given not yet known
>
<i
class="Icon material interactive focusable small"
id="tooltip_target_13"
tabindex="0"
>
<span
@ -1363,8 +1372,10 @@ exports[`disable-cluster-pages-when-cluster-is-not-relevant given not yet known
>
close
</span>
<div />
</i>
<div>
Close ⌘+W
</div>
</div>
</div>
</div>
@ -1388,12 +1399,13 @@ exports[`disable-cluster-pages-when-cluster-is-not-relevant given not yet known
>
add
</span>
<div />
</i>
<div>
New tab
</div>
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_15"
tabindex="0"
>
<span
@ -1402,11 +1414,12 @@ exports[`disable-cluster-pages-when-cluster-is-not-relevant given not yet known
>
fullscreen
</span>
<div />
</i>
<div>
Fit to window
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_16"
tabindex="0"
>
<span
@ -1415,8 +1428,10 @@ exports[`disable-cluster-pages-when-cluster-is-not-relevant given not yet known
>
keyboard_arrow_up
</span>
<div />
</i>
<div>
Open
</div>
</div>
</div>
</div>

View File

@ -463,7 +463,6 @@ exports[`disable sidebar items when cluster is not relevant given extension shou
>
<i
class="Icon material interactive focusable small"
id="tooltip_target_129"
tabindex="0"
>
<span
@ -472,8 +471,10 @@ exports[`disable sidebar items when cluster is not relevant given extension shou
>
close
</span>
<div />
</i>
<div>
Close ⌘+W
</div>
</div>
</div>
</div>
@ -497,12 +498,13 @@ exports[`disable sidebar items when cluster is not relevant given extension shou
>
add
</span>
<div />
</i>
<div>
New tab
</div>
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_131"
tabindex="0"
>
<span
@ -511,11 +513,12 @@ exports[`disable sidebar items when cluster is not relevant given extension shou
>
fullscreen
</span>
<div />
</i>
<div>
Fit to window
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_132"
tabindex="0"
>
<span
@ -524,8 +527,10 @@ exports[`disable sidebar items when cluster is not relevant given extension shou
>
keyboard_arrow_up
</span>
<div />
</i>
<div>
Open
</div>
</div>
</div>
</div>
@ -978,7 +983,6 @@ exports[`disable sidebar items when cluster is not relevant given extension shou
>
<i
class="Icon material interactive focusable small"
id="tooltip_target_71"
tabindex="0"
>
<span
@ -987,8 +991,10 @@ exports[`disable sidebar items when cluster is not relevant given extension shou
>
close
</span>
<div />
</i>
<div>
Close ⌘+W
</div>
</div>
</div>
</div>
@ -1012,12 +1018,13 @@ exports[`disable sidebar items when cluster is not relevant given extension shou
>
add
</span>
<div />
</i>
<div>
New tab
</div>
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_73"
tabindex="0"
>
<span
@ -1026,11 +1033,12 @@ exports[`disable sidebar items when cluster is not relevant given extension shou
>
fullscreen
</span>
<div />
</i>
<div>
Fit to window
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_74"
tabindex="0"
>
<span
@ -1039,8 +1047,10 @@ exports[`disable sidebar items when cluster is not relevant given extension shou
>
keyboard_arrow_up
</span>
<div />
</i>
<div>
Open
</div>
</div>
</div>
</div>
@ -1493,7 +1503,6 @@ exports[`disable sidebar items when cluster is not relevant given not yet known
>
<i
class="Icon material interactive focusable small"
id="tooltip_target_13"
tabindex="0"
>
<span
@ -1502,8 +1511,10 @@ exports[`disable sidebar items when cluster is not relevant given not yet known
>
close
</span>
<div />
</i>
<div>
Close ⌘+W
</div>
</div>
</div>
</div>
@ -1527,12 +1538,13 @@ exports[`disable sidebar items when cluster is not relevant given not yet known
>
add
</span>
<div />
</i>
<div>
New tab
</div>
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_15"
tabindex="0"
>
<span
@ -1541,11 +1553,12 @@ exports[`disable sidebar items when cluster is not relevant given not yet known
>
fullscreen
</span>
<div />
</i>
<div>
Fit to window
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_16"
tabindex="0"
>
<span
@ -1554,8 +1567,10 @@ exports[`disable sidebar items when cluster is not relevant given not yet known
>
keyboard_arrow_up
</span>
<div />
</i>
<div>
Open
</div>
</div>
</div>
</div>

View File

@ -281,7 +281,6 @@ exports[`disable kube object detail items when cluster is not relevant given ext
some-kind: some-name
<i
class="Icon material interactive focusable"
id="tooltip_target_161"
tabindex="0"
>
<span
@ -290,8 +289,10 @@ exports[`disable kube object detail items when cluster is not relevant given ext
>
content_copy
</span>
<div />
</i>
<div>
Copy
</div>
</div>
<ul
class="Menu MenuActions flex KubeObjectMenu toolbar gaps right bottom"
@ -299,7 +300,6 @@ exports[`disable kube object detail items when cluster is not relevant given ext
/>
<i
class="Icon material interactive focusable"
id="tooltip_target_162"
tabindex="0"
>
<span
@ -308,8 +308,10 @@ exports[`disable kube object detail items when cluster is not relevant given ext
>
close
</span>
<div />
</i>
<div>
Close
</div>
</div>
<div
class="drawer-content flex column box grow"
@ -379,7 +381,6 @@ exports[`disable kube object detail items when cluster is not relevant given ext
>
<i
class="Icon material interactive focusable small"
id="tooltip_target_153"
tabindex="0"
>
<span
@ -388,8 +389,10 @@ exports[`disable kube object detail items when cluster is not relevant given ext
>
close
</span>
<div />
</i>
<div>
Close ⌘+W
</div>
</div>
</div>
</div>
@ -413,12 +416,13 @@ exports[`disable kube object detail items when cluster is not relevant given ext
>
add
</span>
<div />
</i>
<div>
New tab
</div>
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_155"
tabindex="0"
>
<span
@ -427,11 +431,12 @@ exports[`disable kube object detail items when cluster is not relevant given ext
>
fullscreen
</span>
<div />
</i>
<div>
Fit to window
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_156"
tabindex="0"
>
<span
@ -440,8 +445,10 @@ exports[`disable kube object detail items when cluster is not relevant given ext
>
keyboard_arrow_up
</span>
<div />
</i>
<div>
Open
</div>
</div>
</div>
</div>
@ -732,7 +739,6 @@ exports[`disable kube object detail items when cluster is not relevant given ext
some-kind: some-name
<i
class="Icon material interactive focusable"
id="tooltip_target_91"
tabindex="0"
>
<span
@ -741,8 +747,10 @@ exports[`disable kube object detail items when cluster is not relevant given ext
>
content_copy
</span>
<div />
</i>
<div>
Copy
</div>
</div>
<ul
class="Menu MenuActions flex KubeObjectMenu toolbar gaps right bottom"
@ -750,7 +758,6 @@ exports[`disable kube object detail items when cluster is not relevant given ext
/>
<i
class="Icon material interactive focusable"
id="tooltip_target_92"
tabindex="0"
>
<span
@ -759,8 +766,10 @@ exports[`disable kube object detail items when cluster is not relevant given ext
>
close
</span>
<div />
</i>
<div>
Close
</div>
</div>
<div
class="drawer-content flex column box grow"
@ -868,7 +877,6 @@ exports[`disable kube object detail items when cluster is not relevant given ext
>
<i
class="Icon material interactive focusable small"
id="tooltip_target_83"
tabindex="0"
>
<span
@ -877,8 +885,10 @@ exports[`disable kube object detail items when cluster is not relevant given ext
>
close
</span>
<div />
</i>
<div>
Close ⌘+W
</div>
</div>
</div>
</div>
@ -902,12 +912,13 @@ exports[`disable kube object detail items when cluster is not relevant given ext
>
add
</span>
<div />
</i>
<div>
New tab
</div>
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_85"
tabindex="0"
>
<span
@ -916,11 +927,12 @@ exports[`disable kube object detail items when cluster is not relevant given ext
>
fullscreen
</span>
<div />
</i>
<div>
Fit to window
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_86"
tabindex="0"
>
<span
@ -929,8 +941,10 @@ exports[`disable kube object detail items when cluster is not relevant given ext
>
keyboard_arrow_up
</span>
<div />
</i>
<div>
Open
</div>
</div>
</div>
</div>
@ -1221,7 +1235,6 @@ exports[`disable kube object detail items when cluster is not relevant given not
some-kind: some-name
<i
class="Icon material interactive focusable"
id="tooltip_target_21"
tabindex="0"
>
<span
@ -1230,8 +1243,10 @@ exports[`disable kube object detail items when cluster is not relevant given not
>
content_copy
</span>
<div />
</i>
<div>
Copy
</div>
</div>
<ul
class="Menu MenuActions flex KubeObjectMenu toolbar gaps right bottom"
@ -1239,7 +1254,6 @@ exports[`disable kube object detail items when cluster is not relevant given not
/>
<i
class="Icon material interactive focusable"
id="tooltip_target_22"
tabindex="0"
>
<span
@ -1248,8 +1262,10 @@ exports[`disable kube object detail items when cluster is not relevant given not
>
close
</span>
<div />
</i>
<div>
Close
</div>
</div>
<div
class="drawer-content flex column box grow"
@ -1357,7 +1373,6 @@ exports[`disable kube object detail items when cluster is not relevant given not
>
<i
class="Icon material interactive focusable small"
id="tooltip_target_13"
tabindex="0"
>
<span
@ -1366,8 +1381,10 @@ exports[`disable kube object detail items when cluster is not relevant given not
>
close
</span>
<div />
</i>
<div>
Close ⌘+W
</div>
</div>
</div>
</div>
@ -1391,12 +1408,13 @@ exports[`disable kube object detail items when cluster is not relevant given not
>
add
</span>
<div />
</i>
<div>
New tab
</div>
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_15"
tabindex="0"
>
<span
@ -1405,11 +1423,12 @@ exports[`disable kube object detail items when cluster is not relevant given not
>
fullscreen
</span>
<div />
</i>
<div>
Fit to window
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_16"
tabindex="0"
>
<span
@ -1418,8 +1437,10 @@ exports[`disable kube object detail items when cluster is not relevant given not
>
keyboard_arrow_up
</span>
<div />
</i>
<div>
Open
</div>
</div>
</div>
</div>

View File

@ -329,7 +329,6 @@ exports[`disable kube object menu items when cluster is not relevant given exten
>
<i
class="Icon material interactive focusable small"
id="tooltip_target_137"
tabindex="0"
>
<span
@ -338,8 +337,10 @@ exports[`disable kube object menu items when cluster is not relevant given exten
>
close
</span>
<div />
</i>
<div>
Close ⌘+W
</div>
</div>
</div>
</div>
@ -363,12 +364,13 @@ exports[`disable kube object menu items when cluster is not relevant given exten
>
add
</span>
<div />
</i>
<div>
New tab
</div>
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_139"
tabindex="0"
>
<span
@ -377,11 +379,12 @@ exports[`disable kube object menu items when cluster is not relevant given exten
>
fullscreen
</span>
<div />
</i>
<div>
Fit to window
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_140"
tabindex="0"
>
<span
@ -390,8 +393,10 @@ exports[`disable kube object menu items when cluster is not relevant given exten
>
keyboard_arrow_up
</span>
<div />
</i>
<div>
Open
</div>
</div>
</div>
</div>
@ -724,7 +729,6 @@ exports[`disable kube object menu items when cluster is not relevant given exten
>
<i
class="Icon material interactive focusable small"
id="tooltip_target_75"
tabindex="0"
>
<span
@ -733,8 +737,10 @@ exports[`disable kube object menu items when cluster is not relevant given exten
>
close
</span>
<div />
</i>
<div>
Close ⌘+W
</div>
</div>
</div>
</div>
@ -758,12 +764,13 @@ exports[`disable kube object menu items when cluster is not relevant given exten
>
add
</span>
<div />
</i>
<div>
New tab
</div>
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_77"
tabindex="0"
>
<span
@ -772,11 +779,12 @@ exports[`disable kube object menu items when cluster is not relevant given exten
>
fullscreen
</span>
<div />
</i>
<div>
Fit to window
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_78"
tabindex="0"
>
<span
@ -785,8 +793,10 @@ exports[`disable kube object menu items when cluster is not relevant given exten
>
keyboard_arrow_up
</span>
<div />
</i>
<div>
Open
</div>
</div>
</div>
</div>
@ -1119,7 +1129,6 @@ exports[`disable kube object menu items when cluster is not relevant given not y
>
<i
class="Icon material interactive focusable small"
id="tooltip_target_13"
tabindex="0"
>
<span
@ -1128,8 +1137,10 @@ exports[`disable kube object menu items when cluster is not relevant given not y
>
close
</span>
<div />
</i>
<div>
Close ⌘+W
</div>
</div>
</div>
</div>
@ -1153,12 +1164,13 @@ exports[`disable kube object menu items when cluster is not relevant given not y
>
add
</span>
<div />
</i>
<div>
New tab
</div>
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_15"
tabindex="0"
>
<span
@ -1167,11 +1179,12 @@ exports[`disable kube object menu items when cluster is not relevant given not y
>
fullscreen
</span>
<div />
</i>
<div>
Fit to window
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_16"
tabindex="0"
>
<span
@ -1180,8 +1193,10 @@ exports[`disable kube object menu items when cluster is not relevant given not y
>
keyboard_arrow_up
</span>
<div />
</i>
<div>
Open
</div>
</div>
</div>
</div>

View File

@ -319,7 +319,6 @@ exports[`show status for a kube object given application starts and in test page
<i
class="Icon material interactive focusable small"
tabindex="0"
tooltip="Close ⌘+W"
>
<span
class="icon"
@ -347,7 +346,6 @@ exports[`show status for a kube object given application starts and in test page
class="Icon new-dock-tab material interactive focusable"
id="menu-actions-for-dock"
tabindex="0"
tooltip="New tab"
>
<span
class="icon"
@ -363,7 +361,6 @@ exports[`show status for a kube object given application starts and in test page
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Fit to window"
>
<span
class="icon"
@ -378,7 +375,6 @@ exports[`show status for a kube object given application starts and in test page
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Open"
>
<span
class="icon"
@ -758,7 +754,6 @@ exports[`show status for a kube object given application starts and in test page
<i
class="Icon material interactive focusable small"
tabindex="0"
tooltip="Close ⌘+W"
>
<span
class="icon"
@ -786,7 +781,6 @@ exports[`show status for a kube object given application starts and in test page
class="Icon new-dock-tab material interactive focusable"
id="menu-actions-for-dock"
tabindex="0"
tooltip="New tab"
>
<span
class="icon"
@ -802,7 +796,6 @@ exports[`show status for a kube object given application starts and in test page
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Fit to window"
>
<span
class="icon"
@ -817,7 +810,6 @@ exports[`show status for a kube object given application starts and in test page
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Open"
>
<span
class="icon"
@ -1197,7 +1189,6 @@ exports[`show status for a kube object given application starts and in test page
<i
class="Icon material interactive focusable small"
tabindex="0"
tooltip="Close ⌘+W"
>
<span
class="icon"
@ -1225,7 +1216,6 @@ exports[`show status for a kube object given application starts and in test page
class="Icon new-dock-tab material interactive focusable"
id="menu-actions-for-dock"
tabindex="0"
tooltip="New tab"
>
<span
class="icon"
@ -1241,7 +1231,6 @@ exports[`show status for a kube object given application starts and in test page
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Fit to window"
>
<span
class="icon"
@ -1256,7 +1245,6 @@ exports[`show status for a kube object given application starts and in test page
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Open"
>
<span
class="icon"
@ -1596,7 +1584,6 @@ exports[`show status for a kube object given application starts and in test page
<i
class="Icon material interactive focusable small"
tabindex="0"
tooltip="Close ⌘+W"
>
<span
class="icon"
@ -1624,7 +1611,6 @@ exports[`show status for a kube object given application starts and in test page
class="Icon new-dock-tab material interactive focusable"
id="menu-actions-for-dock"
tabindex="0"
tooltip="New tab"
>
<span
class="icon"
@ -1640,7 +1626,6 @@ exports[`show status for a kube object given application starts and in test page
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Fit to window"
>
<span
class="icon"
@ -1655,7 +1640,6 @@ exports[`show status for a kube object given application starts and in test page
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Open"
>
<span
class="icon"
@ -1995,7 +1979,6 @@ exports[`show status for a kube object given application starts and in test page
<i
class="Icon material interactive focusable small"
tabindex="0"
tooltip="Close ⌘+W"
>
<span
class="icon"
@ -2023,7 +2006,6 @@ exports[`show status for a kube object given application starts and in test page
class="Icon new-dock-tab material interactive focusable"
id="menu-actions-for-dock"
tabindex="0"
tooltip="New tab"
>
<span
class="icon"
@ -2039,7 +2021,6 @@ exports[`show status for a kube object given application starts and in test page
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Fit to window"
>
<span
class="icon"
@ -2054,7 +2035,6 @@ exports[`show status for a kube object given application starts and in test page
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Open"
>
<span
class="icon"
@ -2434,7 +2414,6 @@ exports[`show status for a kube object given application starts and in test page
<i
class="Icon material interactive focusable small"
tabindex="0"
tooltip="Close ⌘+W"
>
<span
class="icon"
@ -2462,7 +2441,6 @@ exports[`show status for a kube object given application starts and in test page
class="Icon new-dock-tab material interactive focusable"
id="menu-actions-for-dock"
tabindex="0"
tooltip="New tab"
>
<span
class="icon"
@ -2478,7 +2456,6 @@ exports[`show status for a kube object given application starts and in test page
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Fit to window"
>
<span
class="icon"
@ -2493,7 +2470,6 @@ exports[`show status for a kube object given application starts and in test page
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Open"
>
<span
class="icon"

View File

@ -268,7 +268,6 @@ exports[`disable kube object statuses when cluster is not relevant given extensi
<i
class="Icon KubeObjectStatusIcon error material focusable"
data-testid="kube-object-status-icon-for-some-uid"
id="tooltip_target_156"
>
<span
class="icon"
@ -276,8 +275,35 @@ exports[`disable kube object statuses when cluster is not relevant given extensi
>
error
</span>
<div />
</i>
<div
data-testid="tooltip-content-for-kube-object-status-icon-for-some-uid"
>
<div
class="KubeObjectStatusTooltip"
>
<div
class="level error"
>
<span
class="title"
>
Critical
</span>
<div
class="status msg"
>
- some-kube-object-status-text
<span
class="age"
>
.
</span>
</div>
</div>
</div>
</div>
</div>
<div
class="footer"
@ -332,7 +358,6 @@ exports[`disable kube object statuses when cluster is not relevant given extensi
>
<i
class="Icon material interactive focusable small"
id="tooltip_target_137"
tabindex="0"
>
<span
@ -341,8 +366,10 @@ exports[`disable kube object statuses when cluster is not relevant given extensi
>
close
</span>
<div />
</i>
<div>
Close ⌘+W
</div>
</div>
</div>
</div>
@ -366,12 +393,13 @@ exports[`disable kube object statuses when cluster is not relevant given extensi
>
add
</span>
<div />
</i>
<div>
New tab
</div>
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_139"
tabindex="0"
>
<span
@ -380,11 +408,12 @@ exports[`disable kube object statuses when cluster is not relevant given extensi
>
fullscreen
</span>
<div />
</i>
<div>
Fit to window
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_140"
tabindex="0"
>
<span
@ -393,8 +422,10 @@ exports[`disable kube object statuses when cluster is not relevant given extensi
>
keyboard_arrow_up
</span>
<div />
</i>
<div>
Open
</div>
</div>
</div>
</div>
@ -722,7 +753,6 @@ exports[`disable kube object statuses when cluster is not relevant given extensi
>
<i
class="Icon material interactive focusable small"
id="tooltip_target_75"
tabindex="0"
>
<span
@ -731,8 +761,10 @@ exports[`disable kube object statuses when cluster is not relevant given extensi
>
close
</span>
<div />
</i>
<div>
Close ⌘+W
</div>
</div>
</div>
</div>
@ -756,12 +788,13 @@ exports[`disable kube object statuses when cluster is not relevant given extensi
>
add
</span>
<div />
</i>
<div>
New tab
</div>
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_77"
tabindex="0"
>
<span
@ -770,11 +803,12 @@ exports[`disable kube object statuses when cluster is not relevant given extensi
>
fullscreen
</span>
<div />
</i>
<div>
Fit to window
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_78"
tabindex="0"
>
<span
@ -783,8 +817,10 @@ exports[`disable kube object statuses when cluster is not relevant given extensi
>
keyboard_arrow_up
</span>
<div />
</i>
<div>
Open
</div>
</div>
</div>
</div>
@ -1112,7 +1148,6 @@ exports[`disable kube object statuses when cluster is not relevant given not yet
>
<i
class="Icon material interactive focusable small"
id="tooltip_target_13"
tabindex="0"
>
<span
@ -1121,8 +1156,10 @@ exports[`disable kube object statuses when cluster is not relevant given not yet
>
close
</span>
<div />
</i>
<div>
Close ⌘+W
</div>
</div>
</div>
</div>
@ -1146,12 +1183,13 @@ exports[`disable kube object statuses when cluster is not relevant given not yet
>
add
</span>
<div />
</i>
<div>
New tab
</div>
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_15"
tabindex="0"
>
<span
@ -1160,11 +1198,12 @@ exports[`disable kube object statuses when cluster is not relevant given not yet
>
fullscreen
</span>
<div />
</i>
<div>
Fit to window
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_16"
tabindex="0"
>
<span
@ -1173,8 +1212,10 @@ exports[`disable kube object statuses when cluster is not relevant given not yet
>
keyboard_arrow_up
</span>
<div />
</i>
<div>
Open
</div>
</div>
</div>
</div>

View File

@ -21,31 +21,6 @@ import { observer } from "mobx-react";
import { kubeObjectStatusTextInjectionToken } from "../../../renderer/components/kube-object-status-icon/kube-object-status-text-injection-token";
import { KubeObjectStatusIcon } from "../../../renderer/components/kube-object-status-icon";
// TODO: Make tooltips free of side effects by making it deterministic
jest.mock("../../../renderer/components/tooltip/withTooltip", () => ({
withTooltip:
(Target: any) =>
({ tooltip, ...props }: any) => {
if (tooltip) {
const testId = props["data-testid"];
return (
<>
<Target
tooltip={tooltip.children ? undefined : tooltip}
{...props}
/>
<div data-testid={testId && `tooltip-content-for-${testId}`}>
{tooltip.children || tooltip}
</div>
</>
);
}
return <Target {...props} />;
},
}));
describe("show status for a kube object", () => {
let builder: ApplicationBuilder;
let infoStatusIsShown: boolean;

View File

@ -489,7 +489,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
>
<button
class="Button add-button primary big round"
tooltip="Add Namespace"
type="button"
>
<i
@ -566,7 +565,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
<i
class="Icon material interactive focusable small"
tabindex="0"
tooltip="Close ⌘+W"
>
<span
class="icon"
@ -594,7 +592,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
class="Icon new-dock-tab material interactive focusable"
id="menu-actions-for-dock"
tabindex="0"
tooltip="New tab"
>
<span
class="icon"
@ -610,7 +607,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Fit to window"
>
<span
class="icon"
@ -625,7 +621,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Minimize"
>
<span
class="icon"
@ -1145,7 +1140,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
>
<button
class="Button add-button primary big round"
tooltip="Add Namespace"
type="button"
>
<i
@ -1222,7 +1216,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
<i
class="Icon material interactive focusable small"
tabindex="0"
tooltip="Close ⌘+W"
>
<span
class="icon"
@ -1250,7 +1243,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
class="Icon new-dock-tab material interactive focusable"
id="menu-actions-for-dock"
tabindex="0"
tooltip="New tab"
>
<span
class="icon"
@ -1266,7 +1258,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Fit to window"
>
<span
class="icon"
@ -1281,7 +1272,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Minimize"
>
<span
class="icon"
@ -1806,7 +1796,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
>
<button
class="Button add-button primary big round"
tooltip="Add Namespace"
type="button"
>
<i
@ -1883,7 +1872,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
<i
class="Icon material interactive focusable small"
tabindex="0"
tooltip="Close ⌘+W"
>
<span
class="icon"
@ -1911,7 +1899,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
class="Icon new-dock-tab material interactive focusable"
id="menu-actions-for-dock"
tabindex="0"
tooltip="New tab"
>
<span
class="icon"
@ -1927,7 +1914,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Fit to window"
>
<span
class="icon"
@ -1942,7 +1928,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Minimize"
>
<span
class="icon"
@ -2536,7 +2521,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
>
<button
class="Button add-button primary big round"
tooltip="Add Namespace"
type="button"
>
<i
@ -2613,7 +2597,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
<i
class="Icon material interactive focusable small"
tabindex="0"
tooltip="Close ⌘+W"
>
<span
class="icon"
@ -2663,7 +2646,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
<i
class="Icon material interactive focusable small"
tabindex="0"
tooltip="Close ⌘+W"
>
<span
class="icon"
@ -2691,7 +2673,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
class="Icon new-dock-tab material interactive focusable"
id="menu-actions-for-dock"
tabindex="0"
tooltip="New tab"
>
<span
class="icon"
@ -2707,7 +2688,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Fit to window"
>
<span
class="icon"
@ -2722,7 +2702,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Minimize"
>
<span
class="icon"
@ -3242,7 +3221,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
>
<button
class="Button add-button primary big round"
tooltip="Add Namespace"
type="button"
>
<i
@ -3319,7 +3297,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
<i
class="Icon material interactive focusable small"
tabindex="0"
tooltip="Close ⌘+W"
>
<span
class="icon"
@ -3369,7 +3346,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
<i
class="Icon material interactive focusable small"
tabindex="0"
tooltip="Close ⌘+W"
>
<span
class="icon"
@ -3397,7 +3373,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
class="Icon new-dock-tab material interactive focusable"
id="menu-actions-for-dock"
tabindex="0"
tooltip="New tab"
>
<span
class="icon"
@ -3413,7 +3388,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Fit to window"
>
<span
class="icon"
@ -3428,7 +3402,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Minimize"
>
<span
class="icon"
@ -4020,7 +3993,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
>
<button
class="Button add-button primary big round"
tooltip="Add Namespace"
type="button"
>
<i
@ -4097,7 +4069,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
<i
class="Icon material interactive focusable small"
tabindex="0"
tooltip="Close ⌘+W"
>
<span
class="icon"
@ -4147,7 +4118,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
<i
class="Icon material interactive focusable small"
tabindex="0"
tooltip="Close ⌘+W"
>
<span
class="icon"
@ -4175,7 +4145,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
class="Icon new-dock-tab material interactive focusable"
id="menu-actions-for-dock"
tabindex="0"
tooltip="New tab"
>
<span
class="icon"
@ -4191,7 +4160,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Fit to window"
>
<span
class="icon"
@ -4206,7 +4174,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Minimize"
>
<span
class="icon"
@ -4800,7 +4767,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
>
<button
class="Button add-button primary big round"
tooltip="Add Namespace"
type="button"
>
<i
@ -4877,7 +4843,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
<i
class="Icon material interactive focusable small"
tabindex="0"
tooltip="Close ⌘+W"
>
<span
class="icon"
@ -4905,7 +4870,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
class="Icon new-dock-tab material interactive focusable"
id="menu-actions-for-dock"
tabindex="0"
tooltip="New tab"
>
<span
class="icon"
@ -4921,7 +4885,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Fit to window"
>
<span
class="icon"
@ -4936,7 +4899,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Minimize"
>
<span
class="icon"
@ -5001,10 +4963,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
>
<i
class="Icon material focusable"
tooltip="YAMLException: end of the stream or a document separator is expected (1:1)
1 | @some-invalid-configuration@
-----^"
>
<span
class="icon"
@ -5548,7 +5506,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
>
<button
class="Button add-button primary big round"
tooltip="Add Namespace"
type="button"
>
<i
@ -5625,7 +5582,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
<i
class="Icon material interactive focusable small"
tabindex="0"
tooltip="Close ⌘+W"
>
<span
class="icon"
@ -5653,7 +5609,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
class="Icon new-dock-tab material interactive focusable"
id="menu-actions-for-dock"
tabindex="0"
tooltip="New tab"
>
<span
class="icon"
@ -5669,7 +5624,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Fit to window"
>
<span
class="icon"
@ -5684,7 +5638,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Minimize"
>
<span
class="icon"
@ -6287,7 +6240,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
>
<button
class="Button add-button primary big round"
tooltip="Add Namespace"
type="button"
>
<i
@ -6364,7 +6316,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
<i
class="Icon material interactive focusable small"
tabindex="0"
tooltip="Close ⌘+W"
>
<span
class="icon"
@ -6392,7 +6343,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
class="Icon new-dock-tab material interactive focusable"
id="menu-actions-for-dock"
tabindex="0"
tooltip="New tab"
>
<span
class="icon"
@ -6408,7 +6358,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Fit to window"
>
<span
class="icon"
@ -6423,7 +6372,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Minimize"
>
<span
class="icon"
@ -7017,7 +6965,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
>
<button
class="Button add-button primary big round"
tooltip="Add Namespace"
type="button"
>
<i
@ -7094,7 +7041,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
<i
class="Icon material interactive focusable small"
tabindex="0"
tooltip="Close ⌘+W"
>
<span
class="icon"
@ -7122,7 +7068,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
class="Icon new-dock-tab material interactive focusable"
id="menu-actions-for-dock"
tabindex="0"
tooltip="New tab"
>
<span
class="icon"
@ -7138,7 +7083,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Fit to window"
>
<span
class="icon"
@ -7153,7 +7097,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Minimize"
>
<span
class="icon"
@ -7747,7 +7690,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
>
<button
class="Button add-button primary big round"
tooltip="Add Namespace"
type="button"
>
<i
@ -7824,7 +7766,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
<i
class="Icon material interactive focusable small"
tabindex="0"
tooltip="Close ⌘+W"
>
<span
class="icon"
@ -7852,7 +7793,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
class="Icon new-dock-tab material interactive focusable"
id="menu-actions-for-dock"
tabindex="0"
tooltip="New tab"
>
<span
class="icon"
@ -7868,7 +7808,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Fit to window"
>
<span
class="icon"
@ -7883,7 +7822,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Minimize"
>
<span
class="icon"
@ -8477,7 +8415,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
>
<button
class="Button add-button primary big round"
tooltip="Add Namespace"
type="button"
>
<i
@ -8531,7 +8468,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
class="Icon new-dock-tab material interactive focusable"
id="menu-actions-for-dock"
tabindex="0"
tooltip="New tab"
>
<span
class="icon"
@ -9042,7 +8978,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
>
<button
class="Button add-button primary big round"
tooltip="Add Namespace"
type="button"
>
<i
@ -9119,7 +9054,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
<i
class="Icon material interactive focusable small"
tabindex="0"
tooltip="Close ⌘+W"
>
<span
class="icon"
@ -9147,7 +9081,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
class="Icon new-dock-tab material interactive focusable"
id="menu-actions-for-dock"
tabindex="0"
tooltip="New tab"
>
<span
class="icon"
@ -9163,7 +9096,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Fit to window"
>
<span
class="icon"
@ -9178,7 +9110,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Minimize"
>
<span
class="icon"
@ -9781,7 +9712,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
>
<button
class="Button add-button primary big round"
tooltip="Add Namespace"
type="button"
>
<i
@ -9835,7 +9765,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
class="Icon new-dock-tab material interactive focusable"
id="menu-actions-for-dock"
tabindex="0"
tooltip="New tab"
>
<span
class="icon"
@ -10346,7 +10275,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
>
<button
class="Button add-button primary big round"
tooltip="Add Namespace"
type="button"
>
<i
@ -10400,7 +10328,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
class="Icon new-dock-tab material interactive focusable"
id="menu-actions-for-dock"
tabindex="0"
tooltip="New tab"
>
<span
class="icon"
@ -10911,7 +10838,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
>
<button
class="Button add-button primary big round"
tooltip="Add Namespace"
type="button"
>
<i
@ -10988,7 +10914,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
<i
class="Icon material interactive focusable small"
tabindex="0"
tooltip="Close ⌘+W"
>
<span
class="icon"
@ -11016,7 +10941,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
class="Icon new-dock-tab material interactive focusable"
id="menu-actions-for-dock"
tabindex="0"
tooltip="New tab"
>
<span
class="icon"
@ -11032,7 +10956,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Fit to window"
>
<span
class="icon"
@ -11047,7 +10970,6 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Minimize"
>
<span
class="icon"

View File

@ -471,7 +471,6 @@ exports[`cluster/namespaces - edit namespaces from previously opened tab given t
<i
class="Icon material interactive focusable small"
tabindex="0"
tooltip="Close ⌘+W"
>
<span
class="icon"
@ -499,7 +498,6 @@ exports[`cluster/namespaces - edit namespaces from previously opened tab given t
class="Icon new-dock-tab material interactive focusable"
id="menu-actions-for-dock"
tabindex="0"
tooltip="New tab"
>
<span
class="icon"
@ -515,7 +513,6 @@ exports[`cluster/namespaces - edit namespaces from previously opened tab given t
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Fit to window"
>
<span
class="icon"
@ -530,7 +527,6 @@ exports[`cluster/namespaces - edit namespaces from previously opened tab given t
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Minimize"
>
<span
class="icon"
@ -1032,7 +1028,6 @@ exports[`cluster/namespaces - edit namespaces from previously opened tab given t
<i
class="Icon material interactive focusable small"
tabindex="0"
tooltip="Close ⌘+W"
>
<span
class="icon"
@ -1060,7 +1055,6 @@ exports[`cluster/namespaces - edit namespaces from previously opened tab given t
class="Icon new-dock-tab material interactive focusable"
id="menu-actions-for-dock"
tabindex="0"
tooltip="New tab"
>
<span
class="icon"
@ -1076,7 +1070,6 @@ exports[`cluster/namespaces - edit namespaces from previously opened tab given t
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Fit to window"
>
<span
class="icon"
@ -1091,7 +1084,6 @@ exports[`cluster/namespaces - edit namespaces from previously opened tab given t
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Minimize"
>
<span
class="icon"

View File

@ -8,7 +8,6 @@ import { fireEvent } from "@testing-library/react";
import type { ApplicationBuilder } from "../../../renderer/components/test-utils/get-application-builder";
import { getApplicationBuilder } from "../../../renderer/components/test-utils/get-application-builder";
import navigateToNamespacesInjectable from "../../../common/front-end-routing/routes/cluster/namespaces/navigate-to-namespaces.injectable";
import React from "react";
import createEditResourceTabInjectable from "../../../renderer/components/dock/edit-resource/edit-resource-tab.injectable";
import getRandomIdForEditResourceTabInjectable from "../../../renderer/components/dock/edit-resource/get-random-id-for-edit-resource-tab.injectable";
import type { AsyncFnMock } from "@async-fn/jest";
@ -26,30 +25,6 @@ import directoryForLensLocalStorageInjectable from "../../../common/directory-fo
import hostedClusterIdInjectable from "../../../renderer/cluster-frame-context/hosted-cluster-id.injectable";
import { controlWhenStoragesAreReady } from "../../../renderer/utils/create-storage/storages-are-ready";
jest.mock("../../../renderer/components/tooltip/withTooltip", () => ({
withTooltip:
(Target: any) =>
({ tooltip, ...props }: any) => {
if (tooltip) {
const testId = props["data-testid"];
return (
<>
<Target
tooltip={tooltip.children ? undefined : tooltip}
{...props}
/>
<div data-testid={testId && `tooltip-content-for-${testId}`}>
{tooltip.children || tooltip}
</div>
</>
);
}
return <Target {...props} />;
},
}));
describe("cluster/namespaces - edit namespace from new tab", () => {
let builder: ApplicationBuilder;
let callForNamespaceMock: AsyncFnMock<CallForResource>;

View File

@ -6,7 +6,6 @@ import type { RenderResult } from "@testing-library/react";
import { act } from "@testing-library/react";
import type { ApplicationBuilder } from "../../../renderer/components/test-utils/get-application-builder";
import { getApplicationBuilder } from "../../../renderer/components/test-utils/get-application-builder";
import React from "react";
import type { AsyncFnMock } from "@async-fn/jest";
import asyncFn from "@async-fn/jest";
import type { CallForResource } from "../../../renderer/components/dock/edit-resource/edit-resource-model/call-for-resource/call-for-resource.injectable";
@ -18,30 +17,6 @@ import writeJsonFileInjectable from "../../../common/fs/write-json-file.injectab
import { TabKind } from "../../../renderer/components/dock/dock/store";
import { Namespace } from "../../../common/k8s-api/endpoints";
jest.mock("../../../renderer/components/tooltip/withTooltip", () => ({
withTooltip:
(Target: any) =>
({ tooltip, ...props }: any) => {
if (tooltip) {
const testId = props["data-testid"];
return (
<>
<Target
tooltip={tooltip.children ? undefined : tooltip}
{...props}
/>
<div data-testid={testId && `tooltip-content-for-${testId}`}>
{tooltip.children || tooltip}
</div>
</>
);
}
return <Target {...props} />;
},
}));
describe("cluster/namespaces - edit namespaces from previously opened tab", () => {
let builder: ApplicationBuilder;
let callForNamespaceMock: AsyncFnMock<CallForResource>;

View File

@ -23,11 +23,6 @@ import type { IObservableValue } from "mobx";
import { runInAction, computed, observable } from "mobx";
import storageSaveDelayInjectable from "../../renderer/utils/create-storage/storage-save-delay.injectable";
// TODO: Make tooltips free of side effects by making it deterministic
jest.mock("../../renderer/components/tooltip/withTooltip", () => ({
withTooltip: (target: any) => target,
}));
describe("cluster - sidebar and tab navigation for extensions", () => {
let applicationBuilder: ApplicationBuilder;
let rendererDi: DiContainer;

View File

@ -448,7 +448,6 @@ exports[`disable workloads overview details when cluster is not relevant given e
>
<i
class="Icon material interactive focusable small"
id="tooltip_target_129"
tabindex="0"
>
<span
@ -457,8 +456,10 @@ exports[`disable workloads overview details when cluster is not relevant given e
>
close
</span>
<div />
</i>
<div>
Close ⌘+W
</div>
</div>
</div>
</div>
@ -482,12 +483,13 @@ exports[`disable workloads overview details when cluster is not relevant given e
>
add
</span>
<div />
</i>
<div>
New tab
</div>
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_131"
tabindex="0"
>
<span
@ -496,11 +498,12 @@ exports[`disable workloads overview details when cluster is not relevant given e
>
fullscreen
</span>
<div />
</i>
<div>
Fit to window
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_132"
tabindex="0"
>
<span
@ -509,8 +512,10 @@ exports[`disable workloads overview details when cluster is not relevant given e
>
keyboard_arrow_up
</span>
<div />
</i>
<div>
Open
</div>
</div>
</div>
</div>
@ -963,7 +968,6 @@ exports[`disable workloads overview details when cluster is not relevant given e
>
<i
class="Icon material interactive focusable small"
id="tooltip_target_71"
tabindex="0"
>
<span
@ -972,8 +976,10 @@ exports[`disable workloads overview details when cluster is not relevant given e
>
close
</span>
<div />
</i>
<div>
Close ⌘+W
</div>
</div>
</div>
</div>
@ -997,12 +1003,13 @@ exports[`disable workloads overview details when cluster is not relevant given e
>
add
</span>
<div />
</i>
<div>
New tab
</div>
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_73"
tabindex="0"
>
<span
@ -1011,11 +1018,12 @@ exports[`disable workloads overview details when cluster is not relevant given e
>
fullscreen
</span>
<div />
</i>
<div>
Fit to window
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_74"
tabindex="0"
>
<span
@ -1024,8 +1032,10 @@ exports[`disable workloads overview details when cluster is not relevant given e
>
keyboard_arrow_up
</span>
<div />
</i>
<div>
Open
</div>
</div>
</div>
</div>
@ -1478,7 +1488,6 @@ exports[`disable workloads overview details when cluster is not relevant given n
>
<i
class="Icon material interactive focusable small"
id="tooltip_target_13"
tabindex="0"
>
<span
@ -1487,8 +1496,10 @@ exports[`disable workloads overview details when cluster is not relevant given n
>
close
</span>
<div />
</i>
<div>
Close ⌘+W
</div>
</div>
</div>
</div>
@ -1512,12 +1523,13 @@ exports[`disable workloads overview details when cluster is not relevant given n
>
add
</span>
<div />
</i>
<div>
New tab
</div>
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_15"
tabindex="0"
>
<span
@ -1526,11 +1538,12 @@ exports[`disable workloads overview details when cluster is not relevant given n
>
fullscreen
</span>
<div />
</i>
<div>
Fit to window
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_16"
tabindex="0"
>
<span
@ -1539,8 +1552,10 @@ exports[`disable workloads overview details when cluster is not relevant given n
>
keyboard_arrow_up
</span>
<div />
</i>
<div>
Open
</div>
</div>
</div>
</div>

View File

@ -1046,7 +1046,6 @@ exports[`add custom helm repository in preferences when navigating to preference
class="Icon material interactive focusable"
data-testid="remove-helm-repository-Some active repository"
tabindex="0"
tooltip="Remove"
>
<span
class="icon"
@ -1055,6 +1054,11 @@ exports[`add custom helm repository in preferences when navigating to preference
delete
</span>
</i>
<div
data-testid="tooltip-content-for-remove-helm-repository-Some active repository"
>
Remove
</div>
</div>
</div>
<div />
@ -1631,7 +1635,6 @@ exports[`add custom helm repository in preferences when navigating to preference
class="Icon material interactive focusable"
data-testid="remove-helm-repository-Some active repository"
tabindex="0"
tooltip="Remove"
>
<span
class="icon"
@ -1640,6 +1643,11 @@ exports[`add custom helm repository in preferences when navigating to preference
delete
</span>
</i>
<div
data-testid="tooltip-content-for-remove-helm-repository-Some active repository"
>
Remove
</div>
</div>
</div>
<div />
@ -1820,7 +1828,6 @@ exports[`add custom helm repository in preferences when navigating to preference
More
<i
class="Icon material focusable small"
tooltip="More"
>
<span
class="icon"
@ -1829,6 +1836,9 @@ exports[`add custom helm repository in preferences when navigating to preference
add
</span>
</i>
<div>
More
</div>
</button>
</div>
</div>
@ -2325,7 +2335,6 @@ exports[`add custom helm repository in preferences when navigating to preference
class="Icon material interactive focusable"
data-testid="remove-helm-repository-Some active repository"
tabindex="0"
tooltip="Remove"
>
<span
class="icon"
@ -2334,6 +2343,11 @@ exports[`add custom helm repository in preferences when navigating to preference
delete
</span>
</i>
<div
data-testid="tooltip-content-for-remove-helm-repository-Some active repository"
>
Remove
</div>
</div>
</div>
<div />
@ -2918,7 +2932,6 @@ exports[`add custom helm repository in preferences when navigating to preference
class="Icon material interactive focusable"
data-testid="remove-helm-repository-Some active repository"
tabindex="0"
tooltip="Remove"
>
<span
class="icon"
@ -2927,6 +2940,11 @@ exports[`add custom helm repository in preferences when navigating to preference
delete
</span>
</i>
<div
data-testid="tooltip-content-for-remove-helm-repository-Some active repository"
>
Remove
</div>
</div>
</div>
<div />
@ -3107,7 +3125,6 @@ exports[`add custom helm repository in preferences when navigating to preference
More
<i
class="Icon material focusable small"
tooltip="More"
>
<span
class="icon"
@ -3116,6 +3133,9 @@ exports[`add custom helm repository in preferences when navigating to preference
add
</span>
</i>
<div>
More
</div>
</button>
</div>
</div>
@ -3612,7 +3632,6 @@ exports[`add custom helm repository in preferences when navigating to preference
class="Icon material interactive focusable"
data-testid="remove-helm-repository-Some active repository"
tabindex="0"
tooltip="Remove"
>
<span
class="icon"
@ -3621,6 +3640,11 @@ exports[`add custom helm repository in preferences when navigating to preference
delete
</span>
</i>
<div
data-testid="tooltip-content-for-remove-helm-repository-Some active repository"
>
Remove
</div>
</div>
</div>
<div />
@ -3801,7 +3825,6 @@ exports[`add custom helm repository in preferences when navigating to preference
More
<i
class="Icon material focusable small"
tooltip="More"
>
<span
class="icon"
@ -3810,6 +3833,9 @@ exports[`add custom helm repository in preferences when navigating to preference
remove
</span>
</i>
<div>
More
</div>
</button>
<div
data-testid="maximal-options-for-custom-helm-repository-dialog"
@ -3861,7 +3887,6 @@ exports[`add custom helm repository in preferences when navigating to preference
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Browse"
>
<span
class="icon"
@ -3870,6 +3895,9 @@ exports[`add custom helm repository in preferences when navigating to preference
folder
</span>
</i>
<div>
Browse
</div>
</div>
<div
class="flex gaps align-center"
@ -3896,7 +3924,6 @@ exports[`add custom helm repository in preferences when navigating to preference
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Browse"
>
<span
class="icon"
@ -3905,6 +3932,9 @@ exports[`add custom helm repository in preferences when navigating to preference
folder
</span>
</i>
<div>
Browse
</div>
</div>
<div
class="flex gaps align-center"
@ -3931,7 +3961,6 @@ exports[`add custom helm repository in preferences when navigating to preference
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Browse"
>
<span
class="icon"
@ -3940,6 +3969,9 @@ exports[`add custom helm repository in preferences when navigating to preference
folder
</span>
</i>
<div>
Browse
</div>
</div>
<div
class="SubTitle"
@ -4482,7 +4514,6 @@ exports[`add custom helm repository in preferences when navigating to preference
class="Icon material interactive focusable"
data-testid="remove-helm-repository-Some active repository"
tabindex="0"
tooltip="Remove"
>
<span
class="icon"
@ -4491,6 +4522,11 @@ exports[`add custom helm repository in preferences when navigating to preference
delete
</span>
</i>
<div
data-testid="tooltip-content-for-remove-helm-repository-Some active repository"
>
Remove
</div>
</div>
</div>
<div />
@ -4671,7 +4707,6 @@ exports[`add custom helm repository in preferences when navigating to preference
More
<i
class="Icon material focusable small"
tooltip="More"
>
<span
class="icon"
@ -4680,6 +4715,9 @@ exports[`add custom helm repository in preferences when navigating to preference
add
</span>
</i>
<div>
More
</div>
</button>
</div>
</div>
@ -5176,7 +5214,6 @@ exports[`add custom helm repository in preferences when navigating to preference
class="Icon material interactive focusable"
data-testid="remove-helm-repository-Some active repository"
tabindex="0"
tooltip="Remove"
>
<span
class="icon"
@ -5185,6 +5222,11 @@ exports[`add custom helm repository in preferences when navigating to preference
delete
</span>
</i>
<div
data-testid="tooltip-content-for-remove-helm-repository-Some active repository"
>
Remove
</div>
</div>
</div>
<div />
@ -5365,7 +5407,6 @@ exports[`add custom helm repository in preferences when navigating to preference
More
<i
class="Icon material focusable small"
tooltip="More"
>
<span
class="icon"
@ -5374,6 +5415,9 @@ exports[`add custom helm repository in preferences when navigating to preference
remove
</span>
</i>
<div>
More
</div>
</button>
<div
data-testid="maximal-options-for-custom-helm-repository-dialog"
@ -5425,7 +5469,6 @@ exports[`add custom helm repository in preferences when navigating to preference
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Browse"
>
<span
class="icon"
@ -5434,6 +5477,9 @@ exports[`add custom helm repository in preferences when navigating to preference
folder
</span>
</i>
<div>
Browse
</div>
</div>
<div
class="flex gaps align-center"
@ -5460,7 +5506,6 @@ exports[`add custom helm repository in preferences when navigating to preference
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Browse"
>
<span
class="icon"
@ -5469,6 +5514,9 @@ exports[`add custom helm repository in preferences when navigating to preference
folder
</span>
</i>
<div>
Browse
</div>
</div>
<div
class="flex gaps align-center"
@ -5495,7 +5543,6 @@ exports[`add custom helm repository in preferences when navigating to preference
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Browse"
>
<span
class="icon"
@ -5504,6 +5551,9 @@ exports[`add custom helm repository in preferences when navigating to preference
folder
</span>
</i>
<div>
Browse
</div>
</div>
<div
class="SubTitle"
@ -6046,7 +6096,6 @@ exports[`add custom helm repository in preferences when navigating to preference
class="Icon material interactive focusable"
data-testid="remove-helm-repository-Some active repository"
tabindex="0"
tooltip="Remove"
>
<span
class="icon"
@ -6055,6 +6104,11 @@ exports[`add custom helm repository in preferences when navigating to preference
delete
</span>
</i>
<div
data-testid="tooltip-content-for-remove-helm-repository-Some active repository"
>
Remove
</div>
</div>
</div>
<div />
@ -6235,7 +6289,6 @@ exports[`add custom helm repository in preferences when navigating to preference
More
<i
class="Icon material focusable small"
tooltip="More"
>
<span
class="icon"
@ -6244,6 +6297,9 @@ exports[`add custom helm repository in preferences when navigating to preference
add
</span>
</i>
<div>
More
</div>
</button>
</div>
</div>
@ -6740,7 +6796,6 @@ exports[`add custom helm repository in preferences when navigating to preference
class="Icon material interactive focusable"
data-testid="remove-helm-repository-Some active repository"
tabindex="0"
tooltip="Remove"
>
<span
class="icon"
@ -6749,6 +6804,11 @@ exports[`add custom helm repository in preferences when navigating to preference
delete
</span>
</i>
<div
data-testid="tooltip-content-for-remove-helm-repository-Some active repository"
>
Remove
</div>
</div>
</div>
<div />
@ -8101,7 +8161,6 @@ exports[`add custom helm repository in preferences when navigating to preference
More
<i
class="Icon material focusable small"
tooltip="More"
>
<span
class="icon"
@ -8110,6 +8169,9 @@ exports[`add custom helm repository in preferences when navigating to preference
add
</span>
</i>
<div>
More
</div>
</button>
</div>
</div>

View File

@ -1046,7 +1046,6 @@ exports[`add helm repository from list in preferences when navigating to prefere
class="Icon material interactive focusable"
data-testid="remove-helm-repository-Some already active repository"
tabindex="0"
tooltip="Remove"
>
<span
class="icon"
@ -1055,6 +1054,11 @@ exports[`add helm repository from list in preferences when navigating to prefere
delete
</span>
</i>
<div
data-testid="tooltip-content-for-remove-helm-repository-Some already active repository"
>
Remove
</div>
</div>
</div>
<div />
@ -1633,7 +1637,6 @@ exports[`add helm repository from list in preferences when navigating to prefere
class="Icon material interactive focusable"
data-testid="remove-helm-repository-Some already active repository"
tabindex="0"
tooltip="Remove"
>
<span
class="icon"
@ -1642,6 +1645,11 @@ exports[`add helm repository from list in preferences when navigating to prefere
delete
</span>
</i>
<div
data-testid="tooltip-content-for-remove-helm-repository-Some already active repository"
>
Remove
</div>
</div>
</div>
<div />
@ -2269,7 +2277,6 @@ exports[`add helm repository from list in preferences when navigating to prefere
class="Icon material interactive focusable"
data-testid="remove-helm-repository-Some already active repository"
tabindex="0"
tooltip="Remove"
>
<span
class="icon"
@ -2278,6 +2285,11 @@ exports[`add helm repository from list in preferences when navigating to prefere
delete
</span>
</i>
<div
data-testid="tooltip-content-for-remove-helm-repository-Some already active repository"
>
Remove
</div>
</div>
</div>
<div />
@ -2854,7 +2866,6 @@ exports[`add helm repository from list in preferences when navigating to prefere
class="Icon material interactive focusable"
data-testid="remove-helm-repository-Some already active repository"
tabindex="0"
tooltip="Remove"
>
<span
class="icon"
@ -2863,6 +2874,11 @@ exports[`add helm repository from list in preferences when navigating to prefere
delete
</span>
</i>
<div
data-testid="tooltip-content-for-remove-helm-repository-Some already active repository"
>
Remove
</div>
</div>
</div>
<div />
@ -4017,7 +4033,6 @@ exports[`add helm repository from list in preferences when navigating to prefere
class="Icon material interactive focusable"
data-testid="remove-helm-repository-Some already active repository"
tabindex="0"
tooltip="Remove"
>
<span
class="icon"
@ -4026,6 +4041,11 @@ exports[`add helm repository from list in preferences when navigating to prefere
delete
</span>
</i>
<div
data-testid="tooltip-content-for-remove-helm-repository-Some already active repository"
>
Remove
</div>
</div>
<div
class="item flex gaps align-center justify-space-between repo"
@ -4047,7 +4067,6 @@ exports[`add helm repository from list in preferences when navigating to prefere
class="Icon material interactive focusable"
data-testid="remove-helm-repository-Some to be added repository"
tabindex="0"
tooltip="Remove"
>
<span
class="icon"
@ -4056,6 +4075,11 @@ exports[`add helm repository from list in preferences when navigating to prefere
delete
</span>
</i>
<div
data-testid="tooltip-content-for-remove-helm-repository-Some to be added repository"
>
Remove
</div>
</div>
</div>
<div />
@ -4634,7 +4658,6 @@ exports[`add helm repository from list in preferences when navigating to prefere
class="Icon material interactive focusable"
data-testid="remove-helm-repository-Some already active repository"
tabindex="0"
tooltip="Remove"
>
<span
class="icon"
@ -4643,6 +4666,11 @@ exports[`add helm repository from list in preferences when navigating to prefere
delete
</span>
</i>
<div
data-testid="tooltip-content-for-remove-helm-repository-Some already active repository"
>
Remove
</div>
</div>
<div
class="item flex gaps align-center justify-space-between repo"
@ -4664,7 +4692,6 @@ exports[`add helm repository from list in preferences when navigating to prefere
class="Icon material interactive focusable"
data-testid="remove-helm-repository-Some to be added repository"
tabindex="0"
tooltip="Remove"
>
<span
class="icon"
@ -4673,6 +4700,11 @@ exports[`add helm repository from list in preferences when navigating to prefere
delete
</span>
</i>
<div
data-testid="tooltip-content-for-remove-helm-repository-Some to be added repository"
>
Remove
</div>
</div>
</div>
<div />
@ -5310,7 +5342,6 @@ exports[`add helm repository from list in preferences when navigating to prefere
class="Icon material interactive focusable"
data-testid="remove-helm-repository-Some already active repository"
tabindex="0"
tooltip="Remove"
>
<span
class="icon"
@ -5319,6 +5350,11 @@ exports[`add helm repository from list in preferences when navigating to prefere
delete
</span>
</i>
<div
data-testid="tooltip-content-for-remove-helm-repository-Some already active repository"
>
Remove
</div>
</div>
<div
class="item flex gaps align-center justify-space-between repo"
@ -5340,7 +5376,6 @@ exports[`add helm repository from list in preferences when navigating to prefere
class="Icon material interactive focusable"
data-testid="remove-helm-repository-Some to be added repository"
tabindex="0"
tooltip="Remove"
>
<span
class="icon"
@ -5349,6 +5384,11 @@ exports[`add helm repository from list in preferences when navigating to prefere
delete
</span>
</i>
<div
data-testid="tooltip-content-for-remove-helm-repository-Some to be added repository"
>
Remove
</div>
</div>
</div>
<div />

View File

@ -3720,7 +3720,6 @@ exports[`listing active helm repositories in preferences when navigating to pref
class="Icon material interactive focusable"
data-testid="remove-helm-repository-some-repository"
tabindex="0"
tooltip="Remove"
>
<span
class="icon"
@ -3729,6 +3728,11 @@ exports[`listing active helm repositories in preferences when navigating to pref
delete
</span>
</i>
<div
data-testid="tooltip-content-for-remove-helm-repository-some-repository"
>
Remove
</div>
</div>
<div
class="item flex gaps align-center justify-space-between repo"
@ -3750,7 +3754,6 @@ exports[`listing active helm repositories in preferences when navigating to pref
class="Icon material interactive focusable"
data-testid="remove-helm-repository-some-other-repository"
tabindex="0"
tooltip="Remove"
>
<span
class="icon"
@ -3759,6 +3762,11 @@ exports[`listing active helm repositories in preferences when navigating to pref
delete
</span>
</i>
<div
data-testid="tooltip-content-for-remove-helm-repository-some-other-repository"
>
Remove
</div>
</div>
</div>
<div />

View File

@ -1046,7 +1046,6 @@ exports[`remove helm repository from list of active repositories in preferences
class="Icon material interactive focusable"
data-testid="remove-helm-repository-some-active-repository"
tabindex="0"
tooltip="Remove"
>
<span
class="icon"
@ -1055,6 +1054,11 @@ exports[`remove helm repository from list of active repositories in preferences
delete
</span>
</i>
<div
data-testid="tooltip-content-for-remove-helm-repository-some-active-repository"
>
Remove
</div>
</div>
</div>
<div />
@ -1631,7 +1635,6 @@ exports[`remove helm repository from list of active repositories in preferences
class="Icon material interactive focusable"
data-testid="remove-helm-repository-some-active-repository"
tabindex="0"
tooltip="Remove"
>
<span
class="icon"
@ -1640,6 +1643,11 @@ exports[`remove helm repository from list of active repositories in preferences
delete
</span>
</i>
<div
data-testid="tooltip-content-for-remove-helm-repository-some-active-repository"
>
Remove
</div>
</div>
</div>
<div />

View File

@ -18,11 +18,6 @@ import showSuccessNotificationInjectable from "../../renderer/components/notific
import showErrorNotificationInjectable from "../../renderer/components/notifications/show-error-notification.injectable";
import type { AsyncResult } from "../../common/utils/async-result";
// TODO: Make tooltips free of side effects by making it deterministic
jest.mock("../../renderer/components/tooltip/withTooltip", () => ({
withTooltip: (target: any) => target,
}));
describe("add custom helm repository in preferences", () => {
let applicationBuilder: ApplicationBuilder;
let showSuccessNotificationMock: jest.Mock;

View File

@ -16,11 +16,6 @@ import showSuccessNotificationInjectable from "../../renderer/components/notific
import showErrorNotificationInjectable from "../../renderer/components/notifications/show-error-notification.injectable";
import type { AsyncResult } from "../../common/utils/async-result";
// TODO: Make tooltips free of side effects by making it deterministic
jest.mock("../../renderer/components/tooltip/withTooltip", () => ({
withTooltip: (target: any) => target,
}));
describe("add helm repository from list in preferences", () => {
let applicationBuilder: ApplicationBuilder;
let showSuccessNotificationMock: jest.Mock;

View File

@ -444,7 +444,6 @@ exports[`installing helm chart from previously opened tab given tab for installi
<i
class="Icon material interactive focusable small"
tabindex="0"
tooltip="Close ⌘+W"
>
<span
class="icon"
@ -453,6 +452,9 @@ exports[`installing helm chart from previously opened tab given tab for installi
close
</span>
</i>
<div>
Close ⌘+W
</div>
</div>
</div>
</div>
@ -469,7 +471,6 @@ exports[`installing helm chart from previously opened tab given tab for installi
class="Icon new-dock-tab material interactive focusable"
id="menu-actions-for-dock"
tabindex="0"
tooltip="New tab"
>
<span
class="icon"
@ -478,11 +479,13 @@ exports[`installing helm chart from previously opened tab given tab for installi
add
</span>
</i>
<div>
New tab
</div>
</div>
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Fit to window"
>
<span
class="icon"
@ -491,10 +494,12 @@ exports[`installing helm chart from previously opened tab given tab for installi
fullscreen
</span>
</i>
<div>
Fit to window
</div>
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Minimize"
>
<span
class="icon"
@ -503,6 +508,9 @@ exports[`installing helm chart from previously opened tab given tab for installi
keyboard_arrow_down
</span>
</i>
<div>
Minimize
</div>
</div>
</div>
<div
@ -966,7 +974,6 @@ exports[`installing helm chart from previously opened tab given tab for installi
<i
class="Icon material interactive focusable small"
tabindex="0"
tooltip="Close ⌘+W"
>
<span
class="icon"
@ -975,6 +982,9 @@ exports[`installing helm chart from previously opened tab given tab for installi
close
</span>
</i>
<div>
Close ⌘+W
</div>
</div>
</div>
</div>
@ -991,7 +1001,6 @@ exports[`installing helm chart from previously opened tab given tab for installi
class="Icon new-dock-tab material interactive focusable"
id="menu-actions-for-dock"
tabindex="0"
tooltip="New tab"
>
<span
class="icon"
@ -1000,11 +1009,13 @@ exports[`installing helm chart from previously opened tab given tab for installi
add
</span>
</i>
<div>
New tab
</div>
</div>
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Fit to window"
>
<span
class="icon"
@ -1013,10 +1024,12 @@ exports[`installing helm chart from previously opened tab given tab for installi
fullscreen
</span>
</i>
<div>
Fit to window
</div>
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Minimize"
>
<span
class="icon"
@ -1025,6 +1038,9 @@ exports[`installing helm chart from previously opened tab given tab for installi
keyboard_arrow_down
</span>
</i>
<div>
Minimize
</div>
</div>
</div>
<div

View File

@ -496,7 +496,6 @@ exports[`opening dock tab for installing helm chart given application is started
class="Icon new-dock-tab material interactive focusable"
id="menu-actions-for-dock"
tabindex="0"
tooltip="New tab"
>
<span
class="icon"
@ -505,6 +504,9 @@ exports[`opening dock tab for installing helm chart given application is started
add
</span>
</i>
<div>
New tab
</div>
</div>
</div>
</div>
@ -1175,7 +1177,6 @@ exports[`opening dock tab for installing helm chart given application is started
class="Icon new-dock-tab material interactive focusable"
id="menu-actions-for-dock"
tabindex="0"
tooltip="New tab"
>
<span
class="icon"
@ -1184,6 +1185,9 @@ exports[`opening dock tab for installing helm chart given application is started
add
</span>
</i>
<div>
New tab
</div>
</div>
</div>
</div>
@ -1854,7 +1858,6 @@ exports[`opening dock tab for installing helm chart given application is started
class="Icon new-dock-tab material interactive focusable"
id="menu-actions-for-dock"
tabindex="0"
tooltip="New tab"
>
<span
class="icon"
@ -1863,6 +1866,9 @@ exports[`opening dock tab for installing helm chart given application is started
add
</span>
</i>
<div>
New tab
</div>
</div>
</div>
</div>
@ -1887,7 +1893,6 @@ exports[`opening dock tab for installing helm chart given application is started
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Copy"
>
<span
class="icon"
@ -1896,11 +1901,13 @@ exports[`opening dock tab for installing helm chart given application is started
content_copy
</span>
</i>
<div>
Copy
</div>
</div>
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Close"
>
<span
class="icon"
@ -1909,6 +1916,9 @@ exports[`opening dock tab for installing helm chart given application is started
close
</span>
</i>
<div>
Close
</div>
</div>
<div
class="drawer-content flex column box grow"
@ -2586,7 +2596,6 @@ exports[`opening dock tab for installing helm chart given application is started
class="Icon new-dock-tab material interactive focusable"
id="menu-actions-for-dock"
tabindex="0"
tooltip="New tab"
>
<span
class="icon"
@ -2595,6 +2604,9 @@ exports[`opening dock tab for installing helm chart given application is started
add
</span>
</i>
<div>
New tab
</div>
</div>
</div>
</div>
@ -2619,7 +2631,6 @@ exports[`opening dock tab for installing helm chart given application is started
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Copy"
>
<span
class="icon"
@ -2628,11 +2639,13 @@ exports[`opening dock tab for installing helm chart given application is started
content_copy
</span>
</i>
<div>
Copy
</div>
</div>
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Close"
>
<span
class="icon"
@ -2641,6 +2654,9 @@ exports[`opening dock tab for installing helm chart given application is started
close
</span>
</i>
<div>
Close
</div>
</div>
<div
class="drawer-content flex column box grow"
@ -3497,7 +3513,6 @@ exports[`opening dock tab for installing helm chart given application is started
class="Icon new-dock-tab material interactive focusable"
id="menu-actions-for-dock"
tabindex="0"
tooltip="New tab"
>
<span
class="icon"
@ -3506,6 +3521,9 @@ exports[`opening dock tab for installing helm chart given application is started
add
</span>
</i>
<div>
New tab
</div>
</div>
</div>
</div>
@ -3530,7 +3548,6 @@ exports[`opening dock tab for installing helm chart given application is started
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Copy"
>
<span
class="icon"
@ -3539,11 +3556,13 @@ exports[`opening dock tab for installing helm chart given application is started
content_copy
</span>
</i>
<div>
Copy
</div>
</div>
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Close"
>
<span
class="icon"
@ -3552,6 +3571,9 @@ exports[`opening dock tab for installing helm chart given application is started
close
</span>
</i>
<div>
Close
</div>
</div>
<div
class="drawer-content flex column box grow"
@ -4418,7 +4440,6 @@ exports[`opening dock tab for installing helm chart given application is started
class="Icon new-dock-tab material interactive focusable"
id="menu-actions-for-dock"
tabindex="0"
tooltip="New tab"
>
<span
class="icon"
@ -4427,6 +4448,9 @@ exports[`opening dock tab for installing helm chart given application is started
add
</span>
</i>
<div>
New tab
</div>
</div>
</div>
</div>
@ -4451,7 +4475,6 @@ exports[`opening dock tab for installing helm chart given application is started
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Copy"
>
<span
class="icon"
@ -4460,11 +4483,13 @@ exports[`opening dock tab for installing helm chart given application is started
content_copy
</span>
</i>
<div>
Copy
</div>
</div>
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Close"
>
<span
class="icon"
@ -4473,6 +4498,9 @@ exports[`opening dock tab for installing helm chart given application is started
close
</span>
</i>
<div>
Close
</div>
</div>
<div
class="drawer-content flex column box grow"
@ -5329,7 +5357,6 @@ exports[`opening dock tab for installing helm chart given application is started
class="Icon new-dock-tab material interactive focusable"
id="menu-actions-for-dock"
tabindex="0"
tooltip="New tab"
>
<span
class="icon"
@ -5338,6 +5365,9 @@ exports[`opening dock tab for installing helm chart given application is started
add
</span>
</i>
<div>
New tab
</div>
</div>
</div>
</div>
@ -5362,7 +5392,6 @@ exports[`opening dock tab for installing helm chart given application is started
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Copy"
>
<span
class="icon"
@ -5371,11 +5400,13 @@ exports[`opening dock tab for installing helm chart given application is started
content_copy
</span>
</i>
<div>
Copy
</div>
</div>
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Close"
>
<span
class="icon"
@ -5384,6 +5415,9 @@ exports[`opening dock tab for installing helm chart given application is started
close
</span>
</i>
<div>
Close
</div>
</div>
<div
class="drawer-content flex column box grow"
@ -6273,7 +6307,6 @@ exports[`opening dock tab for installing helm chart given application is started
<i
class="Icon material interactive focusable small"
tabindex="0"
tooltip="Close ⌘+W"
>
<span
class="icon"
@ -6282,6 +6315,9 @@ exports[`opening dock tab for installing helm chart given application is started
close
</span>
</i>
<div>
Close ⌘+W
</div>
</div>
</div>
</div>
@ -6298,7 +6334,6 @@ exports[`opening dock tab for installing helm chart given application is started
class="Icon new-dock-tab material interactive focusable"
id="menu-actions-for-dock"
tabindex="0"
tooltip="New tab"
>
<span
class="icon"
@ -6307,11 +6342,13 @@ exports[`opening dock tab for installing helm chart given application is started
add
</span>
</i>
<div>
New tab
</div>
</div>
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Fit to window"
>
<span
class="icon"
@ -6320,10 +6357,12 @@ exports[`opening dock tab for installing helm chart given application is started
fullscreen
</span>
</i>
<div>
Fit to window
</div>
<i
class="Icon material interactive focusable"
tabindex="0"
tooltip="Minimize"
>
<span
class="icon"
@ -6332,6 +6371,9 @@ exports[`opening dock tab for installing helm chart given application is started
keyboard_arrow_down
</span>
</i>
<div>
Minimize
</div>
</div>
</div>
<div

View File

@ -31,11 +31,6 @@ import dockStoreInjectable from "../../../renderer/components/dock/dock/store.in
import readJsonFileInjectable from "../../../common/fs/read-json-file.injectable";
import type { DiContainer } from "@ogre-tools/injectable";
// TODO: Make tooltips free of side effects by making it deterministic
jest.mock("../../../renderer/components/tooltip/withTooltip", () => ({
withTooltip: (target: any) => target,
}));
describe("installing helm chart from new tab", () => {
let builder: ApplicationBuilder;
let rendererDi: DiContainer;

View File

@ -24,11 +24,6 @@ import { controlWhenStoragesAreReady } from "../../../renderer/utils/create-stor
import type { DiContainer } from "@ogre-tools/injectable";
import callForCreateHelmReleaseInjectable from "../../../renderer/components/+helm-releases/create-release/call-for-create-helm-release.injectable";
// TODO: Make tooltips free of side effects by making it deterministic
jest.mock("../../../renderer/components/tooltip/withTooltip", () => ({
withTooltip: (target: any) => target,
}));
describe("installing helm chart from previously opened tab", () => {
let builder: ApplicationBuilder;
let rendererDi: DiContainer;

View File

@ -25,11 +25,6 @@ import hostedClusterIdInjectable from "../../../renderer/cluster-frame-context/h
import dockStoreInjectable from "../../../renderer/components/dock/dock/store.injectable";
import type { DiContainer } from "@ogre-tools/injectable";
// TODO: Make tooltips free of side effects by making it deterministic
jest.mock("../../../renderer/components/tooltip/withTooltip", () => ({
withTooltip: (target: any) => target,
}));
describe("opening dock tab for installing helm chart", () => {
let builder: ApplicationBuilder;
let rendererDi: DiContainer;

View File

@ -17,11 +17,6 @@ import type { Logger } from "../../common/logger";
import callForPublicHelmRepositoriesInjectable from "../../renderer/components/+preferences/kubernetes/helm-charts/adding-of-public-helm-repository/public-helm-repositories/call-for-public-helm-repositories.injectable";
import showErrorNotificationInjectable from "../../renderer/components/notifications/show-error-notification.injectable";
// TODO: Make tooltips free of side effects by making it deterministic
jest.mock("../../renderer/components/tooltip/withTooltip", () => ({
withTooltip: (target: any) => target,
}));
describe("listing active helm repositories in preferences", () => {
let applicationBuilder: ApplicationBuilder;
let rendered: RenderResult;

View File

@ -15,11 +15,6 @@ import type { HelmRepo } from "../../common/helm/helm-repo";
import callForPublicHelmRepositoriesInjectable from "../../renderer/components/+preferences/kubernetes/helm-charts/adding-of-public-helm-repository/public-helm-repositories/call-for-public-helm-repositories.injectable";
import type { AsyncResult } from "../../common/utils/async-result";
// TODO: Make tooltips free of side effects by making it deterministic
jest.mock("../../renderer/components/tooltip/withTooltip", () => ({
withTooltip: (target: any) => target,
}));
describe("remove helm repository from list of active repositories in preferences", () => {
let applicationBuilder: ApplicationBuilder;
let rendered: RenderResult;

View File

@ -24,11 +24,6 @@ import showSuccessNotificationInjectable from "../../renderer/components/notific
import showCheckedErrorInjectable from "../../renderer/components/notifications/show-checked-error.injectable";
import getRandomUpgradeChartTabIdInjectable from "../../renderer/components/dock/upgrade-chart/get-random-upgrade-chart-tab-id.injectable";
// TODO: Make tooltips free of side effects by making it deterministic
jest.mock("../../renderer/components/tooltip/withTooltip", () => ({
withTooltip: (target: any) => target,
}));
describe("showing details for helm release", () => {
let builder: ApplicationBuilder;
let callForHelmReleasesMock: AsyncFnMock<CallForHelmReleases>;

View File

@ -58,11 +58,11 @@ export interface ResourceMetricSource {
}
export interface BaseHorizontalPodAutoscalerMetricSpec {
resource: ResourceMetricSource;
object: ObjectMetricSource;
external: ExternalMetricSource;
pods: PodsMetricSource;
containerResource: ContainerResourceMetricSource;
external: ExternalMetricSource;
object: ObjectMetricSource;
pods: PodsMetricSource;
resource: ResourceMetricSource;
}
export type HorizontalPodAutoscalerMetricSpec =
@ -72,6 +72,55 @@ export type HorizontalPodAutoscalerMetricSpec =
| OptionVarient<HpaMetricType.Pods, BaseHorizontalPodAutoscalerMetricSpec, "pods">
| OptionVarient<HpaMetricType.ContainerResource, BaseHorizontalPodAutoscalerMetricSpec, "containerResource">;
export interface ContainerResourceMetricStatus {
container: string;
currentAverageUtilization?: number;
currentAverageValue: string;
name: string;
}
export interface ExternalMetricStatus {
currentAverageValue?: string;
currentValue: string;
metricName: string;
metricSelector?: LabelSelector;
}
export interface ObjectMetricStatus {
averageValue?: string;
currentValue?: string;
metricName: string;
selector?: LabelSelector;
target: CrossVersionObjectReference;
}
export interface PodsMetricStatus {
currentAverageValue: string;
metricName: string;
selector?: LabelSelector;
}
export interface ResourceMetricStatus {
currentAverageUtilization?: number;
currentAverageValue: string;
name: string;
}
export interface BaseHorizontalPodAutoscalerMetricStatus {
containerResource: ContainerResourceMetricStatus;
external: ExternalMetricStatus;
object: ObjectMetricStatus;
pods: PodsMetricStatus;
resource: ResourceMetricStatus;
}
export type HorizontalPodAutoscalerMetricStatus =
| OptionVarient<HpaMetricType.Resource, BaseHorizontalPodAutoscalerMetricStatus, "resource">
| OptionVarient<HpaMetricType.External, BaseHorizontalPodAutoscalerMetricStatus, "external">
| OptionVarient<HpaMetricType.Object, BaseHorizontalPodAutoscalerMetricStatus, "object">
| OptionVarient<HpaMetricType.Pods, BaseHorizontalPodAutoscalerMetricStatus, "pods">
| OptionVarient<HpaMetricType.ContainerResource, BaseHorizontalPodAutoscalerMetricStatus, "containerResource">;
export interface CrossVersionObjectReference {
kind: string;
name: string;
@ -89,7 +138,7 @@ export interface HorizontalPodAutoscalerStatus {
conditions?: BaseKubeObjectCondition[];
currentReplicas: number;
desiredReplicas: number;
currentMetrics: HorizontalPodAutoscalerMetricSpec[];
currentMetrics?: HorizontalPodAutoscalerMetricStatus[];
}
interface MetricCurrentTarget {
@ -142,114 +191,11 @@ export class HorizontalPodAutoscaler extends KubeObject<
return this.status?.currentMetrics ?? [];
}
protected getMetricName(metric: HorizontalPodAutoscalerMetricSpec): string {
switch (metric.type) {
case HpaMetricType.Resource:
return metric.resource.name;
case HpaMetricType.Pods:
return metric.pods.metricName;
case HpaMetricType.Object:
return metric.object.metricName;
case HpaMetricType.External:
return metric.external.metricName;
case HpaMetricType.ContainerResource:
return metric.containerResource.name;
default:
return `<unknown metric type: ${(metric as HorizontalPodAutoscalerMetricSpec).type}>`;
}
}
protected getResourceMetricValue(currentMetric: ResourceMetricSource | undefined, targetMetric: ResourceMetricSource): MetricCurrentTarget {
return {
current: (
currentMetric?.targetAverageUtilization
? `${currentMetric.targetAverageUtilization}%`
: currentMetric?.targetAverageValue
),
target: (
targetMetric?.targetAverageUtilization
? `${targetMetric.targetAverageUtilization}%`
: targetMetric?.targetAverageValue
),
};
}
protected getPodsMetricValue(currentMetric: PodsMetricSource | undefined, targetMetric: PodsMetricSource): MetricCurrentTarget {
return {
current: currentMetric?.targetAverageValue,
target: targetMetric?.targetAverageValue,
};
}
protected getObjectMetricValue(currentMetric: ObjectMetricSource | undefined, targetMetric: ObjectMetricSource): MetricCurrentTarget {
return {
current: (
currentMetric?.targetValue
?? currentMetric?.averageValue
),
target: (
targetMetric?.targetValue
?? targetMetric?.averageValue
),
};
}
protected getExternalMetricValue(currentMetric: ExternalMetricSource | undefined, targetMetric: ExternalMetricSource): MetricCurrentTarget {
return {
current: (
currentMetric?.targetValue
?? currentMetric?.targetAverageValue
),
target: (
targetMetric?.targetValue
?? targetMetric?.targetAverageValue
),
};
}
protected getContainerResourceMetricValue(currentMetric: ContainerResourceMetricSource | undefined, targetMetric: ContainerResourceMetricSource): MetricCurrentTarget {
return {
current: (
currentMetric?.targetAverageUtilization
? `${currentMetric.targetAverageUtilization}%`
: currentMetric?.targetAverageValue
),
target: (
targetMetric?.targetAverageUtilization
? `${targetMetric.targetAverageUtilization}%`
: targetMetric?.targetAverageValue
),
};
}
protected getMetricCurrentTarget(metric: HorizontalPodAutoscalerMetricSpec): MetricCurrentTarget {
const currentMetric = this.getMetrics()
.find(m => (
m.type === metric.type
&& this.getMetricName(m) === this.getMetricName(metric)
));
switch (metric.type) {
case HpaMetricType.Resource:
return this.getResourceMetricValue(currentMetric?.resource, metric.resource);
case HpaMetricType.Pods:
return this.getPodsMetricValue(currentMetric?.pods, metric.pods);
case HpaMetricType.Object:
return this.getObjectMetricValue(currentMetric?.object, metric.object);
case HpaMetricType.External:
return this.getExternalMetricValue(currentMetric?.external, metric.external);
case HpaMetricType.ContainerResource:
return this.getContainerResourceMetricValue(currentMetric?.containerResource, metric.containerResource);
default:
return {};
}
}
getMetricValues(metric: HorizontalPodAutoscalerMetricSpec): string {
const {
current = "unknown",
target = "unknown",
} = this.getMetricCurrentTarget(metric);
} = getMetricCurrentTarget(metric, this.getCurrentMetrics());
return `${current} / ${target}`;
}
@ -263,3 +209,105 @@ export class HorizontalPodAutoscalerApi extends KubeApi<HorizontalPodAutoscaler>
});
}
}
function getMetricName(metric: HorizontalPodAutoscalerMetricSpec | HorizontalPodAutoscalerMetricStatus): string | undefined {
switch (metric.type) {
case HpaMetricType.Resource:
return metric.resource.name;
case HpaMetricType.Pods:
return metric.pods.metricName;
case HpaMetricType.Object:
return metric.object.metricName;
case HpaMetricType.External:
return metric.external.metricName;
case HpaMetricType.ContainerResource:
return metric.containerResource.name;
default:
return undefined;
}
}
function getResourceMetricValue(currentMetric: ResourceMetricStatus | undefined, targetMetric: ResourceMetricSource): MetricCurrentTarget {
return {
current: (
typeof currentMetric?.currentAverageUtilization === "number"
? `${currentMetric.currentAverageUtilization}%`
: currentMetric?.currentAverageValue
),
target: (
typeof targetMetric?.targetAverageUtilization === "number"
? `${targetMetric.targetAverageUtilization}%`
: targetMetric?.targetAverageValue
),
};
}
function getPodsMetricValue(currentMetric: PodsMetricStatus | undefined, targetMetric: PodsMetricSource): MetricCurrentTarget {
return {
current: currentMetric?.currentAverageValue,
target: targetMetric?.targetAverageValue,
};
}
function getObjectMetricValue(currentMetric: ObjectMetricStatus | undefined, targetMetric: ObjectMetricSource): MetricCurrentTarget {
return {
current: (
currentMetric?.currentValue
?? currentMetric?.averageValue
),
target: (
targetMetric?.targetValue
?? targetMetric?.averageValue
),
};
}
function getExternalMetricValue(currentMetric: ExternalMetricStatus | undefined, targetMetric: ExternalMetricSource): MetricCurrentTarget {
return {
current: (
currentMetric?.currentValue
?? currentMetric?.currentAverageValue
),
target: (
targetMetric?.targetValue
?? targetMetric?.targetAverageValue
),
};
}
function getContainerResourceMetricValue(currentMetric: ContainerResourceMetricStatus | undefined, targetMetric: ContainerResourceMetricSource): MetricCurrentTarget {
return {
current: (
typeof currentMetric?.currentAverageUtilization === "number"
? `${currentMetric.currentAverageUtilization}%`
: currentMetric?.currentAverageValue
),
target: (
typeof targetMetric?.targetAverageUtilization === "number"
? `${targetMetric.targetAverageUtilization}%`
: targetMetric?.targetAverageValue
),
};
}
function getMetricCurrentTarget(spec: HorizontalPodAutoscalerMetricSpec, status: HorizontalPodAutoscalerMetricStatus[]): MetricCurrentTarget {
const currentMetric = status.find(m => (
m.type === spec.type
&& getMetricName(m) === getMetricName(spec)
));
switch (spec.type) {
case HpaMetricType.Resource:
return getResourceMetricValue(currentMetric?.resource, spec.resource);
case HpaMetricType.Pods:
return getPodsMetricValue(currentMetric?.pods, spec.pods);
case HpaMetricType.Object:
return getObjectMetricValue(currentMetric?.object, spec.object);
case HpaMetricType.External:
return getExternalMetricValue(currentMetric?.external, spec.external);
case HpaMetricType.ContainerResource:
return getContainerResourceMetricValue(currentMetric?.containerResource, spec.containerResource);
default:
return {};
}
}

View File

@ -355,7 +355,7 @@ export abstract class KubeObjectStore<
async loadFromPath(resourcePath: string) {
const { namespace, name } = parseKubeApi(resourcePath);
assert(name && namespace, "Both name and namesapce must be part of resourcePath");
assert(name, "name must be part of resourcePath");
return this.load({ name, namespace });
}

View File

@ -0,0 +1,32 @@
/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import path from "path";
import { unionPATHs } from "../union-env-path";
describe("unionPATHs", () => {
it("return the same path if given only one with no double delimiters", () => {
expect(unionPATHs(`/bin/bar${path.delimiter}/usr/bin`)).toBe(`/bin/bar${path.delimiter}/usr/bin`);
});
it("return equivalent path if given only one with no double delimiters", () => {
expect(unionPATHs(`/bin/bar${path.delimiter}${path.delimiter}/usr/bin`)).toBe(`/bin/bar${path.delimiter}/usr/bin`);
});
it("should remove duplicate entries, appending non duplicates in order received", () => {
expect(unionPATHs(
`/bin/bar${path.delimiter}/usr/bin`,
`/bin/bar${path.delimiter}/usr/lens/bat`,
)).toBe(`/bin/bar${path.delimiter}/usr/bin${path.delimiter}/usr/lens/bat`);
});
it("should remove duplicate entries, appending non duplicates in order received, 3", () => {
expect(unionPATHs(
`/bin/bar${path.delimiter}/usr/bin`,
`/bin/bar${path.delimiter}/usr/lens/bat`,
`/usr/local/lens${path.delimiter}/usr/bin`,
)).toBe(`/bin/bar${path.delimiter}/usr/bin${path.delimiter}/usr/lens/bat${path.delimiter}/usr/local/lens`);
});
});

View File

@ -3,18 +3,38 @@
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { TypedRegEx } from "typed-regex";
// Helper to convert CPU K8S units to numbers
const thousand = 1000;
const million = thousand * thousand;
const shortBillion = thousand * million;
const unitConverters = new Map([
["n", 1000 ** -3],
["u", 1000 ** -2],
["m", 1000 ** -1], // milli
["", 1000 ** 0], // no units
["k", 1000 ** 1],
["M", 1000 ** 2],
["G", 1000 ** 3],
["P", 1000 ** 4],
["T", 1000 ** 5],
["E", 1000 ** 6],
]);
export function cpuUnitsToNumber(cpu: string) {
const cpuNum = parseInt(cpu);
const cpuUnitsRegex = TypedRegEx("^(?<digits>[+-]?[0-9.]+(e[-+]?[0-9]+)?)(?<unit>[EinumkKMGTP]*)$");
if (cpu.includes("m")) return cpuNum / thousand;
if (cpu.includes("u")) return cpuNum / million;
if (cpu.includes("n")) return cpuNum / shortBillion;
export function cpuUnitsToNumber(value: string) {
const match = cpuUnitsRegex.captures(value);
return parseFloat(cpu);
if (!match) {
return undefined;
}
const { digits = "", unit } = match;
const conversion = unitConverters.get(unit);
if (conversion === undefined) {
return undefined;
}
return parseFloat(digits) * conversion;
}

View File

@ -22,7 +22,6 @@ export * from "./hash-set";
export * from "./n-fircate";
export * from "./noop";
export * from "./observable-crate/impl";
export * from "./openBrowser";
export * from "./paths";
export * from "./promise-exec";
export * from "./readonly";

View File

@ -0,0 +1,9 @@
/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { getGlobalOverride } from "../test-utils/get-global-override";
import openLinkInBrowserInjectable from "./open-link-in-browser.injectable";
export default getGlobalOverride(openLinkInBrowserInjectable, () => async () => {});

View File

@ -0,0 +1,28 @@
/**
* 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 { shell } from "electron";
const allowedProtocols = new Set(["http:", "https:"]);
export type OpenLinkInBrowser = (url: string) => Promise<void>;
const openLinkInBrowserInjectable = getInjectable({
id: "open-link-in-browser",
instantiate: (): OpenLinkInBrowser => (
async (url) => {
const { protocol } = new URL(url);
if (!allowedProtocols.has(protocol)) {
throw new TypeError("not an http(s) URL");
}
await shell.openExternal(url);
}
),
causesSideEffects: true,
});
export default openLinkInBrowserInjectable;

View File

@ -1,29 +0,0 @@
/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { shell } from "electron";
const allowedProtocols = new Set(["http:", "https:"]);
/**
* Opens a link using the program configured as the default browser
* on the target platform. Will reject URLs with a scheme other than
* http or https to prevent programs other than the default browser
* running.
*
* @param url The URL to open
*/
export function openBrowser(url: string): Promise<void> {
if (allowedProtocols.has(new URL(url).protocol)) {
return shell.openExternal(url);
}
return Promise.reject(new TypeError("not an http(s) URL"));
}
/**
* @deprecated use openBrowser
*/
export const openExternal = openBrowser;

View File

@ -24,8 +24,9 @@ type TupleOfImpl<T, N extends number, R extends unknown[]> = R["length"] extends
* @yields A tuple of the next element from each of the sources
* @returns The tuple of all the sources as soon as at least one of the sources is exausted
*/
export function zip<T>(src1: T[]): Iterator<[T], Tuple<T[], 1>>;
export function zip<T>(src1: T[], src2: T[]): Iterator<[T, T], Tuple<T[], 2>>;
export function zip<T>(...sources: Tuple<T[], 0>): Iterator<Tuple<T, 0>, Tuple<T[], 0>>;
export function zip<T>(...sources: Tuple<T[], 1>): Iterator<Tuple<T, 1>, Tuple<T[], 1>>;
export function zip<T>(...sources: Tuple<T[], 2>): Iterator<Tuple<T, 2>, Tuple<T[], 2>>;
export function* zip<T, N extends number>(...sources: Tuple<T[], N>): Iterator<Tuple<T, N>, Tuple<T[], N>> {
const maxSafeLength = Math.min(...sources.map(source => source.length));

View File

@ -0,0 +1,20 @@
/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import path from "path";
import * as iter from "./iter";
/**
* Join all entires with a PATH env var delimated string together
* @param PATHs Any number of PATH env variables
*
* NOTE: This function does not attempt to handle any sort of escape sequences since after testing
* it was found that `zsh` (at least on `macOS`) does not when trying to find programs
*/
export function unionPATHs(...PATHs: string[]): string {
const entries = new Set(iter.filterFlatMap(PATHs, PATH => PATH.split(path.delimiter)));
return iter.join(entries.values(), path.delimiter);
}

View File

@ -3,6 +3,15 @@
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
export { Singleton, openExternal, openBrowser, getAppVersion } from "../../common/utils";
import openLinkInBrowserInjectable from "../../common/utils/open-link-in-browser.injectable";
import { asLegacyGlobalFunctionForExtensionApi } from "../as-legacy-globals-for-extension-api/as-legacy-global-function-for-extension-api";
export { Singleton, getAppVersion } from "../../common/utils";
export { prevDefault, stopPropagation } from "../../renderer/utils/prevDefault";
export { cssNames } from "../../renderer/utils/cssNames";
/**
* @deprecated Use {@link openBrowser} instead
*/
export const openExternal = asLegacyGlobalFunctionForExtensionApi(openLinkInBrowserInjectable);
export const openBrowser = asLegacyGlobalFunctionForExtensionApi(openLinkInBrowserInjectable);

View File

@ -44,3 +44,4 @@ global.ResizeObserver = class {
};
jest.mock("./renderer/components/monaco-editor/monaco-editor");
jest.mock("./renderer/components/tooltip/withTooltip");

View File

@ -59,9 +59,11 @@ const checkForUpdatesTrayItemInjectable = getInjectable({
click: pipeline(
async () => {
await processCheckingForUpdates("tray");
const { updateIsReadyToBeInstalled } = await processCheckingForUpdates("tray");
await showApplicationWindow();
if (updateIsReadyToBeInstalled) {
await showApplicationWindow();
}
},
withErrorLoggingFor(() => "[TRAY]: Checking for updates failed."),

View File

@ -9,7 +9,6 @@ import discoveredUpdateVersionInjectable from "../../../common/application-updat
import { runInAction } from "mobx";
import downloadUpdateInjectable from "../download-update/download-update.injectable";
import checkForUpdatesStartingFromChannelInjectable from "./check-for-updates-starting-from-channel.injectable";
import withOrphanPromiseInjectable from "../../../common/utils/with-orphan-promise/with-orphan-promise.injectable";
import emitEventInjectable from "../../../common/app-event-bus/emit-event.injectable";
import { getCurrentDateTime } from "../../../common/utils/date/get-current-date-time";
@ -22,7 +21,6 @@ const processCheckingForUpdatesInjectable = getInjectable({
const checkingForUpdatesState = di.inject(updatesAreBeingDiscoveredInjectable);
const discoveredVersionState = di.inject(discoveredUpdateVersionInjectable);
const checkForUpdatesStartingFromChannel = di.inject(checkForUpdatesStartingFromChannelInjectable);
const withOrphanPromise = di.inject(withOrphanPromiseInjectable);
const emitEvent = di.inject(emitEventInjectable);
return async (source: string) => {
@ -44,7 +42,7 @@ const processCheckingForUpdatesInjectable = getInjectable({
checkingForUpdatesState.set(false);
});
return;
return { updateIsReadyToBeInstalled: false };
}
const { version, actualUpdateChannel } = result;
@ -56,7 +54,7 @@ const processCheckingForUpdatesInjectable = getInjectable({
checkingForUpdatesState.set(false);
});
return;
return { updateIsReadyToBeInstalled: true };
}
emitEvent({
@ -74,7 +72,9 @@ const processCheckingForUpdatesInjectable = getInjectable({
checkingForUpdatesState.set(false);
});
withOrphanPromise(async () => await downloadUpdate())();
const { downloadWasSuccessful } = await downloadUpdate();
return { updateIsReadyToBeInstalled: downloadWasSuccessful };
};
},
});

View File

@ -4,8 +4,8 @@
*/
import { getInjectable } from "@ogre-tools/injectable";
import periodicalCheckForUpdatesInjectable from "./periodical-check-for-updates.injectable";
import { afterRootFrameIsReadyInjectionToken } from "../../start-main-application/runnable-tokens/after-root-frame-is-ready-injection-token";
import updatingIsEnabledInjectable from "../updating-is-enabled.injectable";
import { afterApplicationIsLoadedInjectionToken } from "../../start-main-application/runnable-tokens/after-application-is-loaded-injection-token";
const startCheckingForUpdatesInjectable = getInjectable({
id: "start-checking-for-updates",
@ -23,7 +23,7 @@ const startCheckingForUpdatesInjectable = getInjectable({
};
},
injectionToken: afterRootFrameIsReadyInjectionToken,
injectionToken: afterApplicationIsLoadedInjectionToken,
});
export default startCheckingForUpdatesInjectable;

View File

@ -3,8 +3,8 @@
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { getInjectable } from "@ogre-tools/injectable";
import { beforeQuitOfFrontEndInjectionToken } from "../../start-main-application/runnable-tokens/before-quit-of-front-end-injection-token";
import periodicalCheckForUpdatesInjectable from "./periodical-check-for-updates.injectable";
import { beforeQuitOfBackEndInjectionToken } from "../../start-main-application/runnable-tokens/before-quit-of-back-end-injection-token";
const stopCheckingForUpdatesInjectable = getInjectable({
id: "stop-checking-for-updates",
@ -21,7 +21,7 @@ const stopCheckingForUpdatesInjectable = getInjectable({
};
},
injectionToken: beforeQuitOfFrontEndInjectionToken,
injectionToken: beforeQuitOfBackEndInjectionToken,
});
export default stopCheckingForUpdatesInjectable;

View File

@ -5,7 +5,6 @@
import { getInjectable } from "@ogre-tools/injectable";
import { docsUrl, productName, supportUrl } from "../../common/vars";
import { broadcastMessage } from "../../common/ipc";
import { openBrowser } from "../../common/utils";
import type { MenuItemConstructorOptions } from "electron";
import { webContents } from "electron";
import loggerInjectable from "../../common/logger.injectable";
@ -25,6 +24,7 @@ import applicationWindowInjectable from "../start-main-application/lens-window/a
import reloadWindowInjectable from "../start-main-application/lens-window/reload-window.injectable";
import showApplicationWindowInjectable from "../start-main-application/lens-window/show-application-window.injectable";
import processCheckingForUpdatesInjectable from "../application-update/check-for-updates/process-checking-for-updates.injectable";
import openLinkInBrowserInjectable from "../../common/utils/open-link-in-browser.injectable";
function ignoreIf(check: boolean, menuItems: MenuItemOpts[]) {
return check ? [] : menuItems;
@ -54,6 +54,7 @@ const applicationMenuItemsInjectable = getInjectable({
const navigateToAddCluster = di.inject(navigateToAddClusterInjectable);
const stopServicesAndExitApp = di.inject(stopServicesAndExitAppInjectable);
const processCheckingForUpdates = di.inject(processCheckingForUpdatesInjectable);
const openLinkInBrowser = di.inject(openLinkInBrowserInjectable);
logger.info(`[MENU]: autoUpdateEnabled=${updatingIsEnabled}`);
@ -260,7 +261,7 @@ const applicationMenuItemsInjectable = getInjectable({
label: "Documentation",
id: "documentation",
click: async () => {
openBrowser(docsUrl).catch((error) => {
openLinkInBrowser(docsUrl).catch((error) => {
logger.error("[MENU]: failed to open browser", { error });
});
},
@ -269,7 +270,7 @@ const applicationMenuItemsInjectable = getInjectable({
label: "Support",
id: "support",
click: async () => {
openBrowser(supportUrl).catch((error) => {
openLinkInBrowser(supportUrl).catch((error) => {
logger.error("[MENU]: failed to open browser", { error });
});
},

View File

@ -8,6 +8,7 @@ import os from "os";
import { app } from "electron";
import logger from "./logger";
import { isSnap } from "../common/vars";
import { unionPATHs } from "../common/utils/union-env-path";
/**
* shellSync loads what would have been the environment if this application was
@ -25,7 +26,8 @@ export async function shellSync() {
}
if (!isSnap) {
process.env.PATH = env.PATH;
// Prefer the synced PATH over the initial one
process.env.PATH = unionPATHs(env.PATH ?? "", process.env.PATH ?? "");
}
// The spread operator allows joining of objects. The precedence is last to first.

View File

@ -6,10 +6,10 @@ import { getInjectable } from "@ogre-tools/injectable";
import loggerInjectable from "../../../../common/logger.injectable";
import applicationWindowStateInjectable from "./application-window-state.injectable";
import { BrowserWindow } from "electron";
import { openBrowser } from "../../../../common/utils";
import sendToChannelInElectronBrowserWindowInjectable from "./send-to-channel-in-electron-browser-window.injectable";
import type { ElectronWindow } from "./create-lens-window.injectable";
import type { RequireExactlyOne } from "type-fest";
import openLinkInBrowserInjectable from "../../../../common/utils/open-link-in-browser.injectable";
export type ElectronWindowTitleBarStyle = "hiddenInset" | "hidden" | "default" | "customButtonsOnHover";
@ -46,6 +46,7 @@ const createElectronWindowInjectable = getInjectable({
instantiate: (di): CreateElectronWindow => {
const logger = di.inject(loggerInjectable);
const sendToChannelInLensWindow = di.inject(sendToChannelInElectronBrowserWindowInjectable);
const openLinkInBrowser = di.inject(openLinkInBrowserInjectable);
return (configuration) => {
const applicationWindowState = di.inject(
@ -158,7 +159,7 @@ const createElectronWindowInjectable = getInjectable({
})
.setWindowOpenHandler((details) => {
openBrowser(details.url).catch((error) => {
openLinkInBrowser(details.url).catch((error) => {
logger.error("[CREATE-ELECTRON-WINDOW]: failed to open browser", {
error,
});

View File

@ -3,7 +3,7 @@
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { getInjectable } from "@ogre-tools/injectable";
import { afterRootFrameIsReadyInjectionToken } from "../../runnable-tokens/after-root-frame-is-ready-injection-token";
import { afterApplicationIsLoadedInjectionToken } from "../../runnable-tokens/after-application-is-loaded-injection-token";
import directoryForKubeConfigsInjectable from "../../../../common/app-paths/directory-for-kube-configs/directory-for-kube-configs.injectable";
import ensureDirInjectable from "../../../../common/fs/ensure-dir.injectable";
import kubeconfigSyncManagerInjectable from "../../../catalog-sources/kubeconfig-sync/manager.injectable";
@ -27,7 +27,7 @@ const startKubeConfigSyncInjectable = getInjectable({
causesSideEffects: true,
injectionToken: afterRootFrameIsReadyInjectionToken,
injectionToken: afterApplicationIsLoadedInjectionToken,
});
export default startKubeConfigSyncInjectable;

View File

@ -3,7 +3,7 @@
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { getInjectable } from "@ogre-tools/injectable";
import { beforeQuitOfFrontEndInjectionToken } from "../../runnable-tokens/before-quit-of-front-end-injection-token";
import { beforeQuitOfBackEndInjectionToken } from "../../runnable-tokens/before-quit-of-back-end-injection-token";
import kubeconfigSyncManagerInjectable from "../../../catalog-sources/kubeconfig-sync/manager.injectable";
const stopKubeConfigSyncInjectable = getInjectable({
@ -19,7 +19,7 @@ const stopKubeConfigSyncInjectable = getInjectable({
};
},
injectionToken: beforeQuitOfFrontEndInjectionToken,
injectionToken: beforeQuitOfBackEndInjectionToken,
});
export default stopKubeConfigSyncInjectable;

View File

@ -6,7 +6,7 @@
import shellEnvironment from "shell-env";
import logger from "../logger";
export type EnvironmentVariables = Record<string, string>;
export type EnvironmentVariables = Partial<Record<string, string>>;
let shellSyncFailed = false;

View File

@ -6,13 +6,13 @@
import React from "react";
import { observer } from "mobx-react";
import type { NodeStore } from "../+nodes/store";
import { cssNames } from "../../utils";
import { Radio, RadioGroup } from "../radio";
import type { ClusterOverviewStore } from "./cluster-overview-store/cluster-overview-store";
import { MetricNodeRole, MetricType } from "./cluster-overview-store/cluster-overview-store";
import clusterOverviewStoreInjectable from "./cluster-overview-store/cluster-overview-store.injectable";
import { withInjectables } from "@ogre-tools/injectable-react";
import nodeStoreInjectable from "../+nodes/store.injectable";
import { normalizeMetrics } from "../../../common/k8s-api/endpoints/metrics.api";
interface Dependencies {
clusterOverviewStore: ClusterOverviewStore;
@ -24,32 +24,50 @@ const NonInjectedClusterMetricSwitchers = observer(({
nodeStore,
}: Dependencies) => {
const { masterNodes, workerNodes } = nodeStore;
const metricsValues = clusterOverviewStore.getMetricsValues(clusterOverviewStore.metrics);
const disableRoles = !masterNodes.length || !workerNodes.length;
const disableMetrics = !metricsValues.length;
const { cpuUsage, memoryUsage } = clusterOverviewStore.metrics;
const hasMasterNodes = masterNodes.length > 0;
const hasWorkerNodes = workerNodes.length > 0;
const hasCpuMetrics = normalizeMetrics(cpuUsage).data.result[0].values.length > 0;
const hasMemoryMetrics = normalizeMetrics(memoryUsage).data.result[0].values.length > 0;
return (
<div className="flex gaps" style={{ marginBottom: "calc(var(--margin) * 2)" }}>
<div className="box grow">
<RadioGroup
asButtons
className={cssNames("RadioGroup flex gaps", { disabled: disableRoles })}
className="RadioGroup flex gaps"
value={clusterOverviewStore.metricNodeRole}
onChange={metric => clusterOverviewStore.metricNodeRole = metric}
>
<Radio label="Master" value={MetricNodeRole.MASTER}/>
<Radio label="Worker" value={MetricNodeRole.WORKER}/>
<Radio
label="Master"
value={MetricNodeRole.MASTER}
disabled={!hasMasterNodes}
/>
<Radio
label="Worker"
value={MetricNodeRole.WORKER}
disabled={!hasWorkerNodes}
/>
</RadioGroup>
</div>
<div className="box grow" style={{ textAlign: "right" }}>
<RadioGroup
asButtons
className={cssNames("RadioGroup flex gaps", { disabled: disableMetrics })}
className="RadioGroup flex gaps"
value={clusterOverviewStore.metricType}
onChange={value => clusterOverviewStore.metricType = value}
>
<Radio label="CPU" value={MetricType.CPU}/>
<Radio label="Memory" value={MetricType.MEMORY}/>
<Radio
label="CPU"
value={MetricType.CPU}
disabled={!hasCpuMetrics}
/>
<Radio
label="Memory"
value={MetricType.MEMORY}
disabled={!hasMemoryMetrics}
/>
</RadioGroup>
</div>
</div>

View File

@ -17,7 +17,7 @@
}
.empty {
margin-top: -45px;
text-align: center;
padding-bottom: 45px;
}
}

View File

@ -63,27 +63,13 @@ class NonInjectedHpaDetails extends React.Component<HpaDetailsProps & Dependenci
case HpaMetricType.Resource: {
const metricSpec = metric.resource ?? metric.containerResource;
const addition = metricSpec.targetAverageUtilization
? "(as a percentage of request)"
? " (as a percentage of request)"
: "";
return (
<>
Resource
{metricSpec.name}
{" "}
on Pods
{addition}
</>
);
return `Resource ${metricSpec.name} on Pods${addition}`;
}
case HpaMetricType.Pods:
return (
<>
{metric.pods.metricName}
{" "}
on Pods
</>
);
return `${metric.pods.metricName} on Pods`;
case HpaMetricType.Object: {
return (
@ -95,15 +81,7 @@ class NonInjectedHpaDetails extends React.Component<HpaDetailsProps & Dependenci
);
}
case HpaMetricType.External:
return (
<>
{metric.external.metricName}
{" "}
on
{" "}
{JSON.stringify(metric.external.metricSelector)}
</>
);
return `${metric.external.metricName} on ${JSON.stringify(metric.external.metricSelector)}`;
}
};

View File

@ -19,7 +19,7 @@ import logger from "../../../common/logger";
export interface ResourceQuotaDetailsProps extends KubeObjectDetailsProps<ResourceQuota> {
}
function transformUnit(name: string, value: string): number {
function transformUnit(name: string, value: string): number | undefined {
if (name.includes("memory") || name.includes("storage")) {
return unitsToBytes(value);
}
@ -36,23 +36,38 @@ function renderQuotas(quota: ResourceQuota): JSX.Element[] {
return object.entries(hard)
.filter(hasDefinedTupleValue)
.map(([name, value]) => {
const current = transformUnit(name, value);
const max = transformUnit(name, value);
const usage = max === 0 ? 100 : Math.ceil(current / max * 100); // special case 0 max as always 100% usage
.map(([name, rawMax]) => {
const rawCurrent = used[name] ?? "0";
const current = transformUnit(name, rawCurrent);
const max = transformUnit(name, rawMax);
if (current === undefined || max === undefined) {
return (
<div key={name} className={cssNames("param", kebabCase(name))}>
<span className="title">{name}</span>
<span className="value">
{`${rawCurrent} / ${rawMax}`}
</span>
</div>
);
}
const usage = max === 0
? 100 // special case 0 max as always 100% usage
: current / max * 100;
return (
<div key={name} className={cssNames("param", kebabCase(name))}>
<span className="title">{name}</span>
<span className="value">
{`${used[name]} / ${value}`}
{`${rawCurrent} / ${rawMax}`}
</span>
<LineProgress
max={max}
value={current}
tooltip={(
<p>
{`Set: ${value}. Usage: ${usage}%`}
{`Set: ${rawMax}. Usage: ${+usage.toFixed(2)}%`}
</p>
)}
/>

View File

@ -5,6 +5,10 @@
.Ingresses {
.TableCell {
&.checkbox .Checkbox {
align-items: flex-start;
}
&.rules {
flex-grow: 3.0;
overflow-x: scroll;
@ -14,8 +18,13 @@
display: none;
}
span:not(:last-of-type) {
margin-right: 1em;
.ingressRule {
overflow: hidden;
text-overflow: ellipsis;
}
.ingressRule + .ingressRule {
margin-top: 6px;
}
}

View File

@ -58,7 +58,7 @@ export class Ingresses extends React.Component {
computeRouteDeclarations(ingress).map(decl => (
decl.displayAsLink
? (
<span key={decl.url}>
<div key={decl.url} className="ingressRule">
<a
href={decl.url}
rel="noreferrer"
@ -68,12 +68,12 @@ export class Ingresses extends React.Component {
{decl.url}
</a>
{`${decl.service}`}
</span>
</div>
)
: (
<span key={decl.url}>
<div key={decl.url} className="ingressRule">
{`${decl.url}${decl.service}`}
</span>
</div>
)
)),
<KubeObjectAge key="age" object={ingress} />,

View File

@ -6,7 +6,6 @@
import React from "react";
import { autoBind, cssNames } from "../../utils";
import type { PortForwardItem, PortForwardStore } from "../../port-forward";
import { openPortForward } from "../../port-forward";
import type { MenuActionsProps } from "../menu/menu-actions";
import { MenuActions } from "../menu/menu-actions";
import { MenuItem } from "../menu";
@ -15,6 +14,8 @@ import { Notifications } from "../notifications";
import { withInjectables } from "@ogre-tools/injectable-react";
import portForwardDialogModelInjectable from "../../port-forward/port-forward-dialog-model/port-forward-dialog-model.injectable";
import portForwardStoreInjectable from "../../port-forward/port-forward-store/port-forward-store.injectable";
import type { OpenPortForward } from "../../port-forward/open-port-forward.injectable";
import openPortForwardInjectable from "../../port-forward/open-port-forward.injectable";
export interface PortForwardMenuProps extends MenuActionsProps {
portForward: PortForwardItem;
@ -24,6 +25,7 @@ export interface PortForwardMenuProps extends MenuActionsProps {
interface Dependencies {
portForwardStore: PortForwardStore;
openPortForwardDialog: (item: PortForwardItem) => void;
openPortForward: OpenPortForward;
}
class NonInjectedPortForwardMenu<Props extends PortForwardMenuProps & Dependencies> extends React.Component<Props> {
@ -94,7 +96,7 @@ class NonInjectedPortForwardMenu<Props extends PortForwardMenuProps & Dependenci
return (
<>
{ portForward.status === "Active" && (
<MenuItem onClick={() => openPortForward(portForward)}>
<MenuItem onClick={() => this.props.openPortForward(portForward)}>
<Icon
material="open_in_browser"
interactive={toolbar}
@ -139,6 +141,7 @@ export const PortForwardMenu = withInjectables<Dependencies, PortForwardMenuProp
getProps: (di, props) => ({
portForwardStore: di.inject(portForwardStoreInjectable),
openPortForwardDialog: di.inject(portForwardDialogModelInjectable).open,
openPortForward: di.inject(openPortForwardInjectable),
...props,
}),
},

View File

@ -13,7 +13,7 @@ import { cssNames } from "../../utils";
import { Notifications } from "../notifications";
import { Button } from "../button";
import type { ForwardedPort, PortForwardStore } from "../../port-forward";
import { openPortForward, predictProtocol } from "../../port-forward";
import { predictProtocol } from "../../port-forward";
import { Spinner } from "../spinner";
import { withInjectables } from "@ogre-tools/injectable-react";
import portForwardStoreInjectable from "../../port-forward/port-forward-store/port-forward-store.injectable";
@ -21,6 +21,8 @@ import portForwardDialogModelInjectable from "../../port-forward/port-forward-di
import logger from "../../../common/logger";
import aboutPortForwardingInjectable from "../../port-forward/about-port-forwarding.injectable";
import notifyErrorPortForwardingInjectable from "../../port-forward/notify-error-port-forwarding.injectable";
import type { OpenPortForward } from "../../port-forward/open-port-forward.injectable";
import openPortForwardInjectable from "../../port-forward/open-port-forward.injectable";
export interface ServicePortComponentProps {
service: Service;
@ -32,6 +34,7 @@ interface Dependencies {
openPortForwardDialog: (item: ForwardedPort, options: { openInBrowser: boolean; onClose: () => void }) => void;
aboutPortForwarding: () => void;
notifyErrorPortForwarding: (message: string) => void;
openPortForward: OpenPortForward;
}
@observer
@ -88,7 +91,7 @@ class NonInjectedServicePortComponent extends React.Component<ServicePortCompone
@action
async portForward() {
const { service, port } = this.props;
const { service, port, openPortForward } = this.props;
let portForward: ForwardedPort = {
kind: "service",
name: service.getName(),
@ -180,7 +183,7 @@ class NonInjectedServicePortComponent extends React.Component<ServicePortCompone
<span title="Open in a browser" onClick={() => this.portForward()}>
{port.toString()}
</span>
<Button primary onClick={portForwardAction}>
<Button primary onClick={portForwardAction}>
{" "}
{this.isPortForwarded ? (this.isActive ? "Stop/Remove" : "Remove") : "Forward..."}
{" "}
@ -202,6 +205,7 @@ export const ServicePortComponent = withInjectables<Dependencies, ServicePortCom
openPortForwardDialog: di.inject(portForwardDialogModelInjectable).open,
aboutPortForwarding: di.inject(aboutPortForwardingInjectable),
notifyErrorPortForwarding: di.inject(notifyErrorPortForwardingInjectable),
openPortForward: di.inject(openPortForwardInjectable),
...props,
}),
},

View File

@ -11,7 +11,6 @@ import { disposeOnUnmount, observer } from "mobx-react";
import { DrawerItem } from "../drawer";
import { Badge } from "../badge";
import { PodDetailsStatuses } from "../+workloads-pods/pod-details-statuses";
import { Link } from "react-router-dom";
import { PodDetailsTolerations } from "../+workloads-pods/pod-details-tolerations";
import { PodDetailsAffinities } from "../+workloads-pods/pod-details-affinities";
import type { JobStore } from "./store";
@ -23,7 +22,6 @@ import { makeObservable, observable, reaction } from "mobx";
import { podMetricTabs, PodCharts } from "../+workloads-pods/pod-charts";
import { ClusterMetricsResourceType } from "../../../common/cluster-types";
import { ResourceMetrics } from "../resource-metrics";
import type { ApiManager } from "../../../common/k8s-api/api-manager";
import logger from "../../../common/logger";
import { withInjectables } from "@ogre-tools/injectable-react";
import type { SubscribeStores } from "../../kube-watch-api/kube-watch-api";
@ -32,9 +30,6 @@ import type { PodStore } from "../+workloads-pods/store";
import podStoreInjectable from "../+workloads-pods/store.injectable";
import jobStoreInjectable from "./store.injectable";
import type { GetActiveClusterEntity } from "../../api/catalog/entity/get-active-cluster-entity.injectable";
import type { GetDetailsUrl } from "../kube-detail-params/get-details-url.injectable";
import getDetailsUrlInjectable from "../kube-detail-params/get-details-url.injectable";
import apiManagerInjectable from "../../../common/k8s-api/api-manager/manager.injectable";
import getActiveClusterEntityInjectable from "../../api/catalog/entity/get-active-cluster-entity.injectable";
export interface JobDetailsProps extends KubeObjectDetailsProps<Job> {
@ -45,8 +40,6 @@ interface Dependencies {
podStore: PodStore;
jobStore: JobStore;
getActiveClusterEntity: GetActiveClusterEntity;
getDetailsUrl: GetDetailsUrl;
apiManager: ApiManager;
}
@observer
@ -76,7 +69,7 @@ class NonInjectedJobDetails extends React.Component<JobDetailsProps & Dependenci
};
render() {
const { object: job, jobStore, getActiveClusterEntity, getDetailsUrl, apiManager } = this.props;
const { object: job, jobStore, getActiveClusterEntity } = this.props;
if (!job) {
return null;
@ -92,7 +85,6 @@ class NonInjectedJobDetails extends React.Component<JobDetailsProps & Dependenci
const nodeSelector = job.getNodeSelectors();
const images = job.getImages();
const childPods = jobStore.getChildPods(job);
const ownerRefs = job.getOwnerRefs();
const condition = job.getCondition();
const isMetricHidden = getActiveClusterEntity()?.isMetricHidden(ClusterMetricsResourceType.Job);
@ -130,24 +122,6 @@ class NonInjectedJobDetails extends React.Component<JobDetailsProps & Dependenci
}
</DrawerItem>
)}
{ownerRefs.length > 0 && (
<DrawerItem name="Controlled by">
{
ownerRefs.map(ref => {
const { name, kind } = ref;
const detailsUrl = getDetailsUrl(apiManager.lookupApiLink(ref, job));
return (
<p key={name}>
{kind}
{" "}
<Link to={detailsUrl}>{name}</Link>
</p>
);
})
}
</DrawerItem>
)}
<DrawerItem
name="Conditions"
className="conditions"
@ -184,8 +158,6 @@ export const JobDetails = withInjectables<Dependencies, JobDetailsProps>(NonInje
subscribeStores: di.inject(subscribeStoresInjectable),
podStore: di.inject(podStoreInjectable),
jobStore: di.inject(jobStoreInjectable),
getDetailsUrl: di.inject(getDetailsUrlInjectable),
apiManager: di.inject(apiManagerInjectable),
getActiveClusterEntity: di.inject(getActiveClusterEntityInjectable),
}),
});

View File

@ -5,7 +5,7 @@
import { getInjectable } from "@ogre-tools/injectable";
import { workloadInjectionToken } from "../workload-injection-token";
import { ResourceNames } from "../../../../utils/rbac";
import navigateToPodsInjectable from "../../../../../common/front-end-routing/routes/cluster/workloads/deployments/navigate-to-deployments.injectable";
import navigateToCronJobsInjectable from "../../../../../common/front-end-routing/routes/cluster/workloads/cron-jobs/navigate-to-cron-jobs.injectable";
import namespaceStoreInjectable from "../../../+namespaces/store.injectable";
import cronJobsStoreInjectable from "../../../+workloads-cronjobs/store.injectable";
import { computed } from "mobx";
@ -14,7 +14,7 @@ const cronJobsWorkloadInjectable = getInjectable({
id: "cron-jobs-workload",
instantiate: (di) => {
const navigate = di.inject(navigateToPodsInjectable);
const navigate = di.inject(navigateToCronJobsInjectable);
const namespaceStore = di.inject(namespaceStoreInjectable);
const store = di.inject(cronJobsStoreInjectable);

View File

@ -5,16 +5,16 @@
import { getInjectable } from "@ogre-tools/injectable";
import { workloadInjectionToken } from "../workload-injection-token";
import { ResourceNames } from "../../../../utils/rbac";
import navigateToPodsInjectable from "../../../../../common/front-end-routing/routes/cluster/workloads/deployments/navigate-to-deployments.injectable";
import namespaceStoreInjectable from "../../../+namespaces/store.injectable";
import replicasetsStoreInjectable from "../../../+workloads-replicasets/store.injectable";
import { computed } from "mobx";
import navigateToReplicasetsInjectable from "../../../../../common/front-end-routing/routes/cluster/workloads/replicasets/navigate-to-replicasets.injectable";
const replicasetsWorkloadInjectable = getInjectable({
id: "replicasets-workload",
instantiate: (di) => {
const navigate = di.inject(navigateToPodsInjectable);
const navigate = di.inject(navigateToReplicasetsInjectable);
const namespaceStore = di.inject(namespaceStoreInjectable);
const store = di.inject(replicasetsStoreInjectable);

View File

@ -5,16 +5,16 @@
import { getInjectable } from "@ogre-tools/injectable";
import { workloadInjectionToken } from "../workload-injection-token";
import { ResourceNames } from "../../../../utils/rbac";
import navigateToPodsInjectable from "../../../../../common/front-end-routing/routes/cluster/workloads/deployments/navigate-to-deployments.injectable";
import namespaceStoreInjectable from "../../../+namespaces/store.injectable";
import statefulsetsStoreInjectable from "../../../+workloads-statefulsets/store.injectable";
import { computed } from "mobx";
import navigateToStatefulsetsInjectable from "../../../../../common/front-end-routing/routes/cluster/workloads/statefulsets/navigate-to-statefulsets.injectable";
const statefulsetsWorkloadInjectable = getInjectable({
id: "statefulsets-workload",
instantiate: (di) => {
const navigate = di.inject(navigateToPodsInjectable);
const navigate = di.inject(navigateToStatefulsetsInjectable);
const namespaceStore = di.inject(namespaceStoreInjectable);
const store = di.inject(statefulsetsStoreInjectable);

View File

@ -13,7 +13,7 @@ import { cssNames } from "../../utils";
import { Notifications } from "../notifications";
import { Button } from "../button";
import type { ForwardedPort, PortForwardStore } from "../../port-forward";
import { openPortForward, predictProtocol } from "../../port-forward";
import { predictProtocol } from "../../port-forward";
import { Spinner } from "../spinner";
import { withInjectables } from "@ogre-tools/injectable-react";
import portForwardStoreInjectable from "../../port-forward/port-forward-store/port-forward-store.injectable";
@ -21,6 +21,8 @@ import portForwardDialogModelInjectable from "../../port-forward/port-forward-di
import logger from "../../../common/logger";
import aboutPortForwardingInjectable from "../../port-forward/about-port-forwarding.injectable";
import notifyErrorPortForwardingInjectable from "../../port-forward/notify-error-port-forwarding.injectable";
import type { OpenPortForward } from "../../port-forward/open-port-forward.injectable";
import openPortForwardInjectable from "../../port-forward/open-port-forward.injectable";
export interface PodContainerPortProps {
pod: Pod;
@ -32,6 +34,7 @@ interface Dependencies {
openPortForwardDialog: (item: ForwardedPort, options: { openInBrowser: boolean; onClose: () => void }) => void;
aboutPortForwarding: () => void;
notifyErrorPortForwarding: (message: string) => void;
openPortForward: OpenPortForward;
}
@observer
@ -86,7 +89,7 @@ class NonInjectedPodContainerPort extends React.Component<PodContainerPortProps
@action
async portForward() {
const { pod, port } = this.props;
const { pod, port, openPortForward } = this.props;
let portForward: ForwardedPort = {
kind: "pod",
name: pod.getName(),
@ -178,7 +181,7 @@ class NonInjectedPodContainerPort extends React.Component<PodContainerPortProps
<span title="Open in a browser" onClick={() => this.portForward()}>
{text}
</span>
<Button primary onClick={portForwardAction}>
<Button primary onClick={portForwardAction}>
{" "}
{this.isPortForwarded ? (this.isActive ? "Stop/Remove" : "Remove") : "Forward..."}
{" "}
@ -200,6 +203,7 @@ export const PodContainerPort = withInjectables<Dependencies, PodContainerPortPr
openPortForwardDialog: di.inject(portForwardDialogModelInjectable).open,
aboutPortForwarding: di.inject(aboutPortForwardingInjectable),
notifyErrorPortForwarding: di.inject(notifyErrorPortForwardingInjectable),
openPortForward: di.inject(openPortForwardInjectable),
...props,
}),
},

View File

@ -113,7 +113,7 @@ class NonInjectedPods extends React.Component<Dependencies> {
sortingCallbacks={{
[columnId.name]: pod => getConvertedParts(pod.getName()),
[columnId.namespace]: pod => pod.getNs(),
[columnId.containers]: pod => pod.getContainers().length,
[columnId.containers]: pod => pod.getContainerStatuses().length,
[columnId.restarts]: pod => pod.getRestartsCount(),
[columnId.owners]: pod => pod.getOwnerRefs().map(ref => ref.kind),
[columnId.qos]: pod => pod.getQosClass(),

View File

@ -82,7 +82,7 @@ export class PodStore extends KubeObjectStore<Pod, PodApi> {
}
return {
cpu: total.cpu + cpuUnitsToNumber(cpu),
cpu: total.cpu + (cpuUnitsToNumber(cpu) ?? 0),
memory: total.memory + unitsToBytes(memory),
};
}, empty);

View File

@ -25,7 +25,7 @@
cursor: pointer;
}
.badge:not(.isExpanded) {
.badge:not(.scrollable):not(.isExpanded) {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;

View File

@ -115,6 +115,7 @@ export class ClusterFrameHandler {
(view: LensView) => {
logger.info(`[LENS-VIEW]: cluster id=${clusterId} should now be visible`);
view.frame.classList.remove("hidden");
view.frame.focus();
ipcRenderer.send(clusterVisibilityHandler, clusterId);
},
);

View File

@ -11,6 +11,8 @@ import terminalSpawningPoolInjectable from "./terminal-spawning-pool.injectable"
import terminalConfigInjectable from "../../../../common/user-store/terminal-config.injectable";
import terminalCopyOnSelectInjectable from "../../../../common/user-store/terminal-copy-on-select.injectable";
import themeStoreInjectable from "../../../themes/store.injectable";
import isMacInjectable from "../../../../common/vars/is-mac.injectable";
import openLinkInBrowserInjectable from "../../../../common/utils/open-link-in-browser.injectable";
export type CreateTerminal = (tabId: TabId, api: TerminalApi) => Terminal;
@ -22,6 +24,8 @@ const createTerminalInjectable = getInjectable({
terminalConfig: di.inject(terminalConfigInjectable),
terminalCopyOnSelect: di.inject(terminalCopyOnSelectInjectable),
themeStore: di.inject(themeStoreInjectable),
isMac: di.inject(isMacInjectable),
openLinkInBrowser: di.inject(openLinkInBrowserInjectable),
};
return (tabId, api) => new Terminal(dependencies, { tabId, api });

View File

@ -12,19 +12,22 @@ import type { TabId } from "../dock/store";
import type { TerminalApi } from "../../../api/terminal-api";
import type { ThemeStore } from "../../../themes/store";
import { disposer } from "../../../utils";
import { isMac } from "../../../../common/vars";
import { once } from "lodash";
import { clipboard } from "electron";
import logger from "../../../../common/logger";
import type { TerminalConfig } from "../../../../common/user-store/preferences-helpers";
import assert from "assert";
import { TerminalChannels } from "../../../../common/terminal/channels";
import { LinkProvider } from "xterm-link-provider";
import type { OpenLinkInBrowser } from "../../../../common/utils/open-link-in-browser.injectable";
export interface TerminalDependencies {
readonly spawningPool: HTMLElement;
readonly terminalConfig: IComputedValue<TerminalConfig>;
readonly terminalCopyOnSelect: IComputedValue<boolean>;
readonly themeStore: ThemeStore;
readonly isMac: boolean;
openLinkInBrowser: OpenLinkInBrowser;
}
export interface TerminalArguments {
@ -93,7 +96,6 @@ export class Terminal {
this.xterm.loadAddon(this.fitAddon);
this.xterm.open(this.dependencies.spawningPool);
this.xterm.registerLinkMatcher(/https?:\/\/[^\s]+/i, this.onClickLink);
this.xterm.attachCustomKeyEventHandler(this.keyHandler);
this.xterm.onSelectionChange(this.onSelectionChange);
@ -108,7 +110,16 @@ export class Terminal {
this.api.on("data", this.onApiData);
window.addEventListener("resize", this.onResize);
const linkProvider = new LinkProvider(
this.xterm,
/https?:\/\/[^\s]+/i,
(event, link) => this.dependencies.openLinkInBrowser(link),
undefined,
0,
);
this.disposer.push(
this.xterm.registerLinkProvider(linkProvider),
reaction(() => this.theme, colors => this.xterm.setOption("theme", colors), {
fireImmediately: true,
}),
@ -169,10 +180,6 @@ export class Terminal {
this.viewport.scrollTop = this.scrollPos; // restore last scroll position
};
onClickLink = (evt: MouseEvent, link: string) => {
window.open(link, "_blank");
};
onContextMenu = () => {
if (
// don't paste if user hasn't turned on the feature
@ -229,7 +236,7 @@ export class Terminal {
}
//Ctrl+K: clear the entire buffer, making the prompt line the new first line on mac os
if (isMac && metaKey) {
if (this.dependencies.isMac && metaKey) {
switch (code) {
case "KeyK":
this.onClear();

View File

@ -0,0 +1,134 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`<DrawerParamToggler /> after clicking the toggle after clicking the toggle again renders 1`] = `
<body>
<div>
<div
class="DrawerParamToggler"
>
<div
class="flex gaps align-center params"
>
<div
class="param-label"
>
Foo
</div>
<div
class="param-link"
data-testid="drawer-param-toggler"
>
<span
class="param-link-text"
>
Show
</span>
<i
class="Icon material focusable"
>
<span
class="icon"
data-icon-name="arrow_drop_down"
>
arrow_drop_down
</span>
</i>
</div>
</div>
<div
class="param-content"
/>
</div>
</div>
</body>
`;
exports[`<DrawerParamToggler /> after clicking the toggle renders 1`] = `
<body>
<div>
<div
class="DrawerParamToggler"
>
<div
class="flex gaps align-center params"
>
<div
class="param-label"
>
Foo
</div>
<div
class="param-link"
data-testid="drawer-param-toggler"
>
<span
class="param-link-text"
>
Hide
</span>
<i
class="Icon material focusable"
>
<span
class="icon"
data-icon-name="arrow_drop_up"
>
arrow_drop_up
</span>
</i>
</div>
</div>
<div
class="param-content open"
>
<div
data-testid="drawer-child"
/>
</div>
</div>
</div>
</body>
`;
exports[`<DrawerParamToggler /> renders 1`] = `
<body>
<div>
<div
class="DrawerParamToggler"
>
<div
class="flex gaps align-center params"
>
<div
class="param-label"
>
Foo
</div>
<div
class="param-link"
data-testid="drawer-param-toggler"
>
<span
class="param-link-text"
>
Show
</span>
<i
class="Icon material focusable"
>
<span
class="icon"
data-icon-name="arrow_drop_down"
>
arrow_drop_down
</span>
</i>
</div>
</div>
<div
class="param-content"
/>
</div>
</div>
</body>
`;

View File

@ -0,0 +1,59 @@
/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import type { RenderResult } from "@testing-library/react";
import { render } from "@testing-library/react";
import React from "react";
import { DrawerParamToggler } from "./drawer-param-toggler";
describe("<DrawerParamToggler />", () => {
let result: RenderResult;
beforeEach(() => {
result = render((
<DrawerParamToggler
label="Foo"
>
<div data-testid="drawer-child"></div>
</DrawerParamToggler>
));
});
it("renders", () => {
expect(result.baseElement).toMatchSnapshot();
});
it("does not render children by default", () => {
expect(result.queryByTestId("drawer-child")).toBeNull();
});
describe("after clicking the toggle", () => {
beforeEach(() => {
result.getByTestId("drawer-param-toggler").click();
});
it("renders", () => {
expect(result.baseElement).toMatchSnapshot();
});
it("renders children", () => {
expect(result.queryByTestId("drawer-child")).not.toBeNull();
});
describe("after clicking the toggle again", () => {
beforeEach(() => {
result.getByTestId("drawer-param-toggler").click();
});
it("renders", () => {
expect(result.baseElement).toMatchSnapshot();
});
it("does not children", () => {
expect(result.queryByTestId("drawer-child")).toBeNull();
});
});
});
});

View File

@ -33,13 +33,17 @@ export class DrawerParamToggler extends React.Component<DrawerParamTogglerProps,
<div className="DrawerParamToggler">
<div className="flex gaps align-center params">
<div className="param-label">{label}</div>
<div className="param-link" onClick={this.toggle}>
<div
className="param-link"
onClick={this.toggle}
data-testid="drawer-param-toggler"
>
<span className="param-link-text">{link}</span>
<Icon material={icon}/>
</div>
</div>
<div className={cssNames("param-content", { open })}>
{children}
{open && children}
</div>
</div>
);

View File

@ -8,7 +8,7 @@ import "./kube-object-details.scss";
import React from "react";
import { disposeOnUnmount, observer } from "mobx-react";
import type { IComputedValue } from "mobx";
import { computed, observable, reaction, makeObservable } from "mobx";
import { observable, reaction, makeObservable } from "mobx";
import { Drawer } from "../drawer";
import type { KubeObject } from "../../../common/k8s-api/kube-object";
import { Spinner } from "../spinner";
@ -51,11 +51,11 @@ class NonInjectedKubeObjectDetails extends React.Component<Dependencies> {
makeObservable(this);
}
@computed get path() {
get path() {
return this.props.kubeDetailsUrlParam.get();
}
@computed get object() {
get object() {
return this.props.kubeObject.get();
}
@ -102,43 +102,32 @@ class NonInjectedKubeObjectDetails extends React.Component<Dependencies> {
}
renderContents(object: KubeObject) {
const { isLoading, loadingError } = this;
const details = this.props.detailComponents.get();
const getContents = () => {
if (details.length === 0) {
const crd = this.props.customResourceDefinitionStore.getByObject(object);
if (details.length === 0) {
const crd = this.props.customResourceDefinitionStore.getByObject(object);
/**
/**
* This is a fallback so that if a custom resource object doesn't have
* any defined details we should try and display at least some details
*/
if (crd) {
return (
<CustomResourceDetails
key={object.getId()}
object={object}
crd={crd}
/>
);
} else {
// if we still don't have any details to show, just show the standard object metadata
return <KubeObjectMeta key={object.getId()} object={object} />;
}
if (crd) {
return (
<CustomResourceDetails
key={object.getId()}
object={object}
crd={crd}
/>
);
} else {
// if we still don't have any details to show, just show the standard object metadata
return <KubeObjectMeta key={object.getId()} object={object} />;
}
}
return details.map((DetailComponent, index) => (
<DetailComponent key={index} object={object} />
));
};
return (
<>
{isLoading && <Spinner center/>}
{loadingError && <div className="box center">{loadingError}</div>}
{getContents()}
</>
);
return details.map((DetailComponent, index) => (
<DetailComponent key={index} object={object} />
));
}
render() {
@ -152,6 +141,8 @@ class NonInjectedKubeObjectDetails extends React.Component<Dependencies> {
toolbar={object && <KubeObjectMenu object={object} toolbar={true}/>}
onClose={this.props.hideDetails}
>
{isLoading && <Spinner center/>}
{loadingError && <div className="box center">{loadingError}</div>}
{object && this.renderContents(object)}
</Drawer>
);

View File

@ -21,6 +21,11 @@
white-space: nowrap;
transition: 250ms color;
&.disabled {
opacity: 0.6;
pointer-events: none;
}
&:not(.checked):not(.disabled) {
cursor: pointer;
&:not(:active):focus {

View File

@ -85,6 +85,7 @@ export function Radio<T>({
type="radio"
checked={checked}
onChange={() => ctx.onSelect(value)}
disabled={disabled || ctx.disabled}
/>
<i className="tick flex center"/>
{label ? <div className="label">{label}</div> : null}

View File

@ -26,10 +26,10 @@ describe("Table tests", () => {
expect(i).toStrictEqual([1, 2, 4, 3]);
});
it("should sort numerically asc (by defaul) and not touch the original list", () => {
it("should sort numerically asc (by default) and not touch the original list", () => {
const i = [1, 2, 4, 3];
expect(getSorted(i, v => v, "foobar")).toStrictEqual([1, 2, 3, 4]);
expect(getSorted(i, v => v)).toStrictEqual([1, 2, 3, 4]);
expect(i).toStrictEqual([1, 2, 4, 3]);
});

View File

@ -3,15 +3,14 @@
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import type { TableSortCallback } from "./table";
import type { TableOrderBy, TableSortCallback } from "./table";
import { Ordering, rectifyOrdering, sortCompare, tuple } from "../../utils";
export function getSorted<T>(rawItems: T[], sortingCallback: TableSortCallback<T> | undefined, orderByRaw: string): T[] {
export function getSorted<T>(rawItems: T[], sortingCallback: TableSortCallback<T> | undefined, orderBy: TableOrderBy = "asc"): T[] {
if (typeof sortingCallback !== "function") {
return rawItems;
}
const orderBy = orderByRaw === "asc" || orderByRaw === "desc" ? orderByRaw : "asc";
const sortData = rawItems.map((item, index) => ({
index,
sortBy: sortingCallback(item),

View File

@ -0,0 +1,24 @@
/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import React from "react";
export const withTooltip =
(Target: any) =>
({ tooltip, tooltipOverrideDisabled, ...props }: any) => {
if (tooltip) {
const testId = props["data-testid"];
return (
<>
<Target {...props} />
<div data-testid={testId && `tooltip-content-for-${testId}`}>
{tooltip.children || tooltip}
</div>
</>
);
}
return <Target {...props} />;
};

View File

@ -87,7 +87,7 @@ function VirtualListInner<T extends { getId(): string } | string>({
useEffect(() => {
try {
if (prevItems.current.length !== items.length || !isEqual(prevRowHeights.current, rowHeights)) {
listRef.current?.resetAfterIndex(0, false);
listRef.current?.resetAfterIndex(0);
}
} finally {
prevItems.current = items;

View File

@ -403,7 +403,6 @@ exports[`<ClusterFrame /> given cluster with list nodes and namespaces permissio
>
<i
class="Icon material interactive focusable small"
id="tooltip_target_56"
tabindex="0"
>
<span
@ -412,8 +411,10 @@ exports[`<ClusterFrame /> given cluster with list nodes and namespaces permissio
>
close
</span>
<div />
</i>
<div>
Close ⌘+W
</div>
</div>
</div>
</div>
@ -437,12 +438,13 @@ exports[`<ClusterFrame /> given cluster with list nodes and namespaces permissio
>
add
</span>
<div />
</i>
<div>
New tab
</div>
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_58"
tabindex="0"
>
<span
@ -451,11 +453,12 @@ exports[`<ClusterFrame /> given cluster with list nodes and namespaces permissio
>
fullscreen
</span>
<div />
</i>
<div>
Fit to window
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_59"
tabindex="0"
>
<span
@ -464,8 +467,10 @@ exports[`<ClusterFrame /> given cluster with list nodes and namespaces permissio
>
keyboard_arrow_up
</span>
<div />
</i>
<div>
Open
</div>
</div>
</div>
</div>
@ -884,7 +889,6 @@ exports[`<ClusterFrame /> given cluster with list nodes and namespaces permissio
>
<i
class="Icon material interactive focusable small"
id="tooltip_target_16"
tabindex="0"
>
<span
@ -893,8 +897,10 @@ exports[`<ClusterFrame /> given cluster with list nodes and namespaces permissio
>
close
</span>
<div />
</i>
<div>
Close ⌘+W
</div>
</div>
</div>
</div>
@ -918,12 +924,13 @@ exports[`<ClusterFrame /> given cluster with list nodes and namespaces permissio
>
add
</span>
<div />
</i>
<div>
New tab
</div>
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_18"
tabindex="0"
>
<span
@ -932,11 +939,12 @@ exports[`<ClusterFrame /> given cluster with list nodes and namespaces permissio
>
fullscreen
</span>
<div />
</i>
<div>
Fit to window
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_19"
tabindex="0"
>
<span
@ -945,8 +953,10 @@ exports[`<ClusterFrame /> given cluster with list nodes and namespaces permissio
>
keyboard_arrow_up
</span>
<div />
</i>
<div>
Open
</div>
</div>
</div>
</div>
@ -1424,7 +1434,6 @@ exports[`<ClusterFrame /> given cluster without list nodes, but with namespaces
>
<i
class="Icon material interactive focusable small"
id="tooltip_target_94"
tabindex="0"
>
<span
@ -1433,8 +1442,10 @@ exports[`<ClusterFrame /> given cluster without list nodes, but with namespaces
>
close
</span>
<div />
</i>
<div>
Close ⌘+W
</div>
</div>
</div>
</div>
@ -1458,12 +1469,13 @@ exports[`<ClusterFrame /> given cluster without list nodes, but with namespaces
>
add
</span>
<div />
</i>
<div>
New tab
</div>
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_96"
tabindex="0"
>
<span
@ -1472,11 +1484,12 @@ exports[`<ClusterFrame /> given cluster without list nodes, but with namespaces
>
fullscreen
</span>
<div />
</i>
<div>
Fit to window
</div>
<i
class="Icon material interactive focusable"
id="tooltip_target_97"
tabindex="0"
>
<span
@ -1485,8 +1498,10 @@ exports[`<ClusterFrame /> given cluster without list nodes, but with namespaces
>
keyboard_arrow_up
</span>
<div />
</i>
<div>
Open
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,38 @@
/**
* 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 loggerInjectable from "../../common/logger.injectable";
import openLinkInBrowserInjectable from "../../common/utils/open-link-in-browser.injectable";
import showErrorNotificationInjectable from "../components/notifications/show-error-notification.injectable";
import type { ForwardedPort } from "./port-forward-item";
import { portForwardAddress } from "./port-forward-utils";
export type OpenPortForward = (portForward: ForwardedPort) => void;
const openPortForwardInjectable = getInjectable({
id: "open-port-forward",
instantiate: (di): OpenPortForward => {
const openLinkInBrowser = di.inject(openLinkInBrowserInjectable);
const showErrorNotification = di.inject(showErrorNotificationInjectable);
const logger = di.inject(loggerInjectable);
return (portForward) => {
const browseTo = portForwardAddress(portForward);
openLinkInBrowser(browseTo)
.catch(error => {
logger.error(`failed to open in browser: ${error}`, {
port: portForward.port,
kind: portForward.kind,
namespace: portForward.namespace,
name: portForward.name,
});
showErrorNotification(`Failed to open ${browseTo} in browser`);
});
};
},
});
export default openPortForwardInjectable;

View File

@ -14,7 +14,6 @@ import { Wizard, WizardStep } from "../components/wizard";
import { Input } from "../components/input";
import { cssNames } from "../utils";
import type { PortForwardStore } from "./port-forward-store/port-forward-store";
import { openPortForward } from "./port-forward-utils";
import { Checkbox } from "../components/checkbox";
import { withInjectables } from "@ogre-tools/injectable-react";
import type { PortForwardDialogData, PortForwardDialogModel } from "./port-forward-dialog-model/port-forward-dialog-model";
@ -23,6 +22,8 @@ import logger from "../../common/logger";
import portForwardStoreInjectable from "./port-forward-store/port-forward-store.injectable";
import aboutPortForwardingInjectable from "./about-port-forwarding.injectable";
import notifyErrorPortForwardingInjectable from "./notify-error-port-forwarding.injectable";
import type { OpenPortForward } from "./open-port-forward.injectable";
import openPortForwardInjectable from "./open-port-forward.injectable";
export interface PortForwardDialogProps extends Partial<DialogProps> {}
@ -31,6 +32,7 @@ interface Dependencies {
model: PortForwardDialogModel;
aboutPortForwarding: () => void;
notifyErrorPortForwarding: (message: string) => void;
openPortForward: OpenPortForward;
}
@observer
@ -89,7 +91,7 @@ class NonInjectedPortForwardDialog extends Component<PortForwardDialogProps & De
}
if (portForward.status === "Active" && data.openInBrowser) {
openPortForward(portForward);
this.props.openPortForward(portForward);
}
} catch (error) {
logger.error(`[PORT-FORWARD-DIALOG]: ${error}`, portForward);
@ -177,6 +179,7 @@ export const PortForwardDialog = withInjectables<Dependencies, PortForwardDialog
model: di.inject(portForwardDialogModelInjectable),
aboutPortForwarding: di.inject(aboutPortForwardingInjectable),
notifyErrorPortForwarding: di.inject(notifyErrorPortForwardingInjectable),
openPortForward: di.inject(openPortForwardInjectable),
...props,
}),
},

View File

@ -3,34 +3,12 @@
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { openBrowser } from "../utils";
import { Notifications } from "../components/notifications";
import type { ForwardedPort } from "./port-forward-item";
import logger from "../../common/logger";
export function portForwardAddress(portForward: ForwardedPort) {
return `${portForward.protocol ?? "http"}://localhost:${portForward.forwardPort}`;
}
export function openPortForward(portForward: ForwardedPort) {
const browseTo = portForwardAddress(portForward);
openBrowser(browseTo)
.catch(error => {
logger.error(`failed to open in browser: ${error}`, {
port: portForward.port,
kind: portForward.kind,
namespace: portForward.namespace,
name: portForward.name,
});
Notifications.error(`Failed to open ${browseTo} in browser`);
},
);
}
export function predictProtocol(name: string | undefined) {
return name === "https" ? "https" : "http";
}

View File

@ -7,6 +7,10 @@ import { beforeFrameStartsInjectionToken } from "../../before-frame-starts/befor
import syncBoxInitialValueChannelInjectable from "../../../common/utils/sync-box/sync-box-initial-value-channel.injectable";
import createSyncBoxStateInjectable from "../../../common/utils/sync-box/sync-box-state.injectable";
import { requestFromChannelInjectionToken } from "../../../common/utils/channel/request-from-channel-injection-token";
import { runInAction } from "mobx";
import type { SyncBox } from "../../../common/utils/sync-box/sync-box-injection-token";
import { syncBoxInjectionToken } from "../../../common/utils/sync-box/sync-box-injection-token";
import assert from "assert";
const provideInitialValuesForSyncBoxesInjectable = getInjectable({
id: "provide-initial-values-for-sync-boxes",
@ -14,14 +18,24 @@ const provideInitialValuesForSyncBoxesInjectable = getInjectable({
instantiate: (di) => {
const requestFromChannel = di.inject(requestFromChannelInjectionToken);
const syncBoxInitialValueChannel = di.inject(syncBoxInitialValueChannelInjectable);
const setSyncBoxState = (id: string, state: any) => di.inject(createSyncBoxStateInjectable, id).set(state);
const syncBoxes = di.injectMany(syncBoxInjectionToken);
const setSyncBoxState = (syncBox: SyncBox<any>, state: any) =>
di.inject(createSyncBoxStateInjectable, syncBox.id).set(state);
return {
run: async () => {
const initialValues = await requestFromChannel(syncBoxInitialValueChannel);
initialValues.forEach(({ id, value }) => {
setSyncBoxState(id, value);
runInAction(() => {
initialValues.forEach(({ id, value }) => {
const syncBox = syncBoxes.find((box) => box.id === id);
assert(syncBox);
setSyncBoxState(syncBox, value);
});
});
},
};

Some files were not shown because too many files have changed in this diff Show More