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

fix(data-integrity): add indicator for slow checks #604

Merged
merged 6 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
21 changes: 14 additions & 7 deletions src/components/FormFields/Custom/DataIntegrityChecksField.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const DataIntegrityChecksField = ({ label, name }) => {
<Radio
name={'checksToRun'}
value={'false'}
label={i18n.t('Run all available checks')}
label={i18n.t('Run all standard checks')}
checked={!runSelected}
onChange={toggle}
/>
Expand All @@ -108,19 +108,26 @@ const DataIntegrityChecksField = ({ label, name }) => {
)
}

const LabelComponent = ({ label, severity, highlighted, disabled }) => (
const LabelComponent = ({ label, severity, highlighted, disabled, isSlow }) => (
<div
className={cx(styles.transferOption, {
[styles.highlighted]: highlighted,
[styles.disabled]: disabled,
})}
>
<div className={styles.optionName}>{label}</div>
<div
className={cx(styles.optionSeverity, {
[styles.highlighted]: highlighted,
})}
>{`${i18n.t('Severity')}: ${severity}`}</div>
<div className={styles.optionSubtitle}>
<span
className={cx(styles.optionSeverity, {
[styles.highlighted]: highlighted,
})}
>{`${i18n.t('Severity')}: ${severity}`}</span>
{isSlow && (
<span className={styles.optionSlowIndicator}>
{i18n.t('Resource intensive')}
</span>
)}
</div>
</div>
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,38 @@
.transfer {
margin-top: 8px;
margin-block-start: var(--spacers-dp8);
}

.transferOption {
display: flex;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed this to flex, mostly because I prefer using gap instead of margins for spacing between the header and other stuff.

flex-direction: column;
font-size: 14px;
padding: 4px 0;
gap: 6px;
}

.optionName {
font-weight: 500;
margin-bottom: 4px;
}

.optionSeverity {
.optionSubtitle {
display: flex;
align-items: center;
justify-content: space-between;
font-weight: 400;
font-size: 13px;
}

.optionSeverity {
color: var(--colors-grey600);
}

.optionSlowIndicator {
background-color: var(--colors-yellow100);
color: var(--colors-grey800);
padding: 4px 6px;
border-radius: 2px;
}

.transferOption.highlighted .optionSeverity {
color: var(--colors-grey300);
}
Expand Down
Loading