Skip to content

Commit 6df93ee

Browse files
Feat improve env zero page 5254 (#5275)
* feat: Implement Zero Page for Envirnoment with proper css Signed-off-by: Kunal Singh Dadhwal <[email protected]> * Lint Error fix in EnvirnomentList file Signed-off-by: Kunal Singh Dadhwal <[email protected]> * Delete chaoscenter/web/.yarn/install-state.gz Signed-off-by: Hug_Bunter <[email protected]> * Delete chaoscenter/web/.yarnrc.yml Signed-off-by: Hug_Bunter <[email protected]> * Revert yarn.lock to match main branch Signed-off-by: Kunal Singh Dadhwal <[email protected]> * Added New Message to the NoEnv Page Signed-off-by: Kunal Singh Dadhwal <[email protected]> --------- Signed-off-by: Kunal Singh Dadhwal <[email protected]> Signed-off-by: Hug_Bunter <[email protected]> Co-authored-by: Pritesh Kiri <[email protected]>
1 parent 70fa179 commit 6df93ee

File tree

5 files changed

+79
-22
lines changed

5 files changed

+79
-22
lines changed

chaoscenter/web/src/strings/strings.en.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -652,6 +652,9 @@ noDataCV: No Data
652652
noDataToDisplay: No data to display
653653
noDescriptionProvided: No description provided
654654
noEnvironmentFound: No Environments found
655+
noEnvironmentFoundNewMessage: >-
656+
An environment represents where you are installing your chaos infrastructure
657+
and acts as an additional level of abstraction for the same.
655658
noEnvironmentFoundMessage: >-
656659
No Environments found in this project, click on 'New Environment' to add
657660
environments.

chaoscenter/web/src/strings/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,7 @@ export interface StringsMap {
549549
'noDescriptionProvided': unknown
550550
'noEnvironmentFound': unknown
551551
'noEnvironmentFoundMessage': unknown
552+
'noEnvironmentFoundNewMessage': unknown
552553
'noExpFound': unknown
553554
'noExperimentFoundMatchingSearch': unknown
554555
'noExperimentSelected': unknown

chaoscenter/web/src/views/Environments/EnvironmentList/EnvironmentsList.module.scss

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,39 @@
110110
.maxWidthFormInput {
111111
max-width: 320px;
112112
}
113+
114+
115+
.noEnvExecution {
116+
width: 100%;
117+
display: flex;
118+
flex-direction: column;
119+
justify-content: center;
120+
align-items: center;
121+
122+
img {
123+
margin-bottom: 20px;
124+
height: 250px;
125+
width: auto;
126+
}
127+
128+
p.title {
129+
width: 60% !important;
130+
text-align: center !important;
131+
font-weight: 600 !important;
132+
font-size: 20px !important;
133+
color: var(--grey-600) !important;
134+
}
135+
136+
p.subtitle {
137+
padding: 10px !important;
138+
text-align: center !important;
139+
width: 70% !important;
140+
font-weight: 400 !important;
141+
font-size: 16px !important;
142+
color: var(--grey-600) !important;
143+
}
144+
145+
.button {
146+
margin-top: 20px;
147+
}
148+
}

chaoscenter/web/src/views/Environments/EnvironmentList/EnvironmentsList.module.scss.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
declare namespace EnvironmentsListModuleScssNamespace {
22
export interface IEnvironmentsListModuleScss {
3+
button: string;
34
card: string;
45
cardContainer: string;
56
content: string;
@@ -12,9 +13,12 @@ declare namespace EnvironmentsListModuleScssNamespace {
1213
loading: string;
1314
maxInputNameId: string;
1415
maxWidthFormInput: string;
16+
noEnvExecution: string;
1517
noEnvHeading: string;
1618
noEnvText: string;
19+
subtitle: string;
1720
thumbnailSelect: string;
21+
title: string;
1822
toolbar: string;
1923
yamlToggleEnv: string;
2024
}

chaoscenter/web/src/views/Environments/EnvironmentList/EnvironmentsList.tsx

Lines changed: 35 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useMemo } from 'react';
2-
import { Layout, TableV2, useToggleOpen, Dialog } from '@harnessio/uicore';
2+
import { Layout, TableV2, useToggleOpen, Dialog, Container, Text } from '@harnessio/uicore';
33
import type { Column, Row } from 'react-table';
44
import { useHistory } from 'react-router-dom';
55
import type { MutationFunction } from '@apollo/client';
@@ -20,6 +20,7 @@ import type {
2020
EnvironmentDetailsTableProps,
2121
RefetchEnvironments
2222
} from '@controllers/Environments/types';
23+
import Envirnoment from '@images/Environment.svg';
2324
import CreateEnvironment from './CreateEnvironment';
2425
import { MenuCell } from './EnvironmentsTableMenu';
2526
import { EnvironmentName, EnvironmentTypes, LastUpdatedBy } from '../EnvironmentsListColumns/EnvironmentsListColumns';
@@ -121,27 +122,39 @@ export default function EnvironmentListView({
121122
</Layout.Horizontal>
122123
}
123124
>
124-
<Loader
125-
loading={loading.listEnvironments}
126-
noData={{
127-
when: () => environmentTableData === null,
128-
messageTitle: getString('noEnvironmentFound'),
129-
message: getString('noEnvironmentFoundMessage')
130-
}}
131-
>
132-
<TableV2<EnvironmentDetails>
133-
columns={envColumns}
134-
sortable
135-
onRowClick={rowDetails =>
136-
rowDetails.environmentID &&
137-
history.push({
138-
pathname: paths.toKubernetesChaosInfrastructures({ environmentID: rowDetails.environmentID })
139-
})
140-
}
141-
data={environmentTableData?.content ?? []}
142-
pagination={environmentTableData?.pagination}
143-
/>
144-
</Loader>
125+
{environmentTableData === null && !loading.listEnvironments ? (
126+
<Container className={css.noEnvExecution} height="calc(100vh - 100px)">
127+
<img src={Envirnoment} alt={getString('environment')} />
128+
<Text className={css.title}>
129+
{getString('noEnvironmentFound')}
130+
</Text>
131+
<Text className={css.subtitle}>
132+
{getString('noEnvironmentFoundNewMessage')}
133+
</Text>
134+
</Container>
135+
) : (
136+
<Loader
137+
loading={loading.listEnvironments}
138+
noData={{
139+
when: () => environmentTableData === null,
140+
messageTitle: getString('noEnvironmentFound'),
141+
message: getString('noEnvironmentFoundMessage')
142+
}}
143+
>
144+
<TableV2<EnvironmentDetails>
145+
columns={envColumns}
146+
sortable
147+
onRowClick={rowDetails =>
148+
rowDetails.environmentID &&
149+
history.push({
150+
pathname: paths.toKubernetesChaosInfrastructures({ environmentID: rowDetails.environmentID })
151+
})
152+
}
153+
data={environmentTableData?.content ?? []}
154+
pagination={environmentTableData?.pagination}
155+
/>
156+
</Loader>
157+
)}
145158
</DefaultLayout>
146159
);
147160
}

0 commit comments

Comments
 (0)