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

Remove as2 #618

Merged
merged 10 commits into from
Mar 29, 2022
Merged

Remove as2 #618

merged 10 commits into from
Mar 29, 2022

Conversation

zachary-kent
Copy link
Collaborator

@zachary-kent zachary-kent commented Dec 7, 2021

Summary

This pull request removes the AS1 and AS2 options from the onboarding college dropdown, replacing these with one "Arts and Sciences" option. Upon onboarding submission, whether the user is actually enrolled in AS1 or AS2 is determined by checking to entrance year and season the user recorded.

Test Plan

The new "Arts and Sciences" option:
Screen Shot 2021-12-07 at 5 33 50 PM
Whether you're in AS1 or AS2 is inferred on onboarding submission:
Screen Shot 2021-12-07 at 5 34 27 PM

NEW Confirm that an entrance year of Spring 2020 is AS before Fall 2020 (now that season is taken into account).
image

Future STODOs

  • Handle the ISST major in the same way
  • Add a test to confirm this works (maybe Fall 2019, Spring 2020, Fall 2020, Fall 2021) on Cypress

@zachary-kent zachary-kent requested a review from a team as a code owner December 7, 2021 22:35
@dti-github-bot
Copy link
Member

dti-github-bot commented Dec 7, 2021

[diff-counting] Significant lines: 63.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 7, 2021

Visit the preview URL for this PR (updated for commit b6be5c3):

https://cornelldti-courseplan-dev--pr618-remove-as2-1wimklw8.web.app

(expires Tue, 22 Mar 2022 23:59:39 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

@@ -188,7 +191,7 @@ export default defineComponent({
placeholderText,
gradYear: this.onboardingData.gradYear,
entranceYear: this.onboardingData.entranceYear,
collegeAcronym: this.onboardingData.college ? this.onboardingData.college : '',
collegeAcronym: this.onboardingData.college ?? '',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoa I didn't know ?? existed. This is cool!

},
majors(): Readonly<Record<string, string>> {
const majors: Record<string, string> = {};
const majorJSON = reqsData.major;
const acr = this.collegeAcronym.replace('AS', 'AS2');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this arbitrarily choosing AS2 to replace AS so that it passes the if statement?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so! The major lists for AS1 and AS2 should be the same

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed this was the case in the index.ts in the data folder.

Copy link
Contributor

@hahnbeelee hahnbeelee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basic functionality works, but
There's a weird bug where the chosen college + major disappears once I open the modal up again after choosing Arts & Science.
image

@CLAassistant
Copy link

CLAassistant commented Jan 18, 2022

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@willespencer willespencer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the code and found one small change to make. After fixing that, fixing the bug @hahnbeelee pointed out, resolving merge conflicts, and testing, this should be good for someone else to review!

src/components/Modals/Onboarding/Onboarding.vue Outdated Show resolved Hide resolved
},
majors(): Readonly<Record<string, string>> {
const majors: Record<string, string> = {};
const majorJSON = reqsData.major;
const acr = this.collegeAcronym.replace('AS', 'AS2');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so! The major lists for AS1 and AS2 should be the same

@einc einc requested a review from jerrry1123 March 9, 2022 22:55
@jessfeng jessfeng requested a review from andxu282 March 9, 2022 23:31
Copy link
Contributor

@jerrry1123 jerrry1123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

everything makes sense for me except the part where we're doing a special case for A&S at the end. Shouldn't we be directly changing the JSON instead?

src/utilities.ts Outdated
@@ -50,6 +50,9 @@ export const yearRange = 6;

export function getCollegeFullName(acronym: string | undefined): string {
// Return empty string if college is not in requirementJSON
if (acronym === 'AS') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we be doing a special case here instead of changing the JSON directly?

Copy link
Collaborator

@benjamin-shen benjamin-shen Mar 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This question is totally fair, and it's due to an inconsistency with the frontend and "backend" (how we represent requirements data).

A&S before and after 2020 have different requirements. They are represented as AS1 and AS2 in our requirements data. That is, they are considered separate colleges (because we assume one college = one set of requirements). On the frontend, we want the user to see it as a merged college, i.e. AS. So, Zak decided to implement this as a frontend-only change by writing conversions between these two representations. An upside of this is that the backend format can stay the same. A downside of this is that A&S needs to be special-cased in few different places.

An alternative implementation would have been something along the lines of adding variants to the requirements data format. So, the backend would look something like AS:Version1 and AS:Version2, where AS refers to a single college and Version1 and Version2 refer to different sets of requirements (we now assume one college = one or more sets of requirements). An upside would be that it would be more extensible -- that is, other colleges can have multiple versions as well (which is great if requirements are changed relatively frequently). A downside would be that every other college would have to support this added complexity (for example, EN would need to turn into EN:Version1 or EN:Default, both in the requirements data and in our user database). There are probably ways to avoid this downside by making the new format backwards-compatible, but that also comes with its pros and cons (see how we implemented additionalRequirements).

I personally think a single special case like this is fine. But if there are more special cases to be added in the future, or if we somehow manage to reach the backlog, I think there should be a refactoring effort.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for explaining that Ben! If we ever have a chance to refactor this to use the alternate implementation you mentioned, that could allow us to handle more specific cases of requirements changing over time (such as the Probability and Stats requirement for ECE). It's definitely down the line, but it could be useful for our users and help to reduce some confusion.

Copy link

@jessfeng jessfeng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on preview url with entrance year before Fall 2020, Fall 2020, and after Fall 2020 and they all look good! 😄 The bug I noticed during dev meeting is when adding another major and clicking finish on the onboarding, navigating to the new added major's header doesn't display anything below it (steps and screenshots are below). It's fine after refreshing the page (progress bar + requirements show up), so I'm not sure how big of a problem this is. I tried the same steps on prod, and it seems to have expected behavior (progress bar + requirements show up after finishing edit profile w/o having to refresh).
Screen Shot 2022-03-10 at 12 19 58 AM

@willespencer
Copy link
Member

Tested on preview url with entrance year before Fall 2020, Fall 2020, and after Fall 2020 and they all look good! 😄 The bug I noticed during dev meeting is when adding another major and clicking finish on the onboarding, navigating to the new added major's header doesn't display anything below it (steps and screenshots are below). It's fine after refreshing the page (progress bar + requirements show up), so I'm not sure how big of a problem this is. I tried the same steps on prod, and it seems to have expected behavior (progress bar + requirements show up after finishing edit profile w/o having to refresh). Screen Shot 2022-03-10 at 12 19 58 AM

Thank you for the detailed testing plan!! However, I still am not able to reproduce this :(

  • @einc could you try to see if you can replicate it?
  • @jessfeng did you try this on the dev webapp? If not could you see if it fails there, because if so, it is probably unrelated to my changes.

Additionally, I fixed the bug @einc pointed out during the meeting that A&S was still labeled pre-post 2020 in the reqs bar! This PR should be good to go now besides this potential bug.

image

@willespencer willespencer requested review from einc and hahnbeelee March 16, 2022 00:14
@willespencer willespencer requested review from hahnbeelee and removed request for hahnbeelee March 29, 2022 19:32
@willespencer willespencer dismissed hahnbeelee’s stale review March 29, 2022 19:33

Changes resolved!

@willespencer willespencer merged commit 7bf56ba into master Mar 29, 2022
@willespencer willespencer deleted the remove-as2 branch March 29, 2022 19:33
@willespencer willespencer mentioned this pull request Apr 13, 2022
24 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants