-
Notifications
You must be signed in to change notification settings - Fork 10
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
Dev #7
Conversation
asiripanich
commented
Jan 15, 2023
•
edited by AlirezaRa94
Loading
edited by AlirezaRa94
- feat: Dashboard home tab #1
- feat: Data tab #2
- feat: Map tab #4
- feat: Push notification tab #5
- feat: AWS Cognito Authentication #14
- Enhancement of Token Naming Convention and Addition of Test Token Marking Feature #11
Restructing the project requires the following fixes: - fixed the docker build context. - fixed the app's data path.
Other changes include: - restructured the project.
The following elements have been added: - sign-ups trend plot, - trips trend plot, - number of users box, - number of trips box, and - number of active users box.
@asiripanich should I start reviewing this? Or are you reviewing it yourself? |
It was an environment variable, but now I have to use a callback to get the |
There must be a way to transfer the data from the callback to
|
Thank you, If you are OK with these methods, I will make changes using them. |
The ideal way is to register the callback from For completeness, if registering the callback from |
We can create a callback inside |
@AlirezaRa94 any updates? it's been a week since the last update and we need to deploy this... |
@shankari I'm busy these days, but I'll try to find some free time to work on it this week. |
@AlirezaRa94 the goal was to have it fully done and ready to deploy by end of March. It is now mid-Apr, and we need to be showing off demos... |
The goal was to have the time-use feature and the dashboard done by the end of February. The dashboard with authentication and dynamic config was ready at that time. At that time, my task was working full-time on the dashboard. But now I have other duties and must find some free time to work on the dashboard. |
@shankari |
That's because the dynamic config was only done on 20th March (dbae8f9)
You do need to make the changes to use the timeseries functions instead of a
Note that we internally use AWS DocumentDB, a managed solution that is supposed to be compatible with MongoDB but sometimes has minor differences. We keep (and will continue to keep) the timeseries code consistent with both MongoDB and DocumentDB, but having people write arbitrary code in other modules makes it hard to find and fix all incompatibilities. |
@AlirezaRa94 let's not get into a nitpicky argument about this. The dashboard code was not completely done by end of Feb, but neither was the NREL code for the survey. You are absolutely right that NREL had a significant delay in reviewing the code after it was written, at least in part because we were scrambling to finish the UI code changes. Hopefully this is not the end of our collaboration, and we will continue to work together on improvements to both the survey and the dashboard. Concretely, do you have an ETA for when the data access changes in We cannot deploy until they are complete. We can make the related changes ourselves - I wrote the entire server code, I can restructure two data access functions if I need to - but that will take our time away from the app UI changes. The whole point of the feature swap was that UNSW working on the dashboard would free up NREL resources to work on time use... |
…uture Before this ``` $ find . -name \*.py | xargs file ./globals.py: ASCII text ./utils/decode_jwt.py: Python script text executable, ASCII text, with CRLF line terminators ./utils/constants.py: ASCII text, with CRLF line terminators ./utils/generate_qr_codes.py: Python script text executable, ASCII text ./utils/permissions.py: Python script text executable, ASCII text, with CRLF line terminators ./utils/cognito_utils.py: Python script text executable, ASCII text, with CRLF line terminators ./utils/db_utils.py: Python script text executable, ASCII text, with CRLF line terminators ./utils/generate_random_tokens.py: Python script text executable, ASCII text ./globalsUpdater.py: Python script text executable, ASCII text ./app.py: Python script text executable, ASCII text ./config-fake.py: ASCII text, with CRLF line terminators ./pages/home.py: Python script text executable, ASCII text ./pages/tokens.py: Python script text executable, ASCII text ./pages/map.py: Python script text executable, ASCII text ./pages/settings.py: Python script text executable, ASCII text ./pages/push_notification.py: Python script text executable, ASCII text ./pages/data.py: Python script text executable, ASCII text ./app_sidebar_collapsible.py: Python script text executable, ASCII text, with CRLF line terminators ``` Auto-fix using ``` $ find . -name \*.py | xargs file | grep "with CRLF" | cut -d ":" -f 1 | xargs dos2unix dos2unix: converting file ./utils/decode_jwt.py to Unix format... dos2unix: converting file ./utils/constants.py to Unix format... dos2unix: converting file ./utils/permissions.py to Unix format... dos2unix: converting file ./utils/cognito_utils.py to Unix format... dos2unix: converting file ./utils/db_utils.py to Unix format... dos2unix: converting file ./config-fake.py to Unix format... dos2unix: converting file ./app_sidebar_collapsible.py to Unix format... ``` After the change ``` $ find . -name \*.py | xargs file ./globals.py: ASCII text ./utils/decode_jwt.py: Python script text executable, ASCII text ./utils/constants.py: ASCII text ./utils/generate_qr_codes.py: Python script text executable, ASCII text ./utils/permissions.py: Python script text executable, ASCII text ./utils/cognito_utils.py: Python script text executable, ASCII text ./utils/db_utils.py: Python script text executable, ASCII text ./utils/generate_random_tokens.py: Python script text executable, ASCII text ./globalsUpdater.py: Python script text executable, ASCII text ./app.py: Python script text executable, ASCII text ./config-fake.py: Python script text executable, ASCII text ./pages/home.py: Python script text executable, ASCII text ./pages/tokens.py: Python script text executable, ASCII text ./pages/map.py: Python script text executable, ASCII text ./pages/settings.py: Python script text executable, ASCII text ./pages/push_notification.py: Python script text executable, ASCII text ./pages/data.py: Python script text executable, ASCII text ./app_sidebar_collapsible.py: Python script text executable, ASCII text ```
Convert all files to unix format to make code reviews easier in the f…
One more crlf fix
So that we can test the reverse proxy configuration fixes in dev This fixes #24 (comment) The `docker-compose` (except for `nginx`) should be kept consistent with the production `docker-compose-prod.yml` with the exception of `DASH_DEBUG_MODE`, which is set to true so that we can debug errors in the setup more easily Testing done: - Built and ran the docker-compose - Accessing http://localhost:8060/admin gives the same error as #24 (comment) ``` Uncaught ReferenceError: DashRenderer is not defined <anonymous> http://localhost:8060/admin/:58 ```
This internally sets the `requests_pathname_prefix`, which allows us to load all the assets (including the javascript files) correctly. This is a partial fix for #24 that implements the first step in #24 (comment)
This fixes #24 (comment) #24 (comment) #24 (comment) Since there are not a lot of hrefs and they are all in the same file #24 (comment) ``` $ grep -r href . | grep -v .git ./utils/cognito_utils.py: dbc.Button('Login with AWS Cognito', id='login-button', href=CognitoConfig.AUTH_URL, style={ ./app_sidebar_collapsible.py: href=dash.get_relative_path("/"), ./app_sidebar_collapsible.py: href=dash.get_relative_path("/data"), ./app_sidebar_collapsible.py: href=dash.get_relative_path("/tokens"), ./app_sidebar_collapsible.py: href=dash.get_relative_path("/map"), ./app_sidebar_collapsible.py: href=dash.get_relative_path("/push_notification"), ./app_sidebar_collapsible.py: href=dash.get_relative_path("/settings"), ```
Support and test the reverse proxy configuration
This is a hack to get the dashboard to work. It retrieves data using the timeseries interfaces and performs the projections using pandas locally. It is *not* complete. Notably: - the projections are not the same as the original projections - the projections do not take the dynamic config into account - we still use `edb` for some calls - notably the ones to get the uuid table; we should add decorations to the timeseries to support them going forward
Hack to use the timeseries calls to retrieve the data
@AlirezaRa94 @swastis10 This is a long and complicated PR already, so I am going to merge this as the first prototype release. It does meet all the minimum requirements:
I will then file a series of issues for cleanup as I see them, and for new functionality as we get feedback from program admins. Especially given that @AlirezaRa94 is now working on this project on a limited basis, I think it will be easier to track progress that way. |
Current issues are: Those seem enough to be starting with; I will add more functionality-based issues as we test more. |
I have also turned off write access for everybody except me and NREL IT (@asiripanich @AlirezaRa94 @swastis10), all further improvements will be through fork + pull request only. Please let me know if you have concerns about this. |