Skip to content

Commit e0ed0a5

Browse files
committed
Styles | auto match dialog margins and vertical hierarchy
1 parent 9b95b02 commit e0ed0a5

3 files changed

Lines changed: 33 additions & 26 deletions

File tree

src/components/common/TagCountLabel.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@ import React from 'react';
22
import { isNumber } from 'lodash';
33
import { PRIMARY_COLORS } from '../../common/colors'
44

5-
const TabCountLabel = ({label, count}) => {
5+
const TabCountLabel = ({label, count, normal}) => {
66
if(!isNumber(count))
77
return <span>{label}</span>;
88

99
return (
1010
<span style={{display: 'flex'}}>
11-
<span style={{marginRight: '8px', display: 'flex', alignItems: 'center'}}><b>{label}</b></span>
11+
<span style={{marginRight: '8px', display: 'flex', alignItems: 'center', fontWeight: normal ? 'normal' : 'bold'}}>
12+
{label}
13+
</span>
1214
<span className="tag-count-label--count" style={{backgroundColor: PRIMARY_COLORS['90'], fontSize: '14px'}}>
1315
{count.toLocaleString()}
1416
</span>

src/components/map-projects/AutoMatchDialog.jsx

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import DoubleArrowIcon from '@mui/icons-material/DoubleArrow';
2020
import map from 'lodash/map'
2121

2222
import CloseIconButton from '../common/CloseIconButton'
23+
import TagCountLabel from '../common/TagCountLabel'
2324
import RepoChip from '../repos/RepoVersionChip'
2425
import AIAssistantButton from './AIAssistantButton'
2526
import AIAssistantSelectorPanel from './AIAssistantSelectorPanel'
@@ -81,21 +82,24 @@ const AutoMatchDialog = ({
8182
{
8283
value: 'selected',
8384
disabled: !hasSelectedRows,
84-
label: `${t('map_project.selected_rows')} (${selectedRowCount.toLocaleString()})`,
85+
label: t('map_project.selected_rows'),
86+
count: hasSelectedRows ? selectedRowCount : false,
8587
helperText: hasSelectedRows ?
8688
t('map_project.auto_match_selected_rows_note', {count: selectedRowCount.toLocaleString()}) :
8789
t('map_project.auto_match_selected_rows_note_no_count')
8890
},
8991
{
9092
value: 'unmapped',
9193
disabled: !hasUnmappedRows,
92-
label: `${t('map_project.unmapped_only')} (${rowStatuses.unmapped.length.toLocaleString()})`,
94+
count: rowStatuses.unmapped.length,
95+
label: t('map_project.unmapped_only'),
9396
helperText: t('map_project.auto_match_unmapped_only_note')
9497
},
9598
{
9699
value: 'all',
97100
disabled: false,
98-
label: `${t('map_project.unmapped_and_proposed')} (${allRowsCount.toLocaleString()})`,
101+
count: allRowsCount,
102+
label: t('map_project.unmapped_and_proposed'),
99103
helperText: t('map_project.auto_match_note', {
100104
approvedCount: rowStatuses.reviewed.length.toLocaleString(),
101105
proposedCount: rowStatuses.readyForReview.length.toLocaleString()
@@ -104,7 +108,9 @@ const AutoMatchDialog = ({
104108
{
105109
value: 'allIncludingApproved',
106110
disabled: !hasApprovedRows,
107-
label: `${t('map_project.all_including_approved')} (${totalRows.toLocaleString()})`,
111+
count: totalRows,
112+
label: t('map_project.all_including_approved'),
113+
warning: true,
108114
helperText: t('map_project.auto_match_all_including_approved_note', {
109115
approvedCount: rowStatuses.reviewed.length.toLocaleString(),
110116
proposedCount: rowStatuses.readyForReview.length.toLocaleString()
@@ -144,36 +150,35 @@ const AutoMatchDialog = ({
144150
<RepoChip repo={repoVersion} hideType sx={{marginLeft: '16px'}} />
145151
}
146152
</div>
147-
<FormControl sx={{marginTop: '16px'}}>
148-
<FormLabel id="automatch-rows">{`${t('map_project.rows_to_match')}: ${rowsToMatchCount.toLocaleString()} ${t('map_project.out_of')} ${totalRows.toLocaleString()}` }</FormLabel>
153+
<FormControl sx={{marginTop: '10px'}}>
154+
<FormLabel id="automatch-rows" sx={{color: 'rgba(0, 0, 0, 0.87)'}}>{`${t('map_project.rows_to_match')}: ${rowsToMatchCount.toLocaleString()} ${t('map_project.out_of')} ${totalRows.toLocaleString()}` }</FormLabel>
149155
<RadioGroup
156+
sx={{marginLeft: '12px'}}
150157
aria-labelledby="automatch-rows"
151158
name="automatch-rows"
152159
value={autoMatchScope}
153160
onChange={event => setAutoMatchScope(event.target.value)}
154161
>
155162
{
156163
scopeOptions.map(option => (
157-
<div key={option.value} style={{marginBottom: '8px'}}>
164+
<div key={option.value}>
158165
<FormControlLabel
159166
value={option.value}
160167
disabled={option.disabled}
161-
control={<Radio />}
162-
label={option.label}
168+
control={<Radio size='small' />}
169+
label={<TagCountLabel label={option.label} count={option.count} normal />}
163170
sx={{marginRight: 0}}
164171
/>
165-
{
166-
autoMatchScope === option.value &&
167-
<FormHelperText sx={{margin: '0 0 0 32px'}}>
168-
{option.helperText}
169-
</FormHelperText>
170-
}
172+
<FormHelperText sx={{margin: '-8px 0 0 28px', color: option.warning && autoMatchScope === option.value ? 'warning.main' : undefined}}>
173+
{option.helperText}
174+
</FormHelperText>
171175
{
172176
autoMatchScope === option.value && option.value === 'allIncludingApproved' &&
173177
<FormControlLabel
174-
sx={{marginLeft: '24px', marginTop: '4px'}}
178+
sx={{marginLeft: '17px', marginTop: '-4px', marginRight: 0}}
175179
control={
176180
<Checkbox
181+
size='small'
177182
checked={confirmAllIncludingApproved}
178183
onChange={event => setConfirmAllIncludingApproved(event.target.checked)}
179184
/>
@@ -189,12 +194,12 @@ const AutoMatchDialog = ({
189194
</RadioGroup>
190195
</FormControl>
191196

192-
<FormControl sx={{marginTop: '16px'}}>
197+
<FormControl sx={{marginTop: '8px'}}>
193198
<FormControlLabel control={<Checkbox checked={algos} onChange={() => setAlgos(!algos)} />} label={t('map_project.retrieve_candidates')} />
194-
<FormLabel id="algorithms">
199+
<FormLabel id="algorithms" sx={{marginTop: '-4px', marginLeft: '12px'}}>
195200
{t('map_project.retrieve_candidates_helper_text')}
196201
</FormLabel>
197-
<div className='col-xs-12 padding-0'>
202+
<div className='col-xs-12 padding-0' style={{marginLeft: '8px'}}>
198203
{
199204
algosSelected.map(algo => {
200205
return (
@@ -209,7 +214,7 @@ const AutoMatchDialog = ({
209214
inAIAssistantGroup &&
210215
<>
211216
<FormControlLabel
212-
sx={{marginTop: '16px', width: '100%'}}
217+
sx={{marginTop: '8px', width: '100%'}}
213218
control={
214219
<Checkbox
215220
checked={autoRunAIAnalysis}
@@ -233,13 +238,13 @@ const AutoMatchDialog = ({
233238
models={AIModels}
234239
selectedModel={AIModel}
235240
onModelChange={setAIModel}
236-
sx={{marginTop: '12px'}}
241+
sx={{marginTop: '12px', marginLeft: '12px'}}
237242
/> :
238243
<AIAssistantButton
239244
models={AIModels}
240245
selected={AIModel}
241246
onClick={() => {}}
242-
sx={{marginTop: '12px'}}
247+
sx={{marginTop: '12px', marginLeft: '12px'}}
243248
onModelChange={setAIModel}
244249
popperProps={{
245250
sx: {zIndex: 1500}

src/i18n/locales/en/translations.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -515,10 +515,10 @@
515515
"loading_project": "Loading project...",
516516
"stopping_gracefully": "Stopping gracefully...",
517517
"stop_processing": "Stop Processing",
518-
"auto_match_unmapped_only_note": "Note: Only unmapped rows will be matched.",
518+
"auto_match_unmapped_only_note": "Note: Only unmapped rows will be matched",
519519
"auto_match_note": "Note: This will not affect {{approvedCount}} approved input rows but will override {{proposedCount}} proposed input rows",
520520
"auto_match_note_no_counts": "Note: This will not affect approved input rows but will override proposed input rows",
521-
"auto_match_all_including_approved_note": "Warning: This will re-run every input row from scratch and overwrite {{approvedCount}} approved and {{proposedCount}} proposed decisions.",
521+
"auto_match_all_including_approved_note": "Warning: This will re-run every input row from scratch and overwrite {{approvedCount}} approved and {{proposedCount}} proposed decisions",
522522
"auto_match_all_including_approved_confirm": "I understand that {{approvedCount}} approved decisions will be overwritten",
523523
"auto_match_selected_rows_note": "Note: This will run Auto Match for {{count}} selected input rows",
524524
"auto_match_selected_rows_note_no_count": "Note: Select rows in the left panel to enable this option",

0 commit comments

Comments
 (0)