diff --git a/src/features/Classes/ClassesTable/_test_/columns.test.jsx b/src/features/Classes/ClassesTable/_test_/columns.test.jsx index daba135..a5c2bcb 100644 --- a/src/features/Classes/ClassesTable/_test_/columns.test.jsx +++ b/src/features/Classes/ClassesTable/_test_/columns.test.jsx @@ -99,6 +99,7 @@ describe('columns', () => { expect(getByText('View class content')).toBeInTheDocument(); expect(getByText('Manage Instructors')).toBeInTheDocument(); expect(getByText('Edit Class')).toBeInTheDocument(); + expect(getByText('Gradebook')).toBeInTheDocument(); expect(getByText('Delete Class')).toBeInTheDocument(); }); }); diff --git a/src/features/Classes/ClassesTable/columns.jsx b/src/features/Classes/ClassesTable/columns.jsx index 4f3dfd5..3711ca1 100644 --- a/src/features/Classes/ClassesTable/columns.jsx +++ b/src/features/Classes/ClassesTable/columns.jsx @@ -119,6 +119,7 @@ const columns = [ const deletionState = useSelector((state) => state.courses.newClass.status); const [isOpenModal, openModal, closeModal] = useToggle(false); const [deletionClassState, setDeletionState] = useState(initialDeletionClassState); + const gradebookUrl = getConfig().GRADEBOOK_MICROFRONTEND_URL || getConfig().LMS_BASE_URL; const handleResetDeletion = () => { setDeletionState(initialDeletionClassState); @@ -129,6 +130,10 @@ const columns = [ setDeletionState({ isModalOpen: true, isRequestComplete: false }); }; + const handleGradebookButton = () => { + window.open(`${gradebookUrl}/gradebook/${classId}`, '_blank', 'noopener,noreferrer'); + }; + const handleDeleteClass = async (rowClassId) => { try { await dispatch(deleteClass(rowClassId)); @@ -187,6 +192,10 @@ const columns = [ Edit Class + + + Gradebook + Delete Class