-
Notifications
You must be signed in to change notification settings - Fork 141
Fix: solve duplicate key error in simulation #2562
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your changes @miguelro20. Had a question for you before proceeding.
src/pages/Simulations.jsx
Outdated
@@ -119,7 +124,7 @@ export default function SimulationsPage() { | |||
</p> | |||
</PageHeader> | |||
<Section> | |||
<Table dataSource={data} columns={columns} rowKey="start_time" /> | |||
<Table dataSource={data} columns={columns} rowKey="rowKey" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue, blocking: Per Ant Design's docs here, the rowKey
prop defaults to a given row's key
value; is the fix not as simple as removing the original rowKey="start_time"
designation?
I have made a change, now each simulation object holds a key inside of it. I did try that solution, but what happened was that the Table object can take a unique key value from within the rendered object, and our simulation object did not have that value. In this follow up, I renamed the value from rowKey to key inside the simulation object, this way the Table takes the value with the key name without needing to specify it on the object and no errors show up on the page when running the app. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your explanation sounds good to me. LGTM pending test passage.
Ah, this actually fails CI. Could you run |
Fixes #2554
Description
The fix was made to prevent an error that happened in simulation page because of duplicate keys.
Changes
Changed the key used inside the table from start-time to unique key. The unique key was already included in the code, the fix was to add it in the simulation object.