Skip to content
Snippets Groups Projects

feat(userOverlays): display users overlays without group (MIN-193)

5 unresolved threads

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.

useroverlays

Edited by mateusz-winiarczyk

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
1 <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
  • 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());
  • Adrian Orłów
  • 1 export const ACTION_TYPES = ['Edit', 'Download'];
  • 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'}
  • 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]));
  • Adrian Orłów
  • LGTM

    Overall great solution, good job!

    Please explain more how updateUserOverlaysOrder works in one of the comments

    RFC: JSON.parse... comment

  • Adrian Orłów approved this merge request

    approved this merge request

  • added 1 commit

    • 661c54f0 - refactor(useroverlays): extract icons to reusable file refactor updating overlays

    Compare with previous version

  • 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

    Compare with previous version

  • added 3 commits

    Compare with previous version

  • mentioned in commit db55a1e7

  • Please register or sign in to reply
    Loading