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.
I suppose thats not only about input, but about any callback action
useActionWithConfirmation ?
There was a problem hiding this comment.
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.
| 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.
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?" | |||

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