Skip to content
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

Add confirmation dialog before closing app #19139

Merged
merged 2 commits into from
Apr 20, 2022
Merged

Add confirmation dialog before closing app #19139

merged 2 commits into from
Apr 20, 2022

Conversation

abist
Copy link
Contributor

@abist abist commented Apr 18, 2022

This PR fixes #19080

Updated screenshot-

Screen Shot 2022-04-18 at 4 00 13 PM

@coveralls
Copy link

coveralls commented Apr 18, 2022

Pull Request Test Coverage Report for Build 2186479908

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.002%) to 42.298%

Totals Coverage Status
Change from base Build 2185425881: 0.002%
Covered Lines: 27754
Relevant Lines: 61357

💛 - Coveralls

@alanrenmsft
Copy link
Contributor

what if i have multiple unsaved table designer, looking at the code I will be getting multiple notifications, right?

@alanrenmsft
Copy link
Contributor

If there are multiple unsaved table designers and try to close ADS.

  1. Am i getting multiple confirm dialogs at the same time?
    expected: No
  2. If the answer to first question is no, If I choose "Exit", will i get another confirm dialog for another table designer editor?
    expected: No, there should be only one confirmation dialog for table designer.

@chlafreniere
Copy link
Contributor

chlafreniere commented Apr 18, 2022

Is table designer implemented as a custom editor in VS Code, or something else? Just want to make sure that we shouldn't be hooking into any VS Code editor-related functionality here (since editors already have this concept of prompting before closing)

@abist
Copy link
Contributor Author

abist commented Apr 18, 2022

@chlafreniere Yes, the TableDesignerInput extends EditorInput. I haven't made any changes in the editor itself, this change only is for the TableDesignerInput type so there should be no side effects

@abist
Copy link
Contributor Author

abist commented Apr 19, 2022

@alanrenmsft bump

@alanrenmsft
Copy link
Contributor

Chris mentioned another way of implementing this, I will see if i can figure it out.


public _serviceBrand: undefined;
private _providers = new Map<string, TableDesignerProvider>();

private async confirmBeforeExit(): Promise<boolean> {
let openTableDesignerEditors = this._editorService.editors.filter(e => e instanceof TableDesignerInput);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like we can combine 34 and 35 into one line.

		const dirtyTableDesigners = this._editorService.editors.filter(e => e instanceof TableDesignerInput && e.isDirty());
		if (dirtyTableDesigners.length > 0) {

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a reason that this comment was not taken?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it wasn't a big change and a suggestion so I didn't want to spend time making a minute non functional change and wait for the build.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you particularly want it in your specific style, I'll just edit this in my next PR

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that would be good. BTW, it would be nice not to leave open comments when you merge the PR, it is ok if you don't want to make certain changes, reply to it and mark it as resolved.

@abist abist merged commit 449d27a into main Apr 20, 2022
@abist abist deleted the tdesigner/confirmExit branch April 20, 2022 03:26
@abist abist mentioned this pull request Apr 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Table designer doesn't prompt user to save before the app closes
4 participants