Skip to content

Commit 1d9efcd

Browse files
committed
fix i18n
1 parent 273cd7b commit 1d9efcd

File tree

8 files changed

+247
-287
lines changed

8 files changed

+247
-287
lines changed

x-pack/plugins/apm/public/components/app/Settings/AgentConfigurations/AgentConfigurationCreateEdit/ServicePage/ServicePage.tsx

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,7 @@
55
* 2.0.
66
*/
77

8-
import {
9-
EuiSpacer,
10-
EuiPanel,
11-
EuiFlexGroup,
12-
EuiFlexItem,
13-
EuiButton,
14-
} from '@elastic/eui';
8+
import { EuiSpacer, EuiFlexGroup, EuiFlexItem, EuiButton } from '@elastic/eui';
159
import React from 'react';
1610
import { i18n } from '@kbn/i18n';
1711
import { isString } from 'lodash';
@@ -99,7 +93,7 @@ export function ServicePage({ newConfig, setNewConfig, onClickNext }: Props) {
9993
);
10094

10195
return (
102-
<EuiPanel hasShadow={false} paddingSize="none">
96+
<>
10397
{/* Service name options */}
10498
<FormRowSelect
10599
title={i18n.translate(
@@ -196,6 +190,6 @@ export function ServicePage({ newConfig, setNewConfig, onClickNext }: Props) {
196190
</EuiButton>
197191
</EuiFlexItem>
198192
</EuiFlexGroup>
199-
</EuiPanel>
193+
</>
200194
);
201195
}

x-pack/plugins/apm/public/components/app/Settings/AgentConfigurations/AgentConfigurationCreateEdit/SettingsPage/SettingsPage.tsx

Lines changed: 52 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import {
1515
EuiForm,
1616
EuiHealth,
1717
EuiLoadingSpinner,
18-
EuiPanel,
1918
EuiSpacer,
2019
EuiStat,
2120
EuiText,
@@ -137,69 +136,65 @@ export function SettingsPage({
137136
}}
138137
>
139138
{/* Selected Service panel */}
140-
<EuiPanel hasShadow={false} paddingSize="none">
141-
<EuiFlexGroup>
142-
<EuiFlexItem>
143-
<EuiStat
144-
titleSize="xs"
145-
title={
146-
isLoading ? '-' : getOptionLabel(newConfig.service.name)
147-
}
148-
description={i18n.translate(
149-
'xpack.apm.agentConfig.chooseService.service.name.label',
150-
{ defaultMessage: 'Service name' }
151-
)}
152-
/>
153-
</EuiFlexItem>
154-
<EuiFlexItem>
155-
<EuiStat
156-
titleSize="xs"
157-
title={
158-
isLoading
159-
? '-'
160-
: getOptionLabel(newConfig.service.environment)
161-
}
162-
description={i18n.translate(
163-
'xpack.apm.agentConfig.chooseService.service.environment.label',
164-
{ defaultMessage: 'Environment' }
165-
)}
166-
/>
167-
</EuiFlexItem>
168-
<EuiFlexItem grow={false}>
169-
{!isEditMode && (
170-
<EuiButton onClick={onClickEdit} iconType="pencil">
171-
{i18n.translate(
172-
'xpack.apm.agentConfig.chooseService.editButton',
173-
{ defaultMessage: 'Edit' }
174-
)}
175-
</EuiButton>
139+
140+
<EuiFlexGroup>
141+
<EuiFlexItem>
142+
<EuiStat
143+
titleSize="xs"
144+
title={isLoading ? '-' : getOptionLabel(newConfig.service.name)}
145+
description={i18n.translate(
146+
'xpack.apm.agentConfig.chooseService.service.name.label',
147+
{ defaultMessage: 'Service name' }
148+
)}
149+
/>
150+
</EuiFlexItem>
151+
<EuiFlexItem>
152+
<EuiStat
153+
titleSize="xs"
154+
title={
155+
isLoading
156+
? '-'
157+
: getOptionLabel(newConfig.service.environment)
158+
}
159+
description={i18n.translate(
160+
'xpack.apm.agentConfig.chooseService.service.environment.label',
161+
{ defaultMessage: 'Environment' }
176162
)}
177-
</EuiFlexItem>
178-
</EuiFlexGroup>
179-
</EuiPanel>
163+
/>
164+
</EuiFlexItem>
165+
<EuiFlexItem grow={false}>
166+
{!isEditMode && (
167+
<EuiButton onClick={onClickEdit} iconType="pencil">
168+
{i18n.translate(
169+
'xpack.apm.agentConfig.chooseService.editButton',
170+
{ defaultMessage: 'Edit' }
171+
)}
172+
</EuiButton>
173+
)}
174+
</EuiFlexItem>
175+
</EuiFlexGroup>
180176

181177
<EuiHorizontalRule />
182178

183179
{/* Settings panel */}
184-
<EuiPanel hasShadow={false} paddingSize="none">
185-
<EuiTitle size="s">
186-
<h3>
187-
{i18n.translate('xpack.apm.agentConfig.settings.title', {
188-
defaultMessage: 'Configuration options',
189-
})}
190-
</h3>
191-
</EuiTitle>
192180

193-
<EuiSpacer size="m" />
181+
<EuiTitle size="s">
182+
<h3>
183+
{i18n.translate('xpack.apm.agentConfig.settings.title', {
184+
defaultMessage: 'Configuration options',
185+
})}
186+
</h3>
187+
</EuiTitle>
194188

195-
{isLoading ? (
196-
<div style={{ textAlign: 'center' }}>
197-
<EuiLoadingSpinner size="m" />
198-
</div>
199-
) : (
200-
renderSettings({ unsavedChanges, newConfig, setNewConfig })
201-
)}
202-
</EuiPanel>
189+
<EuiSpacer size="m" />
190+
191+
{isLoading ? (
192+
<div style={{ textAlign: 'center' }}>
193+
<EuiLoadingSpinner size="m" />
194+
</div>
195+
) : (
196+
renderSettings({ unsavedChanges, newConfig, setNewConfig })
197+
)}
203198
</form>
204199
</EuiForm>
205200
<EuiSpacer size="xxl" />

x-pack/plugins/apm/public/components/app/Settings/ApmIndices/index.tsx

Lines changed: 71 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import {
1313
EuiFlexItem,
1414
EuiForm,
1515
EuiFormRow,
16-
EuiPanel,
1716
EuiSpacer,
1817
EuiText,
1918
EuiTitle,
@@ -194,86 +193,83 @@ export function ApmIndices() {
194193

195194
<EuiSpacer size="m" />
196195

197-
<EuiPanel hasShadow={false} paddingSize="none">
198-
<EuiFlexGroup alignItems="center">
199-
<EuiFlexItem grow={false}>
200-
<EuiForm>
201-
{APM_INDEX_LABELS.map(({ configurationName, label }) => {
202-
const matchedConfiguration = data.apmIndexSettings.find(
203-
({ configurationName: configName }) =>
204-
configName === configurationName
205-
);
206-
const defaultValue = matchedConfiguration
207-
? matchedConfiguration.defaultValue
208-
: '';
209-
const savedUiIndexValue = apmIndices[configurationName] || '';
210-
return (
211-
<EuiFormRow
212-
key={configurationName}
213-
label={label}
214-
helpText={i18n.translate(
215-
'xpack.apm.settings.apmIndices.helpText',
196+
<EuiFlexGroup alignItems="center">
197+
<EuiFlexItem grow={false}>
198+
<EuiForm>
199+
{APM_INDEX_LABELS.map(({ configurationName, label }) => {
200+
const matchedConfiguration = data.apmIndexSettings.find(
201+
({ configurationName: configName }) =>
202+
configName === configurationName
203+
);
204+
const defaultValue = matchedConfiguration
205+
? matchedConfiguration.defaultValue
206+
: '';
207+
const savedUiIndexValue = apmIndices[configurationName] || '';
208+
return (
209+
<EuiFormRow
210+
key={configurationName}
211+
label={label}
212+
helpText={i18n.translate(
213+
'xpack.apm.settings.apmIndices.helpText',
214+
{
215+
defaultMessage:
216+
'Overrides {configurationName}: {defaultValue}',
217+
values: { configurationName, defaultValue },
218+
}
219+
)}
220+
fullWidth
221+
>
222+
<EuiFieldText
223+
disabled={!canSave}
224+
fullWidth
225+
name={configurationName}
226+
placeholder={defaultValue}
227+
value={savedUiIndexValue}
228+
onChange={handleChangeIndexConfigurationEvent}
229+
/>
230+
</EuiFormRow>
231+
);
232+
})}
233+
<EuiSpacer />
234+
<EuiFlexGroup justifyContent="flexEnd">
235+
<EuiFlexItem grow={false}>
236+
<EuiButtonEmpty onClick={refetch}>
237+
{i18n.translate(
238+
'xpack.apm.settings.apmIndices.cancelButton',
239+
{ defaultMessage: 'Cancel' }
240+
)}
241+
</EuiButtonEmpty>
242+
</EuiFlexItem>
243+
<EuiFlexItem grow={false}>
244+
<EuiToolTip
245+
content={
246+
!canSave &&
247+
i18n.translate(
248+
'xpack.apm.settings.apmIndices.noPermissionTooltipLabel',
216249
{
217250
defaultMessage:
218-
'Overrides {configurationName}: {defaultValue}',
219-
values: { configurationName, defaultValue },
251+
"Your user role doesn't have permissions to change APM indices",
220252
}
221-
)}
222-
fullWidth
253+
)
254+
}
255+
>
256+
<EuiButton
257+
fill
258+
onClick={handleApplyChangesEvent}
259+
isLoading={isSaving}
260+
isDisabled={!canSave}
223261
>
224-
<EuiFieldText
225-
disabled={!canSave}
226-
fullWidth
227-
name={configurationName}
228-
placeholder={defaultValue}
229-
value={savedUiIndexValue}
230-
onChange={handleChangeIndexConfigurationEvent}
231-
/>
232-
</EuiFormRow>
233-
);
234-
})}
235-
<EuiSpacer />
236-
<EuiFlexGroup justifyContent="flexEnd">
237-
<EuiFlexItem grow={false}>
238-
<EuiButtonEmpty onClick={refetch}>
239262
{i18n.translate(
240-
'xpack.apm.settings.apmIndices.cancelButton',
241-
{ defaultMessage: 'Cancel' }
263+
'xpack.apm.settings.apmIndices.applyButton',
264+
{ defaultMessage: 'Apply changes' }
242265
)}
243-
</EuiButtonEmpty>
244-
</EuiFlexItem>
245-
<EuiFlexItem grow={false}>
246-
<EuiToolTip
247-
content={
248-
!canSave &&
249-
i18n.translate(
250-
'xpack.apm.settings.apmIndices.noPermissionTooltipLabel',
251-
{
252-
defaultMessage:
253-
"Your user role doesn't have permissions to change APM indices",
254-
}
255-
)
256-
}
257-
>
258-
<EuiButton
259-
fill
260-
onClick={handleApplyChangesEvent}
261-
isLoading={isSaving}
262-
isDisabled={!canSave}
263-
>
264-
{i18n.translate(
265-
'xpack.apm.settings.apmIndices.applyButton',
266-
{ defaultMessage: 'Apply changes' }
267-
)}
268-
</EuiButton>
269-
</EuiToolTip>
270-
</EuiFlexItem>
271-
</EuiFlexGroup>
272-
</EuiForm>
273-
</EuiFlexItem>
274-
</EuiFlexGroup>
275-
<EuiSpacer size="m" />
276-
</EuiPanel>
266+
</EuiButton>
267+
</EuiToolTip>
268+
</EuiFlexItem>
269+
</EuiFlexGroup>
270+
</EuiForm>
271+
</EuiFlexItem>
272+
</EuiFlexGroup>
277273
</>
278274
);
279275
}

x-pack/plugins/apm/public/components/app/Settings/CustomizeUI/CustomLink/index.tsx

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import {
99
EuiFlexGroup,
1010
EuiFlexItem,
11-
EuiPanel,
1211
EuiTitle,
1312
EuiText,
1413
EuiSpacer,
@@ -116,20 +115,18 @@ export function CustomLinkOverview() {
116115

117116
<EuiSpacer size="m" />
118117

119-
<EuiPanel hasShadow={false} paddingSize="none">
120-
{hasValidLicense ? (
121-
showEmptyPrompt ? (
122-
<EmptyPrompt onCreateCustomLinkClick={onCreateCustomLinkClick} />
123-
) : (
124-
<CustomLinkTable
125-
items={customLinks}
126-
onCustomLinkSelected={setCustomLinkSelected}
127-
/>
128-
)
118+
{hasValidLicense ? (
119+
showEmptyPrompt ? (
120+
<EmptyPrompt onCreateCustomLinkClick={onCreateCustomLinkClick} />
129121
) : (
130-
<LicensePrompt text={INVALID_LICENSE} />
131-
)}
132-
</EuiPanel>
122+
<CustomLinkTable
123+
items={customLinks}
124+
onCustomLinkSelected={setCustomLinkSelected}
125+
/>
126+
)
127+
) : (
128+
<LicensePrompt text={INVALID_LICENSE} />
129+
)}
133130
</>
134131
);
135132
}

0 commit comments

Comments
 (0)