@ -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: {
|
||||
|
Reference in New Issue
Block a user