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

UIORGS-390 Implement organization's banking information form #580

Merged
merged 17 commits into from
Nov 16, 2023

Conversation

usavkov-epam
Copy link
Contributor

@usavkov-epam usavkov-epam commented Nov 14, 2023

Purpose

https://issues.folio.org/browse/UIORGS-390

Certain libraries need to store organization-specific banking and account information in the organization record, independent of the normal account information stored in an organization record.

Approach

  • Move reusable stuff (hooks, utils, constants, etc.) into a shared place;
  • Implement a hooks to prepare banking information for rendering;
  • Implement components for displaying banking information fields: banking information is not in the organization scheme and is handled separately (for security purposes).
  • Implement a mechanism for tracking changes in the values of an organization's banking information: since the information is taken and sent to a separate endpoint, the UI must identify the fields added, changed, and deleted.
  • Handle banking information of form submission (create/edit);
  • Implement event emitter mechanism (based on Event API): the address category options for the banking information fields depend on another part of the organization's form - the addresses in the contact information;
  • Emit an event on address categories change and intercept it in the banking information form;
  • Keep the initial value as an option for a banking information address category field;
  • Cover code with unit tests.

Screenshot

chrome_Oo3kvCIgW6.mp4

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.

@usavkov-epam usavkov-epam self-assigned this Nov 14, 2023
Copy link

github-actions bot commented Nov 14, 2023

Jest Unit Test Statistics

    1 files  ±  0    81 suites  +12   3m 46s ⏱️ + 1m 8s
251 tests +25  251 ✔️ +25  0 💤 ±0  0 ±0 
254 runs  +25  254 ✔️ +25  0 💤 ±0  0 ±0 

Results for commit 31f09ca. ± Comparison against base commit 485f859.

This pull request removes 2 and adds 27 tests. Note that renamed tests count towards both.
SettingsPage should display loading on fetching useBankingInformation ‑ SettingsPage should display loading on fetching useBankingInformation
useBankingInformation should fetch all organization types ‑ useBankingInformation should fetch all organization types
BankingInformationField should render banking information item fields ‑ BankingInformationField should render banking information item fields
EventEmitter should add and invoke event listeners ‑ EventEmitter should add and invoke event listeners
EventEmitter should emit events with the correct data ‑ EventEmitter should emit events with the correct data
EventEmitter should remove event listeners ‑ EventEmitter should remove event listeners
OrganizationBankingInfoForm Interaction with 'Addresses' categories fields should handle change address categories event ‑ OrganizationBankingInfoForm Interaction with 'Addresses' categories fields should handle change address categories event
OrganizationBankingInfoForm Interaction with 'Addresses' categories fields should render categories options based on selected address categories ‑ OrganizationBankingInfoForm Interaction with 'Addresses' categories fields should render categories options based on selected address categories
OrganizationBankingInfoForm should provide banking account types options for the related field ‑ OrganizationBankingInfoForm should provide banking account types options for the related field
OrganizationBankingInfoForm should render RepeatableFieldWithValidation ‑ OrganizationBankingInfoForm should render RepeatableFieldWithValidation
OrganizationCreate should handle banking information on form submit ‑ OrganizationCreate should handle banking information on form submit
OrganizationEdit should handle banking information on form submit ‑ OrganizationEdit should handle banking information on form submit
…

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Nov 14, 2023

BigTest Unit Test Statistics

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

Results for commit 31f09ca. ± Comparison against base commit 485f859.

♻️ This comment has been updated with latest results.

Copy link

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 0 Code Smells

91.2% 91.2% Coverage
0.0% 0.0% Duplication

@usavkov-epam usavkov-epam marked this pull request as ready for review November 15, 2023 20:20
@usavkov-epam usavkov-epam requested review from a team November 15, 2023 20:34
Copy link
Contributor

@alisher-epam alisher-epam left a comment

Choose a reason for hiding this comment

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

LGTM

@usavkov-epam usavkov-epam merged commit e780e54 into master Nov 16, 2023
5 checks passed
@usavkov-epam usavkov-epam deleted the UIORGS-390 branch November 16, 2023 18:08
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