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

Feature/scenario settings #61

Merged
merged 13 commits into from
Apr 26, 2024
Merged

Feature/scenario settings #61

merged 13 commits into from
Apr 26, 2024

Conversation

josihoppe
Copy link
Contributor

No description provided.

@josihoppe josihoppe linked an issue Mar 25, 2024 that may be closed by this pull request
3 tasks
@josihoppe
Copy link
Contributor Author

Sliders are adjusted for scenario settings. First the detail sliders are updated and then DETAIL_PANEL_SLIDER_CHANGE is changed to adapt main sliders. And after that the main/panel Sliders are updated with the scenario settings, but somehow the max value of the sliders (in the inside logic) is not changed, so the scenario setting can not move the slider beyond the "old" max value. And I don't know why.

@josihoppe josihoppe requested a review from henhuy March 25, 2024 13:05
@nesnoj nesnoj self-requested a review March 25, 2024 13:18
Copy link
Contributor

@henhuy henhuy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like your implementation!
I did two modifications:

  • only read scenario.json once at beginning of module
  • moved adapting of scenario sliders into scenario.js

Thanks for this!

@henhuy
Copy link
Contributor

henhuy commented Mar 28, 2024

BTW, I did not change anything but moved adapting to scenarios.js - but somehow main slider adaption works now.
(I think there has been a change in flow, so that detail slider adaption and related main slider adaption happen before setting main slider value now)

@henhuy
Copy link
Contributor

henhuy commented Mar 28, 2024

@nesnoj could you check if this works as expected on your machine too? Thx

Copy link
Contributor

@nesnoj nesnoj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx, will check!
One thing I just noticed: The detail settings sidepanels do not close when clicking [X], console saying "closeSidepanel is not defined at HTMLButtonElement.onclick".
I guess after changing the script type of the sliders.js to "module" the ex- and import of this fct should be added? (adding export ... did not help)

Copy link
Contributor

@nesnoj nesnoj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works out as expected, thank you @josihoppe and @henhuy !
I'd have liked to have it implemented more generically (scenario site template which is filled with data from json or whatever) but to wrap up this quickly, this solution is good as it implements the most important features!

2 things:

  • Please fix the detail panel bug described above (BTW, the closing via more arrow btns work, as this is implemented using eventTopics.MORE_LABEL_CLICK)
  • I'd like to change the path to scenarios.json to the digipipe datapackage later, can I just change the path? The path to scenarios.json is hard coded in JS - if the file were taken from datapackage, should it be added to the config.py instead like the other panel settings files?

@henhuy
Copy link
Contributor

henhuy commented Apr 25, 2024

  • I'd like to change the path to scenarios.json to the digipipe datapackage later, can I just change the path? The path to scenarios.json is hard coded in JS - if the file were taken from datapackage, should it be added to the config.py instead like the other panel settings files?

I also recommend to read path from config file.

@henhuy
Copy link
Contributor

henhuy commented Apr 25, 2024

  • Please fix the detail panel bug described above (BTW, the closing via more arrow btns work, as this is implemented using eventTopics.MORE_LABEL_CLICK)

will fix

@nesnoj
Copy link
Contributor

nesnoj commented Apr 25, 2024

  • I'd like to change the path to scenarios.json to the digipipe datapackage later, can I just change the path? The path to scenarios.json is hard coded in JS - if the file were taken from datapackage, should it be added to the config.py instead like the other panel settings files?

I also recommend to read path from config file.

Could you please change this @josihoppe ?

@henhuy
Copy link
Contributor

henhuy commented Apr 25, 2024

Could you please change this @josihoppe ?

I will do

@henhuy henhuy requested a review from nesnoj April 26, 2024 11:25
@henhuy
Copy link
Contributor

henhuy commented Apr 26, 2024

Implemented change requests. Please review and merge

Copy link
Contributor

@nesnoj nesnoj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@nesnoj nesnoj merged commit 25bc022 into dev Apr 26, 2024
1 check passed
@nesnoj nesnoj deleted the feature/scenario_settings branch April 26, 2024 11:39
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

Successfully merging this pull request may close these issues.

Implement scenario settings
3 participants