Skip to content

Commit

Permalink
Fix #10429 error message when using vector data with no wpsUrl defined (
Browse files Browse the repository at this point in the history
#10432)

* Fix #10429 error mesage when using vector data with no wpsUrl defined

* improved logic for misconfigured plugin
  • Loading branch information
MV88 authored Jun 21, 2024
1 parent 0967a50 commit bf8efdd
Showing 1 changed file with 24 additions and 5 deletions.
29 changes: 24 additions & 5 deletions web/client/epics/geoProcessing.js
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ export const runBufferProcessGPTEpic = (action$, store) => action$
const counter = getCounter(layers, GPT_BUFFER_GROUP_ID);
let misconfiguredLayers = [];
if (!layerUrl) {
misconfiguredLayers.push(layer.name + " - " + layer.title);
misconfiguredLayers.push(layer.name === layer.title ? layer.name : layer.name + " - " + layer.title);
}
if (misconfiguredLayers.length) {
return Rx.Observable.of(showErrorNotification({
Expand Down Expand Up @@ -678,12 +678,33 @@ export const runIntersectProcessGPTEpic = (action$, store) => action$
const layer = getLayerFromIdSelector(state, layerId);
const layers = availableLayersSelector(state);
const layerUrl = wpsUrlSelector(state) || head(castArray(layer.url));

const intersectionLayerId = intersectionLayerIdSelector(state);
const intersectionLayer = getLayerFromIdSelector(state, intersectionLayerId);
const intersectionLayerUrl = wpsUrlSelector(state) || head(castArray(intersectionLayer.url));

const sourceFeature = sourceFeatureSelector(state);
const executeOptions = {};
const intersectionFeature = intersectionFeatureSelector(state);
const counter = getCounter(layers, GPT_INTERSECTION_GROUP_ID);
let sourceFC$;
let intersectionFC$;
let misconfiguredLayers = [];
if (!layerUrl) {
misconfiguredLayers.push(layer.name === layer.title ? layer.name : layer.name + " - " + layer.title);
}
if (!intersectionLayerUrl) {
misconfiguredLayers.push(intersectionLayer.name === intersectionLayer.title ? intersectionLayer.name : intersectionLayer.name + " - " + intersectionLayer.title);
}
if (misconfiguredLayers.length) {
return Rx.Observable.of(showErrorNotification({
title: "errorTitleDefault",
message: "GeoProcessing.notifications.errorMissingUrl",
autoDismiss: 6,
position: "tc",
values: {layerName: misconfiguredLayers.join(", ")}
}));
}
if (isEmpty(sourceFeature)) {
sourceFC$ = executeProcess(
layerUrl,
Expand All @@ -699,9 +720,7 @@ export const runIntersectProcessGPTEpic = (action$, store) => action$
} else {
sourceFC$ = Rx.Observable.of(sourceFeature.geometry);
}
const intersectionLayerId = intersectionLayerIdSelector(state);
const intersectionLayer = getLayerFromIdSelector(state, intersectionLayerId);
const intersectionLayerUrl = wpsUrlSelector(state) || head(castArray(intersectionLayer.url));

if (isEmpty(intersectionFeature)) {
intersectionFC$ = executeProcess(
intersectionLayerUrl,
Expand Down Expand Up @@ -849,7 +868,7 @@ export const runIntersectProcessGPTEpic = (action$, store) => action$
})
.catch((e) => {
logError(e);
let misconfiguredLayers = [];
misconfiguredLayers = [];
if (!layerUrl) {
misconfiguredLayers.push(layer.name + " - " + layer.title);
}
Expand Down

0 comments on commit bf8efdd

Please sign in to comment.