Skip to content

Commit

Permalink
UITEN-282 - add null checks and default value for isPublic field(foll…
Browse files Browse the repository at this point in the history
…ow-up) (#401)

* UITEN-276 - Reading Room Access settings page basic layout implementation (#389)

* UITEN-276 - Reading Room Access settings page basic layout implementation

* UITEN-276 - fix review comments

* UITEN-278 - create reading room from tenant settings

* UITEN-278 - update package.json

* UITEN-278 - Add prop type validation

* UITEN-278 - update jest config

* UITEN-278 - add unit test

* UITEN-278 - update to final form

* UITEN-278 - update uni test

* UITEN-278 - refinement

* UITEN-278 - add validators, refine code

* UITEN-278 - refine

* UITEN-278 - disable lint rule

* UITEN-278 - refine

* UITEN-278 - fix prop types sonar problem

* UITEN-278 - update permission check on reading room access

* UITEN-278 - create reading room from tenant settings (#393)

* UITEN-278 - create reading room from tenant settings

* UITEN-278 - update package.json

* UITEN-278 - Add prop type validation

* UITEN-278 - update jest config

* UITEN-278 - add unit test

* UITEN-278 - update to final form

* UITEN-278 - update uni test

* UITEN-278 - refinement

* UITEN-278 - add validators, refine code

* UITEN-278 - refine

* UITEN-278 - disable lint rule

* UITEN-278 - refine

* UITEN-278 - fix prop types sonar problem

* UITEN-278 - update permission check on reading room access

* UITEN-278 - fix review comments

* UITEN-282, UITEN-283 - Implementation for update and delete reading room access.

* UITEN-282 - fix the default value of Public checkbox to pick the current value

* UITEN-282 - add null checks for isPublic field value and also have a default value in case it is not available.

* UITEN-282 - refine code

* UITEN-282 - refine the validation for service points

* UITEN-282 - refine the validation for service points
  • Loading branch information
Terala-Priyanka authored May 7, 2024
1 parent a28b87c commit 3759efd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/settings/ReadingRoomAccess/getFieldComponents.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const getFieldComponents = (fieldLabels, options, rraData) => ({
{...fieldProps}
aria-label={`${fieldLabels[name]} ${rowIndex}`}
component={Checkbox}
initialValue={rraData[rowIndex].isPublic}
initialValue={rraData[rowIndex]?.isPublic ?? false}
type="checkbox"
marginBottom0
/>
Expand Down
2 changes: 1 addition & 1 deletion src/settings/ReadingRoomAccess/getValidators.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const validators = {
},
[readingRoomAccessColumns.SERVICEPOINTS]: (item) => {
const { servicePoints } = item;
if (!servicePoints) {
if (!servicePoints?.length) {
return <FormattedMessage id="stripes-core.label.missingRequiredField" />;
}
return undefined;
Expand Down

0 comments on commit 3759efd

Please sign in to comment.