-
Notifications
You must be signed in to change notification settings - Fork 7
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
feat: warn about unsaved changes in editor #1620
Conversation
2834695
to
33b445b
Compare
33b445b
to
d1997fb
Compare
I suppose this gives the same effect #1621 |
@astandrik not exactly. It should also warn if you try to insert query from History (or Saved queries, or Top queries). |
Updated my solution to more straigthforward approach =) |
}); | ||
} | ||
|
||
export function changeInputWithConfirmation<T>(callback: (args: T) => void) { |
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.
I suppose thats not only about input, but about any callback action
useActionWithConfirmation ?
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.
Not sure... in this function we use getConfirmation
, and it is exactly about unsaved changes in editor. So, it should be used only for one narrow case with user input.
@@ -154,7 +160,12 @@ export const SavedQueries = ({changeUserInput}: SavedQueriesProps) => { | |||
settings={QUERY_TABLE_SETTINGS} | |||
emptyDataMessage={i18n(filter ? 'history.empty-search' : 'saved.empty')} | |||
rowClassName={() => b('row')} | |||
onRowClick={(row) => onQueryClick(row.body, row.name)} | |||
onRowClick={async (row) => |
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.
according to gravity-ui/react-data-table onRowClick is sync function
Does passing async function have purpose here?
@@ -0,0 +1,4 @@ | |||
{ | |||
"action_apply": "Proceed", | |||
"context_unsaved-changes-warning": "You have unsaved changes in this query. Do you want to proceed?" |
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.
Stand
CI Results
Test Status: β PASSED
π Full Report
Bundle Size: πΊ
Current: 66.06 MB | Main: 66.03 MB
Diff: +0.04 MB (0.06%)
βΉοΈ CI Information