From e76c712cd6e34c8c11636eac265ce6cb436035c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Jim=C3=A9nez?= Date: Wed, 12 Jun 2024 15:23:35 -0500 Subject: [PATCH] feat: redirect link to manage instructors in classes table --- src/features/Classes/ClassesTable/columns.jsx | 68 +++++++++---------- 1 file changed, 31 insertions(+), 37 deletions(-) diff --git a/src/features/Classes/ClassesTable/columns.jsx b/src/features/Classes/ClassesTable/columns.jsx index f3f4da7b..bc707b64 100644 --- a/src/features/Classes/ClassesTable/columns.jsx +++ b/src/features/Classes/ClassesTable/columns.jsx @@ -1,20 +1,18 @@ -/* eslint-disable react/prop-types, no-nested-ternary */ -import React, { useState } from 'react'; -import { useDispatch, useSelector } from 'react-redux'; +/* eslint-disable react/prop-types */ +import React from 'react'; import { Link } from 'react-router-dom'; -import { Button } from 'react-paragon-topaz'; -import AssignInstructors from 'features/Instructors/AssignInstructors'; import { - Dropdown, IconButton, Icon, useToggle, + Dropdown, + IconButton, + Icon, + useToggle, } from '@edx/paragon'; -import AddClass from 'features/Courses/AddClass'; import { MoreHoriz } from '@edx/paragon/icons'; +import { getConfig } from '@edx/frontend-platform'; -import { updateClassSelected } from 'features/Instructors/data/slice'; -import { fetchClassesData } from 'features/Classes/data/thunks'; +import AddClass from 'features/Courses/AddClass'; -import { initialPage } from 'features/constants'; import { formatUTCDate } from 'helpers'; const columns = [ @@ -60,21 +58,6 @@ const columns = [ Header: 'Instructors', accessor: 'instructors', Cell: ({ row }) => { - const [isModalOpen, setIsModalOpen] = useState(false); - - const dispatch = useDispatch(); - const institution = useSelector((state) => state.main.selectedInstitution); - - const handleOpenModal = () => { - dispatch(updateClassSelected(row.original.classId)); - setIsModalOpen(true); - }; - - const handleCloseModal = () => { - dispatch(fetchClassesData(institution.id, initialPage)); - setIsModalOpen(false); - }; - if (row.values.instructors?.length > 0) { return ( ); } + return ( - <> - - - + + Unassigned + ); }, }, @@ -127,9 +103,27 @@ const columns = [ /> - + Edit Class + + + View class content + + + + + Manage Instructors + +