fix: workspace setting validation (#5654)
This commit is contained in:
parent
22b32fd5c6
commit
3c1779b287
1 changed files with 32 additions and 32 deletions
|
|
@ -43,7 +43,7 @@ export const SidebarWorkspaceMenu = observer(() => {
|
||||||
const { setValue: toggleWorkspaceMenu, storedValue } = useLocalStorage<boolean>("is_workspace_menu_open", true);
|
const { setValue: toggleWorkspaceMenu, storedValue } = useLocalStorage<boolean>("is_workspace_menu_open", true);
|
||||||
// derived values
|
// derived values
|
||||||
const isWorkspaceMenuOpen = !!storedValue;
|
const isWorkspaceMenuOpen = !!storedValue;
|
||||||
const isAdmin = allowPermissions([EUserPermissions.ADMIN, EUserPermissions.MEMBER], EUserPermissionsLevel.WORKSPACE);
|
const isAdmin = allowPermissions([EUserPermissions.ADMIN], EUserPermissionsLevel.WORKSPACE);
|
||||||
|
|
||||||
const handleLinkClick = (itemKey: string) => {
|
const handleLinkClick = (itemKey: string) => {
|
||||||
if (window.innerWidth < 768) {
|
if (window.innerWidth < 768) {
|
||||||
|
|
@ -84,7 +84,6 @@ export const SidebarWorkspaceMenu = observer(() => {
|
||||||
>
|
>
|
||||||
<span>WORKSPACE</span>
|
<span>WORKSPACE</span>
|
||||||
</Disclosure.Button>
|
</Disclosure.Button>
|
||||||
{isAdmin && (
|
|
||||||
<CustomMenu
|
<CustomMenu
|
||||||
customButton={
|
customButton={
|
||||||
<span
|
<span
|
||||||
|
|
@ -115,6 +114,7 @@ export const SidebarWorkspaceMenu = observer(() => {
|
||||||
</Link>
|
</Link>
|
||||||
</CustomMenu.MenuItem>
|
</CustomMenu.MenuItem>
|
||||||
|
|
||||||
|
{isAdmin && (
|
||||||
<CustomMenu.MenuItem>
|
<CustomMenu.MenuItem>
|
||||||
<Link href={`/${workspaceSlug}/settings`}>
|
<Link href={`/${workspaceSlug}/settings`}>
|
||||||
<div className="flex items-center justify-start gap-2">
|
<div className="flex items-center justify-start gap-2">
|
||||||
|
|
@ -123,8 +123,8 @@ export const SidebarWorkspaceMenu = observer(() => {
|
||||||
</div>
|
</div>
|
||||||
</Link>
|
</Link>
|
||||||
</CustomMenu.MenuItem>
|
</CustomMenu.MenuItem>
|
||||||
</CustomMenu>
|
|
||||||
)}
|
)}
|
||||||
|
</CustomMenu>
|
||||||
<Disclosure.Button
|
<Disclosure.Button
|
||||||
as="button"
|
as="button"
|
||||||
className="sticky top-0 z-10 group/workspace-button px-0.5 py-1.5 flex items-center justify-between gap-1 text-custom-sidebar-text-400 hover:bg-custom-sidebar-background-90 rounded text-xs font-semibold"
|
className="sticky top-0 z-10 group/workspace-button px-0.5 py-1.5 flex items-center justify-between gap-1 text-custom-sidebar-text-400 hover:bg-custom-sidebar-background-90 rounded text-xs font-semibold"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue