Skip to content

OBPIH-7541 Create UI for new reorder report#5571

Merged
alannadolny merged 7 commits intodevelopfrom
ft/OBPIH-7541
Oct 29, 2025
Merged

OBPIH-7541 Create UI for new reorder report#5571
alannadolny merged 7 commits intodevelopfrom
ft/OBPIH-7541

Conversation

@alannadolny
Copy link
Collaborator

No description provided.

@alannadolny alannadolny self-assigned this Oct 27, 2025
@github-actions github-actions bot added type: feature A new piece of functionality for the app domain: frontend Changes or discussions relating to the frontend UI domain: backend Changes or discussions relating to the backend server domain: l10n Changes or discussions relating to localization & Internationalization labels Oct 27, 2025
@codecov
Copy link

codecov bot commented Oct 27, 2025

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 8.50%. Comparing base (1bb7314) to head (d05fc15).
⚠️ Report is 160 commits behind head on develop.

Files with missing lines Patch % Lines
...pih/warehouse/inventory/InventoryController.groovy 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             develop   #5571      +/-   ##
============================================
- Coverage       9.12%   8.50%   -0.62%     
+ Complexity      1170    1113      -57     
============================================
  Files            701     707       +6     
  Lines          45281   45452     +171     
  Branches       10851   10886      +35     
============================================
- Hits            4131    3867     -264     
- Misses         40497   41011     +514     
+ Partials         653     574      -79     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

columns,
tableData,
loading,
emptyTableMessage,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why did you remove emptyTableMessage here but not also in useProductsTab? If we really want to remove it I think we should also remove it from useProductsTab 🤔

Copy link
Collaborator

Choose a reason for hiding this comment

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

I will ask differently - why was this file even touched? Were you just testing something for the table and forgot to bring back or?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

uh, I did it by mistake 😢

Comment on lines +4839 to +4841
react.report.reorder.category.label=Category
react.report.reorder.tags.label=Tags
react.report.reorder.loadTable.label=Load table
Copy link
Collaborator

@SebastianLib SebastianLib Oct 27, 2025

Choose a reason for hiding this comment

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

From what I see, we declare the same things a few times for example "Tags" (react.productsList.filters.tags.label, react.cycleCount.filter.tags.label, and now react.report.reorder.tags.label). Maybe we should create a common key for example react.default.filters.tags. Right now, while working on my current ticket, I’m facing the same issue where I have to write the same translations multiple times for different things. What do you think @alannadolny @kchelstowski

Copy link
Collaborator

Choose a reason for hiding this comment

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

@SebastianLib this is a larger conversation and refactor. I think the current reason for doing it this way is not to have to eventually pull translations for another feature (e.g. if we were to use the productLists.filters.tags, we'd have to inject the whole productList.* list of translations.

onSubmit={updateFilterParams}
onSubmit={(values) => {
updateFilterParams(values);
onSubmit(values);
Copy link
Collaborator

Choose a reason for hiding this comment

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

not a big deal, but wouldn't it actually be cleaner if we had the onSubmit null by default and here say:

if (onSubmit) {
  ...
}

By just looking at this part it feels like it's always triggered (I know it's an empty function), so my suggestion would be to make an explicit if, but I leave it up to you

columns,
tableData,
loading,
emptyTableMessage,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I will ask differently - why was this file even touched? Were you just testing something for the table and forgot to bring back or?

import 'components/cycleCount/cycleCount.scss';

const ReorderReport = () => {
useTranslation('report');
Copy link
Collaborator

Choose a reason for hiding this comment

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

@SebastianLib this is the reason we wouldn't want to use productList's label, because we'd have to fetch all of them here.
I agree with you in general and we have plans to somehow standardize that, but it's a larger topic.

@@ -0,0 +1,86 @@
import FilterSelectField from 'components/form-elements/FilterSelectField';
import {
getExpiredStockOptions, getFilterProductOptions,
Copy link
Collaborator

Choose a reason for hiding this comment

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

doesn't eslint shout about those two being in one line?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, it doesn't shout, so I often forget about splitting those into separate lines

showFilterVisibilityToggler={false}
showSearchField={false}
allowEmptySubmit
customSubmitButtonDefaultLabel="Load table"
Copy link
Collaborator

Choose a reason for hiding this comment

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

should this be called like that if we don't have the table at the moment? I believe this should be rather Download report?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, this is how it was requested in the ticket

@@ -0,0 +1,102 @@
import translate from 'utils/Translate';

export const OPTION_ID = {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think for clarity it's better to separate the enums here and have ExpirationFilter and InventoryLevelStatus like on backend.

@@ -0,0 +1,102 @@
import translate from 'utils/Translate';
Copy link
Collaborator

Choose a reason for hiding this comment

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

actually it's the first time I see such import. What method is triggered then? Isn't it actually a JSX Translate element that is returned? I'm wondering why we use useTranslate in a few places and in few places we import translate like that. I know it's a simple JS file so we can't use useTranslate, but if this works, what you have just done, why would we even need the useTranslate hook 🤔
Not something to fix, just curiosity if you already know the answer

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

So the translation is the TranslateWrapper function (or call it a component) that returns . It gets translated because it is in the translation context. The translate returns HTML, and it is successfully mapped to options in the select. So here is the difference between that and the useTranslate, one of them returns HTML, while the second returns a plain, translated text.

tags: selectedTags,
} = queryProps;

// If there are no values for catalogs, tags, glAccounts, categories or product family
Copy link
Collaborator

Choose a reason for hiding this comment

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

update the comment

&& !selectedFilterProducts
&& !expiredStock
&& !additionalInventoryLocations) {
setDefaultFilterValues(defaultValues);
Copy link
Collaborator

Choose a reason for hiding this comment

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

shouldn't we return at this point?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

nope

return response.data.data;
};

export const fetchLocations = async ({ activityCodes }) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

how did it end up? Was it finally be supposed to be a debounced fetch or not?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, it doesn't need to be debounced

@alannadolny alannadolny merged commit 29552c9 into develop Oct 29, 2025
7 checks passed
@alannadolny alannadolny deleted the ft/OBPIH-7541 branch October 29, 2025 09:47
SebastianLib pushed a commit that referenced this pull request Oct 30, 2025
# Conflicts:
#	grails-app/i18n/messages.properties
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain: backend Changes or discussions relating to the backend server domain: frontend Changes or discussions relating to the frontend UI domain: l10n Changes or discussions relating to localization & Internationalization type: feature A new piece of functionality for the app

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants