-
-
Notifications
You must be signed in to change notification settings - Fork 14
feat: adding a new 'one-pager' dashboard in homepage and revamping navbar #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
Conversation
incorporating pyronear logo, black colored background, new cta style and a centered text retreiving username logged
brought both alerts and risks dashboards onto hompage, adding a filter box gathering existing filters and adding some. Meteo graphs are hidden but can be displayed if desire
|
@Akilditu small consideration: there will be some assets that we have to put in the repository, but for logos of the organizations, I would suggest that there are hosted remotely and that our different apps only use the URL. |
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.
Thanks a lot @Akilditu for this PR!
I have left a few comments, mostly typo corrections and two questions. But since everything seems up and running and we had already discussed these modifications, I approved it 😊
app/homepage.py
Outdated
| def choose_map_style(n_clicks): | ||
|
|
||
| # Because we start with the alerts map, if the number of clicks is even, this means that | ||
| # we are still using the alerts map and we may want to risk one |
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.
| # we are still using the alerts map and we may want to risk one | |
| # we are still using the alerts map and we may want to switch to the risks one |
app/homepage.py
Outdated
|
|
||
| # instantiating the map object from alerts.py: to be modified depending on | ||
| # what we expect the user to view first on homepage | ||
| # Instantiating the alert map object from alerts.py and setting it a the default map object: |
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.
| # Instantiating the alert map object from alerts.py and setting it a the default map object: | |
| # Instantiating the alert map object from alerts.py and setting it as the default map object: |
app/homepage.py
Outdated
| {'label': 'Gard', 'value': 'Gard'}, | ||
| {'label': 'Landes', 'value': 'Landes'} | ||
| ])) | ||
| # Instantiating map layers button object from alters.py |
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.
| # Instantiating map layers button object from alters.py | |
| # Instantiating map layers button object from alerts.py |
app/homepage.py
Outdated
| # Instantiating map style button object | ||
| map_style_button = build_map_style_button() | ||
|
|
||
| # Instantiating meteo graphs, set to True to display them under the map, Fale to hide them |
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.
| # Instantiating meteo graphs, set to True to display them under the map, Fale to hide them | |
| # Instantiating meteo graphs, set to True to display them under the map, False to hide them |
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.
Thanks, I will fix all this missprints in the next commit
| dbc.DropdownMenuItem('Niveaux de Risque', href='risks'), | ||
| ], | ||
| label="Tableaux de bord", | ||
| className="ml-auto flex-nowrap mt-3 mt-md-0 btn-group dropleft", |
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.
I am not sure to understand what the className defined here (and I see a similar one in the instantiation of the user_item object) is designed for and where it comes from. Could you please describe briefly its use or point us to any related resource? Many thanks!
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.
Hi @pechouc here some explanations about those bootstrap css classes :
- ml-auto : margin left auto in regards of other columns on the same row
- flex-nowrap force inline alignment as explained here
- mt et mt-md for margin top
- btn-group dropleft to ensure that the dropdown will occur on the left (to match responsive needs) as detailed here
Hope that helps
| {'label': 'Landes', 'value': 'Landes'} | ||
| ])) | ||
| # Instantiating map layers button object from alters.py | ||
| map_layers_button = build_layer_style_button() |
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.
This comment is more of a question I am asking myself than a change request. Would it be cleaner to directly call the functions instead of their output when building the body object?
This might not be clear said this way but so far, we generally create a new variable (here map_layers_button) which simply contains the output of the related function (build_layer_style_button) and then, we call it without any particular transformation in the app layout block (at line 123 in this case). Equivalently, we could directly call the function at line 123 and skip the creation of the object.
I don't know what the best practice is here and I don't have any strong opinion, but I guess that we would spare quite a few lines and variables by doing so, which can only make our code more readable, right?
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.
Totally agreed @pechouc, to be honest i followed this 'instantiation logic' to ensure code unity with respect to what has been done so far :)
I think that doing a proper PR for this refactoring task would be a good way to deal with it right ?
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.
Yes, I guess this logic is inherited from the code initially provided with the tutorials. And fully agreed with the idea of a separate PR!
I agree @frgfm , we could consider adding this logo version to the pyronear.github.io repo so that it will be hosted on pyronear.org. What do you think ? |
Yes, sounds like our best option here! |
|
Here you go @Akilditu : https://pyronear.org/img/logo_letters_orange.png |
Yes, will commit this and then it will be ready to merge 👍 |
|
I'll let @pechouc give his input on this, as I only took a look at the logo part! |
@frgfm This could indeed be an interesting feature to have multilang but I m not sure about the priority of this. I actually think that the next big step in term of design / functional constraints will be determined by the interviews to come with firemen. |
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.
Same as PE, as it works and we already discussed it, I have nothing special to add.
Will see in another PR how we determine if display is true or not (button for user?).
Anyway, thanks for huge improvement Seb 👍
Aim of the Pull Request
Hi Everyone
This PR aims at :
More detailed info
The Navbar now incorporates PyroNear logo with a black background, a new CTA style and a centered text retreiving the username logged :
Both risks and alerts maps are gathered on the same dashboard, with a filter control box on the left with the ability to :
As you may notice meteo graphs under the map are not displayed anymore but this can be done setting the
meteo_graphs()displayparam toTrueinhomepage.pyThanks for reviewing 👍