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

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

Merged
merged 3 commits into from
Mar 27, 2024

Conversation

Terala-Priyanka
Copy link
Contributor

@Terala-Priyanka Terala-Priyanka commented Mar 25, 2024

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

image

Pre-Merge Checklist

Before merging this PR, please go through the following list and take appropriate actions.

  • I've added appropriate record to the CHANGELOG.md
  • Does this PR meet or exceed the expected quality standards?
    • Code coverage on new code is 80% or greater
    • Duplications on new code is 3% or less
    • There are no major code smells or security issues
  • Does this introduce breaking changes?
    • If any API-related changes - okapi interfaces and permissions are reviewed/changed correspondingly
    • There are no breaking changes in this PR.

If there are breaking changes, please STOP and consider the following:

  • What other modules will these changes impact?
  • Do JIRAs exist to update the impacted modules?
    • If not, please create them
    • Do they contain the appropriate level of detail? Which endpoints/schemas changed, etc.
    • Do they have all they appropriate links to blocked/related issues?
  • Are the JIRAs under active development?
    • If not, contact the project's PO and make sure they're aware of the urgency.
  • Do PRs exist for these changes?
    • If so, have they been approved?

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.

@Terala-Priyanka Terala-Priyanka marked this pull request as draft March 25, 2024 10:04
@Terala-Priyanka Terala-Priyanka self-assigned this Mar 25, 2024
Copy link

github-actions bot commented Mar 25, 2024

Jest Unit Test Statistics

  1 files  ±0  27 suites  +1   2m 32s ⏱️ +8s
95 tests +1  83 ✔️ +1  12 💤 ±0  0 ±0 
97 runs  +1  85 ✔️ +1  12 💤 ±0  0 ±0 

Results for commit 861b7d4. ± Comparison against base commit b27d300.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Mar 25, 2024

BigTest Unit Test Statistics

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

Results for commit 861b7d4. ± Comparison against base commit b27d300.

♻️ This comment has been updated with latest results.

@Terala-Priyanka Terala-Priyanka changed the base branch from master to RRA-Settings March 26, 2024 05:14
@Terala-Priyanka Terala-Priyanka marked this pull request as ready for review March 26, 2024 11:59
@Terala-Priyanka Terala-Priyanka requested review from manvendra-s-rathore and a team March 26, 2024 12:01
import buildStripes from '../../../test/jest/__new_mocks__/stripesCore.mock';

import {
renderWithRouter, renderWithReduxForm

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"', () => {

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

Copy link
Contributor Author

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!

Copy link

@Terala-Priyanka Terala-Priyanka merged commit 4f3c344 into RRA-Settings Mar 27, 2024
6 checks passed
@Terala-Priyanka Terala-Priyanka deleted the UITEN-276 branch March 27, 2024 11:01
Copy link
Member

@zburke zburke left a 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.

Comment on lines +12 to +49
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'
// }
},
] },
Copy link
Member

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');
Copy link
Member

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',
Copy link
Member

Choose a reason for hiding this comment

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

200:

  1. Do not use magic numbers; use a usefully named constant. This is CS 101.
  2. 200 is almost certainly inadequate
  3. import queryLimit() from @folio/stripes/core, which (eventually) will be implemented to return either stripes-config.maxUnpagedResourceCount (from stripes.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 :/

@Terala-Priyanka
Copy link
Contributor Author

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.

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.

Terala-Priyanka added a commit that referenced this pull request May 2, 2024
* 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.
Terala-Priyanka added a commit that referenced this pull request May 3, 2024
…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
Terala-Priyanka added a commit that referenced this pull request May 7, 2024
…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
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.

4 participants