Skip to content

Commit a9e2184

Browse files
Remove Compliance wording messages from GRC UI pages (stolostron#3651)
Ref: https://issues.redhat.com/browse/ACM-11787 Signed-off-by: yiraeChristineKim <yikim@redhat.com>
1 parent fa655a5 commit a9e2184

File tree

8 files changed

+19
-21
lines changed

8 files changed

+19
-21
lines changed

frontend/public/locales/en/translation.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@
328328
"A placement selects clusters from the cluster sets which have bindings to the resource namespace.": "A placement selects clusters from the cluster sets which have bindings to the resource namespace.",
329329
"A placement without any label selectors or label expressions will select all clusters.": "A placement without any label selectors or label expressions will select all clusters.",
330330
"A policy contains policy templates that create policies on managed clusters.": "A policy contains policy templates that create policies on managed clusters.",
331-
"A policy generates reports and validates cluster compliance based on specified security standards, categories, and controls.": "A policy generates reports and validates cluster compliance based on specified security standards, categories, and controls.",
331+
"A policy generates reports and validates cluster violations based on specified security standards, categories, and controls.": "A policy generates reports and validates cluster violations based on specified security standards, categories, and controls.",
332332
"A project organizes all of your Google Cloud resources. A project consists of a set of users; a set of APIs; and billing, authentication, and monitoring settings for those APIs. So, for example, all of your Cloud Storage buckets and objects, along with user permissions for accessing them, reside in a project.": "A project organizes all of your Google Cloud resources. A project consists of a set of users; a set of APIs; and billing, authentication, and monitoring settings for those APIs. So, for example, all of your Cloud Storage buckets and objects, along with user permissions for accessing them, reside in a project.",
333333
"A proxy URL to use for creating HTTP connections outside the cluster. The URL scheme must be HTTP.": "A proxy URL to use for creating HTTP connections outside the cluster. The URL scheme must be HTTP.",
334334
"A proxy URL to use for creating HTTPS connections outside the cluster. If this is not specified, then httpProxy is used for both HTTP and HTTPS connections.": "A proxy URL to use for creating HTTPS connections outside the cluster. If this is not specified, then httpProxy is used for both HTTP and HTTPS connections.",
@@ -659,7 +659,6 @@
659659
"Cluster 2": "Cluster 2",
660660
"Cluster add-ons": "Cluster add-ons",
661661
"Cluster claim expressions": "Cluster claim expressions",
662-
"Cluster compliance": "Cluster compliance",
663662
"Cluster Conditions": "Cluster Conditions",
664663
"Cluster decision resource requeue time in seconds": "Cluster decision resource requeue time in seconds",
665664
"Cluster deploy status": "Cluster deploy status",
@@ -763,7 +762,6 @@
763762
"Compare application types": "Compare application types",
764763
"Compare control plane types": "Compare control plane types",
765764
"Completions": "Completions",
766-
"Compliant": "Compliant",
767765
"components": "components",
768766
"Compute core": "Compute core",
769767
"Compute memory": "Compute memory",

frontend/src/routes/Governance/policies/Policies.test.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ describe('Policies Page', () => {
6161
await waitForText(mockPolicy[0].metadata.name!)
6262

6363
// Sorting
64-
screen.getByRole('button', { name: 'Cluster compliance' }).click()
64+
screen.getByRole('button', { name: 'Cluster violations' }).click()
6565
screen.getByRole('button', { name: 'Namespace' }).click()
6666
screen.getByRole('button', { name: 'Name' }).click()
6767

@@ -89,7 +89,7 @@ describe('Policies Page', () => {
8989
await waitForText('Name')
9090
await waitForText('Namespace')
9191
await waitForText('Remediation')
92-
await waitForText('Cluster compliance')
92+
await waitForText('Cluster violations')
9393
await waitForText('Source')
9494
await waitForText('Policy set')
9595
expect(screen.queryByRole('columnheader', { name: /Status/ })).not.toBeInTheDocument()
@@ -230,7 +230,7 @@ describe('Policies Page', () => {
230230
'/multicloud/governance/policy-sets?search%3D%7B%22name%22%3A%5B%22policy-set-with-1-placement%22%5D%2C%22namespace%22%3A%5B%22test%22%5D%7D'
231231
)
232232
)
233-
// Verify the Cluster compliance column has the correct link to policy details page
233+
// Verify the Cluster violations column has the correct link to policy details page
234234
await waitFor(() =>
235235
// need to use index [1] because the name column is also an "a" element
236236
expect(container.querySelectorAll('a')[2]).toHaveAttribute(

frontend/src/routes/Governance/policies/Policies.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ export default function PoliciesPage() {
531531
() => [
532532
{
533533
id: 'violations',
534-
label: 'Cluster compliance',
534+
label: 'Cluster violations',
535535
options: [
536536
{
537537
label: t('Without violations'),
@@ -772,7 +772,7 @@ function usePolicyViolationsColumn(
772772
): IAcmTableColumn<PolicyTableItem> {
773773
const { t } = useTranslation()
774774
return {
775-
header: t('Cluster compliance'),
775+
header: t('Cluster violations'),
776776
cell: (item) => {
777777
const clusterViolationSummary = policyClusterViolationSummaryMap[item.policy.metadata.uid ?? '']
778778
if (

frontend/src/routes/Governance/policies/policy-details/PolicyTemplateDetails.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export function PolicyTemplateDetails(
120120
value: template?.apiVersion ?? '-',
121121
},
122122
{
123-
key: t('Compliant'),
123+
key: t('Violations'),
124124
value: template?.status?.compliant ?? '-',
125125
},
126126
{
@@ -156,7 +156,7 @@ export function PolicyTemplateDetails(
156156
search: 'object.apiVersion',
157157
},
158158
{
159-
header: t('Compliant'),
159+
header: t('Violations'),
160160
sort: (a: any, b: any) => compareStrings(a.compliant, b.compliant),
161161
cell: (item: any) => {
162162
let compliant = item.compliant ?? '-'

frontend/src/routes/Home/Overview/OverviewPage.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1183,7 +1183,7 @@ it('should render overview page with expected data', async () => {
11831183
await waitFor(() => expect(getAllByText('Amazon')).toHaveLength(1))
11841184
await waitFor(() => expect(getAllByText('Microsoft')).toHaveLength(1))
11851185

1186-
// Check Cluster compliance chart rendered
1186+
// Check Cluster violations chart rendered
11871187
await waitFor(() => expect(getAllByText('Cluster violations')).toHaveLength(2))
11881188
await waitFor(() => expect(getByText('1 Without violations')).toBeTruthy())
11891189
await waitFor(() => expect(getByText('1 With violations')).toBeTruthy())

frontend/src/ui-components/AcmCharts/AcmDonutChart/AcmDonutChart.stories.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export const DonutChart = () => {
4848
<BrowserRouter>
4949
<AcmChartGroup>
5050
<AcmDonutChart
51-
title="Cluster compliance"
51+
title="Cluster violations"
5252
description="Overview of policy compliance status"
5353
data={complianceData}
5454
/>
@@ -72,7 +72,7 @@ export const DonutChart = () => {
7272
export const DonutChartSkeleton = () => {
7373
return (
7474
<AcmChartGroup>
75-
<AcmDonutChart loading={true} title="Cluster compliance" description="Policy compliance" data={[]} />
75+
<AcmDonutChart loading={true} title="Cluster violations" description="Policy compliance" data={[]} />
7676
<AcmDonutChart loading={true} title="Pods" description="Overview of pod count and status" data={[]} />
7777
<AcmDonutChart loading={true} title="Cluster status" description="Overview of cluster status" data={[]} />
7878
</AcmChartGroup>

frontend/src/ui-components/AcmCharts/AcmDonutChart/AcmDonutChart.test.tsx

+7-7
Original file line numberDiff line numberDiff line change
@@ -21,26 +21,26 @@ const podData = [
2121

2222
describe('AcmDonutChart', () => {
2323
test('renders', () => {
24-
const { getByRole, getByTestId } = render(
24+
const { queryAllByText } = render(
2525
<MemoryRouter>
2626
<AcmDonutChart
27-
title="Cluster compliance"
28-
description="Overview of policy compliance status"
27+
title="Cluster violations"
28+
description="Overview of policy violations status"
2929
data={complianceData}
3030
/>
3131
</MemoryRouter>
3232
)
33-
expect(getByTestId('cluster-compliance-chart')).toBeInTheDocument()
34-
expect(getByRole('link')).toBeInTheDocument()
33+
34+
expect(queryAllByText('Cluster violations').length).toBeGreaterThan(0)
3535
})
3636

3737
test('renders skeleton', () => {
3838
const { queryByText } = render(
3939
<MemoryRouter>
40-
<AcmDonutChart loading={true} title="Cluster compliance" description="Policy compliance" data={[]} />
40+
<AcmDonutChart loading={true} title="Cluster violations" description="Policy violations" data={[]} />
4141
</MemoryRouter>
4242
)
43-
expect(queryByText('Cluster compliance')).toBeInTheDocument()
43+
expect(queryByText('Cluster violations')).toBeInTheDocument()
4444
})
4545

4646
test('renders with zero values state', () => {

frontend/src/wizards/Governance/Policy/PolicyWizard.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export function PolicyWizard(props: {
9393
title={props.title}
9494
breadcrumb={props.breadcrumb}
9595
description={t(
96-
'A policy generates reports and validates cluster compliance based on specified security standards, categories, and controls.'
96+
'A policy generates reports and validates cluster violations based on specified security standards, categories, and controls.'
9797
)}
9898
yamlEditor={props.yamlEditor}
9999
onSubmit={props.onSubmit}

0 commit comments

Comments
 (0)