Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: disable/some actions when no instructor #319

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ export default function HeadingAndActions({ course, activeSchedule, onClose }: H
const url = `https://utdirect.utexas.edu/apps/student/coursedocs/nlogon/?year=&semester=&department=${department}&course_number=${courseNumber}&course_title=&unique=&instructor_first=${firstName}&instructor_last=${lastName}&course_type=In+Residence&search=Search`;
openNewTab({ url });
}

// Show the course's syllabi when no instructors listed
if (instructors.length === 0) {
const url = `https://utdirect.utexas.edu/apps/student/coursedocs/nlogon/?year=&semester=&department=${department}&course_number=${courseNumber}&course_title=&unique=&instructor_first=&instructor_last=&course_type=In+Residence&search=Search`;
openNewTab({ url });
}
};

const handleAddOrRemoveCourse = async () => {
Expand Down Expand Up @@ -199,10 +205,22 @@ export default function HeadingAndActions({ course, activeSchedule, onClose }: H
}}
/>
<Divider size='1.75rem' orientation='vertical' />
<Button variant='outline' color='ut-blue' icon={Reviews} onClick={handleOpenRateMyProf}>
<Button
variant='outline'
color='ut-blue'
icon={Reviews}
onClick={handleOpenRateMyProf}
disabled={instructors.length === 0}
>
RateMyProf
</Button>
<Button variant='outline' color='ut-teal' icon={Mood} onClick={handleOpenCES}>
<Button
variant='outline'
color='ut-teal'
icon={Mood}
onClick={handleOpenCES}
disabled={instructors.length === 0}
>
CES
</Button>
<Button variant='outline' color='ut-orange' icon={Description} onClick={handleOpenPastSyllabi}>
Expand Down
Loading