Skip to content

Commit 2e58a93

Browse files
committed
CR updates
1 parent f8f9bab commit 2e58a93

File tree

6 files changed

+22
-16
lines changed

6 files changed

+22
-16
lines changed

examples/vitepress/docs/custom-objects/Price_Component__c.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,9 @@ Use this when the Price Component represents a Flat Price. To represent a Percen
6666

6767
**Type**
6868

69-
*Picklist*
69+
*Picklist*
70+
71+
#### Possible values are
72+
* List Price
73+
* Surcharge
74+
* Discount

examples/vitepress/docs/custom-objects/Sales_Order_Line__c.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,8 @@ Represents a line item on a sales order.
6262

6363
**Type**
6464

65-
*Picklist*
65+
*Picklist*
66+
67+
#### Possible values are
68+
* Charge
69+
* Discount

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -281,13 +281,11 @@ function fieldMetadataToRenderable(
281281
description: field.description ? [field.description] : [],
282282
apiName: getApiName(field.name, config),
283283
fieldType: field.type,
284-
isPicklist: field.pickListValues.length > 0,
285-
pickListValues: {
284+
pickListValues: field.pickListValues ? {
286285
headingLevel: headingLevel + 1,
287286
heading: 'Possible values are',
288-
value: field.pickListValues
289-
290-
}
287+
value: field.pickListValues,
288+
} : undefined,
291289
};
292290
}
293291

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ export const customObjectTemplate = `
2424
2525
*{{fieldType}}*
2626
27-
{{#if isPicklist}}
28-
{{ heading headingLevel heading }}
29-
{{#each pickListValues.value}}
30-
* {{{this}}}
31-
{{/each}}
27+
{{#if pickListValues}}
28+
{{ heading pickListValues.headingLevel pickListValues.heading }}
29+
{{#each pickListValues.value}}
30+
* {{{this}}}
31+
{{/each}}
3232
{{/if}}
3333
{{/if}}
3434

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export type CustomFieldMetadata = {
1515
label?: string | null;
1616
type?: string | null;
1717
parentName: string;
18-
pickListValues: string[];
18+
pickListValues?: string[];
1919
};
2020

2121
export function reflectCustomFieldSources(
@@ -66,7 +66,7 @@ function toCustomFieldMetadata(parserResult: { CustomField: unknown }): CustomFi
6666
};
6767

6868
const pickListValues =
69-
hasType(customField) && customField.type?.toLowerCase() === 'picklist' ? toPickListValues(customField) : [];
69+
hasType(customField) && customField.type?.toLowerCase() === 'picklist' ? toPickListValues(customField) : undefined;
7070
return { ...defaultValues, ...customField, type_name: 'customfield', pickListValues } as CustomFieldMetadata;
7171
}
7272

@@ -86,7 +86,7 @@ function toPickListValues(customField: object): string[] {
8686
}
8787

8888
function hasType(customField: object): customField is CustomFieldMetadata {
89-
return (customField as CustomFieldMetadata).type != undefined;
89+
return !!(customField as CustomFieldMetadata).type;
9090
}
9191

9292
function addName(metadata: CustomFieldMetadata, name: string): CustomFieldMetadata {

src/core/renderables/types.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,6 @@ export type RenderableCustomField = {
189189
heading: string;
190190
apiName: string;
191191
description: RenderableContent[];
192-
isPicklist: boolean;
193192
pickListValues?: RenderableSection<string[]>
194193
type: 'field';
195194
fieldType?: string | null;

0 commit comments

Comments
 (0)