Skip to content

Commit

Permalink
ml spacing fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
snide committed Sep 13, 2019
1 parent 40596a2 commit 4fd7c62
Show file tree
Hide file tree
Showing 5 changed files with 294 additions and 302 deletions.
Expand Up @@ -15,6 +15,7 @@ import {
EuiForm,
EuiFormRow,
EuiSelect,
EuiSpacer,
} from '@elastic/eui';

import { dictionaryToArray } from '../../../../../../common/types/common';
Expand Down Expand Up @@ -259,16 +260,19 @@ export const PopoverForm: React.SFC<Props> = ({
</EuiFormRow>
)}
{isUnsupportedAgg && (
<EuiCodeEditor
mode="json"
theme="github"
width="100%"
height="200px"
value={JSON.stringify(getEsAggFromGroupByConfig(defaultData), null, 2)}
setOptions={{ fontSize: '12px', showLineNumbers: false }}
isReadOnly
aria-label="Read only code editor"
/>
<Fragment>
<EuiSpacer size="m" />
<EuiCodeEditor
mode="json"
theme="github"
width="100%"
height="200px"
value={JSON.stringify(getEsAggFromGroupByConfig(defaultData), null, 2)}
setOptions={{ fontSize: '12px', showLineNumbers: false }}
isReadOnly
aria-label="Read only code editor"
/>
</Fragment>
)}
<EuiFormRow hasEmptyLabelSpace>
<EuiButton isDisabled={!formValid} onClick={() => onChange(getUpdatedItem())}>
Expand Down
Expand Up @@ -817,6 +817,7 @@ export const StepDefineForm: SFC<Props> = React.memo(({ overrides = {}, onChange
</EuiFormRow>
{!valid && (
<Fragment>
<EuiSpacer size="m" />
<EuiFormHelpText style={{ maxWidth: '320px' }}>
{i18n.translate('xpack.ml.dataframe.stepDefineForm.formHelp', {
defaultMessage:
Expand Down
Expand Up @@ -4,7 +4,6 @@
* you may not use this file except in compliance with the Elastic License.
*/


import { injectI18n, FormattedMessage } from '@kbn/i18n/react';
import React from 'react';

Expand Down Expand Up @@ -38,7 +37,6 @@ function AdvancedSettingsUi({
indexPatternNameError,
intl,
}) {

return (
<React.Fragment>
<EuiFormRow
Expand All @@ -54,19 +52,21 @@ function AdvancedSettingsUi({
<EuiFieldText
placeholder={intl.formatMessage({
id: 'xpack.ml.fileDatavisualizer.advancedImportSettings.indexNamePlaceholder',
defaultMessage: 'index name'
defaultMessage: 'index name',
})}
value={index}
disabled={(initialized === true)}
disabled={initialized === true}
onChange={onIndexChange}
isInvalid={indexNameError !== ''}
aria-label={intl.formatMessage({
id: 'xpack.ml.fileDatavisualizer.advancedImportSettings.indexNameAriaLabel',
defaultMessage: 'Index name, required field'
defaultMessage: 'Index name, required field',
})}
/>
</EuiFormRow>

<EuiSpacer size="m" />

<EuiCheckbox
id="createIndexPattern"
label={
Expand All @@ -75,8 +75,8 @@ function AdvancedSettingsUi({
defaultMessage="Create index pattern"
/>
}
checked={(createIndexPattern === true)}
disabled={(initialized === true)}
checked={createIndexPattern === true}
disabled={initialized === true}
onChange={onCreateIndexPatternChange}
/>

Expand All @@ -89,21 +89,20 @@ function AdvancedSettingsUi({
defaultMessage="Index pattern name"
/>
}
disabled={(createIndexPattern === false || initialized === true)}
disabled={createIndexPattern === false || initialized === true}
isInvalid={indexPatternNameError !== ''}
error={[indexPatternNameError]}
>
<EuiFieldText
disabled={(createIndexPattern === false || initialized === true)}
placeholder={(createIndexPattern === true) ? index : ''}
disabled={createIndexPattern === false || initialized === true}
placeholder={createIndexPattern === true ? index : ''}
value={indexPattern}
onChange={onIndexPatternChange}
isInvalid={indexPatternNameError !== ''}
/>
</EuiFormRow>

<EuiFlexGroup>

<EuiFlexItem>
<IndexSettings
initialized={initialized}
Expand All @@ -127,7 +126,6 @@ function AdvancedSettingsUi({
onChange={onPipelineStringChange}
/>
</EuiFlexItem>

</EuiFlexGroup>
</React.Fragment>
);
Expand All @@ -145,12 +143,12 @@ function IndexSettings({ initialized, data, onChange }) {
defaultMessage="Index settings"
/>
}
disabled={(initialized === true)}
disabled={initialized === true}
fullWidth
>
<MLJobEditor
mode={EDITOR_MODE.JSON}
readOnly={(initialized === true)}
readOnly={initialized === true}
value={data}
height={EDITOR_HEIGHT}
syntaxChecking={false}
Expand All @@ -171,12 +169,12 @@ function Mappings({ initialized, data, onChange }) {
defaultMessage="Mappings"
/>
}
disabled={(initialized === true)}
disabled={initialized === true}
fullWidth
>
<MLJobEditor
mode={EDITOR_MODE.JSON}
readOnly={(initialized === true)}
readOnly={initialized === true}
value={data}
height={EDITOR_HEIGHT}
syntaxChecking={false}
Expand All @@ -197,12 +195,12 @@ function IngestPipeline({ initialized, data, onChange }) {
defaultMessage="Ingest pipeline"
/>
}
disabled={(initialized === true)}
disabled={initialized === true}
fullWidth
>
<MLJobEditor
mode={EDITOR_MODE.JSON}
readOnly={(initialized === true)}
readOnly={initialized === true}
value={data}
height={EDITOR_HEIGHT}
syntaxChecking={false}
Expand Down
Expand Up @@ -7,11 +7,7 @@
import { injectI18n, FormattedMessage } from '@kbn/i18n/react';
import React from 'react';

import {
EuiFieldText,
EuiFormRow,
EuiCheckbox,
} from '@elastic/eui';
import { EuiFieldText, EuiFormRow, EuiCheckbox, EuiSpacer } from '@elastic/eui';

export const SimpleSettings = injectI18n(function ({
index,
Expand All @@ -37,19 +33,21 @@ export const SimpleSettings = injectI18n(function ({
<EuiFieldText
placeholder={intl.formatMessage({
id: 'xpack.ml.fileDatavisualizer.simpleImportSettings.indexNamePlaceholder',
defaultMessage: 'index name'
defaultMessage: 'index name',
})}
value={index}
disabled={(initialized === true)}
disabled={initialized === true}
onChange={onIndexChange}
isInvalid={indexNameError !== ''}
aria-label={intl.formatMessage({
id: 'xpack.ml.fileDatavisualizer.simpleImportSettings.indexNameAriaLabel',
defaultMessage: 'Index name, required field'
defaultMessage: 'Index name, required field',
})}
/>
</EuiFormRow>

<EuiSpacer size="m" />

<EuiCheckbox
id="createIndexPattern"
label={
Expand All @@ -58,8 +56,8 @@ export const SimpleSettings = injectI18n(function ({
defaultMessage="Create index pattern"
/>
}
checked={(createIndexPattern === true)}
disabled={(initialized === true)}
checked={createIndexPattern === true}
disabled={initialized === true}
onChange={onCreateIndexPatternChange}
/>
</React.Fragment>
Expand Down

0 comments on commit 4fd7c62

Please sign in to comment.