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

Show active users modal #2863

Merged
merged 32 commits into from
Aug 13, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
4c0ccc9
Added usersWithOpenTasks to the admin api. Added a button to the proj…
MichaelBuessemeyer Jul 4, 2018
c65843c
added method to transfer many tasks at once to admin_rest_api, create…
MichaelBuessemeyer Jul 6, 2018
18129e5
adding a fetch function, that fetches all users with open tasks -> on…
MichaelBuessemeyer Jul 6, 2018
a94b18f
creating mock data, ongoing
MichaelBuessemeyer Jul 6, 2018
d285460
added mock data, the modal is now working and displayable but has no …
MichaelBuessemeyer Jul 8, 2018
93bce49
fixed flow errors
MichaelBuessemeyer Jul 8, 2018
f31013b
fixed flow errors and added some error handling if no project was sel…
MichaelBuessemeyer Jul 9, 2018
a3acacf
[WIP] transfer annotations to different user for api #2862
Jul 9, 2018
5628221
Merge branch 'master' of github.com:scalableminds/webknossos into add…
Jul 9, 2018
df84522
[WIP] route for transferring active tasks of a project to a user #2862
Jul 9, 2018
b88a2ea
routes for showing active tasks and transfering them #2862
Jul 9, 2018
0aa6baf
Merge branch 'master' of github.com:scalableminds/webknossos into sho…
MichaelBuessemeyer Jul 9, 2018
16c6f52
Merge branch 'show-active-users-modal' of github.com:scalableminds/we…
Jul 9, 2018
7c958f5
added changelog, moved error message to messages, fixed flow error
MichaelBuessemeyer Jul 9, 2018
9c21832
added the request for active users to the admin_rest_api and used it …
MichaelBuessemeyer Jul 11, 2018
7fc64d3
added a type for activeUsers, added an api request to transfer all ac…
MichaelBuessemeyer Jul 12, 2018
923aaba
reverted changelog -> entry for this issue still missing
MichaelBuessemeyer Jul 12, 2018
586f21d
added changelog entry
MichaelBuessemeyer Jul 12, 2018
f368318
Merge branch 'master' into show-active-users-modal
MichaelBuessemeyer Jul 12, 2018
dd9c02b
added message for successful transfer, added transfer functionality, …
MichaelBuessemeyer Jul 12, 2018
1bf3214
Merge branch 'show-active-users-modal' of github.com:scalableminds/we…
MichaelBuessemeyer Jul 12, 2018
6ea5366
corrected changelog entry
MichaelBuessemeyer Jul 12, 2018
69ca333
added error handling to the transfer request, added an error message …
MichaelBuessemeyer Jul 12, 2018
3d0c911
refeshed snapshots
MichaelBuessemeyer Jul 12, 2018
330e19c
merge master into show-active-users-modal
fm3 Jul 30, 2018
c00e535
refactored requested changes
MichaelBuessemeyer Aug 9, 2018
b3e83a7
resolved conflicts
MichaelBuessemeyer Aug 9, 2018
464ac2e
updated snapshots and resolved auto merging errors
MichaelBuessemeyer Aug 9, 2018
f3c31b8
fixed flow type problems
MichaelBuessemeyer Aug 10, 2018
970f3d7
fixed linter issues
MichaelBuessemeyer Aug 10, 2018
0a2aba0
added a spinner while fetching data
MichaelBuessemeyer Aug 10, 2018
6b5b4af
disallow transferring tasks to users who cannot access the dataset
fm3 Aug 13, 2018
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
75 changes: 37 additions & 38 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,62 +1,61 @@
# Changelog

All notable user-facing changes to webknossos are documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Calendar Versioning](http://calver.org/) `0Y.0M.MICRO`.
For upgrade instructions, please check the [migration guide](MIGRATIONS.md).

## [Unreleased]

[Commits](https://github.com/scalableminds/webknossos/compare/18.07.0...HEAD)

### Added

- Added the task bounding box of a skeleton tracing to NML files. [#2827](https://github.com/scalableminds/webknossos/pull/2827) \
Example: `<taskBoundingBox topLeftX="0" topLeftY="0" topLeftZ="0" width="512" height="512" depth="512" />`
- Added the possibility to kick a user out of the organization team. [#2801](https://github.com/scalableminds/webknossos/pull/2801)
- Added a mandatory waiting interval of 10 seconds when getting a task with a new task type. The modal containing the task description cannot be closed earlier. These ten seconds should be used to fully understand the new task type. [#2793](https://github.com/scalableminds/webknossos/pull/2793)
- Added more debugging related information in case of unexpected errors. The additional information can be used when reporting the error. [#2766](https://github.com/scalableminds/webknossos/pull/2766)
- Added permission for team managers to create explorational tracings on datasets without allowed teams. [#2758](https://github.com/scalableminds/webknossos/pull/2758)
- Added higher-resolution images for dataset gallery thumbnails. [#2745](https://github.com/scalableminds/webknossos/pull/2745)
- Added permission for admins to get tasks from all projects in their organization. [#2728](https://github.com/scalableminds/webknossos/pull/2728)
- Added the shortcut to copy the currently hovered cell id (CTRL + I) to non-volume-tracings, too. [#2726](https://github.com/scalableminds/webknossos/pull/2726)
- Added permission for team managers to refresh datasets. [#2688](https://github.com/scalableminds/webknossos/pull/2688)
- Added backend-unit-test setup and a first test for NML validation. [#2829](https://github.com/scalableminds/webknossos/pull/2829)

* Added a button to the administration/project-tab, that displays a modal with all users with active annotations of the selected project. All these annotations can be transfered to a single user [#2670](https://github.com/scalableminds/webknossos/issues/2670)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MichaelBuessemeyer You accidently re-formatted the whole CHANGELOG.md file (or better, the prettier sublime plugin did). Please revert the changes in this file, add the following to your JsPrettier sublime user config: "auto_format_on_save_excludes": ["*/node_modules/*","*.md"] (so .md files are no longer "prettified", and then re-add your changelog entry :)

* Added the task bounding box of a skeleton tracing to NML files. [#2827](https://github.com/scalableminds/webknossos/pull/2827) \
Example: `<taskBoundingBox topLeftX="0" topLeftY="0" topLeftZ="0" width="512" height="512" depth="512" />`
* Added the possibility to kick a user out of the organization team. [#2801](https://github.com/scalableminds/webknossos/pull/2801)
* Added a mandatory waiting interval of 10 seconds when getting a task with a new task type. The modal containing the task description cannot be closed earlier. These ten seconds should be used to fully understand the new task type. [#2793](https://github.com/scalableminds/webknossos/pull/2793)
* Added more debugging related information in case of unexpected errors. The additional information can be used when reporting the error. [#2766](https://github.com/scalableminds/webknossos/pull/2766)
* Added permission for team managers to create explorational tracings on datasets without allowed teams. [#2758](https://github.com/scalableminds/webknossos/pull/2758)
* Added higher-resolution images for dataset gallery thumbnails. [#2745](https://github.com/scalableminds/webknossos/pull/2745)
* Added permission for admins to get tasks from all projects in their organization. [#2728](https://github.com/scalableminds/webknossos/pull/2728)
* Added the shortcut to copy the currently hovered cell id (CTRL + I) to non-volume-tracings, too. [#2726](https://github.com/scalableminds/webknossos/pull/2726)
* Added permission for team managers to refresh datasets. [#2688](https://github.com/scalableminds/webknossos/pull/2688)
* Added backend-unit-test setup and a first test for NML validation. [#2829](https://github.com/scalableminds/webknossos/pull/2829)

### Changed

- Improved the search functionality in the datasets view. The datasets will be sorted so that the best match is shown first. If a different sorting is desired, the sorting-arrows in the columns can still be used to change the sorting criteria. [#2834](https://github.com/scalableminds/webknossos/pull/2834)
- Improved performance in orthogonal mode. [#2821](https://github.com/scalableminds/webknossos/pull/2821)
- When deleting the last node of a tree, that tree will not be removed automatically anymore. Instead, the tree will just be empty. To remove that active tree, the "delete" shortcut can be used again. [#2806](https://github.com/scalableminds/webknossos/pull/2806)
- Changed the type of the initial node of new tasks to be a branchpoint (if not created via NML). [#2799](https://github.com/scalableminds/webknossos/pull/2799)
- The dataset gallery got a redesign with mobile support. [#2761](https://github.com/scalableminds/webknossos/pull/2761)
- Improved loading speed of buckets. [#2724](https://github.com/scalableminds/webknossos/pull/2724)
- Changed the task search, when filtered by user, to show all instead of just active tasks (except for canceled tasks). [#2774](https://github.com/scalableminds/webknossos/pull/2774)
- Hid old paused projects in the project progress report even if they have open instances. [#2768](https://github.com/scalableminds/webknossos/pull/2768)
- Excluded canceled tasks and base tracings from the list at `api/projects/:name/usersWithOpenTasks`. [#2765](https://github.com/scalableminds/webknossos/pull/2765)
- Streamlined the order in which initial buckets are loaded when viewing a dataset. [#2749](https://github.com/scalableminds/webknossos/pull/2749)
- Reduced the number of scenarios in which segmentation-related warnings are shown (e.g, not for skeleton tracings when there are multiple resolutions for segmentations anyway). [#2715](https://github.com/scalableminds/webknossos/pull/2715)
- Improved tracing view page load performance by decreasing WebGL shader compilation time. [#2709](https://github.com/scalableminds/webknossos/pull/2709)

* Improved the search functionality in the datasets view. The datasets will be sorted so that the best match is shown first. If a different sorting is desired, the sorting-arrows in the columns can still be used to change the sorting criteria. [#2834](https://github.com/scalableminds/webknossos/pull/2834)
* Improved performance in orthogonal mode. [#2821](https://github.com/scalableminds/webknossos/pull/2821)
* When deleting the last node of a tree, that tree will not be removed automatically anymore. Instead, the tree will just be empty. To remove that active tree, the "delete" shortcut can be used again. [#2806](https://github.com/scalableminds/webknossos/pull/2806)
* Changed the type of the initial node of new tasks to be a branchpoint (if not created via NML). [#2799](https://github.com/scalableminds/webknossos/pull/2799)
* The dataset gallery got a redesign with mobile support. [#2761](https://github.com/scalableminds/webknossos/pull/2761)
* Improved loading speed of buckets. [#2724](https://github.com/scalableminds/webknossos/pull/2724)
* Changed the task search, when filtered by user, to show all instead of just active tasks (except for canceled tasks). [#2774](https://github.com/scalableminds/webknossos/pull/2774)
* Hid old paused projects in the project progress report even if they have open instances. [#2768](https://github.com/scalableminds/webknossos/pull/2768)
* Excluded canceled tasks and base tracings from the list at `api/projects/:name/usersWithOpenTasks`. [#2765](https://github.com/scalableminds/webknossos/pull/2765)
* Streamlined the order in which initial buckets are loaded when viewing a dataset. [#2749](https://github.com/scalableminds/webknossos/pull/2749)
* Reduced the number of scenarios in which segmentation-related warnings are shown (e.g, not for skeleton tracings when there are multiple resolutions for segmentations anyway). [#2715](https://github.com/scalableminds/webknossos/pull/2715)
* Improved tracing view page load performance by decreasing WebGL shader compilation time. [#2709](https://github.com/scalableminds/webknossos/pull/2709)

### Fixed

- Fixed a bug which caused segmentation data to be requested as four-bit when four-bit-mode was enabled. [#2828](https://github.com/scalableminds/webknossos/pull/2828)
- Fixed a bug which caused projects to be unpaused when the project priority was changed. [#2795](https://github.com/scalableminds/webknossos/pull/2795)
- Fixed an unnecessary warning when deleting a tree in a task, that warned about deleting the initial node although the initial node was not contained in the deleted tree. [#2812](https://github.com/scalableminds/webknossos/pull/2812)
- Fixed a bug where the comment tab was scrolled into view horizontally if a node with a comment was activated. [#2805](https://github.com/scalableminds/webknossos/pull/2805)
- Fixed a bug in for Firefox users where a long tree list created an unnecessary scroll region. [#2787](https://github.com/scalableminds/webknossos/pull/2787)
- Fixed clicking on a task type within the task list page, so that the task type page will actually only show the linked task type. [#2769](https://github.com/scalableminds/webknossos/pull/2769)
- Fixed clicking on a project within the task list page, so that the project page will actually only show the linked project. [#2759](https://github.com/scalableminds/webknossos/pull/2759)
- Fixed a bug where cell IDs in the segmentation tab were not shown for all zoomsteps. [#2726](https://github.com/scalableminds/webknossos/pull/2726)
- Fixed the naming of the initial tree in tasks. [#2689](https://github.com/scalableminds/webknossos/pull/2689)
- Fixed a regression affecting node selection, shortcuts and 3d viewport navigation. [#2673](https://github.com/scalableminds/webknossos/pull/2673)
- Fixed the dataset zip upload for dataSets, which only have one dataLayer and no config file. [#2840](https://github.com/scalableminds/webknossos/pull/2840)

* Fixed a bug which caused segmentation data to be requested as four-bit when four-bit-mode was enabled. [#2828](https://github.com/scalableminds/webknossos/pull/2828)
* Fixed a bug which caused projects to be unpaused when the project priority was changed. [#2795](https://github.com/scalableminds/webknossos/pull/2795)
* Fixed an unnecessary warning when deleting a tree in a task, that warned about deleting the initial node although the initial node was not contained in the deleted tree. [#2812](https://github.com/scalableminds/webknossos/pull/2812)
* Fixed a bug where the comment tab was scrolled into view horizontally if a node with a comment was activated. [#2805](https://github.com/scalableminds/webknossos/pull/2805)
* Fixed a bug in for Firefox users where a long tree list created an unnecessary scroll region. [#2787](https://github.com/scalableminds/webknossos/pull/2787)
* Fixed clicking on a task type within the task list page, so that the task type page will actually only show the linked task type. [#2769](https://github.com/scalableminds/webknossos/pull/2769)
* Fixed clicking on a project within the task list page, so that the project page will actually only show the linked project. [#2759](https://github.com/scalableminds/webknossos/pull/2759)
* Fixed a bug where cell IDs in the segmentation tab were not shown for all zoomsteps. [#2726](https://github.com/scalableminds/webknossos/pull/2726)
* Fixed the naming of the initial tree in tasks. [#2689](https://github.com/scalableminds/webknossos/pull/2689)
* Fixed a regression affecting node selection, shortcuts and 3d viewport navigation. [#2673](https://github.com/scalableminds/webknossos/pull/2673)
* Fixed the dataset zip upload for dataSets, which only have one dataLayer and no config file. [#2840](https://github.com/scalableminds/webknossos/pull/2840)

### Removed


## [18.07.0](https://github.com/scalableminds/webknossos/releases/tag/18.07.0) - 2018-07-05

First release
87 changes: 45 additions & 42 deletions app/assets/javascripts/admin/project/transfer_all_tasks_modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Spin, Modal, Button, Select, Table } from "antd";
import { getUsers } from "admin/admin_rest_api";
import type { APIUserType, APIProjectType } from "admin/api_flow_types";
import Toast from "libs/toast";
import messages from "messages";

const { Option } = Select;

Expand Down Expand Up @@ -154,56 +155,58 @@ class TransferAllTasksModal extends React.PureComponent<Props, State> {
);
}

// TODO own users does not show up !!
// use newly available api requests
render() {
if (!this.props.visible) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be removed as you already check that in the outer component.

return null;
}
const errorMessage = "No selected project found";
if (!this.props.project) {
// TODO move to messages
Toast.error(errorMessage);
const project = this.props.project;
if (!project) {
Toast.error(messages["project.none_selected"]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When does this happen? Showing a toast is a side effect (if the render function is called twice and this block is executed, there will be two toast notifications). In general, side effects should be avoided within the render function, as it can be executed various times. In this specific scenario, I would just remove the toast.error line. Instead leave the return null line.

return null;
}
Toast.close(errorMessage); // TODO -> display Toast properly
const title = `All users with open tasks of ${this.props.project.name}`;
return (
<Modal
title={title}
visible={this.props.visible}
onCancel={this.props.onCancel}
pagination="false"
footer={
} else {
Toast.close(messages["project.none_selected"]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here. If you would like to show such message (when does this happen?), you can just return the message, as this will be the content of the modal.

const title = `All users with open tasks of ${project.name}`;
return (
<Modal
title={title}
visible={this.props.visible}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the modal will always be visible when this component is rendered you can just write <Modal title={title} visible onCancel=....

onCancel={this.props.onCancel}
pagination="false"
footer={
<div>
<Button
type="primary"
disabled={this.state.currentUserIdValue === ""}
onClick={() => this.props.onSubmit()}
>
Transfer all tasks
</Button>
<Button onClick={() => this.props.onCancel()}>Close</Button>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can just write onClick={this.props.onCancel}. The arrow function would be important, if the context is important. However, the parent component has to take care of that, anyway, since you are getting that value from props.

In line 164, you could also write onClick={this.transferAllActiveTasks} if you define the corresponding function like transferAllActiveTasks = async () => {.... However, the current way is also fine :)

</div>
}
>
<div>
<Button
type="primary"
disabled={this.state.currentUserIdValue === ""}
onClick={() => this.props.onSubmit()}
>
Transfer all tasks
</Button>
<Button onClick={() => this.props.onCancel()}>Close</Button>
{this.renderTableContent()}
<br />
<br />
</div>
}
>
<div>
{this.renderTableContent()}
<br />
<br />
</div>
Select a user to transfer the tasks to:
<div className="control-group">
<div className="form-group">
{this.state.isLoading ? (
<div className="text-center">
<Spin size="large" />
</div>
) : (
this.renderFormContent()
)}
Select a user to transfer the tasks to:
<div className="control-group">
<div className="form-group">
{this.state.isLoading ? (
<div className="text-center">
<Spin size="large" />
</div>
) : (
this.renderFormContent()
)}
</div>
</div>
</div>
</Modal>
);
</Modal>
);
}
}
}

Expand Down
1 change: 1 addition & 0 deletions app/assets/javascripts/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ In order to restore the current window, a reload is necessary.`,
"project.delete": "Do you really want to delete this project?",
"project.increase_instances":
"Do you really want to add one additional instance to all tasks of this project?",
"project.none_selected": "No currently selected project found",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make sure that the messages are ended with a fullstop.

"script.delete": "Do you really want to delete this script?",
"team.delete": "Do you really want to delete this team?",
"taskType.delete": "Do you really want to delete this task type?",
Expand Down