-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #264 from Vizzuality/SKY30-373-fe-carry-forward-fi…
…lters-from-progress-tracker-when-user-navigates-to-the-conservation-builder [SKY30-373] Preserve settings when switching between progress-tracker and conservation builder
- Loading branch information
Showing
4 changed files
with
190 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
export function mapParamsToSearchParams(mapParams) { | ||
const params = JSON.parse(mapParams as string); | ||
const searchParams = new URLSearchParams(); | ||
|
||
if (params?.settings) { | ||
searchParams.set('settings', JSON.stringify(params?.settings || null)); | ||
} | ||
|
||
if (params?.layers) { | ||
searchParams.set('layers', params?.layers); | ||
} | ||
|
||
if (params?.layerSettings) { | ||
searchParams.set('layer-settings', JSON.stringify(params?.layerSettings || null)); | ||
} | ||
|
||
const searchParamsUri = searchParams.toString(); | ||
|
||
return decodeURIComponent(searchParamsUri); | ||
} | ||
|
||
export default mapParamsToSearchParams; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters