[OSDEV-1748] Align SLC with current v1/production-locations validation.#520
Conversation
…ask description, removed validation for number_of_workers min>=max
React App | Jest test suite - Code coverage reportTotal: 29.6%Your code coverage diff: 0.09% ▴ ✅ All code changes are covered |
📝 WalkthroughWalkthroughThis pull request updates the project’s release notes for version 2.0.0 and introduces several changes across the database schema, API endpoints, and frontend utility functions. A new database field ( Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant API_Server as API Server
participant Database
Client->>API_Server: GET /api/v1/production-locations?bbox=...
API_Server->>API_Server: Validate geo-bounding box parameters
API_Server->>Database: Query production locations within bounding box
Database-->>API_Server: Return matching records
API_Server-->>Client: Respond with filtered location data
Possibly related PRs
Suggested reviewers
✨ Finishing Touches
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 (
|
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 |
Django App | Unittest test suite - Code coverage reportTotal: 80.44%Your code coverage diff: 0.04% ▴ ✅ All code changes are covered |
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/react/src/util/util.js (1)
1458-1477: LGTM! Clean refactor with improved field handling.The changes effectively:
- Remove unfilled fields
- Transform field values consistently
- Handle number_of_workers and country fields appropriately
A minor suggestion to improve readability:
- const { numberOfWorkers, country, ...fields } = contribData; + const { + numberOfWorkers, + country, + ...fields + } = contribData;
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/react/src/util/util.js(3 hunks)
🧰 Additional context used
🧠 Learnings (1)
src/react/src/util/util.js (1)
Learnt from: VadimKovalenkoSNF
PR: opensupplyhub/open-supply-hub#470
File: src/react/src/util/util.js:1441-1472
Timestamp: 2025-01-29T09:00:01.638Z
Learning: The data passed to parseContribData() function in src/react/src/util/util.js is pre-parsed and validated before reaching the function, so additional type checking is not required.
⏰ 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-fe-code-quality
- GitHub Check: run-eslint-linter-and-prettier-formatter
- 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-django-cov
- GitHub Check: get-base-branch-countries-cov
- GitHub Check: get-base-branch-contricleaner-cov
🔇 Additional comments (2)
src/react/src/util/util.js (2)
1437-1442: LGTM! Robust implementation for handling both array and non-array inputs.The function safely extracts values from both array and non-array inputs, with proper null-safety using optional chaining.
1454-1454: LGTM! Ensures consistent number type output.The modification ensures that both min and max values are properly converted to numbers, maintaining type consistency.
roman-stolar
left a comment
There was a problem hiding this comment.
LGTM
@VadimKovalenkoSNF @Innavin369 One question, so from now user could put any data to number_of_workers and it will be parsed by rules in generateRangeField method but no exception will be raised? Is it correct scenario?
|
@roman-stolar In case of SLC we have FE validation. |
|
Got it! |



OSDEV-1748 Moderation Queue. Align SLC with current v1/production-locations validation.