Skip to content

Commit

Permalink
Redesign dataset gallery as publication gallery (#3653)
Browse files Browse the repository at this point in the history
* redesign spotlight view

* add publication to dataset

* update migration guide, schema number

* new snapshots + test db

* scalafmt

* minor cleanup

* first version of spotlight redesign with grouped publications

* make dataset gallery publication gallery

* add type for datasetDetails

* refresh snapshots

* apply PR feedback, enlarge thumbnails, click on mini-thumbnail opens dataset

* refresh snapshots

* also show segmentation in mini thumbnail, update changelog

* update migrations.md

* fix empty text if there are not featured publications

* refresh snapshots
  • Loading branch information
daniel-wer authored Jan 24, 2019
1 parent 55dbb60 commit dad5a33
Show file tree
Hide file tree
Showing 15 changed files with 530 additions and 685 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.md).

### Changed

- The Dataset Gallery was redesigned to be a Publication Gallery instead. It will feature scientific publications together with their published datasets and information such as the species, brain region or acquisition method of such datasets. [#3653](https://github.com/scalableminds/webknossos/pull/3653)
- Annotations for non-public datasets can now be shared using the "Share" functionality without making the dataset public. [#3664](https://github.com/scalableminds/webknossos/pull/3664)
- Statistics are now separated by organization, rather than showing the webKnossos instance’s totals. [#3663](https://github.com/scalableminds/webknossos/pull/3663)

Expand Down
8 changes: 7 additions & 1 deletion MIGRATIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ This project adheres to [Calendar Versioning](http://calver.org/) `0Y.0M.MICRO`.
User-facing changes are documented in the [changelog](CHANGELOG.md).

## Unreleased
-
- WebKnossos has a publication gallery now. There is no public interface to create publications yet, but instead those need to be inserted into the database directly.
Publications and additional dataset properties that are displayed in the gallery as well, can be inserted as follows:
```
insert into webknossos.publications(_id, publicationDate, imageUrl, title, description) values('5c3c9ec895010095014759fd', NOW(), '<LINK_TO_IMAGE>', '<TITLE>', '<DESCRIPTION>');
update webknossos.datasets set _publication = '5c3c9ec895010095014759fd', details='{"species":"<e.g. Mouse>", "brain-region":"<e.g. cortex>", "acquisition":"<e.g. Raw CLSM data>"}' where _id = '<DATASET_ID>' ;
```

### Postgres Evolutions:
- [037-add-publications.sql](conf/evolutions/037-add-publications.sql)
Expand Down
17 changes: 17 additions & 0 deletions app/assets/javascripts/admin/api_flow_types.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,23 +78,40 @@ export type APITeam = {
+organization: string,
};

type APIPublication = {
+created: number,
+description: string,
+id: string,
+imageUrl: string,
+publicationDate: number,
+title: string,
};

export type APIDatasetId = {
+owningOrganization: string,
+name: string,
};

export type APIDatasetDetails = {
+species?: string,
+brainRegion?: string,
+acquisition?: string,
};

type APIDatasetBase = APIDatasetId & {
+allowedTeams: Array<APITeam>,
+created: number,
+dataStore: APIDataStore,
+description: ?string,
+details: ?APIDatasetDetails,
+isEditable: boolean,
+isPublic: boolean,
+displayName: ?string,
+logoUrl: ?string,
+lastUsedByUser: number,
+isForeign: boolean,
+sortingKey: number,
+publication: ?APIPublication,
};

export type APIMaybeUnimportedDataset = APIDatasetBase & {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@ class DatasetActionView extends React.PureComponent<Props, State> {
) : null}
</React.Fragment>
) : null}
<a
href={`/datasets/${dataset.owningOrganization}/${dataset.name}/view`}
<Link
to={`/datasets/${dataset.owningOrganization}/${dataset.name}/view`}
title="View Dataset"
>
<Icon type="eye-o" />View
</a>
</Link>
{!dataset.isForeign ? (
<React.Fragment>
<a
Expand Down
10 changes: 5 additions & 5 deletions app/assets/javascripts/dashboard/dashboard_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import Request from "libs/request";

const TabPane = Tabs.TabPane;

const validTabKeys = ["datasets", "advanced-datasets", "tasks", "explorativeAnnotations"];
const validTabKeys = ["publications", "advanced-datasets", "tasks", "explorativeAnnotations"];

type OwnProps = {
userId: ?string,
Expand Down Expand Up @@ -57,7 +57,7 @@ export const datasetCache = {
};

export const urlTokenToTabKeyMap = {
gallery: "datasets",
gallery: "publications",
datasets: "advanced-datasets",
tasks: "tasks",
annotations: "explorativeAnnotations",
Expand All @@ -69,7 +69,7 @@ class DashboardView extends React.PureComponent<Props, State> {

const lastUsedTabKey = localStorage.getItem("lastUsedDashboardTab");
const isValid = lastUsedTabKey && validTabKeys.indexOf(lastUsedTabKey) > -1;
const defaultTab = this.props.isAdminView ? "tasks" : "datasets";
const defaultTab = this.props.isAdminView ? "tasks" : "publications";

const cachedDatasets = datasetCache.get();

Expand Down Expand Up @@ -151,7 +151,7 @@ class DashboardView extends React.PureComponent<Props, State> {

getTabs(user: APIUser) {
if (this.props.activeUser) {
const isAdminView = this.props.isAdminView;
const { isAdminView } = this.props;

const datasetViewProps = {
user,
Expand All @@ -162,7 +162,7 @@ class DashboardView extends React.PureComponent<Props, State> {

return [
!isAdminView ? (
<TabPane tab="Dataset Gallery" key="datasets">
<TabPane tab="Publications" key="publications">
<DatasetView {...datasetViewProps} dataViewType="gallery" />
</TabPane>
) : null,
Expand Down
216 changes: 0 additions & 216 deletions app/assets/javascripts/dashboard/dataset_panel.js

This file was deleted.

8 changes: 3 additions & 5 deletions app/assets/javascripts/dashboard/dataset_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import * as React from "react";

import type { APIUser, APIMaybeUnimportedDataset } from "admin/api_flow_types";
import AdvancedDatasetView from "dashboard/advanced_dataset/advanced_dataset_view";
import GalleryDatasetView from "dashboard/gallery_dataset_view";
import PublicationView from "dashboard/publication_view";
import Persistence from "libs/persistence";
import * as Utils from "libs/utils";

Expand Down Expand Up @@ -86,9 +86,7 @@ class DatasetView extends React.PureComponent<Props, State> {
}

renderGallery() {
return (
<GalleryDatasetView datasets={this.props.datasets} searchQuery={this.state.searchQuery} />
);
return <PublicationView datasets={this.props.datasets} searchQuery={this.state.searchQuery} />;
}

renderAdvanced() {
Expand Down Expand Up @@ -144,7 +142,7 @@ class DatasetView extends React.PureComponent<Props, State> {
return (
<div>
{adminHeader}
<h3 className="TestDatasetHeadline">Datasets</h3>
<h3 className="TestDatasetHeadline">{isGallery ? "Publications" : "Datasets"}</h3>
<div className="clearfix" style={{ margin: "20px 0px" }} />
<Spin size="large" spinning={this.props.datasets.length === 0 && this.props.isLoading}>
{content}
Expand Down
Loading

0 comments on commit dad5a33

Please sign in to comment.