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

#9250: Share plugin - Permalink functionality #9288

Merged
merged 11 commits into from
Jul 25, 2023

Conversation

dsuren1
Copy link
Contributor

@dsuren1 dsuren1 commented Jul 18, 2023

Description

This PR introduces permalink functionality to Share

Please check if the PR fulfills these requirements

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

  • Feature

Issue

What is the current behavior?

What is the new behavior?
User can create permalink of the current state of the map, dashboard, geostory, context map. The permalink resources are saved as PERMALINK category and has unique resource id. The title attribute is shown in Save/SaveAs modal and TOC

image image

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

@dsuren1 dsuren1 added this to the 2023.02.00 milestone Jul 18, 2023
@dsuren1 dsuren1 requested a review from offtherailz July 18, 2023 13:35
@dsuren1 dsuren1 self-assigned this Jul 18, 2023
@dsuren1 dsuren1 linked an issue Jul 18, 2023 that may be closed by this pull request
16 tasks
@offtherailz
Copy link
Member

can you update this pr with latest master, so It can pass the checks, thank you.

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.

  • see my comments inline
  • Title can not be saved or searched. I see you make it work on cards too, and this is great, but for the moment the title functionality is not supported sufficiently for resources to make this title visible everywhere. So for the moment, as I asked, show the title input only if the title already exists as attribute (so only for the case of permalinks). After merging this PR, let's open a new issue to improve the title functionality.
    title_not_saved.webm
    Here the point of the issue telling this
  • It could be a nice to have to have the title editor in save form too. IT should be shown for the moment only if it is present as attribute (also an empty string is ok for showing the editor, but if it is an empty string in the layer tree or where it is shown as a string,you should show the name isntead.
  • I notice the controlLabel is not correct. "Via a direct link" . Please fix (use something like "Permalink generated", maybe a subtitle "share the resource using the generated address"

-[ ] The permalinks URL should contain the hash in the URL (name), instead here I see the ID.
image

Because of this inconsistency above, any futher test will not be valid because after refactoring I'd need to test all again. Generally the rest seems to work well (please double check the part of the session I commented inline).

  • I noticed the share plugin to create permalink is not shown if the map is new ... It may be acceptable @tdipisa ?
docs/developer-guide/mapstore-migration-guide.md Outdated Show resolved Hide resolved
docs/developer-guide/mapstore-migration-guide.md Outdated Show resolved Hide resolved
docs/developer-guide/mapstore-migration-guide.md Outdated Show resolved Hide resolved
docs/developer-guide/mapstore-migration-guide.md Outdated Show resolved Hide resolved
docs/developer-guide/mapstore-migration-guide.md Outdated Show resolved Hide resolved
docs/developer-guide/mapstore-migration-guide.md Outdated Show resolved Hide resolved
docs/developer-guide/mapstore-migration-guide.md Outdated Show resolved Hide resolved
web/client/configs/pluginsConfig.json Outdated Show resolved Hide resolved
web/client/components/share/SharePanel.jsx Outdated Show resolved Hide resolved
web/client/epics/context.js Outdated Show resolved Hide resolved
@dsuren1
Copy link
Contributor Author

dsuren1 commented Jul 21, 2023

  • Title can not be saved or searched. I see you make it work on cards too, and this is great, but for the moment the title functionality is not supported sufficiently for resources to make this title visible everywhere. So for the moment, as I asked, show the title input only if the title already exists as attribute (so only for the case of permalinks). After merging this PR, let's open a new issue to improve the title functionality.

The code is already present to show title from the resource on the card. Will make name take precedence on resources and hide input when title is not present

@dsuren1 dsuren1 requested a review from offtherailz July 21, 2023 15:50
@offtherailz
Copy link
Member

@tdipisa we should be ready to go. Anyway our installation do not contain the PERMALINK category. Now we have docker and some other items.
The migration guidelines has been provided, but we have to provide them in our installation. Should we ask to alessandro ?

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.

Everything works. Only some minor issues:

  • Save button has a fixed size as the "create new" button, in certain languages, this is not enough. Expecially in french where this have to be used mostly. So please
    • Make these buttons growing with the text
    • I think that strings should be : "Generate permalink" and "Create a new permalink..." (with ... suggesting to do more).
    • Create new permalink should stay below the QR Code, on the right.
      image
      image
@dsuren1
Copy link
Contributor Author

dsuren1 commented Jul 24, 2023

Updated:
Screenshot 2023-07-24 at 11 19 46 AM
Screenshot 2023-07-24 at 11 20 02 AM

@dsuren1 dsuren1 requested a review from offtherailz July 24, 2023 07:36
@dsuren1
Copy link
Contributor Author

dsuren1 commented Jul 24, 2023

Doc build is complaining about missing configuration file. It worked a while back. Strange!

@offtherailz
Copy link
Member

Doc build is complaining about missing configuration file. It worked a while back. Strange!

I think is a new requirement.
https://docs.readthedocs.io/en/stable/config-file/v2.html

Can you open an issue for that? @tdipisa I'll review the PR in the meanwhile, but for merging it requires this to be fixed on the main project
adding a file like .readthedocs.yml to the root of the project, with something like this may work, but we have to do some tests with a PR.

version: 2

python:
  install:
    - requirements: docs/requirements.txt
  system_packages: true

mkdocs:
  configuration: mkdocs.yml
  fail_on_warning: false

@tdipisa can you assign this task to someone?

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.

I applied the fixes in review by myself, please take a look

web/client/epics/permalink.js Outdated Show resolved Hide resolved
@offtherailz
Copy link
Member

here I added a draft PR to fix the issue of readthedocs, you can start from this. I can not dedicate time today on this, hope it works.
#9297

@offtherailz
Copy link
Member

Hi @tdipisa , there was a missing comment I noticed you didn't replied, so just to double check, I ask for confirmation

  • I noticed the share plugin to create permalink is not shown if the map is new ... It may be acceptable @tdipisa ?

I mean that the share plugin do not show when the map is new. So the permalink will not be visible too. Is this acceptable?

@tdipisa
Copy link
Member

tdipisa commented Jul 24, 2023

Hi @tdipisa , there was a missing comment I noticed you didn't replied, so just to double check, I ask for confirmation

  • I noticed the share plugin to create permalink is not shown if the map is new ... It may be acceptable @tdipisa ?

I mean that the share plugin do not show when the map is new. So the permalink will not be visible too. Is this acceptable?

yes

@offtherailz offtherailz reopened this Jul 25, 2023
@offtherailz
Copy link
Member

closed and reopen to re-run checks

@offtherailz offtherailz enabled auto-merge (squash) July 25, 2023 09:49
@offtherailz offtherailz merged commit 2ce16e0 into geosolutions-it:master Jul 25, 2023
10 checks passed
@tdipisa
Copy link
Member

tdipisa commented Jul 25, 2023

@ElenaGallo please test this carefully on DEV once deployed.

@ElenaGallo
Copy link
Contributor

ElenaGallo commented Jul 26, 2023

@dsuren1 some notes after testing the permalink:

  • the permalink description is not reported in the save panel
    description

  • if the permalink is saved it is not found as a map on the homepage, is that correct?
    save permalink

  • the Details in the permalink are not visible
    details

  • the permalink generated from a context does not have the save panel filled in correctly (no name, tile and public rule)
    context_permalink

@offtherailz
Copy link
Member

offtherailz commented Jul 26, 2023

My feedback on this:

  • Description could be saved as an metadata so it can be analogue to the map's one and visible in the save form. We can apply this fix.
  • Permalink should not be listed in maps. For the moment are links, if you do not have the reference, you will not be allowed to use it.
  • the Details in the permalink are not visible --> good catch. Anyway the detail is part of the saved resource, so even cloning the map with save as makes it lost. So I think not saving it is the correct behavior too.

Ther rest is up to @dsuren1

@dsuren1
Copy link
Contributor Author

dsuren1 commented Jul 26, 2023

@ElenaGallo

the permalink generated from a context does not have the save panel filled in correctly (no name, tile and public rule)

Save as panel will not have name and description. This is an expected behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment