Skip to content

Commit

Permalink
Review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
e40pud committed Dec 17, 2024
1 parent 86a6b33 commit 6bad818
Showing 1 changed file with 15 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,7 @@
*/

import React from 'react';
import {
EuiButton,
EuiButtonEmpty,
EuiFlexGroup,
EuiFlexItem,
EuiLoadingSpinner,
} from '@elastic/eui';
import { EuiButton, EuiButtonEmpty, EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import * as i18n from './translations';

export interface BulkActionsProps {
Expand All @@ -39,52 +33,52 @@ export const BulkActions: React.FC<BulkActionsProps> = React.memo(
reprocessFailedRules,
}) => {
const disableInstallTranslatedRulesButton = isTableLoading || !numberOfTranslatedRules;
const showInstallSelectedRulesButton = isTableLoading || numberOfSelectedRules > 0;
const showRetryFailedRulesButton = isTableLoading || numberOfFailedRules > 0;
const showInstallSelectedRulesButton = numberOfSelectedRules > 0;
const showRetryFailedRulesButton = numberOfFailedRules > 0;
return (
<EuiFlexGroup alignItems="center" gutterSize="s" responsive={false} wrap={true}>
{showInstallSelectedRulesButton ? (
{showInstallSelectedRulesButton && (
<EuiFlexItem grow={false}>
<EuiButtonEmpty
iconType="plusInCircle"
color={'primary'}
onClick={installSelectedRule}
onClick={() => installSelectedRule?.()}
disabled={isTableLoading}
isLoading={isTableLoading}
data-test-subj="installSelectedRulesButton"
aria-label={i18n.INSTALL_SELECTED_ARIA_LABEL}
>
{i18n.INSTALL_SELECTED_RULES(numberOfSelectedRules)}
{isTableLoading && <EuiLoadingSpinner size="s" />}
</EuiButtonEmpty>
</EuiFlexItem>
) : null}
{showRetryFailedRulesButton ? (
)}
{showRetryFailedRulesButton && (
<EuiFlexItem grow={false}>
<EuiButton
iconType="refresh"
color={'warning'}
data-test-subj="reprocessFailedRulesButton"
onClick={reprocessFailedRules}
onClick={() => reprocessFailedRules?.()}
disabled={isTableLoading}
isLoading={isTableLoading}
data-test-subj="reprocessFailedRulesButton"
aria-label={i18n.REPROCESS_FAILED_ARIA_LABEL}
>
{i18n.REPROCESS_FAILED_RULES(numberOfFailedRules)}
{isTableLoading && <EuiLoadingSpinner size="s" />}
</EuiButton>
</EuiFlexItem>
) : null}
)}
<EuiFlexItem grow={false}>
<EuiButton
iconType="plusInCircle"
data-test-subj="installTranslatedRulesButton"
onClick={installTranslatedRule}
onClick={() => installTranslatedRule?.()}
disabled={disableInstallTranslatedRulesButton}
isLoading={isTableLoading}
data-test-subj="installTranslatedRulesButton"
aria-label={i18n.INSTALL_TRANSLATED_ARIA_LABEL}
>
{numberOfTranslatedRules > 0
? i18n.INSTALL_TRANSLATED_RULES(numberOfTranslatedRules)
: i18n.INSTALL_TRANSLATED_RULES_EMPTY_STATE}
{isTableLoading && <EuiLoadingSpinner size="s" />}
</EuiButton>
</EuiFlexItem>
</EuiFlexGroup>
Expand Down

0 comments on commit 6bad818

Please sign in to comment.