parent
f8603c5d92
commit
88b6c633af
@ -50,7 +50,12 @@ const ErrorCodeBlock = styled.pre`
|
||||
`;
|
||||
|
||||
const getDefaultPath = collections => {
|
||||
return `/collections/${collections.first().get('name')}`;
|
||||
const first = collections.filter(collection => collection.get('hide') !== true).first();
|
||||
if (first) {
|
||||
return `/collections/${first.get('name')}`;
|
||||
} else {
|
||||
throw new Error('Could not find a non hidden collection');
|
||||
}
|
||||
};
|
||||
|
||||
const RouteInCollection = ({ collections, render, ...props }) => {
|
||||
|
@ -133,7 +133,12 @@ class Sidebar extends React.Component {
|
||||
value={query}
|
||||
/>
|
||||
</SearchContainer>
|
||||
<SidebarNavList>{collections.toList().map(this.renderLink)}</SidebarNavList>
|
||||
<SidebarNavList>
|
||||
{collections
|
||||
.toList()
|
||||
.filter(collection => collection.get('hide') !== true)
|
||||
.map(this.renderLink)}
|
||||
</SidebarNavList>
|
||||
</SidebarContainer>
|
||||
);
|
||||
}
|
||||
|
@ -118,6 +118,7 @@ const getConfigSchema = () => ({
|
||||
preview_path_date_field: { type: 'string' },
|
||||
create: { type: 'boolean' },
|
||||
publish: { type: 'boolean' },
|
||||
hide: { type: 'boolean' },
|
||||
editor: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
|
@ -195,6 +195,7 @@ The `collections` setting is the heart of your Netlify CMS configuration, as it
|
||||
* `filter`: optional filter for `folder` collections; details in [Collection Types](../collection-types)
|
||||
* `create`: for `folder` collections only; `true` allows users to create new items in the collection; defaults to `false`
|
||||
* `publish`: for `publish_mode: editorial_workflow` only; `false` hides UI publishing controls for a collection; defaults to `true`
|
||||
* `hide`: `true` hides a collection in the CMS UI; defaults to `false`. Useful when using the relation widget to hide referenced collections.
|
||||
* `delete`: `false` prevents users from deleting items in a collection; defaults to `true`
|
||||
* `extension`: see detailed description below
|
||||
* `format`: see detailed description below
|
||||
|
Loading…
x
Reference in New Issue
Block a user