Skip to content

Commit

Permalink
Sort using unix timestamp value (#43162) (#45934)
Browse files Browse the repository at this point in the history
* Sort using unix timestamp value

* Extract internationalization from react components to function calls.

* Updating Jest snapshots for pipelines table component
  • Loading branch information
ycombinator authored Sep 19, 2019
1 parent dbf7c9d commit fb1d1fa
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 42 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,17 @@

import React from 'react';
import { EuiButton, EuiButtonEmpty, EuiIconTip, EuiInMemoryTable, EuiLink } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { injectI18n, FormattedMessage } from '@kbn/i18n/react';
import { PIPELINE_LIST } from './constants';

function getColumns(openPipeline, clonePipeline) {
return [
{
field: 'id',
name: (
<FormattedMessage
id="xpack.logstash.pipelinesTable.idColumnLabel"
defaultMessage="Id"
/>
name: i18n.translate(
'xpack.logstash.pipelinesTable.idColumnLabel',
{ defaultMessage: 'Id' }
),
sortable: true,
render: (id, { isCentrallyManaged }) => {
Expand All @@ -39,34 +38,28 @@ function getColumns(openPipeline, clonePipeline) {
},
{
field: 'description',
name: (
<FormattedMessage
id="xpack.logstash.pipelinesTable.descriptionColumnLabel"
defaultMessage="Description"
/>
name: i18n.translate(
'xpack.logstash.pipelinesTable.descriptionColumnLabel',
{ defaultMessage: 'Description' }
),
render: description => <span data-test-subj="cellDescription">{description}</span>,
sortable: true,
truncateText: true,
},
{
field: 'lastModifiedHumanized',
name: (
<FormattedMessage
id="xpack.logstash.pipelinesTable.lastModifiedColumnLabel"
defaultMessage="Last Modified"
/>
name: i18n.translate(
'xpack.logstash.pipelinesTable.lastModifiedColumnLabel',
{ defaultMessage: 'Last modified' }
),
render: lastModified => <span data-test-subj="cellLastModified">{lastModified}</span>,
sortable: true,
sortable: ({ lastModified }) => lastModified.valueOf(),
},
{
field: 'username',
name: (
<FormattedMessage
id="xpack.logstash.pipelinesTable.modifiedByColumnLabel"
defaultMessage="Modified By"
/>
name: i18n.translate(
'xpack.logstash.pipelinesTable.modifiedByColumnLabel',
{ defaultMessage: 'Modified by' }
),
render: username => <span data-test-subj="cellUsername">{username}</span>,
sortable: true,
Expand Down

0 comments on commit fb1d1fa

Please sign in to comment.