feat: show admin figma-ux correlation fixes#831
feat: show admin figma-ux correlation fixes#831priscila-moneo wants to merge 1 commit intomasterfrom
Conversation
|
Warning Rate limit exceeded
⌛ 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. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (12)
📝 WalkthroughWalkthroughThis PR adds new date fields ( Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/components/mui/editable-table/mui-table-editable.module.less (1)
4-13:⚠️ Potential issue | 🟡 Minor
align-self: centerhas no effect on absolutely positioned elements.The
::beforepseudo-element isposition: absolute, soalign-selfwon't center it vertically. The border will render starting fromtop: 0with 60% height rather than being vertically centered.To center the dotted border vertically:
🔧 Proposed fix
&::before { content: ""; position: absolute; - top: 0; - bottom: 0; + top: 50%; left: 0; border-left: 1px dashed `#e0e0e0`; height: 60%; - align-self: center; + transform: translateY(-50%); }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/components/mui/editable-table/mui-table-editable.module.less` around lines 4 - 13, The ::before pseudo-element in the &::before rule is absolutely positioned so align-self: center is ignored; update the &::before styles (the pseudo-element selector) to vertically center the 60% height dashed border by removing the conflicting top: 0 and bottom: 0 and instead use top: 50% plus transform: translateY(-50%) (keep height: 60% and border-left as-is) so the dashed line is centered vertically within the container.
🧹 Nitpick comments (2)
src/i18n/en.json (1)
2669-2669: Minor key-value semantic mismatch.The key
imagesuses plural form but the value is now singular"Image File". This works functionally but could cause confusion when maintaining the codebase. Consider renaming the key toimage_fileorimageif it refers to a single image upload section, or keep as-is if this is intentional for backward compatibility.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/i18n/en.json` at line 2669, The i18n key "images" is plural but its value is singular ("Image File"), causing a semantic mismatch; either rename the key to "image_file" or "image" and update all references (e.g., any i18n.t('images') or t('images') usages) to the new key, or alternatively change the value to a plural phrase ("Image Files") to match the existing key; if you must preserve backward compatibility, add the new key with the correct singular value and keep "images" as an alias (or vice versa) and mark the old key for deprecation.package.json (1)
92-92: Update dependency to stable version.The package.json pins
openstack-uicore-foundationto4.2.25-beta.1, but the latest stable version is4.2.23. Update to the stable release unless there is a specific requirement for the prerelease features.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@package.json` at line 92, The package.json currently pins the dependency "openstack-uicore-foundation" to a prerelease version "4.2.25-beta.1"; update that dependency entry to the stable release "4.2.23" by replacing the version string for the "openstack-uicore-foundation" dependency in package.json (ensure package lock/yarn lock is updated afterwards and run install to refresh lockfile).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/components/mui/editable-table/mui-table-editable.js`:
- Line 188: Replace the confirm button color value used in the ConfirmDialog
configuration: locate the confirmButtonColor property inside the options/object
in mui-table-editable.js (used by the ConfirmDialog component) and change its
value from the MUI theme name "warning" to the hex string "#DD6B55" so it
matches the established pattern used elsewhere (e.g., mui-table.js,
meta-field-values.js, additional-input-list.js).
In
`@src/pages/sponsors/sponsor-form-item-list-page/components/sponsor-form-item-form.js`:
- Around line 183-187: The onRemove callback is using file.filename which
doesn't match the actual payload (it provides name), causing the filter to never
match; update the filter in the onRemove handler to compare img.filename (or the
stored image identifier) against file.name instead of file.filename, keeping the
rest of the logic (const newImages = (formik.values.images || []).filter(...);
formik.setFieldValue("images", newImages)) intact so removals correctly remove
the uploaded image.
In `@src/pages/sponsors/sponsor-forms-tab/index.js`:
- Around line 216-220: The pluralization logic uses strict equality against
row.items_count which can be a string; coerce once to a numeric value in the
render/mapper where this snippet is built (e.g., compute const itemsCount =
Number(row.items_count) || 0) and then use itemsCount both for the displayed
number and for the comparison (itemsCount === 1) to decide singular/plural;
update references to row.items_count in this template to use the new itemsCount
variable so non-numeric/string API values are handled consistently.
---
Outside diff comments:
In `@src/components/mui/editable-table/mui-table-editable.module.less`:
- Around line 4-13: The ::before pseudo-element in the &::before rule is
absolutely positioned so align-self: center is ignored; update the &::before
styles (the pseudo-element selector) to vertically center the 60% height dashed
border by removing the conflicting top: 0 and bottom: 0 and instead use top: 50%
plus transform: translateY(-50%) (keep height: 60% and border-left as-is) so the
dashed line is centered vertically within the container.
---
Nitpick comments:
In `@package.json`:
- Line 92: The package.json currently pins the dependency
"openstack-uicore-foundation" to a prerelease version "4.2.25-beta.1"; update
that dependency entry to the stable release "4.2.23" by replacing the version
string for the "openstack-uicore-foundation" dependency in package.json (ensure
package lock/yarn lock is updated afterwards and run install to refresh
lockfile).
In `@src/i18n/en.json`:
- Line 2669: The i18n key "images" is plural but its value is singular ("Image
File"), causing a semantic mismatch; either rename the key to "image_file" or
"image" and update all references (e.g., any i18n.t('images') or t('images')
usages) to the new key, or alternatively change the value to a plural phrase
("Image Files") to match the existing key; if you must preserve backward
compatibility, add the new key with the correct singular value and keep "images"
as an alias (or vice versa) and mark the old key for deprecation.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 17dfc42e-41a7-4f3a-97f0-c73009ea606e
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (12)
package.jsonsrc/actions/sponsor-forms-actions.jssrc/components/mui/__tests__/mui-table-editable.test.jssrc/components/mui/editable-table/mui-table-editable.jssrc/components/mui/editable-table/mui-table-editable.module.lesssrc/components/mui/sortable-table/mui-table-sortable.jssrc/components/mui/table/mui-table.jssrc/i18n/en.jsonsrc/pages/sponsors/sponsor-form-item-list-page/components/sponsor-form-item-form.jssrc/pages/sponsors/sponsor-forms-list-page/index.jssrc/pages/sponsors/sponsor-forms-tab/index.jssrc/reducers/sponsors/sponsor-forms-list-reducer.js
💤 Files with no reviewable changes (1)
- src/components/mui/tests/mui-table-editable.test.js
| type: "warning", | ||
| showCancelButton: true, | ||
| confirmButtonColor: "#DD6B55", | ||
| confirmButtonColor: "warning", |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify showConfirmDialog implementation to confirm it uses SweetAlert-style color handling
ast-grep --pattern $'showConfirmDialog($$$)'
# Check the implementation of showConfirmDialog
fd -t f "showConfirmDialog" --exec cat {}Repository: fntechgit/summit-admin
Length of output: 11371
🏁 Script executed:
# Find the ConfirmDialog component definition
fd -t f "confirm-dialog" --exec grep -l "ConfirmDialog" {} \;Repository: fntechgit/summit-admin
Length of output: 104
🏁 Script executed:
# Search for ConfirmDialog export/definition
rg "export.*ConfirmDialog|function ConfirmDialog|const ConfirmDialog" -A 5Repository: fntechgit/summit-admin
Length of output: 514
🏁 Script executed:
# Find where ConfirmDialog is imported in the showConfirmDialog file
rg -B 20 "const showConfirmDialog" | head -30Repository: fntechgit/summit-admin
Length of output: 3452
🏁 Script executed:
# Read the full ConfirmDialog implementation
cat -n src/components/mui/confirm-dialog.jsRepository: fntechgit/summit-admin
Length of output: 2913
Use consistent color value #DD6B55 instead of "warning" for the confirm button.
The ConfirmDialog component uses MUI's Button, which accepts both hex colors and MUI theme color names. However, the rest of the codebase consistently uses "#DD6B55" for confirmation button colors (see mui-table.js, meta-field-values.js, additional-input-list.js, etc.). Update this to match the established pattern.
- confirmButtonColor: "warning",
+ confirmButtonColor: "#DD6B55",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| confirmButtonColor: "warning", | |
| confirmButtonColor: "#DD6B55", |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/components/mui/editable-table/mui-table-editable.js` at line 188, Replace
the confirm button color value used in the ConfirmDialog configuration: locate
the confirmButtonColor property inside the options/object in
mui-table-editable.js (used by the ConfirmDialog component) and change its value
from the MUI theme name "warning" to the hex string "#DD6B55" so it matches the
established pattern used elsewhere (e.g., mui-table.js, meta-field-values.js,
additional-input-list.js).
src/pages/sponsors/sponsor-form-item-list-page/components/sponsor-form-item-form.js
Show resolved
Hide resolved
| `${row.items_count} ${ | ||
| row.items_count === 1 | ||
| ? T.translate("edit_sponsor.forms_tab.item") | ||
| : T.translate("edit_sponsor.forms_tab.items") | ||
| }` |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Verify how `items_count` is produced/normalized before reaching the table
rg -n -C3 '\bitems_count\b'Repository: fntechgit/summit-admin
Length of output: 4919
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Examine the full reducer context to understand data transformation
echo "=== Examining reducer at lines 115-165 ==="
sed -n '110,170p' src/reducers/sponsors/sponsor-page-forms-list-reducer.jsRepository: fntechgit/summit-admin
Length of output: 1577
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Check if there's any API response processing or type coercion
echo "=== Search for API client setup or response handling ==="
rg -l "axios|fetch|api" --max-count 5 src/ | head -10
echo ""
echo "=== Check sponsor-forms-actions to see how API calls are made ==="
sed -n '500,520p' src/actions/sponsor-forms-actions.js
echo ""
echo "=== Look for any response interceptors or API configuration ==="
rg -n "interceptor|transform" src/ | head -20Repository: fntechgit/summit-admin
Length of output: 8401
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Check the component definition for prop types
echo "=== Examine the full component file to see prop types ==="
wc -l src/pages/sponsors/sponsor-forms-tab/index.js
# Get context around the render function and check for PropTypes
echo ""
echo "=== Check for component prop definitions ==="
rg -n "propTypes|typescript|interface.*Form" src/pages/sponsors/sponsor-forms-tab/index.js -A 3 -B 1
# Look for mock data or tests that show actual data structure
echo ""
echo "=== Search for test data showing items_count structure ==="
rg -n "items_count.*:" src/ --type json --type js | head -20Repository: fntechgit/summit-admin
Length of output: 219
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Read the component around the render function showing items_count
echo "=== Component render function context (lines 200-230) ==="
sed -n '200,230p' src/pages/sponsors/sponsor-forms-tab/index.js
# Check imports and setup to understand data source
echo ""
echo "=== Component imports and setup (first 50 lines) ==="
head -50 src/pages/sponsors/sponsor-forms-tab/index.js
# Look for where table data comes from
echo ""
echo "=== Search for data source in component ==="
rg -n "forms|managedForms|customizedForms" src/pages/sponsors/sponsor-forms-tab/index.js | head -15Repository: fntechgit/summit-admin
Length of output: 3456
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Search for any mock data or test files with actual items_count values
echo "=== Search for mock data with items_count ==="
rg -n '"items_count"' src/ --type json -B 1 -A 1 | head -30
# Check test files
echo ""
echo "=== Look for test files related to sponsor forms ==="
fd "test|spec" src/pages/sponsors/sponsor-forms-tab/ 2>/dev/null || echo "No test dir found"
# Look at reducer more carefully - check what type `a` is
echo ""
echo "=== Check where payload.response.data comes from ==="
sed -n '100,130p' src/reducers/sponsors/sponsor-page-forms-list-reducer.jsRepository: fntechgit/summit-admin
Length of output: 111
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Try to find API response examples or backend documentation
echo "=== Search for any .md or README files that document API ==="
find src/ -name "README*" -o -name "*.md" | xargs cat 2>/dev/null | grep -i "items_count" || echo "No docs found"
# Look at the beginning of the reducer file for context
echo ""
echo "=== Check reducer file start and action types ==="
head -30 src/reducers/sponsors/sponsor-page-forms-list-reducer.js
# Check the actual reducer action handler more carefully
echo ""
echo "=== Full first items_count reducer case ==="
sed -n '100,135p' src/reducers/sponsors/sponsor-page-forms-list-reducer.js
# Look at any comments or type hints
echo ""
echo "=== Search for comments about items_count ==="
rg -B 2 -A 2 "items_count" src/reducers/sponsors/sponsor-page-forms-list-reducer.js | head -40Repository: fntechgit/summit-admin
Length of output: 2790
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Verify the exact line numbers for the code in question
echo "=== Confirm exact code at lines 216-220 ==="
sed -n '216,220p' src/pages/sponsors/sponsor-forms-tab/index.js
# Check if there are other similar numeric comparisons that might have same issue
echo ""
echo "=== Search for similar strict equality comparisons with object properties ==="
rg -n '===\s*[0-9]' src/pages/sponsors/sponsor-forms-tab/index.jsRepository: fntechgit/summit-admin
Length of output: 413
Harden pluralization against non-numeric items_count values.
The strict equality check row.items_count === 1 on line 217 will fail if the API payload provides items_count as a string (e.g., "1"), resulting in incorrect pluralization. The reducer passes items_count directly from the API without type coercion, and one reducer case attempts a fallback (items_count: a.items_count || 0) that doesn't ensure numeric type. Coerce to a number once in the render function to handle this edge case.
Suggested patch
- render: (row) =>
- `${row.items_count} ${
- row.items_count === 1
- ? T.translate("edit_sponsor.forms_tab.item")
- : T.translate("edit_sponsor.forms_tab.items")
- }`
+ render: (row) => {
+ const itemsCount = Number(row.items_count) || 0;
+ return `${itemsCount} ${
+ itemsCount === 1
+ ? T.translate("edit_sponsor.forms_tab.item")
+ : T.translate("edit_sponsor.forms_tab.items")
+ }`;
+ }📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| `${row.items_count} ${ | |
| row.items_count === 1 | |
| ? T.translate("edit_sponsor.forms_tab.item") | |
| : T.translate("edit_sponsor.forms_tab.items") | |
| }` | |
| render: (row) => { | |
| const itemsCount = Number(row.items_count) || 0; | |
| return `${itemsCount} ${ | |
| itemsCount === 1 | |
| ? T.translate("edit_sponsor.forms_tab.item") | |
| : T.translate("edit_sponsor.forms_tab.items") | |
| }`; | |
| } |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/pages/sponsors/sponsor-forms-tab/index.js` around lines 216 - 220, The
pluralization logic uses strict equality against row.items_count which can be a
string; coerce once to a numeric value in the render/mapper where this snippet
is built (e.g., compute const itemsCount = Number(row.items_count) || 0) and
then use itemsCount both for the displayed number and for the comparison
(itemsCount === 1) to decide singular/plural; update references to
row.items_count in this template to use the new itemsCount variable so
non-numeric/string API values are handled consistently.
9e66f31 to
e5545a9
Compare
ref: https://app.clickup.com/t/86b8tt4df
Summary by CodeRabbit
New Features
Tests
Chores