Giter Site home page Giter Site logo

clarity-h2020 / csis-helpers-module Goto Github PK

View Code? Open in Web Editor NEW
1.0 17.0 0.0 462 KB

CSIS Helpers Drupal Module

License: GNU General Public License v3.0

JavaScript 62.53% PHP 36.43% CSS 0.39% Twig 0.64%
building-block new-component drupal-8 drupal-module

csis-helpers-module's People

Contributors

p-a-s-c-a-l avatar patrickkaleta avatar therter avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

csis-helpers-module's Issues

Get node id of parent entity

Script shall return the id of the parent entity that contains the iFrame node, not the current entity of the iFrame node itself.

DisplaySuite Interference

Move creation of Drupal Settings for entity info from hook preprocess to hook view since DisplaySuite disables hook preprocess.

Include additional info in $entityinfo

It would be helpful if we could include some additional properties from study group node in $entityinfo so that we can avoid some API calls in our external components.

ATM we would need

  • field_emikat_id
  • field_data_package: here just the data package entity uuid from data/id, e.g. a8ff7930-4a9f-4289-8246-3383ba13c30f
  • field_area: the valueproperty of the geofiled entity, e.g. POLYGON((14.149017 40.8268,14.149017 40.894051,14.316902 40.894051,14.316902 40.8268,14.149017 40.8268))

404 Error message for Report image GET request via JSON:API

I'm trying to add the "include in report button" functionality, but after updating my local csis instance to the newest version of the csis, I'm receiving an error when trying to make a GET-request for a Report image:
The "entity" parameter was not converted for the path "/jsonapi/node/report_image/{entity}" (route name: "jsonapi.node--report_image.individual")
The GET-request was working prior to that update.

@fgeyer16: have there been any other changes made to the (JSON:API) Rest configuration, which I need to manually add to my local instance?

Include In Report Button not working properly

  • The "Include in Report" Button does not work for the Study Area Map.
  • Layers shown on the map are not available in the report image generated with html2canvas. This is most likely a problem caused by html2canvas itself and not by the map component or the include in report button.

To track down the problem, the debug log in html2canvas can be used. The problem related to the missing map layers could be resolved by updating html2canvas to the latest version and by changing some configuration options or modifying the react JS Code of the map component.

Transport Module (TM) trigger specifications

Subtask of this issue.

In order for the TM to be able to generate study-relevant output, CSIS needs to trigger the TM and sent the necessary information for the relevant Studies.

We already have something similar for another external service (Emikat), where we use REST for the communication (issue, relevant code).

@rapto: Angela told me that you would be to right person to talk to. Can you check our trigger approach for Emikat and tell me if we could do something similar for the TM?

If so, we would have to think about the following things:

  1. Which Studies are considered to be relevant for the TM? -> should be just Studies of StudyType = Transport Infrastructure
  2. When and with what data should we trigger the TM? -> CSIS allows users to fill their studies bit by bit. So right after it is created, it doesn't yet contain all the needed data, so it might make sense to wait a bit before we actually trigger the TM.
  3. What shall we do when users change relevant parts of the Study? -> for Emikat, in such cases we trigger it again with the updated data and start a re-calculation
  4. How will the CSIS know once results are available? -> for Emikat, we periodically pull the current status. But it would also be possible (maybe the better solution?) if the TM would make a REST call and update the status of the calculations
  5. Which ID to use as primary identification for communication? (e.g. when requesting a map from the TM) -> for the CSIS (Drupal system) it would be easier if we could use our internal IDs and pass them along in our requests.

Add boolean field for Adaptation Project into $StudyInfo

Since we want to remove the Study variant fieldfrom the Study Scenario object, we need to add it separately to the $studyInfo object, so that the Map and Table components can query and filter data for the baseline and for the adapted scenario.
Boolean field has_adapted_scenario will be set based on whether or not the Study contains an "Adaptation Project" Group node.

In the process the study_variant attribute will be removed from the study_scenarios and study_presets of the $studyInfo object.

Cannot read property 'step' of undefined

js_VN7rwrZCfKyapY1QuY241S22w6myG2_M6JuGNsj-3Lc.js:2 Uncaught TypeError: Cannot read property 'step' of undefined
    at HTMLDocument.<anonymous> (js_3dwsmfOnil9STOkYO05SL0FSYUhjWfvIHR8_sBxWRtk.js:4788)
    at j (js_VN7rwrZCfKyapY1QuY241S22w6myG2_M6JuGNsj-3Lc.js:2)
    at k (js_VN7rwrZCfKyapY1QuY241S22w6myG2_M6JuGNsj-3Lc.js:2)

Hide edit buttons if user permissions are not sufficient

Group members who are not owners, cannot edit the Study group itself, but only work with the group contents (the GL-steps, report images, ...).

So, in the Study step all edit buttons created with the Display Suite need to be hidden via the CSIS helpers module. For that, all Display suite buttons in question will get an extra class "token-field-check-permissions", for which the helpers module will look for and then based on the write_permissions attribute in the $studyObject, the buttons will be either hidden or not.

Creating automated tests for Integration with Emikat

@DenoBeno suggested that we should have some kind of automated testing, that would on a regular basis check if the communication between CSIS and Emikat is working and if Emikat produces results.

I suppose one way of how we could achieve this is by creating a custom service in our csis helpers module. That service could be called either by accessing a specific URL or triggered by a cronjob (might be better to instead use a queue as shown here).

Example of how to build a service here and here.

Get Node UUID

CSIS Helper Modules retrieved the id of the node which is fine for Legacy REST API, but for making requests to the JSON:API (e.g. GET '/jsonapi/node/report_image/ff1f3c94-abbd-43bc-90d8-c61e7dad6dac/') we need the UUID.

Calculation in progress/finished indication

EMIKAT calculation took 6 minutes for the test study that I tried today. Possibly more for larger areas.

It would be nice to have some indication on the site saying "calculation failed/in progress/done".

Theme Missing

Not sure what this error message wants to tell me:

grafik

Emikat Trigger specifications

  • include forceRecalculate attribute
    Set the boolean forceRecalculate attribute in each PUT request to inform Emikat if the changes made to the study affect the calculations or not.
    Swagger Interface with examples: https://service.emikat.at/EmiKatTst/swagger/index.html#!/EmiKat32Scenario32resource/insertScenario
  • trigger Emikat only for certain Study types (TBD which ones)
  • handle events when Study type changes (e.g. change status in Emikat? TBD) it won't be possible to change study type

Opening Edit-form as modal not working for links created by the module

The openEditForm function creates a link just like the ones on the Summary-Tab, which open the edit-forms for Report Images via Ajax as a modal.

However, this doesn't seem to work and the "use-ajax" class in the link gets ignored and a complete page-load is triggered instead. Not a major bug, since the user is taken back to the correct page after he/she saves the edit-form. But it's still ugly that way.

@fgeyer16 Any idea why this is not working?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.