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

[Course Planner]: Download/upload/share planner configuration #3843

Open
wxiaoyun opened this issue Oct 30, 2024 · 0 comments
Open

[Course Planner]: Download/upload/share planner configuration #3843

wxiaoyun opened this issue Oct 30, 2024 · 0 comments

Comments

@wxiaoyun
Copy link

Is your feature request related to a problem? Please describe.

Similar problem to sharing timetable. I wish to replicate the course planner configuration by downloading the configuration and uploading the configuration json file.

Describe the solution you'd like

  1. A button that downloads the planner details on https://nusmods.com/planner
    a. Create a temporary blob from the redux store after stringification
    b. Create an object url for that blob
    c. Create a temporary anchor element with the create url
    d. Programmatically click on the anchor element
    e. Revoke the object url
  2. A button that imports the planner details on https://nusmods.com/planner
    a. Drag or drop / file select for the planner config
    b. Maybe some sort of zod schema parsing
    c. Override the redux store with new state

Describe alternatives you've considered

URL sharing will be more convenient where URL contains the state of the course planner.

Additional context

I tested my personal planner config and it is 5000+ characters after base64 encoding. It seems that URL should be kept below 2000 characters. Nusmods cannot encode the config into the url without some sort of minification. Also, sharing a very long URL is pretty bad idea coz it might encounter character limits in texting applications

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

No branches or pull requests

1 participant