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

Wrapped Frontend - Add TA slides & Update slide logic #879

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

anchen9
Copy link
Collaborator

@anchen9 anchen9 commented Oct 28, 2024

Summary

Added three total slides to the Wrapped Frontend by building on this PR and Figma dev handoff. I added slides is to display a student's favorite TA, the total time a TA helped students, and a slide for how many students a TA has helped. Also updated slide logic so that if an user is only a student, they do not see TA slides, and if an user is both a student & TA they see all slides, and if an user is only a TA they only see TA specific slides.

  • Added background gradient for all wrapped slides
  • Flipped image on the visits to office hours slides
  • Edited image size of personality slides
  • Edited text appearance on conclusion slide
  • Added favTaId to wrappedData

Test Plan

To test the slide logic, I edited my test data in QMI Test to test:

  • favTaId = "" or undefined ==> should only see TA specific slides
  • timeHelpingStudents == 0 or undefined ==> should only see student specific slides
  • if both are defined and non-empty/non-zero then all slides should be displayed.

Notes

  • need to complete ribbons/banners as well as animations
  • need to add firebase call to number of students a TA has helped.

Breaking Changes

None

  • I have updated the documentation accordingly.
  • My PR adds a @ts-ignore

@anchen9 anchen9 requested a review from a team as a code owner October 28, 2024 02:51
@CLAassistant
Copy link

CLAassistant commented Oct 28, 2024

CLA assistant check
All committers have signed the CLA.

@dti-github-bot
Copy link
Member

dti-github-bot commented Oct 28, 2024

[diff-counting] Significant lines: 573.

Copy link
Contributor

@rgu0114 rgu0114 left a comment

Choose a reason for hiding this comment

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

Great start on this so far Annie! And nice work navigating the existing (long) component file and adding in React/CSS changes to more closely mimic the designs. I added a few code style comments, but a couple other things to note:

  1. usually for frontend PRs, it's good to attach screenshots of the changes you made (even if the reviewer will run it locally) so it's clearer what changes you made. Attaching the reference Figma designs is also a plus.
  2. if you reload and go to to the favorite TA slide for the first time, there's some flickering – probably some incorrect logic related to the total number of stages for users who are also TAs, but I can take another look and suggest fixes


const FavTA = () => (
<>
<div style={{
Copy link
Contributor

Choose a reason for hiding this comment

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

put styling inside Wrapped.scss as a new css class unless it's super small (like a couple lines), in that case u can do styling inline like you do here

</div>

<Typography variant="h3" style={{ fontWeight: 600 }}>
<div className="taName">TA {wrappedData.favTaId}</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

this is the right logic here, but favTAId is actually a long string corresponding to a particular TA – O0W5vwCn9bN2LLQOiVTB4UyAvxc2

To get the actual TA's name, you'll need to query the users collection in Firebase and look up the firstName and lastName fields

Copy link
Contributor

Choose a reason for hiding this comment

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

you can sorta see this on lines 50 and 55. So it would be something like...

const usersRef = firebase.firestore().collection('users'); // accessing the users collection
const doc = await usersRef.doc(props.user?.userId).get(wrappedData.favTaId); // looking up a user document by id
...
<div>`Favorite TA: {doc.firstName} {doc.lastName}`</div> // string concat in javascript (check correct syntax)

const totalStages = 5;

/* TA's only see 4 slides, TA + Student see 7, Only student see 6 */
const totalStages = (wrappedData.timeHelpingStudents === undefined || wrappedData.timeHelpingStudents == 0) ?
Copy link
Contributor

Choose a reason for hiding this comment

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

javascript uses === instead of ==

Copy link
Contributor

Choose a reason for hiding this comment

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

also, you can use truthy and falsy values in languages like JS to simplify this. So if wrappedData.timeHelpingStudents === undefined, you'd normally do if (wrappedData.timeHelpingStudents)... and the conditional would evaluate to false if it's undefined

Copy link
Contributor

Choose a reason for hiding this comment

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

let's also create a const for total stages at the top so this isn't hardcoded

@@ -84,7 +84,7 @@ const SplitView = ({

const [removeQuestionId, setRemoveQuestionId] = useState<string | undefined>(undefined);
const [displayFeedbackPrompt, setDisplayFeedbackPrompt] = useState<boolean>(false);
const [displayWrapped, setDisplayWrapped] = useState<boolean>(false);
const [displayWrapped, setDisplayWrapped] = useState<boolean>(true);
Copy link
Contributor

Choose a reason for hiding this comment

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

make sure to restore variables you set for testing when you push to github

color: "#080680",
}}
>
70
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we only have time spent helping students, so we can remove this. Unless Sia mentioned adding this extra slide? Forgot lol let's check with her during work session.

Copy link
Contributor

@rgu0114 rgu0114 left a comment

Choose a reason for hiding this comment

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

A couple misc. design todos for this PR (or the next):

  • banner styling on intro slide, adding banners to total minutes, fav ta, and conclusion slide
  • decrease transparency of the people on total visits slide
  • mini ppl in places
  • numbers

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.

5 participants