From e4f1cf844db34b162f407acd29ebc27bce1d1f6f Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 16 Jul 2018 13:11:56 +0200 Subject: [PATCH] Redesign user task list (#2861) * for user task list, show cards with full task type description instead of a table (#2817) * sort user task list by ascending creation date (#2817) * fix minute part of the displayed creation date, which was configured to show seconds * add mailable description to changelog (#2861) * minor design tweaks for user-task-list * switch description and action pane in user-task-list --- CHANGELOG.md | 5 +- .../admin/task/task_annotation_view.js | 2 +- .../admin/tasktype/task_type_list_view.js | 2 +- .../dashboard/dashboard_task_list_view.js | 117 +++++++----------- app/assets/stylesheets/_dashboard.less | 7 +- flow-typed/npm/antd_vx.x.x.js | 3 +- 6 files changed, 59 insertions(+), 77 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1cf1df9dbb..6360b89e0b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,7 +23,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.md). - 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 displayName for organizations [#2869](https://github.com/scalableminds/webknossos/pull/2869) + - Added displayName for organizations. [#2869](https://github.com/scalableminds/webknossos/pull/2869) - Added onboarding flow for initial setup of WebKnossos. [#2859](https://github.com/scalableminds/webknossos/pull/2859) - Added the possibility to show the task in a random order. [#2860](https://github.com/scalableminds/webknossos/pull/2860) @@ -42,6 +42,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.md). - 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) + - Redesigned the user task list to make it easier to read the whole task description. [#2861](https://github.com/scalableminds/webknossos/pull/2861) ### Fixed @@ -57,7 +58,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.md). - 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 the dataset zip upload for datasets, which only have one data layer and no config file. [#2840](https://github.com/scalableminds/webknossos/pull/2840) - Fixed a bug where task deletion broke the task listing for users who had active annotations for the task [#2884](https://github.com/scalableminds/webknossos/pull/2884) diff --git a/app/assets/javascripts/admin/task/task_annotation_view.js b/app/assets/javascripts/admin/task/task_annotation_view.js index e9beb0e00b..11a30762f4 100644 --- a/app/assets/javascripts/admin/task/task_annotation_view.js +++ b/app/assets/javascripts/admin/task/task_annotation_view.js @@ -163,7 +163,7 @@ class TaskAnnotationView extends React.PureComponent return ( {userString} - {moment(annotation.modified).format("YYYY-MM-DD HH:SS")} + {moment(annotation.modified).format("YYYY-MM-DD HH:mm")} diff --git a/app/assets/javascripts/admin/tasktype/task_type_list_view.js b/app/assets/javascripts/admin/tasktype/task_type_list_view.js index 5311a58e89..4bc0b6b1bd 100644 --- a/app/assets/javascripts/admin/tasktype/task_type_list_view.js +++ b/app/assets/javascripts/admin/tasktype/task_type_list_view.js @@ -157,7 +157,7 @@ class TaskTypeListView extends React.PureComponent { key="description" sorter={Utils.localeCompareBy(typeHint, "description")} render={description => ( -
+
{ return this.state.showFinishedTasks ? this.state.finishedTasks : this.state.unfinishedTasks; } - renderTable() { - return ( - { - if (this.state.showFinishedTasks) return task.annotation.state === "Finished"; - else return task.annotation.state !== "Finished"; - })} - rowKey="id" - pagination={{ - defaultPageSize: 50, - }} - style={{ overflowX: "auto" }} - > - - t.type.summary)} - /> - - t.type.description)} - render={description => ( -
+ renderTaskList() { + const tasks = this.getCurrentTasks().sort(Utils.localeCompareBy(typeHint, "created")); + const descriptionClassName = classNames("task-type-description", { + short: this.state.showFinishedTasks || this.props.isAdminView, + }); + + const TaskCardTitle = ({ task }) => ( + + {`${task.type.summary} (${moment(task.created).format( + "YYYY-MM-DD HH:mm", + )}) `} + {task.type.settings.allowedModes.map(mode => {mode})} + + ); + + const TaskCard = task => ( + } style={{ margin: "10px" }}> + +
+
- )} - width={550} - /> - t.type.settings.allowedModes.join("-"))} - render={modes => modes.map(mode => {mode})} - /> - moment(created).format("YYYY-MM-DD HH:SS")} - /> - this.renderActions(task)} - /> -
+ + +

+ Task ID: {task.id} +
+ Project: {task.projectName} +

+ {this.renderActions(task)} + + + + ); + + return ( + ); } @@ -405,9 +384,7 @@ class DashboardTaskListView extends React.PureComponent { Tasks
- - {this.renderTable()} - + {this.renderTaskList()} ; static SubMenu: React$ComponentType

; } + declare var message: Object; declare class Modal

extends React$Component

{ static confirm: Function; static info: Function; } declare var notification: Object; - declare var message: Object; + declare class Pagination

extends React$Component

{} declare class Popover

extends React$Component

{} declare class AutoComplete

extends React$Component

{ static Option: React$ComponentType<*>;