Skip to content

Commit

Permalink
Merge pull request #116 from EBI-Metabolights/MTBLS-607-master
Browse files Browse the repository at this point in the history
public non curated study management for master
  • Loading branch information
famaladoss authored May 28, 2024
2 parents a6fe709 + 8de5413 commit 23e9792
Show file tree
Hide file tree
Showing 15 changed files with 141 additions and 12 deletions.
5 changes: 5 additions & 0 deletions src/app/components/console/console.component.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
border-radius: 4px !important;
}

.not-curated {
background-color: orange;
color: white;
}

.banner {
font-size: 14px;
color: red;
Expand Down
30 changes: 22 additions & 8 deletions src/app/components/console/console.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,28 @@ <h2 class="has-text-weight-bold">
<div class="control py-0 mb0">
<div class="tags has-addons">
<span class="tag">Status</span>
<span
class="tag"
[class.is-primary]="study.status == 'In Review'"
[class.is-danger]="study.status == 'In Curation'"
[class.is-warning]="study.status == 'Submitted'"
[class.is-success]="study.status == 'Public'"
>{{ study.status }}</span
>
<span *ngIf="study.status == 'Public'; else onlyStatus" >
<span *ngIf="study.curationRequest == 'MANUAL_CURATION'; else noCuration"
class="tag is-success"
>{{ study.status }} - Curated
</span>
<ng-template #noCuration>
<span
class="tag not-curated"
>{{ study.status }} - Not Curated
</span>
</ng-template>
</span>
<ng-template #onlyStatus>
<span
class="tag"
[class.is-primary]="study.status == 'In Review'"
[class.is-danger]="study.status == 'In Curation'"
[class.is-warning]="study.status == 'Submitted'"
[class.is-success]="study.status == 'Public'"
>{{ study.status }}</span
>
</ng-template>
</div>
</div>
<div class="control py-0 mb0">
Expand Down
21 changes: 21 additions & 0 deletions src/app/components/public/study/study.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,27 @@
</div>
</article>
</div>
<div id="status-board" *ngIf="status == 'Public' && curationRequest == 'NO_CURATION'">
<article class="message is-warning">
<div class="message-body">
<p>
<mat-icon class="mat-icon material-icons">info</mat-icon>
This study ({{ requestedStudy }}) is publicly accessible upon request from the submitter(s). It <b><u>is not curated</u></b> by MetaboLights team, however it passes the minimum validation requirements of MetaboLights.
<br/>
<br/>
If you have comments or suggestions, please get in touch with the submitter(s) or MetaboLights team (<b>
<a
[href]="
'mailto:[email protected]?subject=Regarding non-curated public study - ' +
requestedStudy
"
>metabolights-help&#64;ebi.ac.uk</a
></b>).

</p>
</div>
</article>
</div>
<div
*ngIf="requestedStudy != undefined && !studyError"
class="main-wrapper"
Expand Down
8 changes: 8 additions & 0 deletions src/app/components/public/study/study.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export class PublicStudyComponent implements OnInit {
@select((state) => state.study.identifier) studyIdentifier;
@select((state) => state.status.user) user;
@select((state) => state.study.status) studyStatus;
@select((state) => state.study.curationRequest) curationRequestState;
@select((state) => state.study.validation) studyValidation;
@select((state) => state.status.currentTabIndex) currentIndex: number;
@select((state) => state.study.investigationFailed) investigationFailed;
Expand All @@ -35,6 +36,7 @@ export class PublicStudyComponent implements OnInit {
status = "submitted";
tab = "descriptors";
requestedStudy: string = null;
curationRequest = ""
studyError = false;
validation: any = {};
files: any = null;
Expand Down Expand Up @@ -139,6 +141,12 @@ export class PublicStudyComponent implements OnInit {
}
});

this.curationRequestState.subscribe((value) => {
if(value){
this.curationRequest = value;
}
});

this.studyReviewerLink.subscribe((value) => {
this.reviewerLink = value;
});
Expand Down
1 change: 1 addition & 0 deletions src/app/components/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export const SHARED_INITIAL_STATE: Record<string, any> = {
info: "",
configuration: "",
isCurator: false,
curationRequest: null,
user: null,
error: false,
message: "",
Expand Down
2 changes: 2 additions & 0 deletions src/app/components/study/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ export const SET_STUDY_ABSTRACT = "SET_STUDY_ABSTRACT";
export const SET_STUDY_SUBMISSION_DATE = "SET_STUDY_SUBMISSION_DATE";
export const SET_STUDY_RELEASE_DATE = "SET_STUDY_RELEASE_DATE";
export const SET_STUDY_STATUS = "SET_STUDY_STATUS";
export const SET_STUDY_CURATION_REQUEST = "SET_STUDY_CURATION_REQUEST";

export const SET_STUDY_REVIEWER_LINK = "SET_STUDY_REVIEWER_LINK";

export const SET_STUDY_PUBLICATIONS = "SET_STUDY_PUBLICATIONS";
Expand Down
4 changes: 4 additions & 0 deletions src/app/components/study/status/status.component.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.error-message {
color: red;
}
.not-curated {
background-color: orange;
color: white;
}
29 changes: 26 additions & 3 deletions src/app/components/study/status/status.component.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,32 @@
<div class="control">
<div class="tags has-addons">
<span class="tag is-dark">Status</span>
<span class="tag is-link clickable" (click)="openModal()">{{
status
}}</span>
<div *ngIf="status == 'Public'; else onlyStatus" >
<span *ngIf="curationRequest == 'MANUAL_CURATION'; else noCuration">
<span class="tag is-link clickable" (click)="openModal()">
{{
status
}} - Curated
</span>
</span>
<ng-template #noCuration>
<span class="tag clickable not-curated" (click)="openModal()">
{{
status
}} - Not Curated
</span>
</ng-template>
</div>

<ng-template #onlyStatus>
<span class="tag is-link clickable" (click)="openModal()">
{{
status
}}

</span>
</ng-template>

</div>
</div>
<div class="modal" [ngClass]="{ 'is-active': isModalOpen }">
Expand Down
5 changes: 5 additions & 0 deletions src/app/components/study/status/status.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export class StatusComponent implements OnInit {
@select((state) => state.study.validation) studyValidation;
@select((state) => state.status.isCurator) isCurator;
@select((state) => state.study.identifier) studyIdentifier;
@select((state) => state.study.curationRequest) curationRequestState;

@select((state) => state.study.readonly) readonly;
isReadOnly = false;
Expand All @@ -33,6 +34,7 @@ export class StatusComponent implements OnInit {
status: string = null;
curator = false;
toStatus = "Submitted";
curationRequest: string = null;
requestedStudy: string = null;
validation: IValidationSummary;
constructor(
Expand All @@ -43,6 +45,9 @@ export class StatusComponent implements OnInit {
}

setUpSubscriptions() {
this.curationRequestState.subscribe((value) => {
this.curationRequest = value;
});
this.studyValidation.subscribe((value) => {
this.validation = value;
});
Expand Down
8 changes: 7 additions & 1 deletion src/app/components/study/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
SET_STUDY_SUBMISSION_DATE,
SET_STUDY_RELEASE_DATE,
SET_STUDY_STATUS,
SET_STUDY_CURATION_REQUEST,
SET_STUDY_REVIEWER_LINK,
SET_STUDY_ASSAYS,
SET_STUDY_PUBLICATIONS,
Expand Down Expand Up @@ -116,6 +117,10 @@ function setStudyStatus(state, action) {
return tassign(state, { status: action.body.study.mtblsStudy.studyStatus });
}

function setCurationRequest(state, action) {
return tassign(state, { curationRequest: action.body.study.mtblsStudy.curationRequest });
}

function setStudyReviewerLink(state, action) {
return tassign(state, {
reviewerLink: action.body.study.mtblsStudy.reviewer_link,
Expand Down Expand Up @@ -349,9 +354,10 @@ export function studyReducer(
return setStudyTitle(state, action);
case SET_STUDY_ABSTRACT:
return setStudyAbstract(state, action);

case SET_STUDY_STATUS:
return setStudyStatus(state, action);
case SET_STUDY_CURATION_REQUEST:
return setCurationRequest(state, action);
case SET_STUDY_REVIEWER_LINK:
return setStudyReviewerLink(state, action);

Expand Down
21 changes: 21 additions & 0 deletions src/app/components/study/study.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,27 @@
</div>
</article>
</div>
<div id="status-board" *ngIf="status == 'Public' && curationRequest == 'NO_CURATION'">
<article class="message is-warning">
<div class="message-body">
<p>
<mat-icon class="mat-icon material-icons">info</mat-icon>
Your study ({{ requestedStudy }}) is publicly accessible. It <b><u>is not curated</u></b> by MetaboLights team, however it passes the minimum validation requirements of MetaboLights.
<br/>
<br/>
If you have comments or suggestions, please get in touch with MetaboLights team (<b>
<a
[href]="
'mailto:[email protected]?subject=Regarding non-curated public study - ' +
requestedStudy
"
>metabolights-help&#64;ebi.ac.uk</a
></b>).

</p>
</div>
</article>
</div>
<div class="main-wrapper" [ngClass]="{ smt: status != 'Submitted' }">
<div style="margin: 20px">
<article class="message is-small has-shadow">
Expand Down Expand Up @@ -277,6 +297,7 @@
</div>
</span>
</div>

</div>
<span class="second-bottom-right">
<a (click)="topFunction()" id="scrollToTop" class="button is-rounded">
Expand Down
9 changes: 9 additions & 0 deletions src/app/components/study/study.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ export class StudyComponent implements OnInit, OnDestroy {
@select((state) => state.study.validation) studyValidation;
@select((state) => state.status.currentTabIndex) currentIndex: number;
@select((state) => state.study.status) studyStatus;
@select((state) => state.study.curationRequest) curationRequestState;

@select((state) => state.study.obfuscationCode) studyObfuscationCode;

@select((state) => state.status.bannerMessage) bannerMessage;
Expand All @@ -28,6 +30,7 @@ export class StudyComponent implements OnInit, OnDestroy {
requestedTab = 0;
tab = "descriptors";
requestedStudy: string = null;
curationRequest = ""
status = "submitted";
validation: any = {};
obfuscationCode: string = null;
Expand Down Expand Up @@ -89,6 +92,12 @@ export class StudyComponent implements OnInit, OnDestroy {
this.status = value;
});

this.curationRequestState.subscribe((value) => {
if(value){
this.curationRequest = value;
}
});

this.studyValidation.subscribe((value) => {
this.validation = value;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export interface IStudyDetail {
status: string;
title: string;
description: string;
curationRequest: string;
}

export interface IStudyDetailWrapper {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ export interface IStudySummary {
/*Interface to represent the minute study information returned by our IsaInvestigation endpoint*/
export interface IMtblsStudySummaryInformation {
studyStatus: string;
curationRequest: string;
modifiedTime: string;
statusUpdateTime: string;
read_access: boolean;
is_curator: boolean;
write_access: boolean;
Expand Down
6 changes: 6 additions & 0 deletions src/app/services/editor.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,12 @@ export class EditorService {
study,
},
});
this.ngRedux.dispatch({
type: "SET_STUDY_CURATION_REQUEST",
body: {
study,
},
});
this.ngRedux.dispatch({
type: "SET_STUDY_REVIEWER_LINK",
body: {
Expand Down

0 comments on commit 23e9792

Please sign in to comment.