From 232828971fc4dcd6b1197fcdbac3e053b41475b9 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 12 Aug 2018 22:03:40 +0200 Subject: [PATCH 1/4] added a popover-link to the name of explorative annotations in the explorative annotations view --- .../dashboard/explorative_annotations_view.js | 35 +++++++++++++++---- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/app/assets/javascripts/dashboard/explorative_annotations_view.js b/app/assets/javascripts/dashboard/explorative_annotations_view.js index 2990df151a6..335426d3b73 100644 --- a/app/assets/javascripts/dashboard/explorative_annotations_view.js +++ b/app/assets/javascripts/dashboard/explorative_annotations_view.js @@ -6,7 +6,7 @@ import * as React from "react"; import { Link, withRouter } from "react-router-dom"; import Request from "libs/request"; import { AsyncLink } from "components/async_clickables"; -import { Spin, Input, Table, Button, Modal, Tag, Icon } from "antd"; +import { Spin, Input, Table, Button, Modal, Tag, Icon, Popover } from "antd"; import FormatUtils from "libs/format_utils"; import Toast from "libs/toast"; import Utils from "libs/utils"; @@ -336,6 +336,30 @@ class ExplorativeAnnotationsView extends React.PureComponent { ); } + renderNameWithDescription(tracing: APIAnnotationType) { + return ( + + {tracing.description && tracing.description !== "" + ? tracing.description + : ""} + + } + placement="topLeft" + > +
+ this.renameTracing(tracing, newName)} + /> +
+
+ ); + } + renderTable() { return ( { title="Name" dataIndex="name" sorter={Utils.localeCompareBy(typeHint, "name")} - render={(name: string, tracing: APIAnnotationType) => ( - this.renameTracing(tracing, newName)} - /> - )} + render={(name: string, tracing: APIAnnotationType) => + this.renderNameWithDescription(tracing) + } /> Date: Sun, 12 Aug 2018 22:12:23 +0200 Subject: [PATCH 2/4] updated changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 22fee94cb74..7463c78d996 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.md). - Added two new properties to mapping json files. The `colors: [, , ...]` property can be used to specify up to 256 custom colors for the first 256 equivalence classes of the mapping. The `hideUnmappedIds: ` property indicates whether segments that were not mapped should be rendered transparently or not. [#2965](https://github.com/scalableminds/webknossos/pull/2965) - Added a button for refreshing the dataset in the backend cache. [#2975](https://github.com/scalableminds/webknossos/pull/2975) +- Added a popover to the explorative annotations view that displays when hovered over the name of an annotation. [#3035](https://github.com/scalableminds/webknossos/pull/3035) - All dates in webknossos will be shown in the browser's timezone. On hover, a tooltip will show the date in UTC. [#2916](https://github.com/scalableminds/webknossos/pull/2916) ![image](https://user-images.githubusercontent.com/2486553/42888385-74c82bc0-8aa8-11e8-9c3e-7cfc90ce93bc.png) - When merging datasets within a tracing via the merge-modal, the user can choose whether the merge should be executed directly in the currently opened tracing. Alternatively, a new annotation can be created which is accessible via the dashboard (as it has been before). - Added shortcuts for moving along the current tracing direction in orthogonal mode. Pressing 'e' (and 'r' for the reverse direction) will move along the "current direction", which is defined by the vector between the last two created nodes. From 1c456e90181218be16ef7718a5d134a1d2f73212 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 13 Aug 2018 13:58:47 +0200 Subject: [PATCH 3/4] changed changelog entry and added a tooltip to hint at the description button --- CHANGELOG.md | 2 +- .../dashboard/explorative_annotations_view.js | 43 ++++++++++--------- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7463c78d996..b59fe7306a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.md). - Added two new properties to mapping json files. The `colors: [, , ...]` property can be used to specify up to 256 custom colors for the first 256 equivalence classes of the mapping. The `hideUnmappedIds: ` property indicates whether segments that were not mapped should be rendered transparently or not. [#2965](https://github.com/scalableminds/webknossos/pull/2965) - Added a button for refreshing the dataset in the backend cache. [#2975](https://github.com/scalableminds/webknossos/pull/2975) -- Added a popover to the explorative annotations view that displays when hovered over the name of an annotation. [#3035](https://github.com/scalableminds/webknossos/pull/3035) +- Added the possibility to see the description of a tracing within the dashboard. [#3035](https://github.com/scalableminds/webknossos/pull/3035) - All dates in webknossos will be shown in the browser's timezone. On hover, a tooltip will show the date in UTC. [#2916](https://github.com/scalableminds/webknossos/pull/2916) ![image](https://user-images.githubusercontent.com/2486553/42888385-74c82bc0-8aa8-11e8-9c3e-7cfc90ce93bc.png) - When merging datasets within a tracing via the merge-modal, the user can choose whether the merge should be executed directly in the currently opened tracing. Alternatively, a new annotation can be created which is accessible via the dashboard (as it has been before). - Added shortcuts for moving along the current tracing direction in orthogonal mode. Pressing 'e' (and 'r' for the reverse direction) will move along the "current direction", which is defined by the vector between the last two created nodes. diff --git a/app/assets/javascripts/dashboard/explorative_annotations_view.js b/app/assets/javascripts/dashboard/explorative_annotations_view.js index 335426d3b73..404475ee4c8 100644 --- a/app/assets/javascripts/dashboard/explorative_annotations_view.js +++ b/app/assets/javascripts/dashboard/explorative_annotations_view.js @@ -6,7 +6,7 @@ import * as React from "react"; import { Link, withRouter } from "react-router-dom"; import Request from "libs/request"; import { AsyncLink } from "components/async_clickables"; -import { Spin, Input, Table, Button, Modal, Tag, Icon, Popover } from "antd"; +import { Spin, Input, Table, Button, Modal, Tag, Icon, Popover, Tooltip } from "antd"; import FormatUtils from "libs/format_utils"; import Toast from "libs/toast"; import Utils from "libs/utils"; @@ -338,25 +338,28 @@ class ExplorativeAnnotationsView extends React.PureComponent { renderNameWithDescription(tracing: APIAnnotationType) { return ( - - {tracing.description && tracing.description !== "" - ? tracing.description - : ""} - - } - placement="topLeft" - > -
- this.renameTracing(tracing, newName)} - /> -
-
+ + this.renameTracing(tracing, newName)} + /> + Show description } placement="bottom"> + + {tracing.description && tracing.description !== "" + ? tracing.description + : "No description"} + + } + > + +
+ + + ); } From ae849b591aaedc9c8cdcc1ef1f4465c2a4d41fcc Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 13 Aug 2018 16:22:38 +0200 Subject: [PATCH 4/4] fixed flow errors --- .../javascripts/dashboard/explorative_annotations_view.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/dashboard/explorative_annotations_view.js b/app/assets/javascripts/dashboard/explorative_annotations_view.js index 1d019310559..eeab471dec4 100644 --- a/app/assets/javascripts/dashboard/explorative_annotations_view.js +++ b/app/assets/javascripts/dashboard/explorative_annotations_view.js @@ -336,7 +336,7 @@ class ExplorativeAnnotationsView extends React.PureComponent { ); } - renderNameWithDescription(tracing: APIAnnotationType) { + renderNameWithDescription(tracing: APIAnnotationTypeCompact) { return ( { title="Name" dataIndex="name" sorter={Utils.localeCompareBy(typeHint, "name")} - render={(name: string, tracing: APIAnnotationType) => + render={(name: string, tracing: APIAnnotationTypeCompact) => this.renderNameWithDescription(tracing) } />