Skip to content

Queue filter #82

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

Merged
merged 29 commits into from
Dec 1, 2021
Merged

Queue filter #82

merged 29 commits into from
Dec 1, 2021

Conversation

isc-svelury
Copy link
Contributor

@isc-svelury isc-svelury commented Nov 29, 2021

  1. Uncommitted Queue now tracks deleted files.
  2. When returning uncommitted files, the uncommitted API now also includes files that are tracked by git but not by the Uncommitted queue.
  3. The WebUI adds an icon to indicate that the file was edited by another user.
  4. For "available" files the process of staging, unstaging and cancelling changes remains unchanged for the user.
  5. When the user tries to act upon changes made by another user, a popup confirms that the user wants to take that action.
  6. Action of each "unavailable" file must be confirmed through its individual checkbox.
  7. If the user selects multiple files, the "available" files are acted upon in the background while the confirmation popup is active on the screen for the user to respond. Once the user confirms their choice (or cancels the action), processing resumes as normal.

This PR closes #28

Copy link
Collaborator

@isc-tleavitt isc-tleavitt left a comment

Choose a reason for hiding this comment

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

A few minor comments. Looks good code-wise; haven't actually tested the behavior but will do that before next release.

@@ -1652,42 +1662,143 @@ webui.ChangedFilesView = function(workspaceView, type, label) {
}
};

self.getFileList = function(including, excluding) {
var files = "";
function confirmActionForUnavailalbleFile(files, action) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: typo (unavailable)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed this.

Method OnBeforeDelete(InternalName As %String) As %Status
{
set context = ##class(SourceControl.Git.PackageManagerContext).ForInternalName(InternalName)
set InternalName = ##class(Utils).NormalizeInternalName(InternalName)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: full classnames are preferred (though other code in the same neighborhood might not be great about that)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This happens in multiple places all throughout the project. It might be better to create a separate PR for finding and refactoring all these instances.

@@ -160,13 +160,17 @@ ClassMethod Uncommitted() As %SystemBase
quit:key=""
// Check that current user has files(key) uncommitted and only %Push if they do
set filename = ##class(Utils).FullExternalName(key)
set sc=##class(SourceControl.Git.Change).GetUncommitted(filename,.tAction,.tInternalName,.UncommittedUser,.tSource,.UncommittedLastUpdated)
if $$$ISOK(sc) && ($data(tAction)&&(UncommittedUser=$username)) {
if (($ISVALIDNUM(key)) && (files(key) '= "")){
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we need to check ISVALIDNUM?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In Utils.GitStatus(), if we want to include all files, then for the files that don't have an internal name but are still tracked by git, I use $increment to generate keys. For files that have internal names, the internal names are the keys and the filepath is the value associated with the key.

So in WebUIDriver.Uncommitted(), if the key is a number and the value is not empty, then it indicates that the file is tracked by Git but not by the Uncommitted queue. Therefore, any user should be able to take action on those changes.

@isc-tleavitt isc-tleavitt merged commit 27e26ed into main Dec 1, 2021
@isc-tleavitt isc-tleavitt deleted the queue-filter branch December 1, 2021 13:32
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.

Improved uncommitted queue + filter in web UI
2 participants