Skip to content

Commit

Permalink
Merge pull request #2 from ryankeairns/enhancement/update-esdocs-data…
Browse files Browse the repository at this point in the history
…source

Design tweaks for esdocs datasource PR
  • Loading branch information
maggieghamry authored Mar 9, 2020
2 parents cb85a63 + ef3032e commit bc60acb
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ export const demodata = () => ({
name: 'demodata',
displayName: strings.getDisplayName(),
help: strings.getHelp(),
image: 'visualizeApp',
image: 'training',
template: templateFromReactComponent(DemodataDatasource),
});
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,6 @@ export const essql = () => ({
name: 'essql',
displayName: strings.getDisplayName(),
help: strings.getHelp(),
image: 'sqlApp',
image: 'database',
template: templateFromReactComponent(EssqlDatasource),
});
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,6 @@ export const timelion = () => ({
name: 'timelion',
displayName: TIMELION,
help: strings.getHelp(),
image: 'timelionApp',
image: 'visTimelion',
template: templateFromReactComponent(TimelionDatasource),
});
4 changes: 2 additions & 2 deletions x-pack/legacy/plugins/canvas/i18n/expression_types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,15 +185,15 @@ export const ExpressionDataSourceStrings = {
}),
getSortFieldTitle: () =>
i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.sortFieldTitle', {
defaultMessage: 'Sort Field',
defaultMessage: 'Sort field',
}),
getSortFieldLabel: () =>
i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.sortFieldLabel', {
defaultMessage: 'Document sort field',
}),
getSortOrderTitle: () =>
i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.sortOrderTitle', {
defaultMessage: 'Sort Order',
defaultMessage: 'Sort order',
}),
getSortOrderLabel: () =>
i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.sortOrderLabel', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@
padding: 0 $euiSizeS;
}

.canvasDataSource__section {
padding: $euiSizeM;
.canvasDataSource__section,
.canvasDataSource__list {
padding: $euiSizeM $euiSizeM 0;
}

.canvasDataSource__sectionFooter {
padding: 0 $euiSizeM;
}

.canvasDataSource__triggerButton {
Expand All @@ -19,10 +24,6 @@
margin-right: $euiSizeS;
}

.canvasDataSource__list {
padding: $euiSizeM;
}

.canvasDataSource__card .euiCard__content {
padding-top: 0 !important; // sass-lint:disable-line no-important
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,20 +164,20 @@ export class DatasourceComponent extends PureComponent {
) : (
datasourceRender
)}
<EuiHorizontalRule margin="m" />
<EuiFlexGroup justifyContent="flexEnd" gutterSize="s">
<EuiFlexItem grow={false}>
<EuiButtonEmpty size="s" onClick={() => setPreviewing(true)}>
{strings.getPreviewButtonLabel()}
</EuiButtonEmpty>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButton disabled={isInvalid} size="s" onClick={this.save} fill color="secondary">
{strings.getSaveButtonLabel()}
</EuiButton>
</EuiFlexItem>
</EuiFlexGroup>
</div>
<EuiHorizontalRule margin="m" />
<EuiFlexGroup justifyContent="flexEnd" className="canvasDataSource__sectionFooter">
<EuiFlexItem grow={false}>
<EuiButtonEmpty size="s" onClick={() => setPreviewing(true)}>
{strings.getPreviewButtonLabel()}
</EuiButtonEmpty>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButton disabled={isInvalid} size="s" onClick={this.save} fill color="secondary">
{strings.getSaveButtonLabel()}
</EuiButton>
</EuiFlexItem>
</EuiFlexGroup>

{datasourcePreview}
</Fragment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,28 +101,22 @@ const EsdocsDatasource = ({ args, updateArgs, defaultIndex }) => {
/>
</EuiFormRow>

<EuiSpacer size="s" />
<EuiAccordion
id="accordionAdvancedSettings"
buttonContent="Advanced Settings"
arrowDisplay="right"
buttonContent="Advanced settings"
className="canvasArg__accordion"
>
<EuiFormRow
label={strings.getSortFieldTitle()}
helpText={strings.getSortFieldLabel()}
display="columnCompressed"
>
<EuiSpacer size="s" />
<EuiFormRow label={strings.getSortFieldTitle()} display="columnCompressed">
<ESFieldSelect
index={index}
value={sortField}
onChange={field => setArg('sort', [field, sortOrder].join(', '))}
/>
</EuiFormRow>

<EuiFormRow
label={strings.getSortOrderTitle()}
helpText={strings.getSortOrderLabel()}
display="columnCompressed"
>
<EuiFormRow label={strings.getSortOrderTitle()} display="columnCompressed">
<EuiSelect
value={sortOrder.toLowerCase()}
onChange={e => setArg('sort', [sortField, e.target.value].join(', '))}
Expand Down Expand Up @@ -163,6 +157,6 @@ export const esdocs = () => ({
name: 'esdocs',
displayName: strings.getDisplayName(),
help: strings.getHelp(),
image: 'filebeatApp',
image: 'documents',
template: templateFromReactComponent(EsdocsDatasource),
});

0 comments on commit bc60acb

Please sign in to comment.