Skip to content

Commit e2f1ed8

Browse files
setting status colors and listing dynamic hard coded clauses
1 parent d1f36ee commit e2f1ed8

File tree

2 files changed

+76
-1
lines changed

2 files changed

+76
-1
lines changed

Clients/src/presentation/pages/ISO/Clause/clause.structure.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,23 @@ export const ISO42001ClauseList = [
1010
{
1111
number: 1,
1212
title: "Understanding the organization and its context",
13+
status: "Not Started",
1314
},
1415
{
1516
number: 2,
1617
title:
1718
"Understanding the needs and expectations of interested parties",
19+
status: "Draft",
1820
},
1921
{
2022
number: 3,
2123
title: "Determining the scope of the AI Management System",
24+
status: "In Review",
2225
},
2326
{
2427
number: 4,
2528
title: "AI Management System",
29+
status: "Approved",
2630
},
2731
],
2832
},
@@ -33,14 +37,17 @@ export const ISO42001ClauseList = [
3337
{
3438
number: 1,
3539
title: "Leadership and commitment",
40+
status: "Implemented",
3641
},
3742
{
3843
number: 2,
3944
title: "Policy",
45+
status: "Needs Rework",
4046
},
4147
{
4248
number: 3,
4349
title: "Organizational roles, responsibilities, and authorities",
50+
status: "Not Started",
4451
},
4552
],
4653
},
@@ -52,10 +59,12 @@ export const ISO42001ClauseList = [
5259
number: 1,
5360
title:
5461
"Actions to address risks and opportunities (Includes Risk Assessment, Treatment, Impact Assessment)",
62+
status: "Draft",
5563
},
5664
{
5765
number: 2,
5866
title: "AI objectives and planning to achieve them",
67+
status: "In Review",
5968
},
6069
],
6170
},
@@ -66,22 +75,27 @@ export const ISO42001ClauseList = [
6675
{
6776
number: 1,
6877
title: "Resources",
78+
status: "Approved",
6979
},
7080
{
7181
number: 2,
7282
title: "Competence",
83+
status: "Implemented",
7384
},
7485
{
7586
number: 3,
7687
title: "Awareness",
88+
status: "Needs Rework",
7789
},
7890
{
7991
number: 4,
8092
title: "Communication",
93+
status: "Not Started",
8194
},
8295
{
8396
number: 5,
8497
title: "Documented information",
98+
status: "Draft",
8599
},
86100
],
87101
},
@@ -92,22 +106,27 @@ export const ISO42001ClauseList = [
92106
{
93107
number: 1,
94108
title: "Operational planning and control",
109+
status: "In Review",
95110
},
96111
{
97112
number: 2,
98113
title: "AI risk assessment (Operational)",
114+
status: "Approved",
99115
},
100116
{
101117
number: 3,
102118
title: "AI risk treatment (Operational)",
119+
status: "Implemented",
103120
},
104121
{
105122
number: 4,
106123
title: "AI System Lifecycle",
124+
status: "Needs Rework",
107125
},
108126
{
109127
number: 5,
110128
title: "Third-party relationships",
129+
status: "Not Started",
111130
},
112131
],
113132
},
@@ -118,14 +137,17 @@ export const ISO42001ClauseList = [
118137
{
119138
number: 1,
120139
title: "Monitoring, measurement, analysis, and evaluation",
140+
status: "Draft",
121141
},
122142
{
123143
number: 2,
124144
title: "Internal audit",
145+
status: "In Review",
125146
},
126147
{
127148
number: 3,
128149
title: "Management review",
150+
status: "Approved",
129151
},
130152
],
131153
},
@@ -136,10 +158,12 @@ export const ISO42001ClauseList = [
136158
{
137159
number: 1,
138160
title: "Nonconformity and corrective action",
161+
status: "Implemented",
139162
},
140163
{
141164
number: 2,
142165
title: "Continual improvement",
166+
status: "Needs Rework",
143167
},
144168
],
145169
},

Clients/src/presentation/pages/ISO/Clause/index.tsx

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,23 @@ const ISO42001Clauses = () => {
1818
setExpanded(isExpanded ? panel : false);
1919
};
2020

21+
function getStatusColor(status: string) {
22+
switch (status) {
23+
case "Not Started":
24+
return "#C63622";
25+
case "Draft":
26+
return "#D68B61";
27+
case "In Review":
28+
return "#D6B971";
29+
case "Approved":
30+
return "#52AB43";
31+
case "Implemented":
32+
return "#B8D39C";
33+
case "Needs Rework":
34+
return "#800080";
35+
}
36+
}
37+
2138
return (
2239
<Stack className="iso-42001-clauses">
2340
{ISO42001ClauseList.map((clause) => (
@@ -74,7 +91,41 @@ const ISO42001Clauses = () => {
7491
{"Clause "} {clause.number} {" : "} {clause.title}
7592
</Typography>
7693
</AccordionSummary>
77-
<AccordionDetails sx={{ padding: 0 }}></AccordionDetails>
94+
<AccordionDetails sx={{ padding: 0 }}>
95+
{clause.subClauses.map((subClause) => (
96+
<Stack
97+
key={subClause.number}
98+
sx={{
99+
display: "flex",
100+
flexDirection: "row",
101+
justifyContent: "space-between",
102+
padding: "16px",
103+
borderBottom:
104+
clause.subClauses.length - 1 ===
105+
clause.subClauses.indexOf(subClause)
106+
? "none"
107+
: "1px solid #eaecf0",
108+
cursor: "pointer",
109+
fontSize: 13,
110+
}}
111+
>
112+
<Typography>
113+
{clause.number + "." + subClause.number}{" "}
114+
{subClause.title}
115+
</Typography>
116+
<Stack
117+
sx={{
118+
borderRadius: "4px",
119+
padding: "5px",
120+
backgroundColor: getStatusColor(subClause.status),
121+
color: "#fff",
122+
}}
123+
>
124+
{subClause.status}
125+
</Stack>
126+
</Stack>
127+
))}
128+
</AccordionDetails>
78129
</Accordion>
79130
</Stack>
80131
))}

0 commit comments

Comments
 (0)