Skip to content

Remove thWidthClass in table_utilities

Justin Ho Tuan Duong requested to merge justin_ho-remove-table-thwidthclass into master

What does this MR do and why?

Relates to #362362.

  • Replace thWidthClass with thWidthPercent in remaining components and fully remove the method. The new util includes less redundant classes as all GlTables already handles most of the styling.
  • Remove thWidthClass from table_utilities since it's no longer used. Also remove DEFAULT_TH_CLASSES.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

No changes to UI.

Page Before After
Corpus management Corpus_management_before Corpus_management_after
Compliance violations report Compliance_violations_report_before Compliance_violations_report_after

How to set up and validate locally

Compliance violations report

  1. Go to Group > Secure > Compliance center.
  2. Select the Violations tab. For example, http://127.0.0.1:3000/groups/gitlab-org/-/security/compliance_dashboard/violations.
  3. Apply the following diff to mock some data:
Click to expand
diff --git a/ee/app/assets/javascripts/compliance_dashboard/components/violations_report/report.vue b/ee/app/assets/javascripts/compliance_dashboard/components/violations_report/report.vue
index bc0c4988ec43..e1b7fae99474 100644
--- a/ee/app/assets/javascripts/compliance_dashboard/components/violations_report/report.vue
+++ b/ee/app/assets/javascripts/compliance_dashboard/components/violations_report/report.vue
@@ -78,7 +78,71 @@ export default {
         };
       },
       update(data) {
-        const { nodes, pageInfo } = data?.group?.mergeRequestViolations || {};
+        const createUser = (id) => ({
+          id: `gid://gitlab/User/${id}`,
+          avatarUrl: `https://${id}`,
+          name: __(`User ${id}`),
+          username: `user-${id}`,
+          webUrl: `http://localhost:3000/user-${id}`,
+          __typename: 'UserCore',
+        });
+
+        const createComplianceViolation = (id) => ({
+          id: `gid://gitlab/MergeRequests::ComplianceViolation/${id}`,
+          severityLevel: 'HIGH',
+          reason: 'APPROVED_BY_COMMITTER',
+          violatingUser: createUser(1),
+          mergeRequest: {
+            id: `gid://gitlab/MergeRequest/1`,
+            title: __(`Merge request 1`),
+            mergedAt: '2022-03-06T16:39:12Z',
+            webUrl: 'http://gdk.test:3000/gitlab-org/gitlab-shell/-/merge_requests/56',
+            author: createUser(2),
+            mergeUser: createUser(1),
+            committers: {
+              nodes: [createUser(1)],
+              __typename: 'UserCoreConnection',
+            },
+            participants: {
+              nodes: [createUser(1), createUser(2)],
+              __typename: 'UserCoreConnection',
+            },
+            approvedBy: {
+              nodes: [createUser(1)],
+              __typename: 'UserCoreConnection',
+            },
+            ref: '!56',
+            fullRef: 'gitlab-org/gitlab-shell!56',
+            sourceBranch: 'master',
+            sourceBranchExists: false,
+            targetBranch: 'feature',
+            targetBranchExists: false,
+            project: {
+              id: 'gid://gitlab/Project/2',
+              avatarUrl: null,
+              name: __('Gitlab Shell'),
+              webUrl: 'http://gdk.test:3000/gitlab-org/gitlab-shell',
+              complianceFrameworks: {
+                nodes: [
+                  {
+                    id: 'gid://gitlab/ComplianceManagement::Framework/1',
+                    name: 'GDPR',
+                    description: 'asds',
+                    color: '#0000ff',
+                    __typename: 'ComplianceFramework',
+                  },
+                ],
+                __typename: 'ComplianceFrameworkConnection',
+              },
+              __typename: __('Project'),
+            },
+            __typename: 'MergeRequest',
+          },
+          __typename: 'ComplianceViolation',
+        });
+        const nodes = [createComplianceViolation(1)];
+        const pageInfo = {};
+        // const { nodes, pageInfo } = data?.group?.mergeRequestViolations || {};
         return {
           list: mapViolations(nodes),
           pageInfo,

Corpus management

  1. Go to Project > Secure > Security configuration.
  2. Find the Coverage Fuzzing section (second to last) and click on Manage corpus. For example, http://127.0.0.1:3000/gitlab-org/gitlab-shell/-/security/configuration/corpus_management.
  3. Select New corpus. Use any name and upload any .zip file, then click Add.

Merge request reports