Skip to content

[ACQ-3328] WS Marketing Page - EnrollInForm - Update enrolInForm onClick to match what enroll on enroll page do #66569

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

Open
wants to merge 11 commits into
base: staging
Choose a base branch
from

Conversation

levadadenys
Copy link
Contributor

@levadadenys levadadenys commented Jun 17, 2025

[ACQ-3328] WS Marketing Page - EnrollInForm - Update enrolInForm onClick to match what enroll on enroll page do

WS Marketing Page now supports WS enrollment.
Please note that editing enroll form values are not part of this ticket. All the values are taken from the user account.
Also updated text for signed out view of ws marketing page as I was working with that code anyways.

2025-06-17.17.07.10.mov
2025-06-17.17.06.04.mov

Links

ACQ-3328

  • Jira:

Testing story

Deployment strategy

Follow-up work

Privacy

Security

Caching

PR Checklist:

  • Tests provide adequate coverage
  • Privacy and Security impacts have been assessed
  • Code is well-commented
  • New features are translatable or updates will not break translations
  • Relevant documentation has been added or updated
  • User impact is well-understood and desirable
  • Pull Request is labeled appropriately
  • Follow-up work items (including potential tech debt) are tracked and linked

@levadadenys levadadenys requested a review from a team June 17, 2025 14:45
@levadadenys
Copy link
Contributor Author

Any naming suggestions are more then welcome 😄

type="primary"
size="m"
href={buildEnrollButtonLink(`/professional-learning/workshops/${id}`)}
text="Sign-in to enroll"
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this text be dependent on whether it's is_student or is_signed_out? i.e. should is_student say "Upgrade account to enroll" and is_signed_out say "Sign-in to enroll"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree it will be nice to diverge messages for singned out and for student, but not sure about best naming. Would defer to @moshebaricdo on naming.

Maybe smth like Switch to teacher account OR Teacher Account needed? (feels to me like it gives more understanding/context)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

actually, also cc @bethanyaconnor @dmcavoy

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 Moshe has a mock for the button for signed out. It says "Sign-in to enroll"

Copy link
Contributor

Choose a reason for hiding this comment

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

For the student case I like "Switch to teacher account to enroll" @moshebaricdo what do you think?

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 do "Switch to teacher account," adding "to enroll" breaks onto a new line, but I think the overall context w/o it is clear enough.

text: 'Sorry, we could not find this workshop. Please check the link and try again.',
});
break;
case SUBMISSION_STATUSES.SUCCESS:
Copy link
Contributor

Choose a reason for hiding this comment

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

There's also a UNKNOWN_ERROR submission status that should be handled. That could potentially be the default in your switch/case/default setup here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, I see thee confusion here. I took old enroll form as a base and there that status if handeled in api call, not in switch case. Totally agree it's better to handle that in switch case. Updating

const submitEnrollment = async (
params: WorkshopEnrollmentParams | null
): Promise<WorkshopEnrollmentResponse | null> => {
setIsSubmitting(true);
Copy link
Contributor

Choose a reason for hiding this comment

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

Could there be a check that makes sure to return early if isSubmitting is already true to prevent a user from spam clicking the button and causing it to run multiple queries back to back, ensuring it just runs the query once until it finishes.

Copy link
Contributor Author

@levadadenys levadadenys Jun 18, 2025

Choose a reason for hiding this comment

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

Thank you for the catch!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also, I just realised that currently pending button is still clickable, and I think that's something we need to prevent (when isPending - functionally disable button)

Cc @moshebaricdo

@moshebaricdo
Copy link
Contributor

Thanks for adding that alert @levadadenys!

Copy link
Contributor

@TurnerRiley TurnerRiley left a comment

Choose a reason for hiding this comment

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

LGTM outside of any text we want to change up!

@levadadenys
Copy link
Contributor Author

2025-06-18.21.51.42.mov

Updated naming for enroll button when signed in as student

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