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

STSMACOM-875 Use <IfAnyPermission> and stripes.hasAnyPerm to check for Notes assign/unassign perm. #1538

Merged
merged 7 commits into from
Nov 25, 2024

Conversation

BogdanDenis
Copy link
Contributor

Description

It seems that permission's replaces property doesn't work as it was expected to, so we have to check for both old and new permission names.
Use <IfAnyPermission> and stripes.hasAnyPerm to check for Notes assign/unassign perm.

Screenshots

image

Issues

STSMACOM-875

@BogdanDenis BogdanDenis requested review from zburke, Dmytro-Melnyshyn and a team November 15, 2024 13:41
Copy link

github-actions bot commented Nov 15, 2024

Bigtest Unit Test Results

  1 files  ±  0    1 suites  ±0   0s ⏱️ -14s
  7 tests  - 501    7 ✅  - 464  0 💤  - 37  0 ❌ ±0 
510 runs  ±  0  510 ✅ + 37  0 💤  - 37  0 ❌ ±0 

Results for commit c7d5600. ± Comparison against base commit 45615a8.

This pull request removes 502 and adds 1 tests. Note that renamed tests count towards both.
Chrome_131_0_0_0_(Linux_x86_64).AddButton when clicking on an option ‑ AddButton when clicking on an option should call "handleAdd" with correct value
Chrome_131_0_0_0_(Linux_x86_64).AddButton ‑ AddButton should not have any a11y issues
Chrome_131_0_0_0_(Linux_x86_64).AddButton ‑ AddButton should render all custom field types
Chrome_131_0_0_0_(Linux_x86_64).AddButton ‑ AddButton should render all custom field types with correct labels
Chrome_131_0_0_0_(Linux_x86_64).AddButton ‑ AddButton should render dropdown
Chrome_131_0_0_0_(Linux_x86_64).Address Edit - React-final-form add address delete address ‑ Address Edit - React-final-form add address delete address calls the delete handler
Chrome_131_0_0_0_(Linux_x86_64).Address Edit - React-final-form add address delete address ‑ Address Edit - React-final-form add address delete address has a single address
Chrome_131_0_0_0_(Linux_x86_64).Address Edit - React-final-form add address ‑ Address Edit - React-final-form add address adds a new form
Chrome_131_0_0_0_(Linux_x86_64).Address Edit - React-final-form add address ‑ Address Edit - React-final-form add address calls the add handler
Chrome_131_0_0_0_(Linux_x86_64).Address Edit - React-final-form ‑ Address Edit - React-final-form has a single address
…
Chrome_131_0_0_0_(Linux_x86_64).DeleteModal when fields stats have loaded when checking for a11y issues ‑ DeleteModal when fields stats have loaded when checking for a11y issues should not have any a11y issues

♻️ This comment has been updated with latest results.

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.

Code changes LGTM but please make sure to set the minimum stripes-core version correctly in package.json: <IfAny> requires ^10.2.3.

package.json Outdated
@@ -47,7 +47,7 @@
"@folio/stripes-cli": "^3.0.0",
"@folio/stripes-components": "^12.0.0",
"@folio/stripes-connect": "^9.0.0",
"@folio/stripes-core": "^10.0.0",
"@folio/stripes-core": "^10.2.0",
Copy link
Member

Choose a reason for hiding this comment

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

<IfAny> doesn't show up until ^10.2.3

@BogdanDenis BogdanDenis force-pushed the STSMACOM-875 branch 4 times, most recently from 6104fa4 to 3bb7e18 Compare November 19, 2024 16:22
zburke pushed a commit to folio-org/stripes-core that referenced this pull request Nov 21, 2024
…ks (#1564)

Updating `stripes-core` in SSC causes 30+ tests to fail.
folio-org/stripes-smart-components#1538
This PR addresses some issues which cause these failures.

Overwriting of initial okapi and discovery data in `setupApplication`
helper. Some tests require custom okapi data, but `setupApplication` in
some cases can overwrite that data which makes those tests fail.

Still investigating a few failing tests so maybe there's something
else that needs to be fixed.
@BogdanDenis BogdanDenis force-pushed the STSMACOM-875 branch 3 times, most recently from d43d302 to bcace68 Compare November 25, 2024 17:12
@BogdanDenis BogdanDenis merged commit fee9ec8 into master Nov 25, 2024
15 checks passed
@BogdanDenis BogdanDenis deleted the STSMACOM-875 branch November 25, 2024 21:17
zburke pushed a commit to folio-org/stripes-core that referenced this pull request Dec 2, 2024
…ks (#1564)

Updating `stripes-core` in SSC causes 30+ tests to fail.
folio-org/stripes-smart-components#1538
This PR addresses some issues which cause these failures.

Overwriting of initial okapi and discovery data in `setupApplication`
helper. Some tests require custom okapi data, but `setupApplication` in
some cases can overwrite that data which makes those tests fail.

Still investigating a few failing tests so maybe there's something
else that needs to be fixed.

(cherry picked from commit 1c73afd)
zburke pushed a commit that referenced this pull request Dec 10, 2024
…k for Notes assign/unassign perm. (#1538)

## Description
It seems that permission's `replaces` property doesn't work as it was
expected to, so we have to check for both old and new permission names.
Use `<IfAnyPermission>` and `stripes.hasAnyPerm` to check for Notes
assign/unassign perm.

## Screenshots

![image](https://github.com/user-attachments/assets/079600d9-5e93-4ab2-8196-a0d78c08975c)

## Issues
[STSMACOM-875](https://folio-org.atlassian.net/browse/STSMACOM-875)

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