From d3759ebfd7753baae49954679727444f203a0358 Mon Sep 17 00:00:00 2001 From: Panu Horsmalahti Date: Fri, 28 Oct 2022 12:40:42 +0300 Subject: [PATCH] Release 6.1.14 (#6483) * Add data-origin to status bar items for better observability (#6400) * Passing id to status-bar-items Signed-off-by: Alex Andreev * Add data-origin prop for status bar items Signed-off-by: Alex Andreev * Fixing status bar tests Signed-off-by: Alex Andreev * Update snapshots Signed-off-by: Alex Andreev * Fix linter Signed-off-by: Alex Andreev * Rename id -> origin because it is not unique Signed-off-by: Alex Andreev Signed-off-by: Alex Andreev * Release 6.1.14 Signed-off-by: Panu Horsmalahti Signed-off-by: Alex Andreev Signed-off-by: Panu Horsmalahti Co-authored-by: Alex Andreev --- package.json | 2 +- ...haracters-in-page-registrations.test.tsx.snap | 2 ++ .../navigate-to-extension-page.test.tsx.snap | 5 +++++ .../navigating-between-routes.test.tsx.snap | 2 ++ ...vigation-using-application-menu.test.tsx.snap | 2 ++ ...time-since-update-was-downloaded.test.ts.snap | 3 +++ ...ling-update-using-topbar-button.test.tsx.snap | 2 ++ .../installing-update-using-tray.test.ts.snap | 6 ++++++ .../__snapshots__/installing-update.test.ts.snap | 6 ++++++ .../periodical-checking-of-updates.test.ts.snap | 1 + .../selection-of-update-stability.test.ts.snap | 1 + .../keyboard-shortcuts.test.tsx.snap | 8 ++++++++ ...avigation-using-application-menu.test.ts.snap | 2 ++ ...m-helm-repository-in-preferences.test.ts.snap | 12 ++++++++++++ ...ository-from-list-in-preferences.test.ts.snap | 10 ++++++++++ ...helm-repositories-in-preferences.test.ts.snap | 10 ++++++++++ ...active-repository-in-preferences.test.ts.snap | 4 ++++ .../closing-preferences.test.tsx.snap | 8 ++++++++ ...xtension-adding-preference-tabs.test.tsx.snap | 1 + ...ation-to-application-preferences.test.ts.snap | 2 ++ ...navigation-to-editor-preferences.test.ts.snap | 2 ++ ...-extension-specific-preferences.test.tsx.snap | 10 ++++++++++ ...gation-to-kubernetes-preferences.test.ts.snap | 2 ++ .../navigation-to-proxy-preferences.test.ts.snap | 2 ++ ...gation-to-telemetry-preferences.test.tsx.snap | 5 +++++ ...vigation-to-terminal-preferences.test.ts.snap | 2 ++ ...avigation-using-application-menu.test.ts.snap | 2 ++ .../navigation-using-tray.test.ts.snap | 2 ++ ...ems-originating-from-extensions.test.tsx.snap | 6 ++++++ ...avigation-using-application-menu.test.ts.snap | 3 +++ .../status-bar-item-injection-token.ts | 1 + .../status-bar-item-registrator.injectable.tsx | 1 + .../status-bar/status-bar-items.injectable.tsx | 16 ++++++++++++---- .../components/status-bar/status-bar.test.tsx | 2 +- .../components/status-bar/status-bar.tsx | 16 +++++++++++----- 35 files changed, 150 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 82e511a81a..8a5ee9e9a1 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "productName": "OpenLens", "description": "OpenLens - Open Source IDE for Kubernetes", "homepage": "https://github.com/lensapp/lens", - "version": "6.1.13", + "version": "6.1.14", "main": "static/build/main.js", "copyright": "© 2022 OpenLens Authors", "license": "MIT", diff --git a/src/features/__snapshots__/extension-special-characters-in-page-registrations.test.tsx.snap b/src/features/__snapshots__/extension-special-characters-in-page-registrations.test.tsx.snap index dab11ecc9b..3eb46b81e9 100644 --- a/src/features/__snapshots__/extension-special-characters-in-page-registrations.test.tsx.snap +++ b/src/features/__snapshots__/extension-special-characters-in-page-registrations.test.tsx.snap @@ -182,6 +182,7 @@ exports[`extension special characters in page registrations renders 1`] = `
; position: "left" | "right"; visible: IComputedValue; diff --git a/src/renderer/components/status-bar/status-bar-item-registrator.injectable.tsx b/src/renderer/components/status-bar/status-bar-item-registrator.injectable.tsx index 71293126f7..ed909a8284 100644 --- a/src/renderer/components/status-bar/status-bar-item-registrator.injectable.tsx +++ b/src/renderer/components/status-bar/status-bar-item-registrator.injectable.tsx @@ -74,6 +74,7 @@ const toItemInjectableFor = (extension: LensRendererExtension, getRandomId: () = id, instantiate: () => ({ + origin: extension.sanitizedExtensionId, component, position, visible: visible ?? computed(() => true), diff --git a/src/renderer/components/status-bar/status-bar-items.injectable.tsx b/src/renderer/components/status-bar/status-bar-items.injectable.tsx index 855b8654c9..2b5be6fdb3 100644 --- a/src/renderer/components/status-bar/status-bar-items.injectable.tsx +++ b/src/renderer/components/status-bar/status-bar-items.injectable.tsx @@ -10,9 +10,14 @@ import type { StatusBarItem } from "./status-bar-item-injection-token"; import { statusBarItemInjectionToken } from "./status-bar-item-injection-token"; import { computedInjectManyInjectable } from "@ogre-tools/injectable-extension-for-mobx"; +interface StatusItem { + origin?: string; + component: React.ComponentType; +} + export interface StatusBarItems { - right: React.ComponentType[]; - left: React.ComponentType[]; + right: StatusItem[]; + left: StatusItem[]; } interface Dependencies { @@ -27,13 +32,16 @@ function getStatusBarItems({ registrations }: Dependencies): IComputedValue", () => { builder.beforeWindowStart((windowDi) => { windowDi.override(statusBarItemsInjectable, () => computed(() => ({ - right: [ () => {text} ], + right: [ { origin: testId, component: () => {text} }], left: [], }) as StatusBarItems)); }); diff --git a/src/renderer/components/status-bar/status-bar.tsx b/src/renderer/components/status-bar/status-bar.tsx index 1214a104c7..dabad3bf17 100644 --- a/src/renderer/components/status-bar/status-bar.tsx +++ b/src/renderer/components/status-bar/status-bar.tsx @@ -22,18 +22,24 @@ const NonInjectedStatusBar = observer(({ items }: Dependencies & StatusBarProps) const { left, right } = items.get(); return ( -
+
{left.map((Item, index) => ( -
- +
+ {}
))}
{right.map((Item, index) => ( -
- +
+ {}
))}