Skip to content
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

Design tweaks for esdocs datasource PR #2

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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),
});