Merge branch 'main' into next

This commit is contained in:
Daniel Lautzenheiser 2023-03-31 14:10:40 -04:00
commit f07b9489f1
5 changed files with 10 additions and 9 deletions

View File

@ -1,5 +1,5 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"useWorkspaces": true,
"version": "1.2.13"
"version": "1.2.14"
}

View File

@ -1,6 +1,6 @@
{
"name": "@staticcms/app",
"version": "1.2.13",
"version": "1.2.14",
"license": "MIT",
"description": "Static CMS application.",
"repository": "https://github.com/StaticJsCMS/static-cms",
@ -35,7 +35,7 @@
"@babel/eslint-parser": "7.21.3",
"@babel/runtime": "7.21.0",
"@emotion/babel-preset-css-prop": "11.10.0",
"@staticcms/core": "^1.2.13",
"@staticcms/core": "^1.2.14",
"buffer": "6.0.3",
"react": "18.2.0",
"react-dom": "18.2.0",

View File

@ -1,6 +1,6 @@
{
"name": "@staticcms/core",
"version": "1.2.13",
"version": "1.2.14",
"license": "MIT",
"description": "Static CMS core application.",
"repository": "https://github.com/StaticJsCMS/static-cms",

View File

@ -55,8 +55,8 @@ function CollectionSearchRedirect() {
}
function EditEntityRedirect() {
const { name, entryName } = useParams();
return <Navigate to={`/collections/${name}/entries/${entryName}`} />;
const { name, ...params } = useParams();
return <Navigate to={`/collections/${name}/entries/${params['*']}`} />;
}
const App = ({
@ -214,9 +214,9 @@ const App = ({
path="/collections/:name/search/:searchTerm"
element={<CollectionRoute isSearchResults isSingleSearchResult />}
/>
<Route path="/collections/:name/filter/:filterTerm" element={<CollectionRoute />} />
<Route path="/collections/:name/filter/*" element={<CollectionRoute />} />
<Route path="/search/:searchTerm" element={<CollectionRoute isSearchResults />} />
<Route path="/edit/:name/:entryName" element={<EditEntityRedirect />} />
<Route path="/edit/:name/*" element={<EditEntityRedirect />} />
<Route path="/page/:id" element={<Page />} />
<Route path="/media" element={<MediaPage />} />
<Route element={<NotFoundPage />} />

View File

@ -16,7 +16,8 @@ interface CollectionRouteProps {
}
const CollectionRoute = ({ isSearchResults, isSingleSearchResult }: CollectionRouteProps) => {
const { name, searchTerm, filterTerm } = useParams();
const { name, searchTerm, ...params } = useParams();
const filterTerm = params['*'];
const collectionSelector = useMemo(() => selectCollection(name), [name]);
const collection = useAppSelector(collectionSelector);