Skip to content

Commit 9471c38

Browse files
committed
Remove measure importance
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
1 parent 78113dc commit 9471c38

24 files changed

+99
-686
lines changed

apps/console/src/pages/organizations/frameworks/controls/Control.tsx

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ const linkedMesuresQuery = graphql`
6565
name
6666
description
6767
category
68-
importance
6968
state
7069
}
7170
}
@@ -88,7 +87,6 @@ const organizationMesuresQuery = graphql`
8887
name
8988
description
9089
category
91-
importance
9290
state
9391
}
9492
}
@@ -721,24 +719,6 @@ export function Control({
721719
setIsPolicyMappingDialogOpen(true);
722720
}, [loadPoliciesData]);
723721

724-
// UI helper functions
725-
const formatImportance = (importance: string | undefined): string => {
726-
if (!importance) return "Unknown";
727-
728-
switch (importance) {
729-
case "LOW":
730-
return "Low";
731-
case "MEDIUM":
732-
return "Medium";
733-
case "HIGH":
734-
return "High";
735-
case "CRITICAL":
736-
return "Critical";
737-
default:
738-
return importance;
739-
}
740-
};
741-
742722
const formatState = (state: string | undefined): string => {
743723
if (!state) return "Unknown";
744724

@@ -756,23 +736,6 @@ export function Control({
756736
}
757737
};
758738

759-
const getImportanceColor = (importance: string | undefined): string => {
760-
if (!importance) return "bg-secondary-bg text-secondary";
761-
762-
switch (importance) {
763-
case "LOW":
764-
return "bg-success-bg text-success";
765-
case "MEDIUM":
766-
return "bg-info-bg text-info";
767-
case "HIGH":
768-
return "bg-warning-bg text-warning";
769-
case "CRITICAL":
770-
return "bg-danger-bg text-danger";
771-
default:
772-
return "bg-secondary-bg text-secondary";
773-
}
774-
};
775-
776739
const getStateColor = (state: string | undefined): string => {
777740
if (!state) return "bg-secondary-bg text-secondary";
778741

@@ -871,9 +834,6 @@ export function Control({
871834
<thead className="sticky top-0 bg-white">
872835
<tr className="border-b text-left text-sm text-secondary bg-invert-bg">
873836
<th className="py-3 px-4 font-medium">Name</th>
874-
<th className="py-3 px-4 font-medium">
875-
Importance
876-
</th>
877837
<th className="py-3 px-4 font-medium">State</th>
878838
<th className="py-3 px-4 font-medium text-right">
879839
Actions
@@ -898,15 +858,6 @@ export function Control({
898858
</div>
899859
)}
900860
</td>
901-
<td className="py-3 px-4">
902-
<div
903-
className={`px-2 py-0.5 rounded-full text-xs ${getImportanceColor(
904-
mesure.importance
905-
)} inline-block`}
906-
>
907-
{formatImportance(mesure.importance)}
908-
</div>
909-
</td>
910861
<td className="py-3 px-4">
911862
<div
912863
className={`px-2 py-0.5 rounded-full text-xs ${getStateColor(
@@ -1000,7 +951,6 @@ export function Control({
1000951
<thead>
1001952
<tr className="border-b text-left text-sm text-secondary bg-invert-bg">
1002953
<th className="py-3 px-4 font-medium">Name</th>
1003-
<th className="py-3 px-4 font-medium">Importance</th>
1004954
<th className="py-3 px-4 font-medium">State</th>
1005955
<th className="py-3 px-4 font-medium text-right">
1006956
Actions
@@ -1021,15 +971,6 @@ export function Control({
1021971
</div>
1022972
)}
1023973
</td>
1024-
<td className="py-3 px-4">
1025-
<div
1026-
className={`px-2 py-0.5 rounded-full text-xs ${getImportanceColor(
1027-
mesure.importance
1028-
)} inline-block`}
1029-
>
1030-
{formatImportance(mesure.importance)}
1031-
</div>
1032-
</td>
1033974
<td className="py-3 px-4">
1034975
<div
1035976
className={`px-2 py-0.5 rounded-full text-xs ${getStateColor(

apps/console/src/pages/organizations/frameworks/controls/__generated__/ControlLinkedMesuresQuery.graphql.ts

Lines changed: 4 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/console/src/pages/organizations/frameworks/controls/__generated__/ControlOrganizationMesuresQuery.graphql.ts

Lines changed: 4 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/console/src/pages/organizations/mesures/EditMesureView.tsx

Lines changed: 2 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ const editMesureQuery = graphql`
2626
name
2727
description
2828
category
29-
importance
3029
}
3130
}
3231
}
@@ -59,8 +58,7 @@ function EditMesureViewContent({
5958
const [formData, setFormData] = useState({
6059
name: mesure.name ?? "",
6160
description: mesure.description ?? "",
62-
category: mesure.category ?? "",
63-
importance: mesure.importance,
61+
category: mesure.category ?? ""
6462
});
6563

6664
const [commit, isInFlight] =
@@ -91,8 +89,7 @@ function EditMesureViewContent({
9189
id: mesureId!,
9290
name: formData.name,
9391
description: formData.description,
94-
category: formData.category,
95-
importance: formData.importance,
92+
category: formData.category
9693
},
9794
},
9895
onCompleted(data, errors) {
@@ -152,52 +149,6 @@ function EditMesureViewContent({
152149
required
153150
/>
154151

155-
<div className="space-y-4">
156-
<div className="space-y-2">
157-
<div className="flex items-center gap-2">
158-
<Label className="text-sm">Importance</Label>
159-
</div>
160-
<div className="flex gap-2">
161-
<button
162-
type="button"
163-
onClick={() => handleFieldChange("importance", "MANDATORY")}
164-
className={cn(
165-
"rounded-full cursor-pointer px-4 py-1 text-sm transition-colors",
166-
formData.importance === "MANDATORY"
167-
? "bg-danger-bg text-danger ring ring-danger-b"
168-
: "bg-invert-bg hover:bg-h-invert-bg"
169-
)}
170-
>
171-
Mandatory
172-
</button>
173-
<button
174-
type="button"
175-
onClick={() => handleFieldChange("importance", "PREFERRED")}
176-
className={cn(
177-
"rounded-full cursor-pointer px-4 py-1 text-sm transition-colors",
178-
formData.importance === "PREFERRED"
179-
? "bg-warning-bg text-warning ring ring-warning-b"
180-
: "bg-invert-bg hover:bg-h-invert-bg"
181-
)}
182-
>
183-
Preferred
184-
</button>
185-
<button
186-
type="button"
187-
onClick={() => handleFieldChange("importance", "ADVANCED")}
188-
className={cn(
189-
"rounded-full cursor-pointer px-4 py-1 text-sm transition-colors",
190-
formData.importance === "ADVANCED"
191-
? "bg-info-bg text-info ring ring-info-b"
192-
: "bg-invert-bg hover:bg-h-invert-bg"
193-
)}
194-
>
195-
Advanced
196-
</button>
197-
</div>
198-
</div>
199-
</div>
200-
201152
<div className="flex justify-end gap-3">
202153
<Button
203154
type="button"

apps/console/src/pages/organizations/mesures/MesureListView.tsx

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ const mesureListViewQuery = graphql`
5151
description
5252
category
5353
state
54-
importance
5554
createdAt
5655
updatedAt
5756
}
@@ -75,7 +74,6 @@ const importMesureMutation = graphql`
7574
description
7675
category
7776
state
78-
importance
7977
createdAt
8078
updatedAt
8179
}
@@ -90,7 +88,6 @@ interface Mesure {
9088
description?: string;
9189
state?: string;
9290
category?: string;
93-
importance?: string;
9491
status?: string;
9592
createdAt?: string;
9693
updatedAt?: string;
@@ -522,9 +519,6 @@ function MesureListContent({
522519
<table className="w-full">
523520
<thead>
524521
<tr className="bg-subtle-bg/30 text-sm font-medium text-tertiary">
525-
<th className="w-24 px-4 py-2 text-left">
526-
Importance
527-
</th>
528522
<th className="w-24 px-4 py-2 text-left">
529523
Status
530524
</th>
@@ -537,11 +531,6 @@ function MesureListContent({
537531
key={mesure.id || Math.random().toString()}
538532
className="hover:bg-h-subtle-bg cursor-pointer"
539533
>
540-
<td className="w-24 px-4 py-3 align-middle">
541-
<Badge variant="outline" className="text-xs">
542-
{mesure.importance}
543-
</Badge>
544-
</td>
545534
<td className="w-24 px-4 py-3 align-middle">
546535
<div className="flex items-center justify-center">
547536
{mesure.status
@@ -593,12 +582,6 @@ function MesureListContent({
593582
<h4 className="font-bold text-md">
594583
{mesure.name}
595584
</h4>
596-
<Badge
597-
variant="outline"
598-
className="text-xs"
599-
>
600-
{mesure.importance}
601-
</Badge>
602585
</div>
603586

604587
{mesure.description && (

0 commit comments

Comments
 (0)