feat(rbac): fixed broken invite and role missing in dropdown

This commit is contained in:
Akhil Mohan
2023-09-08 21:22:36 +05:30
parent cb9ee00ed3
commit 6bbdc4a405
9 changed files with 42 additions and 30 deletions
@@ -47,7 +47,7 @@ export const MembersPage = withProjectPermission(
animate={{ opacity: 1, translateX: 0 }}
exit={{ opacity: 0, translateX: 30 }}
>
<MemberListTab roles={roles as TRole<string>[]} />
<MemberListTab roles={roles as TRole<string>[]} isRolesLoading={isRolesLoading} />
</motion.div>
</TabPanel>
<TabPanel value={TabSections.Roles}>
@@ -54,6 +54,7 @@ import { TRole } from "@app/hooks/api/roles/types";
type Props = {
roles?: TRole<string>[];
isRolesLoading?: boolean;
};
const addMemberFormSchema = z.object({
@@ -62,7 +63,7 @@ const addMemberFormSchema = z.object({
type TAddMemberForm = z.infer<typeof addMemberFormSchema>;
export const MemberListTab = ({ roles = [] }: Props) => {
export const MemberListTab = ({ roles = [], isRolesLoading }: Props) => {
const { createNotification } = useNotificationContext();
const { t } = useTranslation();
@@ -227,7 +228,7 @@ export const MemberListTab = ({ roles = [] }: Props) => {
}
};
const isLoading = isMembersLoading;
const isLoading = isMembersLoading || isRolesLoading;
return (
<div className="w-full">