Skip to content

Commit 5fd9164

Browse files
fix(docgen-sidebar): modernized blueprint dropdown (DOCGEN-7872) (#4392)
* fix(docgen-sidebar): modernized blueprint dropdown (DOCGEN-7872) * fix(docgen-sidebar): fix file extension (DOCGEN-7872) --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
1 parent 788b32f commit 5fd9164

3 files changed

Lines changed: 76 additions & 4 deletions

File tree

src/elements/content-sidebar/DocGenSidebar/DocGenSidebar.scss

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
overflow: 'auto' 'auto';
3636
}
3737

38+
.bcs-DocGen-tagPath {
39+
padding-left: var(--space-1);
40+
}
41+
3842
.bcs-DocGen-accordion * {
3943
width: auto;
4044
padding: 0;
@@ -47,9 +51,13 @@
4751
}
4852

4953
.bcs-DocGen-collapsible {
50-
padding-top: var(--space-3);
51-
padding-right: var(--space-6);
54+
min-width: 0;
5255
border: none;
56+
width: 100%;
57+
58+
* {
59+
text-transform: unset;
60+
}
5361
}
5462

5563
.bcs-DocGenSidebar-loading {

src/elements/content-sidebar/DocGenSidebar/TagTree.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ const TagTree = ({ data, level = 0 }: TagTreeProps) => {
2525
<Accordion.Item
2626
value={key}
2727
key={`${key}-${level}`}
28-
style={{ paddingLeft: `${level * 12}px` }}
2928
fixed
3029
className="bcs-DocGen-collapsible"
3130
>
@@ -40,7 +39,6 @@ const TagTree = ({ data, level = 0 }: TagTreeProps) => {
4039
value={key}
4140
title={key}
4241
key={`${key}-${level}`}
43-
style={{ paddingLeft: `${level * 12}px` }}
4442
className="bcs-DocGen-collapsible"
4543
>
4644
{data[key] && <TagTree data={data[key]} level={level + 1} />}
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
import noop from 'lodash/noop';
2+
import { http, HttpResponse } from 'msw';
3+
import type { HttpHandler } from 'msw';
4+
import type { Meta } from '@storybook/react';
5+
import ContentSidebar from '../../ContentSidebar';
6+
import { mockFileRequest } from '../../stories/__mocks__/ContentSidebarMocks';
7+
import mockDocGenTags from '../../__mocks__/DocGenSidebar.mock';
8+
9+
const defaultArgs = {
10+
detailsSidebarProps: {
11+
hasProperties: true,
12+
hasNotices: true,
13+
hasAccessStats: true,
14+
hasClassification: true,
15+
hasRetentionPolicy: true,
16+
},
17+
features: global.FEATURE_FLAGS,
18+
fileId: global.FILE_ID,
19+
hasActivityFeed: true,
20+
hasMetadata: true,
21+
hasSkills: true,
22+
hasVersions: true,
23+
token: global.TOKEN,
24+
};
25+
26+
const docGenSidebarProps = {
27+
enabled: true,
28+
isDocGenTemplate: true,
29+
checkDocGenTemplate: noop,
30+
getDocGenTags: async () => ({
31+
pagination: {},
32+
data: mockDocGenTags,
33+
}),
34+
};
35+
36+
export const basic = {
37+
args: {
38+
defaultView: 'docgen',
39+
docGenSidebarProps,
40+
},
41+
};
42+
43+
export const withModernizedBlueprint = {
44+
args: {
45+
enableModernizedComponents: true,
46+
defaultView: 'docgen',
47+
docGenSidebarProps,
48+
},
49+
};
50+
51+
const meta: Meta<typeof ContentSidebar> & { parameters: { msw: { handlers: HttpHandler[] } } } = {
52+
title: 'Elements/ContentSidebar/DocGenSidebar',
53+
component: ContentSidebar,
54+
args: defaultArgs,
55+
parameters: {
56+
msw: {
57+
handlers: [
58+
http.get(mockFileRequest.url, () => {
59+
return HttpResponse.json(mockFileRequest.response);
60+
}),
61+
],
62+
},
63+
},
64+
};
65+
66+
export default meta;

0 commit comments

Comments
 (0)