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

Role category Hierarchies #3603

Open
wants to merge 15 commits into
base: develop
Choose a base branch
from
Open

Conversation

Ryanseanlee
Copy link
Contributor

@Ryanseanlee Ryanseanlee commented Mar 18, 2024

Hoist P/R Checklist

Pull request authors: Review and check off the below. Items that do not apply can also be
checked off to indicate they have been considered. If unclear if a step is relevant, please leave
unchecked and note in comments.

  • Caught up with develop branch as of last change.
  • Added CHANGELOG entry, or determined not required.
  • Reviewed for breaking changes, added breaking-change label + CHANGELOG if so.
  • Updated doc comments / prop-types, or determined not required.
  • Reviewed and tested on Mobile, or determined not required.
  • Created Toolbox branch / PR, or determined not required.

If your change is still a WIP, please use the "Create draft pull request" option in the split
button below to indicate it is not ready yet for a final review.

Pull request reviewers: when merging this P/R, please consider using a squash commit to
collapse multiple intermediate commits into a single commit representing the overall feature
change. This helps keep the commit log clean and easy to scan across releases. PRs containing a
single commit should be rebased when possible.

@Ryanseanlee Ryanseanlee linked an issue Mar 18, 2024 that may be closed by this pull request
admin/tabs/general/roles/RoleModel.ts Outdated Show resolved Hide resolved
private processRolesForTreeGrid(
roles: Omit<HoistRole, 'users' | 'directoryGroups' | 'roles'>[]
) {
const topList = [];
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this method would benefit from some more specific variable names, particularly list and topList, which feel pretty ambiguous to me. Maybe ret or root instead of topList and children instead of list?

admin/tabs/general/roles/RoleModel.ts Outdated Show resolved Hide resolved
let list = topList,
id = '';
categories.forEach(category => {
let currCat = list.find(it => it.name === category);
Copy link
Contributor

Choose a reason for hiding this comment

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

Should you also be checking that isGroupRow === true? What if you had a role with the same name as a category?

autosizeOptions: {mode: 'managed'},
emptyText: 'No roles found.',
colChooserModel: true,
sortBy: 'name|asc',
sortBy: ['isGroupRow', 'name'],
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it necessary to sort on isGroupRow? That seems confusing to me

{field: {name: 'category', type: 'string'}, hidden: true},
{field: {name: 'lastUpdated', type: 'date'}, ...Col.dateTime, hidden: true},
{field: {name: 'lastUpdatedBy', type: 'string'}, hidden: true},
{field: {name: 'notes', type: 'string'}, filterable: false, flex: 1}
{field: {name: 'notes', type: 'string'}, filterable: false, flex: 1},
{field: {name: 'isGroupRow', type: 'bool'}, hidden: true, excludeFromChooser: true}
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this need to be a hidden column? Seems like it could just be a Store Field?

item: hframe(
vframe(
grid({
agOptions: {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this is necessary anymore - perhaps left over from old implementation?

cmp/grid/Grid.scss Show resolved Hide resolved
@lbwexler lbwexler changed the title Role category heirarchies Role category Hierarchies May 19, 2024
@lbwexler
Copy link
Member

lbwexler commented Jun 5, 2024

Hi @Ryanseanlee -- could you catch this up, and indicate if all of Greg's comments have been handled? Would love to merge this.

@Ryanseanlee
Copy link
Contributor Author

Hi @Ryanseanlee -- could you catch this up, and indicate if all of Greg's comments have been handled? Would love to merge this.

Hey yes definitely

@@ -38,12 +38,16 @@ export class RoleModel extends HoistModel {
@observable.ref allRoles: HoistRole[] = [];
@observable.ref moduleConfig: RoleModuleConfig;

@bindable groupingDisabled = false;
Copy link
Member

Choose a reason for hiding this comment

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

its not that grouping is 'disabled' its that its not actually being grouped at the moment. Would call it -- `showInGroups' or something like that

@@ -212,6 +227,30 @@ export class RoleModel extends HoistModel {
});
}

private processRolesForTreeGrid(
roles: Omit<HoistRole, 'users' | 'directoryGroups' | 'roles'>[]
Copy link
Member

Choose a reason for hiding this comment

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

I need someone to explain to me how this works :)

@lbwexler
Copy link
Member

lbwexler commented Jun 8, 2024

@Ryanseanlee -- please let me know when you are ready to go over? Hopefully monday

Would be helpful if you could resolve the comments above that you have dealt with -- thanks

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.

Enhancements to Admin Console Roles editor
4 participants