PageRegistration & BaseRegistry refactoring (#1334)

Signed-off-by: Roman <ixrock@gmail.com>
Co-authored-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
RomanandJari Kolehmainen authored and GitHub committed 2020-11-12 16:29:02 +02:00
1 parent 6432b3bb9e
commit faa1cef307
43 files changed
+432 -369

No files matched your search

+1 -2
View File
@@ -1,5 +1,4 @@
import { LensMainExtension } from "@k8slens/extensions";
import { supportPageURL } from "./src/support.route";
export default class SupportPageMainExtension extends LensMainExtension {
appMenus = [
@@ -7,7 +6,7 @@ export default class SupportPageMainExtension extends LensMainExtension {
parentId: "help",
label: "Support",
click: () => {
this.navigate(supportPageURL());
this.navigate();
}
}
]
+7 -14
View File
@@ -1,28 +1,21 @@
import React from "react";
import { Component, LensRendererExtension, Navigation } from "@k8slens/extensions";
import { supportPageRoute, supportPageURL } from "./src/support.route";
import { Support } from "./src/support";
import { Component, Interface, LensRendererExtension } from "@k8slens/extensions";
import { SupportPage } from "./src/support";
export default class SupportPageRendererExtension extends LensRendererExtension {
globalPages = [
globalPages: Interface.PageRegistration[] = [
{
...supportPageRoute,
url: supportPageURL(),
hideInMenu: true,
components: {
Page: Support,
Page: SupportPage,
}
}
]
statusBarItems = [
statusBarItems: Interface.StatusBarRegistration[] = [
{
item: (
<div
className="SupportPageIcon flex align-center"
onClick={() => Navigation.navigate(supportPageURL())}
>
<Component.Icon interactive material="help" smallest />
<div className="SupportPageIcon flex align-center" onClick={() => this.navigate()}>
<Component.Icon interactive material="help" smallest/>
</div>
)
}
@@ -1,7 +0,0 @@
import type { RouteProps } from "react-router";
export const supportPageRoute: RouteProps = {
path: "/support"
}
export const supportPageURL = () => supportPageRoute.path.toString();
+1 -1
View File
@@ -1,4 +1,4 @@
.PageLayout.Support {
.SupportPage {
a[target=_blank] {
text-decoration: none;
border-bottom: 1px solid;
+2 -2
View File
@@ -6,12 +6,12 @@ import { observer } from "mobx-react"
import { App, Component } from "@k8slens/extensions";
@observer
export class Support extends React.Component {
export class SupportPage extends React.Component {
render() {
const { PageLayout } = Component;
const { slackUrl, issuesTrackerUrl } = App;
return (
<PageLayout showOnTop className="Support" header={<h2>Support</h2>}>
<PageLayout showOnTop className="SupportPage" header={<h2>Support</h2>}>
<h2>Community Slack Channel</h2>
<p>
Ask a question, see what's being discussed, join the conversation <a href={slackUrl} target="_blank">here</a>