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

Client-side import/export feature #74

Closed
psvenk opened this issue Nov 23, 2019 · 2 comments
Closed

Client-side import/export feature #74

psvenk opened this issue Nov 23, 2019 · 2 comments
Assignees
Labels
enhancement New feature or request frontend Suspected problem with frontend (client-side code in public directory) priority Work on this first

Comments

@psvenk
Copy link
Member

psvenk commented Nov 23, 2019

Allow users to download an archive of their grades for a year as a JSON file, choosing what to include (drawing from the global variable tableData). This is meant as a (much more user-friendly) improvement to the changes made in #62, which no longer work as intended due to changes made to the backend for lazy loading (#77).

Additionally, include a feature in which users can upload a JSON export and have Aspine (on the client side) intelligently merge the contents of the export with the current contents of tableData, overwriting only what is needed.

It would also be nice to have an option at the login page to enter Aspine with a blank tableData and upload whatever data one wants to use instead of scraping Aspen. This option would be useful for graduated students to view their grades by being able to use Aspine to view their exports without having an account on the Aspen server.

We would need to include a version field (and possibly a commit hash, too) in the generated JSON file which matches the current version in package.json (obviously, this depends on having a real versioning scheme). If a user uploads a JSON file from an earlier version, we could display a warning, and if a user uploads a JSON file from an earlier major version (not backwards-compatible), we could direct the user to our Releases page on GitHub to download and host an older version of Aspine to view their export (or, once we reach that stage, we could make a purely client-side version of Aspine which only supports JSON upload due to lacking a backend; this can be automated at each release using a specialized build process that includes all necessary dependencies and is not reliant upon any endpoints).

@psvenk psvenk added the priority Work on this first label Mar 8, 2020
@psvenk psvenk self-assigned this Mar 22, 2020
@psvenk psvenk added enhancement New feature or request frontend Suspected problem with frontend (client-side code in public directory) labels Mar 28, 2020
@psvenk
Copy link
Member Author

psvenk commented Mar 30, 2020

This is mostly implemented (in the json branch). A few things to do before opening a pull request for review:

  • Further testing with incomplete exports; i.e., an export might not include all information.
    • It may be beneficial to require that certain data are included in every export (e.g. grades overview for ease of calculating GPA) so that we do not have to deal with edge cases throughout the codebase. - Fixed in 3c02e71.
  • Further testing with merging an export with scraped data- for example, if quarter 1 and quarter 3 grades were scraped and quarter 2 grades are included in the export, they should all be displayed in the term dropdown.
    • Or, because this is not a very likely scenario, we could add a function where the user can switch between different objects for tableData. This would make Get grades from previous year #99 easier to implement; i.e., the user would get a dropdown with "Current Year" (from scraping), "Previous Year" (will be scraped if the user selects it), and the ability to upload a JSON file and add another tableData. In the case that the user does not enter a username and password, the scraping options would not be present and the user would need to upload a JSON file. This also solves the problem of where the "Import Data" button should be put—it would be an option in this new dropdown. - Logic added in f604c2d...272cc5c, dropdown added in da2279d...d26c0a3.
  • Make the clock work in the "lite" version, and further test the lite version. - Fixed in dfa6e41.
  • Instead of relying on the scraper giving a success (a login failure would redirect the user to the login page) and a blank tableData in the case of a blank username or password, the backend should detect such a situation and automatically give a response indicating that there is nothing to scrape. - Fixed in 6138dfc.
  • Create a more up-to-date sample.json file and suggest it as an option in the "Import Data" modal popup (e.g., for those who just want to tour Aspine and have neither an Aspen account nor a data export). This would solve Add sample JSON file #79. - I think this will take a while. Let us track this separately in issue Add sample JSON file #79.
  • Possibly change the login flow for non-scraping users by using a separate button instead of instructing the user to leave the login fields blank.
    • Instead of creating a dummy currentTableData object for non-scrapers and calling it "Current Year", set tableData = [] and make the import modal pop up automatically. - Fixed in ad995bd.
    • Make sure that Aspine works as usual after importing data—this includes things like reloading the schedule and clock when switching currentTableData using the dropdown. - Fixed in ad995bd.
  • Remove json, fake, and out command-line options from the backend (from Add import/export functionality #62) because they have not worked properly since lazy loading was added in Lazy loading #77. - Fixed in 8a5720a.
  • Allow the user to export terms that are not yet downloaded instead of disabling the checkboxes—this would involve including a "Downloading..." message after the user clicks "Export" - Fixed in ee2faa8.
  • Make the login page the default—because the home page can now be accessed without signing in, keeping it as the default would show the import modal to many users who want to have Aspine scrape Aspen. That is, / should redirect to /login.html, not to /home.html. - Fixed in 3465734.
  • Eventually (just noting it here so that we don't forget) discuss with ICTS the possibility of storing JSON files on the server for users' convenience

@psvenk
Copy link
Member Author

psvenk commented May 3, 2020

Closed in #119.

@psvenk psvenk closed this as completed May 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request frontend Suspected problem with frontend (client-side code in public directory) priority Work on this first
Projects
None yet
Development

No branches or pull requests

1 participant