Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EuiCommentEvent] Restore child classNames removed in Emotion conversion #6089

Merged
merged 7 commits into from
Aug 1, 2022
Merged
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
33 changes: 19 additions & 14 deletions src/components/comment_list/__snapshots__/comment.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ exports[`EuiComment is rendered 1`] = `
>
<div
class="euiCommentEvent emotion-euiCommentEvent-custom"
data-type="custom"
/>
</div>
</li>
Expand Down Expand Up @@ -63,26 +64,27 @@ exports[`EuiComment props event is rendered 1`] = `
>
<div
class="euiCommentEvent emotion-euiCommentEvent-update"
data-type="update"
>
<div
class="emotion-euiCommentEvent__header"
class="euiCommentEvent__header emotion-euiCommentEvent__header"
>
<div
class="euiPanel euiPanel--transparent emotion-euiPanel-grow-m-transparent-euiCommentEvent__headerPanel"
class="euiPanel euiPanel--transparent emotion-euiPanel-grow-m-transparent"
>
<div
class="emotion-euiCommentEvent__headerMain"
class="euiCommentEvent__headerMain emotion-euiCommentEvent__headerMain"
>
<div
class="emotion-euiCommentEvent__headerData"
class="euiCommentEvent__headerData emotion-euiCommentEvent__headerData"
>
<div
class="emotion-euiCommentEvent__headerUsername"
class="euiCommentEvent__headerUsername emotion-euiCommentEvent__headerUsername"
>
someuser
</div>
<div
class="emotion-euiCommentEvent__headerEvent"
class="euiCommentEvent__headerEvent emotion-euiCommentEvent__headerEvent"
>
commented
</div>
Expand Down Expand Up @@ -123,26 +125,27 @@ exports[`EuiComment props timestamp is rendered 1`] = `
>
<div
class="euiCommentEvent emotion-euiCommentEvent-update"
data-type="update"
>
<div
class="emotion-euiCommentEvent__header"
class="euiCommentEvent__header emotion-euiCommentEvent__header"
>
<div
class="euiPanel euiPanel--transparent emotion-euiPanel-grow-m-transparent-euiCommentEvent__headerPanel"
class="euiPanel euiPanel--transparent emotion-euiPanel-grow-m-transparent"
>
<div
class="emotion-euiCommentEvent__headerMain"
class="euiCommentEvent__headerMain emotion-euiCommentEvent__headerMain"
chandlerprall marked this conversation as resolved.
Show resolved Hide resolved
>
<div
class="emotion-euiCommentEvent__headerData"
class="euiCommentEvent__headerData emotion-euiCommentEvent__headerData"
>
<div
class="emotion-euiCommentEvent__headerUsername"
class="euiCommentEvent__headerUsername emotion-euiCommentEvent__headerUsername"
>
someuser
</div>
<div
class="emotion-euiCommentEvent__headerTimestamp"
class="euiCommentEvent__headerTimestamp"
>
<time>
21 days ago
Expand Down Expand Up @@ -185,9 +188,10 @@ exports[`EuiComment renders a body 1`] = `
>
<div
class="euiCommentEvent emotion-euiCommentEvent-custom"
data-type="custom"
>
<div
class="emotion-euiCommentEvent__body-custom"
class="euiCommentEvent__body emotion-euiCommentEvent__body-custom"
>
<p>
This is the body.
Expand Down Expand Up @@ -226,9 +230,10 @@ exports[`EuiComment renders a timeline icon 1`] = `
>
<div
class="euiCommentEvent emotion-euiCommentEvent-custom"
data-type="custom"
>
<div
class="emotion-euiCommentEvent__body-custom"
class="euiCommentEvent__body emotion-euiCommentEvent__body-custom"
>
<p>
This is the body.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
exports[`EuiCommentEvent is rendered with custom content 1`] = `
<div
class="euiCommentEvent testClass1 testClass2 emotion-euiCommentEvent-custom"
data-type="custom"
>
<div
class="emotion-euiCommentEvent__body-custom"
class="euiCommentEvent__body emotion-euiCommentEvent__body-custom"
>
<p>
Some custom content
Expand All @@ -17,26 +18,27 @@ exports[`EuiCommentEvent is rendered with custom content 1`] = `
exports[`EuiCommentEvent props event is rendered 1`] = `
<div
class="euiCommentEvent emotion-euiCommentEvent-update"
data-type="update"
>
<div
class="emotion-euiCommentEvent__header"
class="euiCommentEvent__header emotion-euiCommentEvent__header"
>
<div
class="euiPanel euiPanel--transparent emotion-euiPanel-grow-m-transparent-euiCommentEvent__headerPanel"
class="euiPanel euiPanel--transparent emotion-euiPanel-grow-m-transparent"
>
<div
class="emotion-euiCommentEvent__headerMain"
class="euiCommentEvent__headerMain emotion-euiCommentEvent__headerMain"
>
<div
class="emotion-euiCommentEvent__headerData"
class="euiCommentEvent__headerData emotion-euiCommentEvent__headerData"
>
<div
class="emotion-euiCommentEvent__headerUsername"
class="euiCommentEvent__headerUsername emotion-euiCommentEvent__headerUsername"
>
someuser
</div>
<div
class="emotion-euiCommentEvent__headerEvent"
class="euiCommentEvent__headerEvent emotion-euiCommentEvent__headerEvent"
>
commented
</div>
Expand All @@ -50,29 +52,31 @@ exports[`EuiCommentEvent props event is rendered 1`] = `
exports[`EuiCommentEvent props eventColor is rendered 1`] = `
<div
class="euiCommentEvent emotion-euiCommentEvent-custom"
data-type="custom"
/>
`;

exports[`EuiCommentEvent props eventIcon and eventIconAriaLabel are rendered 1`] = `
<div
class="euiCommentEvent emotion-euiCommentEvent-update"
data-type="update"
>
<div
class="emotion-euiCommentEvent__header"
class="euiCommentEvent__header emotion-euiCommentEvent__header"
>
<div
class="euiPanel euiPanel--transparent emotion-euiPanel-grow-m-transparent-euiCommentEvent__headerPanel"
class="euiPanel euiPanel--transparent emotion-euiPanel-grow-m-transparent"
>
<div
class="emotion-euiCommentEvent__headerMain"
class="euiCommentEvent__headerMain emotion-euiCommentEvent__headerMain"
>
<div
class="emotion-euiCommentEvent__headerData"
class="euiCommentEvent__headerData emotion-euiCommentEvent__headerData"
>
<div
aria-hidden="false"
aria-label="edit"
class="euiAvatar euiAvatar--s euiAvatar--user emotion-euiAvatar-s-user-subdued-euiCommentEvent__headerEventIcon"
class="euiAvatar euiAvatar--s euiAvatar--user euiCommentEvent__headerEventIcon emotion-euiAvatar-s-user-subdued-euiCommentEvent__headerEventIcon"
role="img"
title="edit"
>
Expand All @@ -82,7 +86,7 @@ exports[`EuiCommentEvent props eventIcon and eventIconAriaLabel are rendered 1`]
/>
</div>
<div
class="emotion-euiCommentEvent__headerUsername"
class="euiCommentEvent__headerUsername emotion-euiCommentEvent__headerUsername"
>
someuser
</div>
Expand All @@ -96,26 +100,27 @@ exports[`EuiCommentEvent props eventIcon and eventIconAriaLabel are rendered 1`]
exports[`EuiCommentEvent props timestamp is rendered 1`] = `
<div
class="euiCommentEvent emotion-euiCommentEvent-update"
data-type="update"
>
<div
class="emotion-euiCommentEvent__header"
class="euiCommentEvent__header emotion-euiCommentEvent__header"
>
<div
class="euiPanel euiPanel--transparent emotion-euiPanel-grow-m-transparent-euiCommentEvent__headerPanel"
class="euiPanel euiPanel--transparent emotion-euiPanel-grow-m-transparent"
>
<div
class="emotion-euiCommentEvent__headerMain"
class="euiCommentEvent__headerMain emotion-euiCommentEvent__headerMain"
>
<div
class="emotion-euiCommentEvent__headerData"
class="euiCommentEvent__headerData emotion-euiCommentEvent__headerData"
>
<div
class="emotion-euiCommentEvent__headerUsername"
class="euiCommentEvent__headerUsername emotion-euiCommentEvent__headerUsername"
>
someuser
</div>
<div
class="emotion-euiCommentEvent__headerTimestamp"
class="euiCommentEvent__headerTimestamp"
>
<time>
21 days ago
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ exports[`EuiCommentList is rendered 1`] = `
>
<div
class="euiCommentEvent emotion-euiCommentEvent-custom"
data-type="custom"
/>
</div>
</li>
Expand Down Expand Up @@ -72,6 +73,7 @@ exports[`EuiCommentList props gutterSize l is rendered 1`] = `
>
<div
class="euiCommentEvent emotion-euiCommentEvent-custom"
data-type="custom"
/>
</div>
</li>
Expand Down Expand Up @@ -110,6 +112,7 @@ exports[`EuiCommentList props gutterSize m is rendered 1`] = `
>
<div
class="euiCommentEvent emotion-euiCommentEvent-custom"
data-type="custom"
/>
</div>
</li>
Expand Down Expand Up @@ -148,6 +151,7 @@ exports[`EuiCommentList props gutterSize xl is rendered 1`] = `
>
<div
class="euiCommentEvent emotion-euiCommentEvent-custom"
data-type="custom"
/>
</div>
</li>
Expand Down
23 changes: 11 additions & 12 deletions src/components/comment_list/comment_event.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,17 @@ export const euiCommentEventStyles = ({ euiTheme }: UseEuiTheme) => ({

export const euiCommentEventHeaderStyles = ({ euiTheme }: UseEuiTheme) => ({
euiCommentEvent__header: css``,
euiCommentEvent__headerPanel: css``,
// types
regular: css`
background: ${euiTheme.colors.lightestShade};
border-bottom: ${euiTheme.border.thin};
padding: ${euiTheme.size.s};
`,
// variants
hasEventColor: css`
padding: 0;
`,
// Children
euiCommentEvent__headerMain: css`
display: flex;
flex: 1;
Expand All @@ -51,22 +61,11 @@ export const euiCommentEventHeaderStyles = ({ euiTheme }: UseEuiTheme) => ({
white-space: pre-wrap;
flex-wrap: wrap;
`,
euiCommentEvent__headerTimestamp: css``,
euiCommentEvent__headerActions: css`
display: flex;
flex-wrap: wrap;
gap: ${euiTheme.size.xs};
`,
// types
regular: css`
background: ${euiTheme.colors.lightestShade};
border-bottom: ${euiTheme.border.thin};
padding: ${euiTheme.size.s};
`,
// variants
hasEventColor: css`
padding: 0;
`,
});

export const euiCommentEventBodyStyles = ({ euiTheme }: UseEuiTheme) => ({
Expand Down
Loading