Skip to content

Commit

Permalink
Merge branch 'master' into support/150156-sidebar-header-text-size
Browse files Browse the repository at this point in the history
  • Loading branch information
satof3 committed Jul 25, 2024
2 parents f640ba1 + 10ba086 commit 3a719cf
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.user-group-edit-link {
text-decoration: underline;
}

// switch visibility of the edit icon
.user-group-edit-link {
:global {
.grw-edit-icon {
visibility: hidden;
}
}

&:global {
&:hover {
.grw-edit-icon {
visibility: visible;
}
}
}
}
29 changes: 23 additions & 6 deletions apps/app/src/client/components/Admin/UserGroup/UserGroupTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ import Link from 'next/link';
import type { IExternalUserGroupHasId } from '~/features/external-user-group/interfaces/external-user-group';


import styles from './UserGroupTable.module.scss';

const userGroupEditLinkStyle = styles['user-group-edit-link'] ?? '';


type Props = {
headerLabel?: string,
userGroups: IUserGroupHasId[],
Expand Down Expand Up @@ -54,6 +59,23 @@ const generateGroupIdToChildGroupsMap = (childUserGroups: IUserGroupHasId[]): Re
return map;
};

type UserGroupEditLinkProps = {
group:IUserGroupHasId,
isExternalGroup:boolean,
}

const UserGroupEditLink = (props: UserGroupEditLinkProps): JSX.Element => {
return (
<Link
href={`/admin/user-group-detail/${props.group._id}?isExternalGroup=${props.isExternalGroup}`}
className={`${userGroupEditLinkStyle} link-secondary link-offset-2 link-underline-opacity-25 link-underline-opacity-100-hover`}
>
<span className="material-symbols-outlined pe-2 pt-2">group</span>
<span>{props.group.name}</span>
<span className="grw-edit-icon material-symbols-outlined px-2 py-0">edit</span>
</Link>
);
};

export const UserGroupTable: FC<Props> = ({
headerLabel,
Expand Down Expand Up @@ -163,12 +185,7 @@ export const UserGroupTable: FC<Props> = ({
{isAclEnabled
? (
<td>
<Link
className="link-opacity-75-hover"
href={`/admin/user-group-detail/${group._id}?isExternalGroup=${isExternalGroup}`}
>
{group.name}
</Link>
<UserGroupEditLink group={group} isExternalGroup={isExternalGroup} />
</td>
)
: (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ export const SecondaryItems: FC = memo(() => {

return (
<div className={styles['grw-secondary-items']}>
{!isGuestUser && <PersonalDropdown />}
<SecondaryItem label="Help" iconName="help" href={growiCloudUri != null ? 'https://growi.cloud/help/' : 'https://docs.growi.org'} isBlank />
{isAdmin && <SecondaryItem label="Admin" iconName="settings" href="/admin" />}
<SecondaryItem label="Trash" href="/trash" iconName="delete" />
{!isGuestUser && <PersonalDropdown />}
</div>
);
});

0 comments on commit 3a719cf

Please sign in to comment.