Skip to content
Snippets Groups Projects

feat(map): context menu

Merged Mateusz Bolewski requested to merge feat/context-menu into development
2 unresolved threads

Task: https://minerva-appunite.atlassian.net/browse/MIN-112?atlOrigin=eyJpIjoiZjNlYTVkYWMxYzc4NDE1ZDgzYTIyMjk1YTI3ZGJlN2EiLCJwIjoiaiJ9

In useOlMapListener I've added listener for context menu. If user click on map with right button, context menu will appear. in onMapRightClick util, we are searching is there any matching bioEntity. If there is, we save it's id and we are looking for UniProtID.

Zrzut_ekranu_2023-12-21_o_01.36.34

Zrzut_ekranu_2023-12-21_o_01.36.44

Test file for ContextMenu.component will be added in next PR.

Edited by Mateusz Bolewski

Merge request reports

Merge request pipeline #83830 passed

Merge request pipeline passed for c9eb1874

Test coverage 91.49% (-0.97%) from 1 job
Approval is optional

Merged by Mateusz BolewskiMateusz Bolewski 1 year ago (Jan 4, 2024 12:39pm UTC)

Merge details

  • Changes merged into development with 33770a77 (commits were squashed).
  • Deleted the source branch.

Pipeline #83868 passed

Pipeline passed for 33770a77 on development

Test coverage 91.56% (-0.97%) from 1 job

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
49 62 // eslint-disable-next-line consistent-return
50 63 return () => unByKey(key);
51 64 }, [mapInstance, handleMapSingleClick]);
65
66 useEffect(() => {
  • When you add listener in useEffect hook you need to remove it at the end. Otherwise it would cause memory leaks:

    useEffect(()=>{ ... return () => { document.removeEventListener('contextmenu',...); }; },[])

  • Please register or sign in to reply
  • LGTM

    Memory leak in useEffect is RFC from my side

  • added 1 commit

    • 8fd53ab6 - feat(map): code review fixes

    Compare with previous version

  • Mateusz Bolewski added 5 commits

    added 5 commits

    Compare with previous version

  • Mateusz Bolewski added 2 commits

    added 2 commits

    • fbc85f66 - feat(map): package-lock update
    • 51305042 - feat(map): package lock update

    Compare with previous version

  • 1 import { contextMenuSelector } from '@/redux/contextMenu/contextMenu.selector';
    2 import { useAppSelector } from '@/redux/hooks/useAppSelector';
    3 import React from 'react';
    4 import { twMerge } from 'tailwind-merge';
    5 import { searchedBioEntityElementUniProtIdSelector } from '@/redux/bioEntity/bioEntity.selectors';
    6 import { FIRST_ARRAY_ELEMENT, SECOND_ARRAY_ELEMENT } from '@/constants/common';
    7
    8 export const ContextMenu = (): React.ReactNode => {
  • Adrian Orłów approved this merge request

    approved this merge request

  • Adrian Orłów added 2 commits

    added 2 commits

    Compare with previous version

  • Mateusz Bolewski mentioned in commit 33770a77

    mentioned in commit 33770a77

  • Please register or sign in to reply
    Loading