Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: earth engine layer json [ee-dev] #2992

Draft
wants to merge 143 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
143 commits
Select commit Hold shift + click to select a range
d157c30
fix: remove fallback coordinate field (DHIS2-8165) (#2575)
turban Apr 24, 2023
00fae56
feat(plugin): send installation status [DHIS2-15097] (#2580)
KaiVandivier May 2, 2023
23efb6b
fix: bumps cli-app-scripts to 10.3.8 for LIBS-499 fix (#2592)
KaiVandivier May 5, 2023
1ff538b
fix(translations): sync translations from transifex (dev)
dhis2-bot Jun 6, 2023
eb2a3bb
docs: move docs to app (#2650)
janhenrikoverland Jun 9, 2023
3fafd45
fix(translations): sync translations from transifex (dev)
dhis2-bot Jun 10, 2023
cd34381
fix(translations): sync translations from transifex (dev)
dhis2-bot Jun 14, 2023
e40dc13
fix(translations): sync translations from transifex (dev)
dhis2-bot Jun 17, 2023
09412e0
docs: maps download and value labels (#2691)
turban Jun 19, 2023
d7172d4
fix(translations): sync translations from transifex (dev)
dhis2-bot Jun 21, 2023
bd9237a
fix(translations): sync translations from transifex (dev)
dhis2-bot Jun 23, 2023
6de79b1
fix: Set rendering strategy to single if not relative period (#2703)
turban Jun 26, 2023
09de660
chore: increase default timeout for DOM activity (#2720)
jenniferarnesen Jun 26, 2023
fd5696d
chore: use 50 second timeout for card title to appear (#2730)
jenniferarnesen Jun 27, 2023
3ba7831
chore: dependency upgrades (#2722)
turban Jun 27, 2023
491548b
fix: keep layer visibility when period is changed (#2705)
turban Jun 27, 2023
9fa4abd
Don't show north arrow for split view maps (#2704)
turban Jun 27, 2023
32578ec
fix: set period for each split view map (#2721)
turban Jun 27, 2023
578a75a
chore: remove target-branch from dependabot config (#2731)
jenniferarnesen Jun 27, 2023
e7d43a8
fix: upgrade landcover dataset (#2732)
turban Jun 28, 2023
b1d349e
chore: increase cypress extended timeout (#2744)
jenniferarnesen Jun 28, 2023
bf5e0b4
fix(translations): sync translations from transifex (dev)
dhis2-bot Jun 29, 2023
d9fc748
fix(translations): sync translations from transifex (dev)
dhis2-bot Jul 4, 2023
523eca7
chore: disable nightly scheduled test run (#2782)
jenniferarnesen Jul 4, 2023
91b8c11
chore: PeriodTypeSelect as functional component (#2926)
turban Aug 8, 2023
199e237
chore: disable earth engine layers
turban Aug 14, 2023
e00958d
feat: load external layers from data store
turban Aug 14, 2023
2ecf26e
feat: earth engine layers from data store
turban Aug 14, 2023
d23588f
feat: ee layer refactor
turban Aug 26, 2023
7cbd464
chore: refactor
turban Aug 28, 2023
79fedec
chore: dynamic filters testing
turban Aug 30, 2023
2bebd2a
chore: disable earth engine layers
turban Aug 14, 2023
2a9eed9
feat: load external layers from data store
turban Aug 14, 2023
ab9b5c9
feat: earth engine layers from data store
turban Aug 14, 2023
3d53926
feat: ee layer refactor
turban Aug 26, 2023
396dfca
chore: refactor
turban Aug 28, 2023
dbc2cee
chore: dynamic filters testing
turban Aug 30, 2023
048784d
chore: dev merge
turban Sep 7, 2023
52006d0
Merge branch 'dev' into feat/custom-ee-layers
turban Sep 7, 2023
35fe040
feat: ee period reducer
turban Sep 11, 2023
95e6803
Merge branch 'dev' into feat/custom-ee-layers
turban Sep 15, 2023
61591fa
Merge branch 'dev' into feat/custom-ee-layers
turban Sep 15, 2023
52a8c01
chore: refactor period type select
turban Sep 16, 2023
26cdcc1
chore: period type select refactor
turban Sep 16, 2023
7584d75
chore: add missing dependency
turban Sep 16, 2023
d5d6dda
chore: add missing dependency
turban Sep 16, 2023
3a5c676
chore: code cleaning
turban Sep 16, 2023
5332da6
chore: hidden periods fix
turban Sep 16, 2023
c95d629
chore: lint fix
turban Sep 16, 2023
bb1509d
chore: period type select refactor
turban Sep 16, 2023
da9ecbd
feat: ee period handling
turban Sep 16, 2023
ce50edf
feat: ee period handling
turban Sep 20, 2023
b1142fd
chore: refactor color scale handling to use arrays
turban Sep 22, 2023
40e70ec
chore: refactor color scale handling to use arrays
turban Sep 22, 2023
543a791
chore: temporary console log to avoid dynamic dep bug
turban Sep 25, 2023
ecfa092
chore: debugging
turban Sep 26, 2023
9b8551f
Period reducer
turban Sep 26, 2023
7cd5114
chore: period type select refactor (#2977)
turban Sep 27, 2023
7f84e89
chore: color scale refactor (#2982)
turban Sep 27, 2023
3decb2b
chore: fixed period select refactor (#2989)
turban Sep 29, 2023
0ffc42b
chore: merge with ee-dev
turban Oct 2, 2023
d7a1b31
fix: merge conflict
turban Oct 2, 2023
6f5fb3d
chore: merge conflict
turban Oct 2, 2023
2ca7552
chore: ee layer json in app
turban Oct 4, 2023
1f569e4
chore: code cleaning
turban Oct 6, 2023
9342874
feat: earth engine layer json
turban Oct 16, 2023
7db74a4
Merge branch 'dev' into ee-dev
turban Oct 16, 2023
282123c
Merge branch 'ee-dev' into feat/ee-layer-json
turban Oct 16, 2023
4e98871
feat: new ee layer
turban Oct 16, 2023
6b36355
feat: air qaulity ee layers
turban Oct 26, 2023
3e3c95a
feat: earth engine layers dialogue
turban Oct 30, 2023
7510d28
chore: translation
turban Nov 1, 2023
5721b42
feat: ee layers dialog
turban Nov 1, 2023
d56dd1e
feat: restrict settings access to maps admin users
turban Nov 1, 2023
a116b65
feat: restrict settings access to maps admin users
turban Nov 1, 2023
7072aae
feat: sentinel-2 imagery from earth engine
turban Nov 2, 2023
4109fcb
chore: merge with dev
turban Nov 3, 2023
d0d73da
chore: merge in ee-dev
turban Nov 3, 2023
9d895ff
chore: merge with ee-dev
turban Nov 3, 2023
eb953c3
chore: refactor
turban Nov 3, 2023
361bbe1
chore: refactor
turban Nov 3, 2023
d5f93aa
chore: ee layers refactor
turban Nov 5, 2023
a53f87e
chore: ee layer refactor
turban Nov 5, 2023
2154093
chore: ee layer refactor
turban Nov 5, 2023
1e1fe0a
chore: ee layer handling refactor
turban Nov 6, 2023
69857e9
chore: ee layer handling refactor
turban Nov 6, 2023
a4d33ac
chore: ee layer refactor
turban Nov 7, 2023
2447905
chore: layer dialog names
turban Nov 7, 2023
a5264df
feat: ee layer style
turban Nov 8, 2023
c54c834
feat: air quality earth engine layers
turban Nov 9, 2023
13d5f7d
chore: ee layers period refactor
turban Nov 10, 2023
d5ecd25
chore: bug fixes
turban Nov 10, 2023
8553545
fix: bug fixes
turban Nov 10, 2023
f14b6a2
chore: ee layers cleaning
turban Nov 11, 2023
08ab92d
fix: ee layer data table
turban Nov 12, 2023
166f876
feat: CHIRPS precipitation layer
turban Nov 15, 2023
efc07d5
chore: code cleaning
turban Nov 16, 2023
30301b9
fix: ee buldings layer style
turban Nov 16, 2023
dd57e4b
fix: ee layer value precision
turban Nov 16, 2023
93259a2
feat: ee layer dialog
turban Nov 17, 2023
fee0422
feat: ee layer masking
turban Nov 25, 2023
2457875
chore: code cleaning
turban Nov 29, 2023
2371d23
chore: remove unused image
turban Nov 29, 2023
7a12279
chore: ee layer thumbs
turban Nov 29, 2023
3bb0708
chore: merge in dev
turban Dec 12, 2023
b8f2f45
chore: merge conflict
turban Dec 12, 2023
ca61c96
fix: system settings after merge
turban Dec 12, 2023
60d98f1
feat: ee layer json
turban Dec 12, 2023
b9fb6f5
feat: ee layer json
turban Dec 12, 2023
d60dc3a
chore: ee layer refactor
turban Dec 12, 2023
e7e3c47
fix: i18n merge conflict
turban Dec 12, 2023
9c7bfda
chore: code cleaning
turban Dec 12, 2023
9e39ee0
chore: code cleaning
turban Dec 12, 2023
c23d2a0
chore: lint fixes
turban Dec 12, 2023
8334c9c
Merge branch 'dev' into ee-dev
turban Dec 20, 2023
7f9bbda
Merge branch 'ee-dev' into chore/ee-refactor
turban Dec 20, 2023
14c37a9
Merge branch 'dev' into ee-dev
turban Dec 20, 2023
5423aee
Merge branch 'ee-dev' into chore/ee-refactor
turban Dec 20, 2023
f6e5d32
chore: code cleaning
turban Dec 20, 2023
a059ced
chore: code cleaning
turban Dec 20, 2023
44c77e5
chore: code cleaning
turban Dec 22, 2023
bb00775
fix: backward compatibility
turban Dec 22, 2023
601d8f2
Code cleaning
turban Dec 22, 2023
b2d6e71
Merge branch 'dev' into ee-dev
turban Jan 25, 2024
716505e
chore: merge in ee-dev
turban Jan 25, 2024
91591d3
fix: proptypes
turban Jan 29, 2024
1c54460
chore: debugging
turban Jan 29, 2024
3a45032
fix: landcover popup values
turban Jan 29, 2024
28abbee
fix: ee data table
turban Jan 29, 2024
7a7290e
fix: ee temperature layer
turban Jan 29, 2024
b7280f9
fix: backward compability
turban Jan 29, 2024
a20ab4e
fix: by year periods
turban Jan 29, 2024
f000105
chore: code cleaning
turban Jan 29, 2024
4020f7e
fix: backward compatibility
turban Jan 29, 2024
42b0e05
chore: removed unused code
turban Jan 29, 2024
889272c
chore: code cleaning
turban Jan 29, 2024
ae472da
chore: merge with chore/ee-refactor
turban Jan 29, 2024
b91b90a
chore: merge conflicts
turban Jan 29, 2024
2b07622
chore: merge with chore/ee-refactor
turban Jan 29, 2024
0ce5272
chore: refactor
turban Jan 29, 2024
a52dae9
chore: refactor
turban Jan 29, 2024
80e0c72
chore: merge in chore/ee-refactor
turban Jan 29, 2024
f8b0b60
chore: refactor
turban Jan 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
497 changes: 315 additions & 182 deletions i18n/en.pot

Large diffs are not rendered by default.

Binary file added public/images/landcover-copernicus.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/nitrogen-dioxide.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/ozone.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/particle-pollution.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/satellite-imagery.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/sulfur-dioxide.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 17 additions & 6 deletions src/actions/layerEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,15 @@ export const setPeriodName = (periodName) => ({
})

// Set period type (thematic)
export const setPeriodType = (periodType, clearPeriod = true) => ({
export const setPeriodType = (periodType, keepPeriod) => ({
type: types.LAYER_EDIT_PERIOD_TYPE_SET,
periodType,
clearPeriod,
keepPeriod,
})

export const setPeriodReducer = (payload) => ({
type: types.LAYER_EDIT_PERIOD_REDUCER_SET,
payload,
})

// Set period (event & thematic)
Expand Down Expand Up @@ -234,10 +239,10 @@ export const setOrgUnitMode = (mode) => ({
payload: mode,
})

// Set layer params (EE)
export const setParams = (params) => ({
type: types.LAYER_EDIT_PARAMS_SET,
payload: params,
// Set layer style (EE)
export const setStyle = (payload) => ({
type: types.LAYER_EDIT_STYLE_SET,
payload,
})

// Set collection filter (EE)
Expand Down Expand Up @@ -358,3 +363,9 @@ export const setNoDataColor = (color) => ({
type: types.LAYER_EDIT_NO_DATA_COLOR_SET,
payload: color,
})

// Set period for EE layer
export const setEarthEnginePeriod = (payload) => ({
type: types.LAYER_EDIT_EARTH_ENGINE_PERIOD_SET,
payload,
})
2 changes: 1 addition & 1 deletion src/components/classification/Classification.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Classification.propTypes = {
setClassification: PropTypes.func.isRequired,
setColorScale: PropTypes.func.isRequired,
classes: PropTypes.number,
colorScale: PropTypes.string,
colorScale: PropTypes.array,
method: PropTypes.number,
}

Expand Down
7 changes: 3 additions & 4 deletions src/components/core/ColorScaleSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@ const ColorScaleSelect = ({ palette, width, onChange, className }) => {
const [isOpen, setIsOpen] = useState(false)
const anchorRef = useRef()

const bins = palette.split(',').length
const bins = palette.length
const scale = getColorScale(palette)

const onColorScaleSelect = (scale) => {
const classes = palette.split(',').length
onChange(getColorPalette(scale, classes))
onChange(getColorPalette(scale, bins))
setIsOpen(false)
}

Expand Down Expand Up @@ -61,7 +60,7 @@ const ColorScaleSelect = ({ palette, width, onChange, className }) => {
}

ColorScaleSelect.propTypes = {
palette: PropTypes.string.isRequired,
palette: PropTypes.array.isRequired,
onChange: PropTypes.func.isRequired,
className: PropTypes.string,
width: PropTypes.number,
Expand Down
2 changes: 1 addition & 1 deletion src/components/core/NumberField.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const NumberField = ({
label={label}
value={Number.isNaN(value) ? '' : String(value)}
disabled={disabled}
onChange={({ value }) => onChange(value)}
onChange={({ value }) => onChange(Number(value))}
/>
</div>
)
Expand Down
9 changes: 7 additions & 2 deletions src/components/datatable/DataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,13 @@ class DataTable extends Component {
return sortDirection === 'ASC' ? a - b : b - a
}

if (a !== undefined) {
// Some values are null
if (
a !== undefined &&
a !== null &&
b !== undefined &&
b !== null
) {
return sortDirection === 'ASC'
? a.localeCompare(b)
: b.localeCompare(a)
Expand Down Expand Up @@ -192,7 +198,6 @@ class DataTable extends Component {
aggregationType,
legend,
} = layer

const isThematic = layerType === THEMATIC_LAYER
const isOrgUnit = layerType === ORG_UNIT_LAYER
const isEvent = layerType === EVENT_LAYER
Expand Down
10 changes: 6 additions & 4 deletions src/components/datatable/EarthEngineColumns.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ const EarthEngineColumns = ({ aggregationType, legend, data }) => {
if (hasClasses(aggregationType) && items) {
const valueFormat = numberPrecision(2)

return items.map(({ id, name }) => (
return items.map(({ value, name }) => (
<Column
key={id}
dataKey={String(id)}
key={value}
dataKey={String(value)}
label={name}
width={100}
className="right"
Expand Down Expand Up @@ -43,7 +43,9 @@ const EarthEngineColumns = ({ aggregationType, legend, data }) => {
<ColumnHeader type="number" {...props} />
)}
cellRenderer={(d) =>
d.cellData !== undefined ? valueFormat(d.cellData) : ''
d.cellData !== undefined && d.cellData !== null
? valueFormat(d.cellData)
: ''
}
/>
)
Expand Down
35 changes: 35 additions & 0 deletions src/components/earthEngine/EarthEngineLayer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import i18n from '@dhis2/d2-i18n'
import PropTypes from 'prop-types'
import React from 'react'
import { Checkbox } from '../core/index.js'
import styles from './styles/EarthEngineLayer.module.css'

const EarthEngineLayer = ({ layer, isAdded, onShow, onHide }) => {
const { layerId, name, img, description, source } = layer

return (
<div
className={styles.layer}
onClick={() => (isAdded ? onHide(layerId) : onShow(layerId))}
>
<Checkbox checked={isAdded} dense={false} onChange={() => {}} />
<img src={img} className={styles.image} />
<div className={styles.layerInfo}>
<h2>{name}</h2>
<p>{description}</p>
<div className={styles.source}>
{i18n.t('Source')}: {source}
</div>
</div>
</div>
)
}

EarthEngineLayer.propTypes = {
isAdded: PropTypes.bool.isRequired,
layer: PropTypes.object.isRequired,
onHide: PropTypes.func.isRequired,
onShow: PropTypes.func.isRequired,
}

export default EarthEngineLayer
58 changes: 58 additions & 0 deletions src/components/earthEngine/EarthEngineModal.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import i18n from '@dhis2/d2-i18n'
import {
Modal,
ModalTitle,
ModalContent,
ModalActions,
Button,
ButtonStrip,
} from '@dhis2/ui'
import PropTypes from 'prop-types'
import React from 'react'
import useEarthEngineLayers from '../../hooks/useEarthEngineLayersStore.js'
import EarthEngineLayer from './EarthEngineLayer.js'
import earthEngineLayers from '../../constants/earthEngineLayers/index.js'

Check failure on line 14 in src/components/earthEngine/EarthEngineModal.js

View workflow job for this annotation

GitHub Actions / lint

`../../constants/earthEngineLayers/index.js` import should occur before import of `../../hooks/useEarthEngineLayersStore.js`
import styles from './styles/EarthEngineModal.module.css'

const layers = earthEngineLayers
.filter((l) => !l.legacy)
.sort((a, b) => a.name.localeCompare(b.name))

const EarthEngineModal = ({ onClose }) => {
const { addedLayers, addLayer, removeLayer } = useEarthEngineLayers()

return (
<Modal large position="middle" dataTest="earthenginemodal">
<ModalTitle>{i18n.t('Configure available layers')}</ModalTitle>
<ModalContent>
<div className={styles.description}>
{i18n.t(
'Choose which layers are available to add to maps. This setting applies to all users.'
)}
</div>
{layers.map((layer) => (
<EarthEngineLayer
key={layer.layerId}
layer={layer}
isAdded={addedLayers.includes(layer.layerId)}
onShow={addLayer}
onHide={removeLayer}
/>
))}
</ModalContent>
<ModalActions>
<ButtonStrip end>
<Button secondary onClick={() => onClose()}>
{i18n.t('Close')}
</Button>
</ButtonStrip>
</ModalActions>
</Modal>
)
}

EarthEngineModal.propTypes = {
onClose: PropTypes.func.isRequired,
}

export default EarthEngineModal
30 changes: 30 additions & 0 deletions src/components/earthEngine/ManageLayersButton.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { useCachedDataQuery } from '@dhis2/analytics'
import i18n from '@dhis2/d2-i18n'
import { Button } from '@dhis2/ui'
import PropTypes from 'prop-types'
import React from 'react'
import { MAPS_ADMIN_AUTHORITY_ID } from '../../constants/settings.js'
import styles from './styles/ManageLayersButton.module.css'

const ManageLayersButton = ({ onClick }) => {
const { currentUser } = useCachedDataQuery()
const isMapsAdmin = currentUser.authorities.has(MAPS_ADMIN_AUTHORITY_ID)

if (!isMapsAdmin) {
return null
}

return (
<div className={styles.button}>
<Button small secondary onClick={onClick}>
{i18n.t('Manage available layers')}
</Button>
</div>
)
}

ManageLayersButton.propTypes = {
onClick: PropTypes.func.isRequired,
}

export default ManageLayersButton
52 changes: 52 additions & 0 deletions src/components/earthEngine/styles/EarthEngineLayer.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
.layer {
display: flex;
align-items: center;
color: var(--colors-grey800);
font-size: 0.9rem;
border: 1px solid var(--colors-grey300);
border-radius: 4px;
padding: var(--spacers-dp16) var(--spacers-dp8);
margin-bottom: var(--spacers-dp8);
margin-right: var(--spacers-dp8);
cursor: pointer;
}

.layer:hover {
border-color: var(--colors-grey400);
}

.layer input {
cursor: pointer;
}

.layer img {
display: block;
box-sizing: border-box;
border: 1px solid var(--colors-grey400);
width: 120px;
height: 120px;
margin-left: var(--spacers-dp16);
margin-right: var(--spacers-dp16);
}

.layerInfo {
align-self: start;
}

.layerInfo h2 {
margin: 0;
padding-top: 2px;
font-size: 0.9rem;
font-weight: 500;
}

.layerInfo p {
color: var(--colors-grey700);
margin: var(--spacers-dp8) 0;
line-height: 1.2rem;
}

.layerInfo .source {
color: var(--colors-grey600);
padding-top: var(--spacers-dp8);
}
10 changes: 10 additions & 0 deletions src/components/earthEngine/styles/EarthEngineModal.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.description {
font-size: 0.9rem;
line-height: 1.5rem;
padding-bottom: var(--spacers-dp12);
}

.layersTable {
border-collapse: collapse;
width: 100%;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.button {
margin-left: var(--spacers-dp16);
margin-bottom: var(--spacers-dp12);
}
23 changes: 7 additions & 16 deletions src/components/edit/LayerEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,11 @@ const layerType = {
}

const layerName = () => ({
event: i18n.t('event'),
trackedEntity: i18n.t('tracked entity'),
facility: i18n.t('facility'),
thematic: i18n.t('thematic'),
orgUnit: i18n.t('org unit'),
earthEngine: i18n.t('Earth Engine'),
event: i18n.t('Event'),
trackedEntity: i18n.t('Tracked entity'),
facility: i18n.t('Facility'),
thematic: i18n.t('Thematic'),
orgUnit: i18n.t('Org unit'),
})

const LayerEdit = ({ layer, addLayer, updateLayer, cancelLayer }) => {
Expand Down Expand Up @@ -80,19 +79,11 @@ const LayerEdit = ({ layer, addLayer, updateLayer, cancelLayer }) => {
return null
}

let name = layerName()[type]

if (type === EARTH_ENGINE_LAYER) {
name = layer.name.toLowerCase()
}

const title = layer.id
? i18n.t('Edit {{name}} layer', { name })
: i18n.t('Add new {{name}} layer', { name })
const name = type === EARTH_ENGINE_LAYER ? layer.name : layerName()[type]

return (
<Modal position="middle" dataTest="layeredit">
<ModalTitle>{title}</ModalTitle>
<ModalTitle>{i18n.t('{{name}} layer', { name })}</ModalTitle>
<ModalContent>
<div className={styles.content}>
<LayerDialog
Expand Down
Loading
Loading