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

Misc layout improvements in dataset upload #8231

Merged
merged 8 commits into from
Dec 2, 2024
9 changes: 5 additions & 4 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released
- Removed bounding box size restriction for inferral jobs for super users. [#8200](https://github.com/scalableminds/webknossos/pull/8200)

### Fixed
- Fix performance bottleneck when deleting a lot of trees at once. [#8176](https://github.com/scalableminds/webknossos/pull/8176)
- Fix a bug where changing the color of a segment via the menu in the segments tab would update the segment color of the previous segment, on which the context menu was opened. [#8225](https://github.com/scalableminds/webknossos/pull/8225)
- Fix a bug when importing an NML with groups when only groups but no trees exist in an annotation. [#8176](https://github.com/scalableminds/webknossos/pull/8176)
- Fix a bug where trying to delete a non-existing node (via the API, for example) would delete the whole active tree. [#8176](https://github.com/scalableminds/webknossos/pull/8176)
- Fixed performance bottleneck when deleting a lot of trees at once. [#8176](https://github.com/scalableminds/webknossos/pull/8176)
- Fixed a bug where changing the color of a segment via the menu in the segments tab would update the segment color of the previous segment, on which the context menu was opened. [#8225](https://github.com/scalableminds/webknossos/pull/8225)
- Fixed a bug when importing an NML with groups when only groups but no trees exist in an annotation. [#8176](https://github.com/scalableminds/webknossos/pull/8176)
- Fixed a bug where trying to delete a non-existing node (via the API, for example) would delete the whole active tree. [#8176](https://github.com/scalableminds/webknossos/pull/8176)
- Fixed some layout issues in the upload view. [#8231](https://github.com/scalableminds/webknossos/pull/8231)
philippotto marked this conversation as resolved.
Show resolved Hide resolved

### Removed
- Removed Google Analytics integration. [#8201](https://github.com/scalableminds/webknossos/pull/8201)
Expand Down
54 changes: 23 additions & 31 deletions frontend/javascripts/admin/dataset/dataset_add_view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -306,40 +306,32 @@ const getPostUploadModal = (
{datasetNeedsConversion ? " and a conversion job was started" : null}.
<br />
<div
className="centered-items"
style={{
display: "flex",
marginTop: 10,
}}
>
<div
className="centered-items"
style={{
marginTop: 10,
}}
>
{datasetNeedsConversion ? (
<React.Fragment>
<Button type="primary" onClick={() => history.push("/jobs")}>
View the Jobs Queue
</Button>
<Button onClick={() => history.push("/dashboard/datasets")}>Go to Dashboard</Button>
</React.Fragment>
) : (
<React.Fragment>
<Button
type="primary"
onClick={() => history.push(`/datasets/${organization}/${datasetName}/view`)}
>
View the Dataset
</Button>
<Button
onClick={() => history.push(`/datasets/${organization}/${datasetName}/edit`)}
>
Go to Dataset Settings
</Button>
<Button onClick={() => history.push("/dashboard/datasets")}>Go to Dashboard</Button>
</React.Fragment>
)}
</div>
{datasetNeedsConversion ? (
<React.Fragment>
<Button type="primary" onClick={() => history.push("/jobs")}>
View the Jobs Queue
</Button>
<Button onClick={() => history.push("/dashboard/datasets")}>Go to Dashboard</Button>
</React.Fragment>
) : (
<React.Fragment>
<Button
type="primary"
onClick={() => history.push(`/datasets/${organization}/${datasetName}/view`)}
>
View the Dataset
</Button>
<Button onClick={() => history.push(`/datasets/${organization}/${datasetName}/edit`)}>
Go to Dataset Settings
</Button>
<Button onClick={() => history.push("/dashboard/datasets")}>Go to Dashboard</Button>
</React.Fragment>
)}
</div>
</div>{" "}
</Modal>
Expand Down
39 changes: 12 additions & 27 deletions frontend/javascripts/admin/dataset/dataset_upload_view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ class DatasetUploadView extends React.Component<PropsWithFormAndRouter, State> {
return;
}

Toast.info("Uploading dataset");
this.setState({
isUploading: true,
});
Expand Down Expand Up @@ -349,7 +348,6 @@ class DatasetUploadView extends React.Component<PropsWithFormAndRouter, State> {
});
finishDatasetUpload(datastoreUrl, uploadInfo).then(
async () => {
Toast.success(messages["dataset.upload_success"]);
let maybeError;

if (this.state.needsConversion) {
Expand All @@ -370,25 +368,12 @@ class DatasetUploadView extends React.Component<PropsWithFormAndRouter, State> {
maybeError = error;
}

if (maybeError == null) {
Toast.info(
<React.Fragment>
The conversion for the uploaded dataset was started.
<br />
See{" "}
<a target="_blank" href="/jobs" rel="noopener noreferrer">
Processing Jobs
</a>{" "}
for an overview of running jobs.
</React.Fragment>,
);
} else {
if (maybeError != null) {
Toast.error(
"The conversion for the uploaded dataset could not be started. Please try again or contact us if this issue occurs again.",
"The upload was successful, but the conversion for the dataset could not be started. Please try again or contact us if this issue occurs again.",
);
}
}

this.setState({
isUploading: false,
isFinishing: false,
Expand Down Expand Up @@ -505,14 +490,14 @@ class DatasetUploadView extends React.Component<PropsWithFormAndRouter, State> {
}}
onCancel={this.cancelUpload}
>
<div
style={{
display: "flex",
alignItems: "center",
flexDirection: "column",
}}
>
<Spin spinning={isFinishing} style={{ marginTop: 4 }} tip="Processing uploaded files …">
<Spin spinning={isFinishing} style={{ marginTop: 4 }} tip="Processing uploaded files …">
<div
style={{
display: "flex",
alignItems: "center",
flexDirection: "column",
}}
>
<FolderOutlined
style={{
fontSize: 50,
Expand All @@ -531,8 +516,8 @@ class DatasetUploadView extends React.Component<PropsWithFormAndRouter, State> {
percent={Math.floor(uploadProgress * 1000) / 10}
status="active"
/>
</Spin>
</div>
</div>
</Spin>
</Modal>
);
};
Expand Down
22 changes: 12 additions & 10 deletions frontend/javascripts/components/brain_spinner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,18 @@ export function BrainSpinnerWithError({
<div style={{ textAlign: "center" }}>
{gotUnhandledError ? messages["tracing.unhandled_initialization_error"] : message}
</div>
{organizationToSwitchTo != null ? <div>{switchToOwningOrganizationButton}</div> : null}
<div>
<Link
to="/"
style={{
marginTop: 16,
}}
>
<Button type="primary">Return to dashboard</Button>
</Link>
<div className="flex-center-child" style={{ gap: 8 }}>
{organizationToSwitchTo != null ? <div>{switchToOwningOrganizationButton}</div> : null}
<div>
<Link
to="/"
style={{
marginTop: 16,
}}
>
<Button type="primary">Return to dashboard</Button>
</Link>
</div>
</div>
</>
}
Expand Down
1 change: 0 additions & 1 deletion frontend/javascripts/messages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,6 @@ instead. Only enable this option if you understand its effect. All layers will n
"Resets this task instance to its initial state, undoing any annotation work of the assigned user. The task will remain assigned to this user for further annotation work.",
"task.tooltip_explain_reset_cancel":
"Resets this task instance to its initial state, undoing any annotation work of the assigned user. Furthermore, the task assignment will be removed from the user’s account and recycled into the pool of available tasks for other users. The currently assigned user will not be assigned to this task again (unless they are an Admin).",
"dataset.upload_success": "The dataset was uploaded successfully.",
"dataset.upload_failed": "The dataset upload failed.",
"dataset.upload_cancel": "The dataset upload was cancelled.",
"dataset.unsupported_file_type":
Expand Down