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

Maps catalog page #59

Closed
tdipisa opened this issue Sep 25, 2019 · 14 comments
Closed

Maps catalog page #59

tdipisa opened this issue Sep 25, 2019 · 14 comments

Comments

@tdipisa
Copy link
Collaborator

tdipisa commented Sep 25, 2019

Since the main entry point for geOrchestra is the viewer, an option menu should be available in the viewer context to browse the catalog of user maps.

A new plugin should be added to MapStore. The new menu entry added to the burger menu should open a panel containing the "MapCatalog" component (already used in geostory and dashboards to allow the user to browse maps and select one to load in the current view (similar to the template list, reusing and extending the existing catalog).

If the map item in the catalog list is clicked the map is loaded in the same browser page: if the map has been saved within a context, the same behavior provided for context maps will be applied and the map will be loaded with the context's URL:

https://dev.mapstore2.geo-solutions.it/mapstore/#/context/{ContextName}/{MapId}

The MapCatalog should be enhanced to add (optionally) some additional buttons that should appear for each item in the list. The buttons to add are the same of the home page:

  • Edit Properties : show the map properties form. It should be visible only if the user has edit permission on the map. Not mandatory. the user can open the map and edit.
  • Delete: visible if the user has delete permission on the map. Mandatory, the user can delete the user map only from this entry point.
  • Share: shows the share window. The user can load the map and share it with the URL related to the context if the map has been saved within a context.
    https://dev.mapstore2.geo-solutions.it/mapstore/#/context/{ContextName}/{MapId}
@tdipisa
Copy link
Collaborator Author

tdipisa commented Mar 9, 2020

@allyoucanmap please can you provide an icon for this new menu option?

@allyoucanmap
Copy link
Collaborator

@tdipisa

icon proposals:
picturemessage_jrmwqmn0 5a0

@tdipisa
Copy link
Collaborator Author

tdipisa commented Mar 9, 2020

@allyoucanmap please commit needed updates in MS to allow @vlt1 using the first icon
@vlt1 please use the first icon

@offtherailz
Copy link
Collaborator

offtherailz commented Mar 10, 2020

Here I report some issues noticed when tried to integrate it in georchestra that have to be fixed @vlt1 .
For this reason I'll integrate it only as an optional plugin. The final version have to show the map catalog in the main map page (so localConfig.json)

Adding it in localConfig.json has the following problem:

  • delete doesn't work (it works on specific context)
  • When select the map the panel doesn't seems to load the correct map, event if URL switches correctly (something in map page should be ported in georchestra)

Adding it as a plugin:

  • has problems with delete, it works but the list reloads with the old map there (not deleted yet). I suggest to @tdipisa please confirm :
    • prompt confirm modal when switch to new map
    • close the panel when a map is selected.
  • The Toolbar buttons do not move when panel open (you should intercept it in map-layout epic).

Moreover:

  • if ready, use the new icon

@vlt1
Copy link
Contributor

vlt1 commented Mar 13, 2020

@offtherailz the results of my testing:

delete doesn't work (it works on specific context.

For me delete works the way you described in "Adding it as a plugin" section. The problem is that, when the second request is sent to the server, after deleting, the response is wrong. Instead of returning a list of maps without the deleted one(as it is in mapstore) here it returns the same list, as it was before deleting, the totalCount is less by one. In other words the response sent by the server is inadequate. If you were to reload again then the response is correct. For example, before deletion:

{
  "success": true,
  "totalCount": 5,
  "results": [
    {
      "canDelete": true,
      "canEdit": true,
      "canCopy": true,
      "creation": "2019-11-12 15:49:25.125",
      "description": "USA test",
      "id": 1,
      "name": "USA test",
      "owner": "test_user"
    },
    {
      "canDelete": true,
      "canEdit": true,
      "canCopy": true,
      "creation": "2020-03-10 12:42:51.744",
      "description": "plans de zonages et arbres",
      "id": 873,
      "name": "ma carte",
      "owner": "testadmin",
      "thumbnail": "rest/geostore/data/878/raw?decode=datauri&v=90a64e50-62cc-11ea-a29c-0f962818b867"
    },
    {
      "canDelete": true,
      "canEdit": true,
      "canCopy": true,
      "creation": "2020-03-10 12:56:02.445",
      "description": "dggdgdgd",
      "id": 883,
      "name": "test cat",
      "owner": "testadmin",
      "thumbnail": "rest/geostore/data/887/raw?decode=datauri&v=7bd5dde0-62ce-11ea-9404-87b575c0b2ae"
    },
    {
      "canDelete": true,
      "canEdit": true,
      "canCopy": true,
      "creation": "2020-03-10 13:11:10.198",
      "description": "tests ajout extension partager à la carte ",
      "id": 891,
      "name": "Ma carte2",
      "owner": "testadmin"
    },
    {
      "canDelete": true,
      "canEdit": true,
      "canCopy": true,
      "creation": "2020-03-13 11:32:55.402",
      "description": "delet",
      "id": 942,
      "name": "deletme",
      "owner": "testAdmin"
    }
  ]
}

Then after I delete the map "deletme", I get this response:

{
  "success": true,
  "totalCount": 4,
  "results": [
    {
      "canDelete": true,
      "canEdit": true,
      "canCopy": true,
      "creation": "2019-11-12 15:49:25.125",
      "description": "USA test",
      "id": 1,
      "name": "USA test",
      "owner": "test_user"
    },
    {
      "canDelete": true,
      "canEdit": true,
      "canCopy": true,
      "creation": "2020-03-10 12:42:51.744",
      "description": "plans de zonages et arbres",
      "id": 873,
      "name": "ma carte",
      "owner": "testadmin",
      "thumbnail": "rest/geostore/data/878/raw?decode=datauri&v=90a64e50-62cc-11ea-a29c-0f962818b867"
    },
    {
      "canDelete": true,
      "canEdit": true,
      "canCopy": true,
      "creation": "2020-03-10 12:56:02.445",
      "description": "dggdgdgd",
      "id": 883,
      "name": "test cat",
      "owner": "testadmin",
      "thumbnail": "rest/geostore/data/887/raw?decode=datauri&v=7bd5dde0-62ce-11ea-9404-87b575c0b2ae"
    },
    {
      "canDelete": true,
      "canEdit": true,
      "canCopy": true,
      "creation": "2020-03-10 13:11:10.198",
      "description": "tests ajout extension partager à la carte ",
      "id": 891,
      "name": "Ma carte2",
      "owner": "testadmin"
    },
    {
      "canDelete": true,
      "canEdit": true,
      "canCopy": true,
      "creation": "2020-03-13 11:32:55.402",
      "description": "delet",
      "id": 942,
      "name": "deletme",
      "owner": "testAdmin"
    }
  ]
}

As you see the second response contains the same maps, but the totalCount correctly changes. There seems to be some kind of a problem on the side of the server.

When select the map the panel doesn't seems to load the correct map, event if URL switches correctly (something in map page should be ported in georchestra)

In my testing maps were loaded correctly when I selected them :(

The Toolbar buttons do not move when panel open (you should intercept it in map-layout epic).

Yes, I will make a pr to MapStore to fix that behaviour

if ready, use the new icon

I updated MapStore to the latest master to use the icon. When the deletion and map select points are resolved i will make a pr

  • prompt confirm modal when switch to new map
  • close the panel when a map is selected.

What about these? Also what do you mean close the panel? When map is selected it loads it and after this all panels are closed(in my tests at least).

@tdipisa
Copy link
Collaborator Author

tdipisa commented Mar 16, 2020

@offtherailz @vlt1 below my feedback:

  • @vlt1, please use the dedicated icon for both the option menu item and the user map catalog panel header

  • @offtherailz the user map catalog panel should not be available in the option menu for anonymous users even though some maps are publics, let's discuss this.

@offtherailz
Copy link
Collaborator

ok, about the point from @vlt1 , sure, that's a inconsistent response.
Probably it is due missing transaction support on server side. Delaying 1 second the reload could fix the issue, while investigate on it.
@mbarto do you think we can fix the issue reported on server side ?

@vlt1
Copy link
Contributor

vlt1 commented Mar 16, 2020

@offtherailz I'll try to add a delay

@mbarto
Copy link
Contributor

mbarto commented Mar 16, 2020

@offtherailz @vlt1 @tdipisa my general thought about issues with geostore transactions is that since geostore is our own backend, and we also have a backend project inside mapstore, we should stop creating complicated workarounds in the frontend and start improving the backend properly.

These are good starting points:

@tdipisa
Copy link
Collaborator Author

tdipisa commented Mar 16, 2020

@vlt1 and @offtherailz here blow are my additional feedbakcs after my testing this afternoon (I tested this functionality in georchestra dev environment).

I don't know if there are some side effect during the local development and testing but the problems here are two in my opinion:

  1. When I open this context (expressively created for this test with all plugins in it) and I save a map, the map is correctly saved and available in the Map Catalog list.

At this point if I try to delete this new map, the map is not deleted because MS doesn't perform any request for this: at this point if you refresh the browser's page and you try again, the map is deleted because MS perform the delete request to the backend.

Therefore I think that the problem is that MS doesn't perform the delete request the first time

  1. Once the map is saved, if I click on the map item inside the Map Catalog list the map opens with the following URL (the same in MS dev instance I noticed):

https://georchestra.geo-solutions.it/mapstore/#/viewer/openlayers/983

that URL is wrong, it must be the URL of the context with the map ID at the end (as required here) and not the URL of the default context.

Also the map's share URL from Map Catalog tool must be the same and it is currently wrong:

image

I think a regression has been recently introduced here due to the above: in MS dev I created this two maps in the espacesvertsdrennes context:

  • test_map_delete
  • test_delete_2

but if I search them from MS home using the context filter those maps are not available in the search result list

image

When I tested this last week, it was warking peoperly. @offtherailz @vlt1 can you confirm this regression?

@vlt1
Copy link
Contributor

vlt1 commented Mar 16, 2020

  1. When I open this context (expressively created for this test with all plugins in it) and I save a map, the map is correctly saved and available in the Map Catalog list.

At this point if I try to delete this new map, the map is not deleted because MS doesn't perform any request for this: at this point if you refresh the browser's page and you try again, the map is deleted because MS perform the delete request to the backend.

Therefore I think that the problem is that MS doesn't perform the delete request the first time

@tdipisa I'm guessing you are saving the map and then are immmediately trying to delete it. I see that there is an issue in the map saving, maybe some sort of uncaught exception or something that kills the epics, and so they are not processed anymore. (for example after you saved the map try to save another one, that will fail too). If you don't save the map and just work with MapCatalog everything works as expected. Although, in the testing environment provided to me by @offtherailz, there is an issue with inadequate server response as I've described in the previous comment.

  1. Once the map is saved, if I click on the map item inside the Map Catalog list the map opens with the following URL (the same in MS dev instance I noticed):

https://georchestra.geo-solutions.it/mapstore/#/viewer/openlayers/983

@tdipisa Maps that you listed do not appear because from what I can see they do not contain a context attribute, therefore they do not belong to any context. This suggests an issue with saving. I've just tested locally using the latest MapStore master and created two maps "savecontexttest" and "savecontexttest2" with no issues. I also tried the same on dev server and also created maps "savecontexttest-dev" and "savecontexttest-dev2" with no issues. Could you please describe in detail your process for creating the maps?

@tdipisa
Copy link
Collaborator Author

tdipisa commented Mar 16, 2020

@vlt1

@tdipisa I'm guessing you are saving the map and then are immmediately trying to delete it. I see that there is an issue in the map saving, maybe some sort of uncaught exception or something that kills the epics, and so they are not processed anymore. (for example after you saved the map try to save another one, that will fail too). If you don't save the map and just work with MapCatalog everything works as expected. Although, in the testing environment provided to me by @offtherailz, there is an issue with inadequate server response as I've described in the previous comment.

As I specified, I've tested it in geOrchestra DEV (using the context here). There is no error in geOrchestra DEV while saving a map in a context as it currently happens in MS DEV (#5008). The map is saved but the URL is wrong, to check it try to open this context then:

  • Open the Map Catalog
  • Click on test_tob_save_2 map or open the related share tool

the loaded map URL or the URL in the share tool are:
https://georchestra.geo-solutions.it/mapstore/#/viewer/openlayers/995

that is wrong, it should be:

https://georchestra.geo-solutions.it/mapstore/#/context/tdipisa_test_map_delete/{MAP_ID}

@tdipisa Maps that you listed do not appear because from what I can see they do not contain a context attribute, therefore they do not belong to any context. This suggests an issue with saving. I've just tested locally using the latest MapStore master and created two maps "savecontexttest" and "savecontexttest2" with no issues. I also tried the same on dev server and also created maps "savecontexttest-dev" and "savecontexttest-dev2" with no issues. Could you please describe in detail your process for creating the maps?

yes, there is currently a problem with the save operation in MS dev, the one reported here. I've simply:

So I think there is a problem somewhere and an inconsistency between MS DEV and geOrchestra DEV

@vlt1
Copy link
Contributor

vlt1 commented Mar 16, 2020

@tdipisa To create a map that belongs to a context you have to use the "Existing context" option in create new map menu on the landing page. I'm not aware of any such functionality in Save Plugin

@vlt1
Copy link
Contributor

vlt1 commented Mar 16, 2020

@tdipisa the url is not wrong, these maps have no context, they were saved without one

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

No branches or pull requests

6 participants