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

chore: refactor loaders to hooks #3043

Closed
wants to merge 13 commits into from
37 changes: 23 additions & 14 deletions i18n/en.pot
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,21 @@ msgstr "Group"
msgid "Filters"
msgstr "Filters"

msgid "Selected org units for {{name}}: No coordinates found"
msgstr "Selected org units for {{name}}: No coordinates found"

msgid "{{name}}: No coordinates found"
msgstr "{{name}}: No coordinates found"

msgid "Error: {{message}}"
msgstr "Error: {{message}}"

msgid "No tracked entities found"
msgstr "No tracked entities found"

msgid "No data found"
msgstr "No data found"

msgid "Drill up one level"
msgstr "Drill up one level"

Expand Down Expand Up @@ -1250,14 +1265,8 @@ msgstr "Financial year (Start April)"
msgid "Cancelled"
msgstr "Cancelled"

msgid "{{name}}: No coordinates found"
msgstr "{{name}}: No coordinates found"

msgid "Selected org units: No coordinates found"
msgstr "Selected org units: No coordinates found"

msgid "Error: {{message}}"
msgstr "Error: {{message}}"
msgid "Earth Engine layer"
msgstr "Earth Engine layer"

msgid "You don't have access to this layer data"
msgstr "You don't have access to this layer data"
Expand All @@ -1271,21 +1280,24 @@ msgstr "An unknown error occurred while reading layer data"
msgid "Displaying first {{pageSize}} events out of {{total}}"
msgstr "Displaying first {{pageSize}} events out of {{total}}"

msgid "No data found"
msgstr "No data found"

msgid "Event"
msgstr "Event"

msgid "Facilities"
msgstr "Facilities"

msgid "an error occurred"
msgstr "an error occurred"

msgid "Facilities: No coordinates found"
msgstr "Facilities: No coordinates found"

msgid "Organisation units"
msgstr "Organisation units"

msgid "Org unit layer"
msgstr "Org unit layer"

msgid "Error"
msgstr "Error"

Expand All @@ -1298,9 +1310,6 @@ msgstr "No data"
msgid "Tracked entity"
msgstr "Tracked entity"

msgid "No tracked entities found"
msgstr "No tracked entities found"

msgid "related"
msgstr "related"

Expand Down
4 changes: 0 additions & 4 deletions src/actions/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ export const showEarthEngineValue = (layerId, coordinate) => ({
coordinate,
})

export const clearAlerts = () => ({
type: types.MAP_ALERTS_CLEAR,
})

export const tOpenMap =
({ mapId, defaultBasemap, engine, basemaps }) =>
async (dispatch) => {
Expand Down
57 changes: 0 additions & 57 deletions src/components/alerts/AlertStack.js

This file was deleted.

154 changes: 0 additions & 154 deletions src/components/alerts/__tests__/AlertStack.spec.js

This file was deleted.

This file was deleted.

7 changes: 3 additions & 4 deletions src/components/app/AppLayout.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import cx from 'classnames'
import React, { useState } from 'react'
import { useSelector } from 'react-redux'
import AlertStack from '../alerts/AlertStack.js'
import { useLayersLoader } from '../../hooks/useLayersLoader.js'
import BottomPanel from '../datatable/BottomPanel.js'
import DownloadModeMenu from '../download/DownloadMenubar.js'
import DownloadSettings from '../download/DownloadSettings.js'
import LayerEdit from '../edit/LayerEdit.js'
import LayersPanel from '../layers/LayersPanel.js'
import LayersLoader from '../loaders/LayersLoader.js'
import ContextMenu from '../map/ContextMenu.js'
import MapPosition from '../map/MapPosition.js'
import OpenAsMapDialog from '../openAs/OpenAsMapDialog.js'
Expand All @@ -31,6 +30,8 @@ const AppLayout = () => {
detailsPanelOpen &&
setInterpretationsRenderCount(interpretationsRenderCount + 1)

useLayersLoader()

return (
<>
{downloadModeOpen ? (
Expand All @@ -54,10 +55,8 @@ const AppLayout = () => {
/>
)}
</div>
<LayersLoader />
<ContextMenu />
<LayerEdit />
<AlertStack />
<OpenAsMapDialog />
</>
)
Expand Down
Loading
Loading