-
Notifications
You must be signed in to change notification settings - Fork 23
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 JSON import/export #119
Conversation
Some things to do before merging (from my conversation with @kdk1616):
|
I just now found a bug: if more than one object is in tableData (e.g.
scraped data and imported data), then the quarter dropdown does not
adjust on switching currentTableData. A fix is underway.
|
Also, further testing is needed regarding how switching |
Great stuff! Some ideas.
|
@Ruborcalor Thanks for the review.
On 4/21/20 6:09 PM, Cole Killian wrote:
Great stuff! Some ideas.
1. When logging in and then importing data, the term selector doesn't
fully reset. In the screenshot below I imported only two terms, but
all four still appear available in the term selector. What do you
think about indicating which ones were included in the import?
I think this is caused by two of the issues that I mentioned above:
- Grey out inaccessible quarters in the quarter dropdown
- If more than one object is in tableData (e.g. scraped data and
imported data), then the quarter dropdown does not adjust on switching
currentTableData.
Sorry, I may not have worded them very well. Hopefully the issue that
you noticed will be resolved when my fix is done.
2. The default behavior seems to be that when navigating to home.html,
you are prompted for an import file, however I imagine that most
users would prefer to be redirected back to the login.html page if
their session timed out.
I imagined that most users would navigate to the / endpoint (which now
redirects since faed11d to the correct page depending on whether or
not there is an active session) without accounting for the fact that
people may have bookmarked /home.html.
This can probably be fixed by redirecting home.html to login.html
server-side when there is no active session, and creating a dummy
session when a user clicks on "Login" leaving the username and password
fields blank.
|
Fixed in 7ec1869.
Fixed in 89a9c67.
Fixed in 4e87e1e. Remaining things to do:
|
Approval has been secured from @notrodes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah good work dudeman.
Another thing to fix: The version detection for imports currently only checks the major version. We need to warn the user if the minor version of the import is newer than the minor version of Aspine, letting them know that they should use a newer version of Aspine to view the file (presumably Aspine lite). |
I would like to note that the solution employed in 89a9c67 is hacky in that it uses |
Note to self re hackiness of solution: this can be fixed by rewriting We can probably get away with not passing in anything like that for scraped data as long as |
Fixed in 3393b11. |
Fixed in d61f403. Remaining issues:
|
d79358b
to
f6c3bf1
Compare
Fixed in db0604d. |
Fixed in 847ba33. All of the blockers that have been identified so far have been fixed. @Ruborcalor @kdk1616 @notrodes Please take a look. Is this ready to merge? |
Also, make the AJAX call use the Promise interface instead of a callback; this will be useful later when the option to enter Aspine without signing in is added.
- Serve a default response from the backend if username or password was left blank - Fix the clock and disable the Reports tab if username or password was left blank
This also includes a check that disables any terms in the term dropdown that are not included in the imported data.
We can run this build script whenever we tag a new version and distribute the resulting client-side-only version of Aspine. This is useful for people who want to view a JSON file from Aspine 2.x after compatibility breaks. This commit also adapts some other code to work with the lite version.
Instead of hardcoding substitutions, make build-lite.sh accept a syntax resembling that of the C preprocessor so that lite-specific changes can be made more easily. This commit also brings the lite-specific changes up to date with recent changes to the frontend codebase.
Previously, it was just updating currentTableData.
Some of the classes relating to "custom-select" were used specifically to refer to the GPA/term dropdown. They have now been renamed to include "gpa" in their names and have been supplemented with generic equivalents. This will make it easier to reuse CSS when another dropdown is added to the top bar.
The dropdown is not yet functional.
Remove code duplication regarding modal dialogs.
- 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. - 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.
For the home page to redirect to the login page under some circumstances, the user-facing endpoints had to be changed a bit. "/home.html" is now "/" and "/login.html" is now "/login" (redirects are in place).
Instead of simply disabling terms that have not yet been downloaded from export, allow the user to select those terms and have their data automatically downloaded and included in the export.
Clarify instructions on login page and give reasons for terms being greyed out in export dialog
Selecting a different currentTableData now causes the quarter dropdown to update.
The major and minor version numbers are both checked now, and users are shown the place to download older/newer versions of Aspine (lite).
Instead of setting the HTML "title" attribute, use CSS to make tooltips that work with mobile devices and assistive technologies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to merge
Implements #74 at long last. Please see that issue and the commit messages for more details.