-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[Maps] remove toasts for layer add and layer load error #30584
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
Changes from all commits
e17da48
791ff18
63e6dbe
7069f13
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,4 @@ | ||
| @import './gis_map/gis_map'; | ||
| @import './layer_addpanel/layer_addpanel'; | ||
| @import './layer_panel/index'; | ||
| @import './toasts/toasts'; | ||
| @import './widget_overlay/index'; |
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -128,13 +128,29 @@ export function map(state = INITIAL_STATE, action) { | |
| ...state, | ||
| goto: null, | ||
| }; | ||
| case SET_LAYER_ERROR_STATUS: | ||
| const { layerList } = state; | ||
| const layerIdx = getLayerIndex(layerList, action.layerId); | ||
| if (layerIdx === -1) { | ||
| return state; | ||
| } | ||
|
|
||
| return { | ||
| ...state, | ||
| layerList: [ | ||
| ...layerList.slice(0, layerIdx), | ||
| { | ||
| ...layerList[layerIdx], | ||
| __isInErrorState: true, | ||
| __errorMessage: action.errorMessage | ||
| }, | ||
| ...layerList.slice(layerIdx + 1) | ||
| ] | ||
| }; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm wondering if it's time we revisit the |
||
| case LAYER_DATA_LOAD_STARTED: | ||
| return updateWithDataRequest(state, action); | ||
| case SET_LAYER_ERROR_STATUS: | ||
| return setErrorStatus(state, action); | ||
| case LAYER_DATA_LOAD_ERROR: | ||
| const errorRequestResetState = resetDataRequest(state, action); | ||
| return setErrorStatus(errorRequestResetState, action); | ||
| return resetDataRequest(state, action); | ||
| case LAYER_DATA_LOAD_ENDED: | ||
| return updateWithDataResponse(state, action); | ||
| case TOUCH_LAYER: | ||
|
|
@@ -268,15 +284,6 @@ export function map(state = INITIAL_STATE, action) { | |
| } | ||
| } | ||
|
|
||
| function setErrorStatus(state, { layerId, errorMessage }) { | ||
| const tmsErrorLayer = state.layerList.find(({ id }) => id === layerId); | ||
| return tmsErrorLayer | ||
| ? updateLayerInList( | ||
| updateLayerInList(state, tmsErrorLayer.id, '__isInErrorState', true), | ||
| tmsErrorLayer.id, '__errorMessage', errorMessage) | ||
| : state; | ||
| } | ||
|
|
||
| function findDataRequest(layerDescriptor, dataRequestAction) { | ||
|
|
||
| if (!layerDescriptor.__dataRequests) { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shudders that reducer-code ...