Skip to content

Commit

Permalink
Fix spacing at button sides
Browse files Browse the repository at this point in the history
  • Loading branch information
Tostti committed Dec 13, 2024
1 parent bd7f5e0 commit be67522
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@
import React from 'react';
import {
EuiFlexItem,
EuiButtonEmpty
EuiButtonEmpty,
EuiIconTip
} from '@elastic/eui';
import exportCsv from '../../../../react-services/wz-csv';
import { getToasts } from '../../../../kibana-services';
import { UI_ERROR_SEVERITIES } from '../../../../react-services/error-orchestrator/types';
import { UI_LOGGER_LEVELS } from '../../../../../common/constants';
import { getErrorOrchestrator } from '../../../../react-services/common-services';

export function ExportTableCsv({ endpoint, totalItems, filters, title }) {
export function ExportTableCsv({ endpoint, totalItems, filters, title, maxRows }) {

const showToast = (color, title, time) => {
getToasts().add({
Expand Down Expand Up @@ -56,10 +57,16 @@ export function ExportTableCsv({ endpoint, totalItems, filters, title }) {
getErrorOrchestrator().handleError(options);
}
}

return <EuiFlexItem grow={false}>
<EuiButtonEmpty isDisabled={(totalItems == 0)} iconType="importAction" onClick={() => downloadCsv()}>
Export formatted
{totalItems > maxRows&&<> <EuiIconTip
content={`The exported CSV will be limited to the first ${maxRows} lines. You can change this limit in Dashboard management > App Settings`}
size='m'
color='primary'
type='iInCircle'
/></>}
</EuiButtonEmpty>
</EuiFlexItem>
}
Expand All @@ -70,4 +77,4 @@ ExportTableCsv.defaultProps = {
totalItems:0,
filters: [],
title:""
};
};
11 changes: 2 additions & 9 deletions plugins/main/public/components/common/tables/table-wz-api.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import {
EuiToolTip,
EuiIcon,
EuiCheckboxGroup,
EuiIconTip,
} from '@elastic/eui';
import { TableWithSearchBar } from './table-with-search-bar';
import { TableDefault } from './table-default';
Expand Down Expand Up @@ -252,15 +251,9 @@ export function TableWzAPI({
? rest.downloadCsv
: rest.title
}
maxRows={maxRows}
/>
{totalItems > maxRows && (
<EuiIconTip
content={`The exported CSV will be limited to the first ${maxRows} lines. You can change this limit in Dashboard management > App Settings`}
size='m'
color='primary'
type='iInCircle'
/>
)}

</>
)}
{/* Render optional post custom action button */}
Expand Down

0 comments on commit be67522

Please sign in to comment.