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

Make hybrid annotations the default #4939

Merged
merged 17 commits into from
Dec 2, 2020
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
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
20 changes: 9 additions & 11 deletions app/models/binary/DataSetService.scala
Original file line number Diff line number Diff line change
Expand Up @@ -243,22 +243,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
6 changes: 6 additions & 0 deletions frontend/javascripts/admin/admin_rest_api.js
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,12 @@ export async function getDatasets(
const datasets = await Request.receiveJSON(`/api/datasets${parameters}`);
assertResponseLimit(datasets);

datasets.forEach(dataset => {
if (dataset.isActive && dataset.dataSource.dataLayers == null) {
dataset.dataSource.dataLayers = [];
}
});

philippotto marked this conversation as resolved.
Show resolved Hide resolved
return datasets;
}

Expand Down
Loading