Skip to content

Commit

Permalink
Revert "feat(v2): add option to toggle sidebar category open by defau…
Browse files Browse the repository at this point in the history
…lt (#2613)" (#2644)

This reverts commit 1863a3c.
  • Loading branch information
lex111 authored Apr 22, 2020
1 parent 7d79284 commit 510bec6
Show file tree
Hide file tree
Showing 11 changed files with 3 additions and 176 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,25 @@ module.exports = {
docs: [
{
type: 'category',
collapsed: true,
label: 'level 1',
items: [
'a',
{
type: 'category',
collapsed: true,
label: 'level 2',
items: [
{
type: 'category',
collapsed: true,
label: 'level 3',
items: [
'c',
{
type: 'category',
collapsed: true,
label: 'level 4',
items: [
'd',
{
type: 'category',
collapsed: true,
label: 'deeper more more',
items: ['e'],
},
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ exports[`simple website content 1`] = `
Object {
"docs": Array [
Object {
"collapsed": true,
"items": Array [
Object {
"items": Array [
Expand Down Expand Up @@ -37,7 +36,6 @@ Object {
"type": "category",
},
Object {
"collapsed": true,
"items": Array [
Object {
"href": "/docs/hello",
Expand Down Expand Up @@ -202,7 +200,6 @@ exports[`versioned website content: all sidebars 1`] = `
Object {
"docs": Array [
Object {
"collapsed": true,
"items": Array [
Object {
"href": "/docs/next/foo/bar",
Expand All @@ -214,7 +211,6 @@ Object {
"type": "category",
},
Object {
"collapsed": true,
"items": Array [
Object {
"href": "/docs/next/hello",
Expand All @@ -228,7 +224,6 @@ Object {
],
"version-1.0.0/docs": Array [
Object {
"collapsed": true,
"items": Array [
Object {
"href": "/docs/1.0.0/foo/bar",
Expand All @@ -245,7 +240,6 @@ Object {
"type": "category",
},
Object {
"collapsed": true,
"items": Array [
Object {
"href": "/docs/1.0.0/hello",
Expand All @@ -259,7 +253,6 @@ Object {
],
"version-1.0.1/docs": Array [
Object {
"collapsed": true,
"items": Array [
Object {
"href": "/docs/foo/bar",
Expand All @@ -271,7 +264,6 @@ Object {
"type": "category",
},
Object {
"collapsed": true,
"items": Array [
Object {
"href": "/docs/hello",
Expand All @@ -291,7 +283,6 @@ Object {
"docsSidebars": Object {
"version-1.0.0/docs": Array [
Object {
"collapsed": true,
"items": Array [
Object {
"href": "/docs/1.0.0/foo/bar",
Expand All @@ -308,7 +299,6 @@ Object {
"type": "category",
},
Object {
"collapsed": true,
"items": Array [
Object {
"href": "/docs/1.0.0/hello",
Expand All @@ -335,7 +325,6 @@ Object {
"docsSidebars": Object {
"version-1.0.1/docs": Array [
Object {
"collapsed": true,
"items": Array [
Object {
"href": "/docs/foo/bar",
Expand All @@ -347,7 +336,6 @@ Object {
"type": "category",
},
Object {
"collapsed": true,
"items": Array [
Object {
"href": "/docs/hello",
Expand All @@ -373,7 +361,6 @@ Object {
"docsSidebars": Object {
"docs": Array [
Object {
"collapsed": true,
"items": Array [
Object {
"href": "/docs/next/foo/bar",
Expand All @@ -385,7 +372,6 @@ Object {
"type": "category",
},
Object {
"collapsed": true,
"items": Array [
Object {
"href": "/docs/next/hello",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ exports[`loadSidebars sidebars link 1`] = `
Object {
"docs": Array [
Object {
"collapsed": true,
"items": Array [
Object {
"href": "https://github.com",
Expand All @@ -19,107 +18,30 @@ Object {
}
`;

exports[`loadSidebars sidebars with category.collapsed property 1`] = `
Object {
"docs": Array [
Object {
"collapsed": true,
"items": Array [
Object {
"collapsed": false,
"items": Array [
Object {
"id": "doc1",
"type": "doc",
},
],
"label": "Introduction",
"type": "category",
},
],
"label": "Test",
"type": "category",
},
Object {
"collapsed": true,
"items": Array [
Object {
"collapsed": false,
"items": Array [
Object {
"id": "doc2",
"type": "doc",
},
],
"label": "Powering MDX",
"type": "category",
},
],
"label": "Reference",
"type": "category",
},
],
}
`;

exports[`loadSidebars sidebars with category.collapsed property at first level 1`] = `
Object {
"docs": Array [
Object {
"collapsed": false,
"items": Array [
Object {
"id": "doc1",
"type": "doc",
},
],
"label": "Introduction",
"type": "category",
},
Object {
"collapsed": false,
"items": Array [
Object {
"id": "doc2",
"type": "doc",
},
],
"label": "Powering MDX",
"type": "category",
},
],
}
`;

exports[`loadSidebars sidebars with deep level of category 1`] = `
Object {
"docs": Array [
Object {
"collapsed": true,
"items": Array [
Object {
"id": "a",
"type": "doc",
},
Object {
"collapsed": true,
"items": Array [
Object {
"collapsed": true,
"items": Array [
Object {
"id": "c",
"type": "doc",
},
Object {
"collapsed": true,
"items": Array [
Object {
"id": "d",
"type": "doc",
},
Object {
"collapsed": true,
"items": Array [
Object {
"id": "e",
Expand Down Expand Up @@ -178,7 +100,6 @@ exports[`loadSidebars sidebars with known sidebar item type 1`] = `
Object {
"docs": Array [
Object {
"collapsed": true,
"items": Array [
Object {
"id": "foo/bar",
Expand All @@ -202,7 +123,6 @@ Object {
"type": "category",
},
Object {
"collapsed": true,
"items": Array [
Object {
"id": "hello",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ exports[`docsVersion first time versioning 1`] = `
Object {
"version-1.0.0/docs": Array [
Object {
"collapsed": true,
"items": Array [
Object {
"items": Array [
Expand Down Expand Up @@ -34,7 +33,6 @@ Object {
"type": "category",
},
Object {
"collapsed": true,
"items": Array [
Object {
"id": "version-1.0.0/hello",
Expand All @@ -52,7 +50,6 @@ exports[`docsVersion not the first time versioning 1`] = `
Object {
"version-2.0.0/docs": Array [
Object {
"collapsed": true,
"items": Array [
Object {
"id": "version-2.0.0/foo/bar",
Expand All @@ -63,7 +60,6 @@ Object {
"type": "category",
},
Object {
"collapsed": true,
"items": Array [
Object {
"id": "version-2.0.0/hello",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,19 +126,4 @@ describe('loadSidebars', () => {
const result = loadSidebars(null);
expect(result).toEqual({});
});

test('sidebars with category.collapsed property', async () => {
const sidebarPath = path.join(fixtureDir, 'sidebars-collapsed.json');
const result = loadSidebars([sidebarPath]);
expect(result).toMatchSnapshot();
});

test('sidebars with category.collapsed property at first level', async () => {
const sidebarPath = path.join(
fixtureDir,
'sidebars-collapsed-first-level.json',
);
const result = loadSidebars([sidebarPath]);
expect(result).toMatchSnapshot();
});
});
Loading

0 comments on commit 510bec6

Please sign in to comment.