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

UIIN-2590: ECS: Show info message when user in member tenant tries to view shared instance details without permission #2328

Merged
merged 3 commits into from
Nov 6, 2023

Conversation

mariia-aloshyna
Copy link
Contributor

@mariia-aloshyna mariia-aloshyna commented Nov 3, 2023

Purpose

If a user is on a member tenant and wants to view details of a shared instance retrieved in an Inventory search, the user must have the central tenant permission: Inventory: Can view instances, holdings, items. Otherwise they see 3 dots. This bugfix replaces the 3 dots with a better indication of the problem.

Approach

  • Implement InstanceWarningPane and InstanceLoadingPane as separate components
  • InstanceWarningPane shows the pure instance pane with a warning banner instead of details
  • InstanceLoadingPane shows the pure instance pane with a loading spinner instead of details
  • Move the check of instance loading or error upper to ViewInstanceWrapper to avoid redundant instance properties checks when the instance is empty yet.
  • Check whether the user lacks permission to view shared instances and display a warning message if so. I wanted to check it using centralTenantPermissions but realized that this request also can be failed, so decided to just check for response error status code.
  • Adjust unit tests

Refs

https://issues.folio.org/browse/UIIN-2590

Screenshots

image

Copy link

github-actions bot commented Nov 3, 2023

Jest Unit Test Statistics

    1 files  ±  0  228 suites  +2   10m 57s ⏱️ - 3m 17s
899 tests +10  897 ✔️ +11  2 💤 ±0  0  - 1 
904 runs  +10  902 ✔️ +11  2 💤 ±0  0  - 1 

Results for commit c94699d. ± Comparison against base commit 0ac2099.

♻️ This comment has been updated with latest results.

… view shared instance details without permission
src/ViewInstanceWrapper.js Outdated Show resolved Hide resolved
src/common/hooks/useInstance.js Outdated Show resolved Hide resolved
src/common/hooks/useInstanceQuery/useInstanceQuery.js Outdated Show resolved Hide resolved
Copy link

sonarqubecloud bot commented Nov 6, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 9 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@mariia-aloshyna mariia-aloshyna merged commit 6515018 into master Nov 6, 2023
4 checks passed
@mariia-aloshyna mariia-aloshyna deleted the UIIN-2590 branch November 6, 2023 14:24
mariia-aloshyna added a commit that referenced this pull request Nov 8, 2023
… view shared instance details without permission (#2328)

(cherry picked from commit 6515018)
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.

3 participants