Skip to content

Commit cdbd039

Browse files
authored
make some modals closable (#8869)
This PR update some modals to: 1. Use antd default props to achieve things like hiding the footer buttons 2. Make them closable by clicking into the mask outside the modal. There remained 14 modals that can not be closed by just clicking outside them in the background. I looked through the list and for those modals I agree that they should not be (accidentally) closable but rather the user should be forced to make a decision by clicking one the Ok/Cancel/etc buttons. <img width="377" height="735" alt="Screenshot 2025-08-22 at 11 24 48" src="https://github.com/user-attachments/assets/299e197c-115e-4f87-8f7b-4c582d998917" /> ### Issues: - fixes #5367 ------ (Please delete unneeded items, merge only when none are left open) - [ ] Added changelog entry (create a `$PR_NUMBER.md` file in `unreleased_changes` or use `./tools/create-changelog-entry.py`) - [ ] Added migration guide entry if applicable (edit the same file as for the changelog) - [ ] Updated [documentation](../blob/master/docs) if applicable - [ ] Adapted [wk-libs python client](https://github.com/scalableminds/webknossos-libs/tree/master/webknossos/webknossos/client) if relevant API parts change - [ ] Removed dev-only changes like prints and application.conf edits - [ ] Considered [common edge cases](../blob/master/.github/common_edge_cases.md) - [ ] Needs datastore update after deployment
1 parent eac9685 commit cdbd039

File tree

6 files changed

+9
-42
lines changed

6 files changed

+9
-42
lines changed

frontend/javascripts/admin/dataset/dataset_add_view.tsx

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -273,17 +273,7 @@ const getPostUploadModal = (
273273
open
274274
closable
275275
maskClosable={false}
276-
className="no-footer-modal"
277-
cancelButtonProps={{
278-
style: {
279-
display: "none",
280-
},
281-
}}
282-
okButtonProps={{
283-
style: {
284-
display: "none",
285-
},
286-
}}
276+
footer={null}
287277
onCancel={() => setDatasetId("")}
288278
onOk={() => setDatasetId("")}
289279
width={580}
@@ -336,7 +326,7 @@ const getPostUploadModal = (
336326
</React.Fragment>
337327
)}
338328
</div>
339-
</div>{" "}
329+
</div>
340330
</Modal>
341331
);
342332
};

frontend/javascripts/admin/dataset/dataset_upload_view.tsx

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -492,17 +492,7 @@ class DatasetUploadView extends React.Component<PropsWithFormAndRouter, State> {
492492
open={isUploading}
493493
keyboard={false}
494494
maskClosable={false}
495-
className="no-footer-modal"
496-
okButtonProps={{
497-
style: {
498-
display: "none",
499-
},
500-
}}
501-
cancelButtonProps={{
502-
style: {
503-
display: "none",
504-
},
505-
}}
495+
footer={null}
506496
onCancel={this.cancelUpload}
507497
>
508498
<div

frontend/javascripts/admin/user/experience_modal_view.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,6 @@ function ExperienceModalView({
242242
onOk={updateAllUsers}
243243
okText={"Save"}
244244
width={multipleUsers ? 800 : 600}
245-
maskClosable={false}
246245
>
247246
<Table
248247
size="small"

frontend/javascripts/viewer/view/left-border-tabs/layer_settings_tab.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -488,8 +488,6 @@ class DatasetSettings extends React.PureComponent<DatasetSettingsProps, State> {
488488
title: `Deleting an annotation layer makes its content and history inaccessible. ${fallbackLayerNote}This cannot be undone. Are you sure you want to delete this layer?`,
489489
okText: `Yes, delete annotation layer “${readableAnnotationLayerName}”`,
490490
cancelText: "Cancel",
491-
maskClosable: true,
492-
closable: true,
493491
okButtonProps: {
494492
danger: true,
495493
block: true,

frontend/javascripts/viewer/view/left-border-tabs/modals/add_volume_layer_modal.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -227,14 +227,7 @@ export default function AddVolumeLayerModal({
227227
};
228228

229229
return (
230-
<Modal
231-
title="Add Volume Annotation Layer"
232-
footer={null}
233-
width={500}
234-
maskClosable={false}
235-
onCancel={onCancel}
236-
open
237-
>
230+
<Modal title="Add Volume Annotation Layer" footer={null} width={500} onCancel={onCancel} open>
238231
Layer Name:{" "}
239232
<InputComponent
240233
size="small"

frontend/stylesheets/_utils.less

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ td.nowrap * {
4949
flex-direction: row;
5050
justify-content: center;
5151

52-
& > * {
52+
&>* {
5353
margin: 6px;
5454
}
5555

@@ -71,6 +71,7 @@ td.nowrap * {
7171
display: table;
7272
content: "";
7373
}
74+
7475
.clearfix::after {
7576
// sometimes required by .pull-right
7677
display: table;
@@ -86,12 +87,6 @@ td.nowrap * {
8687
margin-right: 5px;
8788
}
8889

89-
.no-footer-modal {
90-
.ant-modal-footer {
91-
display: none;
92-
}
93-
}
94-
9590
.flex-container {
9691
justify-content: space-between;
9792
display: flex;
@@ -144,9 +139,11 @@ td.nowrap * {
144139
.grabbing {
145140
cursor: grabbing !important;
146141
}
142+
147143
.grabbing * {
148144
cursor: grabbing !important;
149145
}
146+
150147
.is-dragging {
151148
cursor: grabbing !important;
152149
user-select: none;
@@ -180,4 +177,4 @@ td.nowrap * {
180177
overflow-y: auto;
181178
flex-shrink: 1;
182179
}
183-
}
180+
}

0 commit comments

Comments
 (0)