-
Notifications
You must be signed in to change notification settings - Fork 19
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
chris-hellen
wants to merge
11
commits into
folio-org:master
Choose a base branch
from
chris-hellen:STSMACOM-492
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
82d4b19
Created readme file for ControlledVocab comp
chris-hellen 10bc656
test to fix doc
chris-hellen 68620e8
undo test
chris-hellen d028bef
fix for table
chris-hellen 6288893
add line break
chris-hellen c19e282
undo line break
chris-hellen 5106887
Filled out descriptions
chris-hellen c48c9d7
Added usage example and changed description
chris-hellen 7b8af19
Changed description
chris-hellen 5436f27
Fixed link
chris-hellen 641e25e
Merge branch 'master' into STSMACOM-492
ncovercash File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# ControlledVocab | ||
|
||
## Description | ||
|
||
Expanded [`<EditableList>`](https://github.com/folio-org/stripes-smart-components/blob/master/lib/EditableList/readme.md) with more functionality, such as sorting, filtering, and suppression. | ||
|
||
## Props | ||
|
||
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 | ||
|
||
For a usage example see [`<PatronGroupSettings>`](https://github.com/folio-org/ui-users/blob/master/src/settings/PatronGroupsSettings.js) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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: