Skip to content

Commit

Permalink
Make hybrid annotations the default (#4939)
Browse files Browse the repository at this point in the history
* rework new-annotation-links to make the hybrid case the default (and also don't show fallback options when no segmentation layer exists)

* fix some styling and uint64 case

* workaround for inconsistent dataLayers (should always be an array if dataset.isActive is true)

* ensure active datasets have datalayers array even when it is empty

* undo empty dataLayers workaround

* undo empty dataLayers workaround and remove unnecessary type cast

* integrate further PR feedback to UI

* update changelog

* add itemgroup title with 'Other Options' to make clearer that the actual menu link can also be clicked

* separate new-annotation-dropdown into own dropdown so that the main 'New Annotation' link does not open a dropdown

* format

* remove redundant skeleton-only option

* fix linter

* format

Co-authored-by: Florian M <[email protected]>
  • Loading branch information
philippotto and fm3 authored Dec 2, 2020
1 parent c9fa0bc commit 2d3aa3e
Show file tree
Hide file tree
Showing 12 changed files with 245 additions and 228 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released
-

### Changed
- The menu for viewing, editing and creating annotations for a dataset in the dashboard was cleaned up a bit. Creating a hybrid (skeleton + volume) annotation is now the default way of annotating a dataset. The other options are still available via a dropdown. [#4939](https://github.com/scalableminds/webknossos/pull/4939)
- For 2d-only datasets the view mode toggle is hidden. [#4952](https://github.com/scalableminds/webknossos/pull/4952)

### Fixed
Expand Down
20 changes: 9 additions & 11 deletions app/models/binary/DataSetService.scala
Original file line number Diff line number Diff line change
Expand Up @@ -241,22 +241,20 @@ class DataSetService @Inject()(organizationDAO: OrganizationDAO,

def dataSourceFor(dataSet: DataSet, organization: Option[Organization] = None, skipResolutions: Boolean = false)(
implicit ctx: DBAccessContext): Fox[InboxDataSource] =
for {
(for {
organization <- Fox.fillOption(organization) {
organizationDAO.findOne(dataSet._organization)(GlobalAccessContext) ?~> "organization.notFound"
}
dataLayersBox <- dataSetDataLayerDAO.findAllForDataSet(dataSet._id, skipResolutions).futureBox
dataLayers <- dataSetDataLayerDAO.findAllForDataSet(dataSet._id, skipResolutions)
dataSourceId = DataSourceId(dataSet.name, organization.name)
} yield {
dataLayersBox match {
case Full(dataLayers) if (dataLayers.nonEmpty) =>
for {
scale <- dataSet.scale
} yield GenericDataSource[DataLayer](dataSourceId, dataLayers, scale)
case _ =>
Some(UnusableDataSource[DataLayer](dataSourceId, dataSet.status, dataSet.scale))
}
}
if (dataSet.isUsable)
for {
scale <- dataSet.scale.toFox ?~> "dataSet.source.usableButNoScale"
} yield GenericDataSource[DataLayer](dataSourceId, dataLayers, scale)
else
Fox.successful(UnusableDataSource[DataLayer](dataSourceId, dataSet.status, dataSet.scale))
}).flatten

def logoUrlFor(dataSet: DataSet, organization: Option[Organization]): Fox[String] =
dataSet.logoUrl match {
Expand Down
1 change: 1 addition & 0 deletions conf/messages
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ dataSet.import.impossible.name=Import impossible. Dataset name can only consist
dataSet.name.alreadyTaken=This dataset name is already in use.
dataSet.name.notInSamples=This dataset name is not one of the available sample datasets.
dataSet.source.notFound=The data source for the data source couldn’t be found
dataSet.source.usableButNoScale=Dataset {0} is marked as active but has no scale.
dataSet.import.success=The import of the dataset was successful
dataSet.import.failed=Failed to import the dataset
dataSet.import.fileAccessDenied=Cannot create organization folder. Please make sure webKnossos has write permissions in the “binaryData” directory
Expand Down
1 change: 0 additions & 1 deletion frontend/javascripts/admin/admin_rest_api.js
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,6 @@ export async function getDatasets(
const parameters = isUnreported != null ? `?isUnreported=${String(isUnreported)}` : "";
const datasets = await Request.receiveJSON(`/api/datasets${parameters}`);
assertResponseLimit(datasets);

return datasets;
}

Expand Down
Loading

0 comments on commit 2d3aa3e

Please sign in to comment.