Commit 373cb5d4 authored by Frédéric Caplette's avatar Frédéric Caplette

Merge branch 'jlouw-fix-compliance-violations-merged-by' into 'master'

Fix the compliance violations report not showing the merged by avatar

See merge request gitlab-org/gitlab!83524
parents 95018e5b 252f9b6d
import { convertObjectPropsToSnakeCase } from '~/lib/utils/common_utils';
export const mapViolations = (nodes = []) => {
return nodes.map((node) => ({
...node,
......@@ -8,7 +10,7 @@ export const mapViolations = (nodes = []) => {
participants: node.mergeRequest.participants?.nodes || [],
// TODO: Once the legacy dashboard is removed (https://gitlab.com/gitlab-org/gitlab/-/issues/346266) we can update the drawer to use the new attributes and remove these 2 mappings
reference: node.mergeRequest.ref,
mergedBy: node.mergeRequest.mergeUser,
mergedBy: convertObjectPropsToSnakeCase(node.mergeRequest.mergeUser),
project: {
...node.mergeRequest.project,
complianceFramework: node.mergeRequest.project?.complianceFrameworks?.nodes[0] || null,
......
import { mapViolations } from 'ee/compliance_dashboard/graphql/mappers';
import { convertObjectPropsToSnakeCase } from '~/lib/utils/common_utils';
import { createComplianceViolation } from '../mock_data';
describe('mapViolations', () => {
......@@ -7,7 +8,7 @@ describe('mapViolations', () => {
expect(mergeRequest).toMatchObject({
reference: mergeRequest.ref,
mergedBy: mergeRequest.mergeUser,
mergedBy: convertObjectPropsToSnakeCase(mergeRequest.mergeUser),
});
});
});
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment