Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/elements/content-sidebar/DocGenSidebar/DocGenSidebar.scss
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see quite of few blueprint overrides in this file. in general, we should avoid overriding blueprint because it can potentially lead to issues such as what caused this PR

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let blueprint team know about case issue

Since I am not authorized to merge tin this project, would you mind helping me with that?

Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
overflow: 'auto' 'auto';
}

.bcs-DocGen-tagPath {
padding-left: var(--space-1);
}

.bcs-DocGen-accordion * {
width: auto;
padding: 0;
Expand All @@ -47,9 +51,13 @@
}

.bcs-DocGen-collapsible {
padding-top: var(--space-3);
padding-right: var(--space-6);
min-width: 0;
border: none;
width: 100%;

* {
text-transform: unset;
}
Comment on lines +58 to +60
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which element(s) are we trying to target? we should avoid using a wildcard like this unless necessary

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These dropdown headers ("about") and dropdown items ("item") all should be in the original formating
image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it I see, your change makes sense then. but I also think that we'll need to fix Blueprint eventually because this seems like a weird behavior and has internalization issues

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pyaromchyk-stack could you open an issue for blueprint and let them know there's a concern with setting text-transform: uppercase?

}

.bcs-DocGenSidebar-loading {
Expand Down
2 changes: 0 additions & 2 deletions src/elements/content-sidebar/DocGenSidebar/TagTree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ const TagTree = ({ data, level = 0 }: TagTreeProps) => {
<Accordion.Item
value={key}
key={`${key}-${level}`}
style={{ paddingLeft: `${level * 12}px` }}
fixed
className="bcs-DocGen-collapsible"
>
Expand All @@ -40,7 +39,6 @@ const TagTree = ({ data, level = 0 }: TagTreeProps) => {
value={key}
title={key}
key={`${key}-${level}`}
style={{ paddingLeft: `${level * 12}px` }}
className="bcs-DocGen-collapsible"
>
{data[key] && <TagTree data={data[key]} level={level + 1} />}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import noop from 'lodash/noop';
import { http, HttpResponse } from 'msw';
import type { HttpHandler } from 'msw';
import type { Meta } from '@storybook/react';
import ContentSidebar from '../../ContentSidebar';
import { mockFileRequest } from '../../stories/__mocks__/ContentSidebarMocks';
import mockDocGenTags from '../../__mocks__/DocGenSidebar.mock';

const defaultArgs = {
detailsSidebarProps: {
hasProperties: true,
hasNotices: true,
hasAccessStats: true,
hasClassification: true,
hasRetentionPolicy: true,
},
features: global.FEATURE_FLAGS,
fileId: global.FILE_ID,
hasActivityFeed: true,
hasMetadata: true,
hasSkills: true,
hasVersions: true,
token: global.TOKEN,
};

const docGenSidebarProps = {
enabled: true,
isDocGenTemplate: true,
checkDocGenTemplate: noop,
getDocGenTags: async () => ({
pagination: {},
data: mockDocGenTags,
}),
};

export const basic = {
args: {
defaultView: 'docgen',
docGenSidebarProps,
},
};

export const withModernizedBlueprint = {
args: {
enableModernizedComponents: true,
defaultView: 'docgen',
docGenSidebarProps,
},
};

const meta: Meta<typeof ContentSidebar> & { parameters: { msw: { handlers: HttpHandler[] } } } = {
title: 'Elements/ContentSidebar/DocGenSidebar',
component: ContentSidebar,
args: defaultArgs,
parameters: {
msw: {
handlers: [
http.get(mockFileRequest.url, () => {
return HttpResponse.json(mockFileRequest.response);
}),
],
},
},
};

export default meta;