feat(userOverlays): display users overlays without group (MIN-193)
Fetching of user overlays has been added, which allows you to edit the name and description of individual overlays in the modal, remove an overlay and change the order of overlays. Except editting, you can download a file with overlay data. The list of user overlays is displayed only to the logged in user. It is possible to display/disable the user's overlay on the map by toggling the View/Disable button. In addition, a description of the overlay is displayed in the form of a tooltip.
Merge request reports
Activity
assigned to @mateusz-winiarczyk
added 29 commits
-
bff39da1...ba85bc5c - 27 commits from branch
development
- 54eb99da - Merge remote-tracking branch 'origin/development' into MIN-193-display-users-overlays-without-group
- 525c9d69 - test(export): fix test command
-
bff39da1...ba85bc5c - 27 commits from branch
- src/assets/vectors/icons/info.svg 0 → 100644
1 <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"> changed this line in version 3 of the diff
46 47 const handleSaveEditedOverlay = async (): Promise<void> => { 48 if (!currentEditedOverlay || !name || !description || !login) return; 49 await dispatch( 50 updateOverlays([ 51 { 52 ...currentEditedOverlay, 53 name, 54 description, 55 }, 56 ]), 57 ); 58 59 await dispatch(getAllUserOverlaysByCreator(login)); 60 61 dispatch(closeModal()); - Comment on lines +49 to +61
You are dispatching many actions here, so the action creation pattern should be used (encapsulates action dispatch) https://redux.js.org/tutorials/fundamentals/part-7-standard-patterns#action-creators
Also, you don't need to
await
the actions, that's unnecessary
- Resolved by Adrian Orłów
1 export const ACTION_TYPES = ['Edit', 'Download']; changed this line in version 3 of the diff
41 <Button 42 variantStyles="ghost" 43 className="mr-4 max-h-8 flex-none gap-1.5" 44 onClick={toggleOverlay} 45 data-testid="toggle-overlay-button" 46 > 47 {isOverlayLoading && ( 48 <Image 49 src={spinnerIcon} 50 alt="spinner icon" 51 height={12} 52 width={12} 53 className="animate-spin" 54 /> 55 )} 56 {isOverlayActive || isOverlayActive ? 'Disable' : 'View'} changed this line in version 3 of the diff
- Resolved by Adrian Orłów
37 setUserOverlaysList(userOverlays); 38 } 39 }, [userOverlays]); 40 41 const moveUserOverlayListItem = (dragIndex: number, hoverIndex: number): void => { 42 const updatedUserOverlays = moveArrayElement(userOverlaysList, dragIndex, hoverIndex); 43 setUserOverlaysList(updatedUserOverlays); 44 }; 45 46 const updateUserOverlaysOrder = (): void => { 47 const reorderedUserOverlays = []; 48 if (!userOverlays) return; 49 50 for (let index = 0; index < userOverlays.length; index += 1) { 51 const userOverlay = userOverlays[index]; 52 const newOrderedUserOverlay = JSON.parse(JSON.stringify(userOverlaysList[index])); changed this line in version 3 of the diff
- Resolved by Adrian Orłów
added 1 commit
- 661c54f0 - refactor(useroverlays): extract icons to reusable file refactor updating overlays
added 7 commits
-
661c54f0...2e797ddc - 5 commits from branch
development
- 2b82bb4d - Merge remote-tracking branch 'origin/development' into MIN-193-display-users-overlays-without-group
- 255a921c - refactor(useroverlays): use common api path endpoint
-
661c54f0...2e797ddc - 5 commits from branch
added 3 commits
-
255a921c...9d60cc66 - 2 commits from branch
development
- 970bd92d - Merge remote-tracking branch 'origin/development' into MIN-193-display-users-overlays-without-group
-
255a921c...9d60cc66 - 2 commits from branch
mentioned in commit db55a1e7