mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Add eslint rule padding-line-between-statements (#1593)
Signed-off-by: Panu Horsmalahti <phorsmalahti@mirantis.com>
This commit is contained in:
1 parent
7b77f18376
commit
dcf253e7d5
401 files changed
+2018
-40
No files matched your search
@@ -11,6 +11,7 @@ import { statusBarRegistry } from "../../../extensions/registries";
|
||||
export class BottomBar extends React.Component {
|
||||
render() {
|
||||
const { currentWorkspace } = workspaceStore;
|
||||
|
||||
return (
|
||||
<div className="BottomBar flex gaps">
|
||||
<div id="current-workspace" className="flex gaps align-center">
|
||||
@@ -23,6 +24,7 @@ export class BottomBar extends React.Component {
|
||||
<div className="extensions box grow flex gaps justify-flex-end">
|
||||
{statusBarRegistry.getItems().map(({ item }, index) => {
|
||||
if (!item) return;
|
||||
|
||||
return <div className="flex align-center gaps item" key={index}>{item}</div>;
|
||||
})}
|
||||
</div>
|
||||
|
||||
@@ -46,6 +46,7 @@ export class ClusterManager extends React.Component {
|
||||
|
||||
get startUrl() {
|
||||
const { activeClusterId } = clusterStore;
|
||||
|
||||
if (activeClusterId) {
|
||||
return clusterViewURL({
|
||||
params: {
|
||||
@@ -53,6 +54,7 @@ export class ClusterManager extends React.Component {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return landingURL();
|
||||
}
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@ export class ClusterStatus extends React.Component<Props> {
|
||||
error: res.error,
|
||||
});
|
||||
});
|
||||
|
||||
if (this.cluster.disconnected) {
|
||||
await this.activateCluster();
|
||||
}
|
||||
@@ -62,6 +63,7 @@ export class ClusterStatus extends React.Component<Props> {
|
||||
renderContent() {
|
||||
const { authOutput, cluster, hasErrors } = this;
|
||||
const failureReason = cluster.failureReason;
|
||||
|
||||
if (!hasErrors || this.isReconnecting) {
|
||||
return (
|
||||
<>
|
||||
@@ -75,6 +77,7 @@ export class ClusterStatus extends React.Component<Props> {
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Icon material="cloud_off" className="error"/>
|
||||
|
||||
@@ -33,6 +33,7 @@ export class ClusterView extends React.Component<Props> {
|
||||
render() {
|
||||
const { cluster } = this;
|
||||
const showStatus = cluster && (!cluster.available || !hasLoadedView(cluster.id) || !cluster.ready);
|
||||
|
||||
return (
|
||||
<div className="ClusterView flex align-center">
|
||||
{showStatus && (
|
||||
|
||||
@@ -53,6 +53,7 @@ export class ClustersMenu extends React.Component<Props> {
|
||||
}));
|
||||
}
|
||||
}));
|
||||
|
||||
if (cluster.online) {
|
||||
menu.append(new MenuItem({
|
||||
label: _i18n._(t`Disconnect`),
|
||||
@@ -65,6 +66,7 @@ export class ClustersMenu extends React.Component<Props> {
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
if (!cluster.isManaged) {
|
||||
menu.append(new MenuItem({
|
||||
label: _i18n._(t`Remove`),
|
||||
@@ -100,6 +102,7 @@ export class ClustersMenu extends React.Component<Props> {
|
||||
source: { index: from },
|
||||
destination: { index: to },
|
||||
} = result;
|
||||
|
||||
clusterStore.swapIconOrders(currentWorkspaceId, from, to);
|
||||
}
|
||||
}
|
||||
@@ -110,6 +113,7 @@ export class ClustersMenu extends React.Component<Props> {
|
||||
const workspace = workspaceStore.getById(workspaceStore.currentWorkspaceId);
|
||||
const clusters = clusterStore.getByWorkspaceId(workspace.id).filter(cluster => cluster.enabled);
|
||||
const activeClusterId = clusterStore.activeCluster;
|
||||
|
||||
return (
|
||||
<div className={cssNames("ClustersMenu flex column", className)}>
|
||||
<div className="clusters flex column gaps">
|
||||
@@ -119,6 +123,7 @@ export class ClustersMenu extends React.Component<Props> {
|
||||
<div ref={innerRef} {...droppableProps}>
|
||||
{clusters.map((cluster, index) => {
|
||||
const isActive = cluster.id === activeClusterId;
|
||||
|
||||
return (
|
||||
<Draggable draggableId={cluster.id} index={index} key={cluster.id}>
|
||||
{({ draggableProps, dragHandleProps, innerRef }: DraggableProvided) => (
|
||||
@@ -154,10 +159,12 @@ export class ClustersMenu extends React.Component<Props> {
|
||||
<div className="extensions">
|
||||
{globalPageMenuRegistry.getItems().map(({ title, target, components: { Icon } }) => {
|
||||
const registeredPage = globalPageRegistry.getByPageMenuTarget(target);
|
||||
|
||||
if (!registeredPage) return;
|
||||
const { extensionId, id: pageId } = registeredPage;
|
||||
const pageUrl = getExtensionPageUrl({ extensionId, pageId, params: target.params });
|
||||
const isActive = pageUrl === navigation.location.pathname;
|
||||
|
||||
return (
|
||||
<Icon
|
||||
key={pageUrl}
|
||||
|
||||
@@ -20,12 +20,14 @@ export async function initView(clusterId: ClusterId) {
|
||||
return;
|
||||
}
|
||||
const cluster = clusterStore.getById(clusterId);
|
||||
|
||||
if (!cluster) {
|
||||
return;
|
||||
}
|
||||
logger.info(`[LENS-VIEW]: init dashboard, clusterId=${clusterId}`);
|
||||
const parentElem = document.getElementById("lens-views");
|
||||
const iframe = document.createElement("iframe");
|
||||
|
||||
iframe.name = cluster.contextName;
|
||||
iframe.setAttribute("src", getClusterFrameUrl(clusterId));
|
||||
iframe.addEventListener("load", () => {
|
||||
@@ -52,10 +54,12 @@ export async function autoCleanOnRemove(clusterId: ClusterId, iframe: HTMLIFrame
|
||||
|
||||
export function refreshViews() {
|
||||
const cluster = clusterStore.getById(getMatchedClusterId());
|
||||
|
||||
lensViews.forEach(({ clusterId, view, isLoaded }) => {
|
||||
const isCurrent = clusterId === cluster?.id;
|
||||
const isReady = cluster?.available && cluster?.ready;
|
||||
const isVisible = isCurrent && isLoaded && isReady;
|
||||
|
||||
view.style.display = isVisible ? "flex" : "none";
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user