@hestia-earth/ui-components 0.2.12 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/hestia-earth-ui-components.umd.js +474 -473
- package/bundles/hestia-earth-ui-components.umd.js.map +1 -1
- package/common/clipboard/clipboard.component.d.ts +1 -0
- package/cycles/cycles-activity/cycles-activity.component.d.ts +1 -3
- package/cycles/cycles-activity-logs/cycles-activity-logs.component.d.ts +42 -10
- package/cycles/cycles-completeness/cycles-completeness.component.d.ts +1 -3
- package/cycles/cycles-emissions/cycles-emissions.component.d.ts +1 -3
- package/cycles/cycles-emissions-chart/cycles-emissions-chart.component.d.ts +1 -2
- package/cycles/cycles-emissions-logs/cycles-emissions-logs.component.d.ts +42 -6
- package/cycles/cycles-practices/cycles-practices.component.d.ts +1 -3
- package/cycles/cycles-practices-logs/cycles-practices-logs.component.d.ts +42 -10
- package/cycles/cycles-result/cycles-result.component.d.ts +1 -3
- package/cycles/cycles.model.d.ts +3 -4
- package/esm2015/common/clipboard/clipboard.component.js +5 -3
- package/esm2015/cycles/cycles-activity/cycles-activity.component.js +2 -8
- package/esm2015/cycles/cycles-activity-logs/cycles-activity-logs.component.js +11 -21
- package/esm2015/cycles/cycles-completeness/cycles-completeness.component.js +2 -8
- package/esm2015/cycles/cycles-emissions/cycles-emissions.component.js +2 -8
- package/esm2015/cycles/cycles-emissions-chart/cycles-emissions-chart.component.js +4 -9
- package/esm2015/cycles/cycles-emissions-logs/cycles-emissions-logs.component.js +12 -14
- package/esm2015/cycles/cycles-practices/cycles-practices.component.js +2 -8
- package/esm2015/cycles/cycles-practices-logs/cycles-practices-logs.component.js +10 -21
- package/esm2015/cycles/cycles-result/cycles-result.component.js +4 -12
- package/esm2015/cycles/cycles.model.js +4 -5
- package/esm2015/files/files-form/files-form.component.js +1 -1
- package/esm2015/impact-assessments/impact-assessments-indicators-chart/impact-assessments-indicators-chart.component.js +4 -9
- package/esm2015/impact-assessments/impact-assessments-products/impact-assessments-products.component.js +2 -8
- package/esm2015/impact-assessments/impact-assessments-products-logs/impact-assessments-products-logs.component.js +8 -12
- package/esm2015/node/index.js +2 -1
- package/esm2015/node/node-link/node-link.component.js +2 -2
- package/esm2015/node/node-logs-models/node-logs-models.component.js +56 -326
- package/esm2015/node/node-logs-models/node-logs-models.model.js +370 -0
- package/esm2015/node/node-missing-lookup-factors/node-missing-lookup-factors.component.js +1 -1
- package/esm2015/node/node-value-details/node-value-details.component.js +3 -3
- package/esm2015/node/node.service.js +1 -1
- package/esm2015/sites/sites-maps/sites-maps.component.js +3 -9
- package/esm2015/sites/sites-measurements/sites-measurements.component.js +2 -8
- package/esm2015/sites/sites-measurements-logs/sites-measurements-logs.component.js +8 -12
- package/fesm2015/hestia-earth-ui-components.js +339 -328
- package/fesm2015/hestia-earth-ui-components.js.map +1 -1
- package/impact-assessments/impact-assessments-indicators-chart/impact-assessments-indicators-chart.component.d.ts +1 -2
- package/impact-assessments/impact-assessments-products/impact-assessments-products.component.d.ts +1 -3
- package/impact-assessments/impact-assessments-products-logs/impact-assessments-products-logs.component.d.ts +37 -6
- package/node/index.d.ts +1 -0
- package/node/node-logs-models/node-logs-models.component.d.ts +24 -88
- package/node/node-logs-models/node-logs-models.model.d.ts +88 -0
- package/node/node-missing-lookup-factors/node-missing-lookup-factors.component.d.ts +2 -1
- package/node/node.service.d.ts +1 -31
- package/package.json +2 -2
- package/sites/sites-maps/sites-maps.component.d.ts +1 -3
- package/sites/sites-measurements/sites-measurements.component.d.ts +1 -3
- package/sites/sites-measurements-logs/sites-measurements-logs.component.d.ts +39 -6
|
@@ -776,7 +776,7 @@
|
|
|
776
776
|
}]
|
|
777
777
|
}] });
|
|
778
778
|
|
|
779
|
-
var _a$4, _b$
|
|
779
|
+
var _a$4, _b$2, _c$3;
|
|
780
780
|
var termProperties = function (term) { return Object.keys(term).filter(function (key) { return !schema.isExpandable(term[key]) && ![
|
|
781
781
|
'pinned', 'expanded', 'extended', 'selected', 'loading',
|
|
782
782
|
'_score', '@type', '@id', '@context', 'createdAt',
|
|
@@ -814,8 +814,8 @@
|
|
|
814
814
|
return type in termTypeToLabel ? termTypeToLabel[type] : utils.keyToLabel(type);
|
|
815
815
|
};
|
|
816
816
|
var termTypesToChildren = function (termTypes) { return termTypes.map(function (termType) { return ({ label: termTypeLabel(termType), termType: termType }); }); };
|
|
817
|
-
var groups = Object.freeze((_b$
|
|
818
|
-
_b$
|
|
817
|
+
var groups = Object.freeze((_b$2 = {},
|
|
818
|
+
_b$2[schema.TermTermType.emission] = {
|
|
819
819
|
label: 'Emissions & Resource Use',
|
|
820
820
|
termType: 'Emissions & Resource Use',
|
|
821
821
|
children: termTypesToChildren([
|
|
@@ -827,12 +827,12 @@
|
|
|
827
827
|
schema.TermTermType.methodEmissionResourceUse
|
|
828
828
|
])
|
|
829
829
|
},
|
|
830
|
-
_b$
|
|
830
|
+
_b$2[schema.TermTermType.region] = {
|
|
831
831
|
label: termTypeLabel(schema.TermTermType.region),
|
|
832
832
|
termType: schema.TermTermType.region,
|
|
833
833
|
children: []
|
|
834
834
|
},
|
|
835
|
-
_b$
|
|
835
|
+
_b$2.infrastructure = {
|
|
836
836
|
label: 'Infrastructure & Equipment',
|
|
837
837
|
termType: 'Infrastructure & Equipment',
|
|
838
838
|
children: termTypesToChildren([
|
|
@@ -843,7 +843,7 @@
|
|
|
843
843
|
schema.TermTermType.machinery
|
|
844
844
|
])
|
|
845
845
|
},
|
|
846
|
-
_b$
|
|
846
|
+
_b$2.input = {
|
|
847
847
|
label: 'Inputs',
|
|
848
848
|
termType: 'Inputs',
|
|
849
849
|
children: termTypesToChildren([
|
|
@@ -861,7 +861,7 @@
|
|
|
861
861
|
schema.TermTermType.water
|
|
862
862
|
])
|
|
863
863
|
},
|
|
864
|
-
_b$
|
|
864
|
+
_b$2[schema.TermTermType.measurement] = {
|
|
865
865
|
label: 'Measurements',
|
|
866
866
|
termType: 'Measurements',
|
|
867
867
|
children: termTypesToChildren([
|
|
@@ -872,7 +872,7 @@
|
|
|
872
872
|
schema.TermTermType.methodMeasurement
|
|
873
873
|
])
|
|
874
874
|
},
|
|
875
|
-
_b$
|
|
875
|
+
_b$2.practice = {
|
|
876
876
|
label: 'Practices',
|
|
877
877
|
termType: 'Practices',
|
|
878
878
|
children: termTypesToChildren([
|
|
@@ -889,7 +889,7 @@
|
|
|
889
889
|
schema.TermTermType.waterRegime,
|
|
890
890
|
])
|
|
891
891
|
},
|
|
892
|
-
_b$
|
|
892
|
+
_b$2.product = {
|
|
893
893
|
label: 'Products',
|
|
894
894
|
termType: 'Products',
|
|
895
895
|
children: termTypesToChildren([
|
|
@@ -903,12 +903,12 @@
|
|
|
903
903
|
schema.TermTermType.processedFood
|
|
904
904
|
])
|
|
905
905
|
},
|
|
906
|
-
_b$
|
|
906
|
+
_b$2[schema.TermTermType.property] = {
|
|
907
907
|
label: termTypeLabel(schema.TermTermType.property),
|
|
908
908
|
termType: schema.TermTermType.property,
|
|
909
909
|
children: []
|
|
910
910
|
},
|
|
911
|
-
_b$
|
|
911
|
+
_b$2));
|
|
912
912
|
var termTypeGroups = [
|
|
913
913
|
groups.property,
|
|
914
914
|
groups.region,
|
|
@@ -1760,14 +1760,16 @@
|
|
|
1760
1760
|
type: i0.Input
|
|
1761
1761
|
}] } });
|
|
1762
1762
|
|
|
1763
|
+
var defaultIcon = 'clipboard';
|
|
1763
1764
|
var ClipboardComponent = /** @class */ (function () {
|
|
1764
1765
|
function ClipboardComponent() {
|
|
1765
1766
|
this.disabled = false;
|
|
1766
1767
|
this.hideText = false;
|
|
1767
|
-
this.icon =
|
|
1768
|
+
this.icon = defaultIcon;
|
|
1768
1769
|
this.size = 'md';
|
|
1769
1770
|
this.rotate = 0;
|
|
1770
1771
|
this.clipboardClass = 'no-print px-3';
|
|
1772
|
+
this.defaultIcon = defaultIcon;
|
|
1771
1773
|
}
|
|
1772
1774
|
ClipboardComponent.prototype.onClick = function ($event) {
|
|
1773
1775
|
$event.stopPropagation();
|
|
@@ -1804,7 +1806,7 @@
|
|
|
1804
1806
|
return ClipboardComponent;
|
|
1805
1807
|
}());
|
|
1806
1808
|
ClipboardComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ClipboardComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1807
|
-
ClipboardComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ClipboardComponent, selector: "he-clipboard", inputs: { value: "value", disabled: "disabled", hideText: "hideText", icon: "icon", size: "size", rotate: "rotate", clipboardClass: "clipboardClass" }, viewQueries: [{ propertyName: "valueNode", first: true, predicate: ["valueNode"], descendants: true }, { propertyName: "tooltip", first: true, predicate: ["t"], descendants: true }], ngImport: i0__namespace, template: "<span #valueNode [class.is-hidden]=\"hideText\">{{value}}</span>\n\n<span [class]=\"clipboardClass\" pointer (click)=\"!disabled && onClick($event)\"\n ngbTooltip=\"Copied!\" triggers=\"manual\" placement=\"bottom\" container=\"body\" #t=\"ngbTooltip\"\n>\n <fa-icon [icon]=\"icon\" [size]=\"size\" [rotate]=\"rotate\"></fa-icon>\n</span>\n", styles: [""], components: [{ type: i1__namespace.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }], directives: [{ type: i11__namespace.NgbTooltip, selector: "[ngbTooltip]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disableTooltip", "tooltipClass", "openDelay", "closeDelay", "ngbTooltip"], outputs: ["shown", "hidden"], exportAs: ["ngbTooltip"] }] });
|
|
1809
|
+
ClipboardComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ClipboardComponent, selector: "he-clipboard", inputs: { value: "value", disabled: "disabled", hideText: "hideText", icon: "icon", size: "size", rotate: "rotate", clipboardClass: "clipboardClass" }, viewQueries: [{ propertyName: "valueNode", first: true, predicate: ["valueNode"], descendants: true }, { propertyName: "tooltip", first: true, predicate: ["t"], descendants: true }], ngImport: i0__namespace, template: "<span #valueNode [class.is-hidden]=\"hideText\">{{value}}</span>\n\n<span [class]=\"clipboardClass\" pointer (click)=\"!disabled && onClick($event)\"\n ngbTooltip=\"Copied!\" triggers=\"manual\" placement=\"bottom\" container=\"body\" #t=\"ngbTooltip\"\n>\n <fa-icon [icon]=\"icon || defaultIcon\" [size]=\"size\" [rotate]=\"rotate\"></fa-icon>\n</span>\n", styles: [""], components: [{ type: i1__namespace.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }], directives: [{ type: i11__namespace.NgbTooltip, selector: "[ngbTooltip]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disableTooltip", "tooltipClass", "openDelay", "closeDelay", "ngbTooltip"], outputs: ["shown", "hidden"], exportAs: ["ngbTooltip"] }] });
|
|
1808
1810
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ClipboardComponent, decorators: [{
|
|
1809
1811
|
type: i0.Component,
|
|
1810
1812
|
args: [{
|
|
@@ -4268,7 +4270,7 @@
|
|
|
4268
4270
|
}]
|
|
4269
4271
|
}], ctorParameters: function () { return [{ type: i1__namespace$3.HttpClient }, { type: HeCommonService }]; } });
|
|
4270
4272
|
|
|
4271
|
-
var _a$3, _b, _c$2, _d$
|
|
4273
|
+
var _a$3, _b$1, _c$2, _d$2, _e;
|
|
4272
4274
|
var searchableTypes = [
|
|
4273
4275
|
schema.NodeType.Cycle,
|
|
4274
4276
|
schema.NodeType.Source
|
|
@@ -4451,11 +4453,11 @@
|
|
|
4451
4453
|
/**
|
|
4452
4454
|
* List of fields to search in.
|
|
4453
4455
|
*/
|
|
4454
|
-
var searchFields = Object.freeze((_b = {},
|
|
4455
|
-
_b[schema.NodeType.Cycle] = ['name', 'description'],
|
|
4456
|
-
_b[schema.NodeType.Source] = ['name', 'bibliography.title'],
|
|
4457
|
-
_b[schema.NodeType.ImpactAssessment] = ['name', 'product.name', 'country.name'],
|
|
4458
|
-
_b));
|
|
4456
|
+
var searchFields = Object.freeze((_b$1 = {},
|
|
4457
|
+
_b$1[schema.NodeType.Cycle] = ['name', 'description'],
|
|
4458
|
+
_b$1[schema.NodeType.Source] = ['name', 'bibliography.title'],
|
|
4459
|
+
_b$1[schema.NodeType.ImpactAssessment] = ['name', 'product.name', 'country.name'],
|
|
4460
|
+
_b$1));
|
|
4459
4461
|
var searchFieldsNested = Object.freeze((_c$2 = {},
|
|
4460
4462
|
_c$2[schema.NodeType.Cycle] = [
|
|
4461
4463
|
'inputs.term.name',
|
|
@@ -4471,10 +4473,10 @@
|
|
|
4471
4473
|
/**
|
|
4472
4474
|
* Specific strict queries per type.
|
|
4473
4475
|
*/
|
|
4474
|
-
var searchQueries = (_d$
|
|
4475
|
-
_d$
|
|
4476
|
-
_d$
|
|
4477
|
-
_d$
|
|
4476
|
+
var searchQueries = (_d$2 = {},
|
|
4477
|
+
_d$2[schema.NodeType.Cycle] = { must: [], must_not: [matchAggregatedQuery] },
|
|
4478
|
+
_d$2[schema.NodeType.Source] = { must: [], must_not: [matchAggregatedQuery] },
|
|
4479
|
+
_d$2);
|
|
4478
4480
|
var searchFiltersKeys = (_e = {},
|
|
4479
4481
|
_e[schema.NodeType.Cycle] = function (key) { return key; },
|
|
4480
4482
|
_e[schema.NodeType.Source] = function (key) { return key; },
|
|
@@ -4793,16 +4795,16 @@
|
|
|
4793
4795
|
time: '',
|
|
4794
4796
|
unit: ''
|
|
4795
4797
|
}[key] || key).trim(); };
|
|
4796
|
-
var csvValue = function (value) { return (value || '').replace('[', '').replace(']', '').trim(); };
|
|
4797
|
-
var parseMessage = function (message) { return message.split(',').reduce(function (prev, parts) {
|
|
4798
|
+
var csvValue$1 = function (value) { return (value || '').replace('[', '').replace(']', '').trim(); };
|
|
4799
|
+
var parseMessage$1 = function (message) { return message.split(',').reduce(function (prev, parts) {
|
|
4798
4800
|
var _a;
|
|
4799
4801
|
var _b = __read(parts.split('='), 2), key = _b[0], value = _b[1];
|
|
4800
|
-
var val = csvValue(value);
|
|
4802
|
+
var val = csvValue$1(value);
|
|
4801
4803
|
return Object.assign(Object.assign({}, prev), (key && val ? (_a = {}, _a[csvKey(key)] = val, _a) : {}));
|
|
4802
4804
|
}, {}); };
|
|
4803
4805
|
var formatLine = function (_a) {
|
|
4804
4806
|
var _b = _a.data, timestamp = _b.timestamp, message = _b.message;
|
|
4805
|
-
return (Object.assign({ timestamp: timestamp }, parseMessage(message)));
|
|
4807
|
+
return (Object.assign({ timestamp: timestamp }, parseMessage$1(message)));
|
|
4806
4808
|
};
|
|
4807
4809
|
var toCsv$1 = function (lines) { return json2Csv.json2csvAsync(lines.map(formatLine).filter(function (data) { return Object.keys(data).length > 1; }), {
|
|
4808
4810
|
emptyFieldValue: ''
|
|
@@ -4816,13 +4818,12 @@
|
|
|
4816
4818
|
});
|
|
4817
4819
|
};
|
|
4818
4820
|
/**
|
|
4819
|
-
*
|
|
4821
|
+
* If Transformation, return the Transformation Term @id.
|
|
4820
4822
|
*
|
|
4821
|
-
* @param node
|
|
4822
|
-
* @param logs
|
|
4823
|
+
* @param node Cycle or Transformation
|
|
4823
4824
|
* @returns
|
|
4824
4825
|
*/
|
|
4825
|
-
var
|
|
4826
|
+
var logsKey = function (node) { return (node.type || node['@type']) === schema.NodeType.Cycle ? null : node.term['@id']; };
|
|
4826
4827
|
|
|
4827
4828
|
var _a$1;
|
|
4828
4829
|
var linkTypeEnabled = function (type) { return [
|
|
@@ -5387,7 +5388,7 @@
|
|
|
5387
5388
|
this.node['@type'].toLowerCase(),
|
|
5388
5389
|
this.id
|
|
5389
5390
|
].filter(Boolean).join('/');
|
|
5390
|
-
return
|
|
5391
|
+
return url + "?dataState=" + api.DataState.recalculated;
|
|
5391
5392
|
},
|
|
5392
5393
|
enumerable: false,
|
|
5393
5394
|
configurable: true
|
|
@@ -5498,10 +5499,171 @@
|
|
|
5498
5499
|
type: i0.Input
|
|
5499
5500
|
}] } });
|
|
5500
5501
|
|
|
5501
|
-
var _c$1, _d$2;
|
|
5502
5502
|
var get$3 = require('lodash.get');
|
|
5503
|
+
var set$1 = require('lodash.set');
|
|
5503
5504
|
var orderBy$5 = require('lodash.orderby');
|
|
5504
|
-
var
|
|
5505
|
+
var termTypes = Object.values(schema.TermTermType);
|
|
5506
|
+
var blankNodeTypes = Object.values(schema.SchemaType).filter(function (t) { return !schema.isTypeNode(t); });
|
|
5507
|
+
var schemaTypesLowerCase = Object.values(schema.SchemaType).map(function (v) { return v.toLowerCase(); });
|
|
5508
|
+
var blankNodeTypesLowerCase = blankNodeTypes.map(function (v) { return v.toLowerCase(); });
|
|
5509
|
+
var missingLookupPrefix = 'Missing lookup';
|
|
5510
|
+
var parseFilename = function (filepath) {
|
|
5511
|
+
var _c = __read(filepath.split('.'), 1), filename = _c[0];
|
|
5512
|
+
var ext = termTypes.includes(filename) ? api.SupportedExtensions.xlsx : api.SupportedExtensions.csv;
|
|
5513
|
+
return api.fileToExt(filename, ext);
|
|
5514
|
+
};
|
|
5515
|
+
var parseLookup = function (_c) {
|
|
5516
|
+
var column = _c.column, termid = _c.termid, _d = missingLookupPrefix, missingLookup = _c[_d];
|
|
5517
|
+
return ({
|
|
5518
|
+
filename: parseFilename(missingLookup), termId: termid,
|
|
5519
|
+
column: column
|
|
5520
|
+
});
|
|
5521
|
+
};
|
|
5522
|
+
var csvValue = function (value) { return (value || '').replace('[', '').replace(']', ''); };
|
|
5523
|
+
var parseMessage = function (message) {
|
|
5524
|
+
try {
|
|
5525
|
+
var data = JSON.parse(message);
|
|
5526
|
+
return data.message.split(',').reduce(function (prev, parts) {
|
|
5527
|
+
var _c;
|
|
5528
|
+
var _d = __read(parts.split('='), 2), key = _d[0], value = _d[1];
|
|
5529
|
+
var val = csvValue(value);
|
|
5530
|
+
return Object.assign(Object.assign({}, prev), (key && val ? (_c = {}, _c[key.trim()] = val, _c) : {}));
|
|
5531
|
+
}, { logger: data.logger });
|
|
5532
|
+
}
|
|
5533
|
+
catch (err) {
|
|
5534
|
+
// make sure it works even if one log is malformed
|
|
5535
|
+
return {};
|
|
5536
|
+
}
|
|
5537
|
+
};
|
|
5538
|
+
var omitLogKeys = function (log) { return Object.fromEntries(Object.entries(log).filter(function (_c) {
|
|
5539
|
+
var _d = __read(_c, 1), key = _d[0];
|
|
5540
|
+
return !schemaTypesLowerCase.includes(key);
|
|
5541
|
+
})); };
|
|
5542
|
+
var includeBlankNodes = function (logs, log) { return Object
|
|
5543
|
+
.keys(log)
|
|
5544
|
+
.filter(function (key) { return blankNodeTypesLowerCase.includes(key); })
|
|
5545
|
+
.reduce(function (prev, key) {
|
|
5546
|
+
var _c;
|
|
5547
|
+
return (Object.assign(Object.assign({}, prev), (_c = {}, _c[key] = utils.unique(__spreadArray(__spreadArray([], __read(((typeof prev[key] === 'string' ? [prev[key]] : prev[key]) || []))), [
|
|
5548
|
+
log[key]
|
|
5549
|
+
])), _c)));
|
|
5550
|
+
}, logs); };
|
|
5551
|
+
var groupLog = function (group, _a) {
|
|
5552
|
+
var logger = _a.logger, term = _a.term, model = _a.model, key = _a.key, should_run = _a.should_run, run_required = _a.run_required, property = _a.property, log = __rest(_a, ["logger", "term", "model", "key", "should_run", "run_required", "property"]);
|
|
5553
|
+
var isOrchestrator = logger.includes('orchestrator');
|
|
5554
|
+
var isKey = !isOrchestrator && !!key;
|
|
5555
|
+
var parentLogKey = ["[\"" + term + "\"]", !isOrchestrator && key || property].filter(Boolean).join('.');
|
|
5556
|
+
var logModelKey = [parentLogKey, model].filter(Boolean).join('.');
|
|
5557
|
+
set$1(group, parentLogKey + ".models", utils.unique(__spreadArray(__spreadArray([], __read(get$3(group, parentLogKey + ".models", []))), [
|
|
5558
|
+
model
|
|
5559
|
+
])));
|
|
5560
|
+
set$1(group, parentLogKey + ".isKey", isKey);
|
|
5561
|
+
var data = get$3(group, logModelKey, {});
|
|
5562
|
+
data = includeBlankNodes(data, log);
|
|
5563
|
+
if (typeof should_run !== 'undefined') {
|
|
5564
|
+
var shouldRun = should_run === 'True';
|
|
5565
|
+
data = isOrchestrator ? Object.assign(Object.assign({}, data), { shouldRunOrchestrator: shouldRun }) : Object.assign(Object.assign(Object.assign({}, data), omitLogKeys(log)), { shouldRun: shouldRun });
|
|
5566
|
+
}
|
|
5567
|
+
else if (typeof run_required !== 'undefined') {
|
|
5568
|
+
var runRequired = run_required === 'True';
|
|
5569
|
+
data = Object.assign(Object.assign(Object.assign({}, data), (runRequired ? {} : omitLogKeys(log))), {
|
|
5570
|
+
runRequired: runRequired
|
|
5571
|
+
});
|
|
5572
|
+
}
|
|
5573
|
+
else if ('requirements' in log) {
|
|
5574
|
+
var requirements = log.requirements, logData = __rest(log, ["requirements"]);
|
|
5575
|
+
data.requirements = Object.assign(Object.assign({}, (data.requirements || {})), logData);
|
|
5576
|
+
}
|
|
5577
|
+
else if (missingLookupPrefix in log) {
|
|
5578
|
+
data.missingLookups = utils.unique(__spreadArray(__spreadArray([], __read((data.missingLookups || []))), [
|
|
5579
|
+
parseLookup(log)
|
|
5580
|
+
]));
|
|
5581
|
+
}
|
|
5582
|
+
else if (!isOrchestrator) {
|
|
5583
|
+
data.logs = Object.assign(Object.assign({}, (data.logs || {})), omitLogKeys(log));
|
|
5584
|
+
}
|
|
5585
|
+
set$1(group, logModelKey, data);
|
|
5586
|
+
return group;
|
|
5587
|
+
};
|
|
5588
|
+
var groupLogSubValue = function (group, log, key) {
|
|
5589
|
+
var id = log[key];
|
|
5590
|
+
var data = groupLog(group[id] || {}, log);
|
|
5591
|
+
group[id] = data;
|
|
5592
|
+
if (key === 'transformation') {
|
|
5593
|
+
// add value to the same term/model on parent group
|
|
5594
|
+
Object.entries(group[id]).map(function (_c) {
|
|
5595
|
+
var _d = __read(_c, 2), term = _d[0], models = _d[1];
|
|
5596
|
+
return Object.keys(models).map(function (model) {
|
|
5597
|
+
var _a;
|
|
5598
|
+
if ((_a = group === null || group === void 0 ? void 0 : group[term]) === null || _a === void 0 ? void 0 : _a[model]) {
|
|
5599
|
+
group[term][model][key] = utils.unique(__spreadArray(__spreadArray([], __read((group[term][model][key] || []))), [
|
|
5600
|
+
id
|
|
5601
|
+
]));
|
|
5602
|
+
}
|
|
5603
|
+
});
|
|
5604
|
+
});
|
|
5605
|
+
}
|
|
5606
|
+
return group;
|
|
5607
|
+
};
|
|
5608
|
+
var subValueKeys = [
|
|
5609
|
+
'transformation'
|
|
5610
|
+
];
|
|
5611
|
+
var groupLogsByModel = function (data) { return data.split('\n')
|
|
5612
|
+
.map(parseMessage)
|
|
5613
|
+
.filter(function (v) { return !!(v === null || v === void 0 ? void 0 : v.term) && (v === null || v === void 0 ? void 0 : v.term) !== 'None' && !!(v === null || v === void 0 ? void 0 : v.model); })
|
|
5614
|
+
.reduce(function (group, log) {
|
|
5615
|
+
var subValue = subValueKeys.find(function (v) { return !!log[v]; });
|
|
5616
|
+
return subValue ?
|
|
5617
|
+
subValue === 'transformation' ?
|
|
5618
|
+
// for transformation, do not add to top-level model
|
|
5619
|
+
groupLogSubValue(group, log, subValue) :
|
|
5620
|
+
groupLog(groupLogSubValue(group, log, subValue), log)
|
|
5621
|
+
: groupLog(group, log);
|
|
5622
|
+
}); };
|
|
5623
|
+
var computeTerms = function (originalValues, recalculatedValues, terms, filterTermTypes) { return rxjs.from((terms === null || terms === void 0 ? void 0 : terms.length) ?
|
|
5624
|
+
terms :
|
|
5625
|
+
__spreadArray(__spreadArray([], __read((originalValues || []).map(function (_c) {
|
|
5626
|
+
var term = _c.term;
|
|
5627
|
+
return term;
|
|
5628
|
+
}))), __read((recalculatedValues || []).map(function (_c) {
|
|
5629
|
+
var term = _c.term;
|
|
5630
|
+
return term;
|
|
5631
|
+
}))).filter(function (node) { return !(filterTermTypes === null || filterTermTypes === void 0 ? void 0 : filterTermTypes.length) || filterTermTypes.includes(node.termType); })).pipe(operators.distinct(function (v) { return v['@id']; }), operators.toArray(), operators.map(function (v) { return orderBy$5(v, ['name'], ['asc']); })).toPromise(); };
|
|
5632
|
+
exports.LogStatus = void 0;
|
|
5633
|
+
(function (LogStatus) {
|
|
5634
|
+
LogStatus["success"] = "successful";
|
|
5635
|
+
LogStatus["error"] = "failed";
|
|
5636
|
+
LogStatus["skipHierarchy"] = "not run (model higher up hierarchy run instead)";
|
|
5637
|
+
LogStatus["dataProvided"] = "not run (user provided data retained)";
|
|
5638
|
+
LogStatus["notRequired"] = "not relevant";
|
|
5639
|
+
})(exports.LogStatus || (exports.LogStatus = {}));
|
|
5640
|
+
var hasLogDetails = function (data, logs) {
|
|
5641
|
+
var _a;
|
|
5642
|
+
return [
|
|
5643
|
+
exports.LogStatus.success,
|
|
5644
|
+
exports.LogStatus.error
|
|
5645
|
+
].includes(logStatus(data, logs)) && ((logs === null || logs === void 0 ? void 0 : logs.requirements) || (logs === null || logs === void 0 ? void 0 : logs.logs) || ((_a = logs === null || logs === void 0 ? void 0 : logs.missingLookups) === null || _a === void 0 ? void 0 : _a.length));
|
|
5646
|
+
};
|
|
5647
|
+
var logStatus = function (data, logs) { return hasLog(logs)
|
|
5648
|
+
? (!data.isRequired
|
|
5649
|
+
? exports.LogStatus.notRequired
|
|
5650
|
+
: isRunOrchestrator(logs)
|
|
5651
|
+
? ('shouldRun' in logs
|
|
5652
|
+
? logs.shouldRun
|
|
5653
|
+
? data.isRecalculated
|
|
5654
|
+
? exports.LogStatus.success
|
|
5655
|
+
: exports.LogStatus.dataProvided
|
|
5656
|
+
: exports.LogStatus.error
|
|
5657
|
+
: exports.LogStatus.dataProvided)
|
|
5658
|
+
: data.isRecalculated
|
|
5659
|
+
? exports.LogStatus.skipHierarchy
|
|
5660
|
+
: exports.LogStatus.dataProvided)
|
|
5661
|
+
: ([
|
|
5662
|
+
typeof data.originalValue === 'undefined',
|
|
5663
|
+
data.isRecalculated // is recalculated
|
|
5664
|
+
].every(Boolean)
|
|
5665
|
+
? exports.LogStatus.skipHierarchy
|
|
5666
|
+
: exports.LogStatus.dataProvided); };
|
|
5505
5667
|
var reduceValues = function (values, termId) {
|
|
5506
5668
|
var propertyValues = values
|
|
5507
5669
|
.map(function (_c) {
|
|
@@ -5513,6 +5675,7 @@
|
|
|
5513
5675
|
return propertyValues.length ? propertyValues.reduce(function (p, v) { return p + v; }, 0) : undefined;
|
|
5514
5676
|
};
|
|
5515
5677
|
var isRunOrchestrator = function (log) { return !('shouldRunOrchestrator' in log) || log.shouldRunOrchestrator; };
|
|
5678
|
+
var isBackground = function (log) { return (log === null || log === void 0 ? void 0 : log.methodTier) === schema.EmissionMethodTier.background; };
|
|
5516
5679
|
var hasLog = function (log, withOrchestrator) {
|
|
5517
5680
|
if (withOrchestrator === void 0) { withOrchestrator = true; }
|
|
5518
5681
|
return !!log && ('shouldRun' in log ||
|
|
@@ -5559,7 +5722,7 @@
|
|
|
5559
5722
|
var model = _c.model;
|
|
5560
5723
|
return model;
|
|
5561
5724
|
}) }); }); };
|
|
5562
|
-
var logSubValues = function (logs, original, recalculated, models, _c) {
|
|
5725
|
+
var logSubValues = function (allLogs, logs, original, recalculated, models, _c) {
|
|
5563
5726
|
var nodeType = _c.nodeType, type = _c.type, termId = _c.termId;
|
|
5564
5727
|
return utils.unique(__spreadArray(__spreadArray(__spreadArray([], __read(Object.keys(logs).flatMap(function (key) { return [
|
|
5565
5728
|
logSubValue(logs, key, 'input'),
|
|
@@ -5571,21 +5734,29 @@
|
|
|
5571
5734
|
.map(function (v) {
|
|
5572
5735
|
var originalValue = blankNodeValue(original, v.key, v.id);
|
|
5573
5736
|
var recalculatedValue = blankNodeValue(recalculated, v.key, v.id);
|
|
5574
|
-
return Object.assign(Object.assign({}, v), { configModels: v.configModels.map(
|
|
5737
|
+
return Object.assign(Object.assign({}, v), { configModels: v.configModels.map(configModelWithDocs(models, { nodeType: nodeType, type: type, termId: termId }, v)), originalValue: originalValue, recalculatedValue: recalculatedValue, isRecalculated: !utils.isUndefined(recalculatedValue) && recalculatedValue !== originalValue, isRequired: true });
|
|
5575
5738
|
})
|
|
5576
|
-
.filter(function (v) { return v.configModels.length > 0; })
|
|
5739
|
+
.filter(function (v) { return v.configModels.length > 0; })
|
|
5740
|
+
.map(dataWithConfigModelLogs(allLogs));
|
|
5577
5741
|
};
|
|
5742
|
+
// const hasKey = (blankNodes: blankNode[], key: string) => (blankNodes || []).some(n => key in n);
|
|
5578
5743
|
var logKeys = function (logs, original, recalculated, models, _c) {
|
|
5579
5744
|
var nodeType = _c.nodeType, type = _c.type, termId = _c.termId;
|
|
5580
5745
|
return Object.keys(logs)
|
|
5581
5746
|
.filter(function (key) { return logs[key].isKey; })
|
|
5582
5747
|
.map(function (key) { return ({
|
|
5583
5748
|
key: key,
|
|
5584
|
-
configModels: [
|
|
5749
|
+
configModels: (logs[key].models || [])
|
|
5750
|
+
.map(configModelWithDocs(models, { nodeType: nodeType, type: type, termId: termId }, { key: key }))
|
|
5751
|
+
// only take those we found a matching model (avoid matching key on wrong node type)
|
|
5752
|
+
.filter(function (v) { return !!v.model; }),
|
|
5585
5753
|
originalValue: blankNodeValue(original, key),
|
|
5586
5754
|
recalculatedValue: blankNodeValue(recalculated, key),
|
|
5587
|
-
isRecalculated: isRecalculated(recalculated, key)
|
|
5588
|
-
|
|
5755
|
+
isRecalculated: isRecalculated(recalculated, key),
|
|
5756
|
+
isRequired: true
|
|
5757
|
+
}); })
|
|
5758
|
+
.filter(function (v) { return v.configModels.length > 0; })
|
|
5759
|
+
.map(dataWithConfigModelLogs(logs));
|
|
5589
5760
|
};
|
|
5590
5761
|
var isBackgroundNoInput = function (logs) { return logs.methodTier === schema.EmissionMethodTier.background && !logs.input; };
|
|
5591
5762
|
var isModelLog = function (logs) { return [
|
|
@@ -5611,17 +5782,9 @@
|
|
|
5611
5782
|
}).filter(Boolean);
|
|
5612
5783
|
return indexes.length ? indexes[0] : '';
|
|
5613
5784
|
};
|
|
5614
|
-
var
|
|
5785
|
+
var configModelWithDocs = function (models, _c, subValue) {
|
|
5615
5786
|
var nodeType = _c.nodeType, type = _c.type, termId = _c.termId;
|
|
5616
|
-
if (isKey === void 0) { isKey = false; }
|
|
5617
5787
|
return function (methodId) {
|
|
5618
|
-
var key = (subValue === null || subValue === void 0 ? void 0 : subValue.key)
|
|
5619
|
-
? subValue.id
|
|
5620
|
-
// handle "input.hestiaAggregatedData" for example
|
|
5621
|
-
? (subValue === null || subValue === void 0 ? void 0 : subValue.key) + "." + methodId
|
|
5622
|
-
// handle "input.price"
|
|
5623
|
-
: type.toLowerCase() + "." + (isKey ? methodId : subValue === null || subValue === void 0 ? void 0 : subValue.key)
|
|
5624
|
-
: null;
|
|
5625
5788
|
var node = {
|
|
5626
5789
|
'@type': nodeType,
|
|
5627
5790
|
term: { '@id': (subValue === null || subValue === void 0 ? void 0 : subValue.id) || termId },
|
|
@@ -5629,10 +5792,22 @@
|
|
|
5629
5792
|
};
|
|
5630
5793
|
return {
|
|
5631
5794
|
methodId: methodId,
|
|
5632
|
-
model: findMatchingModel(models, modelParams(node)) ||
|
|
5795
|
+
model: findMatchingModel(models, modelParams(node)) ||
|
|
5796
|
+
findMatchingModel(models, modelKeyParams(node, (subValue === null || subValue === void 0 ? void 0 : subValue.key) + "." + methodId)) ||
|
|
5797
|
+
// handle "input.price"
|
|
5798
|
+
findMatchingModel(models, modelKeyParams(node, type.toLowerCase() + "." + (subValue === null || subValue === void 0 ? void 0 : subValue.key))) ||
|
|
5799
|
+
// handle "input.hestiaAggregatedData"
|
|
5800
|
+
findMatchingModel(models, modelKeyParams(node, type.toLowerCase() + "." + methodId))
|
|
5633
5801
|
};
|
|
5634
5802
|
};
|
|
5635
5803
|
};
|
|
5804
|
+
var configModelWithLogs = function (data, logs) { return function (model) { return (Object.assign(Object.assign({}, model), { logs: logs === null || logs === void 0 ? void 0 : logs[model.methodId], status: logStatus(data, logs === null || logs === void 0 ? void 0 : logs[model.methodId]), showLogs: hasLogDetails(data, logs === null || logs === void 0 ? void 0 : logs[model.methodId]) })); }; };
|
|
5805
|
+
var dataWithConfigModelLogs = function (logs) { return function (data) {
|
|
5806
|
+
var subLogKey = data.id || data.key ?
|
|
5807
|
+
data.id || data.key : null;
|
|
5808
|
+
var log = subLogKey ? logs[subLogKey] : logs;
|
|
5809
|
+
return Object.assign(Object.assign({}, data), { configModels: data.configModels.map(function (model) { return Array.isArray(model) ? model.map(configModelWithLogs(data, log)) : configModelWithLogs(data, log)(model); }) });
|
|
5810
|
+
}; };
|
|
5636
5811
|
/**
|
|
5637
5812
|
* Group models running in parallel under the same array, as they should appear vertically.
|
|
5638
5813
|
*
|
|
@@ -5660,38 +5835,98 @@
|
|
|
5660
5835
|
var groupParallelValues = function (values, models, termId) { return Array.isArray(models)
|
|
5661
5836
|
? Object.fromEntries(models.map(function (model) { return [model.methodId, valueByMethodId(values, model.methodId, termId)]; }))
|
|
5662
5837
|
: {}; };
|
|
5663
|
-
var
|
|
5664
|
-
|
|
5665
|
-
|
|
5666
|
-
|
|
5667
|
-
|
|
5668
|
-
|
|
5669
|
-
|
|
5670
|
-
|
|
5671
|
-
|
|
5672
|
-
|
|
5673
|
-
|
|
5674
|
-
|
|
5675
|
-
|
|
5676
|
-
|
|
5677
|
-
|
|
5678
|
-
|
|
5679
|
-
|
|
5680
|
-
|
|
5838
|
+
var groupLogsByTerm = function (nodeType, logs, models, config, allOriginalValues, allRecalculatedValues, nodeKey) {
|
|
5839
|
+
var originalValues = (allOriginalValues || []).filter(function (value) { return !value.deleted; });
|
|
5840
|
+
var recalculatedValues = (allRecalculatedValues || []).filter(function (value) { return !value.deleted; });
|
|
5841
|
+
var type = originalValues.length ?
|
|
5842
|
+
originalValues[0]['@type'] || originalValues[0].type :
|
|
5843
|
+
recalculatedValues.length ?
|
|
5844
|
+
recalculatedValues[0]['@type'] || recalculatedValues[0].type :
|
|
5845
|
+
undefined;
|
|
5846
|
+
return function (term) {
|
|
5847
|
+
var termId = term['@id'];
|
|
5848
|
+
var termLogs = get$3(logs, termId, {});
|
|
5849
|
+
var original = originalValues.filter(function (v) { return termId === v.term['@id']; });
|
|
5850
|
+
var recalculated = recalculatedValues.filter(function (v) { return termId === v.term['@id']; });
|
|
5851
|
+
var hasData = !!original.length || !!recalculated.length || Object.keys(termLogs).length > 0;
|
|
5852
|
+
var configModelsData = { nodeType: nodeType, type: type, termId: termId };
|
|
5853
|
+
var configModels = groupParallelModels(config, termId, nodeKey, utils.unique(__spreadArray(__spreadArray([], __read((termLogs.models || []).filter(function (key) { return isModelLog(termLogs[key]); }))), __read(findConfigModels(config, termId, nodeKey, models).map(function (_c) {
|
|
5854
|
+
var model = _c.model;
|
|
5855
|
+
return model;
|
|
5856
|
+
})))).map(configModelWithDocs(models, configModelsData)));
|
|
5857
|
+
var keys = logKeys(termLogs, original, recalculated, models, configModelsData);
|
|
5858
|
+
var subValues = logSubValues(logs, termLogs, original, recalculated, models, configModelsData);
|
|
5859
|
+
var isRequired = !Object.values(termLogs)
|
|
5860
|
+
.filter(function (v) { return typeof v === 'object' && !Array.isArray(v); })
|
|
5861
|
+
// ignore models that were never going to run
|
|
5862
|
+
.filter(isRunOrchestrator)
|
|
5863
|
+
.every(function (v) { return v.runRequired === false; });
|
|
5864
|
+
return dataWithConfigModelLogs(termLogs)({
|
|
5865
|
+
isOpen: true,
|
|
5866
|
+
canOpen: keys.length > 0 || subValues.length > 0,
|
|
5867
|
+
termId: termId,
|
|
5868
|
+
term: term,
|
|
5869
|
+
type: type,
|
|
5870
|
+
configModels: configModels,
|
|
5871
|
+
original: original,
|
|
5872
|
+
originalValue: reduceValues(original, termId),
|
|
5873
|
+
recalculated: recalculated,
|
|
5874
|
+
recalculatedValue: reduceValues(recalculated, termId),
|
|
5875
|
+
isOriginal: !!original.length,
|
|
5876
|
+
isRecalculated: isRecalculated(recalculated),
|
|
5877
|
+
hasData: hasData,
|
|
5878
|
+
isRequired: isRequired,
|
|
5879
|
+
logs: termLogs,
|
|
5880
|
+
keys: keys,
|
|
5881
|
+
subValues: subValues,
|
|
5882
|
+
allParallel: allParallel(configModels),
|
|
5883
|
+
originalValueByMethodId: groupParallelValues(original, configModels[0], termId),
|
|
5884
|
+
recalculatedValueByMethodId: groupParallelValues(recalculated, configModels[0], termId)
|
|
5885
|
+
});
|
|
5886
|
+
};
|
|
5887
|
+
};
|
|
5888
|
+
var modelCount = function (blankNodeLogs) { return Math.max.apply(Math.max, __spreadArray([
|
|
5889
|
+
0
|
|
5890
|
+
], __read(blankNodeLogs.flatMap(function (v) { return __spreadArray(__spreadArray([
|
|
5891
|
+
v.configModels.length
|
|
5892
|
+
], __read(v.subValues.map(function (s) { var _a, _b; return (_b = (_a = s.configModels) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0; }))), [
|
|
5893
|
+
v.keys.length ? 1 : 0
|
|
5894
|
+
]); })))); };
|
|
5895
|
+
|
|
5896
|
+
var _b, _c$1;
|
|
5897
|
+
var nodeTypesLowerCase = Object.values(schema.NodeType).map(function (v) { return v.toLowerCase(); });
|
|
5898
|
+
var logIcon = (_b = {},
|
|
5899
|
+
_b[exports.LogStatus.success] = 'check',
|
|
5900
|
+
_b[exports.LogStatus.error] = 'times',
|
|
5901
|
+
_b[exports.LogStatus.skipHierarchy] = ['far', 'circle'],
|
|
5902
|
+
_b[exports.LogStatus.dataProvided] = 'circle',
|
|
5903
|
+
_b[exports.LogStatus.notRequired] = 'dot-circle',
|
|
5904
|
+
_b);
|
|
5905
|
+
var logColor = (_c$1 = {},
|
|
5906
|
+
_c$1[exports.LogStatus.success] = 'success',
|
|
5907
|
+
_c$1[exports.LogStatus.error] = 'danger',
|
|
5908
|
+
_c$1[exports.LogStatus.skipHierarchy] = 'dark',
|
|
5909
|
+
_c$1[exports.LogStatus.dataProvided] = 'dark',
|
|
5910
|
+
_c$1[exports.LogStatus.notRequired] = 'grey',
|
|
5681
5911
|
_c$1);
|
|
5682
|
-
var
|
|
5683
|
-
|
|
5684
|
-
|
|
5685
|
-
|
|
5686
|
-
|
|
5687
|
-
|
|
5688
|
-
|
|
5912
|
+
var methodIdLabel = function (methodId) { return methodId ?
|
|
5913
|
+
({
|
|
5914
|
+
transformation: 'Data From Transformation',
|
|
5915
|
+
impact_assessment: 'Data From Cycle'
|
|
5916
|
+
})[methodId] || utils.keyToLabel(methodId)
|
|
5917
|
+
: ''; };
|
|
5918
|
+
var getModelsAt = function (_b, index) {
|
|
5919
|
+
var configModels = _b.configModels;
|
|
5920
|
+
return configModels[index];
|
|
5921
|
+
};
|
|
5922
|
+
var requirementKeys = function (requirements) { return Object.keys(requirements).filter(function (k) { return !nodeTypesLowerCase.includes(k); }); };
|
|
5923
|
+
var requirementColor = function (value) { return !value || ['None', 'False', '0', '0.0'].includes(value) ? 'danger' : 'white'; };
|
|
5689
5924
|
var NodeLogsModelsComponent = /** @class */ (function () {
|
|
5690
|
-
function NodeLogsModelsComponent(searchService, engineService) {
|
|
5925
|
+
function NodeLogsModelsComponent(nodeService, searchService, engineService) {
|
|
5691
5926
|
var _this = this;
|
|
5927
|
+
this.nodeService = nodeService;
|
|
5692
5928
|
this.searchService = searchService;
|
|
5693
5929
|
this.engineService = engineService;
|
|
5694
|
-
this.models = [];
|
|
5695
5930
|
this.allTerms = [];
|
|
5696
5931
|
this.allBlankNodes = [];
|
|
5697
5932
|
this.includeAllModels = true;
|
|
@@ -5700,30 +5935,37 @@
|
|
|
5700
5935
|
this.terms = [];
|
|
5701
5936
|
this.baseUrl = baseUrl();
|
|
5702
5937
|
this.isExternal = isExternal();
|
|
5703
|
-
this.
|
|
5938
|
+
this.LogStatus = exports.LogStatus;
|
|
5939
|
+
this.logIcon = logIcon;
|
|
5940
|
+
this.logColor = logColor;
|
|
5704
5941
|
this.propertyValue = term.propertyValue;
|
|
5942
|
+
this.getModelsAt = getModelsAt;
|
|
5943
|
+
this.requirementKeys = requirementKeys;
|
|
5944
|
+
this.requirementColor = requirementColor;
|
|
5705
5945
|
this.loading = true;
|
|
5706
5946
|
this.blankNodes = [];
|
|
5707
5947
|
this.methodModelsCount = 0;
|
|
5708
5948
|
this.rowsCount = 0;
|
|
5709
5949
|
this.onlyRequired = true;
|
|
5710
5950
|
this.showLegend = true;
|
|
5711
|
-
this.LogStatus = LogStatus;
|
|
5712
|
-
this.logIcon = logIcon;
|
|
5713
|
-
this.logColor = logColor;
|
|
5714
5951
|
this.suggestTerm = function (text$) { return text$.pipe(operators.distinctUntilChanged(), operators.switchMap(function (v) { return _this.suggestByTerm(v); })); };
|
|
5715
5952
|
}
|
|
5716
5953
|
NodeLogsModelsComponent.prototype.ngOnInit = function () {
|
|
5717
5954
|
return __awaiter(this, void 0, void 0, function () {
|
|
5718
|
-
var
|
|
5719
|
-
|
|
5720
|
-
|
|
5721
|
-
switch (_g.label) {
|
|
5955
|
+
var logsString, groupedLogs, logs, nodeType, config, models, _b, engineModels, _c, _d;
|
|
5956
|
+
return __generator(this, function (_e) {
|
|
5957
|
+
switch (_e.label) {
|
|
5722
5958
|
case 0:
|
|
5723
|
-
|
|
5724
|
-
return [4 /*yield*/, this.
|
|
5959
|
+
this.logsUrl = this.nodeService.nodeLogsUrl(this.node);
|
|
5960
|
+
return [4 /*yield*/, this.nodeService.getLog(this.node).toPromise()];
|
|
5725
5961
|
case 1:
|
|
5726
|
-
|
|
5962
|
+
logsString = _e.sent();
|
|
5963
|
+
groupedLogs = groupLogsByModel(logsString);
|
|
5964
|
+
logs = this.logsKey ? groupedLogs[this.logsKey] : groupedLogs;
|
|
5965
|
+
nodeType = this.node['@type'] || this.node.type;
|
|
5966
|
+
return [4 /*yield*/, this.engineService.ochestratorConfig(nodeType)];
|
|
5967
|
+
case 2:
|
|
5968
|
+
config = _e.sent();
|
|
5727
5969
|
return [4 /*yield*/, this.searchService.search({
|
|
5728
5970
|
fields: ['@type', '@id', 'name'],
|
|
5729
5971
|
limit: 1000,
|
|
@@ -5736,84 +5978,31 @@
|
|
|
5736
5978
|
}
|
|
5737
5979
|
}
|
|
5738
5980
|
})];
|
|
5739
|
-
case 2:
|
|
5740
|
-
models = (_g.sent()).results;
|
|
5741
|
-
this.models = models;
|
|
5742
|
-
_d = this;
|
|
5743
|
-
return [4 /*yield*/, rxjs.from(this.models).pipe(operators.filter(function (v) { return !!v; }), operators.distinct(function (v) { return v['@id']; }), operators.reduce(function (prev, curr) {
|
|
5744
|
-
var _c;
|
|
5745
|
-
return (Object.assign(Object.assign({}, prev), (_c = {}, _c[curr['@id']] = curr, _c)));
|
|
5746
|
-
}, {})).toPromise()];
|
|
5747
5981
|
case 3:
|
|
5748
|
-
|
|
5749
|
-
|
|
5750
|
-
return [4 /*yield*/,
|
|
5982
|
+
models = (_e.sent()).results;
|
|
5983
|
+
_b = this;
|
|
5984
|
+
return [4 /*yield*/, rxjs.from(models).pipe(operators.filter(function (v) { return !!v; }), operators.distinct(function (v) { return v['@id']; }), operators.reduce(function (prev, curr) {
|
|
5985
|
+
var _b;
|
|
5986
|
+
return (Object.assign(Object.assign({}, prev), (_b = {}, _b[curr['@id']] = curr, _b)));
|
|
5987
|
+
}, {})).toPromise()];
|
|
5751
5988
|
case 4:
|
|
5752
|
-
|
|
5753
|
-
return [3 /*break*/, 6];
|
|
5989
|
+
_b.methodsById = _e.sent();
|
|
5990
|
+
if (!this.includeAllModels) return [3 /*break*/, 6];
|
|
5991
|
+
return [4 /*yield*/, this.engineService.models()];
|
|
5754
5992
|
case 5:
|
|
5755
|
-
|
|
5756
|
-
|
|
5993
|
+
_c = _e.sent();
|
|
5994
|
+
return [3 /*break*/, 7];
|
|
5757
5995
|
case 6:
|
|
5758
|
-
|
|
5759
|
-
|
|
5760
|
-
recalculatedValues = (this.recalculatedValues || []).filter(function (value) { return !value.deleted; });
|
|
5761
|
-
type = originalValues.length ?
|
|
5762
|
-
originalValues[0]['@type'] || originalValues[0].type :
|
|
5763
|
-
recalculatedValues.length ?
|
|
5764
|
-
recalculatedValues[0]['@type'] || recalculatedValues[0].type :
|
|
5765
|
-
undefined;
|
|
5766
|
-
_f = this;
|
|
5767
|
-
return [4 /*yield*/, this.fetchAllTerms()];
|
|
5996
|
+
_c = [];
|
|
5997
|
+
_e.label = 7;
|
|
5768
5998
|
case 7:
|
|
5769
|
-
|
|
5770
|
-
|
|
5771
|
-
|
|
5772
|
-
|
|
5773
|
-
|
|
5774
|
-
|
|
5775
|
-
|
|
5776
|
-
var configModelsData = { nodeType: _this.nodeType, type: type, termId: termId };
|
|
5777
|
-
var configModels = groupParallelModels(_this.config, termId, _this.nodeKey, utils.unique(__spreadArray(__spreadArray([], __read(Object.keys(termLogs).filter(function (key) { return isModelLog(termLogs[key]); }))), __read(findConfigModels(_this.config, termId, _this.nodeKey, allModels).map(function (_c) {
|
|
5778
|
-
var model = _c.model;
|
|
5779
|
-
return model;
|
|
5780
|
-
})))).map(configWithDocs(allModels, configModelsData)));
|
|
5781
|
-
var keys = logKeys(termLogs, original, recalculated, allModels, configModelsData);
|
|
5782
|
-
var subValues = logSubValues(termLogs, original, recalculated, allModels, configModelsData);
|
|
5783
|
-
var isRequired = !Object.values(termLogs)
|
|
5784
|
-
// ignore models that were never going to run
|
|
5785
|
-
.filter(isRunOrchestrator)
|
|
5786
|
-
.every(function (logs) { return logs.runRequired === false; });
|
|
5787
|
-
return {
|
|
5788
|
-
isOpen: true,
|
|
5789
|
-
canOpen: keys.length > 0 || subValues.length > 0,
|
|
5790
|
-
termId: termId,
|
|
5791
|
-
term: term,
|
|
5792
|
-
type: type,
|
|
5793
|
-
configModels: configModels,
|
|
5794
|
-
original: original,
|
|
5795
|
-
originalValue: reduceValues(original, termId),
|
|
5796
|
-
recalculated: recalculated,
|
|
5797
|
-
recalculatedValue: reduceValues(recalculated, termId),
|
|
5798
|
-
isOriginal: !!original.length,
|
|
5799
|
-
isRecalculated: isRecalculated(recalculated),
|
|
5800
|
-
hasData: hasData,
|
|
5801
|
-
isRequired: isRequired,
|
|
5802
|
-
logs: termLogs,
|
|
5803
|
-
keys: keys,
|
|
5804
|
-
subValues: subValues,
|
|
5805
|
-
allParallel: allParallel(configModels),
|
|
5806
|
-
originalValueByMethodId: groupParallelValues(original, configModels[0], termId),
|
|
5807
|
-
recalculatedValueByMethodId: groupParallelValues(recalculated, configModels[0], termId)
|
|
5808
|
-
};
|
|
5809
|
-
});
|
|
5810
|
-
this.methodModelsCount = Math.max.apply(Math.max, __spreadArray([
|
|
5811
|
-
0
|
|
5812
|
-
], __read(this.allBlankNodes.flatMap(function (v) { return __spreadArray(__spreadArray([
|
|
5813
|
-
v.configModels.length
|
|
5814
|
-
], __read(v.subValues.map(function (s) { var _a, _b; return (_b = (_a = s.configModels) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0; }))), [
|
|
5815
|
-
v.keys.length ? 1 : 0
|
|
5816
|
-
]); }))));
|
|
5999
|
+
engineModels = _c;
|
|
6000
|
+
_d = this;
|
|
6001
|
+
return [4 /*yield*/, computeTerms(this.originalValues, this.recalculatedValues, this.terms, this.filterTermTypes)];
|
|
6002
|
+
case 8:
|
|
6003
|
+
_d.allTerms = _e.sent();
|
|
6004
|
+
this.allBlankNodes = this.allTerms.flatMap(groupLogsByTerm(nodeType, logs, engineModels, config, this.originalValues, this.recalculatedValues, this.nodeKey));
|
|
6005
|
+
this.methodModelsCount = modelCount(this.allBlankNodes);
|
|
5817
6006
|
this.rowsCount = this.allBlankNodes.reduce(function (prev, curr) { return prev + 1 + curr.subValues.length + curr.keys.length; }, 0);
|
|
5818
6007
|
this.filterResults();
|
|
5819
6008
|
this.loading = false;
|
|
@@ -5822,37 +6011,12 @@
|
|
|
5822
6011
|
});
|
|
5823
6012
|
});
|
|
5824
6013
|
};
|
|
5825
|
-
NodeLogsModelsComponent.prototype.fetchAllTerms = function () {
|
|
5826
|
-
var _a;
|
|
5827
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
5828
|
-
var _this = this;
|
|
5829
|
-
return __generator(this, function (_c) {
|
|
5830
|
-
return [2 /*return*/, rxjs.from(((_a = this.terms) === null || _a === void 0 ? void 0 : _a.length) ?
|
|
5831
|
-
this.terms :
|
|
5832
|
-
__spreadArray(__spreadArray([], __read((this.originalValues || []).map(function (_c) {
|
|
5833
|
-
var term = _c.term;
|
|
5834
|
-
return term;
|
|
5835
|
-
}))), __read((this.recalculatedValues || []).map(function (_c) {
|
|
5836
|
-
var term = _c.term;
|
|
5837
|
-
return term;
|
|
5838
|
-
}))).filter(function (node) { var _a; return !((_a = _this.filterTermTypes) === null || _a === void 0 ? void 0 : _a.length) || _this.filterTermTypes.includes(node.termType); })).pipe(operators.distinct(function (v) { return v['@id']; }), operators.toArray(), operators.map(function (v) { return orderBy$5(v, ['name'], ['asc']); })).toPromise()];
|
|
5839
|
-
});
|
|
5840
|
-
});
|
|
5841
|
-
};
|
|
5842
6014
|
NodeLogsModelsComponent.prototype.suggestByTerm = function (term) {
|
|
5843
6015
|
return rxjs.from(this.allTerms).pipe(operators.map(function (v) { return v.name; }), operators.filter(function (v) { return v.toLowerCase().includes(term.toLowerCase()); }), operators.toArray());
|
|
5844
6016
|
};
|
|
5845
6017
|
NodeLogsModelsComponent.prototype.trackByBlankNode = function (_index, node) {
|
|
5846
6018
|
return node.termId;
|
|
5847
6019
|
};
|
|
5848
|
-
NodeLogsModelsComponent.prototype.keyValue = function (blankNodes, key) {
|
|
5849
|
-
var value = (blankNodes === null || blankNodes === void 0 ? void 0 : blankNodes.length) ? blankNodes[0][key] : null;
|
|
5850
|
-
return ['string', 'number', 'boolean'].includes(typeof value) ? (value || '') : null;
|
|
5851
|
-
};
|
|
5852
|
-
NodeLogsModelsComponent.prototype.openPopover = function (popover, _c) {
|
|
5853
|
-
var blankNode = _c.blankNode, methodId = _c.methodId, subValue = _c.subValue, logs = _c.logs;
|
|
5854
|
-
return this.hasLogDetails(blankNode, methodId, subValue) ? popover.open({ logs: logs }) : null;
|
|
5855
|
-
};
|
|
5856
6020
|
Object.defineProperty(NodeLogsModelsComponent.prototype, "filteredType", {
|
|
5857
6021
|
get: function () {
|
|
5858
6022
|
var _a;
|
|
@@ -5864,8 +6028,8 @@
|
|
|
5864
6028
|
NodeLogsModelsComponent.prototype.filterResults = function () {
|
|
5865
6029
|
var _this = this;
|
|
5866
6030
|
setTimeout(function () {
|
|
5867
|
-
_this.blankNodes = _this.allBlankNodes.filter(function (
|
|
5868
|
-
var isRequired =
|
|
6031
|
+
_this.blankNodes = _this.allBlankNodes.filter(function (_b) {
|
|
6032
|
+
var isRequired = _b.isRequired, name = _b.term.name;
|
|
5869
6033
|
var _a;
|
|
5870
6034
|
return _this.term
|
|
5871
6035
|
? name.toLowerCase().includes(_this.term.toLowerCase())
|
|
@@ -5873,76 +6037,15 @@
|
|
|
5873
6037
|
});
|
|
5874
6038
|
});
|
|
5875
6039
|
};
|
|
5876
|
-
|
|
5877
|
-
|
|
5878
|
-
var id = _c.id, key = _c.key;
|
|
5879
|
-
// try to get a more precise logs, defaults to id otherwise
|
|
5880
|
-
return get$3(this.logs, [id, node.termId].join('.'), key === 'property' ? {} : get$3(this.logs, id, {}) // property needs to be mapped to the exact node to work
|
|
5881
|
-
);
|
|
5882
|
-
};
|
|
5883
|
-
NodeLogsModelsComponent.prototype.getLogs = function (node, methodId, subValue) {
|
|
5884
|
-
var logs = (subValue === null || subValue === void 0 ? void 0 : subValue.key) ? this.getSubvalueLogs(node, subValue) : node.logs || {};
|
|
5885
|
-
return logs[methodId];
|
|
5886
|
-
};
|
|
5887
|
-
NodeLogsModelsComponent.prototype.isBackground = function (log) {
|
|
5888
|
-
return (log === null || log === void 0 ? void 0 : log.methodTier) === schema.EmissionMethodTier.background;
|
|
5889
|
-
};
|
|
5890
|
-
NodeLogsModelsComponent.prototype.isUserProvided = function (node, methodId, subValue) {
|
|
5891
|
-
var log = this.getLogs(node, methodId, subValue);
|
|
5892
|
-
return [
|
|
5893
|
-
typeof node.originalValue === 'undefined',
|
|
5894
|
-
node.isRecalculated,
|
|
5895
|
-
this.isBackground(log),
|
|
5896
|
-
log === null || log === void 0 ? void 0 : log.isKey,
|
|
5897
|
-
this.hasLog(log, false) // skip if contains logs other than orchestrator
|
|
5898
|
-
].every(function (v) { return !v; });
|
|
5899
|
-
};
|
|
5900
|
-
NodeLogsModelsComponent.prototype.getModelsAt = function (node, index, subValue) {
|
|
5901
|
-
var configModels = (subValue || node).configModels;
|
|
5902
|
-
return configModels[index];
|
|
5903
|
-
};
|
|
5904
|
-
NodeLogsModelsComponent.prototype.methodName = function (node, methodId, subValue) {
|
|
6040
|
+
NodeLogsModelsComponent.prototype.methodName = function (_b) {
|
|
6041
|
+
var methodId = _b.methodId;
|
|
5905
6042
|
var _a;
|
|
5906
|
-
|
|
5907
|
-
return ((_a = this.methodsById[methodId]) === null || _a === void 0 ? void 0 : _a.name) ||
|
|
5908
|
-
(log === null || log === void 0 ? void 0 : log.key) ||
|
|
5909
|
-
(log === null || log === void 0 ? void 0 : log.model) ||
|
|
5910
|
-
(methodId ? methodIdLabel(methodId) : '');
|
|
5911
|
-
};
|
|
5912
|
-
NodeLogsModelsComponent.prototype.hasLogDetails = function (node, methodId, subValue) {
|
|
5913
|
-
var _a;
|
|
5914
|
-
var log = this.getLogs(node, methodId, subValue);
|
|
5915
|
-
return [
|
|
5916
|
-
LogStatus.success,
|
|
5917
|
-
LogStatus.error
|
|
5918
|
-
].includes(this.logStatus(node, methodId, subValue)) && ((log === null || log === void 0 ? void 0 : log.requirements) || (log === null || log === void 0 ? void 0 : log.logs) || ((_a = log === null || log === void 0 ? void 0 : log.missingLookups) === null || _a === void 0 ? void 0 : _a.length));
|
|
5919
|
-
};
|
|
5920
|
-
NodeLogsModelsComponent.prototype.logStatus = function (node, methodId, subValue) {
|
|
5921
|
-
var log = this.getLogs(node, methodId, subValue);
|
|
5922
|
-
return this.isUserProvided(node, methodId, subValue)
|
|
5923
|
-
? LogStatus.dataProvided
|
|
5924
|
-
: (hasLog(log)
|
|
5925
|
-
? (!node.isRequired
|
|
5926
|
-
? LogStatus.notRequired
|
|
5927
|
-
: isRunOrchestrator(log)
|
|
5928
|
-
? ('shouldRun' in log
|
|
5929
|
-
? log.shouldRun ? LogStatus.success : LogStatus.error
|
|
5930
|
-
: LogStatus.dataProvided)
|
|
5931
|
-
: node.isRecalculated
|
|
5932
|
-
? LogStatus.skipHierarchy
|
|
5933
|
-
: LogStatus.dataProvided)
|
|
5934
|
-
: LogStatus.skipHierarchy);
|
|
5935
|
-
};
|
|
5936
|
-
NodeLogsModelsComponent.prototype.requirementKeys = function (requirements) {
|
|
5937
|
-
return Object.keys(requirements).filter(function (k) { return !nodeTypesLowerCase.includes(k); });
|
|
5938
|
-
};
|
|
5939
|
-
NodeLogsModelsComponent.prototype.requirementColor = function (value) {
|
|
5940
|
-
return !value || ['None', 'False', '0', '0.0'].includes(value) ? 'danger' : 'white';
|
|
6043
|
+
return ((_a = this.methodsById[methodId]) === null || _a === void 0 ? void 0 : _a.name) || methodIdLabel(methodId);
|
|
5941
6044
|
};
|
|
5942
6045
|
return NodeLogsModelsComponent;
|
|
5943
6046
|
}());
|
|
5944
|
-
NodeLogsModelsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: NodeLogsModelsComponent, deps: [{ token: HeSearchService }, { token: HeEngineService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
5945
|
-
NodeLogsModelsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: NodeLogsModelsComponent, selector: "he-node-logs-models", inputs: { nodeType: "nodeType", nodeKey: "nodeKey", includeAllModels: "includeAllModels", logsUrl: "logsUrl", originalValues: "originalValues", recalculatedValues: "recalculatedValues", terms: "terms", logs: "logs", filterTermTypes: "filterTermTypes" }, ngImport: i0__namespace, template: "<div class=\"px-3 pb-3\">\n <div class=\"has-text-right mb-2\" *ngIf=\"!isExternal\">\n <a class=\"is-size-7\" *ngIf=\"logsUrl\" [href]=\"logsUrl\" target=\"_blank\">\n <fa-icon icon=\"external-link-alt\"></fa-icon>\n <span class=\"pl-2\">Open Full Logs</span>\n </a>\n </div>\n\n <he-data-table class=\"mb-1 is-small\" [small]=\"true\" [nbRows]=\"rowsCount\" maxHeight=\"320\">\n <table class=\"table is-narrow is-striped\">\n <thead>\n <tr>\n <th class=\"width-auto\">\n <div class=\"field\">\n <div class=\"control is-expanded has-icons-right\">\n <input class=\"input search-input is-small\"\n [(ngModel)]=\"term\" name=\"term\"\n placeholder=\"Filter by name\"\n [ngbTypeahead]=\"suggestTerm\"\n [focusFirst]=\"false\"\n (change)=\"filterResults()\"\n >\n <a class=\"icon is-small is-right\"\n [class.is-hidden]=\"!term\"\n (click)=\"term = ''; filterResults();\"\n >\n <fa-icon icon=\"times\"></fa-icon>\n </a>\n </div>\n </div>\n </th>\n <th class=\"has-border-right\">Units</th>\n <th>Original</th>\n <th>Recalculated</th>\n <th>Difference</th>\n <th *ngFor=\"let c of methodModelsCount | times; let i = index\">({{i + 1}})</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngIf=\"loading\">\n <td class=\"has-text-centered\" colspan=\"6\">\n <div class=\"has-text-center py-3\">\n <fa-icon icon=\"spinner\" [pulse]=\"true\" size=\"lg\"></fa-icon>\n </div>\n </td>\n </tr>\n <tr *ngIf=\"!loading && blankNodes.length === 0\">\n <td class=\"has-text-centered\" colspan=\"6\">\n <span>No data</span>\n </td>\n </tr>\n <ng-container *ngFor=\"let blankNode of blankNodes; trackBy: trackByBlankNode\">\n <tr [class.has-sub-rows]=\"blankNode.canOpen\">\n <td class=\"width-auto\" [attr.title]=\"blankNode.term.name\">\n <a class=\"is-inline-block is-align-top pr-2 open-node\"\n (click)=\"blankNode.isOpen = !blankNode.isOpen\"\n *ngIf=\"blankNode.canOpen\"\n >\n <fa-icon icon=\"angle-down\" [class.is-hidden]=\"!blankNode.isOpen\"></fa-icon>\n <fa-icon icon=\"angle-right\" [class.is-hidden]=\"blankNode.isOpen\"></fa-icon>\n </a>\n <he-node-link class=\"is-inline-block\" [node]=\"blankNode.term\">\n <span class=\"is-nowrap has-text-ellipsis\">{{blankNode.term.name}}</span>\n </he-node-link>\n </td>\n <td class=\"has-border-right\">\n <span>{{blankNode.term?.units}}</span>\n </td>\n <td>\n <ng-template #defaultOriginalValue>\n <span>{{blankNode.originalValue | precision:3 | default:'-'}}</span>\n </ng-template>\n <ng-container *ngIf=\"blankNode.allParallel; else defaultOriginalValue\">\n <div *ngFor=\"let model of blankNode.configModels[0]\">{{blankNode.originalValueByMethodId[model.methodId] | precision:3 | default:'-'}}</div>\n </ng-container>\n </td>\n <td>\n <ng-container *ngIf=\"!blankNode.isOriginal || blankNode.isRecalculated; else notRecalculated\">\n <ng-template #defaultRecalculatedValue>\n <span>{{blankNode.recalculatedValue | precision:3 | default:'-'}}</span>\n </ng-template>\n <ng-container *ngIf=\"blankNode.allParallel; else defaultRecalculatedValue\">\n <div *ngFor=\"let model of blankNode.configModels[0]\">{{blankNode.recalculatedValueByMethodId[model.methodId] | precision:3 | default:'-'}}</div>\n </ng-container>\n </ng-container>\n </td>\n <td class=\"is-nowrap\">\n <ng-template #defaultDeltaValue>\n <he-blank-node-value-delta *ngIf=\"blankNode.original.length && blankNode.isRecalculated; else noValue\"\n [value]=\"blankNode.recalculatedValue\"\n [originalValue]=\"blankNode.originalValue\"\n ></he-blank-node-value-delta>\n </ng-template>\n <ng-container *ngIf=\"blankNode.allParallel; else defaultDeltaValue\">\n <div *ngFor=\"let model of blankNode.configModels[0]\">\n <he-blank-node-value-delta *ngIf=\"blankNode.originalValueByMethodId[model.methodId] !== null && blankNode.recalculatedValueByMethodId[model.methodId] !== null; else noValue\"\n [value]=\"blankNode.recalculatedValueByMethodId[model.methodId]\"\n [originalValue]=\"blankNode.originalValueByMethodId[model.methodId]\"\n ></he-blank-node-value-delta>\n </div>\n </ng-container>\n </td>\n <ng-container *ngTemplateOutlet=\"blankNodeModels; context: {blankNode: blankNode}\"></ng-container>\n </tr>\n\n <ng-container *ngIf=\"blankNode.keys?.length\">\n <tr\n *ngFor=\"let subValue of blankNode.keys\"\n [class.is-hidden]=\"!blankNode.isOpen\"\n [class.has-sub-rows]=\"blankNode.subValues?.length\"\n >\n <td class=\"width-auto has-text-left\">\n <span class=\"is-inline-block is-align-top pl-3 pr-1 field-node\">Field:</span>\n\n <a class=\"is-inline-block\" *ngIf=\"blankNode.type\"\n [href]=\"baseUrl + '/schema/' + blankNode.type + '#' + subValue.key\" target=\"_blank\" [title]=\"subValue.key\"\n >\n <span class=\"is-nowrap has-text-ellipsis\">{{subValue.key}}</span>\n </a>\n <span class=\"is-inline-block is-align-top\" *ngIf=\"!blankNode.type\">{{subValue.key}}</span>\n </td>\n <td class=\"has-border-right\"></td>\n <td>\n <span *ngIf=\"subValue.originalValue !== null; else noValue\">{{subValue.originalValue | precision:3 | default:'-'}}</span>\n </td>\n <td>\n <span *ngIf=\"subValue.isRecalculated; else notRecalculated\">\n {{subValue.recalculatedValue | precision:3 | default:'-'}}\n </span>\n </td>\n <td>-</td>\n <td class=\"blank-node-index-key\">\n <ng-container *ngTemplateOutlet=\"blankNodeModel; context: {blankNode:blankNode, model:subValue.configModels[0], isKey:true, logs:getLogs(blankNode, subValue.key)}\"></ng-container>\n </td>\n <td *ngIf=\"methodModelsCount > 1\" [attr.colspan]=\"methodModelsCount - 1\"></td>\n </tr>\n </ng-container>\n\n <tr\n *ngFor=\"let subValue of blankNode.subValues\"\n [class.is-hidden]=\"!blankNode.isOpen\"\n >\n <td class=\"width-auto has-text-left\">\n <span class=\"is-inline-block is-align-top pl-3\">{{subValue.key | keyToLabel}}</span>\n\n <ng-container *ngIf=\"subValue.id\">\n <span class=\"is-inline-block\" class=\"is-inline-block is-align-top pr-1\">:</span>\n\n <ng-container [ngSwitch]=\"subValue.key\">\n <span class=\"is-inline-block\" *ngSwitchCase=\"'backgroundData'\">{{subValue.id | keyToLabel}}</span>\n <he-node-link *ngSwitchDefault class=\"is-block pl-4\" [node]=\"{'@type':'Term','@id':subValue.id}\" [attr.title]=\"subValue.id | keyToLabel\">\n <span class=\"is-nowrap has-text-ellipsis\">{{subValue.id | keyToLabel}}</span>\n </he-node-link>\n </ng-container>\n </ng-container>\n </td>\n <td class=\"has-border-right\"></td>\n <td>\n <span *ngIf=\"subValue.originalValue !== null; else noValue\">{{subValue.originalValue | precision:3 | default:'-'}}</span>\n </td>\n <td>\n <span *ngIf=\"subValue.isRecalculated; else notRecalculated\">\n {{subValue.recalculatedValue | precision:3 | default:'-'}}\n </span>\n </td>\n <td>-</td>\n <ng-container *ngTemplateOutlet=\"blankNodeModels; context: {blankNode: blankNode, subValue: subValue}\"></ng-container>\n </tr>\n </ng-container>\n </tbody>\n </table>\n </he-data-table>\n\n <div class=\"is-size-7 is-italic\">\n <div class=\"columns is-variable is-1 my-0\">\n <div class=\"column is-narrow\">\n <p>\n <a class=\"is-inline-block pr-2\"\n (click)=\"showLegend = !showLegend\"\n >\n <fa-icon icon=\"angle-down\" [class.is-hidden]=\"!showLegend\"></fa-icon>\n <fa-icon icon=\"angle-right\" [class.is-hidden]=\"showLegend\"></fa-icon>\n </a>\n <span class=\"is-inline-block\">Legend:</span>\n </p>\n <ul class=\"content pl-2\" [class.is-hidden]=\"!showLegend\">\n <li\n class=\"has-text-{{logColor[status.value]}}\"\n *ngFor=\"let status of LogStatus | keys\"\n >\n <fa-icon [icon]=\"logIcon[status.value]\"></fa-icon>\n <span class=\"pl-1\">{{status.value}}</span>\n </li>\n </ul>\n </div>\n <div class=\"column has-text-right\" *ngIf=\"filteredType\">\n <label class=\"is-inline-block checkbox\">\n <input type=\"checkbox\" class=\"selector\"\n [(ngModel)]=\"onlyRequired\"\n (change)=\"filterResults()\"\n [disabled]=\"!!term\"\n >\n <span class=\"ml-2\">Show only relevant {{filteredType | pluralize}}</span>\n </label>\n </div>\n </div>\n </div>\n</div>\n\n<ng-template #blankNodeModels let-blankNode=\"blankNode\" let-subValue=\"subValue\">\n <td class=\"blank-node-index-{{i}}\" *ngFor=\"let c of methodModelsCount | times; let i = index\">\n <ng-container *ngIf=\"getModelsAt(blankNode, i, subValue); let models; else noValue\">\n <ng-template #modelSerie>\n <ng-container *ngTemplateOutlet=\"blankNodeModel; context: {blankNode:blankNode, model:models, subValue:subValue, logs:getLogs(blankNode, models.methodId, subValue)}\"></ng-container>\n </ng-template>\n <div *ngIf=\"models | isArray; else modelSerie\">\n <p *ngFor=\"let model of models\">\n <ng-container *ngTemplateOutlet=\"blankNodeModel; context: {blankNode:blankNode, model:model, subValue:subValue, logs:getLogs(blankNode, model.methodId, subValue)}\"></ng-container>\n </p>\n </div>\n </ng-container>\n </td>\n</ng-template>\n\n<ng-template #blankNodeModel let-blankNode=\"blankNode\" let-model=\"model\" let-subValue=\"subValue\" let-logs=\"logs\" let-isKey=\"isKey\">\n <span\n [class.trigger-popover]=\"hasLogDetails(blankNode, model.methodId, subValue)\"\n [ngbPopover]=\"logDetails\" [autoClose]=\"'outside'\"\n triggers=\"manual\" #p=\"ngbPopover\" placement=\"left\" container=\"body\"\n (click)=\"p.isOpen() ? p.close() : openPopover(p, { blankNode, methodId:model.methodId, subValue, logs })\"\n >\n <span class=\"is-capitalized\">{{methodName(blankNode, model.methodId, subValue)}}</span>\n <span class=\"pl-1\" *ngIf=\"hasLog(logs) && logs?.methodTier\">[{{logs.methodTier}}]</span>\n <span class=\"pl-1 has-text-{{logColor[logStatus(blankNode, model.methodId, subValue)]}}\">\n <fa-icon [icon]=\"logIcon[logStatus(blankNode, model.methodId, subValue)]\"></fa-icon>\n </span>\n <span class=\"pl-2\" *ngIf=\"model.model\">\n (<ng-container *ngTemplateOutlet=\"docsLink; context: {$implicit: model.model}\"></ng-container>)\n </span>\n </span>\n</ng-template>\n\n<ng-template #noValue>-</ng-template>\n\n<ng-template #notRecalculated>not recalculated</ng-template>\n\n<ng-template #logDetails let-logs=\"logs\">\n <ng-container *ngIf=\"logs?.requirements\">\n <p class=\"is-requirement\" *ngFor=\"let key of requirementKeys(logs.requirements)\">\n {{key}}: {{logs.requirements[key]}}\n </p>\n </ng-container>\n <ng-container *ngIf=\"logs?.logs\">\n <p class=\"is-log\" *ngFor=\"let key of logs.logs | keys\">\n {{key.key}}: {{key.value}}\n </p>\n </ng-container>\n <ng-container *ngIf=\"logs?.missingLookups?.length\">\n <p class=\"mt-2\">Missing lookups:</p>\n\n <div class=\"table-container data-table-container\">\n <table class=\"table is-fullwidth mb-0\">\n <thead class=\"has-background-black\">\n <tr>\n <th>\n <span class=\"has-text-white\">Filename</span>\n </th>\n <th>\n <span class=\"has-text-white\">Column Title</span>\n </th>\n <th>\n <span class=\"has-text-white\">Row (term.id)</span>\n </th>\n </tr>\n </thead>\n <tbody class=\"has-background-black has-text-white\">\n <tr *ngFor=\"let data of logs.missingLookups\">\n <td>{{data.filename}}</td>\n <td>{{data.column}}</td>\n <td>{{data.termId}}</td>\n </tr>\n </tbody>\n </table>\n </div>\n </ng-container>\n</ng-template>\n\n<ng-template #docsLink let-model>\n <a [href]=\"model.apiDocsPath || model.docPath || model.path\" target=\"_blank\"\n (click)=\"$event.stopPropagation()\"\n >\n <span>Docs</span>\n <fa-icon class=\"ml-1\" icon=\"external-link-alt\" size=\"sm\"></fa-icon>\n </a>\n</ng-template>\n", styles: [":host{display:block}::ng-deep tr.has-sub-rows td{border-bottom-style:dotted}::ng-deep td he-node-link{width:190px}::ng-deep td .open-node+he-node-link{width:170px}\n"], components: [{ type: i1__namespace.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }, { type: DataTableComponent, selector: "he-data-table", inputs: ["minHeight", "maxHeight", "nbRows", "small", "height", "width"] }, { type: NodeLinkComponent, selector: "he-node-link", inputs: ["node", "showExternalLink"] }, { type: BlankNodeValueDeltaComponent, selector: "he-blank-node-value-delta", inputs: ["value", "originalValue", "displayType"] }], directives: [{ type: i2__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1__namespace$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i11__namespace.NgbTypeahead, selector: "input[ngbTypeahead]", inputs: ["autocomplete", "placement", "container", "editable", "focusFirst", "showHint", "inputFormatter", "ngbTypeahead", "resultFormatter", "resultTemplate"], outputs: ["selectItem"], exportAs: ["ngbTypeahead"] }, { type: i1__namespace$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1__namespace$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i2__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i2__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i2__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i2__namespace.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i1__namespace$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { type: i11__namespace.NgbPopover, selector: "[ngbPopover]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disablePopover", "popoverClass", "openDelay", "closeDelay", "ngbPopover", "popoverTitle"], outputs: ["shown", "hidden"], exportAs: ["ngbPopover"] }], pipes: { "times": TimesPipe, "default": DefaultPipe, "precision": PrecisionPipe, "keyToLabel": KeyToLabelPipe, "keys": KeysPipe, "pluralize": PluralizePipe, "isArray": IsArrayPipe } });
|
|
6047
|
+
NodeLogsModelsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: NodeLogsModelsComponent, deps: [{ token: HeNodeService }, { token: HeSearchService }, { token: HeEngineService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
6048
|
+
NodeLogsModelsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: NodeLogsModelsComponent, selector: "he-node-logs-models", inputs: { node: "node", nodeKey: "nodeKey", includeAllModels: "includeAllModels", originalValues: "originalValues", recalculatedValues: "recalculatedValues", terms: "terms", filterTermTypes: "filterTermTypes", logsKey: "logsKey" }, ngImport: i0__namespace, template: "<div class=\"px-3 pb-3\">\n <div class=\"has-text-right mb-2\" *ngIf=\"!isExternal\">\n <a class=\"is-size-7\" *ngIf=\"logsUrl\" [href]=\"logsUrl\" target=\"_blank\">\n <fa-icon icon=\"external-link-alt\"></fa-icon>\n <span class=\"pl-2\">Open Full Logs</span>\n </a>\n </div>\n\n <he-data-table class=\"mb-1 is-small\" [small]=\"true\" [nbRows]=\"rowsCount\" maxHeight=\"320\">\n <table class=\"table is-narrow is-striped\">\n <thead>\n <tr>\n <th class=\"width-auto\">\n <div class=\"field\">\n <div class=\"control is-expanded has-icons-right\">\n <input class=\"input search-input is-small\"\n [(ngModel)]=\"term\" name=\"term\"\n placeholder=\"Filter by name\"\n [ngbTypeahead]=\"suggestTerm\"\n [focusFirst]=\"false\"\n (change)=\"filterResults()\"\n >\n <a class=\"icon is-small is-right\"\n [class.is-hidden]=\"!term\"\n (click)=\"term = ''; filterResults();\"\n >\n <fa-icon icon=\"times\"></fa-icon>\n </a>\n </div>\n </div>\n </th>\n <th class=\"has-border-right\">Units</th>\n <th>Original</th>\n <th>Recalculated</th>\n <th>Difference</th>\n <th *ngFor=\"let c of methodModelsCount | times; let i = index\">({{i + 1}})</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngIf=\"loading\">\n <td class=\"has-text-centered\" colspan=\"6\">\n <div class=\"has-text-center py-3\">\n <fa-icon icon=\"spinner\" [pulse]=\"true\" size=\"lg\"></fa-icon>\n </div>\n </td>\n </tr>\n <tr *ngIf=\"!loading && blankNodes.length === 0\">\n <td class=\"has-text-centered\" colspan=\"6\">\n <span>No data</span>\n </td>\n </tr>\n <ng-container *ngFor=\"let blankNode of blankNodes; trackBy: trackByBlankNode\">\n <tr [class.has-sub-rows]=\"blankNode.canOpen\">\n <td class=\"width-auto\" [attr.title]=\"blankNode.term.name\">\n <a class=\"is-inline-block is-align-top pr-2 open-node\"\n (click)=\"blankNode.isOpen = !blankNode.isOpen\"\n *ngIf=\"blankNode.canOpen\"\n >\n <fa-icon icon=\"angle-down\" [class.is-hidden]=\"!blankNode.isOpen\"></fa-icon>\n <fa-icon icon=\"angle-right\" [class.is-hidden]=\"blankNode.isOpen\"></fa-icon>\n </a>\n <he-node-link class=\"is-inline-block\" [node]=\"blankNode.term\">\n <span class=\"is-nowrap has-text-ellipsis\">{{blankNode.term.name}}</span>\n </he-node-link>\n </td>\n <td class=\"has-border-right\">\n <span>{{blankNode.term?.units}}</span>\n </td>\n <td>\n <ng-template #defaultOriginalValue>\n <span>{{blankNode.originalValue | precision:3 | default:'-'}}</span>\n </ng-template>\n <ng-container *ngIf=\"blankNode.allParallel; else defaultOriginalValue\">\n <div *ngFor=\"let model of blankNode.configModels[0]\">{{blankNode.originalValueByMethodId[model.methodId] | precision:3 | default:'-'}}</div>\n </ng-container>\n </td>\n <td>\n <ng-container *ngIf=\"!blankNode.isOriginal || blankNode.isRecalculated; else notRecalculated\">\n <ng-template #defaultRecalculatedValue>\n <span>{{blankNode.recalculatedValue | precision:3 | default:'-'}}</span>\n </ng-template>\n <ng-container *ngIf=\"blankNode.allParallel; else defaultRecalculatedValue\">\n <div *ngFor=\"let model of blankNode.configModels[0]\">{{blankNode.recalculatedValueByMethodId[model.methodId] | precision:3 | default:'-'}}</div>\n </ng-container>\n </ng-container>\n </td>\n <td class=\"is-nowrap\">\n <ng-template #defaultDeltaValue>\n <he-blank-node-value-delta *ngIf=\"blankNode.original.length && blankNode.isRecalculated; else noValue\"\n [value]=\"blankNode.recalculatedValue\"\n [originalValue]=\"blankNode.originalValue\"\n ></he-blank-node-value-delta>\n </ng-template>\n <ng-container *ngIf=\"blankNode.allParallel; else defaultDeltaValue\">\n <div *ngFor=\"let model of blankNode.configModels[0]\">\n <he-blank-node-value-delta *ngIf=\"blankNode.originalValueByMethodId[model.methodId] !== null && blankNode.recalculatedValueByMethodId[model.methodId] !== null; else noValue\"\n [value]=\"blankNode.recalculatedValueByMethodId[model.methodId]\"\n [originalValue]=\"blankNode.originalValueByMethodId[model.methodId]\"\n ></he-blank-node-value-delta>\n </div>\n </ng-container>\n </td>\n <ng-container *ngTemplateOutlet=\"blankNodeModels; context: {data: blankNode}\"></ng-container>\n </tr>\n\n <tr\n *ngFor=\"let subValue of blankNode.keys\"\n [class.is-hidden]=\"!blankNode.isOpen\"\n [class.has-sub-rows]=\"blankNode.subValues?.length\"\n >\n <td class=\"width-auto has-text-left\">\n <span class=\"is-inline-block is-align-top pl-3 pr-1 field-node\">Field:</span>\n\n <a class=\"is-inline-block\" *ngIf=\"blankNode.type\"\n [href]=\"baseUrl + '/schema/' + blankNode.type + '#' + subValue.key\" target=\"_blank\" [title]=\"subValue.key\"\n >\n <span class=\"is-nowrap has-text-ellipsis\">{{subValue.key}}</span>\n </a>\n <span class=\"is-inline-block is-align-top\" *ngIf=\"!blankNode.type\">{{subValue.key}}</span>\n </td>\n <td class=\"has-border-right\"></td>\n <td>\n <span *ngIf=\"subValue.originalValue !== null; else noValue\">{{subValue.originalValue | precision:3 | default:'-'}}</span>\n </td>\n <td>\n <span *ngIf=\"subValue.isRecalculated || subValue.key === 'impactAssessment'; else notRecalculated\">\n {{subValue.recalculatedValue | precision:3 | default:'-'}}\n </span>\n </td>\n <td>-</td>\n <ng-container *ngTemplateOutlet=\"blankNodeModels; context: {data: subValue}\"></ng-container>\n </tr>\n\n <tr\n *ngFor=\"let subValue of blankNode.subValues\"\n [class.is-hidden]=\"!blankNode.isOpen\"\n >\n <td class=\"width-auto has-text-left\">\n <span class=\"is-inline-block is-align-top pl-3\">{{subValue.key | keyToLabel}}</span>\n\n <ng-container *ngIf=\"subValue.id\">\n <span class=\"is-inline-block\" class=\"is-inline-block is-align-top pr-1\">:</span>\n\n <ng-container [ngSwitch]=\"subValue.key\">\n <span class=\"is-inline-block\" *ngSwitchCase=\"'backgroundData'\">{{subValue.id | keyToLabel}}</span>\n <he-node-link *ngSwitchDefault class=\"is-block pl-4\" [node]=\"{'@type':'Term','@id':subValue.id}\" [attr.title]=\"subValue.id | keyToLabel\">\n <span class=\"is-nowrap has-text-ellipsis\">{{subValue.id | keyToLabel}}</span>\n </he-node-link>\n </ng-container>\n </ng-container>\n </td>\n <td class=\"has-border-right\"></td>\n <td>\n <span *ngIf=\"subValue.originalValue !== null; else noValue\">{{subValue.originalValue | precision:3 | default:'-'}}</span>\n </td>\n <td>\n <span *ngIf=\"subValue.isRecalculated; else notRecalculated\">\n {{subValue.recalculatedValue | precision:3 | default:'-'}}\n </span>\n </td>\n <td>-</td>\n <ng-container *ngTemplateOutlet=\"blankNodeModels; context: {data: subValue}\"></ng-container>\n </tr>\n </ng-container>\n </tbody>\n </table>\n </he-data-table>\n\n <div class=\"is-size-7 is-italic\">\n <div class=\"columns is-variable is-1 my-0\">\n <div class=\"column is-narrow\">\n <p>\n <a class=\"is-inline-block pr-2\"\n (click)=\"showLegend = !showLegend\"\n >\n <fa-icon icon=\"angle-down\" [class.is-hidden]=\"!showLegend\"></fa-icon>\n <fa-icon icon=\"angle-right\" [class.is-hidden]=\"showLegend\"></fa-icon>\n </a>\n <span class=\"is-inline-block\">Legend:</span>\n </p>\n <ul class=\"content pl-2\" [class.is-hidden]=\"!showLegend\">\n <li\n class=\"has-text-{{logColor[status.value]}}\"\n *ngFor=\"let status of LogStatus | keys\"\n >\n <fa-icon [icon]=\"logIcon[status.value]\"></fa-icon>\n <span class=\"pl-1\">{{status.value}}</span>\n </li>\n </ul>\n </div>\n <div class=\"column has-text-right\" *ngIf=\"filteredType\">\n <label class=\"is-inline-block checkbox\">\n <input type=\"checkbox\" class=\"selector\"\n [(ngModel)]=\"onlyRequired\"\n (change)=\"filterResults()\"\n [disabled]=\"!!term\"\n >\n <span class=\"ml-2\">Show only relevant {{filteredType | pluralize}}</span>\n </label>\n </div>\n </div>\n </div>\n</div>\n\n<ng-template #blankNodeModels let-data=\"data\">\n <td class=\"blank-node-index-{{i}}\" *ngFor=\"let c of methodModelsCount | times; let i = index\">\n <ng-container *ngIf=\"getModelsAt(data, i); let models; else noValue\">\n <ng-template #modelSerie>\n <ng-container *ngTemplateOutlet=\"blankNodeModel; context: {model:models}\"></ng-container>\n </ng-template>\n <div *ngIf=\"models | isArray; else modelSerie\">\n <p *ngFor=\"let model of models\">\n <ng-container *ngTemplateOutlet=\"blankNodeModel; context: {model}\"></ng-container>\n </p>\n </div>\n </ng-container>\n </td>\n</ng-template>\n\n<ng-template #blankNodeModel let-model=\"model\">\n <span\n [class.trigger-popover]=\"model.showLogs\"\n [ngbPopover]=\"logDetails\" [autoClose]=\"'outside'\"\n triggers=\"manual\" #p=\"ngbPopover\" placement=\"left\" container=\"body\"\n (click)=\"p.isOpen() ? p.close() : (model.showLogs ? p.open({ logs: model.logs }) : null)\"\n >\n <span class=\"is-capitalized\">{{methodName(model)}}</span>\n <span class=\"pl-1\" *ngIf=\"model.logs?.methodTier\">[{{model.logs.methodTier}}]</span>\n <span class=\"pl-1 has-text-{{logColor[model.status]}}\">\n <fa-icon [icon]=\"logIcon[model.status]\"></fa-icon>\n </span>\n <span class=\"pl-2\" *ngIf=\"model.model\">\n (<ng-container *ngTemplateOutlet=\"docsLink; context: {$implicit: model.model}\"></ng-container>)\n </span>\n </span>\n</ng-template>\n\n<ng-template #noValue>-</ng-template>\n\n<ng-template #notRecalculated>not recalculated</ng-template>\n\n<ng-template #logDetails let-logs=\"logs\">\n <ng-container *ngIf=\"logs?.requirements\">\n <p class=\"is-requirement\" *ngFor=\"let key of requirementKeys(logs.requirements)\">\n {{key}}: {{logs.requirements[key]}}\n </p>\n </ng-container>\n <ng-container *ngIf=\"logs?.logs\">\n <p class=\"is-log\" *ngFor=\"let key of logs.logs | keys\">\n {{key.key}}: {{key.value}}\n </p>\n </ng-container>\n <ng-container *ngIf=\"logs?.missingLookups?.length\">\n <p class=\"mt-2\">Missing lookups:</p>\n\n <div class=\"table-container data-table-container\">\n <table class=\"table is-fullwidth mb-0\">\n <thead class=\"has-background-black\">\n <tr>\n <th>\n <span class=\"has-text-white\">Filename</span>\n </th>\n <th>\n <span class=\"has-text-white\">Column Title</span>\n </th>\n <th>\n <span class=\"has-text-white\">Row (term.id)</span>\n </th>\n </tr>\n </thead>\n <tbody class=\"has-background-black has-text-white\">\n <tr *ngFor=\"let data of logs.missingLookups\">\n <td>{{data.filename}}</td>\n <td>{{data.column}}</td>\n <td>{{data.termId}}</td>\n </tr>\n </tbody>\n </table>\n </div>\n </ng-container>\n</ng-template>\n\n<ng-template #docsLink let-model>\n <a [href]=\"model.apiDocsPath || model.docPath || model.path\" target=\"_blank\"\n (click)=\"$event.stopPropagation()\"\n >\n <span>Docs</span>\n <fa-icon class=\"ml-1\" icon=\"external-link-alt\" size=\"sm\"></fa-icon>\n </a>\n</ng-template>\n", styles: [":host{display:block}::ng-deep tr.has-sub-rows td{border-bottom-style:dotted}::ng-deep td he-node-link{width:190px}::ng-deep td .open-node+he-node-link{width:170px}\n"], components: [{ type: i1__namespace.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }, { type: DataTableComponent, selector: "he-data-table", inputs: ["minHeight", "maxHeight", "nbRows", "small", "height", "width"] }, { type: NodeLinkComponent, selector: "he-node-link", inputs: ["node", "showExternalLink"] }, { type: BlankNodeValueDeltaComponent, selector: "he-blank-node-value-delta", inputs: ["value", "originalValue", "displayType"] }], directives: [{ type: i2__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1__namespace$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i11__namespace.NgbTypeahead, selector: "input[ngbTypeahead]", inputs: ["autocomplete", "placement", "container", "editable", "focusFirst", "showHint", "inputFormatter", "ngbTypeahead", "resultFormatter", "resultTemplate"], outputs: ["selectItem"], exportAs: ["ngbTypeahead"] }, { type: i1__namespace$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1__namespace$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i2__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i2__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i2__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i2__namespace.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i1__namespace$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { type: i11__namespace.NgbPopover, selector: "[ngbPopover]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disablePopover", "popoverClass", "openDelay", "closeDelay", "ngbPopover", "popoverTitle"], outputs: ["shown", "hidden"], exportAs: ["ngbPopover"] }], pipes: { "times": TimesPipe, "default": DefaultPipe, "precision": PrecisionPipe, "keyToLabel": KeyToLabelPipe, "keys": KeysPipe, "pluralize": PluralizePipe, "isArray": IsArrayPipe } });
|
|
5946
6049
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: NodeLogsModelsComponent, decorators: [{
|
|
5947
6050
|
type: i0.Component,
|
|
5948
6051
|
args: [{
|
|
@@ -5950,24 +6053,22 @@
|
|
|
5950
6053
|
templateUrl: './node-logs-models.component.html',
|
|
5951
6054
|
styleUrls: ['./node-logs-models.component.scss']
|
|
5952
6055
|
}]
|
|
5953
|
-
}], ctorParameters: function () { return [{ type: HeSearchService }, { type: HeEngineService }]; }, propDecorators: {
|
|
6056
|
+
}], ctorParameters: function () { return [{ type: HeNodeService }, { type: HeSearchService }, { type: HeEngineService }]; }, propDecorators: { node: [{
|
|
5954
6057
|
type: i0.Input
|
|
5955
6058
|
}], nodeKey: [{
|
|
5956
6059
|
type: i0.Input
|
|
5957
6060
|
}], includeAllModels: [{
|
|
5958
6061
|
type: i0.Input
|
|
5959
|
-
}], logsUrl: [{
|
|
5960
|
-
type: i0.Input
|
|
5961
6062
|
}], originalValues: [{
|
|
5962
6063
|
type: i0.Input
|
|
5963
6064
|
}], recalculatedValues: [{
|
|
5964
6065
|
type: i0.Input
|
|
5965
6066
|
}], terms: [{
|
|
5966
6067
|
type: i0.Input
|
|
5967
|
-
}], logs: [{
|
|
5968
|
-
type: i0.Input
|
|
5969
6068
|
}], filterTermTypes: [{
|
|
5970
6069
|
type: i0.Input
|
|
6070
|
+
}], logsKey: [{
|
|
6071
|
+
type: i0.Input
|
|
5971
6072
|
}] } });
|
|
5972
6073
|
|
|
5973
6074
|
var NodeMissingLookupFactorsComponent = /** @class */ (function () {
|
|
@@ -6013,10 +6114,10 @@
|
|
|
6013
6114
|
'methodModelDescription', 'description',
|
|
6014
6115
|
'primary', 'emissionDuration', 'observations', 'statsDefinition',
|
|
6015
6116
|
'term', 'source', 'variety', 'reliability', 'price', 'currency', 'cost', 'revenue', 'economicValueShare',
|
|
6016
|
-
'impactAssessment', 'properties'
|
|
6117
|
+
'operation', 'impactAssessment', 'properties'
|
|
6017
6118
|
];
|
|
6018
6119
|
var tableKeys = [
|
|
6019
|
-
'inputs', 'transformation', 'value', 'dates', 'methodModel', 'methodTier', 'statsDefinition'
|
|
6120
|
+
'inputs', 'transformation', 'operation', 'value', 'dates', 'methodModel', 'methodTier', 'statsDefinition'
|
|
6020
6121
|
];
|
|
6021
6122
|
var NodeValueDetailsComponent = /** @class */ (function () {
|
|
6022
6123
|
function NodeValueDetailsComponent() {
|
|
@@ -6243,30 +6344,11 @@
|
|
|
6243
6344
|
Tab["products"] = "Products";
|
|
6244
6345
|
})(Tab || (Tab = {}));
|
|
6245
6346
|
var CyclesActivityLogsComponent = /** @class */ (function () {
|
|
6246
|
-
function CyclesActivityLogsComponent(
|
|
6247
|
-
this.nodeService = nodeService;
|
|
6248
|
-
this.loading = true;
|
|
6347
|
+
function CyclesActivityLogsComponent() {
|
|
6249
6348
|
this.NodeType = schema.NodeType;
|
|
6250
6349
|
this.Tab = Tab;
|
|
6251
6350
|
this.selectedTab = Tab.products;
|
|
6252
6351
|
}
|
|
6253
|
-
CyclesActivityLogsComponent.prototype.ngOnInit = function () {
|
|
6254
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
6255
|
-
var logs;
|
|
6256
|
-
return __generator(this, function (_a) {
|
|
6257
|
-
switch (_a.label) {
|
|
6258
|
-
case 0:
|
|
6259
|
-
this.logsUrl = this.nodeService.nodeLogsUrl(this.node);
|
|
6260
|
-
return [4 /*yield*/, this.nodeService.getModelsLog(this.node)];
|
|
6261
|
-
case 1:
|
|
6262
|
-
logs = _a.sent();
|
|
6263
|
-
this.logs = parseLogs(this.cycle, logs);
|
|
6264
|
-
this.loading = false;
|
|
6265
|
-
return [2 /*return*/];
|
|
6266
|
-
}
|
|
6267
|
-
});
|
|
6268
|
-
});
|
|
6269
|
-
};
|
|
6270
6352
|
Object.defineProperty(CyclesActivityLogsComponent.prototype, "node", {
|
|
6271
6353
|
get: function () {
|
|
6272
6354
|
return Object.assign(Object.assign({}, this.cycle), { '@type': schema.NodeType.Cycle, type: schema.NodeType.Cycle, dataState: api.DataState.recalculated });
|
|
@@ -6274,10 +6356,17 @@
|
|
|
6274
6356
|
enumerable: false,
|
|
6275
6357
|
configurable: true
|
|
6276
6358
|
});
|
|
6359
|
+
Object.defineProperty(CyclesActivityLogsComponent.prototype, "logsKey", {
|
|
6360
|
+
get: function () {
|
|
6361
|
+
return logsKey(this.cycle);
|
|
6362
|
+
},
|
|
6363
|
+
enumerable: false,
|
|
6364
|
+
configurable: true
|
|
6365
|
+
});
|
|
6277
6366
|
return CyclesActivityLogsComponent;
|
|
6278
6367
|
}());
|
|
6279
|
-
CyclesActivityLogsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesActivityLogsComponent, deps: [
|
|
6280
|
-
CyclesActivityLogsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesActivityLogsComponent, selector: "he-cycles-activity-logs", inputs: { cycle: "cycle", original: "original", recalculated: "recalculated" }, ngImport: i0__namespace, template: "<
|
|
6368
|
+
CyclesActivityLogsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesActivityLogsComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
6369
|
+
CyclesActivityLogsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesActivityLogsComponent, selector: "he-cycles-activity-logs", inputs: { cycle: "cycle", original: "original", recalculated: "recalculated" }, ngImport: i0__namespace, template: "<div class=\"tabs mb-1\">\n <ul>\n <li [class.is-active]=\"selectedTab === Tab.products\">\n <a (click)=\"selectedTab = Tab.products\">Products</a>\n </li>\n <li [class.is-active]=\"selectedTab === Tab.inputs\">\n <a (click)=\"selectedTab = Tab.inputs\">Inputs</a>\n </li>\n </ul>\n</div>\n\n<he-node-logs-models *ngIf=\"selectedTab === Tab.products\"\n [node]=\"node\"\n [logsKey]=\"logsKey\"\n [originalValues]=\"original?.products\"\n [recalculatedValues]=\"recalculated?.products\"\n></he-node-logs-models>\n\n<he-node-logs-models *ngIf=\"selectedTab === Tab.inputs\"\n [node]=\"node\"\n [logsKey]=\"logsKey\"\n [originalValues]=\"original?.inputs\"\n [recalculatedValues]=\"recalculated?.inputs\"\n></he-node-logs-models>\n", styles: [":host{display:block}\n"], components: [{ type: NodeLogsModelsComponent, selector: "he-node-logs-models", inputs: ["node", "nodeKey", "includeAllModels", "originalValues", "recalculatedValues", "terms", "filterTermTypes", "logsKey"] }], directives: [{ type: i2__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
6281
6370
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesActivityLogsComponent, decorators: [{
|
|
6282
6371
|
type: i0.Component,
|
|
6283
6372
|
args: [{
|
|
@@ -6285,7 +6374,7 @@
|
|
|
6285
6374
|
templateUrl: './cycles-activity-logs.component.html',
|
|
6286
6375
|
styleUrls: ['./cycles-activity-logs.component.scss']
|
|
6287
6376
|
}]
|
|
6288
|
-
}],
|
|
6377
|
+
}], propDecorators: { cycle: [{
|
|
6289
6378
|
type: i0.Input
|
|
6290
6379
|
}], original: [{
|
|
6291
6380
|
type: i0.Input
|
|
@@ -6303,7 +6392,6 @@
|
|
|
6303
6392
|
function CyclesActivityComponent() {
|
|
6304
6393
|
this.originalValues = [];
|
|
6305
6394
|
this.cycles = [];
|
|
6306
|
-
this.selected = [];
|
|
6307
6395
|
this.enableCompare = true;
|
|
6308
6396
|
this.baseUrl = baseUrl();
|
|
6309
6397
|
this.propertyValue = term.propertyValue;
|
|
@@ -6342,9 +6430,6 @@
|
|
|
6342
6430
|
CyclesActivityComponent.prototype.togglePopover = function (popover, context) {
|
|
6343
6431
|
return popover.isOpen() ? popover.close() : popover.open(context);
|
|
6344
6432
|
};
|
|
6345
|
-
CyclesActivityComponent.prototype.isSelected = function (cycle) {
|
|
6346
|
-
return this.selected.length === 0 || this.selected.includes(cycle['@id']);
|
|
6347
|
-
};
|
|
6348
6433
|
// Recalculation logs
|
|
6349
6434
|
CyclesActivityComponent.prototype.selectIndex = function (_a) {
|
|
6350
6435
|
var _this = this;
|
|
@@ -6356,7 +6441,7 @@
|
|
|
6356
6441
|
return CyclesActivityComponent;
|
|
6357
6442
|
}());
|
|
6358
6443
|
CyclesActivityComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesActivityComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
6359
|
-
CyclesActivityComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesActivityComponent, selector: "he-cycles-activity", inputs: { originalValues: "originalValues", cycles: "cycles", selected: "selected", dataState: "dataState", enableCompare: "enableCompare" }, usesOnChanges: true, ngImport: i0__namespace, template: "<div class=\"columns is-variable is-align-items-center is-2 m-0\">\n <div class=\"column is-hidden-mobile\"></div>\n <ng-container *ngIf=\"selectedView === View.table && (inputs.length || products.length)\">\n <div class=\"column is-narrow\">\n <button class=\"button is-dark is-outlined is-small\" (click)=\"showDownload = true\">\n <fa-icon icon=\"download\"></fa-icon>\n <span class=\"pl-2\">Download (CSV)</span>\n </button>\n </div>\n <div class=\"column is-narrow col-sep\"></div>\n </ng-container>\n <div class=\"column is-narrow\" *ngIf=\"!isOriginal\">\n <div class=\"field has-addons\">\n <div class=\"control\">\n <button class=\"button is-small\" [class.is-active]=\"selectedView === View.table\" (click)=\"selectedView = View.table\">\n <span class=\"icon is-small\">\n <fa-icon icon=\"list\" aria-hidden=\"true\"></fa-icon>\n </span>\n <span>Table view</span>\n </button>\n </div>\n <div class=\"control\">\n <button class=\"button is-small\" [class.is-active]=\"selectedView === View.logs\" (click)=\"selectedView = View.logs\">\n <span class=\"icon is-small\">\n <fa-icon icon=\"calculator\" aria-hidden=\"true\"></fa-icon>\n </span>\n <span>Recalculations logs</span>\n </button>\n </div>\n </div>\n </div>\n</div>\n\n<div class=\"px-3 pb-3\" [class.is-hidden]=\"selectedView !== View.table\">\n <ng-container *ngIf=\"inputs.length || products.length; else emptyTable\">\n <he-data-table class=\"mb-1 is-small\" [small]=\"true\" [nbRows]=\"cycles.length\" maxHeight=\"320\">\n <table class=\"table is-narrow is-striped\">\n <thead>\n <tr>\n <th class=\"width-auto\"></th>\n <th class=\"has-border-right\"></th>\n <th *ngIf=\"products.length\" [attr.colspan]=\"products.length\"\n [class.has-border-right]=\"inputs.length\"\n >Products</th>\n <th *ngIf=\"inputs.length\" [attr.colspan]=\"inputs.length\">Inputs</th>\n </tr>\n <tr>\n <th class=\"width-auto\"></th>\n <th class=\"has-border-right\"></th>\n <th *ngFor=\"let product of products; let pl = last\"\n [attr.title]=\"product.value.term.name\"\n [class.has-border-right]=\"inputs.length && pl\"\n >\n <he-node-link [node]=\"product.value.term\">\n <span>{{product.value.term.name | ellipsis:30}}</span>\n </he-node-link>\n </th>\n <th *ngFor=\"let input of inputs\"\n [attr.title]=\"input.value.term.name\"\n >\n <he-node-link [node]=\"input.value.term\">\n <span>{{input.value.term.name | ellipsis:30}}</span>\n </he-node-link>\n </th>\n </tr>\n <tr>\n <th class=\"width-auto\"></th>\n <th class=\"has-border-right\">\n <a [href]=\"baseUrl + '/schema/Cycle#functionalUnit'\" target=\"_blank\">Functional unit</a>\n </th>\n <th *ngFor=\"let product of products; let pl = last\"\n [attr.title]=\"product.value.term.units\"\n [class.has-border-right]=\"inputs.length && pl\"\n >{{product.value.term.units}}</th>\n <th *ngFor=\"let input of inputs\"\n [attr.title]=\"input.value.term.units\"\n >{{input.value.term.units}}</th>\n </tr>\n </thead>\n <tbody>\n <ng-container *ngFor=\"let cycle of cycles; trackBy: trackById; let i = index\">\n <tr *ngIf=\"isSelected(cycle)\">\n <td class=\"width-auto\" [attr.title]=\"defaultLabel(cycle)\">\n <he-node-link [node]=\"cycle.term || cycle\">\n <span class=\"is-nowrap has-text-ellipsis\">{{i + 1}}. {{defaultLabel(cycle)}}</span>\n </he-node-link>\n </td>\n <td class=\"has-border-right\">\n <he-cycles-functional-unit-measure [cycle]=\"cycle\"></he-cycles-functional-unit-measure>\n </td>\n <td class=\"is-nowrap\"\n *ngFor=\"let product of products; let pl = last\"\n [class.has-border-right]=\"inputs.length && pl\"\n >\n <span *ngIf=\"product.value.values[cycle['@id']]; else emptyValue\"\n class=\"trigger-popover\"\n [ngbPopover]=\"details\" [autoClose]=\"'outside'\"\n triggers=\"manual\" #p=\"ngbPopover\" placement=\"left\" container=\"body\"\n (click)=\"togglePopover(p, { data: product.value.values[cycle['@id']], cycle: cycle, key: 'products' })\"\n >\n <span pointer>{{propertyValue(product.value.values[cycle['@id']].value, product.value.term['@id']) | precision:3 | default:'-'}}</span>\n <he-blank-node-state class=\"ml-1\"\n [node]=\"product.value.values[cycle['@id']].node\"\n key=\"value\"\n ></he-blank-node-state>\n </span>\n </td>\n <td class=\"is-nowrap\" *ngFor=\"let input of inputs\">\n <span *ngIf=\"input.value.values[cycle['@id']]; else emptyValue\"\n class=\"trigger-popover\"\n [ngbPopover]=\"details\" [autoClose]=\"'outside'\"\n triggers=\"manual\" #p=\"ngbPopover\" placement=\"left\" container=\"body\"\n (click)=\"togglePopover(p, { data: input.value.values[cycle['@id']], cycle: cycle, key: 'inputs' })\"\n >\n <span pointer>{{propertyValue(input.value.values[cycle['@id']].value, input.value.term['@id']) | precision:3 | default:'-'}}</span>\n <he-blank-node-state class=\"ml-1\"\n [node]=\"input.value.values[cycle['@id']].node\"\n key=\"value\"\n ></he-blank-node-state>\n </span>\n </td>\n </tr>\n </ng-container>\n </tbody>\n </table>\n </he-data-table>\n\n <he-blank-node-state-notice [dataState]=\"dataState\"></he-blank-node-state-notice>\n </ng-container>\n</div>\n\n<ng-container *ngIf=\"selectedView === View.logs && !isOriginal\">\n <div class=\"field has-addons pt-2 px-3\" *ngIf=\"cycles.length > 1\">\n <div class=\"control\">\n <span class=\"button is-small is-static\">Select a Cycle</span>\n </div>\n <div class=\"control is-expanded\">\n <div class=\"select is-small is-fullwidth\">\n <select (change)=\"selectIndex($event)\">\n <option *ngFor=\"let value of cycles; let i = index\" [value]=\"i\">{{i + 1}}. {{defaultLabel(value)}}</option>\n </select>\n </div>\n </div>\n </div>\n\n <he-cycles-activity-logs *ngIf=\"selectedIndex >= 0\"\n [cycle]=\"cycles[selectedIndex]\"\n [original]=\"originalValues[selectedIndex]\"\n [recalculated]=\"cycles[selectedIndex]\"\n ></he-cycles-activity-logs>\n</ng-container>\n\n<he-node-csv-export-confirm *ngIf=\"showDownload\"\n [nodes]=\"cycles\" filename=\"cycle-inputs-products.csv\" [isUpload]=\"false\"\n [headerKeys]=\"['cycle.id', 'cycle.@id', 'cycle.inputs.', 'cycle.products.']\"\n (closed)=\"showDownload = false\"\n></he-node-csv-export-confirm>\n\n<ng-template #emptyTable>\n <div class=\"has-text-centered\">\n <span>No activity data</span>\n </div>\n</ng-template>\n\n<ng-template #emptyValue>\n <span>-</span>\n</ng-template>\n\n<ng-template #details let-node=\"cycle\" let-data=\"data\" let-key=\"key\">\n <p><b>{{defaultLabel(node)}}</b></p>\n <he-node-value-details\n [data]=\"data\" [nodeType]=\"node['@type']\" [dataKey]=\"key\"\n ></he-node-value-details>\n</ng-template>\n", styles: ["fa-icon{display:inline-block;width:10px}he-data-table ::ng-deep .table thead tr th:nth-child(2),he-data-table ::ng-deep .table tbody tr td:nth-child(2){max-width:102px;width:102px}\n"], components: [{ type: i1__namespace.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }, { type: DataTableComponent, selector: "he-data-table", inputs: ["minHeight", "maxHeight", "nbRows", "small", "height", "width"] }, { type: NodeLinkComponent, selector: "he-node-link", inputs: ["node", "showExternalLink"] }, { type: CyclesFunctionalUnitMeasureComponent, selector: "he-cycles-functional-unit-measure", inputs: ["cycle"] }, { type: BlankNodeStateComponent, selector: "he-blank-node-state", inputs: ["nodeType", "dataKey", "key", "node", "state"] }, { type: BlankNodeStateNoticeComponent, selector: "he-blank-node-state-notice", inputs: ["dataState", "showAggregated", "showDeleted", "showUnchanged"] }, { type: CyclesActivityLogsComponent, selector: "he-cycles-activity-logs", inputs: ["cycle", "original", "recalculated"] }, { type: NodeCsvExportConfirmComponent, selector: "he-node-csv-export-confirm", inputs: ["nodes", "filename", "headerKeys", "extension", "isUpload"], outputs: ["closed"] }, { type: NodeValueDetailsComponent, selector: "he-node-value-details", inputs: ["data", "nodeType", "dataKey"] }], directives: [{ type: i2__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i11__namespace.NgbPopover, selector: "[ngbPopover]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disablePopover", "popoverClass", "openDelay", "closeDelay", "ngbPopover", "popoverTitle"], outputs: ["shown", "hidden"], exportAs: ["ngbPopover"] }, { type: i1__namespace$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1__namespace$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }], pipes: { "ellipsis": EllipsisPipe, "default": DefaultPipe, "precision": PrecisionPipe } });
|
|
6444
|
+
CyclesActivityComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesActivityComponent, selector: "he-cycles-activity", inputs: { originalValues: "originalValues", cycles: "cycles", dataState: "dataState", enableCompare: "enableCompare" }, usesOnChanges: true, ngImport: i0__namespace, template: "<div class=\"columns is-variable is-align-items-center is-2 m-0\">\n <div class=\"column is-hidden-mobile\"></div>\n <ng-container *ngIf=\"selectedView === View.table && (inputs.length || products.length)\">\n <div class=\"column is-narrow\">\n <button class=\"button is-dark is-outlined is-small\" (click)=\"showDownload = true\">\n <fa-icon icon=\"download\"></fa-icon>\n <span class=\"pl-2\">Download (CSV)</span>\n </button>\n </div>\n <div class=\"column is-narrow col-sep\"></div>\n </ng-container>\n <div class=\"column is-narrow\" *ngIf=\"!isOriginal\">\n <div class=\"field has-addons\">\n <div class=\"control\">\n <button class=\"button is-small\" [class.is-active]=\"selectedView === View.table\" (click)=\"selectedView = View.table\">\n <span class=\"icon is-small\">\n <fa-icon icon=\"list\" aria-hidden=\"true\"></fa-icon>\n </span>\n <span>Table view</span>\n </button>\n </div>\n <div class=\"control\">\n <button class=\"button is-small\" [class.is-active]=\"selectedView === View.logs\" (click)=\"selectedView = View.logs\">\n <span class=\"icon is-small\">\n <fa-icon icon=\"calculator\" aria-hidden=\"true\"></fa-icon>\n </span>\n <span>Recalculations logs</span>\n </button>\n </div>\n </div>\n </div>\n</div>\n\n<div class=\"px-3 pb-3\" [class.is-hidden]=\"selectedView !== View.table\">\n <ng-container *ngIf=\"inputs.length || products.length; else emptyTable\">\n <he-data-table class=\"mb-1 is-small\" [small]=\"true\" [nbRows]=\"cycles.length\" maxHeight=\"320\">\n <table class=\"table is-narrow is-striped\">\n <thead>\n <tr>\n <th class=\"width-auto\"></th>\n <th class=\"has-border-right\"></th>\n <th *ngIf=\"products.length\" [attr.colspan]=\"products.length\"\n [class.has-border-right]=\"inputs.length\"\n >Products</th>\n <th *ngIf=\"inputs.length\" [attr.colspan]=\"inputs.length\">Inputs</th>\n </tr>\n <tr>\n <th class=\"width-auto\"></th>\n <th class=\"has-border-right\"></th>\n <th *ngFor=\"let product of products; let pl = last\"\n [attr.title]=\"product.value.term.name\"\n [class.has-border-right]=\"inputs.length && pl\"\n >\n <he-node-link [node]=\"product.value.term\">\n <span>{{product.value.term.name | ellipsis:30}}</span>\n </he-node-link>\n </th>\n <th *ngFor=\"let input of inputs\"\n [attr.title]=\"input.value.term.name\"\n >\n <he-node-link [node]=\"input.value.term\">\n <span>{{input.value.term.name | ellipsis:30}}</span>\n </he-node-link>\n </th>\n </tr>\n <tr>\n <th class=\"width-auto\"></th>\n <th class=\"has-border-right\">\n <a [href]=\"baseUrl + '/schema/Cycle#functionalUnit'\" target=\"_blank\">Functional unit</a>\n </th>\n <th *ngFor=\"let product of products; let pl = last\"\n [attr.title]=\"product.value.term.units\"\n [class.has-border-right]=\"inputs.length && pl\"\n >{{product.value.term.units}}</th>\n <th *ngFor=\"let input of inputs\"\n [attr.title]=\"input.value.term.units\"\n >{{input.value.term.units}}</th>\n </tr>\n </thead>\n <tbody>\n <ng-container *ngFor=\"let cycle of cycles; trackBy: trackById; let i = index\">\n <tr>\n <td class=\"width-auto\" [attr.title]=\"defaultLabel(cycle)\">\n <he-node-link [node]=\"cycle.term || cycle\">\n <span class=\"is-nowrap has-text-ellipsis\">{{i + 1}}. {{defaultLabel(cycle)}}</span>\n </he-node-link>\n </td>\n <td class=\"has-border-right\">\n <he-cycles-functional-unit-measure [cycle]=\"cycle\"></he-cycles-functional-unit-measure>\n </td>\n <td class=\"is-nowrap\"\n *ngFor=\"let product of products; let pl = last\"\n [class.has-border-right]=\"inputs.length && pl\"\n >\n <span *ngIf=\"product.value.values[cycle['@id']]; else emptyValue\"\n class=\"trigger-popover\"\n [ngbPopover]=\"details\" [autoClose]=\"'outside'\"\n triggers=\"manual\" #p=\"ngbPopover\" placement=\"left\" container=\"body\"\n (click)=\"togglePopover(p, { data: product.value.values[cycle['@id']], cycle: cycle, key: 'products' })\"\n >\n <span pointer>{{propertyValue(product.value.values[cycle['@id']].value, product.value.term['@id']) | precision:3 | default:'-'}}</span>\n <he-blank-node-state class=\"ml-1\"\n [node]=\"product.value.values[cycle['@id']].node\"\n key=\"value\"\n ></he-blank-node-state>\n </span>\n </td>\n <td class=\"is-nowrap\" *ngFor=\"let input of inputs\">\n <span *ngIf=\"input.value.values[cycle['@id']]; else emptyValue\"\n class=\"trigger-popover\"\n [ngbPopover]=\"details\" [autoClose]=\"'outside'\"\n triggers=\"manual\" #p=\"ngbPopover\" placement=\"left\" container=\"body\"\n (click)=\"togglePopover(p, { data: input.value.values[cycle['@id']], cycle: cycle, key: 'inputs' })\"\n >\n <span pointer>{{propertyValue(input.value.values[cycle['@id']].value, input.value.term['@id']) | precision:3 | default:'-'}}</span>\n <he-blank-node-state class=\"ml-1\"\n [node]=\"input.value.values[cycle['@id']].node\"\n key=\"value\"\n ></he-blank-node-state>\n </span>\n </td>\n </tr>\n </ng-container>\n </tbody>\n </table>\n </he-data-table>\n\n <he-blank-node-state-notice [dataState]=\"dataState\"></he-blank-node-state-notice>\n </ng-container>\n</div>\n\n<ng-container *ngIf=\"selectedView === View.logs && !isOriginal\">\n <div class=\"field has-addons pt-2 px-3\" *ngIf=\"cycles.length > 1\">\n <div class=\"control\">\n <span class=\"button is-small is-static\">Select a Cycle</span>\n </div>\n <div class=\"control is-expanded\">\n <div class=\"select is-small is-fullwidth\">\n <select (change)=\"selectIndex($event)\">\n <option *ngFor=\"let value of cycles; let i = index\" [value]=\"i\">{{i + 1}}. {{defaultLabel(value)}}</option>\n </select>\n </div>\n </div>\n </div>\n\n <he-cycles-activity-logs *ngIf=\"selectedIndex >= 0\"\n [cycle]=\"cycles[selectedIndex]\"\n [original]=\"originalValues[selectedIndex]\"\n [recalculated]=\"cycles[selectedIndex]\"\n ></he-cycles-activity-logs>\n</ng-container>\n\n<he-node-csv-export-confirm *ngIf=\"showDownload\"\n [nodes]=\"cycles\" filename=\"cycle-inputs-products.csv\" [isUpload]=\"false\"\n [headerKeys]=\"['cycle.id', 'cycle.@id', 'cycle.inputs.', 'cycle.products.']\"\n (closed)=\"showDownload = false\"\n></he-node-csv-export-confirm>\n\n<ng-template #emptyTable>\n <div class=\"has-text-centered\">\n <span>No activity data</span>\n </div>\n</ng-template>\n\n<ng-template #emptyValue>\n <span>-</span>\n</ng-template>\n\n<ng-template #details let-node=\"cycle\" let-data=\"data\" let-key=\"key\">\n <p><b>{{defaultLabel(node)}}</b></p>\n <he-node-value-details\n [data]=\"data\" [nodeType]=\"node['@type']\" [dataKey]=\"key\"\n ></he-node-value-details>\n</ng-template>\n", styles: ["fa-icon{display:inline-block;width:10px}he-data-table ::ng-deep .table thead tr th:nth-child(2),he-data-table ::ng-deep .table tbody tr td:nth-child(2){max-width:102px;width:102px}\n"], components: [{ type: i1__namespace.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }, { type: DataTableComponent, selector: "he-data-table", inputs: ["minHeight", "maxHeight", "nbRows", "small", "height", "width"] }, { type: NodeLinkComponent, selector: "he-node-link", inputs: ["node", "showExternalLink"] }, { type: CyclesFunctionalUnitMeasureComponent, selector: "he-cycles-functional-unit-measure", inputs: ["cycle"] }, { type: BlankNodeStateComponent, selector: "he-blank-node-state", inputs: ["nodeType", "dataKey", "key", "node", "state"] }, { type: BlankNodeStateNoticeComponent, selector: "he-blank-node-state-notice", inputs: ["dataState", "showAggregated", "showDeleted", "showUnchanged"] }, { type: CyclesActivityLogsComponent, selector: "he-cycles-activity-logs", inputs: ["cycle", "original", "recalculated"] }, { type: NodeCsvExportConfirmComponent, selector: "he-node-csv-export-confirm", inputs: ["nodes", "filename", "headerKeys", "extension", "isUpload"], outputs: ["closed"] }, { type: NodeValueDetailsComponent, selector: "he-node-value-details", inputs: ["data", "nodeType", "dataKey"] }], directives: [{ type: i2__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i11__namespace.NgbPopover, selector: "[ngbPopover]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disablePopover", "popoverClass", "openDelay", "closeDelay", "ngbPopover", "popoverTitle"], outputs: ["shown", "hidden"], exportAs: ["ngbPopover"] }, { type: i1__namespace$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1__namespace$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }], pipes: { "ellipsis": EllipsisPipe, "default": DefaultPipe, "precision": PrecisionPipe } });
|
|
6360
6445
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesActivityComponent, decorators: [{
|
|
6361
6446
|
type: i0.Component,
|
|
6362
6447
|
args: [{
|
|
@@ -6368,8 +6453,6 @@
|
|
|
6368
6453
|
type: i0.Input
|
|
6369
6454
|
}], cycles: [{
|
|
6370
6455
|
type: i0.Input
|
|
6371
|
-
}], selected: [{
|
|
6372
|
-
type: i0.Input
|
|
6373
6456
|
}], dataState: [{
|
|
6374
6457
|
type: i0.Input
|
|
6375
6458
|
}], enableCompare: [{
|
|
@@ -6382,7 +6465,6 @@
|
|
|
6382
6465
|
var CyclesCompletenessComponent = /** @class */ (function () {
|
|
6383
6466
|
function CyclesCompletenessComponent() {
|
|
6384
6467
|
this.cycles = [];
|
|
6385
|
-
this.selected = [];
|
|
6386
6468
|
this.baseUrl = baseUrl();
|
|
6387
6469
|
this.defaultLabel = defaultLabel;
|
|
6388
6470
|
this.keyToLabel = utils.keyToLabel;
|
|
@@ -6398,13 +6480,10 @@
|
|
|
6398
6480
|
enumerable: false,
|
|
6399
6481
|
configurable: true
|
|
6400
6482
|
});
|
|
6401
|
-
CyclesCompletenessComponent.prototype.isSelected = function (cycle) {
|
|
6402
|
-
return this.selected.length === 0 || this.selected.includes(cycle['@id']);
|
|
6403
|
-
};
|
|
6404
6483
|
return CyclesCompletenessComponent;
|
|
6405
6484
|
}());
|
|
6406
6485
|
CyclesCompletenessComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesCompletenessComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
6407
|
-
CyclesCompletenessComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesCompletenessComponent, selector: "he-cycles-completeness", inputs: { cycles: "cycles",
|
|
6486
|
+
CyclesCompletenessComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesCompletenessComponent, selector: "he-cycles-completeness", inputs: { cycles: "cycles", dataState: "dataState" }, ngImport: i0__namespace, template: "<div class=\"p-3\" *ngIf=\"cycles.length; else emptyTable\">\n <he-data-table class=\"mb-1 is-small\" [small]=\"true\" [nbRows]=\"cycles.length\" maxHeight=\"320\">\n <table class=\"table is-narrow is-striped\">\n <thead>\n <tr>\n <th class=\"width-auto\"></th>\n <th *ngFor=\"let completeness of completenessKeys\"\n [attr.title]=\"completeness\"\n ><a [href]=\"baseUrl + '/schema/Completeness#' + completeness\" target=\"_blank\">{{keyToLabel(completeness)}}</a></th>\n </tr>\n </thead>\n <tbody>\n <ng-container *ngFor=\"let cycle of cycles; trackBy: trackById; let i = index\">\n <tr>\n <td class=\"width-auto\" [attr.title]=\"defaultLabel(cycle)\">\n <he-node-link [node]=\"cycle\">\n <span class=\"is-nowrap has-text-ellipsis\">{{i + 1}}. {{defaultLabel(cycle)}}</span>\n </he-node-link>\n </td>\n <td class=\"is-nowrap\" *ngFor=\"let completeness of completenessKeys\">\n <span>{{cycle.dataCompleteness[completeness] ? 'Complete' : 'Incomplete'}}</span>\n <he-blank-node-state class=\"ml-1\"\n [node]=\"cycle.dataCompleteness\"\n [key]=\"completeness\"\n ></he-blank-node-state>\n </td>\n </tr>\n </ng-container>\n </tbody>\n </table>\n </he-data-table>\n\n <he-blank-node-state-notice [dataState]=\"dataState\" [showAggregated]=\"false\"></he-blank-node-state-notice>\n</div>\n\n<ng-template #emptyTable>\n <div class=\"panel-block\">\n <span>No completeness data</span>\n </div>\n</ng-template>\n", styles: [""], components: [{ type: DataTableComponent, selector: "he-data-table", inputs: ["minHeight", "maxHeight", "nbRows", "small", "height", "width"] }, { type: NodeLinkComponent, selector: "he-node-link", inputs: ["node", "showExternalLink"] }, { type: BlankNodeStateComponent, selector: "he-blank-node-state", inputs: ["nodeType", "dataKey", "key", "node", "state"] }, { type: BlankNodeStateNoticeComponent, selector: "he-blank-node-state-notice", inputs: ["dataState", "showAggregated", "showDeleted", "showUnchanged"] }], directives: [{ type: i2__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
6408
6487
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesCompletenessComponent, decorators: [{
|
|
6409
6488
|
type: i0.Component,
|
|
6410
6489
|
args: [{
|
|
@@ -6415,13 +6494,10 @@
|
|
|
6415
6494
|
}]
|
|
6416
6495
|
}], propDecorators: { cycles: [{
|
|
6417
6496
|
type: i0.Input
|
|
6418
|
-
}], selected: [{
|
|
6419
|
-
type: i0.Input
|
|
6420
6497
|
}], dataState: [{
|
|
6421
6498
|
type: i0.Input
|
|
6422
6499
|
}] } });
|
|
6423
6500
|
|
|
6424
|
-
var isSelected$1 = function (selected, v) { return selected.length === 0 || selected.includes(v['@id']); };
|
|
6425
6501
|
var cycleValue = function (cycle, values) { var _a; return (((_a = values[cycle['@id']]) === null || _a === void 0 ? void 0 : _a.nodes[0]) || { value: [0] }).value; };
|
|
6426
6502
|
var cycleName = function (cycle, index) { return index + 1 + ". " + defaultLabel(cycle); };
|
|
6427
6503
|
var cycleDataset = function (values, termId, cycle, index) {
|
|
@@ -6440,7 +6516,6 @@
|
|
|
6440
6516
|
function CyclesEmissionsChartComponent(ngZone) {
|
|
6441
6517
|
this.ngZone = ngZone;
|
|
6442
6518
|
this.cycles = [];
|
|
6443
|
-
this.selected = [];
|
|
6444
6519
|
this.emissionPerCycle = {};
|
|
6445
6520
|
this.terms = [];
|
|
6446
6521
|
}
|
|
@@ -6456,9 +6531,7 @@
|
|
|
6456
6531
|
}
|
|
6457
6532
|
};
|
|
6458
6533
|
CyclesEmissionsChartComponent.prototype.init = function () {
|
|
6459
|
-
|
|
6460
|
-
var cycles = this.cycles.filter(function (v) { return isSelected$1(_this.selected, v); });
|
|
6461
|
-
this.emissionPerCycle = groupNodesByTerm(cycles, 'emissions');
|
|
6534
|
+
this.emissionPerCycle = groupNodesByTerm(this.cycles, 'emissions');
|
|
6462
6535
|
this.terms = Object.values(this.emissionPerCycle)
|
|
6463
6536
|
.filter(function (_d) {
|
|
6464
6537
|
var values = _d.values;
|
|
@@ -6475,13 +6548,12 @@
|
|
|
6475
6548
|
return this.selectedTerm ? this.updateChart() : null;
|
|
6476
6549
|
};
|
|
6477
6550
|
CyclesEmissionsChartComponent.prototype.initChart = function () {
|
|
6478
|
-
var _this = this;
|
|
6479
6551
|
var _a, _b, _c;
|
|
6480
6552
|
var labels = [(_b = (_a = this.selectedTerm) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : ''];
|
|
6481
6553
|
var termId = this.selectedTerm['@id'];
|
|
6482
6554
|
var values = this.emissionPerCycle[termId].values;
|
|
6483
6555
|
var datasets = this.cycles
|
|
6484
|
-
.map(function (cycle, index) { return
|
|
6556
|
+
.map(function (cycle, index) { return cycleDataset(values, termId, cycle, index); })
|
|
6485
6557
|
.filter(Boolean);
|
|
6486
6558
|
if (this.chart) {
|
|
6487
6559
|
this.chart.destroy();
|
|
@@ -6519,7 +6591,7 @@
|
|
|
6519
6591
|
return CyclesEmissionsChartComponent;
|
|
6520
6592
|
}());
|
|
6521
6593
|
CyclesEmissionsChartComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesEmissionsChartComponent, deps: [{ token: i0__namespace.NgZone }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
6522
|
-
CyclesEmissionsChartComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesEmissionsChartComponent, selector: "he-cycles-emissions-chart", inputs: { cycles: "cycles"
|
|
6594
|
+
CyclesEmissionsChartComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesEmissionsChartComponent, selector: "he-cycles-emissions-chart", inputs: { cycles: "cycles" }, viewQueries: [{ propertyName: "chartRef", first: true, predicate: ["chart"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div class=\"p-3\" [class.is-hidden]=\"!terms?.length\">\n <div class=\"field is-horizontal\">\n <div class=\"field-label is-normal\">\n <label class=\"label\" for=\"selectedTerm\">\n <span>Select a column</span>\n </label>\n </div>\n <div class=\"field-body\">\n <div class=\"control\">\n <div class=\"select is-small\">\n <select (change)=\"updateChart()\" [(ngModel)]=\"selectedTerm\" id=\"selectedTerm\">\n <option *ngFor=\"let term of terms\" [ngValue]=\"term\">{{term.name}}</option>\n </select>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"mt-1\">\n <div class=\"chart-container\">\n <canvas #chart></canvas>\n </div>\n </div>\n</div>\n", styles: [":host{display:block;overflow:visible}.chart-container{height:400px;position:relative}\n"], directives: [{ type: i1__namespace$1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i1__namespace$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1__namespace$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i2__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1__namespace$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1__namespace$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }] });
|
|
6523
6595
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesEmissionsChartComponent, decorators: [{
|
|
6524
6596
|
type: i0.Component,
|
|
6525
6597
|
args: [{
|
|
@@ -6532,14 +6604,11 @@
|
|
|
6532
6604
|
args: ['chart']
|
|
6533
6605
|
}], cycles: [{
|
|
6534
6606
|
type: i0.Input
|
|
6535
|
-
}], selected: [{
|
|
6536
|
-
type: i0.Input
|
|
6537
6607
|
}] } });
|
|
6538
6608
|
|
|
6539
6609
|
var CyclesEmissionsLogsComponent = /** @class */ (function () {
|
|
6540
|
-
function CyclesEmissionsLogsComponent(searchService
|
|
6610
|
+
function CyclesEmissionsLogsComponent(searchService) {
|
|
6541
6611
|
this.searchService = searchService;
|
|
6542
|
-
this.nodeService = nodeService;
|
|
6543
6612
|
this.originalValues = [];
|
|
6544
6613
|
this.recalculatedValues = [];
|
|
6545
6614
|
this.loading = true;
|
|
@@ -6549,28 +6618,22 @@
|
|
|
6549
6618
|
}
|
|
6550
6619
|
CyclesEmissionsLogsComponent.prototype.ngOnInit = function () {
|
|
6551
6620
|
return __awaiter(this, void 0, void 0, function () {
|
|
6552
|
-
var
|
|
6621
|
+
var emissions;
|
|
6553
6622
|
return __generator(this, function (_a) {
|
|
6554
6623
|
switch (_a.label) {
|
|
6555
|
-
case 0:
|
|
6556
|
-
|
|
6557
|
-
|
|
6558
|
-
|
|
6559
|
-
|
|
6560
|
-
|
|
6561
|
-
|
|
6562
|
-
|
|
6563
|
-
|
|
6564
|
-
query: {
|
|
6565
|
-
bool: {
|
|
6566
|
-
must: [
|
|
6567
|
-
matchType(schema.NodeType.Term),
|
|
6568
|
-
matchTermType(schema.TermTermType.emission)
|
|
6569
|
-
]
|
|
6570
|
-
}
|
|
6624
|
+
case 0: return [4 /*yield*/, this.searchService.search({
|
|
6625
|
+
fields: ['@type', '@id', 'name', 'units'],
|
|
6626
|
+
limit: 1000,
|
|
6627
|
+
query: {
|
|
6628
|
+
bool: {
|
|
6629
|
+
must: [
|
|
6630
|
+
matchType(schema.NodeType.Term),
|
|
6631
|
+
matchTermType(schema.TermTermType.emission)
|
|
6632
|
+
]
|
|
6571
6633
|
}
|
|
6572
|
-
}
|
|
6573
|
-
|
|
6634
|
+
}
|
|
6635
|
+
})];
|
|
6636
|
+
case 1:
|
|
6574
6637
|
emissions = (_a.sent()).results;
|
|
6575
6638
|
this.emissions = emissions;
|
|
6576
6639
|
this.loading = false;
|
|
@@ -6586,10 +6649,17 @@
|
|
|
6586
6649
|
enumerable: false,
|
|
6587
6650
|
configurable: true
|
|
6588
6651
|
});
|
|
6652
|
+
Object.defineProperty(CyclesEmissionsLogsComponent.prototype, "logsKey", {
|
|
6653
|
+
get: function () {
|
|
6654
|
+
return logsKey(this.cycle);
|
|
6655
|
+
},
|
|
6656
|
+
enumerable: false,
|
|
6657
|
+
configurable: true
|
|
6658
|
+
});
|
|
6589
6659
|
return CyclesEmissionsLogsComponent;
|
|
6590
6660
|
}());
|
|
6591
|
-
CyclesEmissionsLogsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesEmissionsLogsComponent, deps: [{ token: HeSearchService }
|
|
6592
|
-
CyclesEmissionsLogsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesEmissionsLogsComponent, selector: "he-cycles-emissions-logs", inputs: { cycle: "cycle", originalValues: "originalValues", recalculatedValues: "recalculatedValues" }, ngImport: i0__namespace, template: "<he-node-logs-models *ngIf=\"!loading; else loader\"\n [
|
|
6661
|
+
CyclesEmissionsLogsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesEmissionsLogsComponent, deps: [{ token: HeSearchService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
6662
|
+
CyclesEmissionsLogsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesEmissionsLogsComponent, selector: "he-cycles-emissions-logs", inputs: { cycle: "cycle", originalValues: "originalValues", recalculatedValues: "recalculatedValues" }, ngImport: i0__namespace, template: "<he-node-logs-models *ngIf=\"!loading; else loader\"\n [node]=\"node\"\n [logsKey]=\"logsKey\"\n [originalValues]=\"originalValues\"\n [recalculatedValues]=\"recalculatedValues\"\n [terms]=\"emissions\"\n [filterTermTypes]=\"[TermTermType.emission]\"\n></he-node-logs-models>\n\n<ng-template #loader>\n <div class=\"has-text-center py-3\">\n <fa-icon icon=\"spinner\" [pulse]=\"true\" size=\"lg\"></fa-icon>\n </div>\n</ng-template>\n", styles: [":host{display:block}\n"], components: [{ type: NodeLogsModelsComponent, selector: "he-node-logs-models", inputs: ["node", "nodeKey", "includeAllModels", "originalValues", "recalculatedValues", "terms", "filterTermTypes", "logsKey"] }, { type: i1__namespace.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }], directives: [{ type: i2__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
6593
6663
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesEmissionsLogsComponent, decorators: [{
|
|
6594
6664
|
type: i0.Component,
|
|
6595
6665
|
args: [{
|
|
@@ -6597,7 +6667,7 @@
|
|
|
6597
6667
|
templateUrl: './cycles-emissions-logs.component.html',
|
|
6598
6668
|
styleUrls: ['./cycles-emissions-logs.component.scss']
|
|
6599
6669
|
}]
|
|
6600
|
-
}], ctorParameters: function () { return [{ type: HeSearchService }
|
|
6670
|
+
}], ctorParameters: function () { return [{ type: HeSearchService }]; }, propDecorators: { cycle: [{
|
|
6601
6671
|
type: i0.Input
|
|
6602
6672
|
}], originalValues: [{
|
|
6603
6673
|
type: i0.Input
|
|
@@ -6616,7 +6686,6 @@
|
|
|
6616
6686
|
function CyclesEmissionsComponent() {
|
|
6617
6687
|
this.originalValues = [];
|
|
6618
6688
|
this.cycles = [];
|
|
6619
|
-
this.selected = [];
|
|
6620
6689
|
this.baseUrl = baseUrl();
|
|
6621
6690
|
this.propertyValue = term.propertyValue;
|
|
6622
6691
|
this.defaultLabel = defaultLabel;
|
|
@@ -6651,9 +6720,6 @@
|
|
|
6651
6720
|
CyclesEmissionsComponent.prototype.togglePopover = function (popover, context) {
|
|
6652
6721
|
return popover.isOpen() ? popover.close() : popover.open(context);
|
|
6653
6722
|
};
|
|
6654
|
-
CyclesEmissionsComponent.prototype.isSelected = function (cycle) {
|
|
6655
|
-
return this.selected.length === 0 || this.selected.includes(cycle['@id']);
|
|
6656
|
-
};
|
|
6657
6723
|
Object.defineProperty(CyclesEmissionsComponent.prototype, "isTransformation", {
|
|
6658
6724
|
get: function () {
|
|
6659
6725
|
var firstNode = (this.cycles || [{ '@type': schema.NodeType.Cycle }])[0];
|
|
@@ -6674,7 +6740,7 @@
|
|
|
6674
6740
|
return CyclesEmissionsComponent;
|
|
6675
6741
|
}());
|
|
6676
6742
|
CyclesEmissionsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesEmissionsComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
6677
|
-
CyclesEmissionsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesEmissionsComponent, selector: "he-cycles-emissions", inputs: { originalValues: "originalValues", cycles: "cycles",
|
|
6743
|
+
CyclesEmissionsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesEmissionsComponent, selector: "he-cycles-emissions", inputs: { originalValues: "originalValues", cycles: "cycles", dataState: "dataState" }, usesOnChanges: true, ngImport: i0__namespace, template: "<div class=\"columns is-variable is-align-items-center is-2 m-0\">\n <div class=\"column is-hidden-mobile\"></div>\n <ng-container *ngIf=\"selectedView === View.table && emissions.length\">\n <div class=\"column is-narrow\">\n <button class=\"button is-dark is-outlined is-small\" (click)=\"showDownload = true\">\n <fa-icon icon=\"download\"></fa-icon>\n <span class=\"pl-2\">Download (CSV)</span>\n </button>\n </div>\n <div class=\"column is-narrow col-sep\"></div>\n </ng-container>\n <div class=\"column is-narrow\" *ngIf=\"cycles.length > 1 || !isOriginal\">\n <div class=\"field has-addons\">\n <div class=\"control\">\n <button class=\"button is-small\" [class.is-active]=\"selectedView === View.table\" (click)=\"selectedView = View.table\">\n <span class=\"icon is-small\">\n <fa-icon icon=\"list\" aria-hidden=\"true\"></fa-icon>\n </span>\n <span>Table view</span>\n </button>\n </div>\n <div class=\"control\" *ngIf=\"cycles.length > 1\">\n <button class=\"button is-small\" [class.is-active]=\"selectedView === View.chart\" (click)=\"selectedView = View.chart\">\n <span class=\"icon is-small\">\n <fa-icon icon=\"chart-bar\" aria-hidden=\"true\"></fa-icon>\n </span>\n <span>Chart view</span>\n </button>\n </div>\n <div class=\"control\" *ngIf=\"!isOriginal\">\n <button class=\"button is-small\" [class.is-active]=\"selectedView === View.logs\" (click)=\"selectedView = View.logs\">\n <span class=\"icon is-small\">\n <fa-icon icon=\"calculator\" aria-hidden=\"true\"></fa-icon>\n </span>\n <span>Recalculations logs</span>\n </button>\n </div>\n </div>\n </div>\n</div>\n\n<div class=\"px-3 pb-3\" [class.is-hidden]=\"selectedView !== View.table\">\n <ng-container *ngIf=\"emissions.length; else emptyTable\">\n <he-data-table class=\"mb-1 is-small\" [small]=\"true\" [nbRows]=\"cycles.length\" maxHeight=\"320\">\n <table class=\"table is-narrow is-striped\">\n <thead>\n <tr>\n <th class=\"width-auto\"></th>\n <th class=\"has-border-right\" [class.is-hidden]=\"isTransformation\"></th>\n <th *ngFor=\"let emission of emissions\"\n [attr.title]=\"emission.value.term.name\"\n >\n <he-node-link [node]=\"emission.value.term\">\n <span>{{emission.value.term.name | ellipsis:30}}</span>\n </he-node-link>\n </th>\n </tr>\n <tr>\n <th class=\"width-auto\"></th>\n <th class=\"has-border-right\" [class.is-hidden]=\"isTransformation\">\n <a [href]=\"baseUrl + '/schema/Cycle#functionalUnit'\" target=\"_blank\">Functional unit</a>\n </th>\n <th *ngFor=\"let emission of emissions\"\n [attr.title]=\"emission.value.term.units\"\n >{{emission.value.term.units}}</th>\n </tr>\n </thead>\n <tbody>\n <ng-container *ngFor=\"let cycle of cycles; trackBy: trackById; let i = index\">\n <tr>\n <td class=\"width-auto\" [attr.title]=\"defaultLabel(cycle)\">\n <he-node-link [node]=\"cycle.term || cycle\">\n <span class=\"is-nowrap has-text-ellipsis\">{{i + 1}}. {{defaultLabel(cycle)}}</span>\n </he-node-link>\n </td>\n <td class=\"has-border-right\" [class.is-hidden]=\"isTransformation\">\n <he-cycles-functional-unit-measure [cycle]=\"cycles[0]\"></he-cycles-functional-unit-measure>\n </td>\n <td class=\"is-nowrap\" *ngFor=\"let emission of emissions\">\n <span *ngIf=\"emission.value.values[cycle['@id']]; else emptyValue\"\n class=\"trigger-popover\"\n [ngbPopover]=\"details\" [autoClose]=\"'outside'\"\n triggers=\"manual\" #p=\"ngbPopover\" placement=\"left\" container=\"body\"\n (click)=\"togglePopover(p, { data: emission.value.values[cycle['@id']], cycle: cycle, key: 'emissions' })\"\n >\n <span pointer>{{propertyValue(emission.value.values[cycle['@id']].value, emission.value.term['@id']) | precision:3 | default:'-'}}</span>\n <he-blank-node-state class=\"ml-1\"\n [node]=\"emission.value.values[cycle['@id']].node\"\n key=\"value\"\n ></he-blank-node-state>\n </span>\n </td>\n </tr>\n </ng-container>\n </tbody>\n </table>\n </he-data-table>\n\n <he-blank-node-state-notice [dataState]=\"dataState\" [showDeleted]=\"true\"></he-blank-node-state-notice>\n </ng-container>\n</div>\n\n<he-cycles-emissions-chart *ngIf=\"cycles.length > 1\" [class.is-hidden]=\"selectedView !== View.chart\"\n [cycles]=\"cycles\"\n></he-cycles-emissions-chart>\n\n<ng-container *ngIf=\"selectedView === View.logs && !isOriginal\">\n <div class=\"field has-addons pt-2 px-3\" *ngIf=\"cycles.length > 1\">\n <div class=\"control\">\n <span class=\"button is-small is-static\">Select a Cycle</span>\n </div>\n <div class=\"control is-expanded\">\n <div class=\"select is-small is-fullwidth\">\n <select (change)=\"selectIndex($event)\">\n <option *ngFor=\"let value of cycles; let i = index\" [value]=\"i\">{{i + 1}}. {{defaultLabel(value)}}</option>\n </select>\n </div>\n </div>\n </div>\n\n <he-cycles-emissions-logs *ngIf=\"selectedIndex >= 0\"\n [cycle]=\"cycles[selectedIndex]\"\n [originalValues]=\"originalValues[selectedIndex]?.emissions\"\n [recalculatedValues]=\"cycles[selectedIndex]?.emissions\"\n ></he-cycles-emissions-logs>\n</ng-container>\n\n<he-node-csv-export-confirm *ngIf=\"showDownload\"\n [nodes]=\"cycles\" filename=\"cycle-emissions.csv\" [isUpload]=\"false\"\n [headerKeys]=\"['cycle.id', 'cycle.@id', 'cycle.emissions.']\"\n (closed)=\"showDownload = false\"\n></he-node-csv-export-confirm>\n\n<ng-template #emptyTable>\n <div class=\"has-text-centered\">\n <span>No data</span>\n </div>\n</ng-template>\n\n<ng-template #emptyValue>\n <span>-</span>\n</ng-template>\n\n<ng-template #details let-node=\"cycle\" let-data=\"data\" let-key=\"key\">\n <p><b>{{defaultLabel(node)}}</b></p>\n <he-node-value-details\n [data]=\"data\" [nodeType]=\"node['@type']\" [dataKey]=\"key\"\n ></he-node-value-details>\n</ng-template>\n", styles: ["fa-icon{display:inline-block;width:10px}he-data-table ::ng-deep .table thead tr th:nth-child(2),he-data-table ::ng-deep .table tbody tr td:nth-child(2){max-width:102px;width:102px}\n"], components: [{ type: i1__namespace.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }, { type: DataTableComponent, selector: "he-data-table", inputs: ["minHeight", "maxHeight", "nbRows", "small", "height", "width"] }, { type: NodeLinkComponent, selector: "he-node-link", inputs: ["node", "showExternalLink"] }, { type: CyclesFunctionalUnitMeasureComponent, selector: "he-cycles-functional-unit-measure", inputs: ["cycle"] }, { type: BlankNodeStateComponent, selector: "he-blank-node-state", inputs: ["nodeType", "dataKey", "key", "node", "state"] }, { type: BlankNodeStateNoticeComponent, selector: "he-blank-node-state-notice", inputs: ["dataState", "showAggregated", "showDeleted", "showUnchanged"] }, { type: CyclesEmissionsChartComponent, selector: "he-cycles-emissions-chart", inputs: ["cycles"] }, { type: CyclesEmissionsLogsComponent, selector: "he-cycles-emissions-logs", inputs: ["cycle", "originalValues", "recalculatedValues"] }, { type: NodeCsvExportConfirmComponent, selector: "he-node-csv-export-confirm", inputs: ["nodes", "filename", "headerKeys", "extension", "isUpload"], outputs: ["closed"] }, { type: NodeValueDetailsComponent, selector: "he-node-value-details", inputs: ["data", "nodeType", "dataKey"] }], directives: [{ type: i2__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i11__namespace.NgbPopover, selector: "[ngbPopover]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disablePopover", "popoverClass", "openDelay", "closeDelay", "ngbPopover", "popoverTitle"], outputs: ["shown", "hidden"], exportAs: ["ngbPopover"] }, { type: i1__namespace$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1__namespace$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }], pipes: { "ellipsis": EllipsisPipe, "default": DefaultPipe, "precision": PrecisionPipe } });
|
|
6678
6744
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesEmissionsComponent, decorators: [{
|
|
6679
6745
|
type: i0.Component,
|
|
6680
6746
|
args: [{
|
|
@@ -6686,8 +6752,6 @@
|
|
|
6686
6752
|
type: i0.Input
|
|
6687
6753
|
}], cycles: [{
|
|
6688
6754
|
type: i0.Input
|
|
6689
|
-
}], selected: [{
|
|
6690
|
-
type: i0.Input
|
|
6691
6755
|
}], dataState: [{
|
|
6692
6756
|
type: i0.Input
|
|
6693
6757
|
}] } });
|
|
@@ -6739,31 +6803,12 @@
|
|
|
6739
6803
|
}] } });
|
|
6740
6804
|
|
|
6741
6805
|
var CyclesPracticesLogsComponent = /** @class */ (function () {
|
|
6742
|
-
function CyclesPracticesLogsComponent(
|
|
6743
|
-
this.nodeService = nodeService;
|
|
6806
|
+
function CyclesPracticesLogsComponent() {
|
|
6744
6807
|
this.originalValues = [];
|
|
6745
6808
|
this.recalculatedValues = [];
|
|
6746
|
-
this.loading = true;
|
|
6747
6809
|
this.NodeType = schema.NodeType;
|
|
6748
6810
|
this.models = [];
|
|
6749
6811
|
}
|
|
6750
|
-
CyclesPracticesLogsComponent.prototype.ngOnInit = function () {
|
|
6751
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
6752
|
-
var logs;
|
|
6753
|
-
return __generator(this, function (_a) {
|
|
6754
|
-
switch (_a.label) {
|
|
6755
|
-
case 0:
|
|
6756
|
-
this.logsUrl = this.nodeService.nodeLogsUrl(this.node);
|
|
6757
|
-
return [4 /*yield*/, this.nodeService.getModelsLog(this.node)];
|
|
6758
|
-
case 1:
|
|
6759
|
-
logs = _a.sent();
|
|
6760
|
-
this.logs = parseLogs(this.cycle, logs);
|
|
6761
|
-
this.loading = false;
|
|
6762
|
-
return [2 /*return*/];
|
|
6763
|
-
}
|
|
6764
|
-
});
|
|
6765
|
-
});
|
|
6766
|
-
};
|
|
6767
6812
|
Object.defineProperty(CyclesPracticesLogsComponent.prototype, "node", {
|
|
6768
6813
|
get: function () {
|
|
6769
6814
|
return Object.assign(Object.assign({}, this.cycle), { '@type': schema.NodeType.Cycle, type: schema.NodeType.Cycle, dataState: api.DataState.recalculated });
|
|
@@ -6771,10 +6816,17 @@
|
|
|
6771
6816
|
enumerable: false,
|
|
6772
6817
|
configurable: true
|
|
6773
6818
|
});
|
|
6819
|
+
Object.defineProperty(CyclesPracticesLogsComponent.prototype, "logsKey", {
|
|
6820
|
+
get: function () {
|
|
6821
|
+
return logsKey(this.cycle);
|
|
6822
|
+
},
|
|
6823
|
+
enumerable: false,
|
|
6824
|
+
configurable: true
|
|
6825
|
+
});
|
|
6774
6826
|
return CyclesPracticesLogsComponent;
|
|
6775
6827
|
}());
|
|
6776
|
-
CyclesPracticesLogsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesPracticesLogsComponent, deps: [
|
|
6777
|
-
CyclesPracticesLogsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesPracticesLogsComponent, selector: "he-cycles-practices-logs", inputs: { cycle: "cycle", originalValues: "originalValues", recalculatedValues: "recalculatedValues" }, ngImport: i0__namespace, template: "<he-node-logs-models
|
|
6828
|
+
CyclesPracticesLogsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesPracticesLogsComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
6829
|
+
CyclesPracticesLogsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesPracticesLogsComponent, selector: "he-cycles-practices-logs", inputs: { cycle: "cycle", originalValues: "originalValues", recalculatedValues: "recalculatedValues" }, ngImport: i0__namespace, template: "<he-node-logs-models\n [node]=\"node\"\n [logsKey]=\"logsKey\"\n [originalValues]=\"originalValues\"\n [recalculatedValues]=\"recalculatedValues\"\n></he-node-logs-models>\n", styles: [""], components: [{ type: NodeLogsModelsComponent, selector: "he-node-logs-models", inputs: ["node", "nodeKey", "includeAllModels", "originalValues", "recalculatedValues", "terms", "filterTermTypes", "logsKey"] }] });
|
|
6778
6830
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesPracticesLogsComponent, decorators: [{
|
|
6779
6831
|
type: i0.Component,
|
|
6780
6832
|
args: [{
|
|
@@ -6782,7 +6834,7 @@
|
|
|
6782
6834
|
templateUrl: './cycles-practices-logs.component.html',
|
|
6783
6835
|
styleUrls: ['./cycles-practices-logs.component.scss']
|
|
6784
6836
|
}]
|
|
6785
|
-
}],
|
|
6837
|
+
}], propDecorators: { cycle: [{
|
|
6786
6838
|
type: i0.Input
|
|
6787
6839
|
}], originalValues: [{
|
|
6788
6840
|
type: i0.Input
|
|
@@ -6802,7 +6854,6 @@
|
|
|
6802
6854
|
function CyclesPracticesComponent() {
|
|
6803
6855
|
this.originalValues = [];
|
|
6804
6856
|
this.cycles = [];
|
|
6805
|
-
this.selected = [];
|
|
6806
6857
|
this.baseUrl = baseUrl();
|
|
6807
6858
|
this.propertyValue = term.propertyValue;
|
|
6808
6859
|
this.defaultLabel = defaultLabel;
|
|
@@ -6838,9 +6889,6 @@
|
|
|
6838
6889
|
CyclesPracticesComponent.prototype.togglePopover = function (popover, context) {
|
|
6839
6890
|
return popover.isOpen() ? popover.close() : popover.open(context);
|
|
6840
6891
|
};
|
|
6841
|
-
CyclesPracticesComponent.prototype.isSelected = function (cycle) {
|
|
6842
|
-
return this.selected.length === 0 || this.selected.includes(cycle['@id']);
|
|
6843
|
-
};
|
|
6844
6892
|
Object.defineProperty(CyclesPracticesComponent.prototype, "showTimeline", {
|
|
6845
6893
|
get: function () {
|
|
6846
6894
|
return (this.cycles[0].practices || []).some(function (p) { var _a; return timelineTermType.includes((_a = p.term) === null || _a === void 0 ? void 0 : _a.termType); });
|
|
@@ -6859,7 +6907,7 @@
|
|
|
6859
6907
|
return CyclesPracticesComponent;
|
|
6860
6908
|
}());
|
|
6861
6909
|
CyclesPracticesComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesPracticesComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
6862
|
-
CyclesPracticesComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesPracticesComponent, selector: "he-cycles-practices", inputs: { originalValues: "originalValues", cycles: "cycles",
|
|
6910
|
+
CyclesPracticesComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesPracticesComponent, selector: "he-cycles-practices", inputs: { originalValues: "originalValues", cycles: "cycles", dataState: "dataState" }, usesOnChanges: true, ngImport: i0__namespace, template: "<div class=\"columns is-variable is-align-items-center is-2 m-0\">\n <div class=\"column is-hidden-mobile\"></div>\n <ng-container *ngIf=\"selectedView === View.table && practices.length\">\n <div class=\"column is-narrow\">\n <button class=\"button is-dark is-outlined is-small\" (click)=\"showDownload = true\">\n <fa-icon icon=\"download\"></fa-icon>\n <span class=\"pl-2\">Download (CSV)</span>\n </button>\n </div>\n <div class=\"column is-narrow col-sep\"></div>\n </ng-container>\n <div class=\"column is-narrow\" *ngIf=\"showTimeline || !isOriginal\">\n <div class=\"field has-addons\">\n <div class=\"control\">\n <button class=\"button is-small\" [class.is-active]=\"selectedView === View.table\" (click)=\"selectedView = View.table\">\n <span class=\"icon is-small\">\n <fa-icon icon=\"list\" aria-hidden=\"true\"></fa-icon>\n </span>\n <span>Table view</span>\n </button>\n </div>\n <div class=\"control\" *ngIf=\"showTimeline\">\n <button class=\"button is-small\" [class.is-active]=\"selectedView === View.timeline\" (click)=\"selectedView = View.timeline\">\n <span class=\"icon is-small\">\n <fa-icon icon=\"list-alt\" aria-hidden=\"true\"></fa-icon>\n </span>\n <span>Operations timeline</span>\n </button>\n </div>\n <div class=\"control\" *ngIf=\"!isOriginal\">\n <button class=\"button is-small\" [class.is-active]=\"selectedView === View.logs\" (click)=\"selectedView = View.logs\">\n <span class=\"icon is-small\">\n <fa-icon icon=\"calculator\" aria-hidden=\"true\"></fa-icon>\n </span>\n <span>Recalculations logs</span>\n </button>\n </div>\n </div>\n </div>\n</div>\n\n<div class=\"px-3 pb-3\" [class.is-hidden]=\"selectedView !== View.table\">\n <ng-container *ngIf=\"practices.length; else emptyTable\">\n <he-data-table class=\"mb-1 is-small\" [small]=\"true\" [nbRows]=\"cycles.length\" maxHeight=\"320\">\n <table class=\"table is-narrow is-striped\">\n <thead>\n <tr>\n <th class=\"width-auto\"></th>\n <th class=\"has-border-right\"></th>\n <th *ngFor=\"let practice of practices\"\n [attr.title]=\"practice.value.term.name\"\n >\n <he-node-link [node]=\"practice.value.term\">\n <span>{{practice.value.term.name | ellipsis:30}}</span>\n </he-node-link>\n </th>\n </tr>\n <tr>\n <th class=\"width-auto\"></th>\n <th class=\"has-border-right\">\n <a [href]=\"baseUrl + '/schema/Cycle#functionalUnit'\" target=\"_blank\">Functional unit</a>\n </th>\n <th *ngFor=\"let practice of practices\"\n [attr.title]=\"practice.value.term.units\"\n >{{practice.value.term.units}}</th>\n </tr>\n </thead>\n <tbody>\n <ng-container *ngFor=\"let cycle of cycles; trackBy: trackById; let i = index\">\n <tr>\n <td class=\"width-auto\" [attr.title]=\"defaultLabel(cycle)\">\n <he-node-link [node]=\"cycle.term || cycle\">\n <span class=\"is-nowrap has-text-ellipsis\">{{i + 1}}. {{defaultLabel(cycle)}}</span>\n </he-node-link>\n </td>\n <td class=\"has-border-right\">\n <he-cycles-functional-unit-measure [cycle]=\"cycles[0]\"></he-cycles-functional-unit-measure>\n </td>\n <td class=\"is-nowrap\" *ngFor=\"let practice of practices\">\n <span *ngIf=\"practice.value.values[cycle['@id']]; else emptyValue\"\n class=\"trigger-popover\"\n [ngbPopover]=\"details\" [autoClose]=\"'outside'\"\n triggers=\"manual\" #p=\"ngbPopover\" placement=\"left\" container=\"body\"\n (click)=\"togglePopover(p, { data: practice.value.values[cycle['@id']], cycle: cycle, key: 'practices' })\"\n >\n <span pointer>{{propertyValue(practice.value.values[cycle['@id']].value, practice.value.term['@id']) | precision:3 | default:'-'}}</span>\n <he-blank-node-state class=\"ml-1\"\n [node]=\"practice.value.values[cycle['@id']].node\"\n key=\"value\"\n ></he-blank-node-state>\n </span>\n </td>\n </tr>\n </ng-container>\n </tbody>\n </table>\n </he-data-table>\n\n <he-blank-node-state-notice [dataState]=\"dataState\" [showDeleted]=\"true\"></he-blank-node-state-notice>\n </ng-container>\n</div>\n\n<div class=\"px-3 pb-3\" *ngIf=\"selectedView === View.timeline\">\n <he-cycles-practices-timeline\n [cycle]=\"cycles[0]\" [filterTermTypes]=\"timelineTermType\"\n ></he-cycles-practices-timeline>\n\n <he-blank-node-state-notice [dataState]=\"dataState\" [showDeleted]=\"true\"></he-blank-node-state-notice>\n</div>\n\n<ng-container *ngIf=\"selectedView === View.logs && !isOriginal\">\n <div class=\"field has-addons pt-2 px-3\" *ngIf=\"cycles.length > 1\">\n <div class=\"control\">\n <span class=\"button is-small is-static\">Select a Cycle</span>\n </div>\n <div class=\"control is-expanded\">\n <div class=\"select is-small is-fullwidth\">\n <select (change)=\"selectIndex($event)\">\n <option *ngFor=\"let value of cycles; let i = index\" [value]=\"i\">{{i + 1}}. {{defaultLabel(value)}}</option>\n </select>\n </div>\n </div>\n </div>\n\n <he-cycles-practices-logs *ngIf=\"selectedIndex >= 0\"\n [cycle]=\"cycles[selectedIndex]\"\n [originalValues]=\"originalValues[selectedIndex]?.practices\"\n [recalculatedValues]=\"cycles[selectedIndex]?.practices\"\n ></he-cycles-practices-logs>\n</ng-container>\n\n<he-node-csv-export-confirm *ngIf=\"showDownload\"\n [nodes]=\"cycles\" filename=\"cycle-practices.csv\" [isUpload]=\"false\"\n [headerKeys]=\"['cycle.id', 'cycle.@id', 'cycle.practices.']\"\n (closed)=\"showDownload = false\"\n></he-node-csv-export-confirm>\n\n<ng-template #emptyTable>\n <div class=\"has-text-centered\">\n <span>No data</span>\n </div>\n</ng-template>\n\n<ng-template #emptyValue>\n <span>-</span>\n</ng-template>\n\n<ng-template #details let-node=\"cycle\" let-data=\"data\" let-key=\"key\">\n <p><b>{{defaultLabel(node)}}</b></p>\n <he-node-value-details\n [data]=\"data\" [nodeType]=\"node['@type']\" [dataKey]=\"key\"\n ></he-node-value-details>\n</ng-template>\n", styles: ["fa-icon{display:inline-block;width:10px}he-data-table ::ng-deep .table thead tr th:nth-child(2),he-data-table ::ng-deep .table tbody tr td:nth-child(2){max-width:102px;width:102px}\n"], components: [{ type: i1__namespace.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }, { type: DataTableComponent, selector: "he-data-table", inputs: ["minHeight", "maxHeight", "nbRows", "small", "height", "width"] }, { type: NodeLinkComponent, selector: "he-node-link", inputs: ["node", "showExternalLink"] }, { type: CyclesFunctionalUnitMeasureComponent, selector: "he-cycles-functional-unit-measure", inputs: ["cycle"] }, { type: BlankNodeStateComponent, selector: "he-blank-node-state", inputs: ["nodeType", "dataKey", "key", "node", "state"] }, { type: BlankNodeStateNoticeComponent, selector: "he-blank-node-state-notice", inputs: ["dataState", "showAggregated", "showDeleted", "showUnchanged"] }, { type: CyclesPracticesTimelineComponent, selector: "he-cycles-practices-timeline", inputs: ["filterTermTypes", "cycle"] }, { type: CyclesPracticesLogsComponent, selector: "he-cycles-practices-logs", inputs: ["cycle", "originalValues", "recalculatedValues"] }, { type: NodeCsvExportConfirmComponent, selector: "he-node-csv-export-confirm", inputs: ["nodes", "filename", "headerKeys", "extension", "isUpload"], outputs: ["closed"] }, { type: NodeValueDetailsComponent, selector: "he-node-value-details", inputs: ["data", "nodeType", "dataKey"] }], directives: [{ type: i2__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i11__namespace.NgbPopover, selector: "[ngbPopover]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disablePopover", "popoverClass", "openDelay", "closeDelay", "ngbPopover", "popoverTitle"], outputs: ["shown", "hidden"], exportAs: ["ngbPopover"] }, { type: i1__namespace$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1__namespace$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }], pipes: { "ellipsis": EllipsisPipe, "default": DefaultPipe, "precision": PrecisionPipe } });
|
|
6863
6911
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesPracticesComponent, decorators: [{
|
|
6864
6912
|
type: i0.Component,
|
|
6865
6913
|
args: [{
|
|
@@ -6871,8 +6919,6 @@
|
|
|
6871
6919
|
type: i0.Input
|
|
6872
6920
|
}], cycles: [{
|
|
6873
6921
|
type: i0.Input
|
|
6874
|
-
}], selected: [{
|
|
6875
|
-
type: i0.Input
|
|
6876
6922
|
}], dataState: [{
|
|
6877
6923
|
type: i0.Input
|
|
6878
6924
|
}] } });
|
|
@@ -6881,7 +6927,6 @@
|
|
|
6881
6927
|
function CyclesResultComponent(ngZone) {
|
|
6882
6928
|
this.ngZone = ngZone;
|
|
6883
6929
|
this.cycles = [];
|
|
6884
|
-
this.selected = [];
|
|
6885
6930
|
}
|
|
6886
6931
|
CyclesResultComponent.prototype.ngAfterViewInit = function () {
|
|
6887
6932
|
chart_js.Chart.scaleService.updateScaleDefaults('category', {
|
|
@@ -6899,23 +6944,15 @@
|
|
|
6899
6944
|
return this.init();
|
|
6900
6945
|
}
|
|
6901
6946
|
};
|
|
6902
|
-
CyclesResultComponent.prototype.isSelected = function (cycle) {
|
|
6903
|
-
return this.selected.length === 0 || this.selected.includes(cycle['@id']);
|
|
6904
|
-
};
|
|
6905
6947
|
CyclesResultComponent.prototype.init = function () {
|
|
6906
6948
|
var _this = this;
|
|
6907
6949
|
var labels = this.cycles
|
|
6908
6950
|
.map(function (cycle, index) { return ({ cycle: cycle, index: index }); })
|
|
6909
|
-
.filter(function (_b) {
|
|
6910
|
-
var cycle = _b.cycle;
|
|
6911
|
-
return _this.isSelected(cycle);
|
|
6912
|
-
})
|
|
6913
6951
|
.map(function (_b) {
|
|
6914
6952
|
var cycle = _b.cycle, index = _b.index;
|
|
6915
6953
|
return index + 1 + ". " + defaultLabel(cycle);
|
|
6916
6954
|
});
|
|
6917
|
-
var
|
|
6918
|
-
var productsPerCycle = groupNodesByTerm(cycles, 'products');
|
|
6955
|
+
var productsPerCycle = groupNodesByTerm(this.cycles, 'products');
|
|
6919
6956
|
var datasets = Object.values(productsPerCycle).map(function (_b, index) {
|
|
6920
6957
|
var _c = _b.term, name = _c.name, units = _c.units, termId = _c["@id"], values = _b.values;
|
|
6921
6958
|
var color = itemColor(index);
|
|
@@ -6924,7 +6961,7 @@
|
|
|
6924
6961
|
backgroundColor: color,
|
|
6925
6962
|
borderColor: color,
|
|
6926
6963
|
barPercentage: 0.5,
|
|
6927
|
-
data: cycles.map(function (_b) {
|
|
6964
|
+
data: _this.cycles.map(function (_b) {
|
|
6928
6965
|
var id = _b["@id"];
|
|
6929
6966
|
return values[id] ? term.propertyValue(values[id].value, termId) : 0;
|
|
6930
6967
|
})
|
|
@@ -6976,7 +7013,7 @@
|
|
|
6976
7013
|
return CyclesResultComponent;
|
|
6977
7014
|
}());
|
|
6978
7015
|
CyclesResultComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesResultComponent, deps: [{ token: i0__namespace.NgZone }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
6979
|
-
CyclesResultComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesResultComponent, selector: "he-cycles-result", inputs: { cycles: "cycles"
|
|
7016
|
+
CyclesResultComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesResultComponent, selector: "he-cycles-result", inputs: { cycles: "cycles" }, viewQueries: [{ propertyName: "chartRef", first: true, predicate: ["chart"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div class=\"chart-container\">\n <canvas #chart>{{chart}}</canvas>\n</div>\n", styles: [":host{display:block}.chart-container{height:100%;min-height:300px;position:relative}\n"], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
6980
7017
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesResultComponent, decorators: [{
|
|
6981
7018
|
type: i0.Component,
|
|
6982
7019
|
args: [{
|
|
@@ -6990,8 +7027,6 @@
|
|
|
6990
7027
|
args: ['chart']
|
|
6991
7028
|
}], cycles: [{
|
|
6992
7029
|
type: i0.Input
|
|
6993
|
-
}], selected: [{
|
|
6994
|
-
type: i0.Input
|
|
6995
7030
|
}] } });
|
|
6996
7031
|
|
|
6997
7032
|
var components$4 = [
|
|
@@ -8172,7 +8207,6 @@
|
|
|
8172
8207
|
this.loaded = false;
|
|
8173
8208
|
this.loadPolygons = true;
|
|
8174
8209
|
this.sites = [];
|
|
8175
|
-
this.selected = [];
|
|
8176
8210
|
this.nodes = [];
|
|
8177
8211
|
this.center = defaultCenter;
|
|
8178
8212
|
this.zoom = 2;
|
|
@@ -8190,9 +8224,6 @@
|
|
|
8190
8224
|
SitesMapsComponent.prototype.ngAfterViewInit = function () {
|
|
8191
8225
|
return this.googleLoaded && this.map && this.loadData();
|
|
8192
8226
|
};
|
|
8193
|
-
SitesMapsComponent.prototype.isSelected = function (site) {
|
|
8194
|
-
return this.selected.length === 0 || this.selected.includes(site['@id']);
|
|
8195
|
-
};
|
|
8196
8227
|
SitesMapsComponent.prototype.loadData = function () {
|
|
8197
8228
|
return __awaiter(this, void 0, void 0, function () {
|
|
8198
8229
|
var sites, markers, polygons, termPolygons;
|
|
@@ -8323,7 +8354,7 @@
|
|
|
8323
8354
|
SitesMapsComponent.prototype.getSites = function () {
|
|
8324
8355
|
var _this = this;
|
|
8325
8356
|
var _a;
|
|
8326
|
-
var nodes = ((_a = this.sites) === null || _a === void 0 ? void 0 : _a.length) ? this.sites
|
|
8357
|
+
var nodes = ((_a = this.sites) === null || _a === void 0 ? void 0 : _a.length) ? this.sites : this.nodes;
|
|
8327
8358
|
return Promise.all(nodes.map(function (node) { return _this.siteData(node); }));
|
|
8328
8359
|
};
|
|
8329
8360
|
SitesMapsComponent.prototype.termPolygons = function (id) {
|
|
@@ -8352,7 +8383,7 @@
|
|
|
8352
8383
|
return SitesMapsComponent;
|
|
8353
8384
|
}());
|
|
8354
8385
|
SitesMapsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SitesMapsComponent, deps: [{ token: HeNodeService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
8355
|
-
SitesMapsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SitesMapsComponent, selector: "he-sites-maps", inputs: { loadPolygons: "loadPolygons", sites: "sites",
|
|
8386
|
+
SitesMapsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SitesMapsComponent, selector: "he-sites-maps", inputs: { loadPolygons: "loadPolygons", sites: "sites", nodes: "nodes", center: "center", zoom: "zoom", showNotice: "showNotice" }, viewQueries: [{ propertyName: "map", first: true, predicate: i1$4.GoogleMap, descendants: true }], ngImport: i0__namespace, template: "<google-map *ngIf=\"googleLoaded\"\n height=\"100%\"\n width=\"100%\"\n [zoom]=\"zoom\"\n [center]=\"center\"\n></google-map>\n\n<p *ngIf=\"showNotice\" class=\"mt-2 is-italic is-size-7\">The information provided might not be complete</p>\n\n<div class=\"no-location has-text-center has-text-light\" *ngIf=\"showNoLocation\">\n <span>No precise location data</span>\n</div>\n", styles: [":host{display:block;height:100%;position:relative;width:100%}.no-location{background-color:#0000004d;left:0;height:100%;position:absolute;top:0;width:100%;z-index:9}.no-location>span{display:inline-block;margin-top:12%}\n"], components: [{ type: i1__namespace$4.GoogleMap, selector: "google-map", inputs: ["height", "width", "center", "zoom", "options", "mapTypeId"], outputs: ["authFailure", "boundsChanged", "centerChanged", "mapClick", "mapDblclick", "mapDrag", "mapDragend", "mapDragstart", "headingChanged", "idle", "maptypeidChanged", "mapMousemove", "mapMouseout", "mapMouseover", "projectionChanged", "mapRightclick", "tilesloaded", "tiltChanged", "zoomChanged"], exportAs: ["googleMap"] }], directives: [{ type: i2__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
8356
8387
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SitesMapsComponent, decorators: [{
|
|
8357
8388
|
type: i0.Component,
|
|
8358
8389
|
args: [{
|
|
@@ -8368,8 +8399,6 @@
|
|
|
8368
8399
|
type: i0.Input
|
|
8369
8400
|
}], sites: [{
|
|
8370
8401
|
type: i0.Input
|
|
8371
|
-
}], selected: [{
|
|
8372
|
-
type: i0.Input
|
|
8373
8402
|
}], nodes: [{
|
|
8374
8403
|
type: i0.Input
|
|
8375
8404
|
}], center: [{
|
|
@@ -8406,9 +8435,8 @@
|
|
|
8406
8435
|
};
|
|
8407
8436
|
|
|
8408
8437
|
var SitesMeasurementsLogsComponent = /** @class */ (function () {
|
|
8409
|
-
function SitesMeasurementsLogsComponent(searchService
|
|
8438
|
+
function SitesMeasurementsLogsComponent(searchService) {
|
|
8410
8439
|
this.searchService = searchService;
|
|
8411
|
-
this.nodeService = nodeService;
|
|
8412
8440
|
this.originalValues = [];
|
|
8413
8441
|
this.recalculatedValues = [];
|
|
8414
8442
|
this.loading = true;
|
|
@@ -8419,29 +8447,23 @@
|
|
|
8419
8447
|
}
|
|
8420
8448
|
SitesMeasurementsLogsComponent.prototype.ngOnInit = function () {
|
|
8421
8449
|
return __awaiter(this, void 0, void 0, function () {
|
|
8422
|
-
var
|
|
8423
|
-
return __generator(this, function (
|
|
8424
|
-
switch (
|
|
8425
|
-
case 0:
|
|
8426
|
-
|
|
8427
|
-
|
|
8428
|
-
|
|
8429
|
-
|
|
8430
|
-
|
|
8431
|
-
|
|
8432
|
-
|
|
8433
|
-
|
|
8434
|
-
query: {
|
|
8435
|
-
bool: {
|
|
8436
|
-
must: [
|
|
8437
|
-
matchType(schema.NodeType.Term),
|
|
8438
|
-
matchTermType(schema.TermTermType.measurement)
|
|
8439
|
-
]
|
|
8440
|
-
}
|
|
8450
|
+
var measurements;
|
|
8451
|
+
return __generator(this, function (_a) {
|
|
8452
|
+
switch (_a.label) {
|
|
8453
|
+
case 0: return [4 /*yield*/, this.searchService.search({
|
|
8454
|
+
fields: ['@type', '@id', 'name', 'units'],
|
|
8455
|
+
limit: 1000,
|
|
8456
|
+
query: {
|
|
8457
|
+
bool: {
|
|
8458
|
+
must: [
|
|
8459
|
+
matchType(schema.NodeType.Term),
|
|
8460
|
+
matchTermType(schema.TermTermType.measurement)
|
|
8461
|
+
]
|
|
8441
8462
|
}
|
|
8442
|
-
}
|
|
8443
|
-
|
|
8444
|
-
|
|
8463
|
+
}
|
|
8464
|
+
})];
|
|
8465
|
+
case 1:
|
|
8466
|
+
measurements = (_a.sent()).results;
|
|
8445
8467
|
this.measurements = measurements;
|
|
8446
8468
|
this.loading = false;
|
|
8447
8469
|
return [2 /*return*/];
|
|
@@ -8458,8 +8480,8 @@
|
|
|
8458
8480
|
});
|
|
8459
8481
|
return SitesMeasurementsLogsComponent;
|
|
8460
8482
|
}());
|
|
8461
|
-
SitesMeasurementsLogsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SitesMeasurementsLogsComponent, deps: [{ token: HeSearchService }
|
|
8462
|
-
SitesMeasurementsLogsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SitesMeasurementsLogsComponent, selector: "he-sites-measurements-logs", inputs: { site: "site", originalValues: "originalValues", recalculatedValues: "recalculatedValues" }, ngImport: i0__namespace, template: "<he-node-logs-models *ngIf=\"!loading; else loader\"\n [
|
|
8483
|
+
SitesMeasurementsLogsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SitesMeasurementsLogsComponent, deps: [{ token: HeSearchService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
8484
|
+
SitesMeasurementsLogsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SitesMeasurementsLogsComponent, selector: "he-sites-measurements-logs", inputs: { site: "site", originalValues: "originalValues", recalculatedValues: "recalculatedValues" }, ngImport: i0__namespace, template: "<he-node-logs-models *ngIf=\"!loading; else loader\"\n [node]=\"node\"\n [originalValues]=\"originalValues\"\n [recalculatedValues]=\"recalculatedValues\"\n [terms]=\"measurements\"\n [filterTermTypes]=\"[TermTermType.measurement]\"\n></he-node-logs-models>\n\n<ng-template #loader>\n <div class=\"has-text-center py-3\">\n <fa-icon icon=\"spinner\" [pulse]=\"true\" size=\"lg\"></fa-icon>\n </div>\n</ng-template>\n", styles: [""], components: [{ type: NodeLogsModelsComponent, selector: "he-node-logs-models", inputs: ["node", "nodeKey", "includeAllModels", "originalValues", "recalculatedValues", "terms", "filterTermTypes", "logsKey"] }, { type: i1__namespace.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }], directives: [{ type: i2__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
8463
8485
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SitesMeasurementsLogsComponent, decorators: [{
|
|
8464
8486
|
type: i0.Component,
|
|
8465
8487
|
args: [{
|
|
@@ -8467,7 +8489,7 @@
|
|
|
8467
8489
|
templateUrl: './sites-measurements-logs.component.html',
|
|
8468
8490
|
styleUrls: ['./sites-measurements-logs.component.scss']
|
|
8469
8491
|
}]
|
|
8470
|
-
}], ctorParameters: function () { return [{ type: HeSearchService }
|
|
8492
|
+
}], ctorParameters: function () { return [{ type: HeSearchService }]; }, propDecorators: { site: [{
|
|
8471
8493
|
type: i0.Input
|
|
8472
8494
|
}], originalValues: [{
|
|
8473
8495
|
type: i0.Input
|
|
@@ -8485,7 +8507,6 @@
|
|
|
8485
8507
|
function SitesMeasurementsComponent() {
|
|
8486
8508
|
this.originalValues = [];
|
|
8487
8509
|
this.sites = [];
|
|
8488
|
-
this.selected = [];
|
|
8489
8510
|
this.showDownload = false;
|
|
8490
8511
|
this.View = View$1;
|
|
8491
8512
|
this.selectedView = View$1.table;
|
|
@@ -8528,9 +8549,6 @@
|
|
|
8528
8549
|
enumerable: false,
|
|
8529
8550
|
configurable: true
|
|
8530
8551
|
});
|
|
8531
|
-
SitesMeasurementsComponent.prototype.isSelected = function (site) {
|
|
8532
|
-
return this.selected.length === 0 || this.selected.includes(site['@id']);
|
|
8533
|
-
};
|
|
8534
8552
|
// Recalculation logs
|
|
8535
8553
|
SitesMeasurementsComponent.prototype.selectIndex = function (_a) {
|
|
8536
8554
|
var _this = this;
|
|
@@ -8542,7 +8560,7 @@
|
|
|
8542
8560
|
return SitesMeasurementsComponent;
|
|
8543
8561
|
}());
|
|
8544
8562
|
SitesMeasurementsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SitesMeasurementsComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
8545
|
-
SitesMeasurementsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SitesMeasurementsComponent, selector: "he-sites-measurements", inputs: { originalValues: "originalValues", sites: "sites",
|
|
8563
|
+
SitesMeasurementsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SitesMeasurementsComponent, selector: "he-sites-measurements", inputs: { originalValues: "originalValues", sites: "sites", dataState: "dataState" }, usesOnChanges: true, ngImport: i0__namespace, template: "<div class=\"columns is-variable is-align-items-center is-2 m-0\">\n <div class=\"column is-hidden-mobile\"></div>\n <ng-container *ngIf=\"selectedView === View.table && measurements.length\">\n <div class=\"column is-narrow\">\n <button class=\"button is-dark is-outlined is-small\" (click)=\"showDownload = true\">\n <fa-icon icon=\"download\"></fa-icon>\n <span class=\"pl-2\">Download (CSV)</span>\n </button>\n </div>\n <div class=\"column is-narrow col-sep\"></div>\n </ng-container>\n <div class=\"column is-narrow\" *ngIf=\"!isOriginal\">\n <div class=\"field has-addons\">\n <div class=\"control\">\n <button class=\"button is-small\" [class.is-active]=\"selectedView === View.table\" (click)=\"selectedView = View.table\">\n <span class=\"icon is-small\">\n <fa-icon icon=\"list\" aria-hidden=\"true\"></fa-icon>\n </span>\n <span>Table view</span>\n </button>\n </div>\n <div class=\"control\">\n <button class=\"button is-small\" [class.is-active]=\"selectedView === View.logs\" (click)=\"selectedView = View.logs\">\n <span class=\"icon is-small\">\n <fa-icon icon=\"calculator\" aria-hidden=\"true\"></fa-icon>\n </span>\n <span>Recalculations logs</span>\n </button>\n </div>\n </div>\n </div>\n</div>\n\n<div class=\"px-3 pb-3\" [class.is-hidden]=\"selectedView !== View.table\">\n <ng-container *ngIf=\"measurements.length; else emptyTable\">\n <he-data-table class=\"mb-1 is-small\" [small]=\"true\" [nbRows]=\"sites.length\" maxHeight=\"320\">\n <table class=\"table is-narrow is-striped\">\n <thead>\n <tr>\n <th class=\"width-auto\"></th>\n <th *ngFor=\"let measurement of measurements\"\n [attr.title]=\"measurement.value.term.name\"\n >\n <he-node-link [node]=\"measurement.value.term\">\n <span>{{measurement.value.term.name | ellipsis:30}}</span>\n </he-node-link>\n </th>\n </tr>\n <tr>\n <th class=\"width-auto\"></th>\n <th *ngFor=\"let measurement of measurements\"\n [attr.title]=\"measurement.value.term.units\"\n >{{measurement.value.term.units}}</th>\n </tr>\n </thead>\n <tbody>\n <ng-container *ngFor=\"let site of sites; trackBy: trackById; let i = index\">\n <tr>\n <td class=\"width-auto\" [attr.title]=\"defaultLabel(site)\">\n <he-node-link [node]=\"site\">\n <span class=\"is-nowrap has-text-ellipsis\">{{i + 1}}. {{defaultLabel(site)}}</span>\n </he-node-link>\n </td>\n <td class=\"is-nowrap\" *ngFor=\"let measurement of measurements\">\n <span *ngIf=\"measurement.value.values[site['@id']]\"\n class=\"trigger-popover\"\n [ngbPopover]=\"details\" [autoClose]=\"'outside'\"\n triggers=\"manual\" #p=\"ngbPopover\" placement=\"left\" container=\"body\"\n (click)=\"togglePopover(p, { data: measurement.value.values[site['@id']], site: site, key: 'measurements' })\"\n >\n <span pointer>{{measurementValue(measurement.value.values[site['@id']], measurement.value.term['@id']) | precision:3 | default:'-'}}</span>\n <he-blank-node-state class=\"ml-1\"\n [node]=\"measurement.value.values[site['@id']].node\"\n key=\"value\"\n ></he-blank-node-state>\n </span>\n <span *ngIf=\"!measurement.value.values[site['@id']]\">\n <span>-</span>\n <sup class=\"pl-1\" *ngIf=\"siteTooBig(site)\">(1)</sup>\n </span>\n </td>\n </tr>\n </ng-container>\n </tbody>\n </table>\n </he-data-table>\n\n <he-blank-node-state-notice [dataState]=\"dataState\"></he-blank-node-state-notice>\n\n <p class=\"is-size-7 is-italic\" *ngIf=\"showAreaTooBig\">\n (1) This region is >{{maxAreaSize}}km2 and is too large to reliably gap fill Measurements.\n </p>\n </ng-container>\n</div>\n\n<ng-container *ngIf=\"selectedView === View.logs && !isOriginal\">\n <div class=\"field has-addons pt-2 px-3\" *ngIf=\"sites.length > 1\">\n <div class=\"control\">\n <span class=\"button is-small is-static\">Select a Site</span>\n </div>\n <div class=\"control is-expanded\">\n <div class=\"select is-small is-fullwidth\">\n <select (change)=\"selectIndex($event)\">\n <option *ngFor=\"let value of sites; let i = index\" [value]=\"i\">{{i + 1}}. {{defaultLabel(value)}}</option>\n </select>\n </div>\n </div>\n </div>\n\n <he-sites-measurements-logs *ngIf=\"selectedIndex >= 0\"\n [site]=\"sites[selectedIndex]\"\n [originalValues]=\"originalValues[selectedIndex]?.measurements\"\n [recalculatedValues]=\"sites[selectedIndex]?.measurements\"\n ></he-sites-measurements-logs>\n</ng-container>\n\n<he-node-csv-export-confirm *ngIf=\"showDownload\"\n [nodes]=\"sites\" filename=\"site-measurements.csv\" [isUpload]=\"false\"\n [headerKeys]=\"['site.id', 'site.@id', 'site.measurements.']\"\n (closed)=\"showDownload = false\"\n></he-node-csv-export-confirm>\n\n<ng-template #emptyTable>\n <div class=\"has-text-centered\">\n <span>No data</span>\n </div>\n</ng-template>\n\n<ng-template #emptyValue>\n <span>-</span>\n</ng-template>\n\n<ng-template #details let-node=\"site\" let-data=\"data\" let-key=\"key\">\n <p><b>{{node.name}}</b></p>\n <he-node-value-details\n [data]=\"data\" [nodeType]=\"node['@type']\" [dataKey]=\"key\"\n ></he-node-value-details>\n</ng-template>\n", styles: ["fa-icon{display:inline-block;width:10px}\n"], components: [{ type: i1__namespace.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }, { type: DataTableComponent, selector: "he-data-table", inputs: ["minHeight", "maxHeight", "nbRows", "small", "height", "width"] }, { type: NodeLinkComponent, selector: "he-node-link", inputs: ["node", "showExternalLink"] }, { type: BlankNodeStateComponent, selector: "he-blank-node-state", inputs: ["nodeType", "dataKey", "key", "node", "state"] }, { type: BlankNodeStateNoticeComponent, selector: "he-blank-node-state-notice", inputs: ["dataState", "showAggregated", "showDeleted", "showUnchanged"] }, { type: SitesMeasurementsLogsComponent, selector: "he-sites-measurements-logs", inputs: ["site", "originalValues", "recalculatedValues"] }, { type: NodeCsvExportConfirmComponent, selector: "he-node-csv-export-confirm", inputs: ["nodes", "filename", "headerKeys", "extension", "isUpload"], outputs: ["closed"] }, { type: NodeValueDetailsComponent, selector: "he-node-value-details", inputs: ["data", "nodeType", "dataKey"] }], directives: [{ type: i2__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i11__namespace.NgbPopover, selector: "[ngbPopover]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disablePopover", "popoverClass", "openDelay", "closeDelay", "ngbPopover", "popoverTitle"], outputs: ["shown", "hidden"], exportAs: ["ngbPopover"] }, { type: i1__namespace$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1__namespace$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }], pipes: { "ellipsis": EllipsisPipe, "default": DefaultPipe, "precision": PrecisionPipe } });
|
|
8546
8564
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SitesMeasurementsComponent, decorators: [{
|
|
8547
8565
|
type: i0.Component,
|
|
8548
8566
|
args: [{
|
|
@@ -8554,8 +8572,6 @@
|
|
|
8554
8572
|
type: i0.Input
|
|
8555
8573
|
}], sites: [{
|
|
8556
8574
|
type: i0.Input
|
|
8557
|
-
}], selected: [{
|
|
8558
|
-
type: i0.Input
|
|
8559
8575
|
}], dataState: [{
|
|
8560
8576
|
type: i0.Input
|
|
8561
8577
|
}] } });
|
|
@@ -9099,7 +9115,7 @@
|
|
|
9099
9115
|
return FilesFormComponent;
|
|
9100
9116
|
}());
|
|
9101
9117
|
FilesFormComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FilesFormComponent, deps: [{ token: i0__namespace.ElementRef }, { token: HeSearchService }, { token: HeUsersService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
9102
|
-
FilesFormComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FilesFormComponent, selector: "he-files-form", inputs: { schemas: "schemas", errors: "errors", node: "node", nodeMap: "nodeMap", editable: "editable", errorMode: "errorMode", deepEditable: "deepEditable", errorsEditable: "errorsEditable", showSuggestedDefaultProperties: "showSuggestedDefaultProperties" }, outputs: { nodeChange: "nodeChange", nodeErorrResolved: "nodeErorrResolved", nodeErrorAdded: "nodeErrorAdded" }, ngImport: i0__namespace, template: "<div class=\"card\">\n <div class=\"card-toggle p-4\" (click)=\"isOpen = !isOpen\" pointer>\n <fa-icon icon=\"angle-down\" [class.is-hidden]=\"!isOpen\"></fa-icon>\n <fa-icon icon=\"angle-right\" [class.is-hidden]=\"isOpen\"></fa-icon>\n <span *ngIf=\"nodeProperty\" class=\"is-px-2\"\n [class.has-text-danger]=\"nodeProperty.hasError\"\n [class.has-text-warning]=\"nodeProperty.hasWarning\"\n >\n <he-node-icon [type]=\"nodeProperty.schemaType\"></he-node-icon>\n </span>\n </div>\n\n <ng-container *ngIf=\"editable && isOpen && nodeProperty\">\n <ng-container *ngTemplateOutlet=\"showNewProperty; context: {$implicit: nodeProperty}\"></ng-container>\n </ng-container>\n\n <div class=\"card-content\">\n <ng-container *ngIf=\"isOpen\">\n <div class=\"pb-3 mb-2\" *ngIf=\"errorsEditable\">\n <ng-container *ngTemplateOutlet=\"nodeErrorForm; context: {$implicit: nodeProperty}\"></ng-container>\n </div>\n\n <div class=\"mb-4\" *ngIf=\"nodeProperty?.error\">\n <ng-container *ngTemplateOutlet=\"propertyError; context: {property: nodeProperty, edit: true}\"></ng-container>\n </div>\n </ng-container>\n\n <div class=\"columns is-multiline\">\n <ng-container *ngFor=\"let property of properties; trackBy: trackByProperty\">\n <ng-container *ngTemplateOutlet=\"showProperty; context: {$implicit: property}\"></ng-container>\n </ng-container>\n </div>\n\n <ng-container *ngIf=\"isOpen\">\n <ng-container *ngTemplateOutlet=\"propertyMap; context: {$implicit: nodeProperty}\"></ng-container>\n </ng-container>\n </div>\n\n <ng-content></ng-content>\n</div>\n\n<he-maps-drawing-confirm *ngIf=\"!!mapDrawingProperty\"\n [value]=\"mapDrawingProperty.value\" [modes]=\"mapDrawingModes(mapDrawingProperty)\"\n (closed)=\"onMapDrawingClosed($event)\"\n></he-maps-drawing-confirm>\n\n<he-bibliographies-search-confirm *ngIf=\"!!bibliographiesSearchProperty\"\n [search]=\"bibliographiesSearchProperty.value\"\n [searchBy]=\"bibliographiesSearchKey(bibliographiesSearchProperty)\"\n [searchSources]=\"bibliographiesSearchSources\"\n (closed)=\"onBibliographiesSearchClosed($event)\"\n></he-bibliographies-search-confirm>\n\n<ng-template #labelDescription let-property>\n <span\n class=\"trigger-popover\"\n [ngbPopover]=\"property.schema?.description\" [autoClose]=\"'outside'\"\n triggers=\"hover\" placement=\"right\" container=\"body\"\n >\n <span>{{property.key}}</span>\n </span>\n</ng-template>\n\n<ng-template #labelDefault let-property>\n <span>{{property.key}}</span>\n</ng-template>\n\n<ng-template #showProperty let-property>\n <ng-container *ngIf=\"(isOpen || property.closedVisible) && !property.isHidden\">\n <div class=\"column is-6\"\n [id]=\"property.fullKey + '_' + property.id\"\n [class.is-12]=\"property.properties.length || !property.key\"\n [ngSwitch]=\"!!property.properties.length\"\n >\n <div class=\"columns is-multiline is-variable is-1\" *ngSwitchCase=\"false\">\n <div class=\"column is-3 py-1\" *ngIf=\"property.key\">\n <label class=\"label has-text-right-tablet has-text-ellipsis\"\n *bindOnce=\"property\"\n [for]=\"property.id\"\n >\n <ng-container\n *ngTemplateOutlet=\"property.schema?.description && editable && property.editable ? labelDescription : labelDefault; context: {$implicit: property}\">\n </ng-container>\n </label>\n </div>\n\n <div class=\"column is-9 py-1\" [class.is-12]=\"!property.key\">\n <div class=\"field\">\n <ng-container *ngTemplateOutlet=\"inputForm; context: {$implicit: property}\"></ng-container>\n\n <ng-container *ngIf=\"(editable || errorsEditable) && (property.hasError || property.hasWarning)\">\n <ng-container *ngTemplateOutlet=\"propertyError; context: {property: property, edit: false}\"></ng-container>\n </ng-container>\n </div>\n </div>\n </div>\n\n <div class=\"panel\" *ngSwitchCase=\"true\"\n [class.is-link]=\"errorMode && property.changed\"\n [class.is-danger]=\"!property.changed && property.hasError\"\n [class.is-warning]=\"!property.changed && property.hasWarning\"\n [class.is-default]=\"!property.changed && !property.hasError && !property.hasWarning\"\n >\n <div class=\"open-group panel-heading py-0\"\n (click)=\"property.isOpen = !property.isOpen\" pointer\n [class.is-open]=\"property.isOpen\"\n [class.has-text-white]=\"(errorMode && property.changed) || property.hasError || property.hasWarning\"\n >\n <div class=\"columns is-mobile is-vcentered\">\n <span class=\"column is-narrow py-1 my-0\">\n <fa-icon icon=\"angle-down\" [class.is-hidden]=\"!property.isOpen\"></fa-icon>\n <fa-icon icon=\"angle-right\" [class.is-hidden]=\"property.isOpen\"></fa-icon>\n </span>\n <span class=\"column py-1 my-0\">\n <span class=\"is-size-6\">{{property.key}}</span>\n </span>\n <span *ngIf=\"property.schemaType\" class=\"column is-narrow py-1 my-0\">\n <span class=\"tags mb-0 has-addons\">\n <span class=\"tag mb-0 is-light\">Type</span>\n <span class=\"tag mb-0 is-white\">\n <he-schema-version-link linkClass=\"is-small\" [node]=\"{'@type': property.schemaType}\">\n <span>{{property.schemaType}}</span>\n </he-schema-version-link>\n </span>\n </span>\n </span>\n <he-popover-confirm class=\"column is-narrow py-1 my-0 px-0\"\n *ngIf=\"editable && !errorsEditable\"\n ngbTooltip=\"Remove group\" placement=\"top\"\n [message]=\"'<p>This will remove the group completely.</p>' + (property.isRequired ? '<p><u>Warning: this field is required.</u></p>' : '') + '<p>Do you confirm?</p>'\"\n popoverClass=\"px-3\"\n (confirmed)=\"propertyChanged(null, property)\"\n >\n <fa-icon icon=\"times\" size=\"sm\"></fa-icon>\n </he-popover-confirm>\n </div>\n </div>\n <div class=\"panel-block is-block p-0\" *ngIf=\"property.isOpen\">\n <ng-container [ngSwitch]=\"property.isArray\">\n <div class=\"px-3 pt-4\" *ngIf=\"property.error\">\n <ng-container *ngTemplateOutlet=\"propertyError; context: {property: property, edit: true}\"></ng-container>\n </div>\n\n <div class=\"mt-3\" *ngSwitchCase=\"false\">\n <p class=\"help py-1 px-2\" *ngIf=\"editable && !property.editable\">\n To change the {{property.key}}, please delete it first, then add the field again\n </p>\n <ng-container *ngIf=\"editable && property.editable\">\n <ng-container [ngSwitch]=\"property.schema?.title\">\n <p class=\"help py-1 px-2\" *ngSwitchCase=\"'Bibliography'\">\n Search by Title or Document DOI to auto-populate the fields using the Mendeley catalogue\n </p>\n </ng-container>\n </ng-container>\n\n <ng-container *ngTemplateOutlet=\"showNewProperty; context: {$implicit: property}\"></ng-container>\n\n <div class=\"px-3 mt-1\" *ngIf=\"errorsEditable\">\n <ng-container *ngTemplateOutlet=\"nodeErrorForm; context: {$implicit: property}\"></ng-container>\n </div>\n\n <div class=\"property-group py-2 px-3 mt-2\">\n <div class=\"columns is-multiline mb-0\">\n <ng-container *ngFor=\"let prop2 of property.properties; trackBy: trackByProperty\">\n <ng-container *ngTemplateOutlet=\"showProperty; context: {$implicit: prop2}\"></ng-container>\n </ng-container>\n </div>\n </div>\n </div>\n\n <div class=\"py-2 px-3 mt-2\" *ngSwitchCase=\"true\">\n <div class=\"mt-1\" *ngIf=\"errorsEditable\">\n <ng-container *ngTemplateOutlet=\"nodeErrorForm; context: {$implicit: property}\"></ng-container>\n </div>\n\n <ng-container *ngFor=\"let prop2 of property.properties; trackBy: trackByProperty\">\n <div class=\"card p-0 my-4\" *ngIf=\"prop2.key\"\n [id]=\"prop2.fullKey + '_' + prop2.id\"\n >\n <div class=\"property-array-number\">\n <div class=\"tags has-addons\">\n <span class=\"tag is-dark\">{{prop2.key}}</span>\n <ng-container *ngIf=\"editable && !errorsEditable && property.editable\">\n <span class=\"tag is-info\" pointer\n (click)=\"duplicateArrayGroup(property, prop2)\"\n [ngbTooltip]=\"'Duplicate ' + pluralize(property.key, 1)\" placement=\"top\"\n >\n <fa-icon icon=\"clone\" size=\"sm\"></fa-icon>\n </span>\n <span class=\"tag is-light\" pointer\n *ngIf=\"prop2.key !== '0'\"\n (click)=\"moveArrayGroupUp(property, prop2)\"\n ngbTooltip=\"Move Up\" placement=\"top\"\n >\n <fa-icon icon=\"long-arrow-alt-up\" size=\"sm\"></fa-icon>\n </span>\n <span class=\"tag is-light\" pointer\n *ngIf=\"prop2.key !== property.properties.length - 1\"\n (click)=\"moveArrayGroupDown(property, prop2)\"\n ngbTooltip=\"Move Down\" placement=\"top\"\n >\n <fa-icon icon=\"long-arrow-alt-down\" size=\"sm\"></fa-icon>\n </span>\n <he-popover-confirm class=\"tag is-delete\"\n [ngbTooltip]=\"'Remove ' + pluralize(property.key, 1)\" placement=\"top\"\n message=\"This will remove the group completely. Do you confirm?\" position=\"right\"\n (confirmed)=\"removeArrayGroup(property, prop2)\"\n ></he-popover-confirm>\n </ng-container>\n </div>\n </div>\n\n <ng-container *ngTemplateOutlet=\"showNewProperty; context: {$implicit: prop2}\"></ng-container>\n\n <div class=\"px-4 mt-2\" *ngIf=\"errorsEditable\">\n <ng-container *ngTemplateOutlet=\"nodeErrorForm; context: {$implicit: prop2}\"></ng-container>\n </div>\n\n <div class=\"px-4 mt-2\" *ngIf=\"prop2.error\">\n <ng-container *ngTemplateOutlet=\"propertyError; context: {property: prop2, edit: true}\"></ng-container>\n </div>\n\n <div class=\"property-group card-content p-3\">\n <div class=\"columns is-multiline my-0\">\n <ng-container *ngFor=\"let prop3 of prop2.properties; trackBy: trackByProperty\">\n <ng-container *ngTemplateOutlet=\"showProperty; context: {$implicit: prop3}\"></ng-container>\n </ng-container>\n </div>\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"editable && !errorsEditable\">\n <button class=\"button is-dark is-outlined is-small\" type=\"button\"\n (click)=\"addArrayGroup(property)\"\n >\n <fa-icon icon=\"plus-circle\"></fa-icon>\n <span class=\"pl-2\">Add</span>\n <span class=\"pl-1\">{{property.key | pluralize:1}}</span>\n </button>\n\n <he-node-recommendations buttonClass=\"is-small\"\n [node]=\"node\" [nodeField]=\"property.key\"\n (selectRecommendation)=\"onSelectRecommendation(property, $event)\"\n ></he-node-recommendations>\n </ng-container>\n </div>\n </ng-container>\n </div>\n </div>\n </div>\n </ng-container>\n</ng-template>\n\n<ng-template #inputForm let-property>\n <ng-container *ngIf=\"property.key\">\n <ng-container [ngSwitch]=\"property.suggestions?.type\">\n <ng-container *ngSwitchCase=\"'select'\">\n <ng-container *ngTemplateOutlet=\"inputSelect; context: {$implicit: property}\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <ng-container *ngTemplateOutlet=\"inputInput; context: {$implicit: property}\"></ng-container>\n </ng-container>\n </ng-container>\n </ng-container>\n</ng-template>\n\n<ng-template #inputInput let-property>\n <div class=\"field mb-0\" [class.has-addons]=\"hasAddons(property)\">\n <div class=\"control is-expanded\"\n [class.has-icons-right]=\"property.loading\"\n >\n <input class=\"input is-small search-input\"\n [class.is-dark]=\"property.key === 'type'\"\n [class.is-link]=\"errorMode && property.changed\"\n [class.is-danger]=\"(!property.changed && property.hasError) || isRequired(property)\"\n [class.is-warning]=\"!property.changed && property.hasWarning\"\n\n [(ngModel)]=\"property.value\" #propertyModel=\"ngModel\"\n [type]=\"property.schema?.type === 'number' ? 'number' : 'string'\"\n [id]=\"property.id\"\n name=\"randomname\"\n [readonly]=\"!editable || !property.editable || property.schema?.internal\"\n [placeholder]=\"property.placeholder\"\n [appTagsInput]=\"{enabled: editable && property.editable && property.schema?.type === 'array', items: property.schema?.items, delimiter: ';', allowDuplicates: true, placeholder: property.placeholder}\"\n (change)=\"propertyChanged($event.target.value, property)\"\n\n [pattern]=\"property.schema?.pattern\"\n [required]=\"property.fullKey.endsWith('id') && property.fullKey !== 'id'\"\n [min]=\"property.schema?.minimum\"\n [max]=\"property.schema?.maximum\"\n\n [ngbTypeahead]=\"propertySuggest(property.fullKey, property.suggestions?.type)\"\n [resultTemplate]=\"suggestion\"\n [inputFormatter]=\"formatter\"\n [focusFirst]=\"true\"\n (focus)=\"editable && property.editable && typeaheadFocus($event)\"\n (selectItem)=\"suggestionSelected($event.item, property)\"\n >\n\n <span class=\"icon is-small is-right has-text-grey-dark\" [class.is-hidden]=\"!property.loading\">\n <fa-icon icon=\"spinner\" [pulse]=\"true\" size=\"sm\"></fa-icon>\n </span>\n </div>\n <ng-container *ngTemplateOutlet=\"inputAddons; context: {$implicit: property}\"></ng-container>\n </div>\n <p class=\"help is-danger-light\"\n *ngIf=\"!property.hasError && propertyModel.invalid\"\n >\n <span *bindOnce=\"propertyModel.errors\" [innerHTML]=\"formatPropertyError(propertyModel.errors, property)\"></span>\n </p>\n</ng-template>\n\n<ng-template #inputSelect let-property>\n <div class=\"field mb-0\" [class.has-addons]=\"hasAddons(property)\">\n <div class=\"control is-expanded\">\n <div class=\"select is-small is-fullwidth\"\n [class.is-link]=\"errorMode && property.changed\"\n [class.is-danger]=\"(!property.changed && property.hasError) || isRequired(property)\"\n [class.is-warning]=\"!property.changed && property.hasWarning\"\n >\n <select\n [(ngModel)]=\"property.value\" #propertyModel=\"ngModel\"\n [id]=\"property.id\"\n name=\"randomname\"\n [disabled]=\"!editable || !property.editable || property.schema?.internal\"\n (change)=\"propertyChanged($event.target.value, property)\"\n >\n <option value=\"\">Select</option>\n <ng-container *bindOnce=\"property.suggestions\">\n <option *ngFor=\"let value of property.suggestions.values; trackBy: trackByIndex\" [value]=\"value\">{{value}}</option>\n </ng-container>\n </select>\n </div>\n </div>\n <ng-container *ngTemplateOutlet=\"inputAddons; context: {$implicit: property}\"></ng-container>\n </div>\n</ng-template>\n\n<ng-template #removeFieldAddon let-property>\n <div class=\"control\" *ngIf=\"!errorsEditable && !property.isRequired\">\n <a class=\"button is-small\" title=\"Remove field\"\n [class.is-outlined]=\"!property.changed && (property.hasError || property.hasWarning)\"\n [class.is-danger]=\"!property.changed && property.hasError\"\n [class.is-warning]=\"!property.changed && property.hasWarning\"\n (click)=\"$event.stopPropagation(); propertyChanged(null, property)\"\n >\n <fa-icon icon=\"times\"></fa-icon>\n </a>\n </div>\n</ng-template>\n\n<ng-template #inputAddons let-property>\n <he-popover-confirm class=\"control\"\n *ngIf=\"enableAddError(property)\"\n position=\"left\"\n [content]=\"popupErrorForm\"\n (confirmed)=\"addError(property, $event)\"\n >\n <span class=\"button is-small\">\n <fa-icon icon=\"comments\"></fa-icon>\n </span>\n </he-popover-confirm>\n\n <ng-container *ngIf=\"editable && property.editable\">\n <ng-container [ngSwitch]=\"property.schemaType\">\n <ng-container *ngSwitchCase=\"SchemaType.Actor\">\n <ng-container *ngTemplateOutlet=\"actorAddons; context: {$implicit: property}\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"SchemaType.Cycle\">\n <ng-container *ngTemplateOutlet=\"cycleAddons; context: {$implicit: property}\"></ng-container>\n </ng-container>\n </ng-container>\n <ng-container *bindOnce=\"property\">\n <div class=\"control\" *ngIf=\"mapDrawingModes(property).length\">\n <button class=\"button is-small\" title=\"Pick on Map\"\n (click)=\"mapDrawingProperty = property\"\n >\n <fa-icon icon=\"map-marked-alt\"></fa-icon>\n </button>\n </div>\n <div class=\"control\" *ngIf=\"bibliographiesSearchKey(property)\">\n <button class=\"button is-small\" title=\"Advanced Search\"\n (click)=\"bibliographiesSearchProperty = property\"\n >\n <fa-icon icon=\"search\"></fa-icon>\n </button>\n </div>\n </ng-container>\n\n <ng-container *ngTemplateOutlet=\"removeFieldAddon; context: {$implicit: property}\"></ng-container>\n </ng-container>\n <div class=\"control\" *ngIf=\"addPropertyEnabled(property)\">\n <a class=\"button is-small is-danger\" title=\"Add field\"\n (click)=\"$event.stopPropagation(); addMissingProperty(property)\"\n >\n <fa-icon icon=\"plus-circle\"></fa-icon>\n <span class=\"pl-2\">Add</span>\n </a>\n </div>\n <div class=\"control\" *ngIf=\"isRequired(property)\">\n <label class=\"button is-small is-danger\" [for]=\"property.id\"\n ngbTooltip=\"This field is required\" placement=\"top\"\n >\n <fa-icon icon=\"exclamation-triangle\"></fa-icon>\n </label>\n </div>\n <ng-container *ngIf=\"property.externalUrl?.url\">\n <div class=\"control\">\n <a class=\"button is-small\"\n [href]=\"property.externalUrl.url + (property.externalUrl.urlParamValue ? property.value : '')\"\n target=\"_blank\"\n [title]=\"property.externalUrl.title\"\n [ngClass]=\"{'is-dark is-outlined': property.key === 'type'}\"\n [attr.disabled]=\"property.externalUrl.urlParamValue && !property.value ? true : null\"\n >\n <fa-icon [icon]=\"property.externalUrl.icon || 'external-link-alt'\"></fa-icon>\n </a>\n </div>\n </ng-container>\n <ng-container *ngIf=\"unitConverterEnabled(property)\">\n <div class=\"control\">\n <button class=\"button is-small\" title=\"Open calculator\"\n [ngbPopover]=\"convertUnits\" autoClose=\"outside\"\n triggers=\"manual\" #p=\"ngbPopover\" placement=\"bottom\" container=\"body\"\n (click)=\"openUnitConverter(p, property)\"\n >\n <fa-icon icon=\"calculator\"></fa-icon>\n </button>\n </div>\n </ng-container>\n</ng-template>\n\n<ng-template #actorAddons let-property>\n <div class=\"control\" *ngIf=\"property.key === '@id'\">\n <button class=\"button is-small\" title=\"Add myself as Actor\"\n (click)=\"setUserActorId(property)\"\n >\n <fa-icon [icon]=\"['far', 'id-badge']\"></fa-icon>\n </button>\n </div>\n</ng-template>\n\n<ng-template #cycleAddons let-property>\n <div class=\"control\" *ngIf=\"property.key === 'cycleDuration'\">\n <button class=\"button is-small\" title=\"Calculate value from startDate and endDate\"\n (click)=\"calculateCycleDuration(property)\"\n [disabled]=\"!calculateCycleDurationEnabled(property)\"\n >\n <fa-icon icon=\"calculator\"></fa-icon>\n </button>\n </div>\n <div class=\"control\" *ngIf=\"property.key === 'startDate'\">\n <button class=\"button is-small\" title=\"Calculate value from endDate and cycleDuration\"\n (click)=\"calculateCycleStartDate(property)\"\n [disabled]=\"!calculateCycleStartDateEnabled(property)\"\n >\n <fa-icon icon=\"calculator\"></fa-icon>\n </button>\n </div>\n</ng-template>\n\n<ng-template #showNewProperty let-property>\n <header class=\"card-header\" *ngIf=\"editable && property.editable && (property.addPropertyEnabled || deepEditable); else padder\">\n <form class=\"py-3 px-4 is-flex-grow-1\" (submit)=\"addProperty(property)\" novalidate>\n <div class=\"field is-horizontal\">\n <div class=\"field-label is-small\">\n <label class=\"label\" [for]=\"property.id + '_new'\">\n <span>Add new field</span>\n </label>\n </div>\n <div class=\"field-body\">\n <div class=\"field has-addons\">\n <div class=\"control is-expanded\">\n <input class=\"input is-small\"\n [(ngModel)]=\"property.newProperty\"\n [id]=\"property.id + '_new'\"\n name=\"randomname\"\n placeholder=\"Search and select field from results\"\n\n [ngbTypeahead]=\"suggestNewProperty(property.fullKey)\"\n [resultTemplate]=\"suggestion\"\n [inputFormatter]=\"formatter\"\n [focusFirst]=\"false\"\n [editable]=\"false\"\n (focus)=\"typeaheadFocus($event)\"\n >\n </div>\n <div class=\"control\">\n <button class=\"button is-small\" type=\"submit\"\n [disabled]=\"!property.newProperty || !property.newProperty.name\"\n >\n <fa-icon icon=\"plus\"></fa-icon>\n <span class=\"pl-2\">Add</span>\n </button>\n </div>\n </div>\n </div>\n </div>\n </form>\n </header>\n</ng-template>\n\n<ng-template #propertyError let-property=\"property\" let-edit=\"edit\">\n <p class=\"help\"\n [class.is-danger]=\"property.hasError\"\n [class.is-warning]=\"property.hasWarning\"\n *ngIf=\"property.error\"\n >\n <span class=\"is-pre-wrap\" *bindOnce=\"property.error\" [innerHTML]=\"property.error.message\"></span>\n <a class=\"pl-2\"\n *ngIf=\"edit && errorsEditable && property.error.index >= 0\"\n (click)=\"editError(property)\"\n >\n <fa-icon class=\"pr-2\" icon=\"edit\"></fa-icon>\n <span>Edit</span>\n </a>\n <a class=\"pl-2\"\n *ngIf=\"(property.hasWarning || errorsEditable) && property.error.index >= 0\"\n (click)=\"resolveError(property)\"\n >\n <fa-icon class=\"pr-2\" icon=\"check\"></fa-icon>\n <span>Resolved</span>\n </a>\n </p>\n</ng-template>\n\n<ng-template #propertyMap let-property>\n <div class=\"panel is-default\" *ngIf=\"showMap\">\n <div class=\"open-group panel-heading py-0\"\n (click)=\"mapVisible = !mapVisible\" pointer\n [class.is-open]=\"mapVisible\"\n >\n <div class=\"columns is-mobile is-vcentered mb-0\">\n <span class=\"column is-narrow py-1 my-0\">\n <fa-icon icon=\"angle-down\" [class.is-hidden]=\"!mapVisible\"></fa-icon>\n <fa-icon icon=\"angle-right\" [class.is-hidden]=\"mapVisible\"></fa-icon>\n </span>\n <span class=\"column py-1 my-0\">\n <span class=\"is-size-6\">View on Map</span>\n </span>\n </div>\n </div>\n <div class=\"panel-block is-block p-0\" [class.is-hidden]=\"!mapVisible\">\n <he-sites-maps [sites]=\"[node]\" [showNotice]=\"false\"></he-sites-maps>\n </div>\n </div>\n</ng-template>\n\n<ng-template #nodeErrorForm let-property>\n <ng-container *ngIf=\"property.newError && property.editable\">\n <div class=\"field has-addons\">\n <div class=\"control\">\n <div class=\"select is-small\">\n <select [(ngModel)]=\"property.newError.level\">\n <option [value]=\"undefined\">Select Level</option>\n <option value=\"error\">Error</option>\n <option value=\"warning\">Warning</option>\n </select>\n </div>\n </div>\n <div class=\"control is-expanded\">\n <textarea class=\"textarea is-small\"\n [(ngModel)]=\"property.newError.message\"\n placeholder=\"Enter your message here\"\n rows=\"1\"\n ></textarea>\n </div>\n <div class=\"control\">\n <button class=\"button is-small\"\n [disabled]=\"!property.newError.level || !property.newError.message\"\n (click)=\"addError(property, property.newError)\"\n >\n <fa-icon icon=\"plus-circle\"></fa-icon>\n <span class=\"pl-2\">Add</span>\n </button>\n </div>\n </div>\n </ng-container>\n</ng-template>\n\n<ng-template #popupErrorForm let-data=\"data\">\n <div class=\"field has-addons\">\n <div class=\"control\">\n <div class=\"select\">\n <select [(ngModel)]=\"data.level\">\n <option [value]=\"undefined\">Select Level</option>\n <option value=\"error\">Error</option>\n <option value=\"warning\">Warning</option>\n </select>\n </div>\n </div>\n <div class=\"control\">\n <input class=\"input\"\n [(ngModel)]=\"data.message\"\n placeholder=\"Enter your message here\"\n >\n </div>\n </div>\n</ng-template>\n\n<ng-template #suggestion let-r=\"result\" let-t=\"term\">\n <ngb-highlight\n [title]=\"r.bibliography?.title || r.bibliography?.documentDOI || r.bibliography?.scopus || r.name\"\n [result]=\"r.bibliography?.title || r.bibliography?.documentDOI || r.bibliography?.scopus || r.name\"\n [term]=\"t\"\n ></ngb-highlight>\n</ng-template>\n\n<ng-template #padder>\n <div class=\"pt-1\"></div>\n</ng-template>\n\n<ng-template #convertUnits let-value=\"value\" let-term=\"term\" let-units=\"units\">\n <he-unit-converter [value]=\"value\" [term]=\"term\" [toUnits]=\"units\"></he-unit-converter>\n</ng-template>\n", styles: [".panel.is-default .panel-heading{background-color:#ededed;color:#363636}.card-toggle{left:0;position:absolute;top:0}@media screen and (max-width: 768px){.card-toggle{position:relative}}.card-toggle>fa-icon{display:inline-block;width:10px}.card{overflow:visible}.card .card{box-shadow:2px 2px #36363652,0 0 0 1px #36363652}.card .card>.card-header{box-shadow:0 2px 1px #36363652}.property-array-number{left:-4px;position:absolute;top:-12px}.property-array-number .tag.is-delete{border:1px solid rgba(54,54,54,.32)}.control>.button{height:100%}.is-danger-light{color:#f5758f}he-sites-maps{height:200px}\n"], components: [{ type: i1__namespace.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }, { type: NodeIconComponent, selector: "he-node-icon", inputs: ["type", "size"] }, { type: MapsDrawingConfirmComponent, selector: "he-maps-drawing-confirm", inputs: ["value", "modes", "center", "zoom"], outputs: ["closed"] }, { type: BibliographiesSearchConfirmComponent, selector: "he-bibliographies-search-confirm", inputs: ["search", "searchSources", "searchBibliographies", "searchBy"], outputs: ["closed"] }, { type: SchemaVersionLinkComponent, selector: "he-schema-version-link", inputs: ["node", "showExternalLink", "linkClass", "text"] }, { type: PopoverConfirmComponent, selector: "he-popover-confirm", inputs: ["message", "content", "position", "popoverClass"], outputs: ["confirmed"] }, { type: NodeRecommendationsComponent, selector: "he-node-recommendations", inputs: ["node", "nodeField", "buttonClass"], outputs: ["selectRecommendation"] }, { type: SitesMapsComponent, selector: "he-sites-maps", inputs: ["loadPolygons", "sites", "selected", "nodes", "center", "zoom", "showNotice"] }, { type: i11__namespace.NgbHighlight, selector: "ngb-highlight", inputs: ["highlightClass", "result", "term"] }, { type: UnitConverterComponent, selector: "he-unit-converter", inputs: ["term", "value", "fromUnits", "toUnits"] }], directives: [{ type: i2__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i2__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i11__namespace.NgbPopover, selector: "[ngbPopover]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disablePopover", "popoverClass", "openDelay", "closeDelay", "ngbPopover", "popoverTitle"], outputs: ["shown", "hidden"], exportAs: ["ngbPopover"] }, { type: i2__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i2__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: BindOnceDirective, selector: "[bindOnce]", inputs: ["bindOnce"] }, { type: i11__namespace.NgbTooltip, selector: "[ngbTooltip]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disableTooltip", "tooltipClass", "openDelay", "closeDelay", "ngbTooltip"], outputs: ["shown", "hidden"], exportAs: ["ngbTooltip"] }, { type: i2__namespace.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i1__namespace$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i11__namespace.NgbTypeahead, selector: "input[ngbTypeahead]", inputs: ["autocomplete", "placement", "container", "editable", "focusFirst", "showHint", "inputFormatter", "ngbTypeahead", "resultFormatter", "resultTemplate"], outputs: ["selectItem"], exportAs: ["ngbTypeahead"] }, { type: i1__namespace$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1__namespace$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: TagsInputDirective, selector: "[appTagsInput]", inputs: ["appTagsInput"] }, { type: i1__namespace$1.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { type: i1__namespace$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i1__namespace$1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i1__namespace$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1__namespace$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i2__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1__namespace$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1__namespace$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1__namespace$1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }], pipes: { "pluralize": PluralizePipe } });
|
|
9118
|
+
FilesFormComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FilesFormComponent, selector: "he-files-form", inputs: { schemas: "schemas", errors: "errors", node: "node", nodeMap: "nodeMap", editable: "editable", errorMode: "errorMode", deepEditable: "deepEditable", errorsEditable: "errorsEditable", showSuggestedDefaultProperties: "showSuggestedDefaultProperties" }, outputs: { nodeChange: "nodeChange", nodeErorrResolved: "nodeErorrResolved", nodeErrorAdded: "nodeErrorAdded" }, ngImport: i0__namespace, template: "<div class=\"card\">\n <div class=\"card-toggle p-4\" (click)=\"isOpen = !isOpen\" pointer>\n <fa-icon icon=\"angle-down\" [class.is-hidden]=\"!isOpen\"></fa-icon>\n <fa-icon icon=\"angle-right\" [class.is-hidden]=\"isOpen\"></fa-icon>\n <span *ngIf=\"nodeProperty\" class=\"is-px-2\"\n [class.has-text-danger]=\"nodeProperty.hasError\"\n [class.has-text-warning]=\"nodeProperty.hasWarning\"\n >\n <he-node-icon [type]=\"nodeProperty.schemaType\"></he-node-icon>\n </span>\n </div>\n\n <ng-container *ngIf=\"editable && isOpen && nodeProperty\">\n <ng-container *ngTemplateOutlet=\"showNewProperty; context: {$implicit: nodeProperty}\"></ng-container>\n </ng-container>\n\n <div class=\"card-content\">\n <ng-container *ngIf=\"isOpen\">\n <div class=\"pb-3 mb-2\" *ngIf=\"errorsEditable\">\n <ng-container *ngTemplateOutlet=\"nodeErrorForm; context: {$implicit: nodeProperty}\"></ng-container>\n </div>\n\n <div class=\"mb-4\" *ngIf=\"nodeProperty?.error\">\n <ng-container *ngTemplateOutlet=\"propertyError; context: {property: nodeProperty, edit: true}\"></ng-container>\n </div>\n </ng-container>\n\n <div class=\"columns is-multiline\">\n <ng-container *ngFor=\"let property of properties; trackBy: trackByProperty\">\n <ng-container *ngTemplateOutlet=\"showProperty; context: {$implicit: property}\"></ng-container>\n </ng-container>\n </div>\n\n <ng-container *ngIf=\"isOpen\">\n <ng-container *ngTemplateOutlet=\"propertyMap; context: {$implicit: nodeProperty}\"></ng-container>\n </ng-container>\n </div>\n\n <ng-content></ng-content>\n</div>\n\n<he-maps-drawing-confirm *ngIf=\"!!mapDrawingProperty\"\n [value]=\"mapDrawingProperty.value\" [modes]=\"mapDrawingModes(mapDrawingProperty)\"\n (closed)=\"onMapDrawingClosed($event)\"\n></he-maps-drawing-confirm>\n\n<he-bibliographies-search-confirm *ngIf=\"!!bibliographiesSearchProperty\"\n [search]=\"bibliographiesSearchProperty.value\"\n [searchBy]=\"bibliographiesSearchKey(bibliographiesSearchProperty)\"\n [searchSources]=\"bibliographiesSearchSources\"\n (closed)=\"onBibliographiesSearchClosed($event)\"\n></he-bibliographies-search-confirm>\n\n<ng-template #labelDescription let-property>\n <span\n class=\"trigger-popover\"\n [ngbPopover]=\"property.schema?.description\" [autoClose]=\"'outside'\"\n triggers=\"hover\" placement=\"right\" container=\"body\"\n >\n <span>{{property.key}}</span>\n </span>\n</ng-template>\n\n<ng-template #labelDefault let-property>\n <span>{{property.key}}</span>\n</ng-template>\n\n<ng-template #showProperty let-property>\n <ng-container *ngIf=\"(isOpen || property.closedVisible) && !property.isHidden\">\n <div class=\"column is-6\"\n [id]=\"property.fullKey + '_' + property.id\"\n [class.is-12]=\"property.properties.length || !property.key\"\n [ngSwitch]=\"!!property.properties.length\"\n >\n <div class=\"columns is-multiline is-variable is-1\" *ngSwitchCase=\"false\">\n <div class=\"column is-3 py-1\" *ngIf=\"property.key\">\n <label class=\"label has-text-right-tablet has-text-ellipsis\"\n *bindOnce=\"property\"\n [for]=\"property.id\"\n >\n <ng-container\n *ngTemplateOutlet=\"property.schema?.description && editable && property.editable ? labelDescription : labelDefault; context: {$implicit: property}\">\n </ng-container>\n </label>\n </div>\n\n <div class=\"column is-9 py-1\" [class.is-12]=\"!property.key\">\n <div class=\"field\">\n <ng-container *ngTemplateOutlet=\"inputForm; context: {$implicit: property}\"></ng-container>\n\n <ng-container *ngIf=\"(editable || errorsEditable) && (property.hasError || property.hasWarning)\">\n <ng-container *ngTemplateOutlet=\"propertyError; context: {property: property, edit: false}\"></ng-container>\n </ng-container>\n </div>\n </div>\n </div>\n\n <div class=\"panel\" *ngSwitchCase=\"true\"\n [class.is-link]=\"errorMode && property.changed\"\n [class.is-danger]=\"!property.changed && property.hasError\"\n [class.is-warning]=\"!property.changed && property.hasWarning\"\n [class.is-default]=\"!property.changed && !property.hasError && !property.hasWarning\"\n >\n <div class=\"open-group panel-heading py-0\"\n (click)=\"property.isOpen = !property.isOpen\" pointer\n [class.is-open]=\"property.isOpen\"\n [class.has-text-white]=\"(errorMode && property.changed) || property.hasError || property.hasWarning\"\n >\n <div class=\"columns is-mobile is-vcentered\">\n <span class=\"column is-narrow py-1 my-0\">\n <fa-icon icon=\"angle-down\" [class.is-hidden]=\"!property.isOpen\"></fa-icon>\n <fa-icon icon=\"angle-right\" [class.is-hidden]=\"property.isOpen\"></fa-icon>\n </span>\n <span class=\"column py-1 my-0\">\n <span class=\"is-size-6\">{{property.key}}</span>\n </span>\n <span *ngIf=\"property.schemaType\" class=\"column is-narrow py-1 my-0\">\n <span class=\"tags mb-0 has-addons\">\n <span class=\"tag mb-0 is-light\">Type</span>\n <span class=\"tag mb-0 is-white\">\n <he-schema-version-link linkClass=\"is-small\" [node]=\"{'@type': property.schemaType}\">\n <span>{{property.schemaType}}</span>\n </he-schema-version-link>\n </span>\n </span>\n </span>\n <he-popover-confirm class=\"column is-narrow py-1 my-0 px-0\"\n *ngIf=\"editable && !errorsEditable\"\n ngbTooltip=\"Remove group\" placement=\"top\"\n [message]=\"'<p>This will remove the group completely.</p>' + (property.isRequired ? '<p><u>Warning: this field is required.</u></p>' : '') + '<p>Do you confirm?</p>'\"\n popoverClass=\"px-3\"\n (confirmed)=\"propertyChanged(null, property)\"\n >\n <fa-icon icon=\"times\" size=\"sm\"></fa-icon>\n </he-popover-confirm>\n </div>\n </div>\n <div class=\"panel-block is-block p-0\" *ngIf=\"property.isOpen\">\n <ng-container [ngSwitch]=\"property.isArray\">\n <div class=\"px-3 pt-4\" *ngIf=\"property.error\">\n <ng-container *ngTemplateOutlet=\"propertyError; context: {property: property, edit: true}\"></ng-container>\n </div>\n\n <div class=\"mt-3\" *ngSwitchCase=\"false\">\n <p class=\"help py-1 px-2\" *ngIf=\"editable && !property.editable\">\n To change the {{property.key}}, please delete it first, then add the field again\n </p>\n <ng-container *ngIf=\"editable && property.editable\">\n <ng-container [ngSwitch]=\"property.schema?.title\">\n <p class=\"help py-1 px-2\" *ngSwitchCase=\"'Bibliography'\">\n Search by Title or Document DOI to auto-populate the fields using the Mendeley catalogue\n </p>\n </ng-container>\n </ng-container>\n\n <ng-container *ngTemplateOutlet=\"showNewProperty; context: {$implicit: property}\"></ng-container>\n\n <div class=\"px-3 mt-1\" *ngIf=\"errorsEditable\">\n <ng-container *ngTemplateOutlet=\"nodeErrorForm; context: {$implicit: property}\"></ng-container>\n </div>\n\n <div class=\"property-group py-2 px-3 mt-2\">\n <div class=\"columns is-multiline mb-0\">\n <ng-container *ngFor=\"let prop2 of property.properties; trackBy: trackByProperty\">\n <ng-container *ngTemplateOutlet=\"showProperty; context: {$implicit: prop2}\"></ng-container>\n </ng-container>\n </div>\n </div>\n </div>\n\n <div class=\"py-2 px-3 mt-2\" *ngSwitchCase=\"true\">\n <div class=\"mt-1\" *ngIf=\"errorsEditable\">\n <ng-container *ngTemplateOutlet=\"nodeErrorForm; context: {$implicit: property}\"></ng-container>\n </div>\n\n <ng-container *ngFor=\"let prop2 of property.properties; trackBy: trackByProperty\">\n <div class=\"card p-0 my-4\" *ngIf=\"prop2.key\"\n [id]=\"prop2.fullKey + '_' + prop2.id\"\n >\n <div class=\"property-array-number\">\n <div class=\"tags has-addons\">\n <span class=\"tag is-dark\">{{prop2.key}}</span>\n <ng-container *ngIf=\"editable && !errorsEditable && property.editable\">\n <span class=\"tag is-info\" pointer\n (click)=\"duplicateArrayGroup(property, prop2)\"\n [ngbTooltip]=\"'Duplicate ' + pluralize(property.key, 1)\" placement=\"top\"\n >\n <fa-icon icon=\"clone\" size=\"sm\"></fa-icon>\n </span>\n <span class=\"tag is-light\" pointer\n *ngIf=\"prop2.key !== '0'\"\n (click)=\"moveArrayGroupUp(property, prop2)\"\n ngbTooltip=\"Move Up\" placement=\"top\"\n >\n <fa-icon icon=\"long-arrow-alt-up\" size=\"sm\"></fa-icon>\n </span>\n <span class=\"tag is-light\" pointer\n *ngIf=\"prop2.key !== property.properties.length - 1\"\n (click)=\"moveArrayGroupDown(property, prop2)\"\n ngbTooltip=\"Move Down\" placement=\"top\"\n >\n <fa-icon icon=\"long-arrow-alt-down\" size=\"sm\"></fa-icon>\n </span>\n <he-popover-confirm class=\"tag is-delete\"\n [ngbTooltip]=\"'Remove ' + pluralize(property.key, 1)\" placement=\"top\"\n message=\"This will remove the group completely. Do you confirm?\" position=\"right\"\n (confirmed)=\"removeArrayGroup(property, prop2)\"\n ></he-popover-confirm>\n </ng-container>\n </div>\n </div>\n\n <ng-container *ngTemplateOutlet=\"showNewProperty; context: {$implicit: prop2}\"></ng-container>\n\n <div class=\"px-4 mt-2\" *ngIf=\"errorsEditable\">\n <ng-container *ngTemplateOutlet=\"nodeErrorForm; context: {$implicit: prop2}\"></ng-container>\n </div>\n\n <div class=\"px-4 mt-2\" *ngIf=\"prop2.error\">\n <ng-container *ngTemplateOutlet=\"propertyError; context: {property: prop2, edit: true}\"></ng-container>\n </div>\n\n <div class=\"property-group card-content p-3\">\n <div class=\"columns is-multiline my-0\">\n <ng-container *ngFor=\"let prop3 of prop2.properties; trackBy: trackByProperty\">\n <ng-container *ngTemplateOutlet=\"showProperty; context: {$implicit: prop3}\"></ng-container>\n </ng-container>\n </div>\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"editable && !errorsEditable\">\n <button class=\"button is-dark is-outlined is-small\" type=\"button\"\n (click)=\"addArrayGroup(property)\"\n >\n <fa-icon icon=\"plus-circle\"></fa-icon>\n <span class=\"pl-2\">Add</span>\n <span class=\"pl-1\">{{property.key | pluralize:1}}</span>\n </button>\n\n <he-node-recommendations buttonClass=\"is-small\"\n [node]=\"node\" [nodeField]=\"property.key\"\n (selectRecommendation)=\"onSelectRecommendation(property, $event)\"\n ></he-node-recommendations>\n </ng-container>\n </div>\n </ng-container>\n </div>\n </div>\n </div>\n </ng-container>\n</ng-template>\n\n<ng-template #inputForm let-property>\n <ng-container *ngIf=\"property.key\">\n <ng-container [ngSwitch]=\"property.suggestions?.type\">\n <ng-container *ngSwitchCase=\"'select'\">\n <ng-container *ngTemplateOutlet=\"inputSelect; context: {$implicit: property}\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <ng-container *ngTemplateOutlet=\"inputInput; context: {$implicit: property}\"></ng-container>\n </ng-container>\n </ng-container>\n </ng-container>\n</ng-template>\n\n<ng-template #inputInput let-property>\n <div class=\"field mb-0\" [class.has-addons]=\"hasAddons(property)\">\n <div class=\"control is-expanded\"\n [class.has-icons-right]=\"property.loading\"\n >\n <input class=\"input is-small search-input\"\n [class.is-dark]=\"property.key === 'type'\"\n [class.is-link]=\"errorMode && property.changed\"\n [class.is-danger]=\"(!property.changed && property.hasError) || isRequired(property)\"\n [class.is-warning]=\"!property.changed && property.hasWarning\"\n\n [(ngModel)]=\"property.value\" #propertyModel=\"ngModel\"\n [type]=\"property.schema?.type === 'number' ? 'number' : 'string'\"\n [id]=\"property.id\"\n name=\"randomname\"\n [readonly]=\"!editable || !property.editable || property.schema?.internal\"\n [placeholder]=\"property.placeholder\"\n [appTagsInput]=\"{enabled: editable && property.editable && property.schema?.type === 'array', items: property.schema?.items, delimiter: ';', allowDuplicates: true, placeholder: property.placeholder}\"\n (change)=\"propertyChanged($event.target.value, property)\"\n\n [pattern]=\"property.schema?.pattern\"\n [required]=\"property.fullKey.endsWith('id') && property.fullKey !== 'id'\"\n [min]=\"property.schema?.minimum\"\n [max]=\"property.schema?.maximum\"\n\n [ngbTypeahead]=\"propertySuggest(property.fullKey, property.suggestions?.type)\"\n [resultTemplate]=\"suggestion\"\n [inputFormatter]=\"formatter\"\n [focusFirst]=\"true\"\n (focus)=\"editable && property.editable && typeaheadFocus($event)\"\n (selectItem)=\"suggestionSelected($event.item, property)\"\n >\n\n <span class=\"icon is-small is-right has-text-grey-dark\" [class.is-hidden]=\"!property.loading\">\n <fa-icon icon=\"spinner\" [pulse]=\"true\" size=\"sm\"></fa-icon>\n </span>\n </div>\n <ng-container *ngTemplateOutlet=\"inputAddons; context: {$implicit: property}\"></ng-container>\n </div>\n <p class=\"help is-danger-light\"\n *ngIf=\"!property.hasError && propertyModel.invalid\"\n >\n <span *bindOnce=\"propertyModel.errors\" [innerHTML]=\"formatPropertyError(propertyModel.errors, property)\"></span>\n </p>\n</ng-template>\n\n<ng-template #inputSelect let-property>\n <div class=\"field mb-0\" [class.has-addons]=\"hasAddons(property)\">\n <div class=\"control is-expanded\">\n <div class=\"select is-small is-fullwidth\"\n [class.is-link]=\"errorMode && property.changed\"\n [class.is-danger]=\"(!property.changed && property.hasError) || isRequired(property)\"\n [class.is-warning]=\"!property.changed && property.hasWarning\"\n >\n <select\n [(ngModel)]=\"property.value\" #propertyModel=\"ngModel\"\n [id]=\"property.id\"\n name=\"randomname\"\n [disabled]=\"!editable || !property.editable || property.schema?.internal\"\n (change)=\"propertyChanged($event.target.value, property)\"\n >\n <option value=\"\">Select</option>\n <ng-container *bindOnce=\"property.suggestions\">\n <option *ngFor=\"let value of property.suggestions.values; trackBy: trackByIndex\" [value]=\"value\">{{value}}</option>\n </ng-container>\n </select>\n </div>\n </div>\n <ng-container *ngTemplateOutlet=\"inputAddons; context: {$implicit: property}\"></ng-container>\n </div>\n</ng-template>\n\n<ng-template #removeFieldAddon let-property>\n <div class=\"control\" *ngIf=\"!errorsEditable && !property.isRequired\">\n <a class=\"button is-small\" title=\"Remove field\"\n [class.is-outlined]=\"!property.changed && (property.hasError || property.hasWarning)\"\n [class.is-danger]=\"!property.changed && property.hasError\"\n [class.is-warning]=\"!property.changed && property.hasWarning\"\n (click)=\"$event.stopPropagation(); propertyChanged(null, property)\"\n >\n <fa-icon icon=\"times\"></fa-icon>\n </a>\n </div>\n</ng-template>\n\n<ng-template #inputAddons let-property>\n <he-popover-confirm class=\"control\"\n *ngIf=\"enableAddError(property)\"\n position=\"left\"\n [content]=\"popupErrorForm\"\n (confirmed)=\"addError(property, $event)\"\n >\n <span class=\"button is-small\">\n <fa-icon icon=\"comments\"></fa-icon>\n </span>\n </he-popover-confirm>\n\n <ng-container *ngIf=\"editable && property.editable\">\n <ng-container [ngSwitch]=\"property.schemaType\">\n <ng-container *ngSwitchCase=\"SchemaType.Actor\">\n <ng-container *ngTemplateOutlet=\"actorAddons; context: {$implicit: property}\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"SchemaType.Cycle\">\n <ng-container *ngTemplateOutlet=\"cycleAddons; context: {$implicit: property}\"></ng-container>\n </ng-container>\n </ng-container>\n <ng-container *bindOnce=\"property\">\n <div class=\"control\" *ngIf=\"mapDrawingModes(property).length\">\n <button class=\"button is-small\" title=\"Pick on Map\"\n (click)=\"mapDrawingProperty = property\"\n >\n <fa-icon icon=\"map-marked-alt\"></fa-icon>\n </button>\n </div>\n <div class=\"control\" *ngIf=\"bibliographiesSearchKey(property)\">\n <button class=\"button is-small\" title=\"Advanced Search\"\n (click)=\"bibliographiesSearchProperty = property\"\n >\n <fa-icon icon=\"search\"></fa-icon>\n </button>\n </div>\n </ng-container>\n\n <ng-container *ngTemplateOutlet=\"removeFieldAddon; context: {$implicit: property}\"></ng-container>\n </ng-container>\n <div class=\"control\" *ngIf=\"addPropertyEnabled(property)\">\n <a class=\"button is-small is-danger\" title=\"Add field\"\n (click)=\"$event.stopPropagation(); addMissingProperty(property)\"\n >\n <fa-icon icon=\"plus-circle\"></fa-icon>\n <span class=\"pl-2\">Add</span>\n </a>\n </div>\n <div class=\"control\" *ngIf=\"isRequired(property)\">\n <label class=\"button is-small is-danger\" [for]=\"property.id\"\n ngbTooltip=\"This field is required\" placement=\"top\"\n >\n <fa-icon icon=\"exclamation-triangle\"></fa-icon>\n </label>\n </div>\n <ng-container *ngIf=\"property.externalUrl?.url\">\n <div class=\"control\">\n <a class=\"button is-small\"\n [href]=\"property.externalUrl.url + (property.externalUrl.urlParamValue ? property.value : '')\"\n target=\"_blank\"\n [title]=\"property.externalUrl.title\"\n [ngClass]=\"{'is-dark is-outlined': property.key === 'type'}\"\n [attr.disabled]=\"property.externalUrl.urlParamValue && !property.value ? true : null\"\n >\n <fa-icon [icon]=\"property.externalUrl.icon || 'external-link-alt'\"></fa-icon>\n </a>\n </div>\n </ng-container>\n <ng-container *ngIf=\"unitConverterEnabled(property)\">\n <div class=\"control\">\n <button class=\"button is-small\" title=\"Open calculator\"\n [ngbPopover]=\"convertUnits\" autoClose=\"outside\"\n triggers=\"manual\" #p=\"ngbPopover\" placement=\"bottom\" container=\"body\"\n (click)=\"openUnitConverter(p, property)\"\n >\n <fa-icon icon=\"calculator\"></fa-icon>\n </button>\n </div>\n </ng-container>\n</ng-template>\n\n<ng-template #actorAddons let-property>\n <div class=\"control\" *ngIf=\"property.key === '@id'\">\n <button class=\"button is-small\" title=\"Add myself as Actor\"\n (click)=\"setUserActorId(property)\"\n >\n <fa-icon [icon]=\"['far', 'id-badge']\"></fa-icon>\n </button>\n </div>\n</ng-template>\n\n<ng-template #cycleAddons let-property>\n <div class=\"control\" *ngIf=\"property.key === 'cycleDuration'\">\n <button class=\"button is-small\" title=\"Calculate value from startDate and endDate\"\n (click)=\"calculateCycleDuration(property)\"\n [disabled]=\"!calculateCycleDurationEnabled(property)\"\n >\n <fa-icon icon=\"calculator\"></fa-icon>\n </button>\n </div>\n <div class=\"control\" *ngIf=\"property.key === 'startDate'\">\n <button class=\"button is-small\" title=\"Calculate value from endDate and cycleDuration\"\n (click)=\"calculateCycleStartDate(property)\"\n [disabled]=\"!calculateCycleStartDateEnabled(property)\"\n >\n <fa-icon icon=\"calculator\"></fa-icon>\n </button>\n </div>\n</ng-template>\n\n<ng-template #showNewProperty let-property>\n <header class=\"card-header\" *ngIf=\"editable && property.editable && (property.addPropertyEnabled || deepEditable); else padder\">\n <form class=\"py-3 px-4 is-flex-grow-1\" (submit)=\"addProperty(property)\" novalidate>\n <div class=\"field is-horizontal\">\n <div class=\"field-label is-small\">\n <label class=\"label\" [for]=\"property.id + '_new'\">\n <span>Add new field</span>\n </label>\n </div>\n <div class=\"field-body\">\n <div class=\"field has-addons\">\n <div class=\"control is-expanded\">\n <input class=\"input is-small\"\n [(ngModel)]=\"property.newProperty\"\n [id]=\"property.id + '_new'\"\n name=\"randomname\"\n placeholder=\"Search and select field from results\"\n\n [ngbTypeahead]=\"suggestNewProperty(property.fullKey)\"\n [resultTemplate]=\"suggestion\"\n [inputFormatter]=\"formatter\"\n [focusFirst]=\"false\"\n [editable]=\"false\"\n (focus)=\"typeaheadFocus($event)\"\n >\n </div>\n <div class=\"control\">\n <button class=\"button is-small\" type=\"submit\"\n [disabled]=\"!property.newProperty || !property.newProperty.name\"\n >\n <fa-icon icon=\"plus\"></fa-icon>\n <span class=\"pl-2\">Add</span>\n </button>\n </div>\n </div>\n </div>\n </div>\n </form>\n </header>\n</ng-template>\n\n<ng-template #propertyError let-property=\"property\" let-edit=\"edit\">\n <p class=\"help\"\n [class.is-danger]=\"property.hasError\"\n [class.is-warning]=\"property.hasWarning\"\n *ngIf=\"property.error\"\n >\n <span class=\"is-pre-wrap\" *bindOnce=\"property.error\" [innerHTML]=\"property.error.message\"></span>\n <a class=\"pl-2\"\n *ngIf=\"edit && errorsEditable && property.error.index >= 0\"\n (click)=\"editError(property)\"\n >\n <fa-icon class=\"pr-2\" icon=\"edit\"></fa-icon>\n <span>Edit</span>\n </a>\n <a class=\"pl-2\"\n *ngIf=\"(property.hasWarning || errorsEditable) && property.error.index >= 0\"\n (click)=\"resolveError(property)\"\n >\n <fa-icon class=\"pr-2\" icon=\"check\"></fa-icon>\n <span>Resolved</span>\n </a>\n </p>\n</ng-template>\n\n<ng-template #propertyMap let-property>\n <div class=\"panel is-default\" *ngIf=\"showMap\">\n <div class=\"open-group panel-heading py-0\"\n (click)=\"mapVisible = !mapVisible\" pointer\n [class.is-open]=\"mapVisible\"\n >\n <div class=\"columns is-mobile is-vcentered mb-0\">\n <span class=\"column is-narrow py-1 my-0\">\n <fa-icon icon=\"angle-down\" [class.is-hidden]=\"!mapVisible\"></fa-icon>\n <fa-icon icon=\"angle-right\" [class.is-hidden]=\"mapVisible\"></fa-icon>\n </span>\n <span class=\"column py-1 my-0\">\n <span class=\"is-size-6\">View on Map</span>\n </span>\n </div>\n </div>\n <div class=\"panel-block is-block p-0\" [class.is-hidden]=\"!mapVisible\">\n <he-sites-maps [sites]=\"[node]\" [showNotice]=\"false\"></he-sites-maps>\n </div>\n </div>\n</ng-template>\n\n<ng-template #nodeErrorForm let-property>\n <ng-container *ngIf=\"property.newError && property.editable\">\n <div class=\"field has-addons\">\n <div class=\"control\">\n <div class=\"select is-small\">\n <select [(ngModel)]=\"property.newError.level\">\n <option [value]=\"undefined\">Select Level</option>\n <option value=\"error\">Error</option>\n <option value=\"warning\">Warning</option>\n </select>\n </div>\n </div>\n <div class=\"control is-expanded\">\n <textarea class=\"textarea is-small\"\n [(ngModel)]=\"property.newError.message\"\n placeholder=\"Enter your message here\"\n rows=\"1\"\n ></textarea>\n </div>\n <div class=\"control\">\n <button class=\"button is-small\"\n [disabled]=\"!property.newError.level || !property.newError.message\"\n (click)=\"addError(property, property.newError)\"\n >\n <fa-icon icon=\"plus-circle\"></fa-icon>\n <span class=\"pl-2\">Add</span>\n </button>\n </div>\n </div>\n </ng-container>\n</ng-template>\n\n<ng-template #popupErrorForm let-data=\"data\">\n <div class=\"field has-addons\">\n <div class=\"control\">\n <div class=\"select\">\n <select [(ngModel)]=\"data.level\">\n <option [value]=\"undefined\">Select Level</option>\n <option value=\"error\">Error</option>\n <option value=\"warning\">Warning</option>\n </select>\n </div>\n </div>\n <div class=\"control\">\n <input class=\"input\"\n [(ngModel)]=\"data.message\"\n placeholder=\"Enter your message here\"\n >\n </div>\n </div>\n</ng-template>\n\n<ng-template #suggestion let-r=\"result\" let-t=\"term\">\n <ngb-highlight\n [title]=\"r.bibliography?.title || r.bibliography?.documentDOI || r.bibliography?.scopus || r.name\"\n [result]=\"r.bibliography?.title || r.bibliography?.documentDOI || r.bibliography?.scopus || r.name\"\n [term]=\"t\"\n ></ngb-highlight>\n</ng-template>\n\n<ng-template #padder>\n <div class=\"pt-1\"></div>\n</ng-template>\n\n<ng-template #convertUnits let-value=\"value\" let-term=\"term\" let-units=\"units\">\n <he-unit-converter [value]=\"value\" [term]=\"term\" [toUnits]=\"units\"></he-unit-converter>\n</ng-template>\n", styles: [".panel.is-default .panel-heading{background-color:#ededed;color:#363636}.card-toggle{left:0;position:absolute;top:0}@media screen and (max-width: 768px){.card-toggle{position:relative}}.card-toggle>fa-icon{display:inline-block;width:10px}.card{overflow:visible}.card .card{box-shadow:2px 2px #36363652,0 0 0 1px #36363652}.card .card>.card-header{box-shadow:0 2px 1px #36363652}.property-array-number{left:-4px;position:absolute;top:-12px}.property-array-number .tag.is-delete{border:1px solid rgba(54,54,54,.32)}.control>.button{height:100%}.is-danger-light{color:#f5758f}he-sites-maps{height:200px}\n"], components: [{ type: i1__namespace.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }, { type: NodeIconComponent, selector: "he-node-icon", inputs: ["type", "size"] }, { type: MapsDrawingConfirmComponent, selector: "he-maps-drawing-confirm", inputs: ["value", "modes", "center", "zoom"], outputs: ["closed"] }, { type: BibliographiesSearchConfirmComponent, selector: "he-bibliographies-search-confirm", inputs: ["search", "searchSources", "searchBibliographies", "searchBy"], outputs: ["closed"] }, { type: SchemaVersionLinkComponent, selector: "he-schema-version-link", inputs: ["node", "showExternalLink", "linkClass", "text"] }, { type: PopoverConfirmComponent, selector: "he-popover-confirm", inputs: ["message", "content", "position", "popoverClass"], outputs: ["confirmed"] }, { type: NodeRecommendationsComponent, selector: "he-node-recommendations", inputs: ["node", "nodeField", "buttonClass"], outputs: ["selectRecommendation"] }, { type: SitesMapsComponent, selector: "he-sites-maps", inputs: ["loadPolygons", "sites", "nodes", "center", "zoom", "showNotice"] }, { type: i11__namespace.NgbHighlight, selector: "ngb-highlight", inputs: ["highlightClass", "result", "term"] }, { type: UnitConverterComponent, selector: "he-unit-converter", inputs: ["term", "value", "fromUnits", "toUnits"] }], directives: [{ type: i2__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i2__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i11__namespace.NgbPopover, selector: "[ngbPopover]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disablePopover", "popoverClass", "openDelay", "closeDelay", "ngbPopover", "popoverTitle"], outputs: ["shown", "hidden"], exportAs: ["ngbPopover"] }, { type: i2__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i2__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: BindOnceDirective, selector: "[bindOnce]", inputs: ["bindOnce"] }, { type: i11__namespace.NgbTooltip, selector: "[ngbTooltip]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disableTooltip", "tooltipClass", "openDelay", "closeDelay", "ngbTooltip"], outputs: ["shown", "hidden"], exportAs: ["ngbTooltip"] }, { type: i2__namespace.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i1__namespace$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i11__namespace.NgbTypeahead, selector: "input[ngbTypeahead]", inputs: ["autocomplete", "placement", "container", "editable", "focusFirst", "showHint", "inputFormatter", "ngbTypeahead", "resultFormatter", "resultTemplate"], outputs: ["selectItem"], exportAs: ["ngbTypeahead"] }, { type: i1__namespace$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1__namespace$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: TagsInputDirective, selector: "[appTagsInput]", inputs: ["appTagsInput"] }, { type: i1__namespace$1.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { type: i1__namespace$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i1__namespace$1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i1__namespace$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1__namespace$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i2__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1__namespace$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1__namespace$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1__namespace$1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }], pipes: { "pluralize": PluralizePipe } });
|
|
9103
9119
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FilesFormComponent, decorators: [{
|
|
9104
9120
|
type: i0.Component,
|
|
9105
9121
|
args: [{
|
|
@@ -9241,7 +9257,7 @@
|
|
|
9241
9257
|
return data.logger === 'hestia_earth.models' && data.level === exports.Level.debug;
|
|
9242
9258
|
}), operators.map(function (_d) {
|
|
9243
9259
|
var data = _d.data;
|
|
9244
|
-
return parseMessage(data.message);
|
|
9260
|
+
return parseMessage$1(data.message);
|
|
9245
9261
|
}), operators.filter(function (message) { return 'node' in message; }), operators.map(parseLog), operators.filter(function (log) { return !!log.impactTermId && !!log.blankNodeTermId && !isNaN(log.value) && log.value > 0; }), operators.groupBy(function (log) { return [log.impactTermId, log.blankNodeTermId, log.modelId].join('/'); }), operators.mergeMap(function (group) { return group.pipe(operators.toArray()); }), operators.map(function (values) {
|
|
9246
9262
|
var _a;
|
|
9247
9263
|
var log = values[0];
|
|
@@ -9404,7 +9420,6 @@
|
|
|
9404
9420
|
type: i0.Input
|
|
9405
9421
|
}] } });
|
|
9406
9422
|
|
|
9407
|
-
var isSelected = function (selected, v) { return selected.length === 0 || selected.includes(v['@id']); };
|
|
9408
9423
|
var impactValue = function (impact, values) { var _a; return (((_a = values[impact['@id']]) === null || _a === void 0 ? void 0 : _a.nodes[0]) || { value: 0 }).value; };
|
|
9409
9424
|
var impactName = function (impact, index) { return index + 1 + ". " + defaultLabel(impact); };
|
|
9410
9425
|
var impactAssessmentDataset = function (values, impact, index) {
|
|
@@ -9423,7 +9438,6 @@
|
|
|
9423
9438
|
function ImpactAssessmentsIndicatorsChartComponent(ngZone) {
|
|
9424
9439
|
this.ngZone = ngZone;
|
|
9425
9440
|
this.impactAssessments = [];
|
|
9426
|
-
this.selected = [];
|
|
9427
9441
|
this.key = 'impacts';
|
|
9428
9442
|
this.indicatorPerImpactAssessment = {};
|
|
9429
9443
|
this.terms = [];
|
|
@@ -9445,8 +9459,7 @@
|
|
|
9445
9459
|
};
|
|
9446
9460
|
ImpactAssessmentsIndicatorsChartComponent.prototype.init = function () {
|
|
9447
9461
|
var _this = this;
|
|
9448
|
-
|
|
9449
|
-
this.indicatorPerImpactAssessment = groupNodesByTerm(impacts, this.key);
|
|
9462
|
+
this.indicatorPerImpactAssessment = groupNodesByTerm(this.impactAssessments, this.key);
|
|
9450
9463
|
this.terms = Object.values(this.indicatorPerImpactAssessment)
|
|
9451
9464
|
.filter(function (_d) {
|
|
9452
9465
|
var term = _d.term, values = _d.values;
|
|
@@ -9463,12 +9476,11 @@
|
|
|
9463
9476
|
return this.selectedTerm ? this.updateChart() : null;
|
|
9464
9477
|
};
|
|
9465
9478
|
ImpactAssessmentsIndicatorsChartComponent.prototype.initChart = function () {
|
|
9466
|
-
var _this = this;
|
|
9467
9479
|
var _a, _b, _c;
|
|
9468
9480
|
var labels = [(_b = (_a = this.selectedTerm) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : ''];
|
|
9469
9481
|
var values = this.indicatorPerImpactAssessment[this.selectedTerm['@id']].values;
|
|
9470
9482
|
var datasets = this.impactAssessments
|
|
9471
|
-
.map(function (impact, index) { return
|
|
9483
|
+
.map(function (impact, index) { return impactAssessmentDataset(values, impact, index); })
|
|
9472
9484
|
.filter(Boolean);
|
|
9473
9485
|
if (this.chart) {
|
|
9474
9486
|
this.chart.destroy();
|
|
@@ -9506,7 +9518,7 @@
|
|
|
9506
9518
|
return ImpactAssessmentsIndicatorsChartComponent;
|
|
9507
9519
|
}());
|
|
9508
9520
|
ImpactAssessmentsIndicatorsChartComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ImpactAssessmentsIndicatorsChartComponent, deps: [{ token: i0__namespace.NgZone }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
9509
|
-
ImpactAssessmentsIndicatorsChartComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ImpactAssessmentsIndicatorsChartComponent, selector: "he-impact-assessments-indicators-chart", inputs: { impactAssessments: "impactAssessments",
|
|
9521
|
+
ImpactAssessmentsIndicatorsChartComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ImpactAssessmentsIndicatorsChartComponent, selector: "he-impact-assessments-indicators-chart", inputs: { impactAssessments: "impactAssessments", key: "key", filterTermTypes: "filterTermTypes" }, viewQueries: [{ propertyName: "chartRef", first: true, predicate: ["chart"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div class=\"p-3\" [class.is-hidden]=\"!terms?.length\">\n <div class=\"field is-horizontal\">\n <div class=\"field-label is-normal\">\n <label class=\"label\" for=\"selectedTerm\">\n <span>Select a column</span>\n </label>\n </div>\n <div class=\"field-body\">\n <div class=\"control\">\n <div class=\"select is-small\">\n <select (change)=\"updateChart()\" [(ngModel)]=\"selectedTerm\" id=\"selectedTerm\">\n <option *ngFor=\"let term of terms\" [ngValue]=\"term\">{{term.name}}</option>\n </select>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"mt-1\">\n <div class=\"chart-container\">\n <canvas #chart></canvas>\n </div>\n </div>\n</div>\n", styles: [":host{display:block;overflow:visible}.chart-container{height:400px;position:relative}\n"], directives: [{ type: i1__namespace$1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i1__namespace$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1__namespace$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i2__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1__namespace$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1__namespace$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }] });
|
|
9510
9522
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ImpactAssessmentsIndicatorsChartComponent, decorators: [{
|
|
9511
9523
|
type: i0.Component,
|
|
9512
9524
|
args: [{
|
|
@@ -9519,8 +9531,6 @@
|
|
|
9519
9531
|
args: ['chart']
|
|
9520
9532
|
}], impactAssessments: [{
|
|
9521
9533
|
type: i0.Input
|
|
9522
|
-
}], selected: [{
|
|
9523
|
-
type: i0.Input
|
|
9524
9534
|
}], key: [{
|
|
9525
9535
|
type: i0.Input
|
|
9526
9536
|
}], filterTermTypes: [{
|
|
@@ -9528,9 +9538,8 @@
|
|
|
9528
9538
|
}] } });
|
|
9529
9539
|
|
|
9530
9540
|
var ImpactAssessmentsProductsLogsComponent = /** @class */ (function () {
|
|
9531
|
-
function ImpactAssessmentsProductsLogsComponent(searchService
|
|
9541
|
+
function ImpactAssessmentsProductsLogsComponent(searchService) {
|
|
9532
9542
|
this.searchService = searchService;
|
|
9533
|
-
this.nodeService = nodeService;
|
|
9534
9543
|
this.originalValues = [];
|
|
9535
9544
|
this.recalculatedValues = [];
|
|
9536
9545
|
this.loading = true;
|
|
@@ -9540,30 +9549,24 @@
|
|
|
9540
9549
|
}
|
|
9541
9550
|
ImpactAssessmentsProductsLogsComponent.prototype.ngOnInit = function () {
|
|
9542
9551
|
return __awaiter(this, void 0, void 0, function () {
|
|
9543
|
-
var
|
|
9544
|
-
return __generator(this, function (
|
|
9545
|
-
switch (
|
|
9546
|
-
case 0:
|
|
9547
|
-
|
|
9548
|
-
|
|
9549
|
-
|
|
9550
|
-
|
|
9551
|
-
|
|
9552
|
-
|
|
9553
|
-
|
|
9554
|
-
|
|
9555
|
-
|
|
9556
|
-
bool: {
|
|
9557
|
-
must: [
|
|
9558
|
-
matchType(schema.NodeType.Term)
|
|
9559
|
-
],
|
|
9560
|
-
should: (this.filterTermTypes || []).map(function (termType) { return matchTermType(termType); }),
|
|
9561
|
-
minimum_should_match: 1
|
|
9562
|
-
}
|
|
9552
|
+
var terms, showAllEmissions;
|
|
9553
|
+
return __generator(this, function (_a) {
|
|
9554
|
+
switch (_a.label) {
|
|
9555
|
+
case 0: return [4 /*yield*/, this.searchService.search({
|
|
9556
|
+
fields: ['@type', '@id', 'name', 'units'],
|
|
9557
|
+
limit: 1000,
|
|
9558
|
+
query: {
|
|
9559
|
+
bool: {
|
|
9560
|
+
must: [
|
|
9561
|
+
matchType(schema.NodeType.Term)
|
|
9562
|
+
],
|
|
9563
|
+
should: (this.filterTermTypes || []).map(function (termType) { return matchTermType(termType); }),
|
|
9564
|
+
minimum_should_match: 1
|
|
9563
9565
|
}
|
|
9564
|
-
}
|
|
9565
|
-
|
|
9566
|
-
|
|
9566
|
+
}
|
|
9567
|
+
})];
|
|
9568
|
+
case 1:
|
|
9569
|
+
terms = (_a.sent()).results;
|
|
9567
9570
|
showAllEmissions = this.key !== 'emissionsResourceUse' || (this.filterTermTypes || []).length === 1;
|
|
9568
9571
|
this.terms = showAllEmissions ? terms : [];
|
|
9569
9572
|
this.loading = false;
|
|
@@ -9588,8 +9591,8 @@
|
|
|
9588
9591
|
});
|
|
9589
9592
|
return ImpactAssessmentsProductsLogsComponent;
|
|
9590
9593
|
}());
|
|
9591
|
-
ImpactAssessmentsProductsLogsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ImpactAssessmentsProductsLogsComponent, deps: [{ token: HeSearchService }
|
|
9592
|
-
ImpactAssessmentsProductsLogsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ImpactAssessmentsProductsLogsComponent, selector: "he-impact-assessments-products-logs", inputs: { impactAssessment: "impactAssessment", key: "key", filterTermTypes: "filterTermTypes", originalValues: "originalValues", recalculatedValues: "recalculatedValues" }, ngImport: i0__namespace, template: "<he-node-logs-models *ngIf=\"!loading; else loader\"\n [
|
|
9594
|
+
ImpactAssessmentsProductsLogsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ImpactAssessmentsProductsLogsComponent, deps: [{ token: HeSearchService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
9595
|
+
ImpactAssessmentsProductsLogsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ImpactAssessmentsProductsLogsComponent, selector: "he-impact-assessments-products-logs", inputs: { impactAssessment: "impactAssessment", key: "key", filterTermTypes: "filterTermTypes", originalValues: "originalValues", recalculatedValues: "recalculatedValues" }, ngImport: i0__namespace, template: "<he-node-logs-models *ngIf=\"!loading; else loader\"\n [node]=\"node\"\n [nodeKey]=\"key\"\n [originalValues]=\"originalValues\"\n [recalculatedValues]=\"recalculatedValues\"\n [terms]=\"terms\"\n [filterTermTypes]=\"filterTermTypes\"\n [includeAllModels]=\"includeAllModels\"\n></he-node-logs-models>\n\n<ng-template #loader>\n <div class=\"has-text-center py-3\">\n <fa-icon icon=\"spinner\" [pulse]=\"true\" size=\"lg\"></fa-icon>\n </div>\n</ng-template>\n", styles: [""], components: [{ type: NodeLogsModelsComponent, selector: "he-node-logs-models", inputs: ["node", "nodeKey", "includeAllModels", "originalValues", "recalculatedValues", "terms", "filterTermTypes", "logsKey"] }, { type: i1__namespace.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }], directives: [{ type: i2__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
9593
9596
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ImpactAssessmentsProductsLogsComponent, decorators: [{
|
|
9594
9597
|
type: i0.Component,
|
|
9595
9598
|
args: [{
|
|
@@ -9597,7 +9600,7 @@
|
|
|
9597
9600
|
templateUrl: './impact-assessments-products-logs.component.html',
|
|
9598
9601
|
styleUrls: ['./impact-assessments-products-logs.component.scss']
|
|
9599
9602
|
}]
|
|
9600
|
-
}], ctorParameters: function () { return [{ type: HeSearchService }
|
|
9603
|
+
}], ctorParameters: function () { return [{ type: HeSearchService }]; }, propDecorators: { impactAssessment: [{
|
|
9601
9604
|
type: i0.Input
|
|
9602
9605
|
}], key: [{
|
|
9603
9606
|
type: i0.Input
|
|
@@ -9622,7 +9625,6 @@
|
|
|
9622
9625
|
this.nodeService = nodeService;
|
|
9623
9626
|
this.dataStateValues = {};
|
|
9624
9627
|
this.impactAssessments = [];
|
|
9625
|
-
this.selected = [];
|
|
9626
9628
|
this.key = 'impacts';
|
|
9627
9629
|
this.enableFilterMethodModel = false;
|
|
9628
9630
|
this.loading = false;
|
|
@@ -9741,9 +9743,6 @@
|
|
|
9741
9743
|
enumerable: false,
|
|
9742
9744
|
configurable: true
|
|
9743
9745
|
});
|
|
9744
|
-
ImpactAssessmentsProductsComponent.prototype.isSelected = function (impact) {
|
|
9745
|
-
return this.selected.length === 0 || this.selected.includes(impact['@id']);
|
|
9746
|
-
};
|
|
9747
9746
|
// Recalculation logs
|
|
9748
9747
|
ImpactAssessmentsProductsComponent.prototype.selectIndex = function (_c) {
|
|
9749
9748
|
var _this = this;
|
|
@@ -9773,7 +9772,7 @@
|
|
|
9773
9772
|
return ImpactAssessmentsProductsComponent;
|
|
9774
9773
|
}());
|
|
9775
9774
|
ImpactAssessmentsProductsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ImpactAssessmentsProductsComponent, deps: [{ token: HeNodeService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
9776
|
-
ImpactAssessmentsProductsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ImpactAssessmentsProductsComponent, selector: "he-impact-assessments-products", inputs: { cycles: "cycles", impactAssessments: "impactAssessments", selected: "selected", key: "key", dataState: "dataState", filterTermTypes: "filterTermTypes", enableFilterMethodModel: "enableFilterMethodModel" }, usesOnChanges: true, ngImport: i0__namespace, template: "<div class=\"columns is-variable is-align-items-center is-2 m-0\">\n <div class=\"column is-hidden-mobile\"></div>\n <ng-container *ngIf=\"selectedView === View.table && indicators.length\">\n <div class=\"column is-narrow\">\n <button class=\"button is-dark is-outlined is-small\" (click)=\"showDownload = true\">\n <fa-icon icon=\"download\"></fa-icon>\n <span class=\"pl-2\">Download (CSV)</span>\n </button>\n </div>\n <div class=\"column is-narrow col-sep\"></div>\n </ng-container>\n <div class=\"column is-narrow\" *ngIf=\"impactAssessments.length > 1 || enableBreakdown || !isOriginal\">\n <div class=\"field has-addons\">\n <div class=\"control\">\n <button class=\"button is-small\" [class.is-active]=\"selectedView === View.table\" (click)=\"selectedView = View.table\">\n <span class=\"icon is-small\">\n <fa-icon icon=\"list\" aria-hidden=\"true\"></fa-icon>\n </span>\n <span>Table view</span>\n </button>\n </div>\n <div class=\"control\" *ngIf=\"impactAssessments.length > 1\">\n <button class=\"button is-small\" [class.is-active]=\"selectedView === View.chart\" (click)=\"selectedView = View.chart\">\n <span class=\"icon is-small\">\n <fa-icon icon=\"chart-bar\" aria-hidden=\"true\"></fa-icon>\n </span>\n <span>Chart view</span>\n </button>\n </div>\n <div class=\"control\" *ngIf=\"enableBreakdown\">\n <button class=\"button is-small\" [class.is-active]=\"selectedView === View.breakdown\" (click)=\"selectedView = View.breakdown\">\n <span class=\"icon is-small\">\n <fa-icon icon=\"chart-bar\" aria-hidden=\"true\"></fa-icon>\n </span>\n <span>Breakdown view</span>\n </button>\n </div>\n <div class=\"control\" *ngIf=\"!isOriginal\">\n <button class=\"button is-small\" [class.is-active]=\"selectedView === View.logs\" (click)=\"showRecalculationLogs()\">\n <span class=\"icon is-small\">\n <fa-icon icon=\"calculator\" aria-hidden=\"true\"></fa-icon>\n </span>\n <span>Recalculations logs</span>\n </button>\n </div>\n </div>\n </div>\n</div>\n\n<div class=\"px-3 pb-3\" [class.is-hidden]=\"selectedView !== View.table\">\n <ng-container *ngIf=\"indicators.length; else emptyTable\">\n <he-data-table class=\"mb-1 is-small\" [small]=\"true\" [nbRows]=\"impactAssessments.length\" maxHeight=\"320\">\n <table class=\"table is-narrow is-striped\">\n <thead>\n <tr>\n <th class=\"width-auto py-0\">\n <div class=\"select is-small\" *ngIf=\"enableFilterMethodModel\">\n <select name=\"selectedMethodModel\"\n (change)=\"updateImpacts()\" [(ngModel)]=\"selectedMethodModel\"\n >\n <option [ngValue]=\"undefined\">Filter Model</option>\n <option *ngFor=\"let term of methodModels\" [ngValue]=\"term\">{{term.name}}</option>\n </select>\n </div>\n </th>\n <th class=\"has-border-right\"></th>\n <th class=\"has-border-right\"></th>\n <th *ngFor=\"let indicator of indicators\"\n [attr.title]=\"indicator.value.term.name\"\n >\n <he-node-link [node]=\"indicator.value.term\">\n <span>{{indicator.value.term.name | ellipsis:30}}</span>\n </he-node-link>\n </th>\n </tr>\n <tr>\n <th class=\"width-auto\"></th>\n <th class=\"has-border-right\">\n <a [href]=\"baseUrl + '/schema/ImpactAssessment#functionalUnit'\" target=\"_blank\">Functional unit</a>\n </th>\n <th class=\"has-border-right\">\n <a [href]=\"baseUrl + '/schema/ImpactAssessment#product'\" target=\"_blank\">Product</a>\n </th>\n <th *ngFor=\"let indicator of indicators\"\n [attr.title]=\"indicator.value.term.units\"\n >{{indicator.value.term.units}}</th>\n </tr>\n </thead>\n <tbody>\n <ng-container *ngFor=\"let impactAssessment of impactAssessments; trackBy: trackById; let i = index\">\n <tr *ngIf=\"isSelected(impactAssessment)\">\n <td class=\"width-auto\" [attr.title]=\"impactName(impactAssessment)\">\n <he-node-link [node]=\"impactAssessment\">\n <span class=\"is-nowrap has-text-ellipsis\">{{i + 1}}. {{impactName(impactAssessment)}}</span>\n </he-node-link>\n </td>\n <td class=\"has-border-right\">\n <span>1 {{impactAssessment.product.units}}</span>\n </td>\n <td class=\"has-border-right\" [attr.title]=\"impactAssessment.product?.name\">\n <he-node-link *ngIf=\"impactAssessment.product\" [node]=\"impactAssessment.product\">\n <span>{{impactAssessment.product.name | ellipsis:30}}</span>\n </he-node-link>\n </td>\n <td class=\"is-nowrap\" *ngFor=\"let indicator of indicators\">\n <span *ngIf=\"indicator.value.values[impactAssessment['@id']]; else emptyValue\"\n class=\"trigger-popover\"\n [ngbPopover]=\"details\" [autoClose]=\"'outside'\"\n triggers=\"manual\" #p=\"ngbPopover\" placement=\"left\" container=\"body\"\n (click)=\"togglePopover(p, { data: indicator.value.values[impactAssessment['@id']], impactAssessment: impactAssessment, key: key })\"\n >\n <span pointer>{{propertyValue(indicator.value.values[impactAssessment['@id']].value, indicator.value.term['@id']) | precision:3 | default:'-'}}</span>\n <he-blank-node-state class=\"ml-1\"\n [node]=\"indicator.value.values[impactAssessment['@id']].node\"\n key=\"value\"\n [state]=\"impactAssessment.aggregated ? 'aggregated' : undefined\"\n ></he-blank-node-state>\n </span>\n </td>\n </tr>\n </ng-container>\n </tbody>\n </table>\n </he-data-table>\n\n <he-blank-node-state-notice [dataState]=\"dataState\"></he-blank-node-state-notice>\n </ng-container>\n</div>\n\n<he-impact-assessments-indicator-breakdown-chart *ngIf=\"selectedView === View.breakdown\"\n [impactAssessment]=\"impactAssessments[0]\"\n [indicators]=\"impactAssessments[0][key]\"\n></he-impact-assessments-indicator-breakdown-chart>\n\n<he-impact-assessments-indicators-chart *ngIf=\"impactAssessments.length > 1\" [class.is-hidden]=\"selectedView !== View.chart\"\n [key]=\"key\"\n [impactAssessments]=\"impactAssessments\" [selected]=\"selected\"\n [filterTermTypes]=\"filterTermTypes\"\n></he-impact-assessments-indicators-chart>\n\n<ng-container *ngIf=\"selectedView === View.logs && !isOriginal\">\n <div class=\"field has-addons pt-2 px-3\" *ngIf=\"impactAssessments.length > 1\">\n <div class=\"control\">\n <span class=\"button is-small is-static\">Select an Impact Assessment</span>\n </div>\n <div class=\"control is-expanded\">\n <div class=\"select is-small is-fullwidth\">\n <select (change)=\"selectIndex($event)\">\n <option *ngFor=\"let value of impactAssessments; let i = index\" [value]=\"i\">{{i + 1}}. {{impactName(value)}}</option>\n </select>\n </div>\n </div>\n </div>\n\n <he-impact-assessments-products-logs *ngIf=\"selectedIndex >= 0\"\n [key]=\"key\"\n [impactAssessment]=\"impactAssessments[selectedIndex]\"\n [filterTermTypes]=\"filterTermTypes\"\n [originalValues]=\"originalValues[selectedIndex][key]\"\n [recalculatedValues]=\"impactAssessments[selectedIndex][key]\"\n ></he-impact-assessments-products-logs>\n</ng-container>\n\n<he-node-csv-export-confirm *ngIf=\"showDownload\"\n [nodes]=\"impactAssessments\" [filename]=\"'impact-' + key + '.csv'\" [isUpload]=\"false\"\n [headerKeys]=\"['impactAssessment.id', 'impactAssessment.@id', 'impactAssessment.' + key + '.']\"\n (closed)=\"showDownload = false\"\n></he-node-csv-export-confirm>\n\n<ng-template #emptyTable>\n <div class=\"has-text-centered\">\n <span>No data</span>\n </div>\n</ng-template>\n\n<ng-template #emptyValue>\n <span>-</span>\n</ng-template>\n\n<ng-template #details let-node=\"impactAssessment\" let-data=\"data\" let-key=\"key\">\n <p *bindOnce=\"node\">\n <b>\n <span *ngIf=\"data.cycle\">{{cycleLabel(node.cycle)}}</span>\n <span *ngIf=\"!data.cycle\">{{data.name}}</span>\n </b>\n </p>\n <he-node-value-details\n [data]=\"data\" [nodeType]=\"node['@type']\" [dataKey]=\"key\"\n ></he-node-value-details>\n</ng-template>\n\n<ng-template #suggestion let-impact=\"result\" let-t=\"term\">\n <div class=\"is-block\">\n <ngb-highlight [result]=\"impact.name || impact.cycle.name\" [term]=\"t\"></ngb-highlight>\n </div>\n <div class=\"columns is-flex\">\n <div class=\"column\" *ngIf=\"impact.country\">\n <span class=\"pr-1 has-text-underline\">Country:</span>\n <span class=\"is-inline-flex\"><ngb-highlight [result]=\"impact.country.name\" [term]=\"t\"></ngb-highlight></span>\n </div>\n <div class=\"column\" *ngIf=\"impact.product\">\n <span class=\"pr-1 has-text-underline\">Product:</span>\n <span class=\"is-inline-flex\"><ngb-highlight [result]=\"impact.product.name\" [term]=\"t\"></ngb-highlight></span>\n </div>\n <div class=\"column\" *ngIf=\"impact.endDate\">\n <span class=\"pr-1 has-text-underline\">Date:</span>\n <span class=\"is-inline-flex\"><ngb-highlight [result]=\"impact.endDate\" [term]=\"t\"></ngb-highlight></span>\n </div>\n </div>\n</ng-template>\n", styles: ["fa-icon{display:inline-block;width:10px}he-data-table ::ng-deep .table thead tr th:nth-child(2),he-data-table ::ng-deep .table tbody tr td:nth-child(2){max-width:102px;width:102px}\n"], components: [{ type: i1__namespace.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }, { type: DataTableComponent, selector: "he-data-table", inputs: ["minHeight", "maxHeight", "nbRows", "small", "height", "width"] }, { type: NodeLinkComponent, selector: "he-node-link", inputs: ["node", "showExternalLink"] }, { type: BlankNodeStateComponent, selector: "he-blank-node-state", inputs: ["nodeType", "dataKey", "key", "node", "state"] }, { type: BlankNodeStateNoticeComponent, selector: "he-blank-node-state-notice", inputs: ["dataState", "showAggregated", "showDeleted", "showUnchanged"] }, { type: ImpactAssessmentsIndicatorBreakdownChartComponent, selector: "he-impact-assessments-indicator-breakdown-chart", inputs: ["impactAssessment", "indicators"] }, { type: ImpactAssessmentsIndicatorsChartComponent, selector: "he-impact-assessments-indicators-chart", inputs: ["impactAssessments", "selected", "key", "filterTermTypes"] }, { type: ImpactAssessmentsProductsLogsComponent, selector: "he-impact-assessments-products-logs", inputs: ["impactAssessment", "key", "filterTermTypes", "originalValues", "recalculatedValues"] }, { type: NodeCsvExportConfirmComponent, selector: "he-node-csv-export-confirm", inputs: ["nodes", "filename", "headerKeys", "extension", "isUpload"], outputs: ["closed"] }, { type: NodeValueDetailsComponent, selector: "he-node-value-details", inputs: ["data", "nodeType", "dataKey"] }, { type: i11__namespace.NgbHighlight, selector: "ngb-highlight", inputs: ["highlightClass", "result", "term"] }], directives: [{ type: i2__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1__namespace$1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i1__namespace$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1__namespace$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i1__namespace$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1__namespace$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i2__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i11__namespace.NgbPopover, selector: "[ngbPopover]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disablePopover", "popoverClass", "openDelay", "closeDelay", "ngbPopover", "popoverTitle"], outputs: ["shown", "hidden"], exportAs: ["ngbPopover"] }, { type: BindOnceDirective, selector: "[bindOnce]", inputs: ["bindOnce"] }], pipes: { "ellipsis": EllipsisPipe, "default": DefaultPipe, "precision": PrecisionPipe } });
|
|
9775
|
+
ImpactAssessmentsProductsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ImpactAssessmentsProductsComponent, selector: "he-impact-assessments-products", inputs: { cycles: "cycles", impactAssessments: "impactAssessments", key: "key", dataState: "dataState", filterTermTypes: "filterTermTypes", enableFilterMethodModel: "enableFilterMethodModel" }, usesOnChanges: true, ngImport: i0__namespace, template: "<div class=\"columns is-variable is-align-items-center is-2 m-0\">\n <div class=\"column is-hidden-mobile\"></div>\n <ng-container *ngIf=\"selectedView === View.table && indicators.length\">\n <div class=\"column is-narrow\">\n <button class=\"button is-dark is-outlined is-small\" (click)=\"showDownload = true\">\n <fa-icon icon=\"download\"></fa-icon>\n <span class=\"pl-2\">Download (CSV)</span>\n </button>\n </div>\n <div class=\"column is-narrow col-sep\"></div>\n </ng-container>\n <div class=\"column is-narrow\" *ngIf=\"impactAssessments.length > 1 || enableBreakdown || !isOriginal\">\n <div class=\"field has-addons\">\n <div class=\"control\">\n <button class=\"button is-small\" [class.is-active]=\"selectedView === View.table\" (click)=\"selectedView = View.table\">\n <span class=\"icon is-small\">\n <fa-icon icon=\"list\" aria-hidden=\"true\"></fa-icon>\n </span>\n <span>Table view</span>\n </button>\n </div>\n <div class=\"control\" *ngIf=\"impactAssessments.length > 1\">\n <button class=\"button is-small\" [class.is-active]=\"selectedView === View.chart\" (click)=\"selectedView = View.chart\">\n <span class=\"icon is-small\">\n <fa-icon icon=\"chart-bar\" aria-hidden=\"true\"></fa-icon>\n </span>\n <span>Chart view</span>\n </button>\n </div>\n <div class=\"control\" *ngIf=\"enableBreakdown\">\n <button class=\"button is-small\" [class.is-active]=\"selectedView === View.breakdown\" (click)=\"selectedView = View.breakdown\">\n <span class=\"icon is-small\">\n <fa-icon icon=\"chart-bar\" aria-hidden=\"true\"></fa-icon>\n </span>\n <span>Breakdown view</span>\n </button>\n </div>\n <div class=\"control\" *ngIf=\"!isOriginal\">\n <button class=\"button is-small\" [class.is-active]=\"selectedView === View.logs\" (click)=\"showRecalculationLogs()\">\n <span class=\"icon is-small\">\n <fa-icon icon=\"calculator\" aria-hidden=\"true\"></fa-icon>\n </span>\n <span>Recalculations logs</span>\n </button>\n </div>\n </div>\n </div>\n</div>\n\n<div class=\"px-3 pb-3\" [class.is-hidden]=\"selectedView !== View.table\">\n <ng-container *ngIf=\"indicators.length; else emptyTable\">\n <he-data-table class=\"mb-1 is-small\" [small]=\"true\" [nbRows]=\"impactAssessments.length\" maxHeight=\"320\">\n <table class=\"table is-narrow is-striped\">\n <thead>\n <tr>\n <th class=\"width-auto py-0\">\n <div class=\"select is-small\" *ngIf=\"enableFilterMethodModel\">\n <select name=\"selectedMethodModel\"\n (change)=\"updateImpacts()\" [(ngModel)]=\"selectedMethodModel\"\n >\n <option [ngValue]=\"undefined\">Filter Model</option>\n <option *ngFor=\"let term of methodModels\" [ngValue]=\"term\">{{term.name}}</option>\n </select>\n </div>\n </th>\n <th class=\"has-border-right\"></th>\n <th class=\"has-border-right\"></th>\n <th *ngFor=\"let indicator of indicators\"\n [attr.title]=\"indicator.value.term.name\"\n >\n <he-node-link [node]=\"indicator.value.term\">\n <span>{{indicator.value.term.name | ellipsis:30}}</span>\n </he-node-link>\n </th>\n </tr>\n <tr>\n <th class=\"width-auto\"></th>\n <th class=\"has-border-right\">\n <a [href]=\"baseUrl + '/schema/ImpactAssessment#functionalUnit'\" target=\"_blank\">Functional unit</a>\n </th>\n <th class=\"has-border-right\">\n <a [href]=\"baseUrl + '/schema/ImpactAssessment#product'\" target=\"_blank\">Product</a>\n </th>\n <th *ngFor=\"let indicator of indicators\"\n [attr.title]=\"indicator.value.term.units\"\n >{{indicator.value.term.units}}</th>\n </tr>\n </thead>\n <tbody>\n <ng-container *ngFor=\"let impactAssessment of impactAssessments; trackBy: trackById; let i = index\">\n <tr>\n <td class=\"width-auto\" [attr.title]=\"impactName(impactAssessment)\">\n <he-node-link [node]=\"impactAssessment\">\n <span class=\"is-nowrap has-text-ellipsis\">{{i + 1}}. {{impactName(impactAssessment)}}</span>\n </he-node-link>\n </td>\n <td class=\"has-border-right\">\n <span>1 {{impactAssessment.product.units}}</span>\n </td>\n <td class=\"has-border-right\" [attr.title]=\"impactAssessment.product?.name\">\n <he-node-link *ngIf=\"impactAssessment.product\" [node]=\"impactAssessment.product\">\n <span>{{impactAssessment.product.name | ellipsis:30}}</span>\n </he-node-link>\n </td>\n <td class=\"is-nowrap\" *ngFor=\"let indicator of indicators\">\n <span *ngIf=\"indicator.value.values[impactAssessment['@id']]; else emptyValue\"\n class=\"trigger-popover\"\n [ngbPopover]=\"details\" [autoClose]=\"'outside'\"\n triggers=\"manual\" #p=\"ngbPopover\" placement=\"left\" container=\"body\"\n (click)=\"togglePopover(p, { data: indicator.value.values[impactAssessment['@id']], impactAssessment: impactAssessment, key: key })\"\n >\n <span pointer>{{propertyValue(indicator.value.values[impactAssessment['@id']].value, indicator.value.term['@id']) | precision:3 | default:'-'}}</span>\n <he-blank-node-state class=\"ml-1\"\n [node]=\"indicator.value.values[impactAssessment['@id']].node\"\n key=\"value\"\n [state]=\"impactAssessment.aggregated ? 'aggregated' : undefined\"\n ></he-blank-node-state>\n </span>\n </td>\n </tr>\n </ng-container>\n </tbody>\n </table>\n </he-data-table>\n\n <he-blank-node-state-notice [dataState]=\"dataState\"></he-blank-node-state-notice>\n </ng-container>\n</div>\n\n<he-impact-assessments-indicator-breakdown-chart *ngIf=\"selectedView === View.breakdown\"\n [impactAssessment]=\"impactAssessments[0]\"\n [indicators]=\"impactAssessments[0][key]\"\n></he-impact-assessments-indicator-breakdown-chart>\n\n<he-impact-assessments-indicators-chart *ngIf=\"impactAssessments.length > 1\" [class.is-hidden]=\"selectedView !== View.chart\"\n [key]=\"key\"\n [impactAssessments]=\"impactAssessments\"\n [filterTermTypes]=\"filterTermTypes\"\n></he-impact-assessments-indicators-chart>\n\n<ng-container *ngIf=\"selectedView === View.logs && !isOriginal\">\n <div class=\"field has-addons pt-2 px-3\" *ngIf=\"impactAssessments.length > 1\">\n <div class=\"control\">\n <span class=\"button is-small is-static\">Select an Impact Assessment</span>\n </div>\n <div class=\"control is-expanded\">\n <div class=\"select is-small is-fullwidth\">\n <select (change)=\"selectIndex($event)\">\n <option *ngFor=\"let value of impactAssessments; let i = index\" [value]=\"i\">{{i + 1}}. {{impactName(value)}}</option>\n </select>\n </div>\n </div>\n </div>\n\n <he-impact-assessments-products-logs *ngIf=\"selectedIndex >= 0\"\n [key]=\"key\"\n [impactAssessment]=\"impactAssessments[selectedIndex]\"\n [filterTermTypes]=\"filterTermTypes\"\n [originalValues]=\"originalValues[selectedIndex]?.[key]\"\n [recalculatedValues]=\"impactAssessments[selectedIndex]?.[key]\"\n ></he-impact-assessments-products-logs>\n</ng-container>\n\n<he-node-csv-export-confirm *ngIf=\"showDownload\"\n [nodes]=\"impactAssessments\" [filename]=\"'impact-' + key + '.csv'\" [isUpload]=\"false\"\n [headerKeys]=\"['impactAssessment.id', 'impactAssessment.@id', 'impactAssessment.' + key + '.']\"\n (closed)=\"showDownload = false\"\n></he-node-csv-export-confirm>\n\n<ng-template #emptyTable>\n <div class=\"has-text-centered\">\n <span>No data</span>\n </div>\n</ng-template>\n\n<ng-template #emptyValue>\n <span>-</span>\n</ng-template>\n\n<ng-template #details let-node=\"impactAssessment\" let-data=\"data\" let-key=\"key\">\n <p *bindOnce=\"node\">\n <b>\n <span *ngIf=\"data.cycle\">{{cycleLabel(node.cycle)}}</span>\n <span *ngIf=\"!data.cycle\">{{data.name}}</span>\n </b>\n </p>\n <he-node-value-details\n [data]=\"data\" [nodeType]=\"node['@type']\" [dataKey]=\"key\"\n ></he-node-value-details>\n</ng-template>\n\n<ng-template #suggestion let-impact=\"result\" let-t=\"term\">\n <div class=\"is-block\">\n <ngb-highlight [result]=\"impact.name || impact.cycle.name\" [term]=\"t\"></ngb-highlight>\n </div>\n <div class=\"columns is-flex\">\n <div class=\"column\" *ngIf=\"impact.country\">\n <span class=\"pr-1 has-text-underline\">Country:</span>\n <span class=\"is-inline-flex\"><ngb-highlight [result]=\"impact.country.name\" [term]=\"t\"></ngb-highlight></span>\n </div>\n <div class=\"column\" *ngIf=\"impact.product\">\n <span class=\"pr-1 has-text-underline\">Product:</span>\n <span class=\"is-inline-flex\"><ngb-highlight [result]=\"impact.product.name\" [term]=\"t\"></ngb-highlight></span>\n </div>\n <div class=\"column\" *ngIf=\"impact.endDate\">\n <span class=\"pr-1 has-text-underline\">Date:</span>\n <span class=\"is-inline-flex\"><ngb-highlight [result]=\"impact.endDate\" [term]=\"t\"></ngb-highlight></span>\n </div>\n </div>\n</ng-template>\n", styles: ["fa-icon{display:inline-block;width:10px}he-data-table ::ng-deep .table thead tr th:nth-child(2),he-data-table ::ng-deep .table tbody tr td:nth-child(2){max-width:102px;width:102px}\n"], components: [{ type: i1__namespace.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }, { type: DataTableComponent, selector: "he-data-table", inputs: ["minHeight", "maxHeight", "nbRows", "small", "height", "width"] }, { type: NodeLinkComponent, selector: "he-node-link", inputs: ["node", "showExternalLink"] }, { type: BlankNodeStateComponent, selector: "he-blank-node-state", inputs: ["nodeType", "dataKey", "key", "node", "state"] }, { type: BlankNodeStateNoticeComponent, selector: "he-blank-node-state-notice", inputs: ["dataState", "showAggregated", "showDeleted", "showUnchanged"] }, { type: ImpactAssessmentsIndicatorBreakdownChartComponent, selector: "he-impact-assessments-indicator-breakdown-chart", inputs: ["impactAssessment", "indicators"] }, { type: ImpactAssessmentsIndicatorsChartComponent, selector: "he-impact-assessments-indicators-chart", inputs: ["impactAssessments", "key", "filterTermTypes"] }, { type: ImpactAssessmentsProductsLogsComponent, selector: "he-impact-assessments-products-logs", inputs: ["impactAssessment", "key", "filterTermTypes", "originalValues", "recalculatedValues"] }, { type: NodeCsvExportConfirmComponent, selector: "he-node-csv-export-confirm", inputs: ["nodes", "filename", "headerKeys", "extension", "isUpload"], outputs: ["closed"] }, { type: NodeValueDetailsComponent, selector: "he-node-value-details", inputs: ["data", "nodeType", "dataKey"] }, { type: i11__namespace.NgbHighlight, selector: "ngb-highlight", inputs: ["highlightClass", "result", "term"] }], directives: [{ type: i2__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1__namespace$1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i1__namespace$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1__namespace$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i1__namespace$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1__namespace$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i2__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i11__namespace.NgbPopover, selector: "[ngbPopover]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disablePopover", "popoverClass", "openDelay", "closeDelay", "ngbPopover", "popoverTitle"], outputs: ["shown", "hidden"], exportAs: ["ngbPopover"] }, { type: BindOnceDirective, selector: "[bindOnce]", inputs: ["bindOnce"] }], pipes: { "ellipsis": EllipsisPipe, "default": DefaultPipe, "precision": PrecisionPipe } });
|
|
9777
9776
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ImpactAssessmentsProductsComponent, decorators: [{
|
|
9778
9777
|
type: i0.Component,
|
|
9779
9778
|
args: [{
|
|
@@ -9785,8 +9784,6 @@
|
|
|
9785
9784
|
type: i0.Input
|
|
9786
9785
|
}], impactAssessments: [{
|
|
9787
9786
|
type: i0.Input
|
|
9788
|
-
}], selected: [{
|
|
9789
|
-
type: i0.Input
|
|
9790
9787
|
}], key: [{
|
|
9791
9788
|
type: i0.Input
|
|
9792
9789
|
}], dataState: [{
|
|
@@ -9982,6 +9979,7 @@
|
|
|
9982
9979
|
exports.calculateCycleStartDateEnabled = calculateCycleStartDateEnabled;
|
|
9983
9980
|
exports.clustererImage = clustererImage;
|
|
9984
9981
|
exports.code = code;
|
|
9982
|
+
exports.computeTerms = computeTerms;
|
|
9985
9983
|
exports.coordinatesToPoint = coordinatesToPoint;
|
|
9986
9984
|
exports.copyObject = copyObject;
|
|
9987
9985
|
exports.countriesQuery = countriesQuery;
|
|
@@ -10016,6 +10014,8 @@
|
|
|
10016
10014
|
exports.gitHome = gitHome;
|
|
10017
10015
|
exports.gitRawBaseUrl = gitRawBaseUrl;
|
|
10018
10016
|
exports.groupChanged = groupChanged;
|
|
10017
|
+
exports.groupLogsByModel = groupLogsByModel;
|
|
10018
|
+
exports.groupLogsByTerm = groupLogsByTerm;
|
|
10019
10019
|
exports.handleAPIError = handleAPIError;
|
|
10020
10020
|
exports.hasError = hasError;
|
|
10021
10021
|
exports.hasWarning = hasWarning;
|
|
@@ -10033,6 +10033,7 @@
|
|
|
10033
10033
|
exports.linkTypeEnabled = linkTypeEnabled;
|
|
10034
10034
|
exports.listColor = listColor;
|
|
10035
10035
|
exports.locationQuery = locationQuery;
|
|
10036
|
+
exports.logsKey = logsKey;
|
|
10036
10037
|
exports.lookupUrl = lookupUrl;
|
|
10037
10038
|
exports.lookups = lookups;
|
|
10038
10039
|
exports.mapsUrl = mapsUrl;
|
|
@@ -10056,6 +10057,7 @@
|
|
|
10056
10057
|
exports.measurementValue = measurementValue;
|
|
10057
10058
|
exports.missingNodeErrorMessage = missingNodeErrorMessage;
|
|
10058
10059
|
exports.missingNodeErrors = missingNodeErrors;
|
|
10060
|
+
exports.modelCount = modelCount;
|
|
10059
10061
|
exports.modelKeyParams = modelKeyParams;
|
|
10060
10062
|
exports.modelParams = modelParams;
|
|
10061
10063
|
exports.multiMatchQuery = multiMatchQuery;
|
|
@@ -10072,8 +10074,7 @@
|
|
|
10072
10074
|
exports.parseData = parseData;
|
|
10073
10075
|
exports.parseDataPath = parseDataPath;
|
|
10074
10076
|
exports.parseLines = parseLines;
|
|
10075
|
-
exports.
|
|
10076
|
-
exports.parseMessage = parseMessage;
|
|
10077
|
+
exports.parseMessage = parseMessage$1;
|
|
10077
10078
|
exports.parseNewValue = parseNewValue;
|
|
10078
10079
|
exports.pathToApiDocsPath = pathToApiDocsPath;
|
|
10079
10080
|
exports.pointToCoordinates = pointToCoordinates;
|