Skip to content

Commit 33d047b

Browse files
committed
OpenConceptLab/ocl_issues#2322 | Auto match dialog | rows count
1 parent 3a29c60 commit 33d047b

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

src/components/map-projects/AutoMatchDialog.jsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ import AIAssistantButton from './AIAssistantButton'
2323

2424
const AutoMatchDialog = ({open, onClose, autoMatchUnmappedOnly, setAutoMatchUnmappedOnly, rowStatuses, autoRunAIAnalysis, setAutoRunAIAnalysis, AIModels, AIModel, setAIModel, repoVersion, onSubmit, inAIAssistantGroup}) => {
2525
const { t } = useTranslation()
26+
const selectedRows = autoMatchUnmappedOnly ? rowStatuses.unmapped.length : (rowStatuses.unmapped.length + rowStatuses.readyForReview.length)
27+
const totalRows = rowStatuses.unmapped.length + rowStatuses.readyForReview.length + rowStatuses.reviewed.length
2628

2729
const getHelperTextForAutoMatchUnmapped = () => {
2830
if (autoMatchUnmappedOnly) {
@@ -43,7 +45,7 @@ const AutoMatchDialog = ({open, onClose, autoMatchUnmappedOnly, setAutoMatchUnma
4345
return t('map_project.auto_match_note_no_counts');
4446
};
4547

46-
const isDisabled = !repoVersion?.version_url
48+
const isDisabled = !repoVersion?.version_url && selectedRows > 0
4749

4850
return (
4951
<Dialog
@@ -72,7 +74,7 @@ const AutoMatchDialog = ({open, onClose, autoMatchUnmappedOnly, setAutoMatchUnma
7274
}
7375
</div>
7476
<FormControl sx={{marginTop: '12px'}}>
75-
<FormLabel id="automatch-rows">{t('map_project.input_dataset')}</FormLabel>
77+
<FormLabel id="automatch-rows">{`${t('map_project.selected_rows')}: ${selectedRows.toLocaleString()} ${t('map_project.out_of')} ${totalRows.toLocaleString()}` }</FormLabel>
7678
<RadioGroup
7779
row
7880
aria-labelledby="automatch-rows"
@@ -82,12 +84,12 @@ const AutoMatchDialog = ({open, onClose, autoMatchUnmappedOnly, setAutoMatchUnma
8284
<FormControlLabel
8385
value="unmapped"
8486
control={<Radio checked={autoMatchUnmappedOnly} />}
85-
label={t('map_project.unmapped_only') + ` (${rowStatuses.unmapped.length.toLocaleString()})`}
87+
label={t('map_project.unmapped_only')}
8688
/>
8789
<FormControlLabel
8890
value="all"
8991
control={<Radio checked={!autoMatchUnmappedOnly} />}
90-
label={t('map_project.all_rows') + ` (${(rowStatuses.unmapped.length + rowStatuses.readyForReview.length).toLocaleString()})`}
92+
label={t('map_project.all_rows')}
9193
/>
9294
</RadioGroup>
9395
</FormControl>

src/i18n/locales/en/translations.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -563,8 +563,9 @@
563563
"candidates_metadata": "Candidates Metadata",
564564
"full_project_export": "Full Project Export",
565565
"select_an_algo": "Select an algorithm",
566-
"input_dataset": "Input Dataset",
567-
"all_rows": "All Rows"
566+
"selected_rows": "Selected Rows",
567+
"all_rows": "All Rows",
568+
"out_of": "out of"
568569
},
569570
"app": {
570571
"web_version": "Web Version",

0 commit comments

Comments
 (0)