mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
merge-fixes
Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
parent
2f408ff0bc
commit
6287279045
@ -6,9 +6,7 @@ import { broadcastIpc } from "../common/ipc"
|
||||
import { observable, reaction, toJS, } from "mobx"
|
||||
import logger from "../main/logger"
|
||||
import { app, ipcRenderer, remote } from "electron"
|
||||
import { appPreferenceRegistry, menuRegistry, pageRegistry, statusBarRegistry, kubeObjectMenuRegistry } from "./registries";
|
||||
import { app, remote, ipcRenderer } from "electron"
|
||||
import { pageRegistry } from "./page-registry";
|
||||
import { appPreferenceRegistry, kubeObjectMenuRegistry, menuRegistry, pageRegistry, statusBarRegistry } from "./registries";
|
||||
|
||||
export interface InstalledExtension extends ExtensionModel {
|
||||
manifestPath: string;
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
import { LensExtension } from "./lens-extension"
|
||||
import type { PageRegistry, AppPreferenceRegistry, StatusBarRegistry } from "./registries/page-registry"
|
||||
import type { KubeObjectMenuRegistry } from "../renderer/api/kube-object-menu-registry";
|
||||
import type { PageRegistry, AppPreferenceRegistry, StatusBarRegistry, KubeObjectMenuRegistry } from "./registries"
|
||||
|
||||
export class LensRendererExtension extends LensExtension {
|
||||
registerPages(registry: PageRegistry) {
|
||||
|
||||
@ -1,4 +1,7 @@
|
||||
// All registries managed by extensions api
|
||||
|
||||
export * from "./page-registry"
|
||||
export * from "./menu-registry"
|
||||
export * from "./app-preference-registry"
|
||||
export * from "./status-bar-registry"
|
||||
export * from "./kube-object-menu-registry";
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { observable } from "mobx"
|
||||
import React from "react"
|
||||
import { BaseRegistry } from "./base-registry";
|
||||
|
||||
export interface KubeObjectMenuComponents {
|
||||
MenuItem: React.ComponentType<any>;
|
||||
@ -11,18 +11,7 @@ export interface KubeObjectMenuRegistration {
|
||||
components: KubeObjectMenuComponents;
|
||||
}
|
||||
|
||||
export class KubeObjectMenuRegistry {
|
||||
items = observable.array<KubeObjectMenuRegistration>([], { deep: false });
|
||||
|
||||
add(item: KubeObjectMenuRegistration) {
|
||||
this.items.push(item)
|
||||
return () => {
|
||||
this.items.replace(
|
||||
this.items.filter(c => c !== item)
|
||||
)
|
||||
};
|
||||
}
|
||||
|
||||
export class KubeObjectMenuRegistry extends BaseRegistry<KubeObjectMenuRegistration> {
|
||||
getItemsForKind(kind: string, apiVersion: string) {
|
||||
return this.items.filter((item) => {
|
||||
return item.kind === kind && item.apiVersions.includes(apiVersion)
|
||||
@ -3,9 +3,9 @@ import "./service-accounts.scss";
|
||||
import React from "react";
|
||||
import { observer } from "mobx-react";
|
||||
import { Trans } from "@lingui/macro";
|
||||
import { ServiceAccount, serviceAccountsApi } from "../../api/endpoints/service-accounts.api";
|
||||
import { ServiceAccount } from "../../api/endpoints/service-accounts.api";
|
||||
import { RouteComponentProps } from "react-router";
|
||||
import { KubeObjectMenu, KubeObjectMenuProps } from "../kube-object/kube-object-menu";
|
||||
import { KubeObjectMenuProps } from "../kube-object/kube-object-menu";
|
||||
import { MenuItem } from "../menu";
|
||||
import { openServiceAccountKubeConfig } from "../kubeconfig-dialog";
|
||||
import { Icon } from "../icon";
|
||||
@ -13,7 +13,7 @@ import { KubeObjectListLayout } from "../kube-object";
|
||||
import { IServiceAccountsRouteParams } from "../+user-management";
|
||||
import { serviceAccountsStore } from "./service-accounts.store";
|
||||
import { CreateServiceAccountDialog } from "./create-service-account-dialog";
|
||||
import { kubeObjectMenuRegistry } from "../../api/kube-object-menu-registry";
|
||||
import { kubeObjectMenuRegistry } from "../../../extensions/registries/kube-object-menu-registry";
|
||||
|
||||
enum sortBy {
|
||||
name = "name",
|
||||
|
||||
@ -4,19 +4,19 @@ import React from "react";
|
||||
import { observer } from "mobx-react";
|
||||
import { RouteComponentProps } from "react-router";
|
||||
import { t, Trans } from "@lingui/macro";
|
||||
import { CronJob, cronJobApi } from "../../api/endpoints/cron-job.api";
|
||||
import { CronJob } from "../../api/endpoints/cron-job.api";
|
||||
import { MenuItem } from "../menu";
|
||||
import { Icon } from "../icon";
|
||||
import { cronJobStore } from "./cronjob.store";
|
||||
import { jobStore } from "../+workloads-jobs/job.store";
|
||||
import { eventStore } from "../+events/event.store";
|
||||
import { KubeObjectMenu, KubeObjectMenuProps } from "../kube-object/kube-object-menu";
|
||||
import { KubeObjectMenuProps } from "../kube-object/kube-object-menu";
|
||||
import { ICronJobsRouteParams } from "../+workloads";
|
||||
import { KubeObjectListLayout } from "../kube-object";
|
||||
import { KubeEventIcon } from "../+events/kube-event-icon";
|
||||
import { _i18n } from "../../i18n";
|
||||
import { CronJobTriggerDialog } from "./cronjob-trigger-dialog";
|
||||
import { kubeObjectMenuRegistry } from "../../api/kube-object-menu-registry";
|
||||
import { kubeObjectMenuRegistry } from "../../../extensions/registries/kube-object-menu-registry";
|
||||
|
||||
enum sortBy {
|
||||
name = "name",
|
||||
|
||||
@ -4,8 +4,8 @@ import React from "react";
|
||||
import { observer } from "mobx-react";
|
||||
import { RouteComponentProps } from "react-router";
|
||||
import { t, Trans } from "@lingui/macro";
|
||||
import { Deployment, deploymentApi } from "../../api/endpoints";
|
||||
import { KubeObjectMenu, KubeObjectMenuProps } from "../kube-object/kube-object-menu";
|
||||
import { Deployment } from "../../api/endpoints";
|
||||
import { KubeObjectMenuProps } from "../kube-object/kube-object-menu";
|
||||
import { MenuItem } from "../menu";
|
||||
import { Icon } from "../icon";
|
||||
import { DeploymentScaleDialog } from "./deployment-scale-dialog";
|
||||
@ -21,8 +21,7 @@ import { cssNames } from "../../utils";
|
||||
import kebabCase from "lodash/kebabCase";
|
||||
import orderBy from "lodash/orderBy";
|
||||
import { KubeEventIcon } from "../+events/kube-event-icon";
|
||||
import { kubeObjectMenuRegistry } from "../../api/kube-object-menu-registry";
|
||||
import { DeploymentDetails } from "./deployment-details";
|
||||
import { kubeObjectMenuRegistry } from "../../../extensions/registries/kube-object-menu-registry";
|
||||
|
||||
enum sortBy {
|
||||
name = "name",
|
||||
|
||||
@ -6,7 +6,7 @@ import { editResourceTab } from "../dock/edit-resource.store";
|
||||
import { MenuActions, MenuActionsProps } from "../menu/menu-actions";
|
||||
import { hideDetails } from "../../navigation";
|
||||
import { apiManager } from "../../api/api-manager";
|
||||
import { kubeObjectMenuRegistry } from "../../api/kube-object-menu-registry";
|
||||
import { kubeObjectMenuRegistry } from "../../../extensions/registries/kube-object-menu-registry";
|
||||
|
||||
export interface KubeObjectMenuProps<T extends KubeObject = any> extends MenuActionsProps {
|
||||
object: T;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user