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

#8686 Snapshot plugin refactoring #8687

Merged

Conversation

alex-fko
Copy link
Contributor

Description

Minor refactoring of Snapshot plugin to make it compatible with Toolbar, BurgerMenu, SidebarMenu.
This PR also simplifies rendering of plugin by preserving two modes (instead of three before): floating dialog or static panel.

Please check if the PR fulfills these requirements

What kind of change does this PR introduce? (check one with "x", remove the others)

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

Issue

What is the current behavior?
#8686

What is the new behavior?
Snapshot plugin supports all three containers; Rendering is simplified to the two modes: floating dialog or static panel.

Breaking change

Does this PR introduce a breaking change? (check one with "x", remove the other)

  • Yes, and I documented them in migration notes
  • No

Other useful information

Copy link
Member

@offtherailz offtherailz left a comment

Choose a reason for hiding this comment

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

Now it is visible, when enabled in localConfig.json. Approving.

@offtherailz offtherailz merged commit 5d26980 into geosolutions-it:master Oct 14, 2022
@offtherailz offtherailz added the BackportNeeded Commits provided for an issue need to be backported to the milestone's stable branch label Oct 14, 2022
@offtherailz
Copy link
Member

offtherailz commented Oct 14, 2022

This can not be tested on dev because it is not officially enabled.
@tdipisa should we simply accept it, backport and test on C040? We may enable it in data dir, but due to its limits of functionality, it may not work with gs-stable ( while it works on c040, where all data is on the same domain).

@tdipisa
Copy link
Member

tdipisa commented Oct 14, 2022

@offtherailz we cannot test in c040 until the PR there is approved and merged. @ElenaGallo I think it is something we can assign to @marthamareal to test locally, then we will update the PR in c040 accordingly after the backport to 2022.02.xx.

@offtherailz
Copy link
Member

Also local test is a little hard, because of CORS. The better way to test is to install mapstore and geoserver on the same tomcat and add to localConfig.json -->plugins--> desktop the "Snapshot" plugin.

@tdipisa
Copy link
Member

tdipisa commented Oct 14, 2022

If so @offtherailz let's enable it temporarily in DEV to allow tests. Simple, why to waste time on complicated solutions? If tests will pass in DEV we will backport in QA testing it in the same way. Finally we will update the c040 PR accordingly.

@offtherailz
Copy link
Member

Also on dev may not work because gs-stable is on another server. Let's try it anyway

@tdipisa
Copy link
Member

tdipisa commented Oct 14, 2022

@offtherailz let's be pragmatic: we don't need to necessarily to add layers from gs-stable to test the snapshot functionalities. we can do that also locally (imo) with an empty background and a vectorl layer imported for example. Imo @marthamareal you can proceed in this way.

@marthamareal
Copy link

@alex-fko @offtherailz, I have tested this locally and the functionality works as follows:

  • When the configuration is added in the localConfig.json, the snapshot button is available.
  • When you click on the snapshot button, a popup opens with the current map view.
  • if the view is savable by the plugin, there are no warning in popup and user can save the image. else a warning message is available to inform the user another approach of saving the image.

However, I have noticed that if a user makes a request on a view that is not savable, and error is raised. But if they close the popup and change to a savable view, on clicking the snapshot button, the previous error still exists in the popup. see video
screen-capture (1).webm

@offtherailz
Copy link
Member

Yes, unfortunately it is the major defect of this tool. Because the warning happens when the map canvas is tainted (contain resources dot allowed for download by the security policies of the browser). And there is no way to clear this condition without removing the whole map at all and recreate a new one. It is a known issue of the tool (it will be probably improved in the future).
So the problem of the snapshot that didn't open seems to be solved.
Thank you.
I think it can be backported

alex-fko added a commit to alex-fko/MapStore2 that referenced this pull request Oct 17, 2022
tdipisa pushed a commit that referenced this pull request Oct 17, 2022
@tdipisa tdipisa removed the BackportNeeded Commits provided for an issue need to be backported to the milestone's stable branch label Oct 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants