mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 21:27:31 +00:00
Make button always show and swap to "Join as Admin"
This commit is contained in:
@@ -351,40 +351,38 @@ export const AllProjectView = ({
|
|||||||
<span>Joined</span>
|
<span>Joined</span>
|
||||||
</Badge>
|
</Badge>
|
||||||
) : (
|
) : (
|
||||||
<div className="opacity-0 transition-all group-hover:opacity-100">
|
<OrgPermissionCan
|
||||||
<OrgPermissionCan
|
I={OrgPermissionAdminConsoleAction.AccessAllProjects}
|
||||||
I={OrgPermissionAdminConsoleAction.AccessAllProjects}
|
an={OrgPermissionSubjects.AdminConsole}
|
||||||
an={OrgPermissionSubjects.AdminConsole}
|
>
|
||||||
>
|
{(isAllowed) =>
|
||||||
{(isAllowed) =>
|
isAllowed ? (
|
||||||
isAllowed ? (
|
<Button
|
||||||
<Button
|
size="xs"
|
||||||
size="xs"
|
variant="outline_bg"
|
||||||
variant="outline_bg"
|
onClick={(e) => {
|
||||||
onClick={(e) => {
|
e.stopPropagation();
|
||||||
e.stopPropagation();
|
e.preventDefault();
|
||||||
e.preventDefault();
|
handleAccessProject(workspace.type, workspace.id);
|
||||||
handleAccessProject(workspace.type, workspace.id);
|
}}
|
||||||
}}
|
disabled={
|
||||||
disabled={
|
orgAdminAccessProject.variables?.projectId === workspace.id &&
|
||||||
orgAdminAccessProject.variables?.projectId === workspace.id &&
|
orgAdminAccessProject.isPending
|
||||||
orgAdminAccessProject.isPending
|
}
|
||||||
}
|
>
|
||||||
>
|
Join as Admin
|
||||||
Admin Access
|
</Button>
|
||||||
</Button>
|
) : (
|
||||||
) : (
|
<Button
|
||||||
<Button
|
size="xs"
|
||||||
size="xs"
|
variant="outline_bg"
|
||||||
variant="outline_bg"
|
onClick={() => handlePopUpOpen("requestAccessConfirmation", workspace)}
|
||||||
onClick={() => handlePopUpOpen("requestAccessConfirmation", workspace)}
|
>
|
||||||
>
|
Request Access
|
||||||
Request Access
|
</Button>
|
||||||
</Button>
|
)
|
||||||
)
|
}
|
||||||
}
|
</OrgPermissionCan>
|
||||||
</OrgPermissionCan>
|
|
||||||
</div>
|
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
|
|||||||
Reference in New Issue
Block a user