Comments (11)
Ah thank you.
from docker-drupal.
Screenshots of maps and table are now being stored as Report images, which are linked to the corresponding GL-Step and can be viewed in the Summary tab and printed out in the report.
@p-a-s-c-a-l
FYI: I mainly followed your approach (thanks for providing the link) and managed to implement it in "plain" JavaScript.
Instead of sending a GET request for the GL-Step and later PATCHing that same GL-Step with the new Report Image, I'm sending another POST request in the end against the relationship endpoint for the Report Images array of the GL-Step. (more on this here)
So the whole approach looks like this:
- POST new file of the screenshot (same as your approach)
- POST new Report Image including the UUID of the new file retrieved in 1) (same as your approach)
- POST new Relationship for the respective GL-Step, payload only contains the entity type and UUID of the Report image (the GL-Step and the type of the relationship is already part of the URL)
from docker-drupal.
We could either add html2canvas.min.js to csis.libraries.yml in csis-theme and add a
<button>
+ the respective REST calls to the Drupal API directly in an HTML field. Or we integrate the functionality (JS function) in the csis-helpers-module.
This has to be included in csis-helper module. Modules are for functionality themes for looking nice :-)
Maybe this should be a small separate module.
May be I missed something on glimpsing on html2canvas. But how do we get an Imagefile from that to upload to the server?
from docker-drupal.
May be I missed something on glimpsing on html2canvas. But how do we get an Imagefile from that to upload to the server?
Here is an example: https://github.com/clarity-h2020/scenario-analysis/blob/dev/app/scripts/controllers/mainController.js#L170
document.body.appendChild(canvas);
is just for testing purposes. It should be commented out.
var imageBlob = canvas.toDataURL().replace(/^data:image\/(png|jpg);base64,/, '');
will get the image data from the canvas that was created by html2canvas from the html element identified by elementId
See also https://html2canvas.hertzen.com/
from docker-drupal.
@fgeyer16 Any progress, plans, suggestions, ... here :-)
Is this the 'Snapshot' Field?
from docker-drupal.
@patrickkaleta @fgeyer16
FYI: Complete example for taking screenshots and posting to Drupal API is available in drupalService.js
from docker-drupal.
I wouldn't close this issue just yet, since @DenoBeno suggested that we show to the user an Edit-form, where he/she can enter a description for the Report image, when they click on the "Include in Report" Button.
Reason: They can edit the description of a Report image on the Summary-Tab, but once they get to that tab, they might've already forgotten what this screenshot was really about.
Problem: We cannot show an Edit form for the Report Image directly, since this Report image doesn't exist until after the user clicks that button.
@fgeyer16 might've come up with a possible solution to this, so I will talk to him and try to implement it
from docker-drupal.
Any progress to report here?
from docker-drupal.
Already done. Suggestions by @DenoBeno have been implemented. I forgot to update & close the issue.
from docker-drupal.
The Button does not work for the Study Area Map.
from docker-drupal.
See clarity-h2020/csis-helpers-module#9
from docker-drupal.
Related Issues (20)
- Accessing private Git repository via new servers not possible HOT 5
- SSO needs to be improved HOT 5
- Local User Profiles in DEV are missing information HOT 3
- Edit context usability issue HOT 4
- Unable to add hazard index tag to resource HOT 2
- Reuse of Expert Data Packages in Basic Screening Studies HOT 1
- Upgrade Drupal Docker Images and Containers HOT 2
- Landing Page for `Testing Team` Users HOT 3
- Make new Release DEV -> PROD HOT 8
- Explain reason and purpose for Twin studies HOT 3
- Additional usability improvements HOT 1
- Error in ViewfieldFormatterTitle->viewElements() HOT 6
- Add skip_on_empty plugin to GL-step migrate file HOT 1
- PDF Generation broken HOT 8
- HTML Tags in Resource Description HOT 1
- Twins Map not working properly on Summary Page HOT 6
- drupal/group patches still needed? HOT 5
- Create Custom PostGIS Docker Image HOT 3
- Documentation HOT 1
- Set CSIS Prod and Dev into Maintenance mode due to a server maintenance HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-drupal.