-
Notifications
You must be signed in to change notification settings - Fork 841
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
Support nodes in EuiBasicTable column headers #1234
Changes from 3 commits
9f46aa7
ba692cf
826410a
355e8ef
3dfbe72
13103a3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -455,7 +455,6 @@ export default class extends Component { | |||||||||
return ( | ||||||||||
<EuiTableRowCell | ||||||||||
key={column.id} | ||||||||||
header={column.label} | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a reason why you removed all these? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry I should have explained this in the PR description. I came across this and noticed that it's not the correct attribute name (it should be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
eui/src/components/table/table_row_cell.js Lines 87 to 90 in 0cf8fde
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Ahhhh that makes much more sense then! @cjcenizal and I were going back and forth on this and assumed it was intended to be an actual
+1 -- I think that could help prevent confusion in the future There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yup what Luke said! I'll put it back in the meantime and add it to the propTypes definition if it's not already there. |
||||||||||
textOnly={false} | ||||||||||
hasActions={true} | ||||||||||
align="right" | ||||||||||
|
@@ -527,7 +526,6 @@ export default class extends Component { | |||||||||
return ( | ||||||||||
<EuiTableRowCell | ||||||||||
key={column.id} | ||||||||||
header={column.label} | ||||||||||
align={column.alignment} | ||||||||||
truncateText={cell && cell.truncateText} | ||||||||||
textOnly={cell ? cell.textOnly : true} | ||||||||||
|
@@ -581,7 +579,6 @@ export default class extends Component { | |||||||||
footers.push( | ||||||||||
<EuiTableFooterCell | ||||||||||
key={`footer_${column.id}`} | ||||||||||
header={column.title} | ||||||||||
align={column.alignment} | ||||||||||
> | ||||||||||
{footer} | ||||||||||
|
@@ -591,7 +588,6 @@ export default class extends Component { | |||||||||
footers.push( | ||||||||||
<EuiTableFooterCell | ||||||||||
key={`footer_empty_${footers.length - 1}`} | ||||||||||
header={column.title} | ||||||||||
align={column.alignment} | ||||||||||
> | ||||||||||
{undefined} | ||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
import React, { | ||
Component | ||
Component, | ||
} from 'react'; | ||
import { formatDate } from '../../../../../src/services/format'; | ||
import { createDataStore } from '../data_store'; | ||
|
||
import { | ||
EuiBasicTable, | ||
EuiLink, | ||
EuiFlexGroup, | ||
EuiFlexItem, | ||
EuiHealth, | ||
EuiIconTip, | ||
EuiLink, | ||
} from '../../../../../src/components'; | ||
|
||
/* | ||
|
@@ -100,27 +103,68 @@ export class Table extends Component { | |
}, { | ||
field: 'github', | ||
name: 'Github', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess you meant to remove this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove what? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
name: ( | ||
<EuiFlexGroup gutterSize="xs" alignItems="center"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add |
||
<EuiFlexItem> | ||
Github | ||
</EuiFlexItem> | ||
|
||
<EuiFlexItem> | ||
<EuiIconTip content="Their mascot is the Octokitty" /> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
), | ||
render: (username) => ( | ||
<EuiLink href={`https://github.com/${username}`} target="_blank"> | ||
{username} | ||
</EuiLink> | ||
) | ||
}, { | ||
field: 'dateOfBirth', | ||
name: 'Date of Birth', | ||
name: ( | ||
<EuiFlexGroup gutterSize="xs" alignItems="center"> | ||
<EuiFlexItem> | ||
Date of Birth | ||
</EuiFlexItem> | ||
|
||
<EuiFlexItem> | ||
<EuiIconTip content="Colloquially known as a 'birthday'" /> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
), | ||
dataType: 'date', | ||
render: (date) => formatDate(date, 'dobLong'), | ||
sortable: true | ||
}, { | ||
field: 'nationality', | ||
name: 'Nationality', | ||
name: ( | ||
<EuiFlexGroup gutterSize="xs" alignItems="center"> | ||
<EuiFlexItem> | ||
Nationality | ||
</EuiFlexItem> | ||
|
||
<EuiFlexItem> | ||
<EuiIconTip content="The nation in which this person resides" /> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
), | ||
render: (countryCode) => { | ||
const country = store.getCountry(countryCode); | ||
return `${country.flag} ${country.name}`; | ||
} | ||
}, { | ||
field: 'online', | ||
name: 'Online', | ||
name: ( | ||
<EuiFlexGroup gutterSize="xs" alignItems="center"> | ||
<EuiFlexItem> | ||
Online | ||
</EuiFlexItem> | ||
|
||
<EuiFlexItem> | ||
<EuiIconTip content="Free to talk or busy with business" /> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
), | ||
dataType: 'boolean', | ||
render: (online) => { | ||
const color = online ? 'success' : 'danger'; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you re-word to be past tense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what you mean, could you give me an example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ha nope!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha thanks, will update.