Commit d51f5110 authored by Rasko Leinonen's avatar Rasko Leinonen
Browse files

0.4.5. Fix to XML checklist parsing that did not work except in Chrome.

parent 1e3ecc71
......@@ -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",
......@@ -451,12 +452,14 @@
"balanced-match": {
"version": "1.0.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
......@@ -471,17 +474,20 @@
"code-point-at": {
"version": "1.1.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"concat-map": {
"version": "0.0.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"core-util-is": {
"version": "1.0.2",
......@@ -598,7 +604,8 @@
"inherits": {
"version": "2.0.3",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"ini": {
"version": "1.3.5",
......@@ -610,6 +617,7 @@
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
......@@ -624,6 +632,7 @@
"version": "3.0.4",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
......@@ -631,12 +640,14 @@
"minimist": {
"version": "0.0.8",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"minipass": {
"version": "2.3.5",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"safe-buffer": "^5.1.2",
"yallist": "^3.0.0"
......@@ -655,6 +666,7 @@
"version": "0.5.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"minimist": "0.0.8"
}
......@@ -735,7 +747,8 @@
"number-is-nan": {
"version": "1.0.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"object-assign": {
"version": "4.1.1",
......@@ -747,6 +760,7 @@
"version": "1.4.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"wrappy": "1"
}
......@@ -832,7 +846,8 @@
"safe-buffer": {
"version": "5.1.2",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"safer-buffer": {
"version": "2.1.2",
......@@ -868,6 +883,7 @@
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
......@@ -887,6 +903,7 @@
"version": "3.0.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"ansi-regex": "^2.0.0"
}
......@@ -930,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