Skip to content

Commit 48f5b72

Browse files
Update from compliance category to compliance group
Found in retrieving metadata for field object that the XML element name is complianceGroup and not complianceCategory. Upating appropriately.
1 parent 0683043 commit 48f5b72

File tree

8 files changed

+17
-17
lines changed

8 files changed

+17
-17
lines changed

examples/markdown/force-app/objects/Event__c/fields/Social_Security_Number__c.field-meta.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
<length>9</length>
88
<trackTrending>false</trackTrending>
99
<type>Text</type>
10-
<complianceCategory>PII</complianceCategory>
10+
<complianceGroup>PII</complianceGroup>
1111
<securityClassification>Internal</securityClassification>
1212
</CustomField>

src/core/changelog/__test__/helpers/custom-field-metadata-builder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export default class CustomFieldMetadataBuilder {
2424
parentName: 'MyObject',
2525
required: false,
2626
securityClassification: 'Internal',
27-
complianceCategory: 'PII',
27+
complianceGroup: 'PII',
2828
};
2929
}
3030
}

src/core/markdown/adapters/type-to-renderable.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -357,8 +357,8 @@ function fieldMetadataToRenderable(
357357
apiName: getApiName(field.name, config),
358358
fieldType: field.type,
359359
required: field.required,
360-
complianceCategory: renderComplianceCategory(field.complianceCategory, config),
361-
securityClassification: renderComplianceCategory(field.securityClassification, config),
360+
complianceGroup: renderComplianceGroup(field.complianceGroup, config),
361+
securityClassification: renderComplianceGroup(field.securityClassification, config),
362362
pickListValues: field.pickListValues
363363
? {
364364
headingLevel: headingLevel + 1,
@@ -394,9 +394,9 @@ function getApiName(currentName: string, config: MarkdownGeneratorConfig) {
394394
return currentName;
395395
}
396396

397-
function renderComplianceCategory(complianceCategory: string | null, config: MarkdownGeneratorConfig) {
397+
function renderComplianceGroup(complianceGroup: string | null, config: MarkdownGeneratorConfig) {
398398
if(config.includeFieldSecurityMetadata) {
399-
return complianceCategory;
399+
return complianceGroup;
400400
} else {
401401
return null;
402402
}

src/core/markdown/templates/custom-object-template.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ export const customObjectTemplate = `
2424
{{{renderContent description}}}
2525
{{/if}}
2626
27-
{{#if complianceCategory}}
28-
**Compliance Category**
29-
{{complianceCategory}}
27+
{{#if complianceGroup}}
28+
**Compliance Group**
29+
{{complianceGroup}}
3030
{{/if}}
3131
3232
{{#if securityClassification}}

src/core/reflection/sobject/__test__/reflect-custom-field-sources.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const customFieldContent = `
1515
<type>Url</type>
1616
<description>A Photo URL field</description>
1717
<securityClassification>Internal</securityClassification>
18-
<complianceCategory>PII</complianceCategory>
18+
<complianceGroup>PII</complianceGroup>
1919
</CustomField>`;
2020

2121
describe('when parsing custom field metadata', () => {
@@ -123,7 +123,7 @@ describe('when parsing custom field metadata', () => {
123123
assertEither(result, (data) => expect(data[0].type.securityClassification).toBe('Internal'));
124124
});
125125

126-
test('the resulting type contains the correct compliance category', async () => {
126+
test('the resulting type contains the correct compliance group', async () => {
127127
const unparsed: UnparsedCustomFieldBundle = {
128128
type: 'customfield',
129129
name: 'PhotoUrl__c',
@@ -134,7 +134,7 @@ describe('when parsing custom field metadata', () => {
134134

135135
const result = await reflectCustomFieldSources([unparsed])();
136136

137-
assertEither(result, (data) => expect(data[0].type.complianceCategory).toBe('PII'));
137+
assertEither(result, (data) => expect(data[0].type.complianceGroup).toBe('PII'));
138138
});
139139

140140
test('can parse picklist values when there are multiple picklist values available', async () => {

src/core/reflection/sobject/reflect-custom-field-source.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export type CustomFieldMetadata = {
1919
pickListValues?: string[];
2020
required: boolean;
2121
securityClassification: string | null;
22-
complianceCategory: string | null;
22+
complianceGroup: string | null;
2323
};
2424

2525
export function reflectCustomFieldSources(
@@ -69,7 +69,7 @@ function toCustomFieldMetadata(parserResult: { CustomField: unknown }): CustomFi
6969
description: null,
7070
required: false,
7171
securityClassification: null,
72-
complianceCategory: null,
72+
complianceGroup: null,
7373
};
7474

7575
return {

src/core/reflection/sobject/reflect-custom-object-sources.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ function convertInlineFieldsToCustomFieldMetadata(
110110
const type = inlineField.type ? (inlineField.type as string) : null;
111111
const required = inlineField.required ? (inlineField.required as boolean) : false;
112112
const securityClassification = inlineField.securityClassification ? (inlineField.securityClassification as string) : null;
113-
const complianceCategory = inlineField.complianceCategory ? (inlineField.complianceCategory as string) : null;
113+
const complianceGroup = inlineField.complianceGroup ? (inlineField.complianceGroup as string) : null;
114114

115115
return {
116116
type_name: 'customfield',
@@ -121,7 +121,7 @@ function convertInlineFieldsToCustomFieldMetadata(
121121
type,
122122
required,
123123
securityClassification,
124-
complianceCategory,
124+
complianceGroup,
125125
pickListValues: getPickListValues(inlineField),
126126
};
127127
}

src/core/renderables/types.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ export type RenderableCustomField = {
202202
type: 'field';
203203
fieldType?: string | null;
204204
required: boolean;
205-
complianceCategory: string | null;
205+
complianceGroup: string | null;
206206
securityClassification: string | null;
207207
};
208208

0 commit comments

Comments
 (0)