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

fix: handle inconsistent ge param #1045

Merged
merged 1 commit into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
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 @@ -55,10 +55,10 @@ class GESelector extends PureComponent<GESelectorProps, GESelectorState> {
const stateObj = { url: 'url' };
const url = new URL(window.location.href);
const urlParam = new URLSearchParams(url.search);
urlParam.delete('GE');
urlParam.delete('ge');
const changedValue = event.target.value as string;
if (changedValue && changedValue != 'ANY') {
urlParam.append('GE', event.target.value as string);
urlParam.append('ge', event.target.value as string);
}
const param = urlParam.toString();
const new_url = `${param.trim() ? '?' : ''}${param}`;
Expand Down
2 changes: 1 addition & 1 deletion apps/antalmanac/src/components/RightPane/RightPaneStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class RightPaneStore extends EventEmitter {
const search = new URLSearchParams(window.location.search);
this.urlCourseCodeValue = search.get('courseCode') || '';
this.urlTermValue = search.get('term') || '';
this.urlGEValue = search.get('GE') || '';
this.urlGEValue = search.get('ge') || '';
this.urlCourseNumValue = search.get('courseNumber') || '';
this.urlDeptLabel = search.get('deptLabel') || '';
this.urlDeptValue = search.get('deptValue') || '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export function ColorAndDelete(props: SectionActionProps) {
* Copying a specific class's link will only copy its course code.
* If there is random value let in the url, it will interfere with the generated url.
*/
const fieldsToReset = ['courseCode', 'courseNumber', 'deptLabel', 'deptValue', 'GE', 'term'];
const fieldsToReset = ['courseCode', 'courseNumber', 'deptLabel', 'deptValue', 'ge', 'term'];

/**
* Sections that have not been added to a schedule can be added to a schedule.
Expand Down
4 changes: 2 additions & 2 deletions apps/antalmanac/src/stores/CoursePaneStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function paramsAreInURL() {
'courseCode',
'courseNumber',
'deptLabel',
'GE',
'ge',
'deptValue',
'term',
'sectionCode',
Expand All @@ -45,7 +45,7 @@ function paramsAreInURL() {
function requiredParamsAreInURL() {
const search = new URLSearchParams(window.location.search);

const searchParams = ['courseCode', 'courseNumber', 'GE', 'deptValue'];
const searchParams = ['courseCode', 'courseNumber', 'ge', 'deptValue'];

return searchParams.some((param) => search.get(param) !== null);
}
Expand Down
Loading