mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Removing unused files
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
parent
d6f5cca350
commit
7691b974d6
@ -1,24 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2021 OpenLens Authors
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
||||||
* this software and associated documentation files (the "Software"), to deal in
|
|
||||||
* the Software without restriction, including without limitation the rights to
|
|
||||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
||||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
|
||||||
* subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
||||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
||||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
export default {
|
|
||||||
Trans: ({ children }: { children: React.ReactNode }) => children,
|
|
||||||
t: (message: string) => message
|
|
||||||
};
|
|
||||||
@ -1,88 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2021 OpenLens Authors
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
||||||
* this software and associated documentation files (the "Software"), to deal in
|
|
||||||
* the Software without restriction, including without limitation the rights to
|
|
||||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
||||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
|
||||||
* subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
||||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
||||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
jest.mock("../../../../common/ipc");
|
|
||||||
|
|
||||||
import React from "react";
|
|
||||||
import { render } from "@testing-library/react";
|
|
||||||
import "@testing-library/jest-dom/extend-expect";
|
|
||||||
|
|
||||||
import { MainLayoutHeader } from "../main-layout-header";
|
|
||||||
import { Cluster } from "../../../../main/cluster";
|
|
||||||
import { ClusterStore } from "../../../../common/cluster-store";
|
|
||||||
import mockFs from "mock-fs";
|
|
||||||
|
|
||||||
describe("<MainLayoutHeader />", () => {
|
|
||||||
let cluster: Cluster;
|
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
const mockOpts = {
|
|
||||||
"minikube-config.yml": JSON.stringify({
|
|
||||||
apiVersion: "v1",
|
|
||||||
clusters: [{
|
|
||||||
name: "minikube",
|
|
||||||
cluster: {
|
|
||||||
server: "https://192.168.64.3:8443",
|
|
||||||
},
|
|
||||||
}],
|
|
||||||
contexts: [{
|
|
||||||
context: {
|
|
||||||
cluster: "minikube",
|
|
||||||
user: "minikube",
|
|
||||||
},
|
|
||||||
name: "minikube",
|
|
||||||
}],
|
|
||||||
users: [{
|
|
||||||
name: "minikube",
|
|
||||||
}],
|
|
||||||
kind: "Config",
|
|
||||||
preferences: {},
|
|
||||||
})
|
|
||||||
};
|
|
||||||
|
|
||||||
mockFs(mockOpts);
|
|
||||||
|
|
||||||
ClusterStore.createInstance();
|
|
||||||
|
|
||||||
cluster = new Cluster({
|
|
||||||
id: "foo",
|
|
||||||
contextName: "minikube",
|
|
||||||
kubeConfigPath: "minikube-config.yml",
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
afterEach(() => {
|
|
||||||
ClusterStore.resetInstance();
|
|
||||||
mockFs.restore();
|
|
||||||
});
|
|
||||||
|
|
||||||
it("renders w/o errors", () => {
|
|
||||||
const { container } = render(<MainLayoutHeader cluster={cluster} />);
|
|
||||||
|
|
||||||
expect(container).toBeInstanceOf(HTMLElement);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("renders cluster name", () => {
|
|
||||||
const { getByText } = render(<MainLayoutHeader cluster={cluster} />);
|
|
||||||
|
|
||||||
expect(getByText("minikube")).toBeInTheDocument();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@ -1,53 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2021 OpenLens Authors
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
||||||
* this software and associated documentation files (the "Software"), to deal in
|
|
||||||
* the Software without restriction, including without limitation the rights to
|
|
||||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
||||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
|
||||||
* subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
||||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
||||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import React from "react";
|
|
||||||
import { observer } from "mobx-react";
|
|
||||||
import { cssNames } from "../../utils";
|
|
||||||
import { Icon } from "../icon";
|
|
||||||
import { MaterialTooltip } from "../material-tooltip/material-tooltip";
|
|
||||||
import { catalogURL } from "../+catalog";
|
|
||||||
import { broadcastMessage } from "../../../common/ipc";
|
|
||||||
import { IpcRendererNavigationEvents } from "../../navigation/events";
|
|
||||||
|
|
||||||
import type { Cluster } from "../../../main/cluster";
|
|
||||||
|
|
||||||
interface Props {
|
|
||||||
cluster: Cluster
|
|
||||||
className?: string
|
|
||||||
}
|
|
||||||
|
|
||||||
function navigateToCatalog() {
|
|
||||||
broadcastMessage(IpcRendererNavigationEvents.NAVIGATE_IN_APP, catalogURL());
|
|
||||||
}
|
|
||||||
|
|
||||||
export const MainLayoutHeader = observer(({ cluster, className }: Props) => {
|
|
||||||
return (
|
|
||||||
<header className={cssNames("flex gaps align-center justify-space-between", className)}>
|
|
||||||
<span className="cluster">{cluster.name}</span>
|
|
||||||
<div>
|
|
||||||
<MaterialTooltip title="Back to Catalog" placement="left">
|
|
||||||
<Icon style={{ cursor: "default" }} material="close" onClick={navigateToCatalog}/>
|
|
||||||
</MaterialTooltip>
|
|
||||||
</div>
|
|
||||||
</header>
|
|
||||||
);
|
|
||||||
});
|
|
||||||
@ -1,76 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2021 OpenLens Authors
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
||||||
* this software and associated documentation files (the "Software"), to deal in
|
|
||||||
* the Software without restriction, including without limitation the rights to
|
|
||||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
||||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
|
||||||
* subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
||||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
||||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
.MainLayout {
|
|
||||||
display: grid;
|
|
||||||
grid-template-areas:
|
|
||||||
"aside header"
|
|
||||||
"aside tabs"
|
|
||||||
"aside main"
|
|
||||||
"aside footer";
|
|
||||||
grid-template-rows: [header] var(--main-layout-header) [tabs] min-content [main] 1fr [footer] auto;
|
|
||||||
grid-template-columns: [sidebar] minmax(var(--main-layout-header), min-content) [main] 1fr;
|
|
||||||
height: 100%;
|
|
||||||
|
|
||||||
> header {
|
|
||||||
grid-area: header;
|
|
||||||
background: $layoutBackground;
|
|
||||||
padding: $padding $padding * 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
> aside {
|
|
||||||
grid-area: aside;
|
|
||||||
position: relative;
|
|
||||||
background: $sidebarBackground;
|
|
||||||
white-space: nowrap;
|
|
||||||
transition: width 150ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
||||||
width: var(--sidebar-width);
|
|
||||||
|
|
||||||
&.compact {
|
|
||||||
position: absolute;
|
|
||||||
width: var(--main-layout-header);
|
|
||||||
height: 100%;
|
|
||||||
overflow: hidden;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
width: var(--sidebar-width);
|
|
||||||
transition-delay: 750ms;
|
|
||||||
box-shadow: 3px 3px 16px rgba(0, 0, 0, 0.35);
|
|
||||||
z-index: $zIndex-sidebar-hover;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
> main {
|
|
||||||
display: contents;
|
|
||||||
|
|
||||||
> * {
|
|
||||||
grid-area: main;
|
|
||||||
overflow: auto;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
footer {
|
|
||||||
position: relative;
|
|
||||||
grid-area: footer;
|
|
||||||
min-width: 0; // restrict size when overflow content (e.g. <Dock> tabs scrolling)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) 2021 OpenLens Authors
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
* this software and associated documentation files (the "Software"), to deal in
|
||||||
|
* the Software without restriction, including without limitation the rights to
|
||||||
|
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
|
* the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
|
* subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all
|
||||||
|
* copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
|
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
|
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
.topBar {
|
.topBar {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: [title] 1fr [controls] auto;
|
grid-template-columns: [title] 1fr [controls] auto;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user