diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1bbcb3366e..eb2278097d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -67,6 +67,10 @@ jobs: - run: make test-extensions name: Run In-tree Extension tests + - run: make ci-validate-dev + if: ${{ contains(github.event.pull_request.labels.*.name, 'dependencies') }} + name: Validate dev mode will work + - name: Install integration test dependencies id: minikube uses: medyagh/setup-minikube@5a9a7104d7322fa40424de8855c84685e89cefd7 diff --git a/Makefile b/Makefile index 1435ab5004..6db96fbc2b 100644 --- a/Makefile +++ b/Makefile @@ -28,6 +28,9 @@ compile-dev: node_modules yarn compile:main --cache yarn compile:renderer --cache +.PHONY: validate-dev +ci-validate-dev: binaries/client build-extensions compile-dev + .PHONY: dev dev: binaries/client build-extensions rm -rf static/build/ diff --git a/build/build_tray_icon.ts b/build/build_tray_icon.ts deleted file mode 100644 index 0850011815..0000000000 --- a/build/build_tray_icon.ts +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Copyright (c) OpenLens Authors. All rights reserved. - * Licensed under MIT License. See LICENSE in root directory for more information. - */ -import path from "path"; -import sharp from "sharp"; -import jsdom from "jsdom"; -import fs from "fs-extra"; - -export async function generateTrayIcon( - { - outputFilename = "trayIcon", - svgIconPath = path.resolve(__dirname, "../src/renderer/components/icon/logo-lens.svg"), - outputFolder = path.resolve(__dirname, "./tray"), - dpiSuffix = "2x", - pixelSize = 32, - shouldUseDarkColors = false, // managed by electron.nativeTheme.shouldUseDarkColors - } = {}) { - outputFilename += `${shouldUseDarkColors ? "Dark" : ""}Template`; // e.g. output trayIconDarkTemplate@2x.png - dpiSuffix = dpiSuffix !== "1x" ? `@${dpiSuffix}` : ""; - const pngIconDestPath = path.resolve(outputFolder, `${outputFilename}${dpiSuffix}.png`); - - try { - // Modify .SVG colors - const trayIconColor = shouldUseDarkColors ? "black" : "white"; - const svgDom = await jsdom.JSDOM.fromFile(svgIconPath); - const svgRoot = svgDom.window.document.body.getElementsByTagName("svg")[0]; - - svgRoot.innerHTML += ``; - const svgIconBuffer = Buffer.from(svgRoot.outerHTML); - // Resize and convert to .PNG - const pngIconBuffer: Buffer = await sharp(svgIconBuffer) - .resize({ width: pixelSize, height: pixelSize }) - .png() - .toBuffer(); - - // Save icon - await fs.writeFile(pngIconDestPath, pngIconBuffer); - console.info(`[DONE]: Tray icon saved at "${pngIconDestPath}"`); - } catch (err) { - console.error(`[ERROR]: ${err}`); - } -} - -// Run -const iconSizes: Record = { - "1x": 16, - "2x": 32, - "3x": 48, -}; - -Object.entries(iconSizes).forEach(([dpiSuffix, pixelSize]) => { - generateTrayIcon({ dpiSuffix, pixelSize, shouldUseDarkColors: false }); - generateTrayIcon({ dpiSuffix, pixelSize, shouldUseDarkColors: true }); -}); diff --git a/build/tray/trayIconDarkTemplate.png b/build/tray/trayIconDarkTemplate.png deleted file mode 100644 index d0a4bdce20..0000000000 Binary files a/build/tray/trayIconDarkTemplate.png and /dev/null differ diff --git a/build/tray/trayIconDarkTemplate@2x.png b/build/tray/trayIconDarkTemplate@2x.png deleted file mode 100644 index 46615aa5bf..0000000000 Binary files a/build/tray/trayIconDarkTemplate@2x.png and /dev/null differ diff --git a/build/tray/trayIconDarkTemplate@3x.png b/build/tray/trayIconDarkTemplate@3x.png deleted file mode 100644 index 0c018f3ed3..0000000000 Binary files a/build/tray/trayIconDarkTemplate@3x.png and /dev/null differ diff --git a/build/tray/trayIconTemplate.png b/build/tray/trayIconTemplate.png deleted file mode 100644 index 16ada5ad31..0000000000 Binary files a/build/tray/trayIconTemplate.png and /dev/null differ diff --git a/build/tray/trayIconTemplate@2x.png b/build/tray/trayIconTemplate@2x.png deleted file mode 100644 index 73c40de994..0000000000 Binary files a/build/tray/trayIconTemplate@2x.png and /dev/null differ diff --git a/build/tray/trayIconTemplate@3x.png b/build/tray/trayIconTemplate@3x.png deleted file mode 100644 index d7a39b9260..0000000000 Binary files a/build/tray/trayIconTemplate@3x.png and /dev/null differ diff --git a/integration/__tests__/cluster-pages.tests.ts b/integration/__tests__/cluster-pages.tests.ts index 48767c8de2..981628b1ba 100644 --- a/integration/__tests__/cluster-pages.tests.ts +++ b/integration/__tests__/cluster-pages.tests.ts @@ -39,6 +39,11 @@ utils.describeIf(minikubeReady(TEST_NAMESPACE))("Minikube based tests", () => { await frame.waitForSelector(`.Menu >> text="Remove"`); }); + it("opens cluster settings by clicking link in no-metrics area", async () => { + await frame.locator("text=Open cluster settings >> nth=0").click(); + await window.waitForSelector(`[data-testid="metrics-header"]`); + }); + it( "should navigate around common cluster pages", @@ -178,9 +183,7 @@ utils.describeIf(minikubeReady(TEST_NAMESPACE))("Minikube based tests", () => { } const testPodName = "nginx-create-pod-test"; - const monacoEditor = await frame.waitForSelector( - `.Dock.isOpen [data-test-component="monaco-editor"]`, - ); + const monacoEditor = await frame.waitForSelector(`.Dock.isOpen [data-test-id="monaco-editor"]`); await monacoEditor.click(); await monacoEditor.type("apiVersion: v1", { delay: 10 }); diff --git a/package.json b/package.json index d56b6a3cd8..aadcaa981d 100644 --- a/package.json +++ b/package.json @@ -124,6 +124,9 @@ "rpm", "AppImage" ], + "asarUnpack": [ + "**/node_modules/sharp/**" + ], "extraResources": [ { "from": "binaries/client/linux/${arch}/kubectl", @@ -199,6 +202,7 @@ } }, "dependencies": { + "@astronautlabs/jsonpath": "^1.1.0", "@hapi/call": "^8.0.1", "@hapi/subtext": "^7.0.3", "@kubernetes/client-node": "^0.16.3", @@ -229,7 +233,6 @@ "joi": "^17.6.0", "js-yaml": "^4.1.0", "jsdom": "^16.7.0", - "jsonpath": "^1.1.1", "lodash": "^4.17.15", "mac-ca": "^1.0.6", "marked": "^4.0.12", @@ -259,7 +262,8 @@ "request-promise-native": "^1.0.9", "rfc6902": "^4.0.2", "selfsigned": "^2.0.1", - "semver": "^7.3.2", + "semver": "^7.3.7", + "sharp": "^0.30.3", "shell-env": "^3.0.1", "spdy": "^4.0.2", "tar": "^6.1.11", @@ -278,7 +282,7 @@ "@material-ui/core": "^4.12.3", "@material-ui/icons": "^4.11.2", "@material-ui/lab": "^4.0.0-alpha.60", - "@pmmmwh/react-refresh-webpack-plugin": "^0.5.4", + "@pmmmwh/react-refresh-webpack-plugin": "^0.5.5", "@sentry/types": "^6.19.3", "@testing-library/jest-dom": "^5.16.3", "@testing-library/react": "^12.1.4", @@ -299,7 +303,6 @@ "@types/jest": "^26.0.24", "@types/js-yaml": "^4.0.5", "@types/jsdom": "^16.2.14", - "@types/jsonpath": "^0.2.0", "@types/lodash": "^4.14.181", "@types/marked": "^4.0.3", "@types/md5-file": "^4.0.2", @@ -313,7 +316,7 @@ "@types/react": "^17.0.43", "@types/react-beautiful-dnd": "^13.1.2", "@types/react-dom": "^17.0.14", - "@types/react-router-dom": "^5.3.2", + "@types/react-router-dom": "^5.3.3", "@types/react-select": "3.1.2", "@types/react-table": "^7.7.9", "@types/react-virtualized-auto-sizer": "^1.0.1", @@ -349,7 +352,7 @@ "electron": "^14.2.9", "electron-builder": "^23.0.3", "electron-notarize": "^0.3.0", - "esbuild": "^0.14.34", + "esbuild": "^0.14.38", "esbuild-loader": "^2.18.0", "eslint": "^8.11.0", "eslint-plugin-header": "^3.1.1", @@ -380,16 +383,15 @@ "postcss-loader": "^6.2.1", "randomcolor": "^0.6.2", "react-beautiful-dnd": "^13.1.0", - "react-refresh": "^0.11.0", + "react-refresh": "^0.12.0", "react-refresh-typescript": "^2.0.4", - "react-router-dom": "^5.3.0", - "react-select": "3.2.0", + "react-router-dom": "^5.3.1", + "react-select": "^5.3.0", "react-select-event": "^5.3.0", "react-table": "^7.7.0", "react-window": "^1.8.6", "sass": "^1.49.11", "sass-loader": "^12.6.0", - "sharp": "^0.30.3", "style-loader": "^3.3.1", "tailwindcss": "^3.0.23", "tar-stream": "^2.2.0", diff --git a/src/behaviours/preferences/__snapshots__/closing-preferences.test.tsx.snap b/src/behaviours/preferences/__snapshots__/closing-preferences.test.tsx.snap index ec4585cb42..d0f2586641 100644 --- a/src/behaviours/preferences/__snapshots__/closing-preferences.test.tsx.snap +++ b/src/behaviours/preferences/__snapshots__/closing-preferences.test.tsx.snap @@ -120,42 +120,51 @@ exports[`preferences - closing-preferences given accessing preferences directly
+ +
Select...
-
+ +
Select...
-
+ +
Select...
-
+ +
Select...
-
+ +
Select...
-
+ +
Select...
-
+ +
Select...
-
+ +
Select...
-
+ +
Select...
-
+ +
Select...
-
+ +
Select...
-
+ +
Select...
-
+ +
Select...
-
+ +
Select...
-
+ +
Select...
-
+ +
Select...
-
+ +
Select...
-
+ +
Select...
-
+ +
Select...
-
+ +
Select...
-
+ +
Select...
-
+ +
Select...
-
+ +
Select...
-
+ +
Select...
-
+ +
Select...
-
+ +
Select...
-
+ +
Select...
-
+ +
Select...
-
+ +
Select...
-
+ +
Select...
-
+ +
Download mirror for kubectl
-