mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Release 6.2.4 (#6676)
* Release 6.2.4 Signed-off-by: Iku-turso <mikko.aspiala@gmail.com> * Bump electron from 19.1.7 to 19.1.8 (#6664) Bumps [electron](https://github.com/electron/electron) from 19.1.7 to 19.1.8. - [Release notes](https://github.com/electron/electron/releases) - [Changelog](https://github.com/electron/electron/blob/main/docs/breaking-changes.md) - [Commits](https://github.com/electron/electron/compare/v19.1.7...v19.1.8) --- updated-dependencies: - dependency-name: electron dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fix extensions using "application" as magic string for preference tab (#6666) Signed-off-by: Iku-turso <mikko.aspiala@gmail.com> Signed-off-by: Iku-turso <mikko.aspiala@gmail.com> * Make preferences from extensions using tabs "application" and "telemetry" appear as last (#6674) Signed-off-by: Iku-turso <mikko.aspiala@gmail.com> Signed-off-by: Iku-turso <mikko.aspiala@gmail.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
parent
3011bab02e
commit
810a0f8dd1
@ -3,7 +3,7 @@
|
|||||||
"productName": "OpenLens",
|
"productName": "OpenLens",
|
||||||
"description": "OpenLens - Open Source IDE for Kubernetes",
|
"description": "OpenLens - Open Source IDE for Kubernetes",
|
||||||
"homepage": "https://github.com/lensapp/lens",
|
"homepage": "https://github.com/lensapp/lens",
|
||||||
"version": "6.2.3",
|
"version": "6.2.4",
|
||||||
"main": "static/build/main.js",
|
"main": "static/build/main.js",
|
||||||
"copyright": "© 2022 OpenLens Authors",
|
"copyright": "© 2022 OpenLens Authors",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@ -375,7 +375,7 @@
|
|||||||
"css-loader": "^6.7.1",
|
"css-loader": "^6.7.1",
|
||||||
"deepdash": "^5.3.9",
|
"deepdash": "^5.3.9",
|
||||||
"dompurify": "^2.4.1",
|
"dompurify": "^2.4.1",
|
||||||
"electron": "^19.1.7",
|
"electron": "^19.1.8",
|
||||||
"electron-builder": "^23.6.0",
|
"electron-builder": "^23.6.0",
|
||||||
"electron-notarize": "^0.3.0",
|
"electron-notarize": "^0.3.0",
|
||||||
"esbuild": "^0.15.14",
|
"esbuild": "^0.15.14",
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -2,12 +2,14 @@
|
|||||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
*/
|
*/
|
||||||
|
import React from "react";
|
||||||
import type { RenderResult } from "@testing-library/react";
|
import type { RenderResult } from "@testing-library/react";
|
||||||
import type { ApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
import type { ApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
||||||
import { getApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
import { getApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
||||||
import navigateToProxyPreferencesInjectable from "./common/navigate-to-proxy-preferences.injectable";
|
import navigateToProxyPreferencesInjectable from "./common/navigate-to-proxy-preferences.injectable";
|
||||||
import type { Discover } from "../../renderer/components/test-utils/discovery-of-html-elements";
|
import type { Discover } from "../../renderer/components/test-utils/discovery-of-html-elements";
|
||||||
import { discoverFor } from "../../renderer/components/test-utils/discovery-of-html-elements";
|
import { discoverFor } from "../../renderer/components/test-utils/discovery-of-html-elements";
|
||||||
|
import type { FakeExtensionOptions } from "../../renderer/components/test-utils/get-extension-fake";
|
||||||
|
|
||||||
describe("preferences - navigation to application preferences", () => {
|
describe("preferences - navigation to application preferences", () => {
|
||||||
let builder: ApplicationBuilder;
|
let builder: ApplicationBuilder;
|
||||||
@ -16,6 +18,53 @@ describe("preferences - navigation to application preferences", () => {
|
|||||||
builder = getApplicationBuilder();
|
builder = getApplicationBuilder();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe("given in preferences, when rendered", () => {
|
||||||
|
let rendered: RenderResult;
|
||||||
|
let discover: Discover;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
builder.beforeWindowStart(() => {
|
||||||
|
builder.preferences.navigate();
|
||||||
|
});
|
||||||
|
|
||||||
|
rendered = await builder.render();
|
||||||
|
|
||||||
|
discover = discoverFor(() => rendered);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("renders", () => {
|
||||||
|
expect(rendered.container).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
|
||||||
|
it("shows application preferences", () => {
|
||||||
|
const { discovered } = discover.querySingleElement(
|
||||||
|
"preference-page",
|
||||||
|
"application-page",
|
||||||
|
);
|
||||||
|
|
||||||
|
expect(discovered).not.toBeNull();
|
||||||
|
});
|
||||||
|
|
||||||
|
describe("when extension with application preference items gets enabled", () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
builder.extensions.enable(
|
||||||
|
extensionStubWithApplicationPreferenceItems,
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("renders", () => {
|
||||||
|
expect(rendered.container).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
|
||||||
|
it("shows preference items of the extension as last", () => {
|
||||||
|
const { attributeValues } =
|
||||||
|
discover.queryAllElements("preference-item");
|
||||||
|
|
||||||
|
expect(attributeValues.at(-1)).toBe("preference-item-for-extension-some-test-extension-name-item-some-application-preference-item-id");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe("given in some child page of preferences, when rendered", () => {
|
describe("given in some child page of preferences, when rendered", () => {
|
||||||
let rendered: RenderResult;
|
let rendered: RenderResult;
|
||||||
let discover: Discover;
|
let discover: Discover;
|
||||||
@ -85,3 +134,22 @@ describe("preferences - navigation to application preferences", () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const extensionStubWithApplicationPreferenceItems: FakeExtensionOptions = {
|
||||||
|
id: "some-test-extension-id",
|
||||||
|
name: "some-test-extension-name",
|
||||||
|
|
||||||
|
rendererOptions: {
|
||||||
|
appPreferences: [
|
||||||
|
{
|
||||||
|
title: "Some application-preference item",
|
||||||
|
id: "some-application-preference-item-id",
|
||||||
|
showInPreferencesTab: "application",
|
||||||
|
|
||||||
|
components: {
|
||||||
|
Hint: () => <div data-testid="some-preference-item-hint" />,
|
||||||
|
Input: () => <div data-testid="some-preference-item-input" />,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
};
|
||||||
@ -113,6 +113,12 @@ const registratorForPreferenceItemsInjectable = getInjectable({
|
|||||||
const items = extension.appPreferences.map((registration, i) => {
|
const items = extension.appPreferences.map((registration, i) => {
|
||||||
const itemId = `${commonId}-item-${registration.id ?? i}`;
|
const itemId = `${commonId}-item-${registration.id ?? i}`;
|
||||||
|
|
||||||
|
const itemIsInSpecialTab =
|
||||||
|
registration.showInPreferencesTab &&
|
||||||
|
["telemetry", "application"].includes(
|
||||||
|
registration.showInPreferencesTab,
|
||||||
|
);
|
||||||
|
|
||||||
return getInjectable({
|
return getInjectable({
|
||||||
id: itemId,
|
id: itemId,
|
||||||
|
|
||||||
@ -120,14 +126,14 @@ const registratorForPreferenceItemsInjectable = getInjectable({
|
|||||||
kind: "block" as const,
|
kind: "block" as const,
|
||||||
id: itemId,
|
id: itemId,
|
||||||
|
|
||||||
// Note: Legacy extensions considered telemetry as magic string, and so does this code
|
// Note: Legacy extensions considered telemetry and application as magic strings, and so does this code
|
||||||
parentId: registration.showInPreferencesTab
|
parentId: registration.showInPreferencesTab
|
||||||
? registration.showInPreferencesTab === "telemetry"
|
? itemIsInSpecialTab
|
||||||
? "telemetry-page"
|
? `${registration.showInPreferencesTab}-page`
|
||||||
: `${commonId}-additional-page-${registration.showInPreferencesTab}`
|
: `${commonId}-additional-page-${registration.showInPreferencesTab}`
|
||||||
: primaryPageId,
|
: primaryPageId,
|
||||||
|
|
||||||
orderNumber: i * 10,
|
orderNumber: i * 10 + (itemIsInSpecialTab ? 1000 : 0),
|
||||||
|
|
||||||
Component: () => (
|
Component: () => (
|
||||||
<ExtensionPreferenceBlock registration={registration} />
|
<ExtensionPreferenceBlock registration={registration} />
|
||||||
|
|||||||
@ -5100,10 +5100,10 @@ electron-window-state@^5.0.3:
|
|||||||
jsonfile "^4.0.0"
|
jsonfile "^4.0.0"
|
||||||
mkdirp "^0.5.1"
|
mkdirp "^0.5.1"
|
||||||
|
|
||||||
electron@^19.1.7:
|
electron@^19.1.8:
|
||||||
version "19.1.7"
|
version "19.1.8"
|
||||||
resolved "https://registry.yarnpkg.com/electron/-/electron-19.1.7.tgz#35036a510d9ca943d271e1d1a12463547ed5cd12"
|
resolved "https://registry.yarnpkg.com/electron/-/electron-19.1.8.tgz#3ce19c270ca86d05bbf0df5ceeaea2d23edc7083"
|
||||||
integrity sha512-U5rCktIm/EeRjfg/9QFo29jzvZVV2z8Xw7r2NdGTpljmjd+7kySHvUHthO2hk8HETILJivL4+R5lF9zxcJ2J9w==
|
integrity sha512-UfPQdFjgKI0xCm1V5sV3iAVOs0kCwAE91xWzV5tI7ij14yOkxTdXp9BqTzFaSbQYLYxn6q1BUUe1nlzjJjzAnw==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@electron/get" "^1.14.1"
|
"@electron/get" "^1.14.1"
|
||||||
"@types/node" "^16.11.26"
|
"@types/node" "^16.11.26"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user