Skip to content

[Apps] New accordion groups, autocomplete search to filter by existing set of all users with App permissions #172

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

Open
wants to merge 44 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
45292a0
Access user guide: collapse everything but current accordion on click…
savathoon Oct 28, 2024
66b3d65
break out app group header component for readability
savathoon Oct 28, 2024
0ed08ee
update paths, set min width on header to prevent icon overlap on smal…
savathoon Oct 28, 2024
c440947
Break out admin action button group into sub component on apps page, …
savathoon Oct 28, 2024
2f7c44d
App detail: remove duplicate components, replace with EmptyListEntry …
savathoon Oct 29, 2024
f63e77d
replace duplicate empty list entries with emptylistentry component
savathoon Oct 29, 2024
d4a6ec0
Add props for adding custom empty list text
savathoon Oct 29, 2024
1719825
App page: initial demo accordion, fix missing admin group button
savathoon Oct 29, 2024
813fcd4
[feat] dark mode and theme toggle (#174)
amyjchen Oct 29, 2024
3173e61
make theme toggle minimize when nav is minimized
amyjchen Oct 29, 2024
fc557e5
figure out why table rows are not 100% width with accordion component
savathoon Oct 30, 2024
082cbd1
full-width accordion list
savathoon Oct 30, 2024
7367f5f
add demo of owner group card for accordion list
savathoon Oct 30, 2024
4ed8ee6
Merge branch '2024-hackweek' into sava/more-components
savathoon Oct 30, 2024
3c51142
[Group Detail] Update the groups member page to add spacing and wrap …
savathoon Oct 30, 2024
fed33e7
Merge branch '2024-hackweek' into sava/more-components
savathoon Oct 30, 2024
ecac23f
[feat] Table Top Bar Component (#177)
amyjchen Oct 30, 2024
fa37b58
figure out why this thing hates being full width of the parent compon…
savathoon Oct 30, 2024
cdfa264
Merge branch '2024-hackweek' into sava/more-components
savathoon Oct 30, 2024
1aa0aa8
update owner group accordion on app group page
savathoon Oct 30, 2024
a50ceaa
[fix] update user avatars to have adequate contrast across themes (#178)
amyjchen Oct 31, 2024
01f5b77
[fix] dark mode bugs (#179)
amyjchen Oct 31, 2024
9015a9c
fix missing key
amyjchen Oct 31, 2024
2a3f548
v0 of trying to filter members down to unique in list groups
savathoon Oct 31, 2024
8809feb
merge
savathoon Oct 31, 2024
c0988d4
flex jank
savathoon Oct 31, 2024
d1158ad
merge back changes in app/detail/index
savathoon Oct 31, 2024
166b4d2
controlled accordion but only kinda
savathoon Oct 31, 2024
69727e4
fix imports
savathoon Nov 1, 2024
f4b3dbc
autocomplete with members
savathoon Nov 1, 2024
fe70d9c
autocomplete
savathoon Nov 1, 2024
437bdae
add back dedupe
savathoon Nov 1, 2024
418f806
add optional header description to accordion list group
savathoon Nov 1, 2024
be55f39
[feat] Update Headers (#180)
amyjchen Nov 1, 2024
f43bcfd
[Groups] Add styles to wrap group name in header (#183)
savathoon Nov 1, 2024
fb5bc98
merge
savathoon Nov 1, 2024
e5108aa
merge conflict fixings
savathoon Nov 1, 2024
8e46b5d
Apps: user filter options now sorted
savathoon Nov 1, 2024
fc0e6e0
Hide title and description if accordion list is empty
savathoon Nov 1, 2024
3bdc926
update copy
savathoon Nov 1, 2024
dfaf96c
oops
savathoon Nov 1, 2024
387a776
merge main
savathoon Jan 3, 2025
8245737
Update type signature of groupMemberships function, clean up imports …
savathoon Jan 3, 2025
db56d3e
update formatting, add freeSolo to autocomplete
savathoon Jan 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ function Dashboard({setThemeMode}: {setThemeMode: (theme: PaletteMode) => void})
};

return (
<Box sx={{display: 'flex'}}>
<Box sx={{display: 'flex', minWidth: '20rem', overflowX: 'hidden'}}>
<AppBar position="absolute" open={open}>
<Toolbar
sx={{
Expand Down
18 changes: 18 additions & 0 deletions src/components/EmptyListEntry.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import {TableRow, TableCell, Typography, TableCellProps} from '@mui/material';

interface EmptyListEntryProps {
cellProps?: TableCellProps;
customText?: string;
}

export const EmptyListEntry: React.FC<EmptyListEntryProps> = ({cellProps, customText}) => {
return (
<TableRow>
<TableCell {...cellProps}>
<Typography variant="body2" color="grey">
{customText || 'None'}
</Typography>
</TableCell>
</TableRow>
);
};
27 changes: 26 additions & 1 deletion src/helpers.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {PolymorphicGroup, OktaUser, Tag, OktaGroupTagMap} from './api/apiSchemas';
import {PolymorphicGroup, OktaUser, Tag, OktaGroupTagMap, OktaUserGroupMember} from './api/apiSchemas';

export const perPage: Array<number | {label: string; value: number}> = [5, 10, 20, 50, {label: 'All', value: -1}];

Expand Down Expand Up @@ -107,3 +107,28 @@ export function ownerCantAddSelf(tags: Tag[] | undefined, owner: boolean) {
export function ownerCantAddSelfGroups(groups: PolymorphicGroup[], owner: boolean) {
return ownerCantAddSelf(getActiveTagsFromGroups(groups), owner);
}

export function sortGroupMembers(
[aUserId, aUsers]: [string, Array<OktaUserGroupMember>],
[bUserId, bUsers]: [string, Array<OktaUserGroupMember>],
): number {
let aEmail = aUsers[0].active_user?.email ?? '';
let bEmail = bUsers[0].active_user?.email ?? '';
return aEmail.localeCompare(bEmail);
}

export function sortGroupMemberRecords(users: Record<string, OktaUser>): OktaUser[] {
const usersArray = Object.values(users); // Convert the object to an array
usersArray.sort((a, b) => {
const nameA = `${a.first_name} ${a.last_name}`;
const nameB = `${b.first_name} ${b.last_name}`;
return nameA.localeCompare(nameB);
});
return usersArray;
}

export function groupMemberships(
memberships: Array<OktaUserGroupMember> | undefined,
): Record<string, Array<OktaUserGroupMember>> {
return groupBy(memberships ?? [], () => 'active_user.id');
}
Loading
Loading