Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
enasequence
webin-portal
Commits
81fd802f
Commit
81fd802f
authored
Mar 19, 2021
by
Rajkumar-D
Browse files
Adding EGA Dac related changes
parent
94d30e83
Changes
20
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
609 additions
and
40 deletions
+609
-40
src/app/app.module.ts
src/app/app.module.ts
+25
-0
src/app/checklist/checklist.component.html
src/app/checklist/checklist.component.html
+4
-4
src/app/contact-dialog-modal/contact-dialog-modal.component.html
.../contact-dialog-modal/contact-dialog-modal.component.html
+2
-2
src/app/dac-dataset-management/dac-dataset-management.component.css
...c-dataset-management/dac-dataset-management.component.css
+41
-0
src/app/dac-dataset-management/dac-dataset-management.component.html
...-dataset-management/dac-dataset-management.component.html
+78
-0
src/app/dac-dataset-management/dac-dataset-management.component.ts
...ac-dataset-management/dac-dataset-management.component.ts
+149
-0
src/app/dac-management/dac-management.component.html
src/app/dac-management/dac-management.component.html
+5
-5
src/app/dac-management/dac-management.component.ts
src/app/dac-management/dac-management.component.ts
+4
-1
src/app/dac-policy-management/dac-policy-management.component.html
...ac-policy-management/dac-policy-management.component.html
+31
-11
src/app/dac-policy-management/dac-policy-management.component.ts
.../dac-policy-management/dac-policy-management.component.ts
+74
-4
src/app/dashboard/dashboard.component.html
src/app/dashboard/dashboard.component.html
+5
-6
src/app/report-action/report-action.component.html
src/app/report-action/report-action.component.html
+4
-0
src/app/report-action/report-action.component.ts
src/app/report-action/report-action.component.ts
+8
-0
src/app/report-edit-dialog/report-edit-dialog.component.ts
src/app/report-edit-dialog/report-edit-dialog.component.ts
+1
-1
src/app/report/report.component.ts
src/app/report/report.component.ts
+8
-0
src/app/sidenav/sidenav/sidenav.component.html
src/app/sidenav/sidenav/sidenav.component.html
+4
-3
src/app/submission-result-dialog/submission-result-dialog.component.html
...ion-result-dialog/submission-result-dialog.component.html
+4
-1
src/app/util/Util-services.ts
src/app/util/Util-services.ts
+10
-0
src/app/util/xml.service.ts
src/app/util/xml.service.ts
+150
-0
src/app/webin-xml-report.service.ts
src/app/webin-xml-report.service.ts
+2
-2
No files found.
src/app/app.module.ts
View file @
81fd802f
...
...
@@ -64,6 +64,7 @@ import { NonSubmissionResultDialogComponent } from './non-submission-result-dial
import
{
AceEditorModule
}
from
'
ng2-ace-editor
'
;
import
{
DacManagementComponent
}
from
'
./dac-management/dac-management.component
'
;
import
{
DacPolicyManagementComponent
}
from
'
./dac-policy-management/dac-policy-management.component
'
;
import
{
DacDatasetManagementComponent
}
from
'
./dac-dataset-management/dac-dataset-management.component
'
;
const
appRoutes
:
Routes
=
[
...
...
@@ -113,6 +114,7 @@ const appRoutes: Routes = [
path
:
'
app-checklist/:checklistType/:init
'
,
component
:
ChecklistComponent
,
canActivate
:
[
WebinAuthenticationGuardService
],
},
{
path
:
'
account
'
,
...
...
@@ -125,30 +127,52 @@ const appRoutes: Routes = [
{
path
:
'
study
'
,
component
:
StudyManagementComponent
,
canActivate
:
[
WebinAuthenticationGuardService
],
},
{
path
:
'
study/:id
'
,
component
:
StudyManagementComponent
,
canActivate
:
[
WebinAuthenticationGuardService
],
},
{
path
:
'
read-submission
'
,
component
:
ReadSubmissionComponent
,
canActivate
:
[
WebinAuthenticationGuardService
],
},
{
path
:
'
taxonomy
'
,
component
:
TaxonomyManagementComponent
,
canActivate
:
[
WebinAuthenticationGuardService
],
},
{
path
:
'
dac
'
,
component
:
DacManagementComponent
,
canActivate
:
[
WebinAuthenticationGuardService
],
},
{
path
:
'
dac/:id
'
,
component
:
DacManagementComponent
,
canActivate
:
[
WebinAuthenticationGuardService
],
},
{
path
:
'
dac-policy
'
,
component
:
DacPolicyManagementComponent
,
canActivate
:
[
WebinAuthenticationGuardService
],
},
{
path
:
'
dac-policy/:id
'
,
component
:
DacPolicyManagementComponent
,
canActivate
:
[
WebinAuthenticationGuardService
],
},
{
path
:
'
dac-dataset
'
,
component
:
DacDatasetManagementComponent
,
canActivate
:
[
WebinAuthenticationGuardService
],
},
{
path
:
'
dac-dataset/:id
'
,
component
:
DacDatasetManagementComponent
,
canActivate
:
[
WebinAuthenticationGuardService
],
},
{
path
:
'
**
'
,
...
...
@@ -211,6 +235,7 @@ const appRoutes: Routes = [
NonSubmissionResultDialogComponent
,
DacManagementComponent
,
DacPolicyManagementComponent
,
DacDatasetManagementComponent
,
],
...
...
src/app/checklist/checklist.component.html
View file @
81fd802f
...
...
@@ -147,10 +147,10 @@
</mat-expansion-panel-header>
<div
*ngFor=
"let field of fieldGroup.fields"
>
<mat-checkbox
class=
"checklist-ch
ec
k
ed
-field"
[(ngModel)]=
"selected
Fields[field.label]"
[disabled]=
"mandatoryFields[field.label]"
><b
class=
"checklist-checked-field"
>
{{
field.label
}}
</b>
<mat-checkbox
[(ngModel)]=
"sel
ec
t
ed
Fields[field.label]"
[disabled]=
"mandatory
Fields[field.label]"
>
{{
field.label
}}
</mat-checkbox>
<p
fxHide
fxShow.gt-sm
>
<i>
{{ field.mandatory }}
...
...
src/app/contact-dialog-modal/contact-dialog-modal.component.html
View file @
81fd802f
...
...
@@ -48,10 +48,10 @@
<mat-form-field>
<input
matInput
name=
"name"
[(ngModel)]=
"contactObj.name"
placeholder=
"Name"
required
>
</mat-form-field>
<mat-form-field>
<!--
<mat-form-field>
<input matInput name="telephone" [(ngModel)]="contactObj.telephone" placeholder="Telephone number"
required>
</mat-form-field>
</mat-form-field>
-->
<mat-form-field>
<input
matInput
name=
"organization"
[(ngModel)]=
"contactObj.organization"
placeholder=
"Organization"
required
>
...
...
src/app/dac-dataset-management/dac-dataset-management.component.css
0 → 100644
View file @
81fd802f
.body
{
padding
:
10px
20px
10px
10px
;
}
.container
{
padding
:
10px
0px
0px
0px
;
}
.mat-row
:nth-child
(
even
)
{
background-color
:
#f8f8f8
;
}
.column
{
float
:
left
;
width
:
50%
;
}
.mat-header-cell
{
font-weight
:
bold
;
font-size
:
14px
;
color
:
#000000
c7
;
}
mat-form-field
{
width
:
100%
;
}
mat-card
{
margin
:
10px
;
}
mat-form-field
.mat-form-field
{
font-size
:
14px
;
font-family
:
Roboto
;
}
mat-icon
{
cursor
:
pointer
;
}
.mat-radio-button
~
.mat-radio-button
{
margin-left
:
16px
;
}
\ No newline at end of file
src/app/dac-dataset-management/dac-dataset-management.component.html
0 → 100644
View file @
81fd802f
<form
(ngSubmit)=
"submitDacDataset(f)"
#f
="
ngForm
"
>
<div
class=
"body"
>
<div>
<div
class=
"mat-h3 mat-tittle"
>
Register Dataset
</div>
</div>
<mat-divider></mat-divider>
<div
class=
"container"
>
<mat-card>
<mat-vertical-stepper
#stepper
>
<mat-step
label=
"Select an existing policy"
*ngIf=
"action!='Edit'"
>
<app-report
(selectedRecord)=
"getSelectedPolicy($event,stepper)"
[reportType]=
"ReportType.policies"
[embDefaultSearch]=
"true"
[embeded]=
"true"
>
</app-report>
<input
type=
"hidden"
name=
"policyRef"
[(ngModel)]=
"selectedDacPolicyId"
/>
</mat-step>
<mat-step
label=
"Submit dataset"
>
<div
class=
"row"
>
<div
class=
"column"
>
<mat-form-field
class=
"app-field-padding"
>
<input
matInput
placeholder=
"Short descriptive title for the dataset"
required
[(ngModel)]=
"title"
name=
"title"
/>
</mat-form-field>
<mat-form-field>
<textarea
matInput
rows=
"3"
[(ngModel)]=
"accessions"
name=
"accessions"
placeholder=
"Accessions of the runs and/or analysis to be associated with this dataset. e.g. EGAR00001nnnnnn, EGAZ00001nnnnnn)"
required
></textarea>
</mat-form-field>
</div>
<div
class=
"column"
>
<mat-form-field>
<textarea
matInput
rows=
"3"
[(ngModel)]=
"description"
name=
"description"
placeholder=
"Description for the dataset"
required
></textarea>
</mat-form-field>
</div>
</div>
<div
class=
"row"
>
<mat-card
style=
"display:flow-root"
>
<mat-card-subtitle>
Dataset type
</mat-card-subtitle>
<div
class=
"column"
>
<div
*ngFor=
"let type of datasetTypes1"
>
<mat-checkbox
matInput
[checked]=
"typeArr.indexOf(type)>=0"
(change)=
"typeSelected($event,type)"
>
{{type}}
</mat-checkbox>
</div>
</div>
<div
class=
"column"
>
<div
sty1e=
"float:left;width:50%"
*ngFor=
"let type of datasetTypes2"
>
<mat-checkbox
matInput
[checked]=
"typeArr.indexOf(type)>=0"
(change)=
"typeSelected($event,type)"
>
{{type}}
</mat-checkbox>
</div>
</div>
</mat-card>
</div>
<div
style=
"text-align:Center"
>
<button
mat-raised-button
color=
"accent"
[disabled]=
"f.invalid"
>
Save
</button>
<button
*ngIf=
"action==='Edit'"
mat-raised-button
style=
"margin-left: 5px;"
[routerLink]=
"['/report',ReportType.datasets,{defaultSearch: true}]"
>
Cancel
</button>
<button
*ngIf=
"action!='Edit'"
mat-raised-button
style=
"margin-left: 5px;"
routerLink=
""
>
Cancel
</button>
</div>
</mat-step>
</mat-vertical-stepper>
</mat-card>
</div>
</div>
<div
class=
"centred"
*ngIf=
"showLoadingFlag"
style=
"height:70px;"
>
<mat-spinner
[diameter]=
"50"
[strokeWidth]=
"5"
style=
"margin:0 auto;"
>
</mat-spinner>
</div>
</form>
\ No newline at end of file
src/app/dac-dataset-management/dac-dataset-management.component.ts
0 → 100644
View file @
81fd802f
import
{
Component
,
OnInit
}
from
'
@angular/core
'
;
import
{
MatDialog
,
MatStepper
}
from
'
@angular/material
'
;
import
{
ActivatedRoute
}
from
'
@angular/router
'
;
import
{
Observable
}
from
'
rxjs
'
;
import
{
ReportType
}
from
'
../report-type.enum
'
;
import
{
SubmissionResultDialogComponent
}
from
'
../submission-result-dialog/submission-result-dialog.component
'
;
import
{
UtilService
}
from
'
../util/Util-services
'
;
import
{
XmlService
}
from
'
../util/xml.service
'
;
@
Component
({
selector
:
'
app-dac-dataset-management
'
,
templateUrl
:
'
./dac-dataset-management.component.html
'
,
styleUrls
:
[
'
./dac-dataset-management.component.css
'
]
})
export
class
DacDatasetManagementComponent
implements
OnInit
{
constructor
(
private
xmlUtil
:
XmlService
,
private
util
:
UtilService
,
public
dialog
:
MatDialog
,
private
activatedRoute
:
ActivatedRoute
,)
{
}
ReportType
=
ReportType
;
selectedDacPolicyId
:
string
;
action
:
string
;
id
:
string
;
showLoadingFlag
=
false
;
xmlString
:
string
;
title
:
string
;
description
:
string
;
accessions
:
string
;
typeArr
=
[];
refArr
=
[];
selectedTypeArr
=
[];
ngOnInit
()
{
this
.
id
=
this
.
activatedRoute
.
snapshot
.
params
.
id
;
if
(
this
.
id
)
{
this
.
action
=
"
Edit
"
;
this
.
initEdit
(
this
.
id
);
}
}
getSelectedPolicy
(
reportObj
:
object
,
stepper
:
MatStepper
)
{
this
.
selectedDacPolicyId
=
reportObj
[
"
id
"
];
stepper
.
next
();
}
submitDacDataset
(
form
)
{
var
observable
:
Observable
<
string
>
;
let
redirectPath
=
""
;
this
.
accessions
=
this
.
accessions
.
replace
(
/
\s
/g
,
''
);
this
.
refArr
=
this
.
accessions
.
split
(
"
,
"
).
filter
(
val
=>
val
!=
""
).
sort
();
if
(
this
.
action
!=
"
Edit
"
)
{
observable
=
this
.
xmlUtil
.
generateDacDatasetXml
(
form
.
value
,
this
.
typeArr
,
this
.
refArr
);
}
else
{
observable
=
this
.
xmlUtil
.
updateDacDatasetXml
(
this
.
xmlString
,
form
.
value
,
this
.
typeArr
,
this
.
refArr
);
redirectPath
=
null
;
}
this
.
util
.
showSubmissionResponse
(
this
,
SubmissionResultDialogComponent
,
observable
,
redirectPath
);
}
initEdit
(
id
)
{
this
.
showLoading
();
this
.
util
.
getDacDatasetXml
(
id
).
subscribe
((
xmlString
:
any
)
=>
{
this
.
xmlString
=
xmlString
;
this
.
setPageValuesfromXml
();
});
}
showLoading
()
{
this
.
showLoadingFlag
=
true
;
}
hideLoading
()
{
this
.
showLoadingFlag
=
false
;
}
setPageValuesfromXml
()
{
var
parser
=
new
DOMParser
();
var
xmlDoc
=
parser
.
parseFromString
(
this
.
xmlString
,
"
text/xml
"
);
this
.
title
=
xmlDoc
.
getElementsByTagName
(
"
TITLE
"
)[
0
].
childNodes
[
0
].
nodeValue
;
this
.
description
=
xmlDoc
.
getElementsByTagName
(
"
DESCRIPTION
"
)[
0
].
childNodes
[
0
].
nodeValue
;
this
.
getAndSetAccession
(
xmlDoc
);
this
.
setDatasetType
(
xmlDoc
);
this
.
hideLoading
();
}
typeSelected
(
event
,
type
)
{
if
(
event
.
checked
)
{
if
(
this
.
typeArr
.
indexOf
(
type
)
===
-
1
)
{
this
.
typeArr
.
push
(
type
);
}
}
else
{
this
.
typeArr
.
splice
(
this
.
typeArr
.
indexOf
(
type
),
1
);
}
}
getAndSetAccession
(
xmlDoc
)
{
let
accessionArr
=
[];
let
runRef
=
xmlDoc
.
getElementsByTagName
(
"
RUN_REF
"
);
let
analysisRef
=
xmlDoc
.
getElementsByTagName
(
"
ANALYSIS_REF
"
);
for
(
var
i
=
0
;
i
<
runRef
.
length
;
i
++
)
{
accessionArr
.
push
(
runRef
[
i
].
getAttribute
(
"
accession
"
));
}
for
(
var
i
=
0
;
i
<
analysisRef
.
length
;
i
++
)
{
accessionArr
.
push
(
analysisRef
[
i
].
getAttribute
(
"
accession
"
));
}
this
.
accessions
=
accessionArr
.
join
(
"
,
"
);
}
setDatasetType
(
xmlDoc
)
{
let
datasetType
=
xmlDoc
.
getElementsByTagName
(
"
DATASET_TYPE
"
);
for
(
var
i
=
0
;
i
<
datasetType
.
length
;
i
++
)
{
if
(
this
.
typeArr
.
indexOf
(
datasetType
[
i
].
childNodes
[
0
].
nodeValue
)
<
0
)
{
this
.
typeArr
.
push
(
datasetType
[
i
].
childNodes
[
0
].
nodeValue
);
}
}
}
datasetTypes1
=
[
"
Whole genome sequencing
"
,
"
Exome sequencing
"
,
"
Genotyping by array
"
,
"
Transcriptome profiling by high-throughput sequencing
"
,
"
Transcriptome profiling by array
"
,
"
Amplicon sequencing
"
,
"
Methylation binding domain sequencing
"
]
datasetTypes2
=
[
"
Methylation profiling by high-throughput sequencing
"
,
"
Phenotype information
"
,
"
Study summary information
"
,
"
Genomic variant calling
"
,
"
Chromatin accessibility profiling by high-throughput sequencing
"
,
"
Histone modification profiling by high-throughput sequencing
"
,
"
Chip-Seq
"
]
}
src/app/dac-management/dac-management.component.html
View file @
81fd802f
...
...
@@ -7,7 +7,7 @@
<div
class=
"container"
>
<mat-card>
<mat-card-subtitle>
DAC Details
</mat-card-subtitle>
<div
style=
"width:
10
0%;"
>
<div
style=
"width:
5
0%;"
>
<mat-form-field
class=
"app-field-padding"
>
<textarea
rows=
"3"
matInput
placeholder=
"Short descriptive title for the DAC"
required
[(ngModel)]=
"title"
name=
"title"
></textarea>
...
...
@@ -32,12 +32,12 @@
</td>
</ng-container>
<ng-container
matColumnDef=
"telephone"
>
<!--
<ng-container matColumnDef="telephone">
<th mat-header-cell *matHeaderCellDef>Telephone</th>
<td mat-cell *matCellDef="let element">
{{ element.telephone }}
</td>
</ng-container>
</ng-container>
-->
<ng-container
matColumnDef=
"organization"
>
<th
mat-header-cell
*matHeaderCellDef
>
Organization
</th>
...
...
@@ -67,7 +67,7 @@
<button
mat-raised-button
color=
"accent"
[disabled]=
"f.invalid || contactArray.length < 1"
>
Save
</button>
<button
*ngIf=
"action==='Edit'"
mat-raised-button
style=
"margin-left: 5px;"
routerLink=
"/report
/studies
"
>
Cancel
</button>
[
routerLink
]
=
"
['
/report
',ReportType.dacs,{defaultSearch: true}]
"
>
Cancel
</button>
<button
*ngIf=
"action!='Edit'"
mat-raised-button
style=
"margin-left: 5px;"
routerLink=
""
>
Cancel
</button>
</div>
...
...
@@ -79,4 +79,4 @@
</div>
</div>
</form>
</form>
\ No newline at end of file
src/app/dac-management/dac-management.component.ts
View file @
81fd802f
...
...
@@ -3,6 +3,7 @@ import { MatDialog, MatTableDataSource } from '@angular/material';
import
{
ActivatedRoute
}
from
'
@angular/router
'
;
import
{
Observable
}
from
'
rxjs
'
;
import
{
ContactDialogModalComponent
}
from
'
../contact-dialog-modal/contact-dialog-modal.component
'
;
import
{
ReportType
}
from
'
../report-type.enum
'
;
import
{
SubmissionResultDialogComponent
}
from
'
../submission-result-dialog/submission-result-dialog.component
'
;
import
{
UtilService
}
from
'
../util/Util-services
'
;
import
{
XmlService
}
from
'
../util/xml.service
'
;
...
...
@@ -14,6 +15,7 @@ import { XmlService } from '../util/xml.service';
})
export
class
DacManagementComponent
implements
OnInit
{
ReportType
=
ReportType
;
editMode
=
false
;
/* Used for storing added emails, this will be used for validation */
emails
=
[];
...
...
@@ -27,7 +29,7 @@ export class DacManagementComponent implements OnInit {
displayedColumns
:
string
[]
=
[
"
emailAddress
"
,
"
name
"
,
"
telephone
"
,
//
"telephone",
"
organization
"
,
"
edit
"
,
"
remove
"
,
...
...
@@ -174,6 +176,7 @@ export class DacManagementComponent implements OnInit {
});
}
this
.
updateEmailsArray
();
if
(
contacts
.
length
>
0
)
{
this
.
dataSource
=
new
MatTableDataSource
<
any
>
(
this
.
contactArray
);
}
...
...
src/app/dac-policy-management/dac-policy-management.component.html
View file @
81fd802f
...
...
@@ -7,34 +7,54 @@
<div
class=
"container"
>
<mat-card>
<mat-vertical-stepper
#stepper
>
<mat-step
label=
"Select an existing DAC"
>
<app-report
(selectedRecord)=
"getSelectedDac($event,stepper)"
[reportType]=
"reportType"
[embDefaultSearch]=
"true"
[embeded]=
"true"
></app-report>
<mat-step
label=
"Select an existing DAC"
*ngIf=
"action!='Edit'"
>
<app-report
(selectedRecord)=
"getSelectedDac($event,stepper)"
[reportType]=
"ReportType.dacs"
[embDefaultSearch]=
"true"
[embeded]=
"true"
>
</app-report>
<input
type=
"hidden"
name=
"dacRef"
[(ngModel)]=
"selectedDacId"
/>
</mat-step>
<mat-step
label=
"Submit policy"
>
<div
style=
"width: 50%;"
>
<mat-radio-group
name=
"group"
[(ngModel)]=
"policyType"
>
<mat-radio-button
value=
"textSelected"
>
Enter
<mat-form-field
class=
"app-field-padding"
>
<input
matInput
placeholder=
"Short descriptive title for the policy"
required
[(ngModel)]=
"title"
name=
"title"
/>
</mat-form-field>
<mat-radio-group
name=
"group"
#radioGroup
="
matRadioGroup
"
>
<mat-radio-button
[checked]=
"!policyUrl"
value=
"textSelected"
>
Enter
policy text
</mat-radio-button>
<mat-radio-button
value=
"urlSelected"
>
Enter the
<mat-radio-button
[checked]=
"policyUrl"
value=
"urlSelected"
>
Enter
the
URL containing
your policy text
</mat-radio-button>
</mat-radio-group>
<mat-form-field
*ngIf=
"
policyTyp
e=='textSelected'"
>
<textarea
matInput
rows=
"3"
[(ngModel)]=
"
t
ext"
name=
"
text"
placeholder=
"P
olic
t t
ext"
required
></textarea>
<mat-form-field
*ngIf=
"
radioGroup.valu
e=='textSelected'"
>
<textarea
matInput
rows=
"3"
[(ngModel)]=
"
policyT
ext"
name=
"
p
olic
yT
ext"
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
*ngIf=
"radioGroup.value=='urlSelected'"
>
<input
matInput
[(ngModel)]=
"policyText"
name=
"policyText"
placeholder=
"Polict URL"
required
/>
</mat-form-field>
</div>
<div
style=
"text-align:Center"
>
<button
mat-raised-button
color=
"accent"
[disabled]=
"f.invalid"
>
Save
</button>
<button
*ngIf=
"action==='Edit'"
mat-raised-button
style=
"margin-left: 5px;"
[routerLink]=
"['/report',ReportType.policies,{defaultSearch: true}]"
>
Cancel
</button>
<button
*ngIf=
"action!='Edit'"
mat-raised-button
style=
"margin-left: 5px;"
routerLink=
""
>
Cancel
</button>
</div>
</mat-step>
</mat-vertical-stepper>
</mat-card>
</div>
</div>
<div
class=
"centred"
*ngIf=
"showLoadingFlag"
style=
"height:70px;"
>
<mat-spinner
[diameter]=
"50"
[strokeWidth]=
"5"
style=
"margin:0 auto;"
>
</mat-spinner>
</div>
</form>
\ No newline at end of file
src/app/dac-policy-management/dac-policy-management.component.ts
View file @
81fd802f
import
{
Component
,
OnInit
}
from
'
@angular/core
'
;
import
{
MatStepper
}
from
'
@angular/material
'
;
import
{
MatDialog
,
MatStepper
}
from
'
@angular/material
'
;
import
{
getEnabledCategories
}
from
'
trace_events
'
;
import
{
ReportType
}
from
'
../report-type.enum
'
;
import
{
FormControl
,
FormGroupDirective
,
NgForm
,
Validators
,
FormGroup
}
from
'
@angular/forms
'
;
import
{
Observable
}
from
'
rxjs
'
;
import
{
XmlService
}
from
'
../util/xml.service
'
;
import
{
UtilService
}
from
'
../util/Util-services
'
;
import
{
SubmissionResultDialogComponent
}
from
'
../submission-result-dialog/submission-result-dialog.component
'
;
import
{
ActivatedRoute
}
from
'
@angular/router
'
;
@
Component
({
...
...
@@ -12,15 +17,30 @@ import { FormControl, FormGroupDirective, NgForm, Validators, FormGroup } from '
})
export
class
DacPolicyManagementComponent
implements
OnInit
{
constructor
()
{
}
reportType
=
ReportType
.
dacs
;
constructor
(
private
xmlUtil
:
XmlService
,
private
util
:
UtilService
,
public
dialog
:
MatDialog
,
private
activatedRoute
:
ActivatedRoute
,)
{
}
ReportType
=
ReportType
;
selectedDacId
:
string
;
textSelected
:
boolean
;
urlSelected
:
boolean
;
text
:
string
;
url
:
string
;
action
:
string
;
id
:
string
;
showLoadingFlag
=
false
;
xmlString
:
string
;
title
:
string
;
policyText
:
string
;
policyUrl
=
false
;
ngOnInit
()
{
this
.
id
=
this
.
activatedRoute
.
snapshot
.
params
.
id
;
if
(
this
.
id
)
{
this
.
action
=
"
Edit
"
;
this
.
initEdit
(
this
.
id
);
}
}
getSelectedDac
(
reportObj
:
object
,
stepper
:
MatStepper
)
{
...
...
@@ -29,6 +49,56 @@ export class DacPolicyManagementComponent implements OnInit {
}
submitDacPolicy
(
form
)
{
var
observable
:
Observable
<
string
>
;
let
redirectPath
=
""
if
(
this
.
action
!=
"
Edit
"
)
{
observable
=
this
.
xmlUtil
.
generateDacPolicyXml
(
form
.
value
,
);
}
else
{
observable
=
this
.
xmlUtil
.
updateDacPolicyXml
(
this
.
xmlString
,
form
.
value
,
);
redirectPath
=
null
;
}
this
.
util
.
showSubmissionResponse
(
this
,
SubmissionResultDialogComponent
,