Skip to content
Snippets Groups Projects

feat: Add summary overlays with named elements (MIN-315)

3 unresolved threads

Closes MIN-315

Objective:

Implement summary overlays with named elements for submap links.

What has been done:

  • providing overlay element name
  • optional grouping of overlays summaries
  • selecting unique overlay summary elements
  • unit tests

image

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
11
12 export const GroupedOverlayAxes = ({ overlay, axes }: Props): JSX.Element | null => {
13 const { idObject, name } = overlay;
14 const overlayAxes = axes.filter(axis => axis.overlayId === idObject);
15
16 if (overlayAxes.length === SIZE_OF_EMPTY_ARRAY) {
17 return null;
18 }
19
20 return (
21 <div className="flex flex-col gap-2 rounded-lg border border-divide p-4">
22 <div className="font-bold" data-testid="grouped-overlay-title">
23 {name}
24 </div>
25 <div className="my-1 h-[1px] w-full bg-divide" />
26 {getAxesSortedByValue(overlayAxes).map(axis => (
  • 8 if (axes.length === ZERO) {
    15 export const OverlayData = ({
    16 isShowGroupedOverlays = false,
    17 isShowOverlayBioEntityName = false,
    18 }: Props = {}): JSX.Element | null => {
    19 const axes = useOverlaysAxes({ isShowOverlayBioEntityName });
    20 const uniqueAxes = getUniqueAxes(axes);
    21 const openedOverlays = useSelector(overlaysOpenedSelector);
    22
    23 if (uniqueAxes.length === ZERO) {
    9 24 return null;
    10 25 }
    11 26
    27 const overlaysAxesContent = (
    28 <div className="flex flex-col gap-2 rounded-lg border border-divide p-4">
    29 {getAxesSortedByValue(uniqueAxes).map(axis => (
  • 1 import { ZERO } from '@/constants/common';
    2 import { OverlayDataAxis } from '../OverlayData.types';
    3
    4 export const getAxesSortedByValue = (axes: OverlayDataAxis[]): OverlayDataAxis[] =>
    5 axes.sort((a, b) => (b?.value || ZERO) - (a?.value || ZERO));
  • LGTM, No Tests RFCs due to lack of time.

  • mateusz-winiarczyk approved this merge request

    approved this merge request

  • Adrian Orłów added 1 commit

    added 1 commit

    Compare with previous version

  • Adrian Orłów reset approvals from @mateusz-winiarczyk by pushing to the branch

    reset approvals from @mateusz-winiarczyk by pushing to the branch

  • Adrian Orłów enabled an automatic merge when the pipeline for 4f8bc229 succeeds

    enabled an automatic merge when the pipeline for 4f8bc229 succeeds

  • merged

  • Adrian Orłów mentioned in commit d7527586

    mentioned in commit d7527586

  • Please register or sign in to reply
    Loading