Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STSMACOM-492: ControlledVocab documentation #1501

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

chris-hellen
Copy link

Created documentation for the ControlledVocab component

@ncovercash ncovercash changed the title STSMACOM-492 STSMACOM-492: ControlledVocab documentation Aug 28, 2024
Comment on lines +9 to +36
Name | Type | Default | Description
--- | --- | --- | ---
actionProps | Object | `{ delete: (item) => {return { disabled: item.item.inUse } } }` | Object containing properties of list action names: 'delete', 'edit' and values of sentinel functions that return objects to destructure onto the action button props
actionSupressor | Object | `{edit: item: => item.readOnly, delete: item, => item.readOnly}` | Object containing properties of list action names: `delete`, `edit` and values of sentinel functions that return booleans based on object properties
actuatorType | String | `'rest'` | Either `rest` or `refdata`. If manually set to `refdata`, sets actuators to PUT only
baseUrl | String | | A string to customize the path which should be used. Required
canCreate | Boolean | `true` | As for [`<EditableList>`](https://github.com/folio-org/stripes-smart-components/edit/master/lib/EditableList/readme.md)
columnMapping | Object | `{name : ..., lastUpdated: ..., numberOfObjects: ...}` | As for [`<EditableList>`](https://github.com/folio-org/stripes-smart-components/edit/master/lib/EditableList/readme.md)
editable | Boolean | `true` | Allows custom content/components to be displayed in the grid
formatter | Object | | As for [`<EditableList>`](https://github.com/folio-org/stripes-smart-components/edit/master/lib/EditableList/readme.md)
hiddenFields | Array of Strings | | A list of the fields present in the table not wanted in the UI
hideCreateButton | Boolean | `false` | Hides create button
id | String | `controlled-vocab-` | Used as a basic suffix for id attributes throughout the component.
itemTemplate | Object | | Object where each key's value is the default value for that field: `{ resourceType: 'book' }`
label | ReactNode | | The text for the H3 tag in the header of the component. Required
limitParam | String | | Limit parameter for the GET url
listFormLabel | ReactNode | | If provided, it will be used instead of what is provided in the `label` prop
listSupressor | Function | | Allows for the supression of the resulting list
listSupressorText | ReactNode | | If list is suppressed, this message will show instead
nameKey | String | `undefined` | The key that uniquely names listed objects: defaults to 'name'
objectLabel | ReactNode | | Labels the objects present in the `numberOfObjects` column
parseRow | Function | | Allows to parse the tables rows according to user implemented function.
readOnlyFields | Array of Strings | | Array of non-editable columns - good for displaying meta information within the row.
rowFilter | Element | | An optional React element placed above the list to present the filter parameters
rowFilterFunction | Function | | Allows for specific filtering of resulting rows
sortBy | String | `name` | Field of which to sort table
translations | Object | | Object of strings used to display different messages to the user
validate | Function | | Allows for custom field validation. The function is called for each record (row) and should return an empty object for no errors, or an object where the keys are the field names and the values are the error message components/strings to display
Copy link
Member

Choose a reason for hiding this comment

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

Please format the table so that it can be read in Markdown. Your editor should be able to do this automatically, feel free to reach out to me if you need help setting that up.

For example:

| Name              | Type     | Default | Description                                     |
| ----------------- | -------- | ------- | ----------------------------------------------- |
| rowFilterFunction | Function |         | Allows for specific filtering of resulting rows |
| sortBy            | String   | `name`  | Field of which to sort table                    |
...

Copy link

github-actions bot commented Aug 28, 2024

Jest Unit Test Statistics

0 tests  ±0   0 ✔️ ±0   0s ⏱️ ±0s
0 suites ±0   0 💤 ±0 
0 files   ±0   0 ±0 

Results for commit 641e25e. ± Comparison against base commit 4e1a4e9.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Aug 28, 2024

BigTest Unit Test Statistics

    1 files  ±0      1 suites  ±0   16s ⏱️ +2s
498 tests ±0  460 ✔️  - 1  37 💤 ±0  1 +1 
500 runs  ±0  462 ✔️  - 1  37 💤 ±0  1 +1 

For more details on these failures, see this check.

Results for commit 641e25e. ± Comparison against base commit 4e1a4e9.

♻️ This comment has been updated with latest results.

Copy link
Member

@ncovercash ncovercash left a comment

Choose a reason for hiding this comment

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

If you're doing documentation for these props, it'd be greatly appreciate if you'd also add TypeScript typings over in stripes-types! Let me know if you have any questions about that repository and how to add to it

@ncovercash ncovercash requested a review from JohnC-80 August 28, 2024 13:19
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.

2 participants