Skip to content

Commit aff95c3

Browse files
Added withdrawn project guard. Resolves #1209. (#1212)
1 parent f02291a commit aff95c3

File tree

7 files changed

+62
-2
lines changed

7 files changed

+62
-2
lines changed

spa/src/app/files/files.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ import { ProjectReleaseComponent } from "./project-release/project-release.compo
106106
import { ProjectSummaryStatsComponent } from "./project-summary-stats-component/project-summary-stats.component";
107107
import { ProjectSupplementaryLinksComponent } from "./project-supplementary-links/project-supplementary-links.component";
108108
import { ProjectViewFactory } from "./project-view/project-view.factory";
109+
import { ProjectWithdrawnComponent } from "./project-withdrawn/project-withdrawn.component";
109110
import { ReleaseComponent } from "./releases/release.component";
110111
import { ReleaseFilesModalContainerComponent } from "./releases/release-files-modal-container/release-files-modal-container.component";
111112
import { ReleaseFilesModalComponent } from "./releases/release-files-modal/release-files-modal.component";
@@ -225,6 +226,7 @@ const v2 = environment.version === "2.0";
225226
ProjectExternalResourcesComponent,
226227
ProjectGuardComponent,
227228
ProjectIngestInProgressComponent,
229+
ProjectWithdrawnComponent,
228230
ProjectIntegrationsComponent,
229231
ProjectMetadataComponent,
230232
ProjectNavComponent,

spa/src/app/files/project-guard/project-guard.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<ng-container [ngSwitch]="getProjectViewMode(projectId)">
33
<project-deprecated *ngSwitchCase="'DEPRECATED'" [updatedProjectId]="getUpdatedProjectId(projectId)"></project-deprecated>
44
<project-ingest-in-progress *ngSwitchCase="'INGEST_IN_PROGRESS'"></project-ingest-in-progress>
5+
<project-withdrawn *ngSwitchCase="'WITHDRAWN'"></project-withdrawn>
56
<project-detail *ngSwitchDefault></project-detail>
67
</ng-container>
78
</ng-container>

spa/src/app/files/project-guard/project-guard.component.ts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ export class ProjectGuardComponent implements OnInit {
2828
// "abe1a013-af7a-45ed-8c26-f3793c24a1f4" // https://app.zenhub.com/workspaces/orange-5d680d7e3eeb5f1bbdf5668f/issues/humancellatlas/data-browser/944, https://app.zenhub.com/workspaces/orange-5d680d7e3eeb5f1bbdf5668f/issues/humancellatlas/data-browser/948
2929
];
3030

31+
private PROJECT_IDS_WITHDRAWN = [
32+
"008e40e8-66ae-43bb-951c-c073a2fa6774" // https://app.zenhub.com/workspaces/orange-5d680d7e3eeb5f1bbdf5668f/issues/humancellatlas/data-browser/1209
33+
];
34+
3135
public projectId$: Observable<string>;
3236

3337
/**
@@ -50,7 +54,10 @@ export class ProjectGuardComponent implements OnInit {
5054
else if ( this.isProjectIngestInProgress(projectId) ) {
5155
return ProjectStatus.INGEST_IN_PROGRESS;
5256
}
53-
57+
else if ( this.isProjectWithdrawn(projectId) ) {
58+
return ProjectStatus.WITHDRAWN;
59+
}
60+
5461
return ProjectStatus.LIVE;
5562
}
5663

@@ -87,6 +94,17 @@ export class ProjectGuardComponent implements OnInit {
8794
return this.PROJECT_IDS_INGEST_IN_PROGRESS.indexOf(projectIdToCheck) >= 0;
8895
}
8996

97+
/**
98+
* Returns true if project has been withdrawn.
99+
*
100+
* @param {string} projectIdToCheck
101+
* @returns {boolean}
102+
*/
103+
public isProjectWithdrawn(projectIdToCheck: string): boolean {
104+
105+
return this.PROJECT_IDS_WITHDRAWN.indexOf(projectIdToCheck) >= 0;
106+
}
107+
90108
/**
91109
*
92110
*/

spa/src/app/files/project-guard/project-status.model.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@
88
export enum ProjectStatus {
99
"DEPRECATED" = "DEPRECATED",
1010
"INGEST_IN_PROGRESS" = "INGEST_IN_PROGRESS",
11-
"LIVE" = "LIVE"
11+
"LIVE" = "LIVE",
12+
"WITHDRAWN" = "WITHDRAWN"
1213
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<pop-layout>
2+
<ng-container title>Explore Project</ng-container>
3+
<ng-container content>
4+
<div class="text-container">
5+
<h2 class="fontsize-xl">Project Withdrawn</h2>
6+
<p class="fontsize-m">The project you are requesting has been withdrawn due to a GDPR request.</p>
7+
</div>
8+
</ng-container>
9+
</pop-layout>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*
2+
* Human Cell Atlas
3+
* https://www.humancellatlas.org/
4+
*
5+
* Styles for project withdrawn component.
6+
*/
7+
8+
.text-container {
9+
margin: 0 auto;
10+
max-width: 650px;
11+
padding: 36px 0;
12+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*
2+
* Human Cell Atlas
3+
* https://www.humancellatlas.org/
4+
*
5+
* Component for displaying project withdrawn messaging.
6+
*/
7+
8+
// Core dependencies
9+
import { Component } from "@angular/core";
10+
11+
@Component({
12+
selector: "project-withdrawn",
13+
templateUrl: "./project-withdrawn.component.html",
14+
styleUrls: ["./project-withdrawn.component.scss"]
15+
})
16+
export class ProjectWithdrawnComponent {
17+
}

0 commit comments

Comments
 (0)