-
Notifications
You must be signed in to change notification settings - Fork 7
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
UITEN-276 - Reading Room Access settings page basic layout implementation #389
Conversation
import buildStripes from '../../../test/jest/__new_mocks__/stripesCore.mock'; | ||
|
||
import { | ||
renderWithRouter, renderWithReduxForm |
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 put each imported item on a new line
expect(screen.getByLabelText('ui-tenant-settings.settings.reading-room-access.label')).toBeInTheDocument(); | ||
}); | ||
|
||
// it('should render text "There are no Reading room access"', () => { |
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 remove unneeded commented code, or add a TODO item and mention a ticket number in which code will be uncommented
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.
This will be uncommented in later PRs.
I will add a TODO here. Thank you for the suggestion!
|
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.
Was this really intended for review? The work feels like a POC given the hard-coded sample data. If you need feedback about an implementation, that's fine, but please mark such PRs as "Draft".
My bad; I see this was intended for a feature branch, not #master
. Sorry for the stern tone.
values: { records: [ | ||
{ | ||
'id': 1, | ||
'name': 'RR1', | ||
'public': true, | ||
'servicePoint': [ | ||
{ | ||
name: 'Circ Desk 1', | ||
id: '3a40852d-49fd-4df2-a1f9-6e2641a6e91f', | ||
}, | ||
{ | ||
id: 'c4c90014-c8c9-4ade-8f24-b5e313319f4b', | ||
name: 'Circ Desk 2' | ||
}, | ||
], | ||
// metadata: { | ||
// 'createdDate': '2024-03-21T10:59:25.085+00:00', | ||
// 'createdByUserId': 'af5ad81e-6857-5b65-9c0c-60942e56f872', | ||
// 'updatedDate': '2024-03-21T10:59:25.085+00:00', | ||
// 'updatedByUserId': 'af5ad81e-6857-5b65-9c0c-60942e56f872' | ||
// } | ||
}, | ||
{ | ||
'id': 2, | ||
'name': 'RR2', | ||
'public': true, | ||
'servicePoint': [{ | ||
name: 'Circ Desk 1', | ||
id: '3a40852d-49fd-4df2-a1f9-6e2641a6e91f', | ||
}], | ||
// metadata: { | ||
// 'createdDate': '2024-03-21T10:59:25.085+00:00', | ||
// 'createdByUserId': 'af5ad81e-6857-5b65-9c0c-60942e56f872', | ||
// 'updatedDate': '2024-03-21T10:59:25.085+00:00', | ||
// 'updatedByUserId': 'af5ad81e-6857-5b65-9c0c-60942e56f872' | ||
// } | ||
}, | ||
] }, |
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.
It is exceptionally exceptionally odd to me that this kind of data would be hard-coded and universal to every single tenant. The fact that metadata
is included but commented out suggests this was copied from an API response; was this test data that should have been removed once the API was configured?
servicePoint: intl.formatMessage({ id:'ui-tenant-settings.settings.reading-room-access.asp' }), | ||
}; | ||
|
||
const editable = false; // stripes.hasPerm('ui-users.settings.reading-room-access.all'); |
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.
Why is this hard-coded? Why does the comment refer to permissions specified by ui-users rather than ui-tenant-settings?
RRAServicePoints: { | ||
type: 'okapi', | ||
resource: 'service-points', | ||
path: 'service-points?limit=200', |
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.
200
:
- Do not use magic numbers; use a usefully named constant. This is CS 101.
- 200 is almost certainly inadequate
- import
queryLimit()
from@folio/stripes/core
, which (eventually) will be implemented to return eitherstripes-config.maxUnpagedResourceCount
(fromstripes.config.js
and thus configurable per-tenant) or the default.
This manifest is configured but never used. Why? If you don't need the data, don't make the API request :/
No worries. Just to add to what is there in the description, in upcoming PRS(when APIS are ready to consume by UI) everything will be clean. |
* 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 (#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 * UIU-282, UIU-283 - Implementation for Update and Delete of Reading Room Access (#398) * 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-282, UITEN-283 - Implementation for update and delete reading room access.
…ent value (follow up) (#400) * 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
…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
Purpose
https://folio-org.atlassian.net/browse/UITEN-277
https://folio-org.atlassian.net/browse/UITEN-276
Approach
Introduced new page(Reading Room Access) in tenant settings.
Currently this page is read only with mock data.
Gradually, once the APIs development progresses and UI permission sets are created, this settings page will include add, edit and delete actions.
Note: Please note that the target branch is not master. Due to several reasons, our teams intends to merge this PR into the above mentioned base branch. Once all the dependencies are cleared, we will in turn merge this base branch into master via another PR. Any pieces of code intentionally commented out(like stripes.hasPerm) will be addressed in upcoming PRs.
Screenshots
Pre-Merge Checklist
Before merging this PR, please go through the following list and take appropriate actions.
If there are breaking changes, please STOP and consider the following:
Ideally all of the PRs involved in breaking changes would be merged in the same day to avoid breaking the folio-testing environment. Communication is paramount if that is to be achieved, especially as the number of intermodule and inter-team dependencies increase.
While it's helpful for reviewers to help identify potential problems, ensuring that it's safe to merge is ultimately the responsibility of the PR assignee.