in src/Frontend/src/components/users/Users.tsx [168:213]
confirm: async () => await deleteUserById(id),
category: CATEGORY_USERS
}
});
};
const calculateDisabledExams = (item: any) => {
if (!item || !item.exams || !item.exams.length) return true;
let isDisabled = true;
const hasExamToFinish = item.exams.find((exam : { status: string }) => exam.status !== ENUM_EXAM_STATUS_FINISHED);
if (hasExamToFinish) isDisabled = false;
return isDisabled;
}
const calculateDisabledResult = (item: any) => {
if (!item || !item.exams || !item.exams.length) return true;
let isDisabled = true;
const canViewResults = item.exams.find((exam : { status: string }) => exam.status !== ENUM_EXAM_STATUS_NOT_STARTED && exam.status !== ENUM_EXAM_STATUS_IN_PROGRESS);
if (canViewResults) isDisabled = false;
return isDisabled;
}
const columns: ColumnDef<TTableHeader>[] = [
{
accessorKey: "name",
header: t("table.headers.name"),
},
{
accessorKey: "email_address",
header: t("table.headers.email"),
},
{
accessorKey: "actions",
header: t("table.headers.actions"),
cell: ({ row }) => {
const user = row.original
return (
<>
<div className="flex justify-center">
<RBACWrapper requiredScopes={[SCOPE_USER_IMPERSONATE]}>
{pathname.includes('results') ?