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

UINV-470: Invoices - Show in version history record view, which fields have been edited #827

Merged
merged 13 commits into from
Nov 21, 2024

Conversation

alisher-epam
Copy link
Contributor

@alisher-epam alisher-epam commented Nov 14, 2024

Purpose

UINV-470: Invoices - Show in version history record view, which fields have been edited

Approach

Screen.Recording.2024-11-19.at.20.36.53.mp4

Screenshots

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.

@alisher-epam alisher-epam self-assigned this Nov 14, 2024
Copy link

github-actions bot commented Nov 14, 2024

Jest Unit Test Statistics

    1 files  ±0  122 suites  +4   3m 36s ⏱️ +13s
377 tests +6  377 ✔️ +6  0 💤 ±0  0 ±0 
382 runs  +6  382 ✔️ +6  0 💤 ±0  0 ±0 

Results for commit b57257f. ± Comparison against base commit d68e810.

This pull request removes 3 and adds 9 tests. Note that renamed tests count towards both.
VersionView should display children when isLoading is false and versionId exists ‑ VersionView should display children when isLoading is false and versionId exists
VersionView should display loading pane when isLoading is true ‑ VersionView should display loading pane when isLoading is true
VersionView should display no version message when isLoading is false and versionId does not exist ‑ VersionView should display no version message when isLoading is false and versionId does not exist
VersionHistoryViewInvoiceLine should display Loading component ‑ VersionHistoryViewInvoiceLine should display Loading component
VersionHistoryViewInvoiceLine should display invoice line description ‑ VersionHistoryViewInvoiceLine should display invoice line description
useInvoiceLinesByInvoiceId should return empty invoiceLines if invoiceId is not provided ‑ useInvoiceLinesByInvoiceId should return empty invoiceLines if invoiceId is not provided
useInvoiceLinesByInvoiceId should return invoice lines by invoiceId ‑ useInvoiceLinesByInvoiceId should return invoice lines by invoiceId
useOrdersByPoNumbers should display adjustments and poLines ‑ useOrdersByPoNumbers should display adjustments and poLines
useOrdersByPoNumbers should render component ‑ useOrdersByPoNumbers should render component
useOrdersByPoNumbers should return empty orders if PO numbers are not provided ‑ useOrdersByPoNumbers should return empty orders if PO numbers are not provided
useOrdersByPoNumbers should return orders by PO numbers ‑ useOrdersByPoNumbers should return orders by PO numbers
useSelectedInvoiceVersion should return Invoice version data ‑ useSelectedInvoiceVersion should return Invoice version data

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Nov 14, 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 b57257f. ± Comparison against base commit d68e810.

♻️ This comment has been updated with latest results.

@alisher-epam alisher-epam requested review from usavkov-epam and a team November 19, 2024 18:46
@OleksandrHladchenko1 OleksandrHladchenko1 requested a review from a team November 20, 2024 12:07
return ky.get(CONFIG_API, { searchParams }).json();
};

export const getVersionMetadata = (version, entity) => ({
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks as a reusable tool for all modules, that will use version history approach. It makes sense to keep it in acq-components lib

MODULE_TENANT,
} from '@folio/stripes-acq-components';

export const getTenantAddresses = (ky) => async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

It's not a organization version's specific request to be placed here. Moreover there is a useAddresses in acq lib, probably it should satisfy fetching of addresses in useSelectedInvoiceVersion. If you need exacly a function instead of a hook, I suggest keeping it in acq lib as well here https://github.com/folio-org/stripes-acq-components/tree/master/lib/utils/api

addressesMap,
] = await Promise.all([
fetchOrganizationsByIds(ky)(organizationIds).then(({ organizations }) => keyBy(organizations, 'id')),
fetchExportDataByIds({
Copy link
Contributor

Choose a reason for hiding this comment

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

There are the same code in another module https://github.com/folio-org/ui-orders/blob/master/src/common/utils/getAcqUnitsByIds.js

It's an indicator to keep it in the shared place (ACQ lib). Could be implemented consistently with existing methodshttps://github.com/folio-org/stripes-acq-components/tree/master/lib/utils/api

api: ACQUISITIONS_UNITS_API,
records: 'acquisitionsUnits',
}).then(data => keyBy(data, 'id')),
getTenantAddresses(ky)()
Copy link
Contributor

Choose a reason for hiding this comment

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

The same here, duplication should be reduced since version history will spread in other modules

Copy link

sonarcloud bot commented Nov 21, 2024

@alisher-epam alisher-epam merged commit 55abd79 into master Nov 21, 2024
6 checks passed
@alisher-epam alisher-epam deleted the UINV-470 branch November 21, 2024 10:05
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