Skip to content

Commit

Permalink
Merge pull request #615 from Vizzuality/fix/MARXAN-954/pre-gap-analys…
Browse files Browse the repository at this point in the history
…is-layer

Fix(front):[MARXAN-954][MARXAN-938]
  • Loading branch information
anamontiaga authored Nov 2, 2021
2 parents dad9439 + c7c8df6 commit 1817e1d
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 9 deletions.
12 changes: 6 additions & 6 deletions app/hooks/map/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -438,12 +438,12 @@ export function usePUGridLayer({
layout: {
visibility: getLayerVisibility(PreGapAnalysisVisibility),
},
...runId && {
filter: [
'all',
['in', `-${runId}-`, ['get', 'valuePosition']],
],
},
// ...runId && {
// filter: [
// 'all',
// ['in', `-${runId}-`, ['get', 'valuePosition']],
// ],
// },
paint: {
'fill-color': COLORS.features,
'fill-opacity': [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ export const PlanningAreaGridUploader: React.FC<PlanningAreaGridUploaderProps> =
theme="primary"
size="xl"
type="submit"
onClick={() => setOpened(false)}
>
Save
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export const PlanningAreUploader: React.FC<PlanningAreUploaderProps> = ({
onClose={() => setOpened(false)}
>
<Form
onSubmit={successFile && onUploadSubmit}
onSubmit={onUploadSubmit}
render={({ handleSubmit }) => {
return (
<form onSubmit={handleSubmit}>
Expand Down
9 changes: 8 additions & 1 deletion app/layout/scenarios/show/map/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { useSelector, useDispatch } from 'react-redux';
import { useRouter } from 'next/router';

import { getScenarioSlice } from 'store/slices/scenarios/detail';
import { getScenarioEditSlice } from 'store/slices/scenarios/edit';

import PluginMapboxGl from '@vizzuality/layer-manager-plugin-mapboxgl';
import { LayerManager, Layer } from '@vizzuality/layer-manager-react';
Expand Down Expand Up @@ -47,17 +48,22 @@ export const ScenariosMap: React.FC<ScenariosShowMapProps> = () => {
const { pid, sid } = query;

const scenarioSlice = getScenarioSlice(sid);
getScenarioEditSlice(sid);

const { setLayerSettings } = scenarioSlice.actions;

const {
tab,
subtab,
cache,
selectedSolution,
highlightFeatures,
layerSettings,
} = useSelector((state) => state[`/scenarios/${sid}`]);

const {
cache,
} = useSelector((state) => state[`/scenarios/${sid}/edit`]);

const {
data = {},
} = useProject(pid);
Expand Down Expand Up @@ -172,6 +178,7 @@ export const ScenariosMap: React.FC<ScenariosShowMapProps> = () => {
});

const PUGridLayer = usePUGridLayer({
cache,
active: true,
sid: sid ? `${sid}` : null,
include,
Expand Down
6 changes: 5 additions & 1 deletion app/store/slices/scenarios/detail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ interface ScenarioShowStateProps {
tab: string,
subtab: string,
selectedSolution: Solution,
cache: number;
// FEATURES
highlightFeatures: string[],
// SETTINGS
Expand All @@ -16,6 +17,7 @@ const initialState = {
tab: 'solutions',
subtab: null,
selectedSolution: null,
cache: Date.now(),
// FEATURES
highlightFeatures: [],
// SETTINGS
Expand All @@ -36,7 +38,9 @@ export function getScenarioSlice(id) {
setSelectedSolution: (state, action: PayloadAction<Solution>) => {
state.selectedSolution = action.payload;
},

setCache: (state, action: PayloadAction<number>) => {
state.cache = action.payload;
},
// FEATURES
setHighlightFeatures: (state, action: PayloadAction<string[]>) => {
state.highlightFeatures = action.payload;
Expand Down

2 comments on commit 1817e1d

@vercel
Copy link

@vercel vercel bot commented on 1817e1d Nov 2, 2021

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-storybook – ./app

marxan-storybook.vercel.app
marxan-storybook-git-main-vizzuality1.vercel.app
marxan-storybook-vizzuality1.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 1817e1d Nov 2, 2021

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 – ./app

marxan.vercel.app
marxan-git-main-vizzuality1.vercel.app
marxan-vizzuality1.vercel.app

Please sign in to comment.