[OSDEV-1397] Facilities. Avoid invoking api/parent-companies/ request on page load#473
Conversation
React App | Jest test suite - Code coverage reportTotal: 27.72%Your code coverage diff: 0.02% ▴ ✅ All code changes are covered |
|
Warning Rate limit exceeded@Innavin369 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 36 minutes and 16 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis pull request introduces several significant changes to the Open Supply Hub project. Two new PATCH endpoints have been added for creating contributions to production locations and moderation events. The changes include disabling dynamic mapping for certain fields in the Changes
Possibly related PRs
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
src/react/src/components/FilterSidebarExtendedSearch.jsx (2)
47-47: Verify naming consistency.Declaring
customSelectComponentsis a fine approach; however, ensure naming consistency for future enhancements. If you plan to add other custom UI elements beyond removing the DropdownIndicator, consider a name such asselectCustomComponentsto reflect broader usage.
343-343: Ensure consistent naming for fetch/loading states.
fetchingNumberofWorkersshould conform to existing naming conventions (e.g.,fetchingNumberOfWorkers) for clarity and consistency. Check for other similarly named variables to maintain uniform code style.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
doc/release/RELEASE-NOTES.md(1 hunks)src/react/src/components/FilterSidebarExtendedSearch.jsx(3 hunks)
🔇 Additional comments (1)
doc/release/RELEASE-NOTES.md (1)
29-29: Documentation matches code changes.
The removal of GET /api/parent-companies/ is correctly documented. This aligns with the new approach of a regular input field for adding multiple parent company names directly on the page.
Dedupe Hub App | Unittest test suite - Code coverage reportTotal: 56.14%Your code coverage diff: 0.00% ▴ ✅ All code changes are covered |
Contricleaner App | Unittest test suite - Code coverage reportTotal: 98.91%Your code coverage diff: 0.00% ▴ ✅ All code changes are covered |
Countries App | Unittest test suite - Code coverage reportTotal: 100%Your code coverage diff: 0.00% ▴ ✅ All code changes are covered |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/react/src/components/FilterSidebarExtendedSearch.jsx (1)
Line range hint
1-364: Great architectural improvement!The transformation of the parent company field from a pre-loaded select to a creatable input:
- Improves initial page load performance
- Provides better user experience with immediate input capability
- Reduces component complexity by removing unnecessary state management
Consider applying this pattern to other similar fields where pre-loading options might not be necessary, such as the Product Type field which is already using the creatable approach.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
doc/release/RELEASE-NOTES.md(1 hunks)src/react/src/components/FilterSidebarExtendedSearch.jsx(3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (13)
- GitHub Check: run-integration-test-code-quality
- GitHub Check: run-flake8-linter
- GitHub Check: run-eslint-linter-and-prettier-formatter
- GitHub Check: run-fe-code-quality
- GitHub Check: run-django-code-quality
- GitHub Check: run-dd-code-quality
- GitHub Check: run-countries-code-quality
- GitHub Check: run-contricleaner-code-quality
- GitHub Check: get-base-branch-fe-cov
- GitHub Check: get-base-branch-dd-cov
- GitHub Check: get-base-branch-contricleaner-cov
- GitHub Check: get-base-branch-django-cov
- GitHub Check: get-base-branch-countries-cov
🔇 Additional comments (3)
doc/release/RELEASE-NOTES.md (1)
29-29: LGTM! Clear and accurate release note.The release note entry clearly describes the change and its impact:
- Removal of the GET request
- Replacement with a regular input field
- New functionality for creating multiple parent company names
src/react/src/components/FilterSidebarExtendedSearch.jsx (2)
307-307: LGTM! Loading state calculation simplified.The removal of parent companies from the
fetchingExtendedOptionscalculation aligns with the PR's objective to eliminate the parent companies API dependency.Also applies to: 340-340
174-175: LGTM! Changes align with PR objectives.The modifications to the Parent Company select field successfully:
- Remove dependency on pre-loaded options, eliminating the unnecessary API call
- Maintain accessibility with proper
aria-label- Simplify the loading state by only considering
fetchingFacilitiesLet's verify that the parent companies API endpoint is no longer called on page load:
✅ Verification successful
Verification successful: Parent companies API is not called on page load
The remaining reference to
/api/parent-companies/inutil.jsis just a URL constructor utility that isn't imported or used by the modified component, confirming that the API is no longer called during page load.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify removal of parent companies API call # Search for any remaining references to the parent companies API endpoint rg -l "api/parent-companies" --type jsLength of output: 65
Script:
#!/bin/bash # Check the context of parent-companies API usage in util.js echo "=== util.js content around parent-companies API ===" rg -C 5 "api/parent-companies" src/react/src/util/util.js echo -e "\n=== Checking imports in FilterSidebarExtendedSearch.jsx ===" rg "import.*util" src/react/src/components/FilterSidebarExtendedSearch.jsxLength of output: 1030
|



OSDEV-1397
GET
/api/parent-companies/request has been removed from the Open Supply Hub page and ClaimFacility component. Parent Company Select is a regular input field that allows the creation of multiple parent company names for filter on this page.