Persist pluginOptions search

Signed-off-by: soupette <cyril.lpz@gmail.com>
This commit is contained in:
soupette 2021-03-12 10:17:00 +01:00
parent 9a510f4e1f
commit 659c85923a

View File

@ -8,6 +8,7 @@ import { useHistory, useLocation } from 'react-router-dom';
import { Header } from '@buffetjs/custom'; import { Header } from '@buffetjs/custom';
import { Flex, Padded } from '@buffetjs/core'; import { Flex, Padded } from '@buffetjs/core';
import isEqual from 'react-fast-compare'; import isEqual from 'react-fast-compare';
import { stringify } from 'qs';
import { import {
PopUpWarning, PopUpWarning,
request, request,
@ -296,6 +297,7 @@ function ListView({
emitEventRef.current('willCreateEntry', trackerProperty); emitEventRef.current('willCreateEntry', trackerProperty);
push({ push({
pathname: `${pathname}/create`, pathname: `${pathname}/create`,
search: query.pluginOptions ? stringify(query.pluginOptions, { encode: false }) : '',
}); });
}, },
color: 'primary', color: 'primary',
@ -308,7 +310,7 @@ function ListView({
}, },
}, },
]; ];
}, [label, pathname, canCreate, formatMessage, hasDraftAndPublish, push]); }, [label, pathname, canCreate, formatMessage, hasDraftAndPublish, push, query]);
const headerProps = useMemo(() => { const headerProps = useMemo(() => {
/* eslint-disable indent */ /* eslint-disable indent */