From e387160d3e93781fbe06a6463283fc8b55fbcd6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Sandvik?= Date: Mon, 4 Dec 2023 16:36:27 +0100 Subject: [PATCH 01/17] feat: disable download button until map is rendered --- src/components/download/DownloadSettings.js | 37 ++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/src/components/download/DownloadSettings.js b/src/components/download/DownloadSettings.js index b6efedb22..cdbedd756 100644 --- a/src/components/download/DownloadSettings.js +++ b/src/components/download/DownloadSettings.js @@ -13,8 +13,10 @@ import { Checkbox, Help } from '../core/index.js' import LegendLayers from './LegendLayers.js' import NorthArrowPosition from './NorthArrowPosition.js' import styles from './styles/DownloadSettings.module.css' +import { is } from 'cypress/types/bluebird/index.js' const DownloadSettings = () => { + const [isRendered, setIsRendered] = useState(false) const [error, setError] = useState(null) const dispatch = useDispatch() @@ -67,6 +69,35 @@ const DownloadSettings = () => { ) }, [name, description, legendLayers, hasLayers, dispatch]) + useEffect(() => { + const mapElements = document.getElementsByClassName('dhis2-map') + + const observer = new MutationObserver((mutations) => { + mutations.forEach((mutation) => { + if (mutation.attributeName == 'class') { + setIsRendered( + mutation.target.classList.contains('dhis2-map-rendered') + ) + } + }) + }) + + for (let mapEl of mapElements) { + observer.observe(mapEl, { attributes: true }) + } + + return () => { + observer.disconnect() + } + }, [showOverviewMap]) + + useEffect(() => { + if (isRendered) { + console.log('isRendered trigger download') + onDownload() + } + }, [isRendered, onDownload]) + const isSupported = downloadSupport() && !error const isSplitView = !!getSplitViewLayer(mapViews) const showMarginsCheckbox = false // Not in use @@ -205,7 +236,11 @@ const DownloadSettings = () => { : i18n.t('Close')} {isSupported && ( - )} From 9f172b067fcc5d6a6c5f524045d402c45fa333f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Sandvik?= Date: Mon, 4 Dec 2023 17:54:20 +0100 Subject: [PATCH 02/17] chore: code cleaning --- src/components/download/DownloadSettings.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/components/download/DownloadSettings.js b/src/components/download/DownloadSettings.js index cdbedd756..0b1b71006 100644 --- a/src/components/download/DownloadSettings.js +++ b/src/components/download/DownloadSettings.js @@ -13,7 +13,6 @@ import { Checkbox, Help } from '../core/index.js' import LegendLayers from './LegendLayers.js' import NorthArrowPosition from './NorthArrowPosition.js' import styles from './styles/DownloadSettings.module.css' -import { is } from 'cypress/types/bluebird/index.js' const DownloadSettings = () => { const [isRendered, setIsRendered] = useState(false) @@ -83,20 +82,14 @@ const DownloadSettings = () => { }) for (let mapEl of mapElements) { + mapEl.classList.remove('dhis2-map-rendered') observer.observe(mapEl, { attributes: true }) } return () => { observer.disconnect() } - }, [showOverviewMap]) - - useEffect(() => { - if (isRendered) { - console.log('isRendered trigger download') - onDownload() - } - }, [isRendered, onDownload]) + }, []) const isSupported = downloadSupport() && !error const isSplitView = !!getSplitViewLayer(mapViews) From d840c3d87a6045290fb11f6aaa00fe288890d6e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Sandvik?= Date: Mon, 4 Dec 2023 18:03:37 +0100 Subject: [PATCH 03/17] chore: code cleaning --- src/components/download/DownloadSettings.js | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/components/download/DownloadSettings.js b/src/components/download/DownloadSettings.js index 0b1b71006..54c1f4f32 100644 --- a/src/components/download/DownloadSettings.js +++ b/src/components/download/DownloadSettings.js @@ -14,6 +14,11 @@ import LegendLayers from './LegendLayers.js' import NorthArrowPosition from './NorthArrowPosition.js' import styles from './styles/DownloadSettings.module.css' +const mapContainerId = 'dhis2-map-container' +const mapClass = 'dhis2-map' +const renderedClass = 'dhis2-map-rendered' +const downloadingClass = 'dhis2-map-downloading' + const DownloadSettings = () => { const [isRendered, setIsRendered] = useState(false) const [error, setError] = useState(null) @@ -39,17 +44,17 @@ const DownloadSettings = () => { const onDownload = useCallback(() => { const filename = standardizeFilename(getMapName(name), 'png') - let mapEl = document.getElementById('dhis2-map-container') + let mapEl = document.getElementById(mapContainerId) if (includeMargins) { mapEl = mapEl.parentNode } // Temporary added to remove close 'x' from map popups - mapEl.classList.add('dhis2-map-downloading') + mapEl.classList.add(downloadingClass) downloadMapImage(mapEl, filename) - .then(() => mapEl.classList.remove('dhis2-map-downloading')) + .then(() => mapEl.classList.remove(downloadingClass)) .catch(setError) }, [name, includeMargins]) @@ -69,20 +74,21 @@ const DownloadSettings = () => { }, [name, description, legendLayers, hasLayers, dispatch]) useEffect(() => { - const mapElements = document.getElementsByClassName('dhis2-map') + // Multiple map elements if split view + const mapElements = document.getElementsByClassName(mapClass) const observer = new MutationObserver((mutations) => { mutations.forEach((mutation) => { if (mutation.attributeName == 'class') { setIsRendered( - mutation.target.classList.contains('dhis2-map-rendered') + mutation.target.classList.contains(renderedClass) ) } }) }) - for (let mapEl of mapElements) { - mapEl.classList.remove('dhis2-map-rendered') + for (const mapEl of mapElements) { + mapEl.classList.remove(renderedClass) observer.observe(mapEl, { attributes: true }) } From 1dfc9fcdc09e2d8c6afcde232c31cbd8074cb143 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Sandvik?= Date: Mon, 4 Dec 2023 18:05:52 +0100 Subject: [PATCH 04/17] chore: code comment --- src/components/download/DownloadSettings.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/download/DownloadSettings.js b/src/components/download/DownloadSettings.js index 54c1f4f32..dd494056b 100644 --- a/src/components/download/DownloadSettings.js +++ b/src/components/download/DownloadSettings.js @@ -77,6 +77,7 @@ const DownloadSettings = () => { // Multiple map elements if split view const mapElements = document.getElementsByClassName(mapClass) + // Observe is rendered class is added to map element const observer = new MutationObserver((mutations) => { mutations.forEach((mutation) => { if (mutation.attributeName == 'class') { From d3f02cfdb0125d8bab82b18a1e5e442f0644a975 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Sandvik?= Date: Mon, 11 Dec 2023 13:06:33 +0100 Subject: [PATCH 05/17] fix: isPushAnalytics url param --- src/components/download/DownloadSettings.js | 47 ++++++++++++--------- 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/src/components/download/DownloadSettings.js b/src/components/download/DownloadSettings.js index dd494056b..4296db3e8 100644 --- a/src/components/download/DownloadSettings.js +++ b/src/components/download/DownloadSettings.js @@ -6,7 +6,7 @@ import { setDownloadConfig } from '../../actions/download.js' import { standardizeFilename } from '../../util/dataDownload.js' import { downloadMapImage, downloadSupport } from '../../util/export-image.js' import { getSplitViewLayer } from '../../util/helpers.js' -import { closeDownloadMode } from '../../util/history.js' +import { closeDownloadMode, getHashUrlParams } from '../../util/history.js' import { getMapName } from '../app/FileMenu.js' import Drawer from '../core/Drawer.js' import { Checkbox, Help } from '../core/index.js' @@ -20,10 +20,13 @@ const renderedClass = 'dhis2-map-rendered' const downloadingClass = 'dhis2-map-downloading' const DownloadSettings = () => { + const isPushAnalytics = getHashUrlParams('isPushAnalytics') === 'true' const [isRendered, setIsRendered] = useState(false) const [error, setError] = useState(null) const dispatch = useDispatch() + console.log('isPushAnalytics', isPushAnalytics) + const { mapViews, name, description } = useSelector((state) => state.map) const { showName, @@ -74,29 +77,31 @@ const DownloadSettings = () => { }, [name, description, legendLayers, hasLayers, dispatch]) useEffect(() => { - // Multiple map elements if split view - const mapElements = document.getElementsByClassName(mapClass) - - // Observe is rendered class is added to map element - const observer = new MutationObserver((mutations) => { - mutations.forEach((mutation) => { - if (mutation.attributeName == 'class') { - setIsRendered( - mutation.target.classList.contains(renderedClass) - ) - } + if (isPushAnalytics) { + // Multiple map elements if split view + const mapElements = document.getElementsByClassName(mapClass) + + // Observe is rendered class is added to map element + const observer = new MutationObserver((mutations) => { + mutations.forEach((mutation) => { + if (mutation.attributeName == 'class') { + setIsRendered( + mutation.target.classList.contains(renderedClass) + ) + } + }) }) - }) - for (const mapEl of mapElements) { - mapEl.classList.remove(renderedClass) - observer.observe(mapEl, { attributes: true }) - } + for (const mapEl of mapElements) { + mapEl.classList.remove(renderedClass) + observer.observe(mapEl, { attributes: true }) + } - return () => { - observer.disconnect() + return () => { + observer.disconnect() + } } - }, []) + }, [isPushAnalytics]) const isSupported = downloadSupport() && !error const isSplitView = !!getSplitViewLayer(mapViews) @@ -238,7 +243,7 @@ const DownloadSettings = () => { {isSupported && ( ) diff --git a/src/components/download/DownloadSettings.js b/src/components/download/DownloadSettings.js index ba234d3d4..585835723 100644 --- a/src/components/download/DownloadSettings.js +++ b/src/components/download/DownloadSettings.js @@ -243,6 +243,7 @@ const DownloadSettings = () => { primary disabled={isPushAnalytics && !isRendered} onClick={onDownload} + className="push-analytics-download-button" > {i18n.t('Download')} From a09c125c852bf6c1eedb390bcaf4792456459889 Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Wed, 14 Feb 2024 10:39:46 +0100 Subject: [PATCH 11/17] fix: check download param when navigating to new --- src/components/app/useLoadMap.js | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/src/components/app/useLoadMap.js b/src/components/app/useLoadMap.js index 7660df3c0..5e4cbb3b7 100644 --- a/src/components/app/useLoadMap.js +++ b/src/components/app/useLoadMap.js @@ -26,30 +26,36 @@ export const useLoadMap = () => { const loadMap = useCallback( async (hashLocation) => { - previousParamsRef.current = getHashUrlParams(hashLocation) + const params = getHashUrlParams(hashLocation) - if (hashLocation.pathname === '/') { + if (params.mapId === '') { dispatch(newMap()) + if ( + params.isDownload !== previousParamsRef.current.isDownload + ) { + dispatch(setDownloadMode(params.isDownload)) + } + + previousParamsRef.current = params return } - const { mapId, isDownload, interpretationId } = - previousParamsRef.current - - if (mapId === CURRENT_AO_KEY) { + if (params.mapId === CURRENT_AO_KEY) { dispatch(newMap()) dispatch(setAnalyticalObject(true)) - if (isDownload) { + if (params.isDownload) { dispatch(setDownloadMode(true)) } + + previousParamsRef.current = params return } try { - const map = await fetchMap(mapId, engine, defaultBasemap) + const map = await fetchMap(params.mapId, engine, defaultBasemap) engine.mutate(dataStatisticsMutation, { - variables: { id: mapId }, + variables: { id: params.mapId }, onError: (error) => log.error('Error: ', error), }) @@ -66,15 +72,17 @@ export const useLoadMap = () => { }) ) - if (interpretationId) { - dispatch(setInterpretation(interpretationId)) - } else if (isDownload) { + if (params.interpretationId) { + dispatch(setInterpretation(params.interpretationId)) + } else if (params.isDownload) { dispatch(setDownloadMode(true)) } } catch (e) { log.error(e) dispatch(newMap()) + dispatch(setDownloadMode(false)) } + previousParamsRef.current = params }, [basemaps, defaultBasemap, dispatch, engine] ) From fc755036475f1def24fef71780e2facac1b7fffa Mon Sep 17 00:00:00 2001 From: HendrikThePendric Date: Wed, 14 Feb 2024 18:16:55 +0100 Subject: [PATCH 12/17] fix: prevent enabling download button while loading mask is showing --- src/components/download/DownloadSettings.js | 6 +++++- src/components/map/MapLoadingMask.js | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/components/download/DownloadSettings.js b/src/components/download/DownloadSettings.js index 585835723..a6bfd81e7 100644 --- a/src/components/download/DownloadSettings.js +++ b/src/components/download/DownloadSettings.js @@ -10,6 +10,7 @@ import { closeDownloadMode, getHashUrlParam } from '../../util/history.js' import { getMapName } from '../app/FileMenu.js' import Drawer from '../core/Drawer.js' import { Checkbox, Help } from '../core/index.js' +import { loadingMaskClass } from '../map/MapLoadingMask.js' import LegendLayers from './LegendLayers.js' import NorthArrowPosition from './NorthArrowPosition.js' import styles from './styles/DownloadSettings.module.css' @@ -84,7 +85,10 @@ const DownloadSettings = () => { mutations.forEach((mutation) => { if (mutation.attributeName == 'class') { setIsRendered( - mutation.target.classList.contains(renderedClass) + !document.querySelector(`.${loadingMaskClass}`) && + mutation.target.classList.contains( + renderedClass + ) ) } }) diff --git a/src/components/map/MapLoadingMask.js b/src/components/map/MapLoadingMask.js index ce43dd3ec..7cc781260 100644 --- a/src/components/map/MapLoadingMask.js +++ b/src/components/map/MapLoadingMask.js @@ -1,11 +1,14 @@ import { ComponentCover, CenteredContent, CircularLoader } from '@dhis2/ui' +import cx from 'classnames' import React from 'react' import styles from './styles/MapLoadingMask.module.css' +export const loadingMaskClass = 'dhis2-map-loading-mask' + const MapLoadingMask = () => ( From c9470bf2e7c6bc51adb85be08c427a39bb5b94eb Mon Sep 17 00:00:00 2001 From: HendrikThePendric Date: Wed, 14 Feb 2024 18:17:42 +0100 Subject: [PATCH 13/17] fix: add class to map container when no map id is set --- src/components/map/MapPosition.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/map/MapPosition.js b/src/components/map/MapPosition.js index 67a821e5e..e16700206 100644 --- a/src/components/map/MapPosition.js +++ b/src/components/map/MapPosition.js @@ -100,6 +100,7 @@ const MapPosition = () => { className={cx(styles.mapContainer, { [styles.download]: downloadMode, 'dhis2-map-download': downloadMode, + 'dhis2-map-new': !downloadMode && !mapId, })} > From 36a35934c90a93707385aa8ad360c8d66d780a02 Mon Sep 17 00:00:00 2001 From: Joseph John Aas Cooper Date: Fri, 26 Jan 2024 14:04:46 +0100 Subject: [PATCH 14/17] fix: improve hover states and add consistent spacing [UX-161] (#3121) --- src/AppWrapper.js | 7 ++++- .../core/styles/IconButton.module.css | 15 ++++++++-- .../overlays/styles/AddLayerButton.module.css | 12 ++++++-- .../layers/overlays/styles/Layer.module.css | 28 +++++++++++++++---- .../overlays/styles/LayerList.module.css | 4 +-- .../layers/styles/LayerCard.module.css | 12 ++++---- .../layers/styles/LayersPanel.module.css | 5 ++-- .../layers/styles/LayersToggle.module.css | 8 ++++-- .../layers/styles/SortableHandle.module.css | 9 +++++- .../toolbar/styles/LayerToolbar.module.css | 4 +-- .../toolbar/styles/OpacitySlider.module.css | 18 ++++++++++-- 11 files changed, 93 insertions(+), 29 deletions(-) diff --git a/src/AppWrapper.js b/src/AppWrapper.js index 282a0fa8b..3c74bbff4 100644 --- a/src/AppWrapper.js +++ b/src/AppWrapper.js @@ -106,7 +106,12 @@ const AppWrapper = () => { > - + diff --git a/src/components/core/styles/IconButton.module.css b/src/components/core/styles/IconButton.module.css index 29313a7a7..e14ada233 100644 --- a/src/components/core/styles/IconButton.module.css +++ b/src/components/core/styles/IconButton.module.css @@ -1,10 +1,16 @@ .iconButton { - width: var(--spacers-dp32); - height: var(--spacers-dp32); + width: 28px; + height: 28px; cursor: pointer; display: flex; justify-content: center; align-items: center; + background-color: transparent; + border-radius: 5px; +} + +.iconButton:hover { + background-color: var(--colors-grey200); } .iconButton > span { @@ -17,4 +23,9 @@ .icon svg { display: block; + color: var(--colors-grey700); +} + +.iconButton:hover .icon svg { + color: var(--colors-grey900); } diff --git a/src/components/layers/overlays/styles/AddLayerButton.module.css b/src/components/layers/overlays/styles/AddLayerButton.module.css index 529d04c8d..de920d003 100644 --- a/src/components/layers/overlays/styles/AddLayerButton.module.css +++ b/src/components/layers/overlays/styles/AddLayerButton.module.css @@ -17,8 +17,8 @@ color: var(--colors-grey900); cursor: pointer; user-select: none; - padding: 0px 12px; - width: 100% + padding: 0px; + width: 100%; } .content { @@ -27,12 +27,20 @@ padding: var(--spacers-dp4) var(--spacers-dp8); gap: var(--spacers-dp8); } +.content svg { + color: var(--colors-grey700); +} .button:hover:enabled, .button:active { background-color: var(--colors-grey200); } +.button:hover:enabled .content svg, +.button:active .content svg { + color: var(--colors-grey900); +} + .button:focus { outline: 3px solid var(--theme-focus); outline-offset: -3px; diff --git a/src/components/layers/overlays/styles/Layer.module.css b/src/components/layers/overlays/styles/Layer.module.css index f8297abf3..8d5222bde 100644 --- a/src/components/layers/overlays/styles/Layer.module.css +++ b/src/components/layers/overlays/styles/Layer.module.css @@ -1,10 +1,17 @@ .container { float: left; - width: 120px; - margin-right: var(--spacers-dp16); + width: 128px; + margin-right: var(--spacers-dp4); + margin-bottom: var(--spacers-dp4); + padding: var(--spacers-dp4); cursor: pointer; box-sizing: border-box; - height: 160px; + height: auto; + background-color: transparent; + border-radius: 3px; +} +.container:hover { + background-color: var(--colors-grey100); } .image { @@ -12,6 +19,10 @@ border: 1px solid var(--colors-grey400); width: 120px; height: 120px; + border-radius: 2px; +} +.container:hover .image { + border-color: var(--colors-grey500); } .noImage { @@ -19,20 +30,27 @@ border: 1px solid var(--colors-grey400); width: 120px; height: 120px; + border-radius: 2px; line-height: 120px; background: var(--colors-grey200); - color: var(--colors-grey500); + color: var(--colors-grey600); font-size: 12px; text-align: center; margin-bottom: var(--spacers-dp4); } +.container:hover .noImage { + border-color: var(--colors-grey500); +} .name { font-size: 14px; color: var(--colors-grey800); - padding-bottom: 20px; + padding-bottom: var(--spacers-dp4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; } +.container:hover .name { + color: var(--colors-grey900); +} diff --git a/src/components/layers/overlays/styles/LayerList.module.css b/src/components/layers/overlays/styles/LayerList.module.css index 79ac907ac..4ec3058bb 100644 --- a/src/components/layers/overlays/styles/LayerList.module.css +++ b/src/components/layers/overlays/styles/LayerList.module.css @@ -3,9 +3,9 @@ } .list { - max-width: 696px; + max-width: 684px; max-height: calc(100vh - 150px); - padding: var(--spacers-dp16) 0 0 var(--spacers-dp16); + padding: var(--spacers-dp8) var(--spacers-dp12); overflow-y: auto; } diff --git a/src/components/layers/styles/LayerCard.module.css b/src/components/layers/styles/LayerCard.module.css index cb6aebe71..74905c0fd 100644 --- a/src/components/layers/styles/LayerCard.module.css +++ b/src/components/layers/styles/LayerCard.module.css @@ -1,6 +1,6 @@ .card { position: relative; - margin: var(--spacers-dp8) var(--spacers-dp4) -4px var(--spacers-dp4); + margin: var(--spacers-dp4) var(--spacers-dp4) -2px var(--spacers-dp4); padding-bottom: 0; z-index: 1200; } @@ -53,10 +53,10 @@ .expand { position: absolute; - top: 4px; - right: -4px; - width: 48px; - height: 48px; + top: 11px; + right: 2px; + width: 32px; + height: 32px; padding: 12px; cursor: pointer; } @@ -68,7 +68,7 @@ .collapsibleContent { max-height: 0px; overflow: hidden; - transition: max-height 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms; + transition: max-height 0.2s ease; } .expanded .collapsibleContent { diff --git a/src/components/layers/styles/LayersPanel.module.css b/src/components/layers/styles/LayersPanel.module.css index 7edd3910a..1a46f6ade 100644 --- a/src/components/layers/styles/LayersPanel.module.css +++ b/src/components/layers/styles/LayersPanel.module.css @@ -7,9 +7,8 @@ } .layersPanelInner { - background-color: #f4f6f8; - border-right: 1px solid #e0e0e0; - box-shadow: 1px 0 1px 0 rgba(0, 0, 0, 0.2); + background-color: var(--colors-grey200); + border-right: 1px solid var(--colors-grey400); height: 100%; overflow-y: auto; z-index: 1190; diff --git a/src/components/layers/styles/LayersToggle.module.css b/src/components/layers/styles/LayersToggle.module.css index e4dcfa7a4..f47cba551 100644 --- a/src/components/layers/styles/LayersToggle.module.css +++ b/src/components/layers/styles/LayersToggle.module.css @@ -7,9 +7,11 @@ padding: var(--spacers-dp8) 0; color: var(--colors-grey600); background-color: var(--colors-white); - box-shadow: 3px 1px 5px -1px rgba(0, 0, 0, 0.2); + box-shadow: var(--elevations-e100); z-index: 1100; cursor: pointer; + border-top-right-radius: 3px; + border-bottom-right-radius: 3px; } .layersToggle.collapsed { @@ -17,5 +19,7 @@ } .layersToggle:hover { - background-color: var(--colors-grey100); + background-color: var(--colors-grey050); + color: var(--colors-grey900); + box-shadow: var(--elevations-e200); } diff --git a/src/components/layers/styles/SortableHandle.module.css b/src/components/layers/styles/SortableHandle.module.css index 9aa693612..68395ae56 100644 --- a/src/components/layers/styles/SortableHandle.module.css +++ b/src/components/layers/styles/SortableHandle.module.css @@ -1,7 +1,14 @@ .handle { position: absolute; left: var(--spacers-dp4); - top: var(--spacers-dp16); + top: 15px; + width: 24px; + height: 24px; + border-radius: 3px; color: var(--colors-grey600); cursor: ns-resize; } +.handle:hover { + background-color: var(--colors-grey200); + color: var(--colors-grey900); +} diff --git a/src/components/layers/toolbar/styles/LayerToolbar.module.css b/src/components/layers/toolbar/styles/LayerToolbar.module.css index 1ca6c3a28..4c51cf99d 100644 --- a/src/components/layers/toolbar/styles/LayerToolbar.module.css +++ b/src/components/layers/toolbar/styles/LayerToolbar.module.css @@ -2,14 +2,14 @@ position: relative; height: var(--spacers-dp32); min-height: var(--spacers-dp32); - padding: 0 var(--spacers-dp8); + padding: 2px var(--spacers-dp8); border-top: 1px solid var(--colors-grey300); color: var(--colors-grey600); } .spacer { float: left; - height: var(--spacers-dp32); + height: 28px; width: var(--spacers-dp8); } diff --git a/src/components/layers/toolbar/styles/OpacitySlider.module.css b/src/components/layers/toolbar/styles/OpacitySlider.module.css index c7c42a871..347b619c2 100644 --- a/src/components/layers/toolbar/styles/OpacitySlider.module.css +++ b/src/components/layers/toolbar/styles/OpacitySlider.module.css @@ -1,6 +1,6 @@ .container { width: 100px; - height: var(--spacers-dp32); + height: 28px; display: flex; justify-content: center; align-items: center; @@ -17,23 +17,35 @@ cursor: pointer; } +.slider:disabled { + cursor: not-allowed; +} + .slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 12px; height: 12px; - background: var(--colors-grey600); + background: var(--colors-grey700); border-radius: 50%; } .slider::-moz-range-thumb { width: 12px; height: 12px; - background: var(--colors-grey600); + background: var(--colors-grey700); border: 0; border-radius: 50%; } +.slider::-webkit-slider-thumb:hover { + background: var(--colors-grey900); +} + +.slider::-moz-range-thumb:hover { + background: var(--colors-grey900); +} + .slider::-moz-focus-outer { border: 0; } From f9943ce2be789dd17f0f6dd889c2546e67e0c93f Mon Sep 17 00:00:00 2001 From: HendrikThePendric Date: Thu, 15 Feb 2024 10:38:19 +0100 Subject: [PATCH 15/17] fix: make `dhis2-map-new` class independent of downloadMode --- src/components/map/MapPosition.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/map/MapPosition.js b/src/components/map/MapPosition.js index e16700206..33df2f167 100644 --- a/src/components/map/MapPosition.js +++ b/src/components/map/MapPosition.js @@ -100,7 +100,7 @@ const MapPosition = () => { className={cx(styles.mapContainer, { [styles.download]: downloadMode, 'dhis2-map-download': downloadMode, - 'dhis2-map-new': !downloadMode && !mapId, + 'dhis2-map-new': !mapId, })} > From efec16c89eee626073d6d0fe0d87fa34745a6a8b Mon Sep 17 00:00:00 2001 From: HendrikThePendric Date: Thu, 29 Feb 2024 15:12:44 +0100 Subject: [PATCH 16/17] feat: add push analytics instructions --- public/push-analytics.json | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 public/push-analytics.json diff --git a/public/push-analytics.json b/public/push-analytics.json new file mode 100644 index 000000000..f94685d0d --- /dev/null +++ b/public/push-analytics.json @@ -0,0 +1,24 @@ +{ + "version": "0.0.1", + "showVisualization": { + "strategy": "navigateToUrl", + "steps": [ + { "goto": "{{appUrl}}/#/{{id}}/download?isPushAnalytics=true" }, + { "waitForSelector": ".push-analytics-download-button:enabled" } + ] + }, + "triggerDownload": { + "strategy": "useUiElements", + "steps": [{ "click": ".push-analytics-download-button" }] + }, + "obtainDownloadArtifact": { + "strategy": "interceptFileDownload" + }, + "clearVisualization": { + "strategy": "navigateToUrl", + "steps": [ + { "goto": "{{appUrl}}/#/" }, + { "waitForSelector": ".dhis2-map-new .dhis2-map-rendered" } + ] + } +} From dd0781a022f3bac82629b071ae4172310349fbf4 Mon Sep 17 00:00:00 2001 From: HendrikThePendric Date: Tue, 5 Mar 2024 13:34:29 +0100 Subject: [PATCH 17/17] chore: upgrade @dhis2/maps-gl --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 9c0b49b25..9e3741499 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "@dhis2/app-service-alerts": "3.9.4", "@dhis2/app-service-datastore": "^1.0.0-beta.3", "@dhis2/d2-i18n": "^1.1.3", - "@dhis2/maps-gl": "^3.8.6", + "@dhis2/maps-gl": "^3.9.0", "@dhis2/ui": "^9.2.0", "@krakenjs/post-robot": "^11.0.0", "@reportportal/agent-js-cypress": "git+https://github.com/dhis2/agent-js-cypress.git#develop", diff --git a/yarn.lock b/yarn.lock index dd4698e72..f2e8054ac 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2243,10 +2243,10 @@ markdown-it "^8.4.2" prop-types "^15.6.2" -"@dhis2/maps-gl@^3.8.6": - version "3.8.6" - resolved "https://registry.yarnpkg.com/@dhis2/maps-gl/-/maps-gl-3.8.6.tgz#eace04fca9bb5d4cc24ca3fcebb4c13e3f8a6422" - integrity sha512-9jVfPczgT9MZrU/Cm5ksSjVnUV8/sPOdcaRVLj/nusDMOUVJ23Bt6/U6Gd6SOu/XPk8pWAi9dwyOF1p5pB8L7g== +"@dhis2/maps-gl@^3.9.0": + version "3.9.0" + resolved "https://registry.yarnpkg.com/@dhis2/maps-gl/-/maps-gl-3.9.0.tgz#124f560eaa2107c7b0555b47d7b88533ebdca9e5" + integrity sha512-bGxBsiTRktUihyM4epcYGl1joJe5RG/r0HOHicU4UaxJLU7t8f1b9VVW18hp9TWyinjMUMmaorIu+dwOgFg/MA== dependencies: "@mapbox/sphericalmercator" "^1.2.0" "@turf/area" "^6.5.0"