clarity-h2020 / docker-drupal

Drupal 8 Project for implememting the CLARTIY CSIS Platform.
https://csis.myclimateservice.eu
GNU Lesser General Public License v3.0
3 stars 0 forks source link

Showing and changing presets outside the study group context #134

Closed DenoBeno closed 4 years ago

DenoBeno commented 5 years ago

Somewhat related to https://github.com/clarity-h2020/map-component/issues/59

I have implemented a simple view that shows presets and allows the users to edit them while in the GL-step context and not in the group context. This allows users to quickly change the presets and take screenshots of various preset combinations whenever they feel like it.

Result: grafik

grafik

Currently this is defined as a block and attached to all "map pages" and a "global: view area" header to this view: https://csis.myclimateservice.eu/admin/structure/views/view/view_mode_for_gl_step/edit/page_3

The view providing the data is called "View presets and edit": https://csis.myclimateservice.eu/admin/structure/views/view/view_presets_and_edit/edit/block_1

DenoBeno commented 5 years ago

I have also added this to table views now.

This is OK for a start. If we want to decide more granularly where to show it and where not, we would have to add this view to the "application" nodes instead. Then one could easily define a map or a table with and without the presets and use the one that's appropriate in the template.

Good enough for now - putting this on hold.

p-a-s-c-a-l commented 4 years ago

Study presets must not appear in expert studies, e.g. this one.

DenoBeno commented 4 years ago

Hm. The expert study has a "study calculation set to "none", so this can be used to filter.

This view lets the users set the study presets on various places in the study:

https://csis.myclimateservice.eu/admin/structure/views/view/view_presets_and_edit?destination=/admin/structure/views

So basically, this view needs a filter by study calculation method. I have added this filter now. And also added a "Study presets currently aren't used in expert studies." message where the presets would be shown normally.

Now, as for the study presets in context, (e.g. https://csis.myclimateservice.eu/study/21/view/context), I don't know how to hide them when not needed there. The easiest way would be to completely remove them from the context edit form. I just did this, see https://csis.myclimateservice.eu/admin/group/types/manage/study/form-display

Now, the question is what happens if the table or map application don't find a preset in the study where they need one? Ideally, they users should simply be instructed to add a preset.

DenoBeno commented 4 years ago

In https://csis.myclimateservice.eu/study/30/step/1613/view/maps, I can still choose local effect temperatures, even though no preset is defined. This is not good, since it's not clear what gets shown if no preset is defined.

image

p-a-s-c-a-l commented 4 years ago

Now, the question is what happens if the table or map application don't find a preset in the study where they need one?

Expert Data Packages don't include EMIKAT screening resources. At least they shouldn't. Using the European Data Package which contains several EMIKAT resources in Expert Studies is a wrong choice.

The table will simply show nothing because there is no data from EMIKAT available. But Expert Templates don't include table views anyway, so this should never happen.

The map will show the layers from the data package and apply a default preset. But this shouldn't be necessary because expert data packages usually don't include local effect data because local effect are just relevant in screening mode.

DenoBeno commented 4 years ago

@p-a-s-c-a-l :

Presets should also be used for other resources, not just EMIKAT. OK, this is not implemented now, so I've disabled it for the studies that don't use EMIKAT for the time being.

However, my question was for those that do use EMIKAT. Since I had to remove the presets from the "context edit", it's possible to come to a table or map where EMIKAT data is shown without setting the preset now. In such cases, nothing should be shown - but something is shown. No idea what.

DenoBeno commented 4 years ago

Changed the message to "no preset defined, showing the historical data". Guess this can be closed now.

grafik

grafik

p-a-s-c-a-l commented 4 years ago

So basically, this view needs a filter by study calculation method. I have added this filter now. And also added a "Study presets currently aren't used in expert studies." message where the presets would be shown normally.

I've remove the filter in the view, because Study Scenarios (presets) are a prerequisite for Template Resources. So each study regardless of its type and calculation method now needs at least one Study Scenario!

However, that did not work, I still cannot select a study scenario in context although this study isn't an expert study:

grafik

Anyway, at least I can edit the scenarios in map and table display, so ATM this is enough for testing template resources.

patrickkaleta commented 4 years ago

See comment #1 and #2 for recent updates relevant to this issue.

p-a-s-c-a-l commented 4 years ago

Hm, when visiting https://csis.myclimateservice.eu/study/30/step/1613/view/maps I get now:

grafik

patrickkaleta commented 4 years ago

The real problem is, that Study 30 has been removed. The error message is just very misleading.

p-a-s-c-a-l commented 4 years ago

OK, what we would need here is to select one of the named scenario presets created by the user in the study/context tab, but not to edit existing scenario presets or adding new ones.

patrickkaleta commented 4 years ago

OK, what we would need here is to select one of the named scenario presets created by the user in the study/context tab, but not to edit existing scenario presets or adding new ones.

I agree, that would be a much better solution.

Unfortunately, the Scenario presets are Paragraphs (basically a special kind of content similar to Nodes), that don't offer any type of selection, so implementing this will be tricky.

I think this could work:

(@fgeyer16 do you see any potential on how to get this done easier?)

Quickly tested this locally and it seems to work. That's how it could look like: currently selected Scenario shown to user in e.g. HC/maps tab select-available-scenario that's what the user would get when clicking on "edit scenario" (probably should change that to "change scenario" or something) select-available-scenario-form

patrickkaleta commented 4 years ago

Proposed changes in my previous comment are now implemented.

Study owners can now define up to 5 scenarios (rather start low, since raising the limit is no problem, but reducing it can be problematic), which then appear in the select lists of the individual GL-steps.

Involved elements in this new feature:

patrickkaleta commented 4 years ago

IMO this issue can now be closed.