-
Notifications
You must be signed in to change notification settings - Fork 47
Add 'Show Group' #66
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
base: master
Are you sure you want to change the base?
Add 'Show Group' #66
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,6 +29,8 @@ | |
| directoryPerson(); | ||
| } else if (location.pathname == "/admin/groups") { | ||
| directoryGroups(); | ||
| } else if (location.pathname.match("/admin/group/")) { | ||
| directoryGroup(); | ||
| } else if (location.pathname == "/admin/access/admins") { | ||
| securityAdministrators(); | ||
| } else if (location.pathname.match("/report/system_log_2")) { | ||
|
|
@@ -339,6 +341,38 @@ | |
| }); | ||
| } | ||
|
|
||
| function directoryGroup() { | ||
| var groupId = location.pathname.split("/")[3]; | ||
| var group; | ||
| getJSON(`/api/v1/groups/${groupId}`).then(aGroup => { | ||
| group = aGroup; | ||
| $(".subheader").html(`${e(group.profile.name)}`); | ||
| document.title += ` - ${e(group.profile.name)} ${e(group.profile.description)}`; | ||
| }); | ||
| function showGroup() { | ||
| function toString(o, i = '') { | ||
|
Owner
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. this code for also, indentation should be cleaned up |
||
| const strings = []; | ||
| for (const p in o) { | ||
| if (p == "_links") continue; | ||
| var v = o[p]; | ||
| if (v === null) v = "null"; | ||
| else if (typeof v == "string") v = '"' + v.replace(/(["\\])/g, "\\$1") + '"'; // Escape " and \ | ||
| else if (Array.isArray(v)) v = v.length == 0 ? '[]' : "[\n" + toString(v, i + " ") + i + "]"; | ||
| else if (typeof v == "object") v = $.isEmptyObject(v) ? '{}' : "{\n" + toString(v, i + " ") + i + "}"; | ||
| if (!Array.isArray(o)) v = p + ": " + v; | ||
| strings.push(i + v); | ||
| } | ||
| return strings.join("\n") + "\n"; | ||
| } | ||
| const groupPopup = createPopup("Group"); | ||
| // It'd make sense to add group logos in here, however, if it's not `OKTA_GROUP`, it's `APP_GROUP` -so, no distinction between AD, Slack, etc. | ||
| // const logo = group.type == "OKTA_GROUP" ? "okta" : group.type.toLowerCase(); | ||
| groupPopup.html(`</span><br><pre>${e(toString(group))}</pre>`); | ||
|
Owner
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. has an extra |
||
| } | ||
| createDiv("Show Group", mainPopup, showGroup); | ||
| createPrefixA("<li class=option>", "<span class='icon person-16-gray'></span>Show Group", ".okta-dropdown-list", showGroup); | ||
|
Owner
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. this adds an item to the More Actions menu which exists for Users, but not for Groups |
||
| } | ||
|
|
||
| function securityAdministrators() { | ||
| createDiv("Export Administrators", mainPopup, function () { // TODO: consider merging into exportObjects(). Will the Link headers be a problem? | ||
| const adminsPopup = createPopup("Administrators"); | ||
|
|
||
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.
there is no element with this css class. it exists for Users, but not for Groups