Persist apiVersion when editing resources in monaco (#4406)

* Persist apiVersion when editing resources in monaco

- Use a new custom k8slens prefixed label

- Means that users aren't surprised when they use lens to update a
  resource to a new apiVersionWithGroup

- Doesn't touch the versions in the stores

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Fix lint

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* fix: Fix lint issues

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* chore: make lint not bail on failure

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* chore: Run lint:fix on all files

Signed-off-by: Sebastian Malton <sebastian@malton.name>

---------

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton authored and GitHub committed 2023-04-05 10:56:23 -04:00
1 parent 058494bc73
commit 807f98ed1b
57 files changed
+295 -400

No files matched your search

@@ -1,9 +1,6 @@
import ipcMainInjectable from "../ipc-main/ipc-main.injectable";
import type { IpcMain, IpcMainEvent } from "electron";
import {
EnlistMessageChannelListener,
enlistMessageChannelListenerInjectionToken,
} from "@k8slens/messaging";
import { EnlistMessageChannelListener, enlistMessageChannelListenerInjectionToken } from "@k8slens/messaging";
import { createContainer } from "@ogre-tools/injectable";
import { registerFeature } from "@k8slens/feature-core";
import { messagingFeatureForMain } from "../feature";
@@ -1,19 +1,13 @@
/* c8 ignore start */
import { getInjectable } from "@ogre-tools/injectable";
import {
RequestChannel,
RequestFromChannel,
requestFromChannelInjectionToken,
} from "@k8slens/messaging";
import { RequestChannel, RequestFromChannel, requestFromChannelInjectionToken } from "@k8slens/messaging";
const requestFromChannelInjectable = getInjectable({
id: "request-from-channel",
instantiate: () =>
((channel: RequestChannel<any, any>) => {
throw new Error(
`Tried to request from channel "${channel.id}" but requesting in "main" it's not supported yet`,
);
throw new Error(`Tried to request from channel "${channel.id}" but requesting in "main" it's not supported yet`);
}) as unknown as RequestFromChannel,
injectionToken: requestFromChannelInjectionToken,
@@ -1,9 +1,7 @@
import { getMessageChannel, getMessageChannelListenerInjectable } from "@k8slens/messaging";
import frameIdsInjectable from "./frameIds.injectable";
const frameCommunicationAdminChannel = getMessageChannel<undefined>(
"frame-communication-admin-channel",
);
const frameCommunicationAdminChannel = getMessageChannel<undefined>("frame-communication-admin-channel");
const allowCommunicationListenerInjectable = getMessageChannelListenerInjectable({
id: "allow-communication",