Skip to content

Commit

Permalink
public non curated study management for master
Browse files Browse the repository at this point in the history
  • Loading branch information
oyurekten committed May 2, 2024
1 parent a6fe709 commit 0082e75
Show file tree
Hide file tree
Showing 11 changed files with 66 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
24 changes: 16 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,22 @@ <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' && study.curationRequest == 'NO_CURATION'; else onlyStatus" >
<span
class="tag not-curated"
>{{ study.status }} - Not Curated</span
>
</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
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;
}
19 changes: 16 additions & 3 deletions src/app/components/study/status/status.component.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
<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' && curationRequest == 'NO_CURATION'; else onlyStatus" >
<span class="tag clickable not-curated" (click)="openModal()">
{{
status
}} - Not Curated
</span>
</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
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 0082e75

Please sign in to comment.