Skip to content

Commit

Permalink
fix:new cohort visibility (#326)
Browse files Browse the repository at this point in the history
Co-authored-by: Your Name <[email protected]>
  • Loading branch information
Cynthia-kam and Your Name authored Oct 19, 2023
1 parent 626dc20 commit 78b89b1
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 60 deletions.
1 change: 1 addition & 0 deletions src/containers/admin-dashBoard/CreateCohortModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ export default function CreateCohortModal({
setValue('phaseName', { value: undefined, label: undefined });

toast.success(t('Cohort Created successful') as TFunction);
refetch();
},
});
}
Expand Down
131 changes: 71 additions & 60 deletions src/pages/AdminTraineeDashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ function AdminTraineeDashboard() {
const [inviteEmail, setInviteEmail] = useState('');
const [buttonLoading, setButtonLoading] = useState(false);
const [toggle, setToggle] = useState(false);
const [showOptions, setShowOptions] = useState(false);
const options: any = [];
const teamsOptions: any = [];
const traineeOptions: any = [];
Expand Down Expand Up @@ -250,69 +251,79 @@ function AdminTraineeDashboard() {
accessor: '',
Cell: ({ row }: any) => (
<div
className={` items-center${
className={`items-center${
traineeData?.length > 0 ? ' flex' : ' hidden'
}`}
>
<Icon
icon="el:file-edit-alt"
className="mr-2"
width="25"
height="25"
cursor="pointer"
color="#9e85f5"
/* istanbul ignore next */
onClick={() => {
setSelectedOptionUpdate({
value: row.original.cohort,
label: row.original.cohort,
});
setSelectedTeamOptionUpdate({
value: row.original.team,
label: row.original.team,
});
removeEditModel();
setEditEmail(row.original.email);
setEditCohort(row.original.cohort);
setEditTeam(row.original.team);
}}
/>
<Icon
icon="mdi:close-circle-outline"
width="30"
height="30"
cursor="pointer"
color="#9e85f5"
/* istanbul ignore next */
onClick={() => {
removeTraineeMod();
setDeleteEmail(row.original.email);
setDeleteFromCohort(row.original.team);
}}
/>

<Icon
icon="mdi:close-circle"
width="30"
height="30"
cursor="pointer"
color="#9e85f5"
/* istanbul ignore next */
onClick={() => {
dropModel(row.original.email);
setdropTraineeID(row.original.userId);
setReason(row.original.reason);
}}
/>

<Icon
icon="flat-color-icons:view-details"
width="30"
height="30"
cursor="pointer"
color="#9e85f5"
onClick={() => handleClickOpen(row.original.email)}
/>
{showOptions ? (
<>
<Icon
icon="el:file-edit-alt"
className="mr-2"
width="25"
height="25"
cursor="pointer"
color="#9e85f5"
/* istanbul ignore next */
onClick={() => {
setSelectedOptionUpdate({
value: row.original.cohort,
label: row.original.cohort,
});
setSelectedTeamOptionUpdate({
value: row.original.team,
label: row.original.team,
});
removeEditModel();
setEditEmail(row.original.email);
setEditCohort(row.original.cohort);
setEditTeam(row.original.team);
}}
/>
<Icon
icon="mdi:close-circle-outline"
width="30"
height="30"
cursor="pointer"
color="#9e85f5"
/* istanbul ignore next */
onClick={() => {
removeTraineeMod();
setDeleteEmail(row.original.email);
setDeleteFromCohort(row.original.team);
}}
/>
<Icon
icon="mdi:close-circle"
width="30"
height="30"
cursor="pointer"
color="#9e85f5"
/* istanbul ignore next */
onClick={() => {
dropModel(row.original.email);
setdropTraineeID(row.original.userId);
setReason(row.original.reason);
}}
/>
<Icon
icon="flat-color-icons:view-details"
width="30"
height="30"
cursor="pointer"
color="#9e85f5"
onClick={() => handleClickOpen(row.original.email)}
/>
</>
) : (
<Icon
icon="entypo:dots-three-vertical"
width="30"
cursor="pointer"
color="#9e85f5"
onClick={() => setShowOptions(true)}
/>
)}
</div>
),
},
Expand Down

1 comment on commit 78b89b1

@vercel
Copy link

@vercel vercel bot commented on 78b89b1 Oct 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

metron-devpulse – ./

metron-devpulse.vercel.app
metron-devpulse-git-develop-metron.vercel.app
metron-devpulse-metron.vercel.app

Please sign in to comment.