Commit 47d8581b authored by Rajkumar-D's avatar Rajkumar-D
Browse files

DAC policy related changes

parent 0ec8e32e
......@@ -31,4 +31,7 @@ mat-form-field.mat-form-field {
mat-icon {
cursor: pointer;
}
.mat-radio-button ~ .mat-radio-button {
margin-left: 16px;
}
\ No newline at end of file
......@@ -10,11 +10,27 @@
<mat-step label="Select an existing DAC">
<app-report (selectedRecord)="getSelectedDac($event,stepper)" [reportType]="reportType"
[embDefaultSearch]="true" [embeded]="true"></app-report>
</mat-step>
<mat-step label="Submit policy">
<div style="width: 50%;">
<mat-radio-group name="group" [(ngModel)]="policyType">
<mat-radio-button value="textSelected"> Enter
policy text
</mat-radio-button>
<mat-radio-button value="urlSelected">Enter the
URL containing
your policy text
</mat-radio-button>
</mat-radio-group>
<mat-form-field *ngIf="policyType=='textSelected'">
<textarea matInput rows="3" [(ngModel)]="text" name="text" placeholder="Polict text"
required></textarea>
</mat-form-field>
<mat-form-field *ngIf="policyType=='urlSelected'">
<input matInput [(ngModel)]="url" name="url" placeholder="Polict URL" required />
</mat-form-field>
</div>
</mat-step>
</mat-vertical-stepper>
</mat-card>
......
......@@ -2,6 +2,8 @@ import { Component, OnInit } from '@angular/core';
import { MatStepper } from '@angular/material';
import { getEnabledCategories } from 'trace_events';
import { ReportType } from '../report-type.enum';
import { FormControl, FormGroupDirective, NgForm, Validators, FormGroup } from '@angular/forms';
@Component({
selector: 'app-dac-policy-management',
......@@ -12,14 +14,17 @@ export class DacPolicyManagementComponent implements OnInit {
constructor() { }
reportType = ReportType.dacs;
selectedDAC: string;
selectedDacId: string;
textSelected: boolean;
urlSelected: boolean;
text: string;
url: string;
ngOnInit() {
}
getSelectedDac(studyAlias: object, stepper: MatStepper) {
this.selectedDAC = studyAlias["accession"];
getSelectedDac(reportObj: object, stepper: MatStepper) {
this.selectedDacId = reportObj["id"];
stepper.next();
}
......
......@@ -354,8 +354,12 @@ export class ReportComponent implements OnInit {
'Submission date',
'Status',
'Action', // No callback for Action column
];
]; if (this.embeded) {
this.displayedColumns.splice(-1, 1);
this.displayedColumns.unshift('Select')
}
this.displayedColumnsCallback = {
'Select': this.accessionColumnCallback.bind(this),
Accession: this.accessionColumnCallback.bind(this),
'Unique name': this.aliasColumnCallback.bind(this),
Title: this.titleColumnCallback.bind(this),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment