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 owner grouping logic to add/remove owners #1059

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lukepag
Copy link
Contributor

@lukepag lukepag commented Feb 26, 2025

Ticket Link

1682

List of squashed commits

  • Add owner grouping logic to add/remove owners
  • add new modals for adding and removing group path owners
  • Create new controller functions
  • Implement new grouping owner add/remove logic
  • Fixed add bug
  • Implement hyperlink for grouping owners
  • Add more comments and fix CSS spacing
  • Create and update existing jasmine tests
  • Finalize clean up

Test Checklist

  • Exhibits Clear Code Structure:
  • Project Unit Tests Passed:
  • Project Jasmine Tests Passed:
  • Executes Expected Functionality:
  • Tested For Incorrect/Unexpected Inputs:

@lukepag lukepag requested review from JorWo and mhodgesatuh February 26, 2025 05:03
Copy link
Member

@mhodgesatuh mhodgesatuh left a comment

Choose a reason for hiding this comment

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

 * Give ownership of grouping at grouping path to newOwner. A user with owner privileges has
 * read and write privileges
 * of a grouping.
 
 The above should be on two lines.
 
 In the comments the spelling "owners-group" might be clearer.

Comment on lines 282 to 289
if(owner.name.includes(':')) {
owner.isOwnerGrouping = true;
// Name field in owner groupings initially holds the group path
owner.ownerGroupingPath = owner.name;
const splitOwnerPath = owner.name.split(':');
// Isolate the grouping name from the path
owner.name = splitOwnerPath[splitOwnerPath.length - 1];
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This logic should be on the API side, but that can be for another ticket.

if (listName === "owners") {
// If the user input has a colon, we can assume that it's a group path
if ($scope.manageMembers.includes(':')) {
listName = "owner grouping";
Copy link
Contributor

@JorWo JorWo Feb 26, 2025

Choose a reason for hiding this comment

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

There technically is no listName/groupName just for owner groupings, it would still be the owner group. Could you use a $scope.isOwnerGrouping variable instead?

Copy link
Contributor Author

@lukepag lukepag Feb 28, 2025

Choose a reason for hiding this comment

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

@JorWo One slight issue I see with this is that the owner objects have the owner.isOwnerGrouping field and that may be confusing to some. However, if this isn't an issue I can push up the changes! (Maybe I can name it just ownerGrouping?)

Edit: Actually, it seems that a lot of the checks that use listName treats it as a string, so changing it to use a boolean in $scope.isOwnerGrouping to check would require certain functions to do a separate check just for isOwnerGrouping as well as the listName check. I can provide examples as well if needed

Copy link
Contributor

Choose a reason for hiding this comment

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

There are many places that in the code that use a $scope and non-scope variable to describe the same thing like $scope.listName and listName, so I assume both owner.isOwnerGrouping and $scope.isOwnerGrouping being used would not be too confusing.

Having checks for listName == "owners" && isOwnerGrouping is fine because it is still readable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@JorWo Got it! I'll make the changes

@JorWo
Copy link
Contributor

JorWo commented Feb 26, 2025

Are the cases handled when adding:

  1. More than one owner grouping path?
  2. A mix of uhIdentifiers and owner grouping paths in the input box?

Comment on lines 31 to 37
<!--
<p class="alert alert-warning mt-2" role="alert" ng-if="hasDeptAccount">
<span class="text-dark" th:text="#{screen.message.modal.add.deptAccount}"></span>
</p>

do I need to account for departmental accounts that are in the grouping?
-->
Copy link
Contributor

Choose a reason for hiding this comment

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

I noticed you left this comment here.

@JorWo
Copy link
Contributor

JorWo commented Feb 26, 2025

Make sure to fix the Codacy issues, thanks.

@lukepag
Copy link
Contributor Author

lukepag commented Feb 28, 2025

Are the cases handled when adding:

  1. More than one owner grouping path?
  2. A mix of uhIdentifiers and owner grouping paths in the input box?

I believe I had a talk with Michael about how we don't need to account for situations where users are adding more than one grouping path. @mhodgesatuh could I get your opinion on this?

Regarding the second question, it does not currently handle the mix of uhIdentifiers and owner grouping paths

@mhodgesatuh
Copy link
Member

Regarding the more than one grouping path question, here's some context:
The feature will only be used by select CSOC individuals and will not be advertised to our broader audience. So the thought is that for this first iteration of the feature it is okay if we don't have rigorous user input testing. If we encounter issues, a future iteration could introduce more controls and make the feature higher profile.

@JorWo
Copy link
Contributor

JorWo commented Feb 28, 2025

Regarding the more than one grouping path question, here's some context: The feature will only be used by select CSOC individuals and will not be advertised to our broader audience. So the thought is that for this first iteration of the feature it is okay if we don't have rigorous user input testing. If we encounter issues, a future iteration could introduce more controls and make the feature higher profile.

@mhodgesatuh Any thoughts on displaying a "feature not supported" modal if those select CSOC individuals did attempt to add more than one groupingPath owner or a mix of uhIdentifiers and groupingPaths? I want to make sure there are no disastrous consequences of not handling those cases.

@mhodgesatuh
Copy link
Member

@JorWo Please update the ticket to describe at least include a minimal set of input controls to ensure that there is no unanticipated behavior. I'm fine, for example, if the initial implementation only allows for a single owner-grouping reference, in order to get minimal functionality established.

@JorWo
Copy link
Contributor

JorWo commented Feb 28, 2025

@JorWo Please update the ticket to describe at least include a minimal set of input controls to ensure that there is no unanticipated behavior. I'm fine, for example, if the initial implementation only allows for a single owner-grouping reference, in order to get minimal functionality established.

Ok, I added a user input edge cases section to the bottom of the ticket.

@lukepag lukepag force-pushed the dev-lukepag-1682 branch 2 times, most recently from f63ddbd to e244325 Compare March 1, 2025 01:45
add new modals for adding and removing group path owners

Create new controller functions

Implement new grouping owner add/remove logic

Fixed add bug

Implement hyperlink for grouping owners

Add more comments and fix CSS spacing

Create and update existing jasmine tests

Finalize clean up

Fix remove bug

Fix pull request changes

Fix more pull request changes

Codacy issues

Codacy
@lukepag lukepag force-pushed the dev-lukepag-1682 branch from e244325 to a0fd5f0 Compare March 1, 2025 01:56
@lukepag lukepag requested review from mhodgesatuh and JorWo March 1, 2025 02:02
Copy link
Member

@mhodgesatuh mhodgesatuh left a comment

Choose a reason for hiding this comment

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

I suggest we consistent hyphenate owner-grouper to represent the use of a grouping to indicate the indirect owners, AKA co-owners.

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.

3 participants