DigitalCommons / mykomap-monolith

A web application for mapping initiatives in the Solidarity Economy
0 stars 0 forks source link

Link ResultsPanel to API #52

Closed rogup closed 2 days ago

rogup commented 1 week ago

What? Why?

Related to issue #20 and #29

This PR:

What should we test?

Checklist

Deployment notes

wu-lee commented 3 days ago

Much of the code I can't comment on in a very helpful way as I'm not familiar with the things being altered.

Automated Tests pass

The code builds and the tests all pass, although the front-end tests emit error and warning mesages. e.g.

Error fetching locations No datasetId parameter given, so dataset locations cannot be fetched

Warning: An update to MapWrapper inside a test was not wrapped in act

Error fetching API version info TypeError: Failed to parse URL from undefined/version at node:internal/deps/undici/undici:13178:13

Manual tests

When testing the app, I do notice that the side-bar still appears in a flash-of-content when the page loads. Probably not relevant here, but seems worth mentioning anyway.

In the following manual tests I'm using the dataset-A data from the test/data directory.

Sidebar categories don't seem to function

The number of categories in the directory appears to be correct - there is only "Unitied Kingdom" and "France"

Not sure if clicking on categories in the directory is meant to work - seems not to, "zero matching results" when I try for both categories. e.g.

  1. open map sidebar
    • Optionally zoom into show individual pins
  2. click on UK
  3. zero matching results, all two pins still visible
  4. errors in console, see below.

Try searching for some text or filters

Likewise to the above, trying to filter the countries doesn't seem to have any visible effect - "0 matching results". This doesn't seem to change if I zoom in to de-cluster the pins first

  1. open map sidebar
  2. select search panel - "3 matching results" shown above filters
    • optional step here, zoom in to show individual pins
  3. select "United Kingdom" in country dropdown
  4. search results panel slides, out with "0 matching results", all two pins still visible (if I move them out from behind the panel)
  5. errors in console, see below.

The errors from both cases seem to be the same, as below:

Error fetching search results undefined [<anonymous code>:1:145535](chrome://devtools/content/webconsole/%3Canonymous%20code%3E)
    overrideMethod <anonymous code>:1
    instrumentConsole console.ts:40
    rejected panelSlice.ts:103
    reducer Redux
    produce immerClass.ts:97
    Redux 9
    createImmutableStateInvariantMiddleware Immutable
    Redux 5
    createImmutableStateInvariantMiddleware Immutable
    Redux 2
    performSearch searchSlice.ts:214
    middleware Redux
    createImmutableStateInvariantMiddleware Immutable
    createActionCreatorInvariantMiddleware Redux
    onFilterChange SearchPanel.tsx:38
    onChange SearchPanel.tsx:76
    handleChange InputBase.js:387
    handleItemClick SelectInput.js:287
    callCallback2 React
    sentryWrapped helpers.ts:104

Searching for "pear" finds the French pin and hides the English one, and for "apple" the vice versa. But neither case seems to change the list in the side bar.

Check that updating the filters or search updates the results and that they are reflected in the map

This doesn't seem to work, because the search/filters don't seem to work at all.

Check that clicking on a result opens the popup

Clicking on the pins, the pop-up appears - this seems to be working

I don't have any results in the search to click in.

Check that clicking 'clear search' removes all filters and closes the results panel

This seems to work as advertised.

Check that the toggle panel button works as expected

The whole panel and results panel are hidden when the toggle button on the edge of the panel is clicked. When re-togged it opens, but the results panel does not show until another search triggers it.

rogup commented 2 days ago

@wu-lee I couldn't reproduce the issues with searching and filtering - maybe a problem with your local setup and build?

I've addressed the small issue with toggling the panel. So I'm going to merge this and deploy it for QA

rogup commented 2 days ago

@ColmDC There's some slightly odd panel behaviour, where the results panel doesn't slide out from the side properly. I tried to get this to work but couldn't figure it out, I think this is Marcel's field of expertise. Please could you create a bug ticket to track this?

@ms0ur1s I've added a comment to ResultsPanel about this. Basically, I think we need to remove the panelOpen && resultsPanelOpen && bit so that the panel stays rendered, to prevent it from appearing so suddenly. But when I tried this, the MuiDrawer-root component stays invisibly floating above the map when the drawer is closed, meaning we can't click on the MapLibre map. The main Panel.tsx component doens't seem to have this problem

ColmDC commented 1 day ago

the results panel doesn't slide out from the side properly.

@rogup You mean it just appears in place?

rogup commented 1 day ago

the results panel doesn't slide out from the side properly.

@rogup You mean it just appears in place?

Yes, it doesn't slide out, so the transition looks weird. It can be repro'ed here https://dev.maps.coop/cwm/?datasetId=delhi

ColmDC commented 1 day ago

I see that behaviour.

@ms0ur1s , is that the currently implemented behaviour and you need something new spec'ed, or do should we treat it as a bug?

lin-d-hop commented 1 day ago

I would say that we treat this as a bug and add to the list.