Skip to content

Commit

Permalink
Merge pull request #1621 from Vizzuality/MRXN23-555-features-showing-…
Browse files Browse the repository at this point in the history
…legend

FE(fix): show features on gap analysis grid legend
  • Loading branch information
anamontiaga authored Jan 10, 2024
2 parents 6f511b4 + abebad0 commit 29d6cd7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ export const ScenariosFeaturesTargets = ({ onGoBack }: { onGoBack: () => void })
{
onSuccess: async () => {
await queryClient.invalidateQueries(['selected-features', sid]);
await queryClient.invalidateQueries(['pre-gap-analysis', sid]);
},
onSettled: () => {
setSubmitting(false);
Expand Down
13 changes: 2 additions & 11 deletions app/layout/scenarios/edit/map/legend/hooks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { orderBy, sortBy } from 'lodash';

import { useProjectCostSurfaces } from 'hooks/cost-surface';
import { useAllFeatures, useSelectedFeatures } from 'hooks/features';
import { useAllGapAnalysis } from 'hooks/gap-analysis';
import { useAllGapAnalysis, usePreGapAnalysis } from 'hooks/gap-analysis';
import { LEGEND_LAYERS } from 'hooks/map/constants';
import { useProject } from 'hooks/projects';
import { useScenario } from 'hooks/scenarios';
Expand Down Expand Up @@ -378,16 +378,7 @@ export const useGapAnalysisLegend = () => {
(state) => state[`/scenarios/${sid}/edit`]
);

const gapAnalysisQuery = useAllGapAnalysis(sid, {
select: (data) =>
sortBy(
data.map(({ id, featureClassName }) => ({
id,
name: featureClassName,
})),
['name']
),
});
const gapAnalysisQuery = usePreGapAnalysis(sid, {});

return LEGEND_LAYERS['gap-analysis']({
items: gapAnalysisQuery.data,
Expand Down

1 comment on commit 29d6cd7

@vercel
Copy link

@vercel vercel bot commented on 29d6cd7 Jan 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

marxan – ./

marxan-git-develop-vizzuality1.vercel.app
marxan-vizzuality1.vercel.app
marxan23.vercel.app

Please sign in to comment.