Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions examples/vitepress/docs/custom-objects/Event__c.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Represents an event that people can register for.

---
### End Date
**Required**

**API Name**

Expand All @@ -33,6 +34,7 @@ Represents an event that people can register for.

---
### Location
**Required**

**API Name**

Expand All @@ -44,6 +46,7 @@ Represents an event that people can register for.

---
### Start Date
**Required**

**API Name**

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ Use this when the Price Component represents a Flat Price. To represent a Percen

---
### Type
**Required**

**API Name**

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ The date the product got discontinued

---
### Name
**Required**

Product name

Expand Down Expand Up @@ -98,6 +99,7 @@ ReleaseDate

---
### Type
**Required**

**API Name**

Expand Down
1 change: 1 addition & 0 deletions examples/vitepress/docs/custom-objects/Product__c.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Product that is sold or available for sale.

---
### Event
**Required**

**API Name**

Expand Down
3 changes: 3 additions & 0 deletions examples/vitepress/docs/custom-objects/Sales_Order_Line__c.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Represents a line item on a sales order.

## Fields
### Amount
**Required**

**API Name**

Expand All @@ -22,6 +23,7 @@ Represents a line item on a sales order.

---
### Product
**Required**

**API Name**

Expand Down Expand Up @@ -55,6 +57,7 @@ Represents a line item on a sales order.

---
### Type
**Required**

**API Name**

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
<isSortingDisabled>false</isSortingDisabled>
<label>Name</label>
<length>128</length>
<required>false</required>
<required>true</required>
<type>Text</type>
<unique>false</unique>
</fields>
Expand Down
1 change: 1 addition & 0 deletions src/core/changelog/__test__/processing-changelog.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class CustomFieldMetadataBuilder {
name: this.name,
description: this.description,
parentName: 'MyObject',
required: false,
};
}
}
Expand Down
1 change: 1 addition & 0 deletions src/core/markdown/adapters/type-to-renderable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ function fieldMetadataToRenderable(
description: field.description ? [field.description] : [],
apiName: getApiName(field.name, config),
fieldType: field.type,
required: field.required,
pickListValues: field.pickListValues
? {
headingLevel: headingLevel + 1,
Expand Down
3 changes: 3 additions & 0 deletions src/core/markdown/templates/custom-object-template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ export const customObjectTemplate = `
{{ heading fields.headingLevel fields.heading }}
{{#each fields.value}}
{{ heading headingLevel heading }}
{{#if required}}
**Required**
{{/if}}

{{#if description}}
{{{renderContent description}}}
Expand Down
2 changes: 2 additions & 0 deletions src/core/reflection/sobject/reflect-custom-field-source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export type CustomFieldMetadata = {
type?: string | null;
parentName: string;
pickListValues?: string[];
required: boolean;
};

export function reflectCustomFieldSources(
Expand Down Expand Up @@ -64,6 +65,7 @@ function toCustomFieldMetadata(parserResult: { CustomField: unknown }): CustomFi
parserResult?.CustomField != null && typeof parserResult.CustomField === 'object' ? parserResult.CustomField : {};
const defaultValues = {
description: null,
required: false,
};

return {
Expand Down
2 changes: 2 additions & 0 deletions src/core/reflection/sobject/reflect-custom-object-sources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ function convertInlineFieldsToCustomFieldMetadata(
const description = inlineField.description ? (inlineField.description as string) : null;
const label = inlineField.label ? (inlineField.label as string) : name;
const type = inlineField.type ? (inlineField.type as string) : null;
const required = inlineField.required ? (inlineField.required as boolean) : false;

return {
type_name: 'customfield',
Expand All @@ -110,6 +111,7 @@ function convertInlineFieldsToCustomFieldMetadata(
name,
parentName,
type,
required,
pickListValues: getPickListValues(inlineField),
};
}
Expand Down
1 change: 1 addition & 0 deletions src/core/renderables/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ export type RenderableCustomField = {
pickListValues?: RenderableSection<string[]>;
type: 'field';
fieldType?: string | null;
required: boolean;
};

export type Renderable = (RenderableClass | RenderableInterface | RenderableEnum | RenderableCustomObject) & {
Expand Down
Loading