Commit aaf3c77b authored by Josue Martinez Villacorta's avatar Josue Martinez Villacorta
Browse files

Merge branch 'master' of https://github.com/enasequence/sub-ang

parents a281407c d51f5110
......@@ -19,7 +19,7 @@ enum Environment{
localdev, localtest, dev , test , prod
}
ext.version_base = '0.4.4'
ext.version_base = '0.4.5'
ext.environment = project.hasProperty('env') ? env : Environment.dev.toString()
version = version_base + "-$ext.environment"
group = 'uk.ac.ebi.ena.webin-portal'
......
......@@ -430,7 +430,8 @@
"ansi-regex": {
"version": "2.1.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"aproba": {
"version": "1.2.0",
......@@ -845,7 +846,8 @@
"safe-buffer": {
"version": "5.1.2",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"safer-buffer": {
"version": "2.1.2",
......@@ -901,6 +903,7 @@
"version": "3.0.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"ansi-regex": "^2.0.0"
}
......@@ -944,12 +947,14 @@
"wrappy": {
"version": "1.0.2",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"yallist": {
"version": "3.0.3",
"bundled": true,
"dev": true
"dev": true,
"optional": true
}
}
},
......
......@@ -40,7 +40,7 @@ export class ChecklistComponent implements OnInit {
ChecklistType = ChecklistType; // Allows use in template
private _checklistGroups: Array<ChecklistGroupInterface>;
private _xmlParser = new DOMParser();
private _xmlDoc: Document;
checklistGroupDisplayedColumns = ['name'];
checklistGroupDataSource: MatTableDataSource<ChecklistGroupInterface>;
checklistDataSource: MatTableDataSource<ChecklistInterface>;
......@@ -155,11 +155,11 @@ export class ChecklistComponent implements OnInit {
}
getXmlTextValue(xmlDoc, xpath: string): string {
return document.evaluate(xpath, xmlDoc, null, XPathResult.STRING_TYPE, null).stringValue;
return this._xmlDoc.evaluate(xpath, xmlDoc, null, XPathResult.STRING_TYPE, null).stringValue;
}
getXmlNodes(xmlDoc, xpath: string) {
return document.evaluate(xpath, xmlDoc, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null);
return this._xmlDoc.evaluate(xpath, xmlDoc, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null);
}
getChecklistTypeParamValue(): string {
......@@ -192,7 +192,10 @@ export class ChecklistComponent implements OnInit {
})
).
subscribe(
data => this.setChecklistXmls(data),
data => {
this.setChecklistXmls(data);
}
,
(err: HttpErrorResponse) => {
console.log('** Webin checklist service failed **', err);
this.dataError = 'Webin checklist service failed. Please try again later. If the problem persists please contact the helpdesk.';
......@@ -219,10 +222,9 @@ export class ChecklistComponent implements OnInit {
setChecklistXmls(data): void {
// console.log('** setChecklistXmls **', data);
this._xmlDoc = (new DOMParser()).parseFromString(data.body, 'text/xml');
const checklistNodes = this.getXmlNodes(this._xmlDoc, '/CHECKLIST_SET/CHECKLIST');
const xmlDoc = this._xmlParser.parseFromString(data.body, 'text/xml');
const checklistNodes = this.getXmlNodes(xmlDoc, 'CHECKLIST_SET/CHECKLIST');
let checklistNode = checklistNodes.iterateNext();
while (checklistNode) {
const checklist: ChecklistInterface = {
......
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