-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Feature/translate monitoring table #24973
Changes from all commits
c7ec189
fa01b88
70f6c7e
68587a0
42aa7d3
efeaefe
8a054ed
b0d1660
62b6ad1
acbad4b
a850650
0a200ce
b2a8244
b4b979e
d349a4f
77abc02
d3a497b
ae285b9
eb0b9a8
ae38a0c
21bfb81
43139db
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ import { FormattedAlert } from 'plugins/monitoring/components/alerts/formatted_a | |
import { mapSeverity } from 'plugins/monitoring/components/alerts/map_severity'; | ||
import { formatTimestampToDuration } from '../../../common/format_timestamp_to_duration'; | ||
import { formatDateTimeLocal } from '../../../common/formatting'; | ||
import { I18nProvider } from '@kbn/i18n/react'; | ||
|
||
const linkToCategories = { | ||
'elasticsearch/nodes': 'Elasticsearch Nodes', | ||
|
@@ -96,14 +97,16 @@ uiModule.directive('monitoringClusterAlertsListing', kbnUrl => { | |
|
||
scope.$watch('alerts', (alerts = []) => { | ||
const alertsTable = ( | ||
<MonitoringTable | ||
className="alertsTable" | ||
rows={alerts} | ||
placeholder="Filter Alerts..." | ||
filterFields={filterFields} | ||
columns={columns} | ||
rowComponent={alertRowFactory(scope, kbnUrl)} | ||
/> | ||
<I18nProvider> | ||
<MonitoringTable | ||
className="alertsTable" | ||
rows={alerts} | ||
placeholder="Filter Alerts..." | ||
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. Shouldn't this be translated too? 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. |
||
filterFields={filterFields} | ||
columns={columns} | ||
rowComponent={alertRowFactory(scope, kbnUrl)} | ||
/> | ||
</I18nProvider> | ||
); | ||
render(alertsTable, $el[0]); | ||
}); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ import { MonitoringTable } from 'plugins/monitoring/components/table'; | |
import { | ||
EuiLink, | ||
} from '@elastic/eui'; | ||
import { I18nProvider } from '@kbn/i18n/react'; | ||
|
||
const filterFields = [ 'name', 'type', 'version', 'output' ]; | ||
const columns = [ | ||
|
@@ -108,24 +109,26 @@ uiModule.directive('monitoringBeatsListing', (kbnUrl) => { | |
|
||
scope.$watch('data', (data = {}) => { | ||
render(( | ||
<div> | ||
<Stats stats={data.stats} /> | ||
<div className="page-row"> | ||
<MonitoringTable | ||
className="beatsTable" | ||
rows={data.listing} | ||
pageIndex={scope.pageIndex} | ||
filterText={scope.filterText} | ||
sortKey={scope.sortKey} | ||
sortOrder={scope.sortOrder} | ||
onNewState={scope.onNewState} | ||
placeholder="Filter Beats..." | ||
filterFields={filterFields} | ||
columns={columns} | ||
rowComponent={beatRowFactory(scope, kbnUrl)} | ||
/> | ||
<I18nProvider> | ||
<div> | ||
<Stats stats={data.stats} /> | ||
<div className="page-row"> | ||
<MonitoringTable | ||
className="beatsTable" | ||
rows={data.listing} | ||
pageIndex={scope.pageIndex} | ||
filterText={scope.filterText} | ||
sortKey={scope.sortKey} | ||
sortOrder={scope.sortOrder} | ||
onNewState={scope.onNewState} | ||
placeholder="Filter Beats..." | ||
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. Shouldn't this be translated? 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. |
||
filterFields={filterFields} | ||
columns={columns} | ||
rowComponent={beatRowFactory(scope, kbnUrl)} | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
</I18nProvider> | ||
), $el[0]); | ||
}); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ import { MonitoringTable } from 'plugins/monitoring/components/table'; | |
import { Tooltip } from 'plugins/monitoring/components/tooltip'; | ||
import { AlertsIndicator } from 'plugins/monitoring/components/cluster/listing/alerts_indicator'; | ||
import { SORT_ASCENDING } from '../../../../common/constants'; | ||
import { I18nProvider } from '@kbn/i18n/react'; | ||
|
||
const filterFields = [ 'cluster_name', 'status', 'license.type' ]; | ||
const columns = [ | ||
|
@@ -285,19 +286,21 @@ uiModule.directive('monitoringClusterListing', ($injector) => { | |
|
||
scope.$watch('clusters', (clusters = []) => { | ||
const clusterTable = ( | ||
<MonitoringTable | ||
className="clusterTable" | ||
rows={clusters} | ||
pageIndex={scope.pageIndex} | ||
filterText={scope.filterText} | ||
sortKey={scope.sortKey} | ||
sortOrder={scope.sortOrder} | ||
onNewState={scope.onNewState} | ||
placeholder="Filter Clusters..." | ||
filterFields={filterFields} | ||
columns={columns} | ||
rowComponent={clusterRowFactory(scope, globalState, kbnUrl, showLicenseExpiration)} | ||
/> | ||
<I18nProvider> | ||
<MonitoringTable | ||
className="clusterTable" | ||
rows={clusters} | ||
pageIndex={scope.pageIndex} | ||
filterText={scope.filterText} | ||
sortKey={scope.sortKey} | ||
sortOrder={scope.sortOrder} | ||
onNewState={scope.onNewState} | ||
placeholder="Filter Clusters..." | ||
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. Shouldn't this be translated? 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. |
||
filterFields={filterFields} | ||
columns={columns} | ||
rowComponent={clusterRowFactory(scope, globalState, kbnUrl, showLicenseExpiration)} | ||
/> | ||
</I18nProvider> | ||
); | ||
render(clusterTable, $el[0]); | ||
}); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ import { LARGE_ABBREVIATED, LARGE_BYTES } from '../../../../common/formatting'; | |
import { | ||
EuiLink, | ||
} from '@elastic/eui'; | ||
import { I18nProvider } from '@kbn/i18n/react'; | ||
|
||
const filterFields = [ 'job_id', 'state', 'node.name' ]; | ||
const columns = [ | ||
|
@@ -92,20 +93,22 @@ Try changing the filter or time range.` | |
|
||
scope.$watch('jobs', (jobs = []) => { | ||
const mlTable = ( | ||
<MonitoringTable | ||
className="mlJobsTable" | ||
rows={jobs} | ||
pageIndex={scope.pageIndex} | ||
filterText={scope.filterText} | ||
sortKey={scope.sortKey} | ||
sortOrder={scope.sortOrder} | ||
onNewState={scope.onNewState} | ||
placeholder="Filter Jobs..." | ||
filterFields={filterFields} | ||
columns={columns} | ||
rowComponent={jobRowFactory(scope, kbnUrl)} | ||
getNoDataMessage={getNoDataMessage} | ||
/> | ||
<I18nProvider> | ||
<MonitoringTable | ||
className="mlJobsTable" | ||
rows={jobs} | ||
pageIndex={scope.pageIndex} | ||
filterText={scope.filterText} | ||
sortKey={scope.sortKey} | ||
sortOrder={scope.sortOrder} | ||
onNewState={scope.onNewState} | ||
placeholder="Filter Jobs..." | ||
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. Shouldn't this be translated? 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. |
||
filterFields={filterFields} | ||
columns={columns} | ||
rowComponent={jobRowFactory(scope, kbnUrl)} | ||
getNoDataMessage={getNoDataMessage} | ||
/> | ||
</I18nProvider> | ||
); | ||
render(mlTable, $el[0]); | ||
}); | ||
|
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.
Why did you add
intl
if you aren't using it?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.
we add 'intl' here because in the test for SummaryStatus we use 'renderWithIntl'.
https://github.com/elastic/kibana/pull/24973/files#diff-9e2803564a1fa0f70e630c1d9f61814fR29
'renderWithIntl' add 'intl' in the props.
If we don't add 'intl' as argument, 'intl' drops to ...props here https://github.com/elastic/kibana/pull/24973/files#diff-e87682e532627ab40213f0d0af2dbb95R75
and we are getting unexpected result in snapshot.