bito-code-review[bot] commented on code in PR #37298:
URL: https://github.com/apache/superset/pull/37298#discussion_r2710438381
##########
superset-frontend/src/components/DatabaseSelector/index.tsx:
##########
@@ -317,6 +376,40 @@ export function DatabaseSelector({
const catalogOptions = catalogData || EMPTY_CATALOG_OPTIONS;
+ const handleModalOk = useCallback(() => {
+ // Apply modal selections to actual state
+ if (modalDb && modalDb.id !== currentDb?.value) {
+ const databaseWithId = { ...modalDb, id: modalDb.id };
+ setCurrentDb(databaseWithId as DatabaseValue);
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Missing DatabaseValue properties</b></div>
<div id="fix">
Ensure `databaseWithId` includes all fields of `DatabaseValue`. For example:
```ts
const databaseWithId = {
...modalDb,
id: modalDb.id,
value: modalDb.id,
label: modalDb.database_name,
};
```
</div>
</div>
<small><i>Code Review Run #9ba2ef</i></small>
</div><div>
<div id="suggestion">
<div id="issue"><b>Missing DatabaseValue properties</b></div>
<div id="fix">
The 'databaseWithId' object lacks required 'value' and 'label' properties
for 'DatabaseValue' type, which can cause rendering issues when setting the
current database from modal selection.
</div>
</div>
<small><i>Code Review Run #699bcf</i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]