Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
7 changes: 3 additions & 4 deletions spa/src/app/config/config.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,12 @@ export class ConfigService {
/**
* Returns the complete URL for the download of the prepared matrix for the specified project.
*
* @param {string} projectId
* @param {string} matrixFormat
* @param {string} fileName
* @returns {string}
*/
public getProjectPreparedMatrixDownloadURL(projectId: string, matrixFormat: string): string {
public getProjectPreparedMatrixDownloadURL(fileName: string): string {

return `${this.getProjectMetaURL()}/project-assets/project-matrices/${projectId}.${matrixFormat}`;
return `${this.getProjectMetaURL()}/project-assets/project-matrices/${fileName}`;
}

/**
Expand Down
33 changes: 16 additions & 17 deletions spa/src/app/files/hca-project/hca-project.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -118,23 +118,22 @@ <h4 class="fontsize-m semi-bold">Project Downloads</h4>
[tooltipPosition]="'above'">Expression Matrix
</hca-tooltip>
</p>
<ng-container
[ngSwitch]="state.projectMatrixUrls && state.projectMatrixUrls.isAnyProjectMatrixUrlAvailable()">
<ng-container *ngSwitchCase="true">
<p class="fontsize-xs rhs downloads">
<span *ngIf="state.projectMatrixUrls.isProjectMatrixCSVAvailable()"><a
[href]="state.projectMatrixUrls.csvUrl"><img
src="assets/images/icon/hca-download-primary.png"/><span>csv</span></a></span>
<span *ngIf="state.projectMatrixUrls.isProjectMatrixLoomAvailable()"><a
[href]="state.projectMatrixUrls.loomUrl"><img
src="assets/images/icon/hca-download-primary.png"/><span>loom</span></a></span>
<span *ngIf="state.projectMatrixUrls.isProjectMatrixMtxAvailable()"><a
[href]="state.projectMatrixUrls.mtxUrl"><img
src="assets/images/icon/hca-download-primary.png"/><span>mtx</span></a></span>
</p>
</ng-container>
<p class="fontsize-xs rhs" *ngSwitchDefault>No expression matrix available</p>
</ng-container>
<p class="fontsize-xs rhs" *ngIf="state.projectMatrixUrls && !state.projectMatrixUrls.isAnyProjectMatrixUrlAvailable()">No expression matrix available</p>
</div>
<div *ngFor="let species of state.projectMatrixUrls.listSpeciesWithMatrixUrls()"
class="species-matrix-url">
<p class="fontsize-xs semi-bold subhead lhs">
<hca-tooltip [tooltipClass]="'hca-tooltip narrow'"
[tooltipContent]="'Download expression matrix'"
[tooltipDisabled]="false"
[tooltipPosition]="'above'">{{species}}
</hca-tooltip>
</p>
<p class="fontsize-xs rhs downloads">
<span *ngFor="let matrixUrl of state.projectMatrixUrls.listMatrixUrlsBySpecies(species)"><a
[href]="matrixUrl.url"><img
src="assets/images/icon/hca-download-primary.png"/><span>{{matrixUrl.fileType}}</span></a></span>
</p>
</div>
</div>
<div class="project-integrations">
Expand Down
17 changes: 15 additions & 2 deletions spa/src/app/files/hca-project/hca-project.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@
p.downloads {

a {
align-items: center;
align-items: flex-start;
color: $hca-black;
display: flex;
}

/* Icon */
img {
cursor: pointer;
height: 20px;
height: 16px;
}

/* Container */
Expand Down Expand Up @@ -227,14 +227,27 @@
/* LHS container */
.lhs {
box-sizing: border-box;
display: flex;
flex-direction: column;
align-items: flex-start;
width: 100%;
&.subhead {
color: #666666;
}
}

/* RHS container */
.rhs {
box-sizing: border-box;
width: 100%;
}

.species-matrix-url {
transition: background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1);
&:hover {
background-color: rgba(0, 0, 0, 0.03);
}
}
}

/**
Expand Down
54 changes: 32 additions & 22 deletions spa/src/app/files/hca-project/hca-project.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ import {
PROJECT_DETAIL_SINGLE_VALUES, PROJECT_DETAIL_SPECIFIC_VALUES,
PROJECT_DETAIL_UNSPECIFIED_VALUES, PROJECT_PORTAL_SINGLE_VALUE_SINGLE_INTEGRATION_OBJECT
} from "./hca-project-mapper.mock";
import { GenusSpecies } from "../shared/genus-species.model";
import { SpeciesMatrixUrls } from "../shared/species-matrix-urls.model";

describe("HCAProjectComponent", () => {

Expand Down Expand Up @@ -64,7 +66,15 @@ describe("HCAProjectComponent", () => {
const HEADING_CITATION = "Citation";

// Project matrix urls
const PROJECT_DETAIL_PROJECT_MATRIX_URLS = new ProjectMatrixUrls("2cd14cf5-f8e0-4c97-91a2-9e8957f41ea8", "https://dev.data.humancellatlas.org/project-assets/project-matrices/537f5501-a964-4ade-91c8-7bd4a23b049d.csv.zip", "https://dev.data.humancellatlas.org/project-assets/project-matrices/537f5501-a964-4ade-91c8-7bd4a23b049d.loom", "https://dev.data.humancellatlas.org/project-assets/project-matrices/537f5501-a964-4ade-91c8-7bd4a23b049d.mtx.zip");
const SPECIES_URLS_HOMO_SAPIENS = new SpeciesMatrixUrls(
"1234",
"https://test.com/1234.homo_sapiens.csv.zip",
"https://test.com/1234.homo_sapiens.loom",
"https://test.com/1234.homo_sapiens.mtx.zip"
);
const PROJECT_MATRIX_URLS_SINGLE_SPECIES = new ProjectMatrixUrls("1234", new Map([
[GenusSpecies.HOMO_SAPIENS, SPECIES_URLS_HOMO_SAPIENS]
]));

// Project details
const PROJECT_LABEL_DONOR_COUNT = "Donor Count";
Expand Down Expand Up @@ -188,7 +198,7 @@ describe("HCAProjectComponent", () => {
testStore.pipe
.and.returnValues(
of(PROJECT_DETAIL_SINGLE_VALUES), // selected project detail
of(PROJECT_DETAIL_PROJECT_MATRIX_URLS), // project matrix URLs
of(PROJECT_MATRIX_URLS_SINGLE_SPECIES), // project matrix URLs
of([]), // project ids
of([]) // integrations
);
Expand All @@ -207,7 +217,7 @@ describe("HCAProjectComponent", () => {
testStore.pipe
.and.returnValues(
of(PROJECT_DETAIL_SINGLE_VALUES), // selected project detail
of(PROJECT_DETAIL_PROJECT_MATRIX_URLS), // project matrix URLs
of(PROJECT_MATRIX_URLS_SINGLE_SPECIES), // project matrix URLs
of([]), // project ids
of([]) // integrations
);
Expand All @@ -226,7 +236,7 @@ describe("HCAProjectComponent", () => {
testStore.pipe
.and.returnValues(
of(PROJECT_DETAIL_SINGLE_VALUES), // selected project detail
of(PROJECT_DETAIL_PROJECT_MATRIX_URLS), // project matrix URLs
of(PROJECT_MATRIX_URLS_SINGLE_SPECIES), // project matrix URLs
of([]), // project ids
of([]) // integrations
);
Expand All @@ -245,7 +255,7 @@ describe("HCAProjectComponent", () => {
testStore.pipe
.and.returnValues(
of(PROJECT_DETAIL_SINGLE_VALUES), // selected project detail
of(PROJECT_DETAIL_PROJECT_MATRIX_URLS), // project matrix URLs
of(PROJECT_MATRIX_URLS_SINGLE_SPECIES), // project matrix URLs
of([]), // project ids
of([]) // integrations
);
Expand All @@ -266,7 +276,7 @@ describe("HCAProjectComponent", () => {
testStore.pipe
.and.returnValues(
of(PROJECT_DETAIL_SINGLE_VALUES), // selected project detail
of(PROJECT_DETAIL_PROJECT_MATRIX_URLS), // project matrix URLs
of(PROJECT_MATRIX_URLS_SINGLE_SPECIES), // project matrix URLs
of([]), // project ids
of([]) // integrations
);
Expand All @@ -285,7 +295,7 @@ describe("HCAProjectComponent", () => {
testStore.pipe
.and.returnValues(
of(PROJECT_DETAIL_EMPTY_VALUES), // selected project detail
of(PROJECT_DETAIL_PROJECT_MATRIX_URLS), // project matrix URLs
of(PROJECT_MATRIX_URLS_SINGLE_SPECIES), // project matrix URLs
of([]), // project ids
of([]) // integrations
);
Expand All @@ -304,7 +314,7 @@ describe("HCAProjectComponent", () => {
testStore.pipe
.and.returnValues(
of(PROJECT_DETAIL_UNSPECIFIED_VALUES), // selected project detail
of(PROJECT_DETAIL_PROJECT_MATRIX_URLS), // project matrix URLs
of(PROJECT_MATRIX_URLS_SINGLE_SPECIES), // project matrix URLs
of([]), // project ids
of([]) // integrations
);
Expand All @@ -323,7 +333,7 @@ describe("HCAProjectComponent", () => {
testStore.pipe
.and.returnValues(
of(PROJECT_DETAIL_SINGLE_VALUES), // selected project detail
of(PROJECT_DETAIL_PROJECT_MATRIX_URLS), // project matrix URLs
of(PROJECT_MATRIX_URLS_SINGLE_SPECIES), // project matrix URLs
of([]), // project ids
of([]) // integrations
);
Expand All @@ -342,7 +352,7 @@ describe("HCAProjectComponent", () => {
testStore.pipe
.and.returnValues(
of(PROJECT_DETAIL_MULTIPLE_VALUES), // selected project detail
of(PROJECT_DETAIL_PROJECT_MATRIX_URLS), // project matrix URLs
of(PROJECT_MATRIX_URLS_SINGLE_SPECIES), // project matrix URLs
of([]), // project ids
of([]) // integrations
);
Expand All @@ -361,7 +371,7 @@ describe("HCAProjectComponent", () => {
testStore.pipe
.and.returnValues(
of(PROJECT_DETAIL_SINGLE_VALUES), // selected project detail
of(PROJECT_DETAIL_PROJECT_MATRIX_URLS), // project matrix URLs
of(PROJECT_MATRIX_URLS_SINGLE_SPECIES), // project matrix URLs
of([]), // project ids
of([]) // integrations
);
Expand All @@ -380,7 +390,7 @@ describe("HCAProjectComponent", () => {
testStore.pipe
.and.returnValues(
of(PROJECT_DETAIL_SPECIFIC_VALUES), // selected project detail
of(PROJECT_DETAIL_PROJECT_MATRIX_URLS), // project matrix URLs
of(PROJECT_MATRIX_URLS_SINGLE_SPECIES), // project matrix URLs
of([]), // project ids
of([]) // integrations
);
Expand All @@ -399,7 +409,7 @@ describe("HCAProjectComponent", () => {
testStore.pipe
.and.returnValues(
of(PROJECT_DETAIL_EMPTY_VALUES), // selected project detail
of(PROJECT_DETAIL_PROJECT_MATRIX_URLS), // project matrix URLs
of(PROJECT_MATRIX_URLS_SINGLE_SPECIES), // project matrix URLs
of([]), // project ids
of([]) // integrations
);
Expand All @@ -418,7 +428,7 @@ describe("HCAProjectComponent", () => {
testStore.pipe
.and.returnValues(
of(PROJECT_DETAIL_UNSPECIFIED_VALUES), // selected project detail
of(PROJECT_DETAIL_PROJECT_MATRIX_URLS), // project matrix URLs
of(PROJECT_MATRIX_URLS_SINGLE_SPECIES), // project matrix URLs
of([]), // project ids
of([]) // integrations
);
Expand All @@ -437,7 +447,7 @@ describe("HCAProjectComponent", () => {
testStore.pipe
.and.returnValues(
of(PROJECT_DETAIL_SINGLE_VALUES), // selected project detail
of(PROJECT_DETAIL_PROJECT_MATRIX_URLS), // project matrix URLs
of(PROJECT_MATRIX_URLS_SINGLE_SPECIES), // project matrix URLs
of([]), // project ids
of([]) // integrations
);
Expand All @@ -455,7 +465,7 @@ describe("HCAProjectComponent", () => {
testStore.pipe
.and.returnValues(
of(PROJECT_DETAIL_MULTIPLE_VALUES), // selected project detail
of(PROJECT_DETAIL_PROJECT_MATRIX_URLS), // project matrix URLs
of(PROJECT_MATRIX_URLS_SINGLE_SPECIES), // project matrix URLs
of([]), // project ids
of([]) // integrations
);
Expand All @@ -474,7 +484,7 @@ describe("HCAProjectComponent", () => {
testStore.pipe
.and.returnValues(
of(PROJECT_DETAIL_SINGLE_VALUES), // selected project detail
of(PROJECT_DETAIL_PROJECT_MATRIX_URLS), // project matrix URLs
of(PROJECT_MATRIX_URLS_SINGLE_SPECIES), // project matrix URLs
of([]), // project ids
of([]) // integrations
);
Expand All @@ -493,7 +503,7 @@ describe("HCAProjectComponent", () => {
testStore.pipe
.and.returnValues(
of(PROJECT_DETAIL_UNSPECIFIED_VALUES), // selected project detail
of(PROJECT_DETAIL_PROJECT_MATRIX_URLS), // project matrix URLs
of(PROJECT_MATRIX_URLS_SINGLE_SPECIES), // project matrix URLs
of([]), // project ids
of([]) // integrations
);
Expand All @@ -512,7 +522,7 @@ describe("HCAProjectComponent", () => {
testStore.pipe
.and.returnValues(
of(PROJECT_DETAIL_SINGLE_VALUES), // selected project detail
of(PROJECT_DETAIL_PROJECT_MATRIX_URLS), // project matrix URLs
of(PROJECT_MATRIX_URLS_SINGLE_SPECIES), // project matrix URLs
of([]), // project ids
of([]) // integrations
);
Expand All @@ -533,7 +543,7 @@ describe("HCAProjectComponent", () => {
testStore.pipe
.and.returnValues(
of(PROJECT_DETAIL_SINGLE_VALUES), // selected project detail
of(PROJECT_DETAIL_PROJECT_MATRIX_URLS), // project matrix URLs
of(PROJECT_MATRIX_URLS_SINGLE_SPECIES), // project matrix URLs
of([]), // project ids
of([]) // integrations
);
Expand All @@ -552,7 +562,7 @@ describe("HCAProjectComponent", () => {
testStore.pipe
.and.returnValues(
of(PROJECT_DETAIL_SINGLE_VALUES), // selected project detail
of(PROJECT_DETAIL_PROJECT_MATRIX_URLS), // project matrix URLs
of(PROJECT_MATRIX_URLS_SINGLE_SPECIES), // project matrix URLs
of([]), // project ids
of(PROJECT_PORTAL_SINGLE_VALUE_SINGLE_INTEGRATION_OBJECT) // integrations
);
Expand All @@ -573,7 +583,7 @@ describe("HCAProjectComponent", () => {
testStore.pipe
.and.returnValues(
of(PROJECT_DETAIL_SINGLE_VALUES), // selected project detail
of(PROJECT_DETAIL_PROJECT_MATRIX_URLS), // project matrix URLs
of(PROJECT_MATRIX_URLS_SINGLE_SPECIES), // project matrix URLs
of([]), // project ids
of([]) // integrations
);
Expand Down
3 changes: 1 addition & 2 deletions spa/src/app/files/hca-project/hca-project.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,7 @@ export class HCAProjectComponent implements OnDestroy, OnInit {
`<a href=${publication.publicationUrl} target="_blank" rel="noopener noreferrer">${publication.publicationTitle}</a>` :
publication.publicationTitle;
}



/**
* Returns true if at least one data curator has been specified for this project.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* Human Cell Atlas
* https://www.humancellatlas.org/
*
* View model of a prepared Matrix URL, containing file type and the actual URL.
*/

export interface MatrixUrl {

fileType: string;
url: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,16 @@
<h3 class="fontsize-l">Download Expression Matrix</h3>
<h4 class="project-title fontsize-m">{{projectTitle}}</h4>
<div class="file-format fontsize-s">
<div *ngIf="projectURLs.isProjectMatrixMtxAvailable()">
<a [href]="projectURLs.mtxUrl">
<img src="assets/images/icon/hca-download-primary.png">
<span>mtx</span>
</a>
<copy-to-clipboard [copyToClipboardLink]="projectURLs.mtxUrl"></copy-to-clipboard>
</div>
<div *ngIf="projectURLs.isProjectMatrixCSVAvailable()">
<a [href]="projectURLs.csvUrl">
<img src="assets/images/icon/hca-download-primary.png">
<span>csv</span>
</a>
<copy-to-clipboard [copyToClipboardLink]="projectURLs.csvUrl"></copy-to-clipboard>
</div>
<div *ngIf="projectURLs.isProjectMatrixLoomAvailable()">
<a [href]="projectURLs.loomUrl">
<img src="assets/images/icon/hca-download-primary.png">
<span>loom</span>
</a>
<copy-to-clipboard [copyToClipboardLink]="projectURLs.loomUrl"></copy-to-clipboard>
</div>
<ng-container *ngFor="let species of projectURLs.listSpeciesWithMatrixUrls()">
<h5>{{species}}</h5>
<div *ngFor="let matrixUrl of projectURLs.listMatrixUrlsBySpecies(species)">
<a [href]="matrixUrl.url">
<img src="assets/images/icon/hca-download-primary.png">
<span>{{matrixUrl.fileType}}</span>
</a>
<copy-to-clipboard [copyToClipboardLink]="matrixUrl.url"></copy-to-clipboard>
</div>
</ng-container>
</div>
</div>
<!--<span class="fontsize-xs">For instructions on how to use the expression matrix see the expression matrix userguide.</span>-->
Expand Down
Loading