mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Allow extensions to have external dependencies (#1018)
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
1 parent
de3849d22c
commit
2b6f283e1b
21 files changed
+1861
-305
No files matched your search
@@ -4,7 +4,7 @@ import { render, unmountComponentAtNode } from "react-dom";
|
||||
import { isMac } from "../common/vars";
|
||||
import { userStore } from "../common/user-store";
|
||||
import { workspaceStore } from "../common/workspace-store";
|
||||
import { extensionStore } from "../extensions/extension-store";
|
||||
import { extensionLoader } from "../extensions/extension-loader";
|
||||
import { clusterStore } from "../common/cluster-store";
|
||||
import { i18nStore } from "./i18n";
|
||||
import { themeStore } from "./theme.store";
|
||||
@@ -25,18 +25,17 @@ export async function bootstrap(App: AppComponent) {
|
||||
userStore.load(),
|
||||
workspaceStore.load(),
|
||||
clusterStore.load(),
|
||||
extensionStore.load(),
|
||||
i18nStore.init(),
|
||||
themeStore.init(),
|
||||
]);
|
||||
|
||||
// Register additional store listeners
|
||||
clusterStore.registerIpcListener();
|
||||
extensionLoader.autoEnableOnLoad(getLensRuntime);
|
||||
|
||||
// init app's dependencies if any
|
||||
if (App.init) {
|
||||
await App.init();
|
||||
extensionStore.autoEnableOnLoad(getLensRuntime);
|
||||
}
|
||||
window.addEventListener("message", (ev: MessageEvent) => {
|
||||
if (ev.data === "teardown") {
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
import { RouteProps } from "react-router";
|
||||
import { buildURL } from "../../navigation";
|
||||
|
||||
export const extensionsRoute: RouteProps = {
|
||||
path: "/extensions"
|
||||
}
|
||||
|
||||
export interface IExtensionsRouteParams {
|
||||
}
|
||||
|
||||
export const extensionsURL = buildURL<IExtensionsRouteParams>(extensionsRoute.path);
|
||||
@@ -1,4 +0,0 @@
|
||||
.Extensions {
|
||||
$spacing: $padding * 2;
|
||||
padding: $spacing;
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
import "./extensions.scss"
|
||||
import React from "react";
|
||||
import { observer } from "mobx-react";
|
||||
import { extensionStore } from "../../../extensions/extension-store";
|
||||
import { WizardLayout } from "../layout/wizard-layout";
|
||||
import { Icon } from "../icon";
|
||||
|
||||
@observer
|
||||
export class Extensions extends React.Component {
|
||||
// todo: add input-select to customize extensions loading folder(s)
|
||||
renderInfoPanel() {
|
||||
return (
|
||||
<div className="info-panel flex gaps align-center">
|
||||
<Icon material="info"/>
|
||||
<p>Extensions available to install</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
render() {
|
||||
const { installed: installedExtensions } = extensionStore;
|
||||
return (
|
||||
<WizardLayout className="Extensions" infoPanel={this.renderInfoPanel()}>
|
||||
<h2>Extensions</h2>
|
||||
<pre>
|
||||
{JSON.stringify(installedExtensions.toJSON(), null, 2)}
|
||||
</pre>
|
||||
</WizardLayout>
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
export * from "./extensions.route"
|
||||
export * from "./extensions"
|
||||
@@ -11,7 +11,6 @@ import { Workspaces, workspacesRoute } from "../+workspaces";
|
||||
import { AddCluster, addClusterRoute } from "../+add-cluster";
|
||||
import { ClusterView } from "./cluster-view";
|
||||
import { ClusterSettings, clusterSettingsRoute } from "../+cluster-settings";
|
||||
import { Extensions, extensionsRoute } from "../+extensions";
|
||||
import { clusterViewRoute, clusterViewURL, getMatchedCluster, getMatchedClusterId } from "./cluster-view.route";
|
||||
import { clusterStore } from "../../../common/cluster-store";
|
||||
import { hasLoadedView, initView, lensViews, refreshViews } from "./lens-views";
|
||||
@@ -64,7 +63,6 @@ export class ClusterManager extends React.Component {
|
||||
<Route component={AddCluster} {...addClusterRoute} />
|
||||
<Route component={ClusterView} {...clusterViewRoute} />
|
||||
<Route component={ClusterSettings} {...clusterSettingsRoute} />
|
||||
<Route component={Extensions} {...extensionsRoute}/>
|
||||
{dynamicPages.globalPages.map(({ path, components: { Page } }) => {
|
||||
return <Route key={path} path={path} component={Page}/>
|
||||
})}
|
||||
|
||||
Reference in new issue
Block a user