|
|
@@ -8,6 +8,7 @@ import ButtonEnablePREnvironments from "../components/ButtonEnablePREnvironments
|
|
|
import { PreviewEnvironmentsHeader } from "../components/PreviewEnvironmentsHeader";
|
|
|
import { Environment } from "../types";
|
|
|
import EnvironmentCard from "./EnvironmentCard";
|
|
|
+import Placeholder from "components/Placeholder";
|
|
|
|
|
|
const EnvironmentsList = () => {
|
|
|
const { currentCluster, currentProject } = useContext(Context);
|
|
|
@@ -56,7 +57,33 @@ const EnvironmentsList = () => {
|
|
|
|
|
|
setEnvironments(envs);
|
|
|
} catch (error) {
|
|
|
- setEnvironments([]);
|
|
|
+ // ret2: remove placeholder (set to empty array)
|
|
|
+ setEnvironments([
|
|
|
+ {
|
|
|
+ id: 12,
|
|
|
+ project_id: 1234,
|
|
|
+ cluster_id: 4321,
|
|
|
+ git_installation_id: 55,
|
|
|
+ name: "asdf",
|
|
|
+ git_repo_owner: "owned",
|
|
|
+ git_repo_name: "this-is-a-repo",
|
|
|
+ last_deployment_status: "failed",
|
|
|
+ deployment_count: 12,
|
|
|
+ mode: "manual",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: 13,
|
|
|
+ project_id: 1234,
|
|
|
+ cluster_id: 4321,
|
|
|
+ git_installation_id: 55,
|
|
|
+ name: "asdf",
|
|
|
+ git_repo_owner: "owned",
|
|
|
+ git_repo_name: "this-is-a-repo",
|
|
|
+ last_deployment_status: "failed",
|
|
|
+ deployment_count: 12,
|
|
|
+ mode: "manual",
|
|
|
+ },
|
|
|
+ ]);
|
|
|
}
|
|
|
};
|
|
|
|
|
|
@@ -80,18 +107,12 @@ const EnvironmentsList = () => {
|
|
|
<>
|
|
|
<PreviewEnvironmentsHeader />
|
|
|
<Relative>
|
|
|
- {isLoading || !buttonIsReady ? (
|
|
|
- <FloatingPlaceholder>
|
|
|
- <Loading />
|
|
|
- </FloatingPlaceholder>
|
|
|
- ) : null}
|
|
|
-
|
|
|
<ControlRow>
|
|
|
<ButtonEnablePREnvironments setIsReady={setButtonIsReady} />
|
|
|
</ControlRow>
|
|
|
{environments.length === 0 ? (
|
|
|
- <Placeholder>
|
|
|
- No repositories found with Preview Environments enabled.
|
|
|
+ <Placeholder title="No repositories found" height="calc(100vh - 400px)">
|
|
|
+ No repositories were found with Preview Environments enabled.
|
|
|
</Placeholder>
|
|
|
) : (
|
|
|
<EnvironmentsGrid>
|
|
|
@@ -115,40 +136,10 @@ const Relative = styled.div`
|
|
|
position: relative;
|
|
|
`;
|
|
|
|
|
|
-const Placeholder = styled.div`
|
|
|
- padding: 30px;
|
|
|
- margin-top: 35px;
|
|
|
- padding-bottom: 40px;
|
|
|
- font-size: 13px;
|
|
|
- color: #ffffff44;
|
|
|
- min-height: 400px;
|
|
|
- height: 50vh;
|
|
|
- background: #ffffff11;
|
|
|
- border-radius: 8px;
|
|
|
- width: 100%;
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- justify-content: center;
|
|
|
- flex-direction: column;
|
|
|
-
|
|
|
- > i {
|
|
|
- font-size: 18px;
|
|
|
- margin-right: 8px;
|
|
|
- }
|
|
|
-`;
|
|
|
-
|
|
|
-const FloatingPlaceholder = styled(Placeholder)`
|
|
|
- position: absolute;
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
- margin-top: 0px;
|
|
|
-`;
|
|
|
-
|
|
|
const EnvironmentsGrid = styled.div`
|
|
|
- margin-top: 32px;
|
|
|
padding-bottom: 150px;
|
|
|
display: grid;
|
|
|
- grid-row-gap: 25px;
|
|
|
+ grid-row-gap: 15px;
|
|
|
`;
|
|
|
|
|
|
const ControlRow = styled.div`
|
|
|
@@ -156,7 +147,7 @@ const ControlRow = styled.div`
|
|
|
margin-left: auto;
|
|
|
justify-content: space-between;
|
|
|
align-items: center;
|
|
|
- margin: 35px 0;
|
|
|
+ margin: 35px 0 30px;
|
|
|
padding-left: 0px;
|
|
|
`;
|
|
|
|