Skip to content

Commit

Permalink
Don't display empty course CRNs (#613)
Browse files Browse the repository at this point in the history
  • Loading branch information
terror committed Dec 20, 2024
1 parent 584372d commit bcfd8fa
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ Options:
--page-delay <PAGE_DELAY> Time delay between page requests in milliseconds [default: 0]
--retries <RETRIES> Number of retries [default: 10]
--batch-size <BATCH_SIZE> Number of pages to scrape per concurrent batch [default: 20]
--mcgill-terms <MCGILL_TERMS> The mcgill terms to scrape [default: 2009-2010 2010-2011 2011-2012 2012-2013 2013-2014 2014-2015 2015-2016 2016-2017 2017-2018 2018-2019 2019-2020 2020-2021 2021-2022 2022-2023 2023-2024]
--vsb-terms <VSB_TERMS> The schedule builder terms to scrape [default: 202305 202309 202401]
--mcgill-terms <MCGILL_TERMS> The mcgill terms to scrape [default: 2009-2010 2010-2011 2011-2012 2012-2013 2013-2014 2014-2015 2015-2016 2016-2017 2017-2018 2018-2019 2019-2020 2020-2021 2021-2022 2022-2023 2023-2024 2024-2025]
--vsb-terms <VSB_TERMS> The schedule builder terms to scrape [default: 202405 202409 202501]
--scrape-vsb Scrape visual schedule builder information
-h, --help Print help
```
Expand Down
28 changes: 15 additions & 13 deletions client/src/components/SchedulesDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,19 +141,21 @@ const ScheduleRow = ({ block }: ScheduleRowProps) => {
<TimeblockDays days={tb.days} key={i} />
))}
</td>
<td
className='hidden cursor-pointer pr-2 text-sm font-medium text-gray-500 dark:text-gray-400 xs:table-cell'
onClick={() => {
toast.promise(navigator.clipboard.writeText(block.crn), {
success: `Copied CRN for ${block.display} to clipboard.`,
loading: undefined,
error:
'Something went wrong when trying to copy section CRN, please try again!',
});
}}
>
CRN: {block.crn}
</td>
{block.crn && (
<td
className='hidden cursor-pointer pr-2 text-sm font-medium text-gray-500 dark:text-gray-400 xs:table-cell'
onClick={() => {
toast.promise(navigator.clipboard.writeText(block.crn), {
success: `Copied CRN for ${block.display} to clipboard.`,
loading: undefined,
error:
'Something went wrong when trying to copy section CRN, please try again!',
});
}}
>
CRN: {block.crn}
</td>
)}
</tr>
);
};
Expand Down
1 change: 0 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ dev: services

dev-deps:
cargo install present
pnpm install

e2e:
pnpm run cy:e2e
Expand Down

0 comments on commit bcfd8fa

Please sign in to comment.