alexandrusoare commented on code in PR #43330:
URL: https://github.com/apache/superset/pull/43330#discussion_r3812206498
##########
superset-frontend/src/SqlLab/components/SaveDatasetActionButton/index.tsx:
##########
@@ -43,8 +45,13 @@ const SaveDatasetActionButton = ({
color="default"
variant="text"
onClick={() => onSaveAsExplore?.()}
+ disabled={!canSaveDataset}
Review Comment:
Question: when onSaveAsExplore is undefined (database doesn't support
virtual table explore), this button isn't rendered at all, so the user never
sees the "run query first" disabled state. Is that intentional? Might be worth
rendering the button as disabled in that case too, so the user understands why
they can't save as dataset — otherwise it silently disappears.
##########
superset-frontend/src/SqlLab/components/SqlEditor/index.tsx:
##########
@@ -865,6 +865,7 @@ const SqlEditor: FC<Props> = ({
}
saveQueryWarning={saveQueryWarning}
database={database}
+ canSaveDataset={latestQuery?.state === 'success'}
Review Comment:
Nit: This uses a raw string 'success' but the test file imports
QueryState.Success from @superset-ui/core. Could we use the enum here too for
consistency and type safety?
canSaveDataset={latestQuery?.state === QueryState.Success}
--
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]