Skip to content

Conversation

@MatteoGuarnaccia5
Copy link
Contributor

@MatteoGuarnaccia5 MatteoGuarnaccia5 commented Nov 12, 2025

Description

see #1472

Note this PR follows on from #1518 but does not need to wait on any PRs in ims-api or ldap

Testing instructions

Add a set up instructions describing how the reviewer should test the code

  • Review code
  • Check Actions build
  • Review changes to test coverage

Agile board tracking

closes #1472

@codecov
Copy link

codecov bot commented Nov 12, 2025

Codecov Report

❌ Patch coverage is 94.85531% with 48 lines in your changes missing coverage. Please review.
✅ Project coverage is 98.66%. Comparing base (31f1ab9) to head (2968c1b).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/systems/systemItemsTable.component.tsx 79.48% 16 Missing ⚠️
src/systems/systemItemsUsageStatuses.component.tsx 96.57% 14 Missing ⚠️
src/items/itemsTable.component.tsx 89.79% 10 Missing ⚠️
src/systems/systemItemsDialog.component.tsx 97.79% 5 Missing ⚠️
src/common/actionMenu.component.tsx 76.92% 3 Missing ⚠️
Additional details and impacted files
@@                          Coverage Diff                           @@
##           implement-base-authorisation-#1472    #1597      +/-   ##
======================================================================
- Coverage                               98.82%   98.66%   -0.17%     
======================================================================
  Files                                     114      115       +1     
  Lines                                   21920    22728     +808     
  Branches                                 2512     2613     +101     
======================================================================
+ Hits                                    21663    22425     +762     
- Misses                                    256      302      +46     
  Partials                                    1        1              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines +138 to +162
const populateUsageStatuses = React.useCallback(() => {
const usageStatusId =
srcSystemTypeId === dstSystemTypeId || selectedRules?.length === 0
? undefined
: selectedRules?.[0]?.dst_usage_status?.id;

setUsageStatuses(
usageStatuses.map((usage_status) => {
return {
...usage_status,
usage_status_id:
usageStatusId ??
selectedItems.find((item) => item.id == usage_status.item_id)
?.usage_status_id ??
'',
};
})
);
}, [
dstSystemTypeId,
selectedItems,
selectedRules,
srcSystemTypeId,
usageStatuses,
]);
Copy link
Contributor

Choose a reason for hiding this comment

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

This works well with the expected current data volume. Just a note: if usage statuses or selected items become large, this population step could weirdness when moving to the next step.
Not urgent, but something to keep an eye on.

@joshdimanteto
Copy link
Contributor

Works well, just a few minor comments to address

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