From 82d4b196167f414df9fd863e56124a35ca361ebf Mon Sep 17 00:00:00 2001 From: Chris Hellen Date: Wed, 14 Aug 2024 15:15:34 -0500 Subject: [PATCH 01/10] Created readme file for ControlledVocab comp --- lib/ControlledVocab/readme.md | 39 +++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 lib/ControlledVocab/readme.md diff --git a/lib/ControlledVocab/readme.md b/lib/ControlledVocab/readme.md new file mode 100644 index 000000000..9c21a5b1b --- /dev/null +++ b/lib/ControlledVocab/readme.md @@ -0,0 +1,39 @@ +# ControlledVocab + +## Description + +Component designed to manage a controlled vocabulary list. This list consists of predefined terms or keywords that users can interact with by adding, editing, or removing entries. + +## Props + +Name | Type | Default | Description +--- | --- | --- +actionProps | Object | | placeholder +actionSupressor | Object | `{edit: item: => item.readOnly, delete: item, => item.readOnly}` | placeholder +actuatorType | String | `'rest'` | placeholder +baseUrl | String | | placeholder +canCreate | Boolean | `true` | placeholder +clientGeneratePk | Bool/String | `true` | placeholder +columnMapping | Object | | placeholder +editable | Boolean | `true` | placeholder +formatter | Object | | placeholder +hiddenFields | Array of Strings | | placeholder +hideCreateButton | Boolean | `false` | placeholder +id | String | | placeholder +itemTemplate | Object | | placeholder +label | ReactNode | | placeholder +limitParam | String | | placeholder +listFormLabel | ReactNode | | placeholder +listSupressor | Function | | placeholder +listSupressorText | ReactNode | | placeholder +nameKey | String | `undefined` | placeholder +objectLabel | ReactNode | | placeholder +parseRows | Function | | placeholder +preCreateHook | Function | `(row) => row` | placeholder +preUpdateHook | Function | `(row) => row` | placeholder +readOnlyFields | Array of Strings | | placeholder +records | String | | placeholder +rowFilter | Element | | placeholder +rowFilterFunction | Function | | placeholder +sortBy | String | | placeholder +translations | Object | | placeholder \ No newline at end of file From 10bc6564618283b64be3704656d1c8b583c1e5fa Mon Sep 17 00:00:00 2001 From: Chris Hellen Date: Wed, 14 Aug 2024 15:35:15 -0500 Subject: [PATCH 02/10] test to fix doc --- lib/ControlledVocab/readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/ControlledVocab/readme.md b/lib/ControlledVocab/readme.md index 9c21a5b1b..05370f1c1 100644 --- a/lib/ControlledVocab/readme.md +++ b/lib/ControlledVocab/readme.md @@ -4,6 +4,7 @@ Component designed to manage a controlled vocabulary list. This list consists of predefined terms or keywords that users can interact with by adding, editing, or removing entries. + ## Props Name | Type | Default | Description From 68620e815fc1d182cce7c0dba1965a04961a43fe Mon Sep 17 00:00:00 2001 From: Chris Hellen Date: Wed, 14 Aug 2024 15:36:07 -0500 Subject: [PATCH 03/10] undo test --- lib/ControlledVocab/readme.md | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/ControlledVocab/readme.md b/lib/ControlledVocab/readme.md index 05370f1c1..9c21a5b1b 100644 --- a/lib/ControlledVocab/readme.md +++ b/lib/ControlledVocab/readme.md @@ -4,7 +4,6 @@ Component designed to manage a controlled vocabulary list. This list consists of predefined terms or keywords that users can interact with by adding, editing, or removing entries. - ## Props Name | Type | Default | Description From d028bef16308d1bc20b94a995c5b6ba57572270c Mon Sep 17 00:00:00 2001 From: Chris Hellen Date: Wed, 14 Aug 2024 15:58:06 -0500 Subject: [PATCH 04/10] fix for table --- lib/ControlledVocab/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ControlledVocab/readme.md b/lib/ControlledVocab/readme.md index 9c21a5b1b..44e57f814 100644 --- a/lib/ControlledVocab/readme.md +++ b/lib/ControlledVocab/readme.md @@ -7,7 +7,7 @@ Component designed to manage a controlled vocabulary list. This list consists of ## Props Name | Type | Default | Description ---- | --- | --- +--- | --- | --- | --- actionProps | Object | | placeholder actionSupressor | Object | `{edit: item: => item.readOnly, delete: item, => item.readOnly}` | placeholder actuatorType | String | `'rest'` | placeholder From 62888939fcdeedd6441a9d11693dc75319bfb48b Mon Sep 17 00:00:00 2001 From: Chris Hellen Date: Wed, 14 Aug 2024 15:59:25 -0500 Subject: [PATCH 05/10] add line break --- lib/ControlledVocab/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ControlledVocab/readme.md b/lib/ControlledVocab/readme.md index 44e57f814..d37bb356e 100644 --- a/lib/ControlledVocab/readme.md +++ b/lib/ControlledVocab/readme.md @@ -9,7 +9,7 @@ Component designed to manage a controlled vocabulary list. This list consists of Name | Type | Default | Description --- | --- | --- | --- actionProps | Object | | placeholder -actionSupressor | Object | `{edit: item: => item.readOnly, delete: item, => item.readOnly}` | placeholder +actionSupressor | Object | `{edit: item: => item.readOnly
delete: item, => item.readOnly}` | placeholder actuatorType | String | `'rest'` | placeholder baseUrl | String | | placeholder canCreate | Boolean | `true` | placeholder From c19e28235bd7430f02b50e20850146aeb2ca6c8f Mon Sep 17 00:00:00 2001 From: Chris Hellen Date: Wed, 14 Aug 2024 16:00:10 -0500 Subject: [PATCH 06/10] undo line break --- lib/ControlledVocab/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ControlledVocab/readme.md b/lib/ControlledVocab/readme.md index d37bb356e..44e57f814 100644 --- a/lib/ControlledVocab/readme.md +++ b/lib/ControlledVocab/readme.md @@ -9,7 +9,7 @@ Component designed to manage a controlled vocabulary list. This list consists of Name | Type | Default | Description --- | --- | --- | --- actionProps | Object | | placeholder -actionSupressor | Object | `{edit: item: => item.readOnly
delete: item, => item.readOnly}` | placeholder +actionSupressor | Object | `{edit: item: => item.readOnly, delete: item, => item.readOnly}` | placeholder actuatorType | String | `'rest'` | placeholder baseUrl | String | | placeholder canCreate | Boolean | `true` | placeholder From 51068873322c63eb5cccb567e5064c4999e9bfc8 Mon Sep 17 00:00:00 2001 From: Chris Hellen Date: Fri, 16 Aug 2024 14:59:16 -0500 Subject: [PATCH 07/10] Filled out descriptions --- lib/ControlledVocab/readme.md | 55 +++++++++++++++++------------------ 1 file changed, 26 insertions(+), 29 deletions(-) diff --git a/lib/ControlledVocab/readme.md b/lib/ControlledVocab/readme.md index 44e57f814..c1bd16a43 100644 --- a/lib/ControlledVocab/readme.md +++ b/lib/ControlledVocab/readme.md @@ -8,32 +8,29 @@ Component designed to manage a controlled vocabulary list. This list consists of Name | Type | Default | Description --- | --- | --- | --- -actionProps | Object | | placeholder -actionSupressor | Object | `{edit: item: => item.readOnly, delete: item, => item.readOnly}` | placeholder -actuatorType | String | `'rest'` | placeholder -baseUrl | String | | placeholder -canCreate | Boolean | `true` | placeholder -clientGeneratePk | Bool/String | `true` | placeholder -columnMapping | Object | | placeholder -editable | Boolean | `true` | placeholder -formatter | Object | | placeholder -hiddenFields | Array of Strings | | placeholder -hideCreateButton | Boolean | `false` | placeholder -id | String | | placeholder -itemTemplate | Object | | placeholder -label | ReactNode | | placeholder -limitParam | String | | placeholder -listFormLabel | ReactNode | | placeholder -listSupressor | Function | | placeholder -listSupressorText | ReactNode | | placeholder -nameKey | String | `undefined` | placeholder -objectLabel | ReactNode | | placeholder -parseRows | Function | | placeholder -preCreateHook | Function | `(row) => row` | placeholder -preUpdateHook | Function | `(row) => row` | placeholder -readOnlyFields | Array of Strings | | placeholder -records | String | | placeholder -rowFilter | Element | | placeholder -rowFilterFunction | Function | | placeholder -sortBy | String | | placeholder -translations | Object | | placeholder \ No newline at end of file +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 [``](https://github.com/folio-org/stripes-smart-components/edit/master/lib/EditableList/readme.md) +columnMapping | Object | `{name : ..., lastUpdated: ..., numberOfObjects: ...}` | As for [``](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 [``](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 \ No newline at end of file From c48c9d7e6d4171233f2312c99a6ddf1b18cf59f4 Mon Sep 17 00:00:00 2001 From: Chris Hellen Date: Fri, 16 Aug 2024 15:12:23 -0500 Subject: [PATCH 08/10] Added usage example and changed description --- lib/ControlledVocab/readme.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/ControlledVocab/readme.md b/lib/ControlledVocab/readme.md index c1bd16a43..7266d6c39 100644 --- a/lib/ControlledVocab/readme.md +++ b/lib/ControlledVocab/readme.md @@ -2,7 +2,7 @@ ## Description -Component designed to manage a controlled vocabulary list. This list consists of predefined terms or keywords that users can interact with by adding, editing, or removing entries. +Expanded `EditableList` with more functionality, such as sorting, filtering, and suppression. ## Props @@ -33,4 +33,6 @@ rowFilter | Element | | An optional React element placed above the list to prese 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 \ No newline at end of file +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 [``](https://github.com/folio-org/ui-users/blob/master/src/settings/PatronGroupsSettings.js) \ No newline at end of file From 7b8af199b577171685f480629cc2544d0c68fdf0 Mon Sep 17 00:00:00 2001 From: Chris Hellen Date: Fri, 16 Aug 2024 15:18:04 -0500 Subject: [PATCH 09/10] Changed description --- lib/ControlledVocab/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ControlledVocab/readme.md b/lib/ControlledVocab/readme.md index 7266d6c39..0cae8f72e 100644 --- a/lib/ControlledVocab/readme.md +++ b/lib/ControlledVocab/readme.md @@ -2,7 +2,7 @@ ## Description -Expanded `EditableList` with more functionality, such as sorting, filtering, and suppression. +Expanded [``](https://github.com/folio-org/stripes-smart-components/edit/master/lib/EditableList/readme.md) with more functionality, such as sorting, filtering, and suppression. ## Props From 5436f2793e9e97c6391a80e80c682db45f5f78bd Mon Sep 17 00:00:00 2001 From: Chris Hellen Date: Fri, 16 Aug 2024 15:19:37 -0500 Subject: [PATCH 10/10] Fixed link --- lib/ControlledVocab/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ControlledVocab/readme.md b/lib/ControlledVocab/readme.md index 0cae8f72e..2e3ff9eb3 100644 --- a/lib/ControlledVocab/readme.md +++ b/lib/ControlledVocab/readme.md @@ -2,7 +2,7 @@ ## Description -Expanded [``](https://github.com/folio-org/stripes-smart-components/edit/master/lib/EditableList/readme.md) with more functionality, such as sorting, filtering, and suppression. +Expanded [``](https://github.com/folio-org/stripes-smart-components/blob/master/lib/EditableList/readme.md) with more functionality, such as sorting, filtering, and suppression. ## Props