Skip to content

Commit

Permalink
fix: missing query param
Browse files Browse the repository at this point in the history
  • Loading branch information
01001110J committed Jul 19, 2024
1 parent 3720354 commit ae40b9d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/features/Classes/Class/ClassPage/Actions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
import { MoreVert } from '@edx/paragon/icons';

import { setAssignStaffRole } from 'helpers';
import { useInstitutionIdQueryParam } from 'hooks';

import AddClass from 'features/Courses/AddClass';
import EnrollStudent from 'features/Classes/EnrollStudent';
Expand All @@ -33,9 +34,10 @@ const Actions = ({ previousPage }) => {
const [isEnrollModalOpen, setIsEnrollModalOpen] = useState(false);

const handleEnrollStudentModal = () => setIsEnrollModalOpen(!isEnrollModalOpen);
const addQueryParam = useInstitutionIdQueryParam();

const handleManageButton = () => {
history.push(`/manage-instructors/${courseName}/${className}?classId=${queryClassId}&previous=${previousPage}`);
history.push(addQueryParam(`/manage-instructors/${courseName}/${className}?classId=${queryClassId}&previous=${previousPage}`));
};

return (
Expand Down
6 changes: 5 additions & 1 deletion src/features/Dashboard/DashboardPage/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import WeeklySchedule from 'features/Dashboard/WeeklySchedule';
import { fetchLicensesData } from 'features/Dashboard/data';
import { updateActiveTab } from 'features/Main/data/slice';

import { useInstitutionIdQueryParam } from 'hooks';

import 'features/Dashboard/DashboardPage/index.scss';

const DashboardPage = () => {
Expand All @@ -24,8 +26,10 @@ const DashboardPage = () => {
const [dataTableLicense, setDataTableLicense] = useState([]);
const imageDashboard = getConfig().IMAGE_DASHBOARD_URL;

const addQueryParam = useInstitutionIdQueryParam();

const handleViewAllLicenses = () => {
history.push('/licenses');
history.push(addQueryParam('/licenses'));
dispatch(updateActiveTab('licenses'));
};

Expand Down
4 changes: 3 additions & 1 deletion src/features/Dashboard/InstructorAssignSection/ClassCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ import PropTypes from 'prop-types';
import { Button } from 'react-paragon-topaz';

import { formatDateRange } from 'helpers';
import { useInstitutionIdQueryParam } from 'hooks';

import 'features/Dashboard/InstructorAssignSection/index.scss';

const ClassCard = ({ data }) => {
const history = useHistory();
const addQueryParam = useInstitutionIdQueryParam();

const handleManageButton = () => {
history.push(`/manage-instructors/${encodeURIComponent(data?.masterCourseName)}/${encodeURIComponent(data?.className)}?classId=${data?.classId}&previous=dashboard`);
history.push(addQueryParam(`/manage-instructors/${encodeURIComponent(data?.masterCourseName)}/${encodeURIComponent(data?.className)}?classId=${data?.classId}&previous=dashboard`));
};

return (
Expand Down
6 changes: 5 additions & 1 deletion src/features/Dashboard/InstructorAssignSection/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import { Button } from 'react-paragon-topaz';
import { fetchClassesData } from 'features/Dashboard/data';
import { updateActiveTab } from 'features/Main/data/slice';

import { useInstitutionIdQueryParam } from 'hooks';

import 'features/Dashboard/InstructorAssignSection/index.scss';

const InstructorAssignSection = () => {
Expand All @@ -19,8 +21,10 @@ const InstructorAssignSection = () => {
const [classCards, setClassCards] = useState([]);
const numberOfClasses = 2;

const addQueryParam = useInstitutionIdQueryParam();

const handleViewAllClasses = () => {
history.push('/classes?instructors=null');
history.push(addQueryParam('/classes?instructors=null'));
dispatch(updateActiveTab('classes'));
};

Expand Down

0 comments on commit ae40b9d

Please sign in to comment.