Skip to content

Commit

Permalink
fix: fix foreign constriant error when add chart to dashboard (#9892)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shifan-Gu committed Apr 26, 2024
1 parent 1187081 commit 60987e0
Showing 1 changed file with 8 additions and 1 deletion.
Expand Up @@ -159,12 +159,19 @@ const AddTilesToDashboardModal: FC<AddTilesToDashboardModalProps> = ({
if (!selectedDashboard) {
throw new Error('Expected dashboard');
}
const firstTab = selectedDashboard.tabs?.[0];
await updateDashboard({
name: selectedDashboard.name,
filters: selectedDashboard.filters,
tiles: appendNewTilesToBottom(selectedDashboard.tiles, [
newTile,
firstTab
? {
...newTile,
tabUuid: firstTab.uuid,
}
: newTile, // TODO: add to first tab by default, need ux to allow user select tab
]),
tabs: selectedDashboard.tabs,
});
onClose?.();
}
Expand Down

0 comments on commit 60987e0

Please sign in to comment.