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

Include In Report Button not working properly #9

Closed
p-a-s-c-a-l opened this issue Jul 8, 2019 · 54 comments
Closed

Include In Report Button not working properly #9

p-a-s-c-a-l opened this issue Jul 8, 2019 · 54 comments
Assignees
Labels
BB: Report Generation Report Generation Building Block bug Something isn't working SHOWSTOPPER Feature or bug, that, if not addressed, renders the CSIS essentially useless wontfix This will not be worked on

Comments

@p-a-s-c-a-l
Copy link
Member

p-a-s-c-a-l commented Jul 8, 2019

  • 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.

@p-a-s-c-a-l p-a-s-c-a-l added the bug Something isn't working label Jul 8, 2019
@p-a-s-c-a-l p-a-s-c-a-l added this to the D1.4 CLARITY CSIS v2 milestone Jul 8, 2019
@p-a-s-c-a-l p-a-s-c-a-l added this to Backlog: High Priority in T1.3 Climate Services Co-creation via automation Jul 8, 2019
p-a-s-c-a-l added a commit that referenced this issue Jul 8, 2019
@p-a-s-c-a-l p-a-s-c-a-l moved this from Backlog: High Priority to Backlog: Medium Priority in T1.3 Climate Services Co-creation Jul 9, 2019
@p-a-s-c-a-l
Copy link
Member Author

p-a-s-c-a-l commented Jul 30, 2019

Most likely a CORS problem. See clarity-h2020/emikat#14 and clarity-h2020/data-package#31

@therter
Copy link
Contributor

therter commented Aug 2, 2019

Current status:
When we use html2canvas version 1.0.0-rc1, set the options useCORS and foreignObjectRendering to true and additional ensure that the page is not scrolled down, then the Report button will work in Chrome.
But the button does not work in Firefox, because the option foreignObjectRendering is not supported by Firefox and without the option foreignObjectRendering, the overlay layers will be clipped.

@p-a-s-c-a-l
Copy link
Member Author

p-a-s-c-a-l commented Aug 2, 2019

ensure that the page is not scrolled down

how?

@therter
Copy link
Contributor

therter commented Aug 2, 2019

how?

we can set the page to the top position by execute
window.scrollTo(0, 0);
After a click on the report button, a popup will open. So the change of the viewport should not disturb the users.

@patrickkaleta
Copy link
Contributor

Same bug also mentioned here.

Problem is that the JSON:API and the Group module sometimes have troubles working together (issue described here). Most of the times this is not an issue for us, since we already have a GL-step relation to the Study group, which we can use to create the required relation between the Report image and the Study a different way (this is done via the csis_helpers_node_insert hook in the csis_helpers.module).
Only place where it doesn't work is the Study area tab, since it does not have a GL-step.

Today someone finally found a workaround, which makes it possible to send a POST request via JSON:API to create a new Group content. I implemented the necessary function in my latest commit, but further testing is needed.

Note: The proposed patch #26 in the linked issue does not solve our problem and breaks the entire Study, so it's not an option for us!

@patrickkaleta
Copy link
Contributor

This is fixed now. I applied the proposed patch (workaround) from here and so far I haven't detected any unwanted side-effects.

@p-a-s-c-a-l
Copy link
Member Author

p-a-s-c-a-l commented Sep 23, 2019

I tried the 'include in report'-button with the new table component iframe, but it didn't work:

TypeError: A is undefined html2canvas.min.js:6:146514

@therter
Copy link
Contributor

therter commented Sep 23, 2019

The wrong element is used by html2canvas. I should be able to fix this

@DenoBeno
Copy link

Excellent. :-)

@therter
Copy link
Contributor

therter commented Sep 25, 2019

Since the html2canvas cannot handle iframes, the first div element of the table component should be used to create the image. So the csis helper module must ensure that a valid element will be delivered to html2canvas.

If the created image does not look like expected, then it is possible that the page uses some css properties, which are not supported. An uncomplete list of supported and not supported css properties can be found here. Sometimes they can be replaced by other css properties.

@p-a-s-c-a-l
Copy link
Member Author

The feature is still not working properly for the map component (neither chrome nor firefox):

grafik

@p-a-s-c-a-l p-a-s-c-a-l added the BB: Report Generation Report Generation Building Block label Sep 25, 2019
therter added a commit that referenced this issue Sep 25, 2019
therter added a commit that referenced this issue Sep 25, 2019
therter added a commit that referenced this issue Sep 25, 2019
@therter
Copy link
Contributor

therter commented Sep 25, 2019

It is working now for the map and the table (at least in firefox and chrome)

Bildschirmfoto vom 2019-09-25 19-26-08

Bildschirmfoto vom 2019-09-25 19-24-56

I think we can close this issue now.

@therter therter closed this as completed Sep 25, 2019
T1.3 Climate Services Co-creation automation moved this from In Progress to Done Mar 19, 2020
T4.5 Scenario Analysis, Decision Support and Report Generation automation moved this from In progress to Done Mar 19, 2020
@p-a-s-c-a-l
Copy link
Member Author

Layers from the group CLARITY Backgrounds selected on this map do not appear in the report image. This is probably caused by the fact that TLS is still not available for services.clarity-h2020.eu

@therter
Copy link
Contributor

therter commented Mar 30, 2020

No Access-Control-Allow-Origin' header is present in the response from the wms http://services.clarity-h2020.eu:8080/geoserver/clarity/ows. So I have reopend this issue

@p-a-s-c-a-l
Copy link
Member Author

Again, not working on this page with FireFox 74.

grafik

@DenoBeno
Copy link

DenoBeno commented Apr 2, 2020

Taking screenshots works for everything expect for the CLARITY land use layers at my side. (Test with latest chrome)

If i get this correctly, the wms serving CLARITY land use layers is misconfigured. Missing the Access-Control-Allow-Origin or not having TLS configured. Whatever it is, we already have another server that's working OK, so we just need the same configuration as on that one (server with hazard layers), no?

Who is responsible for this server? Is it @ghilbrae ? If it's @negroscuro , I have just noticed that he isn't included in this conversation.

therter added a commit that referenced this issue Apr 3, 2020
therter added a commit that referenced this issue Apr 8, 2020
therter added a commit that referenced this issue Apr 9, 2020
@therter
Copy link
Contributor

therter commented Apr 9, 2020

Again, not working on this page with FireFox 74.

grafik

Thsi should be fixed now

@p-a-s-c-a-l
Copy link
Member Author

grafik

therter added a commit that referenced this issue Apr 15, 2020
@p-a-s-c-a-l p-a-s-c-a-l added the wontfix This will not be worked on label Apr 21, 2020
@p-a-s-c-a-l
Copy link
Member Author

@therter what is the current status? Did you test it with Firefox, too? Windows or Linux?

  • Firefox 75.0 (64-Bit) Windows 7: working
  • Firefox 75.0 (64-Bit) Windows 10: not working

So probably a problem with the graphic card driver. Doesn't seem that we have any influence on that.
I close the issue for now. We'll wait for the results of the technical validation: clarity-h2020/csis-technical-validation#1

T1.3 Climate Services Co-creation automation moved this from In Progress to Done Apr 21, 2020
T4.5 Scenario Analysis, Decision Support and Report Generation automation moved this from In progress to Done Apr 21, 2020
@p-a-s-c-a-l
Copy link
Member Author

This is a never ending story. I tried to make a screenshot of this map, but it's again not working:

@therter
Copy link
Contributor

therter commented Jul 27, 2020

The position of the popup from the GetFeatureInfo request is correct now (on the dev instance), but I could not reproduce the errors on the left map.

@p-a-s-c-a-l
Copy link
Member Author

O.K. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BB: Report Generation Report Generation Building Block bug Something isn't working SHOWSTOPPER Feature or bug, that, if not addressed, renders the CSIS essentially useless wontfix This will not be worked on
Development

No branches or pull requests

6 participants