Skip to content

next/store: "course" purchases #8437

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

Merged
merged 16 commits into from
Jul 23, 2025
Merged

next/store: "course" purchases #8437

merged 16 commits into from
Jul 23, 2025

Conversation

haraldschilly
Copy link
Contributor

@haraldschilly haraldschilly commented Jul 11, 2025

Adds a "Course" section to the store, to simplify purchasing a license for a course with a given number of students. It also adds a HelpIcon tooltip help for idle timeout – and makes that component work for next.js.

The main problems I faced in this PR is how URL vs. form values are handled. I don't know why this is so tricky. Probably something is off how the form is used. In any case, I added explicit default parameters in the initialization, such that everything is in the range of allowed combinations. This is important, because components in the form trigger additional processing of the URL. That's why there is now a flag for the actual initialization and also a flag for parsing the URL.

What I tested is tweaking the form and menu navigating. Then of course, saving the configuration to the cart. Then editing the license, having more than one license in the cart, etc. ... Purchase just works as before, the only new identifying field is source. No surprise, because after all, this is still the same type of license.

Also, as discussed, this is also recorded in the "info" field of the license, i.e.

# select * from site_licenses order by created desc limit 1;
info         | {"purchased": {"type": "quota", "user": "academic", "source": "course", ...}}

store index page

Screenshot from 2025-07-21 15-36-53

course page

Screenshot from 2025-07-22 10-49-47

idle timeout help popup

this is also on other pages

Screenshot from 2025-07-22 10-50-35

consistency check: "course/standard" vs. "site license / standard"

academic, whole of august, 61 students

Screenshot from 2025-07-22 10-52-28 Screenshot from 2025-07-22 10-52-01

@haraldschilly haraldschilly force-pushed the store-purchase-course branch 3 times, most recently from f7b9c62 to 67550fe Compare July 16, 2025 12:40
…resets, add idle timeout help and hide period selection in form
@haraldschilly haraldschilly force-pushed the store-purchase-course branch 8 times, most recently from a51bde1 to 1995b38 Compare July 16, 2025 16:32
@haraldschilly haraldschilly force-pushed the store-purchase-course branch from 1995b38 to e730f95 Compare July 16, 2025 16:33
@haraldschilly haraldschilly force-pushed the store-purchase-course branch 3 times, most recently from 932f7b7 to 4a9164f Compare July 21, 2025 16:08
@haraldschilly haraldschilly force-pushed the store-purchase-course branch from 4a9164f to 022163d Compare July 21, 2025 17:05
@haraldschilly haraldschilly force-pushed the store-purchase-course branch from 7e1e4dc to bf046b1 Compare July 23, 2025 14:22
@williamstein williamstein marked this pull request as ready for review July 23, 2025 23:00
@williamstein williamstein merged commit ffc5f8c into master Jul 23, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants