Skip to content

Commit

Permalink
Update payload which includes filename now
Browse files Browse the repository at this point in the history
  • Loading branch information
ridoo committed Feb 6, 2025
1 parent 60c8de2 commit 34bfde5
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions geonode_mapstore_client/client/js/plugins/LitterAssessment.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,15 @@ function toWmsUrl(wmsLayerOptions, securityToken) {

function LitterAssessment({
enabled,
pk,
resource,
wmsLayers = [],
securityToken,
triggerAiInference,
onClose,
}) {
const pk = resource?.pk
const title = resource?.title

const [models, setModels] = useState({});
const [uischemas, setSchemas] = useState({});
const [jsonSchemas, setJsonSchemas] = useState({});
Expand Down Expand Up @@ -303,7 +306,7 @@ function LitterAssessment({
widgets={widgets}
schema={jsonSchemas[selectedModel] || {}}
uiSchema={uischemas[selectedModel] || {}}
formData={{ imageUrl: wmsLayer, pk, inferenceGroup }}
formData={{ imageUrl: wmsLayer, pk, title, inferenceGroup }}
onSubmit={(e) => triggerAiInference(selectedModel, e)}
onError={log("errors")}
>
Expand Down Expand Up @@ -333,13 +336,13 @@ const LitterAssessmentPlugin = connect(
createSelector(
[
(state) => state?.controls?.rightOverlay?.enabled === "LitterAssessment",
(state) => state?.gnresource?.data.pk || null,
(state) => state?.gnresource?.data || null,
(state) => state.layers,
(state) => state.security,
],
(enabled, pk, layers, security) => ({
(enabled, resource, layers, security) => ({
enabled,
pk,
resource,
wmsLayers:
layers?.flat?.filter(
(l) => l.type === "wms" && (!l.group || l.group !== "background")
Expand Down

0 comments on commit 34bfde5

Please sign in to comment.