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

Assign Course to Placeholder Modal (Front-End) #645

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

willespencer
Copy link
Member

Summary

This pull request implements the front-end for the modal that opens to assign courses to placeholders to continue Templates development. Follow-up from #592.

  • Open modal when a placeholder is clicked
  • Refactor NewSelfCheckCourseModal to handle placeholder assigning as well
  • Implement removing placeholder button and styling (with confirmation)
  • Add temporary description/learn more values with TODOs

image

Remaining TODOs:

Complete the requirements side of this modal in a later PR. This should be easier as real placeholder data is populated into a user's Firestore collection. Specifically...

  • Filter out the courses that can be added in the new modal
  • Assign selected course to requirement
  • Replace placeholder in front-end with selected course (and show confirmation)
  • Show corresponding description and learn more link from requirements sidebar

Test Plan

Similarly to #592 - placeholder data has to be added to Firestore manually. Afterward...

  1. Confirm clicking on a placeholder opens up a modal with the name of the placeholder as its title
  2. Confirm the styling of the modal matches the designs
  3. Confirm pressing remove on the modal deletes the placeholder from the plan, and refreshing it
  4. Confirm courses are properly filtered in a self-check add modal and can be assigned to the requirements and semesters as before.

image

Notes

@kkkehui could you take a look and let me know if this looks good? I think I closely followed the designs - but I did keep the placeholder text inside the input box the same as our other add modals for consistency and easier coding. Let me know what you think!

Additionally, This PR can be safely merged as long as the self check add modal remains unchanged, as real users cannot yet have placeholders!

@willespencer willespencer requested a review from a team as a code owner January 27, 2022 20:37
@dti-github-bot
Copy link
Member

[diff-counting] Significant lines: 111.

@github-actions
Copy link
Contributor

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

https://cornelldti-courseplan-dev--pr645-placeholder-modal-6jc5l3wp.web.app

(expires Thu, 03 Feb 2022 20:41:01 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Copy link
Collaborator

@benjamin-shen benjamin-shen left a comment

Choose a reason for hiding this comment

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

Thanks @willespencer!

I feel like the add placeholder modal should be a separate component from the add self check modal. I also had some questions and concerns regarding this implementation.

this.isPlaceholderModalOpen = false;
},
assignCourse() {
// TODO @willespencer write the code that assigns a course to a placeholder
Copy link
Collaborator

Choose a reason for hiding this comment

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

How were we going to implement assigning courses to placeholders? I thought we modeled placeholders after normal courses because we were going to replace them -- I don't know if this added complexity is worth it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry - assign might be the wrong choice here! Yes the idea was to insert and replace a placeholder with a course in the courses list.

// TODO @willespencer write the code that assigns a course to a placeholder
},
getRequirementID() {
// TODO @willespencer get requirement ID from name and slot
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just double checking, do placeholders and requirements have a 1:1 mapping? Where is the name and slot stored?

Copy link
Member Author

Choose a reason for hiding this comment

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

Requirement name and slot is in the firestore list of courses! Every requirement slot will have at most as many placeholders as courses that are needed to fulfill it, but could have fewer in cases of double counting.

Comment on lines +65 to +68
getRequirementLearnMore() {
// TODO @willespencer get requirement learn more link to show on add modal
return 'https://cornelldti.org';
},
Copy link
Collaborator

Choose a reason for hiding this comment

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

We might want to refactor all of this displayed requirements information into its own component (not necessarily in your PR). I think it's pretty hacky as it is now. I also think it should be calculated at the add placeholder modal level, not in the placeholder component.

@kkkehui
Copy link
Contributor

kkkehui commented Feb 8, 2022

hey @willespencer , sorry I just saw this! everything looks good so far! thanks!
The only thing I am not sure about is the outline for the input, it seems to be black in this picture when the input bar is clicked. On the current website, I think it is blue (#0E62C9). If you are reusing the elements from the current add modal, then it should be fine! lmk if there's anything confusing. Thanks!

Screen Shot 2022-02-07 at 7 33 56 PM

Screen Shot 2022-02-07 at 7 36 31 PM

@noschiff noschiff self-requested a review March 28, 2022 15:24
@noschiff noschiff removed their request for review September 27, 2022 01:15
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.

4 participants