|
|
@@ -3,6 +3,7 @@ import Placeholder from "components/Placeholder";
|
|
|
import TabSelector from "components/TabSelector";
|
|
|
import TitleSection from "components/TitleSection";
|
|
|
import React, { useContext, useEffect, useState } from "react";
|
|
|
+import backArrow from "assets/back_arrow.png";
|
|
|
import { useParams } from "react-router";
|
|
|
import api from "shared/api";
|
|
|
import { Context } from "shared/Context";
|
|
|
@@ -26,6 +27,7 @@ import { FullStackRevision, Stack, StackRevision } from "../types";
|
|
|
import EnvGroups from "./components/EnvGroups";
|
|
|
import RevisionList from "./_RevisionList";
|
|
|
import SourceConfig from "./_SourceConfig";
|
|
|
+import { NavLink } from "react-router-dom";
|
|
|
|
|
|
const ExpandedStack = () => {
|
|
|
const { namespace, stack_id } = useParams<{
|
|
|
@@ -82,10 +84,12 @@ const ExpandedStack = () => {
|
|
|
return (
|
|
|
<div>
|
|
|
<StackTitleWrapper>
|
|
|
+ <BackButton to="/stacks">
|
|
|
+ <BackButtonImg src={backArrow} />
|
|
|
+ </BackButton>
|
|
|
<TitleSection
|
|
|
materialIconClass="material-icons-outlined"
|
|
|
icon={"lan"}
|
|
|
- capitalize
|
|
|
>
|
|
|
{stack.name}
|
|
|
</TitleSection>
|
|
|
@@ -94,16 +98,22 @@ const ExpandedStack = () => {
|
|
|
<NamespaceTag.Tag>{stack.namespace}</NamespaceTag.Tag>
|
|
|
</NamespaceTag.Wrapper>
|
|
|
</StackTitleWrapper>
|
|
|
- <RevisionList
|
|
|
- revisions={stack.revisions}
|
|
|
- currentRevision={currentRevision}
|
|
|
- latestRevision={stack.latest_revision}
|
|
|
- stackId={stack.id}
|
|
|
- stackNamespace={namespace}
|
|
|
- onRevisionClick={(revision) => setCurrentRevision(revision)}
|
|
|
- onRollback={() => getStack()}
|
|
|
- ></RevisionList>
|
|
|
- <Br />
|
|
|
+
|
|
|
+ {/* Stack error message */}
|
|
|
+ {currentRevision &&
|
|
|
+ currentRevision?.reason &&
|
|
|
+ currentRevision?.message?.length > 0 ? (
|
|
|
+ <StackErrorMessageStyles.Wrapper>
|
|
|
+ <i className="material-icons">history</i>
|
|
|
+ <StackErrorMessageStyles.Text color="#aaaabb">
|
|
|
+ {currentRevision?.status === "failed" ? "Error: " : ""}
|
|
|
+ {currentRevision?.message}
|
|
|
+ </StackErrorMessageStyles.Text>
|
|
|
+ </StackErrorMessageStyles.Wrapper>
|
|
|
+ ) : null
|
|
|
+ }
|
|
|
+
|
|
|
+ <Break />
|
|
|
<InfoWrapper>
|
|
|
<LastDeployed>
|
|
|
<Status
|
|
|
@@ -111,31 +121,20 @@ const ExpandedStack = () => {
|
|
|
message={getStackStatusMessage(stack)}
|
|
|
/>
|
|
|
<SepDot>•</SepDot>
|
|
|
- <Text color="#aaaabb">
|
|
|
- {!stack.latest_revision?.id
|
|
|
- ? `No version found`
|
|
|
- : `v${stack.latest_revision.id}`}
|
|
|
- </Text>
|
|
|
- <SepDot>•</SepDot>
|
|
|
Last updated {readableDate(stack.updated_at)}
|
|
|
</LastDeployed>
|
|
|
</InfoWrapper>
|
|
|
|
|
|
- {/* Stack error message */}
|
|
|
- {currentRevision &&
|
|
|
- currentRevision?.reason &&
|
|
|
- currentRevision?.message?.length > 0 ? (
|
|
|
- <StackErrorMessageStyles.Wrapper>
|
|
|
- <StackErrorMessageStyles.Title color="#b7b7c9">
|
|
|
- Revision message:
|
|
|
- </StackErrorMessageStyles.Title>
|
|
|
- <StackErrorMessageStyles.Text color="#aaaabb">
|
|
|
- {currentRevision?.status === "failed" ? "Error: " : ""}
|
|
|
- {currentRevision?.message}
|
|
|
- </StackErrorMessageStyles.Text>
|
|
|
- </StackErrorMessageStyles.Wrapper>
|
|
|
- ) : null}
|
|
|
-
|
|
|
+ <RevisionList
|
|
|
+ revisions={stack.revisions}
|
|
|
+ currentRevision={currentRevision}
|
|
|
+ latestRevision={stack.latest_revision}
|
|
|
+ stackId={stack.id}
|
|
|
+ stackNamespace={namespace}
|
|
|
+ onRevisionClick={(revision) => setCurrentRevision(revision)}
|
|
|
+ onRollback={() => getStack()}
|
|
|
+ ></RevisionList>
|
|
|
+ <Br />
|
|
|
<TabSelector
|
|
|
currentTab={currentTab}
|
|
|
options={[
|
|
|
@@ -148,32 +147,24 @@ const ExpandedStack = () => {
|
|
|
{currentRevision.id !== stack.latest_revision.id ? (
|
|
|
<ChartListWrapper>
|
|
|
<Placeholder>
|
|
|
- Not available when previewing versions
|
|
|
+ Not available when previewing revisions
|
|
|
</Placeholder>
|
|
|
</ChartListWrapper>
|
|
|
) : (
|
|
|
- <>
|
|
|
- <SortSelector
|
|
|
- setSortType={setSortType}
|
|
|
- sortType={sortType}
|
|
|
+ <ChartListWrapper>
|
|
|
+ <ChartList
|
|
|
+ currentCluster={currentCluster}
|
|
|
currentView="stacks"
|
|
|
+ namespace={namespace}
|
|
|
+ sortType="Alphabetical"
|
|
|
+ appFilters={
|
|
|
+ stack?.latest_revision?.resources?.map(
|
|
|
+ (res) => res.name
|
|
|
+ ) || []
|
|
|
+ }
|
|
|
+ closeChartRedirectUrl={`${window.location.pathname}${window.location.search}`}
|
|
|
/>
|
|
|
-
|
|
|
- <ChartListWrapper>
|
|
|
- <ChartList
|
|
|
- currentCluster={currentCluster}
|
|
|
- currentView="stacks"
|
|
|
- namespace={namespace}
|
|
|
- sortType="Alphabetical"
|
|
|
- appFilters={
|
|
|
- stack?.latest_revision?.resources?.map(
|
|
|
- (res) => res.name
|
|
|
- ) || []
|
|
|
- }
|
|
|
- closeChartRedirectUrl={`${window.location.pathname}${window.location.search}`}
|
|
|
- />
|
|
|
- </ChartListWrapper>
|
|
|
- </>
|
|
|
+ </ChartListWrapper>
|
|
|
)}
|
|
|
</>
|
|
|
),
|
|
|
@@ -193,7 +184,7 @@ const ExpandedStack = () => {
|
|
|
),
|
|
|
},
|
|
|
{
|
|
|
- label: "Env groups",
|
|
|
+ label: "Env Groups",
|
|
|
value: "env_groups",
|
|
|
component: (
|
|
|
<>
|
|
|
@@ -207,16 +198,53 @@ const ExpandedStack = () => {
|
|
|
setCurrentTab(tab);
|
|
|
}}
|
|
|
></TabSelector>
|
|
|
+ <PaddingBottom />
|
|
|
</div>
|
|
|
);
|
|
|
};
|
|
|
|
|
|
export default ExpandedStack;
|
|
|
|
|
|
+const PaddingBottom = styled.div`
|
|
|
+ width: 100%;
|
|
|
+ height: 150px;
|
|
|
+`;
|
|
|
+
|
|
|
+const Break = styled.div`
|
|
|
+ width: 100%;
|
|
|
+ height: 20px;
|
|
|
+`;
|
|
|
+
|
|
|
+const BackButton = styled(NavLink)`
|
|
|
+ position: absolute;
|
|
|
+ top: 0px;
|
|
|
+ right: 0px;
|
|
|
+ display: flex;
|
|
|
+ width: 36px;
|
|
|
+ cursor: pointer;
|
|
|
+ height: 36px;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ border: 1px solid #ffffff55;
|
|
|
+ border-radius: 100px;
|
|
|
+ background: #ffffff11;
|
|
|
+
|
|
|
+ :hover {
|
|
|
+ background: #ffffff22;
|
|
|
+ > img {
|
|
|
+ opacity: 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+`;
|
|
|
+
|
|
|
+const BackButtonImg = styled.img`
|
|
|
+ width: 16px;
|
|
|
+ opacity: 0.75;
|
|
|
+`;
|
|
|
+
|
|
|
const ChartListWrapper = styled.div`
|
|
|
width: 100%;
|
|
|
margin: auto;
|
|
|
- margin-top: 20px;
|
|
|
padding-bottom: 125px;
|
|
|
`;
|
|
|
|
|
|
@@ -228,13 +256,18 @@ const Gap = styled.div`
|
|
|
|
|
|
const StackErrorMessageStyles = {
|
|
|
Text: styled(Text)`
|
|
|
- font-size: 14px;
|
|
|
- margin-bottom: 10px;
|
|
|
+ font-size: 13px;
|
|
|
`,
|
|
|
Wrapper: styled.div`
|
|
|
display: flex;
|
|
|
- flex-direction: column;
|
|
|
+ align-items: center;
|
|
|
+
|
|
|
margin-top: 5px;
|
|
|
+ > i {
|
|
|
+ color: #ffffff44;
|
|
|
+ margin-right: 8px;
|
|
|
+ font-size: 20px;
|
|
|
+ }
|
|
|
`,
|
|
|
Title: styled(Text)`
|
|
|
font-size: 16px;
|
|
|
@@ -245,11 +278,12 @@ const StackErrorMessageStyles = {
|
|
|
const StackTitleWrapper = styled.div`
|
|
|
width: 100%;
|
|
|
display: flex;
|
|
|
- justify-content: space-between;
|
|
|
+ position: relative;
|
|
|
align-items: center;
|
|
|
|
|
|
// Hotfix to make sure the title section and the namespace tag are aligned
|
|
|
${NamespaceTag.Wrapper} {
|
|
|
- margin-bottom: 15px;
|
|
|
+ margin-left: 17px;
|
|
|
+ margin-bottom: 13px;
|
|
|
}
|
|
|
`;
|