This repository has been archived by the owner on Jan 7, 2020. It is now read-only.
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.
This modal dialog allows users to set the default sort order for a folder. They can say the default is sort by Name or Date (asc or desc) and they can apply this setting to all subfolders. Or they can elect to custom sort the folder's content using drag and drop.
The drag and drop collections are disabled if the sorting option is anything but custom.
Selecting items is only enabled if custom is selected.
If any number of, say, folder objects are selected and the user clicks on a document all the folders are unselected.
If custom is selected and some items are selected these items are de-selected when the user changes the sorting option away from custom.
If the user changes the sorting option away from custom they are first given a confirmation dialog. If they select cancel they keep the custom sort order. If they select to proceed with the change the folder and document lists are immediately sorted based on the selected sort option (this is nearly instant as the sorting is done entirely on the client side).
If the sort option was any of the Name or Date choices the "Apply to children" checkbox label reflects the sorting choice. For example "Apply name ascending to all subfolders". This clearly informs the user as to what action this checkbox will invoke when they Save.
If the user selects custom and the "Apply to subfolders" option was checked then the code un-checks the "Apply to subfolders" option.
While the Custom option is selected the "Apply to subfolders" option is disabled and it's label is disabled.
When Custom is active and the user starts a drag operation on one of the lists, say folders, then the other list's drag and drop is disabled. (Otherwise the user could drop a folder into documents or visa versa.)
Initialization of the UI is based on the saved sorting options for the folder. Includes set the sorting option controls based on the incoming setting and includes disabling the Apply to Subfolders if custom is selected or update the label of the Apply control based on the Name/Date selection. Of course, sort the lists by the sorting option.
On Save, if the Apply to Subfolders option is checked then confirm the action with the user. If they cancel return to the UI. Otherwise:
Note the "apply to all subfolders" is not saved to the database; just the effect is that all subfolders have default sort option set.
Also note that as new documents and folders are added they always will be at the end of custom sort lists.
When custom sorting is select the UI shows move icons to indicate the drag and drop is active.
If custom sorting ask user before cancelling to confirm. Prevent background click or ESC to trigger cancel.
Add spinner when busy
EPIC code use document upload date rather than documentDate used by MEM
hide debug