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

Improve upload UI #5081

Merged
merged 31 commits into from
Feb 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
5d48c4d
implement first few points of rework
MichaelBuessemeyer Jan 18, 2021
63699cb
let frontend determine dataset format to opt in the dataset scale field
MichaelBuessemeyer Jan 22, 2021
6c5aee4
Merge branch 'auto-detect-needs-conversion' into improve-upload-ui
MichaelBuessemeyer Jan 22, 2021
741a588
WIP: further work on the upload ui
MichaelBuessemeyer Jan 22, 2021
3982cc6
add after upload modal content for navigation help
MichaelBuessemeyer Jan 22, 2021
a23103e
handle after upload in the upload component except for onboarding
MichaelBuessemeyer Jan 22, 2021
b85e2ad
Merge branch 'master' of github.com:scalableminds/webknossos into imp…
MichaelBuessemeyer Jan 25, 2021
23dc673
change folder svg to antd's folder icon
MichaelBuessemeyer Jan 25, 2021
f0ae8a1
catch zip file parsing errors
MichaelBuessemeyer Jan 25, 2021
f77af96
make progress bar blue only
MichaelBuessemeyer Jan 29, 2021
f558553
fix error: file being undefined
MichaelBuessemeyer Jan 29, 2021
f44bc17
validate file extension of selected file
MichaelBuessemeyer Jan 29, 2021
727ab1e
apply feedback
MichaelBuessemeyer Jan 29, 2021
4dea325
add changelog entry
MichaelBuessemeyer Feb 1, 2021
6c7b2fc
fixed onboarding upload by fetching datastores after registration
MichaelBuessemeyer Feb 5, 2021
b9c31a3
increase button size
MichaelBuessemeyer Feb 5, 2021
2eb3f66
small fixes & remove conversion indication from upload component
MichaelBuessemeyer Feb 5, 2021
76b71e8
Merge branch 'master' of github.com:scalableminds/webknossos into imp…
MichaelBuessemeyer Feb 5, 2021
417eb47
fix linting
MichaelBuessemeyer Feb 5, 2021
a662823
apply ui feedback
MichaelBuessemeyer Feb 8, 2021
7e5a4bd
Apply suggestions from code review
MichaelBuessemeyer Feb 8, 2021
7c01105
Merge branch 'improve-upload-ui' of github.com:scalableminds/webknoss…
MichaelBuessemeyer Feb 8, 2021
d0f138e
Merge branch 'master' into improve-upload-ui
MichaelBuessemeyer Feb 8, 2021
c53800a
auto select the default team in demo instance when upoading a dataset
MichaelBuessemeyer Feb 12, 2021
4a16efe
Merge branch 'improve-upload-ui' of github.com:scalableminds/webknoss…
MichaelBuessemeyer Feb 12, 2021
4181de3
Update frontend/javascripts/messages.js
MichaelBuessemeyer Feb 12, 2021
222c12a
Merge branch 'master' into improve-upload-ui
MichaelBuessemeyer Feb 12, 2021
2dbdcdc
add help block (#5162)
normanrz Feb 13, 2021
e87599b
fix auto selecting team on upload
MichaelBuessemeyer Feb 15, 2021
f1bf173
don't show 100% progress in upload view to avoid that the exists page…
philippotto Feb 16, 2021
6d7525a
Merge branch 'master' into improve-upload-ui
philippotto Feb 16, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released
- For webKnossos maintenance, superUsers can now join organizations without being listed as a user there. [#5151](https://github.com/scalableminds/webknossos/pull/5151)

### Changed
- Before uploading a dataset webKnossos automatically checks whether a conversion and scale are needed. Additionally, the Upload UI was improved. [#5081](https://github.com/scalableminds/webknossos/issues/5081)
- Make the isosurface feature in the meshes tab more robust. If a request fails, a retry is initiated. [#5102](https://github.com/scalableminds/webknossos/pull/5102)
- Support for the old invite links was removed. These contained the organization name in the URL. The new links contain a token (can be generated in the users view). For instances with a single organization the old invite links should still work. [#5091](https://github.com/scalableminds/webknossos/pull/5091/files)
- Users are no longer allowed to deactivate their own accounts. [#5070](https://github.com/scalableminds/webknossos/pull/5070)
Expand Down
1 change: 1 addition & 0 deletions flow-typed/npm/antd_vx.x.x.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ declare module "antd" {
declare export class Modal<P> extends React$Component<P> {
static confirm: Function;
static info: Function;
static error: Function;
}
declare export var notification: Object;
declare export class Pagination<P> extends React$Component<P> {}
Expand Down
80 changes: 66 additions & 14 deletions frontend/javascripts/admin/dataset/dataset_add_view.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @flow
import { type RouterHistory, withRouter } from "react-router-dom";
import { Tabs, Icon } from "antd";
import React from "react";
import { Tabs, Icon, Modal, Button } from "antd";
import React, { useState } from "react";
import { connect } from "react-redux";
import _ from "lodash";

Expand All @@ -14,10 +14,9 @@ import DatasetAddBossView from "admin/dataset/dataset_add_boss_view";
import DatasetUploadView from "admin/dataset/dataset_upload_view";
import SampleDatasetsModal from "dashboard/dataset/sample_datasets_modal";
import features from "features";
import { getDatastores, startJob } from "admin/admin_rest_api";
import { getDatastores } from "admin/admin_rest_api";
import renderIndependently from "libs/render_independently";
import { useFetch } from "libs/react_helpers";
import { type Vector3 } from "oxalis/constants";

const { TabPane } = Tabs;

Expand Down Expand Up @@ -52,21 +51,60 @@ const fetchCategorizedDatastores = async (): Promise<{

const DatasetAddView = ({ history, activeUser }: PropsWithRouter) => {
const datastores = useFetch(fetchCategorizedDatastores, { own: [], wkConnect: [] }, []);
const [datasetName, setDatasetName] = useState("");
const [organization, setOrganization] = useState("");
const [datasetNeedsConversion, setDatasetNeedsConversion] = useState(false);

const handleDatasetAdded = async (
organization: string,
datasetName: string,
datasetOrganization: string,
uploadedDatasetName: string,
needsConversion: ?boolean,
scale: ?Vector3,
): Promise<void> => {
if (needsConversion && scale) {
await startJob(datasetName, organization, scale);
const url = "/jobs";
history.push(url);
} else {
const url = `/datasets/${organization}/${datasetName}/import`;
history.push(url);
setOrganization(datasetOrganization);
setDatasetName(uploadedDatasetName);
setDatasetNeedsConversion(needsConversion);
};

const showAfterUploadContent = datasetName !== "";

const getAfterUploadModalContent = () => {
if (!showAfterUploadContent) {
return null;
}
return (
<div style={{ fontSize: 20, paddingTop: 13, textAlign: "center" }}>
The dataset was uploaded successfully
{datasetNeedsConversion ? " and a conversion job was started." : null}.
<br />
<div style={{ display: "flex", justifyContent: "center" }}>
<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}/import`)}
>
Got to Dataset Settings
</Button>
<Button onClick={() => history.push("/dashboard/datasets")}>Go to Dashboard</Button>
</React.Fragment>
)}
</div>
</div>
</div>
);
};

return (
Expand Down Expand Up @@ -134,6 +172,20 @@ const DatasetAddView = ({ history, activeUser }: PropsWithRouter) => {
</a>
</p>
</div>
<Modal
visible={showAfterUploadContent}
closable={showAfterUploadContent}
keyboard={showAfterUploadContent}
maskClosable={false}
className="no-footer-modal"
cancelButtonProps={{ style: { display: "none" } }}
okButtonProps={{ style: { display: "none" } }}
onCancel={() => setDatasetName("")}
onOk={() => setDatasetName("")}
width={580}
>
{showAfterUploadContent && getAfterUploadModalContent()}
</Modal>
</React.Fragment>
);
};
Expand Down
4 changes: 3 additions & 1 deletion frontend/javascripts/admin/dataset/dataset_components.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,15 @@ export function DatasetNameFormItem({ form, activeUser }: { form: Object, active
export function DatastoreFormItem({
form,
datastores,
hidden,
}: {
form: Object,
datastores: Array<APIDataStore>,
hidden?: boolean,
}) {
const { getFieldDecorator } = form;
return (
<FormItem label="Datastore" hasFeedback>
<FormItem label="Datastore" hasFeedback hidden={hidden || false}>
{getFieldDecorator("datastore", {
rules: [{ required: true, message: messages["dataset.import.required.datastore"] }],
initialValue: datastores.length ? datastores[0].url : null,
Expand Down
Loading