Skip to content

Conversation

@RaviVaranasi
Copy link
Contributor

@RaviVaranasi RaviVaranasi commented Nov 3, 2024

When generating documentation for custom objects, include pick list values in documentation

TODO:

  • Ensure documentation generator to include pick list values

@RaviVaranasi RaviVaranasi force-pushed the custom-field-pick-list-values branch from f989eed to cb2dccb Compare November 3, 2024 23:41
@RaviVaranasi RaviVaranasi marked this pull request as ready for review November 4, 2024 02:31
@RaviVaranasi
Copy link
Contributor Author

@cesarParra not sure if you have an integration test to verify but believe the changes are completed. Let me know

@cesarParra cesarParra self-requested a review November 4, 2024 13:19
@cesarParra cesarParra changed the base branch from master to develop November 4, 2024 13:19
@cesarParra cesarParra changed the base branch from develop to master November 4, 2024 13:22
@cesarParra
Copy link
Owner

@cesarParra not sure if you have an integration test to verify but believe the changes are completed. Let me know

@RaviVaranasi Yeah, the CI tests will run once I approve.

package.json Outdated
{
"name": "@cparra/apexdocs",
"version": "3.4.2",
"version": "3.4.3",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll take care of the release so let's revert this. Since this Apexdocs is following semver the next one will be 3.5.0 as I consider this change to be an additional feature and not a bug fix.

}

function isCustomField(customField: object): customField is CustomFieldMetadata {
return (customField as CustomFieldMetadata).type != undefined;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[minor] Let's use strict equality (e.g. ===, !==). Since we want to account for both null and undefined we can coerce into a boolean:

return !!(customField as CustomFieldMetadata).type;

**Type**
*{{fieldType}}*
{{#each pickListValues}}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking that instead of looping through the picklist values, we will want to make this its own section, and only render it if there are values to display (since not all fields will be picklists).

I like how Salesforce documentation does it, where they have the "Possible values are" as the heading

image

See my comment below in the src/core/renderables/types.d.ts file with the details about the changes that would need to be made to the type to accomplish this

Copy link
Contributor Author

@RaviVaranasi RaviVaranasi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if this should be renamed to something like hasType, since at this stage we already know we are dealing with custom field metadata because of the previous check (validate)

Agreed

@RaviVaranasi RaviVaranasi force-pushed the custom-field-pick-list-values branch from abff594 to 1970145 Compare November 5, 2024 03:47
@RaviVaranasi
Copy link
Contributor Author

@cesarParra Unsure of the last commit but should be ready for review again

@cesarParra
Copy link
Owner

@cesarParra Unsure of the last commit but should be ready for review again

@RaviVaranasi No worries. I took the liberty of making that change. I tested the output and there was another change needed on the Handlebar template, since it was not respecting the correct heading. Here is the commit I made if you are curious: 2e58a93

The build is passing so I'll merge and let you know once I publish a new version to NPM

Copy link
Owner

@cesarParra cesarParra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks so much for contributing this improvement!

@cesarParra cesarParra merged commit 0bfe28b into cesarParra:master Nov 5, 2024
1 check passed
@cesarParra cesarParra linked an issue Nov 5, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support to show pick list values in Custom Object

2 participants