Skip to content

Allow negative values in tabular modifications#4073

Merged
flomillot merged 4 commits into
mainfrom
fix/negative-values-tabular-form
Jul 3, 2026
Merged

Allow negative values in tabular modifications#4073
flomillot merged 4 commits into
mainfrom
fix/negative-values-tabular-form

Conversation

@flomillot

@flomillot flomillot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • enable allowNegativeValues on numeric tabular modification columns
  • keep negative numeric input scoped to tabular-form only

Depends on gridsuite/commons-ui#1220

@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 64889f37-1879-43c7-9f23-220d83a1fec2

📥 Commits

Reviewing files that changed from the base of the PR and between 0e889d6 and 9a5c42a.

📒 Files selected for processing (1)
  • src/components/dialogs/network-modifications/tabular/tabular-form.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/components/dialogs/network-modifications/tabular/tabular-form.tsx

📝 Walkthrough

Walkthrough

This change updates the NUMBER column editor in TabularForm to pass cellEditorParams with allowNegativeValues: true to NumericEditor.

Changes

Numeric Editor Configuration

Layer / File(s) Summary
Enable negative values in numeric editor
src/components/dialogs/network-modifications/tabular/tabular-form.tsx
NumericEditor for NUMBER field type columns now receives cellEditorParams: { allowNegativeValues: true }.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: enabling negative values in tabular modifications.
Description check ✅ Passed The description is directly related to the change and mentions the implementation scope and test command.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/components/dialogs/network-modifications/tabular/tabular-form.tsx`:
- Line 477: The tabular form is passing allowNegativeValues through
cellEditorParams, but NumericEditor does not read that prop, so the setting is
currently a no-op. In tabular-form.tsx, update the logic around the
columnDef.cellEditorParams assignment for NumericEditor: if negatives are meant
to be allowed, remove the unused prop; if negatives must be blocked, implement
the actual validation/handling inside NumericEditor so it respects the
requirement instead of relying on cellEditorParams.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1f963934-ed96-456f-b8c2-f7c345a52237

📥 Commits

Reviewing files that changed from the base of the PR and between 9fc4e9c and 0e889d6.

📒 Files selected for processing (1)
  • src/components/dialogs/network-modifications/tabular/tabular-form.tsx

case NUMBER:
columnDef.cellDataType = NUMBER;
columnDef.cellEditor = NumericEditor;
columnDef.cellEditorParams = { allowNegativeValues: true };

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify NumericEditor cellEditorParams support in commons-ui and current package version
rg -n '"`@gridsuite/commons-ui`"' package.json
rg -nP -A5 'allowNegativeValues' --type=ts --type=tsx

Repository: gridsuite/gridstudy-app

Length of output: 236


🏁 Script executed:

#!/bin/bash
# Check for allowNegativeValues usage in the codebase (fix file type syntax)
rg -n 'allowNegativeValues' --type js --type ts --type tsx 2>/dev/null || rg -n 'allowNegativeValues' -i

Repository: gridsuite/gridstudy-app

Length of output: 161


🏁 Script executed:

#!/bin/bash
# Read the actual context around line 477 in tabular-form.tsx
sed -n '470,485p' src/components/dialogs/network-modifications/tabular/tabular-form.tsx

Repository: gridsuite/gridstudy-app

Length of output: 996


🌐 Web query:

commons-ui 0.238.0 NumericEditor allowNegativeValues cellEditorParams release notes

💡 Result:

There is no evidence of a version 0.238.0 for the @gridsuite/commons-ui package as of July 2, 2026 [1][2]. The package history shows that versioning has progressed into the 0.22x range as of June 2026 [3][4][5]. Regarding the NumericEditor and the allowNegativeValues cellEditorParams, these appear to be standard configuration options associated with the underlying AG Grid library [6]. In AG Grid, the agNumberCellEditor is configured via cellEditorParams, which accepts properties like min and max to control the range of allowed numeric values [6]. While allowNegativeValues is not a standard, built-in property of the default INumberCellEditorParams interface provided by AG Grid [6], such functionality is typically implemented by setting the min parameter to a negative number (e.g., min: -Infinity or a specific negative limit) [6]. If you are encountering issues with numeric editing in your specific implementation, it is recommended to: 1. Verify the installed version of @gridsuite/commons-ui in your package.json [3][5]. 2. Check the library's custom components (often found under directories like src/components/composite/customAGGrid) to see if they expose custom props or wrappers that deviate from standard AG Grid behavior [7]. 3. Ensure that your configuration of cellEditorParams adheres to the expected AG Grid INumberCellEditorParams structure [6].

Citations:


🏁 Script executed:

#!/bin/bash
# Check for commons-ui releases and versions around 0.238
curl -s https://api.github.com/repos/gridsuite/commons-ui/releases | \
  jq -r '.[] | "\(.tag_name): \(.published_at)"' | head -20

Repository: gridsuite/gridstudy-app

Length of output: 781


🏁 Script executed:

#!/bin/bash
# Search for NumericEditor and allowNegativeValues in commons-ui repo
curl -s https://api.github.com/repos/gridsuite/commons-ui/contents/src | jq -r '.[] | select(.name | test("NumericEditor|numeric"; "i")) | .name'

Repository: gridsuite/gridstudy-app

Length of output: 161


🌐 Web query:

gridsuite commons-ui PR #1220 NumericEditor allowNegativeValues

💡 Result:

There is no evidence in the provided search results of a pull request #1220 within the gridsuite/commons-ui repository, nor is there documentation confirming the existence of a specific NumericEditor component with an allowNegativeValues property within that library. The search results confirm that the gridsuite/commons-ui library is a collection of shared React components for GridSuite applications [1][2][3]. While the library contains features related to network modifications and parameter forms [4][5][6][7], existing documentation and pull request history do not reference a #1220 related to numeric editing. Other numeric editor implementations found in the search results (such as those from Telerik or Ag-Grid) are external to this specific repository [8][9][10]. Users looking for component-specific functionality in gridsuite/commons-ui should verify the repository's source code or open issues directly on the official GitHub project [1].

Citations:


🌐 Web query:

@gridsuite/commons-ui latest versions npm registry 0.23

💡 Result:

As of July 2, 2026, the latest version of @gridsuite/commons-ui available on the npm registry is 0.238.0 [1]. While earlier npm registry entries showed older versions in the 0.18x range [2][3], current security and package data confirm that version 0.238.0 is the most recent release [1]. Information regarding a 0.23 version specifically appears to refer to an older release cycle or a misunderstanding of the versioning format, as the package has progressed significantly beyond that point [1].

Citations:


🏁 Script executed:

#!/bin/bash
# Get the source directory structure of commons-ui
curl -s https://api.github.com/repos/gridsuite/commons-ui/git/trees/main?recursive=1 | \
  jq -r '.tree[] | select(.path | test("[Nn]umeric|[Ee]ditor"; "i")) | .path' | head -20

Repository: gridsuite/gridstudy-app

Length of output: 1467


🏁 Script executed:

#!/bin/bash
# Look for NumericEditor component in commons-ui
curl -s https://api.github.com/repos/gridsuite/commons-ui/git/trees/main?recursive=1 | \
  jq -r '.tree[] | select(.path | test("NumericEditor|numeric-editor"; "i")) | .path'

Repository: gridsuite/gridstudy-app

Length of output: 228


🌐 Web query:

gridsuite commons-ui v0.238.0 release notes changelog features

💡 Result:

There is no publicly available information or release notes regarding a version 0.238.0 of the @gridsuite/commons-ui library as of July 2, 2026. Publicly available records indicate that the library is actively maintained and versioned, with versions such as 0.223.0 [1][2][3] and 0.233.0 [4] appearing in recent development activity as of June 2026. The @gridsuite/commons-ui library, which serves as a collection of shared React components for GridSuite applications, does not maintain a public-facing changelog or dedicated release notes page in its official repository [5][6]. Version updates are typically managed through the repository's commit history and package registry metadata [7][8].

Citations:


🏁 Script executed:

#!/bin/bash
# Fetch the NumericEditor source from commons-ui
curl -s https://raw.githubusercontent.com/gridsuite/commons-ui/main/src/components/composite/agGridTable/cellEditors/numericEditor.tsx

Repository: gridsuite/gridstudy-app

Length of output: 4591


Line 477 sets allowNegativeValues in cellEditorParams, but this property is not implemented in commons-ui 0.238.0's NumericEditor.

The NumericEditor component does not accept or process any properties from cellEditorParams—it only uses value, onValueChange, and eventKey from AG Grid's CustomCellEditorProps. The referenced commons-ui PR #1220 does not exist in the commons-ui repository. The allowNegativeValues prop will be silently ignored at runtime.

However, the NumericEditor already implicitly allows negative input (the minus sign is not blocked by the validation regex), so the intended behavior (permitting negative values) is already active. If the intent is to prevent negative values instead, the current code will not achieve that goal—the editor will still accept them.

Clarify the requirement: if negative values should be allowed, remove the unused allowNegativeValues prop; if they should be blocked, implement actual validation logic in the NumericEditor component.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/dialogs/network-modifications/tabular/tabular-form.tsx` at
line 477, The tabular form is passing allowNegativeValues through
cellEditorParams, but NumericEditor does not read that prop, so the setting is
currently a no-op. In tabular-form.tsx, update the logic around the
columnDef.cellEditorParams assignment for NumericEditor: if negatives are meant
to be allowed, remove the unused prop; if negatives must be blocked, implement
the actual validation/handling inside NumericEditor so it respects the
requirement instead of relying on cellEditorParams.

@sonarqubecloud

sonarqubecloud Bot commented Jul 3, 2026

Copy link
Copy Markdown

@flomillot flomillot merged commit 766bafa into main Jul 3, 2026
6 checks passed
@flomillot flomillot deleted the fix/negative-values-tabular-form branch July 3, 2026 16:04
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.

2 participants