This repository has been archived by the owner on Sep 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Confirm folder delete - fixes issue #4446 #4515
Merged
Merged
Changes from 3 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
fe8c88b
Add CONFIRM_FOLDER_DELETE to strings
gmp 724d89d
Add CONFIRM_FOLDER_DELETE_TITLE to strings
gmp 37ffb17
Confirm folder delete modal fixes #4446
gmp 82e3de4
Merge remote-tracking branch 'upstream/master' into confirmDelete
gmp c77d55d
Add folder name template to CONFIRM_FOLDER_DELETE
gmp da97d1d
Update from 'OK' to 'Delete' button text
gmp 49e6801
Merge remote-tracking branch 'upstream/master' into confirmDelete
gmp ba97c12
Update button text to new DELETE string
gmp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1150,7 +1150,37 @@ define(function (require, exports, module) { | |
|
||
function handleFileDelete() { | ||
var entry = ProjectManager.getSelectedItem(); | ||
ProjectManager.deleteItem(entry); | ||
if (entry.isDirectory) { | ||
Dialogs.showModalDialog( | ||
DefaultDialogs.DIALOG_ID_EXT_DELETED, | ||
Strings.CONFIRM_FOLDER_DELETE_TITLE, | ||
StringUtils.format( | ||
Strings.CONFIRM_FOLDER_DELETE, | ||
StringUtils.breakableUrl(entry.name) | ||
), | ||
[ | ||
{ | ||
className : Dialogs.DIALOG_BTN_CLASS_NORMAL, | ||
id : Dialogs.DIALOG_BTN_CANCEL, | ||
text : Strings.CANCEL | ||
}, | ||
{ | ||
className : Dialogs.DIALOG_BTN_CLASS_PRIMARY, | ||
id : Dialogs.DIALOG_BTN_OK, | ||
text : Strings.OK | ||
} | ||
] | ||
) | ||
.done(function (id) { | ||
if (id === Dialogs.DIALOG_BTN_CANCEL) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We probably don't need this branch of the if as it does nothing, and just use the other one. |
||
return; | ||
} else if (id === Dialogs.DIALOG_BTN_OK) { | ||
ProjectManager.deleteItem(entry); | ||
} | ||
}); | ||
} else { | ||
ProjectManager.deleteItem(entry); | ||
} | ||
} | ||
|
||
/** Show the selected sidebar (tree or working set) item in Finder/Explorer */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -103,6 +103,8 @@ define({ | |
"SAVE_CLOSE_MESSAGE" : "Do you want to save the changes you made in the document <span class='dialog-filename'>{0}</span>?", | ||
"SAVE_CLOSE_MULTI_MESSAGE" : "Do you want to save your changes to the following files?", | ||
"EXT_MODIFIED_TITLE" : "External Changes", | ||
"CONFIRM_FOLDER_DELETE_TITLE" : "Confirm Delete", | ||
"CONFIRM_FOLDER_DELETE" : "Are you sure you want to delete the folder?", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To show the file, use |
||
"FILE_DELETED_TITLE" : "File Deleted", | ||
"EXT_MODIFIED_MESSAGE" : "<span class='dialog-filename'>{0}</span> has been modified on disk, but also has unsaved changes in {APP_NAME}.<br /><br />Which version do you want to keep?", | ||
"EXT_DELETED_MESSAGE" : "<span class='dialog-filename'>{0}</span> has been deleted on disk, but has unsaved changes in {APP_NAME}.<br /><br />Do you want to keep your changes?", | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@peterflynn Mentioned that he preferred
Delete
here instead ofOk
. Maybe you could change this string. I am not sure if usingCMD_FILE_DELETE
will be ok, or if creating a new string for delete might be better.