Skip to content

Commit 5f58c97

Browse files
committed
Feedback | showing controls always
1 parent 929dfc4 commit 5f58c97

File tree

2 files changed

+30
-31
lines changed

2 files changed

+30
-31
lines changed

src/components/map-projects/Controls.jsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const IkonButton = ({title, icon, onClick, color, disabled, id}) => {
3838
)
3939
}
4040

41-
const Controls = ({project, onDownload, onSave, onDelete, owner, file, isSaving, onImport, importResponse, onDownloadImportReport, onProjectLogsClick, isProjectsLogOpen, configure, setConfigure, isStaff}) => {
41+
const Controls = ({project, onDownload, onSave, onDelete, owner, file, isSaving, onImport, importResponse, onDownloadImportReport, onProjectLogsClick, isProjectsLogOpen, configure, setConfigure, isStaff, loadingMatches}) => {
4242
const { t } = useTranslation();
4343
const [anchorEl, setAnchorEl] = React.useState(null);
4444
const downloadOpen = Boolean(anchorEl);
@@ -53,19 +53,19 @@ const Controls = ({project, onDownload, onSave, onDelete, owner, file, isSaving,
5353
onClick={() => setConfigure(!configure)}
5454
title={t('map_project.configure_mapping_project_tooltip')}
5555
icon={<SettingsIcon />}
56+
disabled={loadingMatches}
5657
/>
5758
<IkonButton
5859
color={isProjectsLogOpen ? 'primary' : 'secondary'}
5960
onClick={onProjectLogsClick}
6061
title={t('map_project.project_logs_tooltip')}
61-
disabled={!project?.id}
6262
icon={<TimelineIcon />}
6363
/>
6464
<IkonButton
6565
color='secondary'
6666
onClick={onSave}
6767
title={t('map_project.save_this_project')}
68-
disabled={!owner || !file?.name || isSaving}
68+
disabled={!owner || !file?.name || isSaving || loadingMatches}
6969
icon={<SaveIcon />}
7070
/>
7171
<IkonButton
@@ -74,12 +74,13 @@ const Controls = ({project, onDownload, onSave, onDelete, owner, file, isSaving,
7474
onClick={event => setAnchorEl(event.currentTarget)}
7575
title={t('map_project.download_this_project_as_csv')}
7676
icon={<DownloadIcon />}
77+
disabled={loadingMatches}
7778
/>
7879
{
7980
project?.id &&
8081
<IkonButton
8182
color='secondary'
82-
disabled={isSaving}
83+
disabled={isSaving || loadingMatches}
8384
onClick={onDelete}
8485
title={t('map_project.delete_this_project')}
8586
icon={<DeleteIcon />}

src/components/map-projects/MapProject.jsx

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2716,33 +2716,31 @@ const MapProject = () => {
27162716
}
27172717
</span>
27182718
}
2719-
{
2720-
rows?.length > 0 && !loadingMatches &&
2721-
<Controls
2722-
isStaff={isStaff}
2723-
project={project}
2724-
onDownload={onDownloadClick}
2725-
onSave={onSave}
2726-
onDelete={() => setDeleteProject(true)}
2727-
owner={owner}
2728-
file={file}
2729-
isSaving={isSaving}
2730-
onImport={isEmpty(mapSelected) ? false : () => setOpenImportToCollection(true)}
2731-
importResponse={imports[0]}
2732-
onDownloadImportReport={downloadImportReport}
2733-
onProjectLogsClick={() => {
2734-
const newValue = !showProjectLogs
2735-
if(newValue) {
2736-
setConfigure(false)
2737-
onCloseDecisions()
2738-
}
2739-
setShowProjectLogs(newValue)
2740-
}}
2741-
isProjectsLogOpen={showProjectLogs}
2742-
configure={configure}
2743-
setConfigure={setConfigure}
2744-
/>
2745-
}
2719+
<Controls
2720+
isStaff={isStaff}
2721+
project={project}
2722+
onDownload={onDownloadClick}
2723+
onSave={onSave}
2724+
onDelete={() => setDeleteProject(true)}
2725+
owner={owner}
2726+
file={file}
2727+
loadingMatches={loadingMatches}
2728+
isSaving={isSaving}
2729+
onImport={isEmpty(mapSelected) ? false : () => setOpenImportToCollection(true)}
2730+
importResponse={imports[0]}
2731+
onDownloadImportReport={downloadImportReport}
2732+
onProjectLogsClick={() => {
2733+
const newValue = !showProjectLogs
2734+
if(newValue) {
2735+
setConfigure(false)
2736+
onCloseDecisions()
2737+
}
2738+
setShowProjectLogs(newValue)
2739+
}}
2740+
isProjectsLogOpen={showProjectLogs}
2741+
configure={configure}
2742+
setConfigure={setConfigure}
2743+
/>
27462744
</div>
27472745
</Paper>
27482746
{

0 commit comments

Comments
 (0)