|
@@ -1,9 +1,11 @@
|
|
|
import React, { Component } from "react";
|
|
import React, { Component } from "react";
|
|
|
import styled from "styled-components";
|
|
import styled from "styled-components";
|
|
|
import category from "assets/category.svg";
|
|
import category from "assets/category.svg";
|
|
|
-import integrations from "assets/integrations.svg";
|
|
|
|
|
|
|
+import integrations from "assets/integrations-bold.png";
|
|
|
import rocket from "assets/rocket.png";
|
|
import rocket from "assets/rocket.png";
|
|
|
-import settings from "assets/settings.svg";
|
|
|
|
|
|
|
+import settings from "assets/settings-bold.png";
|
|
|
|
|
+import web from "assets/web-bold.png";
|
|
|
|
|
+import addOns from "assets/add-ons-bold.png";
|
|
|
|
|
|
|
|
import { Context } from "shared/Context";
|
|
import { Context } from "shared/Context";
|
|
|
|
|
|
|
@@ -103,7 +105,7 @@ class Sidebar extends Component<PropsType, StateType> {
|
|
|
renderProjectContents = () => {
|
|
renderProjectContents = () => {
|
|
|
let { currentView } = this.props;
|
|
let { currentView } = this.props;
|
|
|
let { currentProject, user, currentCluster, hasFinishedOnboarding } = this.context;
|
|
let { currentProject, user, currentCluster, hasFinishedOnboarding } = this.context;
|
|
|
- if (currentProject) {
|
|
|
|
|
|
|
+ if (!currentProject?.simplified_view_enabled) {
|
|
|
return (
|
|
return (
|
|
|
<ScrollWrapper>
|
|
<ScrollWrapper>
|
|
|
<SidebarLabel>Home</SidebarLabel>
|
|
<SidebarLabel>Home</SidebarLabel>
|
|
@@ -141,7 +143,7 @@ class Sidebar extends Component<PropsType, StateType> {
|
|
|
"delete",
|
|
"delete",
|
|
|
]) && (
|
|
]) && (
|
|
|
<NavButton path={"/project-settings"}>
|
|
<NavButton path={"/project-settings"}>
|
|
|
- <Img enlarge={true} src={settings} />
|
|
|
|
|
|
|
+ <Img src={settings} />
|
|
|
Project settings
|
|
Project settings
|
|
|
</NavButton>
|
|
</NavButton>
|
|
|
)}
|
|
)}
|
|
@@ -149,7 +151,7 @@ class Sidebar extends Component<PropsType, StateType> {
|
|
|
<br />
|
|
<br />
|
|
|
|
|
|
|
|
<SidebarLabel>
|
|
<SidebarLabel>
|
|
|
- {currentProject.capi_provisioner_enabled ? (
|
|
|
|
|
|
|
+ {currentProject?.capi_provisioner_enabled ? (
|
|
|
"Your team"
|
|
"Your team"
|
|
|
) : (
|
|
) : (
|
|
|
"Clusters"
|
|
"Clusters"
|
|
@@ -164,6 +166,56 @@ class Sidebar extends Component<PropsType, StateType> {
|
|
|
/>
|
|
/>
|
|
|
</ScrollWrapper>
|
|
</ScrollWrapper>
|
|
|
);
|
|
);
|
|
|
|
|
+ } else if (currentProject.simplified_view_enabled) {
|
|
|
|
|
+ return (
|
|
|
|
|
+ <ScrollWrapper>
|
|
|
|
|
+ <NavButton
|
|
|
|
|
+ path="/apps"
|
|
|
|
|
+ active={window.location.pathname.startsWith("/apps")}
|
|
|
|
|
+ >
|
|
|
|
|
+ <Img src={web} />
|
|
|
|
|
+ Applications
|
|
|
|
|
+ </NavButton>
|
|
|
|
|
+ <NavButton
|
|
|
|
|
+ path="/addons"
|
|
|
|
|
+ active={window.location.pathname.startsWith("/addons")}
|
|
|
|
|
+ >
|
|
|
|
|
+ <Img src={addOns} />
|
|
|
|
|
+ Add-ons
|
|
|
|
|
+ </NavButton>
|
|
|
|
|
+ {this.props.isAuthorized("integrations", "", [
|
|
|
|
|
+ "get",
|
|
|
|
|
+ "create",
|
|
|
|
|
+ "update",
|
|
|
|
|
+ "delete",
|
|
|
|
|
+ ]) && (
|
|
|
|
|
+ <NavButton path={"/integrations"}>
|
|
|
|
|
+ <Img src={integrations} />
|
|
|
|
|
+ Integrations
|
|
|
|
|
+ </NavButton>
|
|
|
|
|
+ )}
|
|
|
|
|
+ {this.props.isAuthorized("settings", "", [
|
|
|
|
|
+ "get",
|
|
|
|
|
+ "update",
|
|
|
|
|
+ "delete",
|
|
|
|
|
+ ]) && (
|
|
|
|
|
+ <NavButton path={"/project-settings"}>
|
|
|
|
|
+ <Img src={settings} />
|
|
|
|
|
+ Project settings
|
|
|
|
|
+ </NavButton>
|
|
|
|
|
+ )}
|
|
|
|
|
+
|
|
|
|
|
+ {/* Hacky workaround for setting currentCluster with legacy method */}
|
|
|
|
|
+ <Clusters
|
|
|
|
|
+ display="none"
|
|
|
|
|
+ setWelcome={this.props.setWelcome}
|
|
|
|
|
+ currentView={currentView}
|
|
|
|
|
+ isSelected={false}
|
|
|
|
|
+ forceRefreshClusters={this.props.forceRefreshClusters}
|
|
|
|
|
+ setRefreshClusters={this.props.setRefreshClusters}
|
|
|
|
|
+ />
|
|
|
|
|
+ </ScrollWrapper>
|
|
|
|
|
+ );
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Render placeholder if no project exists
|
|
// Render placeholder if no project exists
|
|
@@ -245,6 +297,12 @@ const NavButton = styled(SidebarLink)`
|
|
|
cursor: ${(props: { disabled?: boolean }) =>
|
|
cursor: ${(props: { disabled?: boolean }) =>
|
|
|
props.disabled ? "not-allowed" : "pointer"};
|
|
props.disabled ? "not-allowed" : "pointer"};
|
|
|
|
|
|
|
|
|
|
+ background: ${(props: any) => (props.active ? "#ffffff11" : "")};
|
|
|
|
|
+
|
|
|
|
|
+ :hover {
|
|
|
|
|
+ background: ${(props: any) => (props.active ? "#ffffff11" : "#ffffff08")};
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
&.active {
|
|
&.active {
|
|
|
background: #ffffff11;
|
|
background: #ffffff11;
|
|
|
|
|
|
|
@@ -268,7 +326,6 @@ const NavButton = styled(SidebarLink)`
|
|
|
const Img = styled.img<{ enlarge?: boolean }>`
|
|
const Img = styled.img<{ enlarge?: boolean }>`
|
|
|
padding: ${(props) => (props.enlarge ? "0 0 0 1px" : "4px")};
|
|
padding: ${(props) => (props.enlarge ? "0 0 0 1px" : "4px")};
|
|
|
height: 22px;
|
|
height: 22px;
|
|
|
- width: 22px;
|
|
|
|
|
padding-top: 4px;
|
|
padding-top: 4px;
|
|
|
border-radius: 3px;
|
|
border-radius: 3px;
|
|
|
margin-right: 8px;
|
|
margin-right: 8px;
|