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-3187: ECS: Disable opening item details if a user is not affiliated with item's member tenant #2707

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mariia-aloshyna
Copy link
Contributor

Purpose

When users are trying to find the item by barcode then they are getting error popup "Invalid token: User with id ... does not exist". It happens when there is only 1 search result and the item details page is trying to open, but the request failes because a user is not affiliated with the item's member tenant.

Approach

  • Check if a user is affiliated with the item's member tenant before sending a request to get item details.

Refs

https://folio-org.atlassian.net/browse/UIIN-3187

Screenshots

Copy link

github-actions bot commented Jan 9, 2025

Jest Unit Test Statistics

       1 files  ±0     255 suites  ±0   15m 2s ⏱️ +17s
1 023 tests ±0  1 014 ✔️  - 7  2 💤 ±0  7 +7 
1 030 runs  ±0  1 021 ✔️  - 7  2 💤 ±0  7 +7 

For more details on these failures, see this check.

Results for commit 4efff99. ± Comparison against base commit 8657bbe.

♻️ This comment has been updated with latest results.

Comment on lines 1216 to 1242
const isUserAffiliatedWithMemberTenant = checkIfUserInMemberTenant(stripes);

// if a user is not affiliated with the item's member tenant then item details cannot be open
if (!isUserAffiliatedWithMemberTenant) {
return instance;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This code prevents all member tenants from auto-openning the item view. Is this what you want? It looks like it also prevents all non-ECS users.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh right, that's just me being stupid yesterday and thinking that the checkIfUserInMemberTenant function checks whether the user is affiliated with a member tenant. Ok, nevermind, I updated the PR

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.

2 participants