@hestia-earth/ui-components 0.3.0 → 0.3.1
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 +456 -392
- package/bundles/hestia-earth-ui-components.umd.js.map +1 -1
- package/common/clipboard/clipboard.component.d.ts +1 -0
- package/cycles/cycles-activity-logs/cycles-activity-logs.component.d.ts +42 -10
- package/cycles/cycles-emissions-logs/cycles-emissions-logs.component.d.ts +42 -6
- package/cycles/cycles-practices-logs/cycles-practices-logs.component.d.ts +42 -10
- package/cycles/cycles.model.d.ts +3 -4
- package/esm2015/common/clipboard/clipboard.component.js +5 -3
- package/esm2015/cycles/cycles-activity-logs/cycles-activity-logs.component.js +11 -21
- package/esm2015/cycles/cycles-emissions-logs/cycles-emissions-logs.component.js +12 -14
- package/esm2015/cycles/cycles-practices-logs/cycles-practices-logs.component.js +10 -21
- package/esm2015/cycles/cycles.model.js +4 -5
- package/esm2015/impact-assessments/impact-assessments-products/impact-assessments-products.component.js +2 -2
- package/esm2015/impact-assessments/impact-assessments-products-logs/impact-assessments-products-logs.component.js +8 -12
- package/esm2015/node/node-link/node-link.component.js +2 -2
- package/esm2015/node/node-logs-models/node-logs-models.component.js +56 -325
- package/esm2015/node/node-logs.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 +2 -2
- package/esm2015/node/node.service.js +1 -1
- package/esm2015/sites/sites-measurements-logs/sites-measurements-logs.component.js +8 -12
- package/fesm2015/hestia-earth-ui-components.js +325 -253
- package/fesm2015/hestia-earth-ui-components.js.map +1 -1
- package/impact-assessments/impact-assessments-products-logs/impact-assessments-products-logs.component.d.ts +37 -6
- package/node/node-logs-models/node-logs-models.component.d.ts +24 -88
- package/node/node-logs.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-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: [{
|
|
@@ -4121,13 +4123,13 @@
|
|
|
4121
4123
|
}]
|
|
4122
4124
|
}] });
|
|
4123
4125
|
|
|
4124
|
-
var orderBy$
|
|
4126
|
+
var orderBy$7 = require('lodash.orderby');
|
|
4125
4127
|
var SortByPipe = /** @class */ (function () {
|
|
4126
4128
|
function SortByPipe() {
|
|
4127
4129
|
}
|
|
4128
4130
|
SortByPipe.prototype.transform = function (value, keys, orders) {
|
|
4129
4131
|
if (orders === void 0) { orders = ['asc']; }
|
|
4130
|
-
return orderBy$
|
|
4132
|
+
return orderBy$7(value, keys, orders);
|
|
4131
4133
|
};
|
|
4132
4134
|
return SortByPipe;
|
|
4133
4135
|
}());
|
|
@@ -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
|
|
5504
|
-
var
|
|
5503
|
+
var set$1 = require('lodash.set');
|
|
5504
|
+
var orderBy$6 = require('lodash.orderby');
|
|
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$6(v, ['name'], ['asc']); })).toPromise(); };
|
|
5632
|
+
var LogStatus;
|
|
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
|
+
})(LogStatus || (LogStatus = {}));
|
|
5640
|
+
var hasLogDetails = function (data, logs) {
|
|
5641
|
+
var _a;
|
|
5642
|
+
return [
|
|
5643
|
+
LogStatus.success,
|
|
5644
|
+
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
|
+
? LogStatus.notRequired
|
|
5650
|
+
: isRunOrchestrator(logs)
|
|
5651
|
+
? ('shouldRun' in logs
|
|
5652
|
+
? logs.shouldRun
|
|
5653
|
+
? data.isRecalculated
|
|
5654
|
+
? LogStatus.success
|
|
5655
|
+
: LogStatus.dataProvided
|
|
5656
|
+
: LogStatus.error
|
|
5657
|
+
: LogStatus.dataProvided)
|
|
5658
|
+
: data.isRecalculated
|
|
5659
|
+
? LogStatus.skipHierarchy
|
|
5660
|
+
: LogStatus.dataProvided)
|
|
5661
|
+
: ([
|
|
5662
|
+
typeof data.originalValue === 'undefined',
|
|
5663
|
+
data.isRecalculated // is recalculated
|
|
5664
|
+
].every(Boolean)
|
|
5665
|
+
? LogStatus.skipHierarchy
|
|
5666
|
+
: 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,99 @@
|
|
|
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 orderBy$5 = require('lodash.orderby');
|
|
5898
|
+
var nodeTypesLowerCase = Object.values(schema.NodeType).map(function (v) { return v.toLowerCase(); });
|
|
5899
|
+
var logIcon = (_b = {},
|
|
5900
|
+
_b[LogStatus.success] = 'check',
|
|
5901
|
+
_b[LogStatus.error] = 'times',
|
|
5902
|
+
_b[LogStatus.skipHierarchy] = ['far', 'circle'],
|
|
5903
|
+
_b[LogStatus.dataProvided] = 'circle',
|
|
5904
|
+
_b[LogStatus.notRequired] = 'dot-circle',
|
|
5905
|
+
_b);
|
|
5906
|
+
var logColor = (_c$1 = {},
|
|
5907
|
+
_c$1[LogStatus.success] = 'success',
|
|
5908
|
+
_c$1[LogStatus.error] = 'danger',
|
|
5909
|
+
_c$1[LogStatus.skipHierarchy] = 'dark',
|
|
5910
|
+
_c$1[LogStatus.dataProvided] = 'dark',
|
|
5911
|
+
_c$1[LogStatus.notRequired] = 'grey',
|
|
5681
5912
|
_c$1);
|
|
5682
|
-
var
|
|
5683
|
-
|
|
5684
|
-
|
|
5685
|
-
|
|
5686
|
-
|
|
5687
|
-
|
|
5688
|
-
|
|
5913
|
+
var methodIdLabel = function (methodId) { return methodId ?
|
|
5914
|
+
({
|
|
5915
|
+
transformation: 'Data From Transformation',
|
|
5916
|
+
impact_assessment: 'Data From Cycle'
|
|
5917
|
+
})[methodId] || utils.keyToLabel(methodId)
|
|
5918
|
+
: ''; };
|
|
5919
|
+
var getModelsAt = function (_b, index) {
|
|
5920
|
+
var configModels = _b.configModels;
|
|
5921
|
+
return configModels[index];
|
|
5922
|
+
};
|
|
5923
|
+
var requirementKeys = function (requirements) { return Object.keys(requirements).filter(function (k) { return !nodeTypesLowerCase.includes(k); }); };
|
|
5924
|
+
var requirementColor = function (value) { return !value || ['None', 'False', '0', '0.0'].includes(value) ? 'danger' : 'white'; };
|
|
5689
5925
|
var NodeLogsModelsComponent = /** @class */ (function () {
|
|
5690
|
-
function NodeLogsModelsComponent(searchService, engineService) {
|
|
5926
|
+
function NodeLogsModelsComponent(nodeService, searchService, engineService) {
|
|
5691
5927
|
var _this = this;
|
|
5928
|
+
this.nodeService = nodeService;
|
|
5692
5929
|
this.searchService = searchService;
|
|
5693
5930
|
this.engineService = engineService;
|
|
5694
|
-
this.models = [];
|
|
5695
5931
|
this.allTerms = [];
|
|
5696
5932
|
this.allBlankNodes = [];
|
|
5697
5933
|
this.includeAllModels = true;
|
|
@@ -5700,30 +5936,37 @@
|
|
|
5700
5936
|
this.terms = [];
|
|
5701
5937
|
this.baseUrl = baseUrl();
|
|
5702
5938
|
this.isExternal = isExternal();
|
|
5703
|
-
this.
|
|
5939
|
+
this.LogStatus = LogStatus;
|
|
5940
|
+
this.logIcon = logIcon;
|
|
5941
|
+
this.logColor = logColor;
|
|
5704
5942
|
this.propertyValue = term.propertyValue;
|
|
5943
|
+
this.getModelsAt = getModelsAt;
|
|
5944
|
+
this.requirementKeys = requirementKeys;
|
|
5945
|
+
this.requirementColor = requirementColor;
|
|
5705
5946
|
this.loading = true;
|
|
5706
5947
|
this.blankNodes = [];
|
|
5707
5948
|
this.methodModelsCount = 0;
|
|
5708
5949
|
this.rowsCount = 0;
|
|
5709
5950
|
this.onlyRequired = true;
|
|
5710
5951
|
this.showLegend = true;
|
|
5711
|
-
this.LogStatus = LogStatus;
|
|
5712
|
-
this.logIcon = logIcon;
|
|
5713
|
-
this.logColor = logColor;
|
|
5714
5952
|
this.suggestTerm = function (text$) { return text$.pipe(operators.distinctUntilChanged(), operators.switchMap(function (v) { return _this.suggestByTerm(v); })); };
|
|
5715
5953
|
}
|
|
5716
5954
|
NodeLogsModelsComponent.prototype.ngOnInit = function () {
|
|
5717
5955
|
return __awaiter(this, void 0, void 0, function () {
|
|
5718
|
-
var
|
|
5719
|
-
|
|
5720
|
-
|
|
5721
|
-
switch (_g.label) {
|
|
5956
|
+
var logsString, groupedLogs, logs, nodeType, config, models, _b, engineModels, _c, _d;
|
|
5957
|
+
return __generator(this, function (_e) {
|
|
5958
|
+
switch (_e.label) {
|
|
5722
5959
|
case 0:
|
|
5723
|
-
|
|
5724
|
-
return [4 /*yield*/, this.
|
|
5960
|
+
this.logsUrl = this.nodeService.nodeLogsUrl(this.node);
|
|
5961
|
+
return [4 /*yield*/, this.nodeService.getLog(this.node).toPromise()];
|
|
5725
5962
|
case 1:
|
|
5726
|
-
|
|
5963
|
+
logsString = _e.sent();
|
|
5964
|
+
groupedLogs = groupLogsByModel(logsString);
|
|
5965
|
+
logs = this.logsKey ? groupedLogs[this.logsKey] : groupedLogs;
|
|
5966
|
+
nodeType = this.node['@type'] || this.node.type;
|
|
5967
|
+
return [4 /*yield*/, this.engineService.ochestratorConfig(nodeType)];
|
|
5968
|
+
case 2:
|
|
5969
|
+
config = _e.sent();
|
|
5727
5970
|
return [4 /*yield*/, this.searchService.search({
|
|
5728
5971
|
fields: ['@type', '@id', 'name'],
|
|
5729
5972
|
limit: 1000,
|
|
@@ -5736,84 +5979,31 @@
|
|
|
5736
5979
|
}
|
|
5737
5980
|
}
|
|
5738
5981
|
})];
|
|
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
5982
|
case 3:
|
|
5748
|
-
|
|
5749
|
-
|
|
5750
|
-
return [4 /*yield*/,
|
|
5983
|
+
models = (_e.sent()).results;
|
|
5984
|
+
_b = this;
|
|
5985
|
+
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) {
|
|
5986
|
+
var _b;
|
|
5987
|
+
return (Object.assign(Object.assign({}, prev), (_b = {}, _b[curr['@id']] = curr, _b)));
|
|
5988
|
+
}, {})).toPromise()];
|
|
5751
5989
|
case 4:
|
|
5752
|
-
|
|
5753
|
-
return [3 /*break*/, 6];
|
|
5990
|
+
_b.methodsById = _e.sent();
|
|
5991
|
+
if (!this.includeAllModels) return [3 /*break*/, 6];
|
|
5992
|
+
return [4 /*yield*/, this.engineService.models()];
|
|
5754
5993
|
case 5:
|
|
5755
|
-
|
|
5756
|
-
|
|
5994
|
+
_c = _e.sent();
|
|
5995
|
+
return [3 /*break*/, 7];
|
|
5757
5996
|
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()];
|
|
5997
|
+
_c = [];
|
|
5998
|
+
_e.label = 7;
|
|
5768
5999
|
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
|
-
]); }))));
|
|
6000
|
+
engineModels = _c;
|
|
6001
|
+
_d = this;
|
|
6002
|
+
return [4 /*yield*/, computeTerms(this.originalValues, this.recalculatedValues, this.terms, this.filterTermTypes)];
|
|
6003
|
+
case 8:
|
|
6004
|
+
_d.allTerms = _e.sent();
|
|
6005
|
+
this.allBlankNodes = this.allTerms.flatMap(groupLogsByTerm(nodeType, logs, engineModels, config, this.originalValues, this.recalculatedValues, this.nodeKey));
|
|
6006
|
+
this.methodModelsCount = modelCount(this.allBlankNodes);
|
|
5817
6007
|
this.rowsCount = this.allBlankNodes.reduce(function (prev, curr) { return prev + 1 + curr.subValues.length + curr.keys.length; }, 0);
|
|
5818
6008
|
this.filterResults();
|
|
5819
6009
|
this.loading = false;
|
|
@@ -5822,37 +6012,12 @@
|
|
|
5822
6012
|
});
|
|
5823
6013
|
});
|
|
5824
6014
|
};
|
|
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
6015
|
NodeLogsModelsComponent.prototype.suggestByTerm = function (term) {
|
|
5843
6016
|
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
6017
|
};
|
|
5845
6018
|
NodeLogsModelsComponent.prototype.trackByBlankNode = function (_index, node) {
|
|
5846
6019
|
return node.termId;
|
|
5847
6020
|
};
|
|
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
6021
|
Object.defineProperty(NodeLogsModelsComponent.prototype, "filteredType", {
|
|
5857
6022
|
get: function () {
|
|
5858
6023
|
var _a;
|
|
@@ -5864,8 +6029,8 @@
|
|
|
5864
6029
|
NodeLogsModelsComponent.prototype.filterResults = function () {
|
|
5865
6030
|
var _this = this;
|
|
5866
6031
|
setTimeout(function () {
|
|
5867
|
-
_this.blankNodes = _this.allBlankNodes.filter(function (
|
|
5868
|
-
var isRequired =
|
|
6032
|
+
_this.blankNodes = _this.allBlankNodes.filter(function (_b) {
|
|
6033
|
+
var isRequired = _b.isRequired, name = _b.term.name;
|
|
5869
6034
|
var _a;
|
|
5870
6035
|
return _this.term
|
|
5871
6036
|
? name.toLowerCase().includes(_this.term.toLowerCase())
|
|
@@ -5873,76 +6038,15 @@
|
|
|
5873
6038
|
});
|
|
5874
6039
|
});
|
|
5875
6040
|
};
|
|
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) {
|
|
6041
|
+
NodeLogsModelsComponent.prototype.methodName = function (_b) {
|
|
6042
|
+
var methodId = _b.methodId;
|
|
5905
6043
|
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';
|
|
6044
|
+
return ((_a = this.methodsById[methodId]) === null || _a === void 0 ? void 0 : _a.name) || methodIdLabel(methodId);
|
|
5941
6045
|
};
|
|
5942
6046
|
return NodeLogsModelsComponent;
|
|
5943
6047
|
}());
|
|
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 } });
|
|
6048
|
+
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 });
|
|
6049
|
+
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
6050
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: NodeLogsModelsComponent, decorators: [{
|
|
5947
6051
|
type: i0.Component,
|
|
5948
6052
|
args: [{
|
|
@@ -5950,24 +6054,22 @@
|
|
|
5950
6054
|
templateUrl: './node-logs-models.component.html',
|
|
5951
6055
|
styleUrls: ['./node-logs-models.component.scss']
|
|
5952
6056
|
}]
|
|
5953
|
-
}], ctorParameters: function () { return [{ type: HeSearchService }, { type: HeEngineService }]; }, propDecorators: {
|
|
6057
|
+
}], ctorParameters: function () { return [{ type: HeNodeService }, { type: HeSearchService }, { type: HeEngineService }]; }, propDecorators: { node: [{
|
|
5954
6058
|
type: i0.Input
|
|
5955
6059
|
}], nodeKey: [{
|
|
5956
6060
|
type: i0.Input
|
|
5957
6061
|
}], includeAllModels: [{
|
|
5958
6062
|
type: i0.Input
|
|
5959
|
-
}], logsUrl: [{
|
|
5960
|
-
type: i0.Input
|
|
5961
6063
|
}], originalValues: [{
|
|
5962
6064
|
type: i0.Input
|
|
5963
6065
|
}], recalculatedValues: [{
|
|
5964
6066
|
type: i0.Input
|
|
5965
6067
|
}], terms: [{
|
|
5966
6068
|
type: i0.Input
|
|
5967
|
-
}], logs: [{
|
|
5968
|
-
type: i0.Input
|
|
5969
6069
|
}], filterTermTypes: [{
|
|
5970
6070
|
type: i0.Input
|
|
6071
|
+
}], logsKey: [{
|
|
6072
|
+
type: i0.Input
|
|
5971
6073
|
}] } });
|
|
5972
6074
|
|
|
5973
6075
|
var NodeMissingLookupFactorsComponent = /** @class */ (function () {
|
|
@@ -6016,7 +6118,7 @@
|
|
|
6016
6118
|
'operation', 'impactAssessment', 'properties'
|
|
6017
6119
|
];
|
|
6018
6120
|
var tableKeys = [
|
|
6019
|
-
'inputs', 'transformation', 'value', 'dates', 'methodModel', 'methodTier', 'statsDefinition'
|
|
6121
|
+
'inputs', 'transformation', 'operation', 'value', 'dates', 'methodModel', 'methodTier', 'statsDefinition'
|
|
6020
6122
|
];
|
|
6021
6123
|
var NodeValueDetailsComponent = /** @class */ (function () {
|
|
6022
6124
|
function NodeValueDetailsComponent() {
|
|
@@ -6243,30 +6345,11 @@
|
|
|
6243
6345
|
Tab["products"] = "Products";
|
|
6244
6346
|
})(Tab || (Tab = {}));
|
|
6245
6347
|
var CyclesActivityLogsComponent = /** @class */ (function () {
|
|
6246
|
-
function CyclesActivityLogsComponent(
|
|
6247
|
-
this.nodeService = nodeService;
|
|
6248
|
-
this.loading = true;
|
|
6348
|
+
function CyclesActivityLogsComponent() {
|
|
6249
6349
|
this.NodeType = schema.NodeType;
|
|
6250
6350
|
this.Tab = Tab;
|
|
6251
6351
|
this.selectedTab = Tab.products;
|
|
6252
6352
|
}
|
|
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
6353
|
Object.defineProperty(CyclesActivityLogsComponent.prototype, "node", {
|
|
6271
6354
|
get: function () {
|
|
6272
6355
|
return Object.assign(Object.assign({}, this.cycle), { '@type': schema.NodeType.Cycle, type: schema.NodeType.Cycle, dataState: api.DataState.recalculated });
|
|
@@ -6274,10 +6357,17 @@
|
|
|
6274
6357
|
enumerable: false,
|
|
6275
6358
|
configurable: true
|
|
6276
6359
|
});
|
|
6360
|
+
Object.defineProperty(CyclesActivityLogsComponent.prototype, "logsKey", {
|
|
6361
|
+
get: function () {
|
|
6362
|
+
return logsKey(this.cycle);
|
|
6363
|
+
},
|
|
6364
|
+
enumerable: false,
|
|
6365
|
+
configurable: true
|
|
6366
|
+
});
|
|
6277
6367
|
return CyclesActivityLogsComponent;
|
|
6278
6368
|
}());
|
|
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: "<
|
|
6369
|
+
CyclesActivityLogsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesActivityLogsComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
6370
|
+
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
6371
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesActivityLogsComponent, decorators: [{
|
|
6282
6372
|
type: i0.Component,
|
|
6283
6373
|
args: [{
|
|
@@ -6285,7 +6375,7 @@
|
|
|
6285
6375
|
templateUrl: './cycles-activity-logs.component.html',
|
|
6286
6376
|
styleUrls: ['./cycles-activity-logs.component.scss']
|
|
6287
6377
|
}]
|
|
6288
|
-
}],
|
|
6378
|
+
}], propDecorators: { cycle: [{
|
|
6289
6379
|
type: i0.Input
|
|
6290
6380
|
}], original: [{
|
|
6291
6381
|
type: i0.Input
|
|
@@ -6518,9 +6608,8 @@
|
|
|
6518
6608
|
}] } });
|
|
6519
6609
|
|
|
6520
6610
|
var CyclesEmissionsLogsComponent = /** @class */ (function () {
|
|
6521
|
-
function CyclesEmissionsLogsComponent(searchService
|
|
6611
|
+
function CyclesEmissionsLogsComponent(searchService) {
|
|
6522
6612
|
this.searchService = searchService;
|
|
6523
|
-
this.nodeService = nodeService;
|
|
6524
6613
|
this.originalValues = [];
|
|
6525
6614
|
this.recalculatedValues = [];
|
|
6526
6615
|
this.loading = true;
|
|
@@ -6530,28 +6619,22 @@
|
|
|
6530
6619
|
}
|
|
6531
6620
|
CyclesEmissionsLogsComponent.prototype.ngOnInit = function () {
|
|
6532
6621
|
return __awaiter(this, void 0, void 0, function () {
|
|
6533
|
-
var
|
|
6622
|
+
var emissions;
|
|
6534
6623
|
return __generator(this, function (_a) {
|
|
6535
6624
|
switch (_a.label) {
|
|
6536
|
-
case 0:
|
|
6537
|
-
|
|
6538
|
-
|
|
6539
|
-
|
|
6540
|
-
|
|
6541
|
-
|
|
6542
|
-
|
|
6543
|
-
|
|
6544
|
-
|
|
6545
|
-
query: {
|
|
6546
|
-
bool: {
|
|
6547
|
-
must: [
|
|
6548
|
-
matchType(schema.NodeType.Term),
|
|
6549
|
-
matchTermType(schema.TermTermType.emission)
|
|
6550
|
-
]
|
|
6551
|
-
}
|
|
6625
|
+
case 0: return [4 /*yield*/, this.searchService.search({
|
|
6626
|
+
fields: ['@type', '@id', 'name', 'units'],
|
|
6627
|
+
limit: 1000,
|
|
6628
|
+
query: {
|
|
6629
|
+
bool: {
|
|
6630
|
+
must: [
|
|
6631
|
+
matchType(schema.NodeType.Term),
|
|
6632
|
+
matchTermType(schema.TermTermType.emission)
|
|
6633
|
+
]
|
|
6552
6634
|
}
|
|
6553
|
-
}
|
|
6554
|
-
|
|
6635
|
+
}
|
|
6636
|
+
})];
|
|
6637
|
+
case 1:
|
|
6555
6638
|
emissions = (_a.sent()).results;
|
|
6556
6639
|
this.emissions = emissions;
|
|
6557
6640
|
this.loading = false;
|
|
@@ -6567,10 +6650,17 @@
|
|
|
6567
6650
|
enumerable: false,
|
|
6568
6651
|
configurable: true
|
|
6569
6652
|
});
|
|
6653
|
+
Object.defineProperty(CyclesEmissionsLogsComponent.prototype, "logsKey", {
|
|
6654
|
+
get: function () {
|
|
6655
|
+
return logsKey(this.cycle);
|
|
6656
|
+
},
|
|
6657
|
+
enumerable: false,
|
|
6658
|
+
configurable: true
|
|
6659
|
+
});
|
|
6570
6660
|
return CyclesEmissionsLogsComponent;
|
|
6571
6661
|
}());
|
|
6572
|
-
CyclesEmissionsLogsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesEmissionsLogsComponent, deps: [{ token: HeSearchService }
|
|
6573
|
-
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 [
|
|
6662
|
+
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 });
|
|
6663
|
+
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"] }] });
|
|
6574
6664
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesEmissionsLogsComponent, decorators: [{
|
|
6575
6665
|
type: i0.Component,
|
|
6576
6666
|
args: [{
|
|
@@ -6578,7 +6668,7 @@
|
|
|
6578
6668
|
templateUrl: './cycles-emissions-logs.component.html',
|
|
6579
6669
|
styleUrls: ['./cycles-emissions-logs.component.scss']
|
|
6580
6670
|
}]
|
|
6581
|
-
}], ctorParameters: function () { return [{ type: HeSearchService }
|
|
6671
|
+
}], ctorParameters: function () { return [{ type: HeSearchService }]; }, propDecorators: { cycle: [{
|
|
6582
6672
|
type: i0.Input
|
|
6583
6673
|
}], originalValues: [{
|
|
6584
6674
|
type: i0.Input
|
|
@@ -6714,31 +6804,12 @@
|
|
|
6714
6804
|
}] } });
|
|
6715
6805
|
|
|
6716
6806
|
var CyclesPracticesLogsComponent = /** @class */ (function () {
|
|
6717
|
-
function CyclesPracticesLogsComponent(
|
|
6718
|
-
this.nodeService = nodeService;
|
|
6807
|
+
function CyclesPracticesLogsComponent() {
|
|
6719
6808
|
this.originalValues = [];
|
|
6720
6809
|
this.recalculatedValues = [];
|
|
6721
|
-
this.loading = true;
|
|
6722
6810
|
this.NodeType = schema.NodeType;
|
|
6723
6811
|
this.models = [];
|
|
6724
6812
|
}
|
|
6725
|
-
CyclesPracticesLogsComponent.prototype.ngOnInit = function () {
|
|
6726
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
6727
|
-
var logs;
|
|
6728
|
-
return __generator(this, function (_a) {
|
|
6729
|
-
switch (_a.label) {
|
|
6730
|
-
case 0:
|
|
6731
|
-
this.logsUrl = this.nodeService.nodeLogsUrl(this.node);
|
|
6732
|
-
return [4 /*yield*/, this.nodeService.getModelsLog(this.node)];
|
|
6733
|
-
case 1:
|
|
6734
|
-
logs = _a.sent();
|
|
6735
|
-
this.logs = parseLogs(this.cycle, logs);
|
|
6736
|
-
this.loading = false;
|
|
6737
|
-
return [2 /*return*/];
|
|
6738
|
-
}
|
|
6739
|
-
});
|
|
6740
|
-
});
|
|
6741
|
-
};
|
|
6742
6813
|
Object.defineProperty(CyclesPracticesLogsComponent.prototype, "node", {
|
|
6743
6814
|
get: function () {
|
|
6744
6815
|
return Object.assign(Object.assign({}, this.cycle), { '@type': schema.NodeType.Cycle, type: schema.NodeType.Cycle, dataState: api.DataState.recalculated });
|
|
@@ -6746,10 +6817,17 @@
|
|
|
6746
6817
|
enumerable: false,
|
|
6747
6818
|
configurable: true
|
|
6748
6819
|
});
|
|
6820
|
+
Object.defineProperty(CyclesPracticesLogsComponent.prototype, "logsKey", {
|
|
6821
|
+
get: function () {
|
|
6822
|
+
return logsKey(this.cycle);
|
|
6823
|
+
},
|
|
6824
|
+
enumerable: false,
|
|
6825
|
+
configurable: true
|
|
6826
|
+
});
|
|
6749
6827
|
return CyclesPracticesLogsComponent;
|
|
6750
6828
|
}());
|
|
6751
|
-
CyclesPracticesLogsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesPracticesLogsComponent, deps: [
|
|
6752
|
-
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
|
|
6829
|
+
CyclesPracticesLogsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesPracticesLogsComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
6830
|
+
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"] }] });
|
|
6753
6831
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesPracticesLogsComponent, decorators: [{
|
|
6754
6832
|
type: i0.Component,
|
|
6755
6833
|
args: [{
|
|
@@ -6757,7 +6835,7 @@
|
|
|
6757
6835
|
templateUrl: './cycles-practices-logs.component.html',
|
|
6758
6836
|
styleUrls: ['./cycles-practices-logs.component.scss']
|
|
6759
6837
|
}]
|
|
6760
|
-
}],
|
|
6838
|
+
}], propDecorators: { cycle: [{
|
|
6761
6839
|
type: i0.Input
|
|
6762
6840
|
}], originalValues: [{
|
|
6763
6841
|
type: i0.Input
|
|
@@ -8358,9 +8436,8 @@
|
|
|
8358
8436
|
};
|
|
8359
8437
|
|
|
8360
8438
|
var SitesMeasurementsLogsComponent = /** @class */ (function () {
|
|
8361
|
-
function SitesMeasurementsLogsComponent(searchService
|
|
8439
|
+
function SitesMeasurementsLogsComponent(searchService) {
|
|
8362
8440
|
this.searchService = searchService;
|
|
8363
|
-
this.nodeService = nodeService;
|
|
8364
8441
|
this.originalValues = [];
|
|
8365
8442
|
this.recalculatedValues = [];
|
|
8366
8443
|
this.loading = true;
|
|
@@ -8371,29 +8448,23 @@
|
|
|
8371
8448
|
}
|
|
8372
8449
|
SitesMeasurementsLogsComponent.prototype.ngOnInit = function () {
|
|
8373
8450
|
return __awaiter(this, void 0, void 0, function () {
|
|
8374
|
-
var
|
|
8375
|
-
return __generator(this, function (
|
|
8376
|
-
switch (
|
|
8377
|
-
case 0:
|
|
8378
|
-
|
|
8379
|
-
|
|
8380
|
-
|
|
8381
|
-
|
|
8382
|
-
|
|
8383
|
-
|
|
8384
|
-
|
|
8385
|
-
|
|
8386
|
-
query: {
|
|
8387
|
-
bool: {
|
|
8388
|
-
must: [
|
|
8389
|
-
matchType(schema.NodeType.Term),
|
|
8390
|
-
matchTermType(schema.TermTermType.measurement)
|
|
8391
|
-
]
|
|
8392
|
-
}
|
|
8451
|
+
var measurements;
|
|
8452
|
+
return __generator(this, function (_a) {
|
|
8453
|
+
switch (_a.label) {
|
|
8454
|
+
case 0: return [4 /*yield*/, this.searchService.search({
|
|
8455
|
+
fields: ['@type', '@id', 'name', 'units'],
|
|
8456
|
+
limit: 1000,
|
|
8457
|
+
query: {
|
|
8458
|
+
bool: {
|
|
8459
|
+
must: [
|
|
8460
|
+
matchType(schema.NodeType.Term),
|
|
8461
|
+
matchTermType(schema.TermTermType.measurement)
|
|
8462
|
+
]
|
|
8393
8463
|
}
|
|
8394
|
-
}
|
|
8395
|
-
|
|
8396
|
-
|
|
8464
|
+
}
|
|
8465
|
+
})];
|
|
8466
|
+
case 1:
|
|
8467
|
+
measurements = (_a.sent()).results;
|
|
8397
8468
|
this.measurements = measurements;
|
|
8398
8469
|
this.loading = false;
|
|
8399
8470
|
return [2 /*return*/];
|
|
@@ -8410,8 +8481,8 @@
|
|
|
8410
8481
|
});
|
|
8411
8482
|
return SitesMeasurementsLogsComponent;
|
|
8412
8483
|
}());
|
|
8413
|
-
SitesMeasurementsLogsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SitesMeasurementsLogsComponent, deps: [{ token: HeSearchService }
|
|
8414
|
-
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 [
|
|
8484
|
+
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 });
|
|
8485
|
+
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"] }] });
|
|
8415
8486
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SitesMeasurementsLogsComponent, decorators: [{
|
|
8416
8487
|
type: i0.Component,
|
|
8417
8488
|
args: [{
|
|
@@ -8419,7 +8490,7 @@
|
|
|
8419
8490
|
templateUrl: './sites-measurements-logs.component.html',
|
|
8420
8491
|
styleUrls: ['./sites-measurements-logs.component.scss']
|
|
8421
8492
|
}]
|
|
8422
|
-
}], ctorParameters: function () { return [{ type: HeSearchService }
|
|
8493
|
+
}], ctorParameters: function () { return [{ type: HeSearchService }]; }, propDecorators: { site: [{
|
|
8423
8494
|
type: i0.Input
|
|
8424
8495
|
}], originalValues: [{
|
|
8425
8496
|
type: i0.Input
|
|
@@ -9187,7 +9258,7 @@
|
|
|
9187
9258
|
return data.logger === 'hestia_earth.models' && data.level === exports.Level.debug;
|
|
9188
9259
|
}), operators.map(function (_d) {
|
|
9189
9260
|
var data = _d.data;
|
|
9190
|
-
return parseMessage(data.message);
|
|
9261
|
+
return parseMessage$1(data.message);
|
|
9191
9262
|
}), 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) {
|
|
9192
9263
|
var _a;
|
|
9193
9264
|
var log = values[0];
|
|
@@ -9468,9 +9539,8 @@
|
|
|
9468
9539
|
}] } });
|
|
9469
9540
|
|
|
9470
9541
|
var ImpactAssessmentsProductsLogsComponent = /** @class */ (function () {
|
|
9471
|
-
function ImpactAssessmentsProductsLogsComponent(searchService
|
|
9542
|
+
function ImpactAssessmentsProductsLogsComponent(searchService) {
|
|
9472
9543
|
this.searchService = searchService;
|
|
9473
|
-
this.nodeService = nodeService;
|
|
9474
9544
|
this.originalValues = [];
|
|
9475
9545
|
this.recalculatedValues = [];
|
|
9476
9546
|
this.loading = true;
|
|
@@ -9480,30 +9550,24 @@
|
|
|
9480
9550
|
}
|
|
9481
9551
|
ImpactAssessmentsProductsLogsComponent.prototype.ngOnInit = function () {
|
|
9482
9552
|
return __awaiter(this, void 0, void 0, function () {
|
|
9483
|
-
var
|
|
9484
|
-
return __generator(this, function (
|
|
9485
|
-
switch (
|
|
9486
|
-
case 0:
|
|
9487
|
-
|
|
9488
|
-
|
|
9489
|
-
|
|
9490
|
-
|
|
9491
|
-
|
|
9492
|
-
|
|
9493
|
-
|
|
9494
|
-
|
|
9495
|
-
|
|
9496
|
-
bool: {
|
|
9497
|
-
must: [
|
|
9498
|
-
matchType(schema.NodeType.Term)
|
|
9499
|
-
],
|
|
9500
|
-
should: (this.filterTermTypes || []).map(function (termType) { return matchTermType(termType); }),
|
|
9501
|
-
minimum_should_match: 1
|
|
9502
|
-
}
|
|
9553
|
+
var terms, showAllEmissions;
|
|
9554
|
+
return __generator(this, function (_a) {
|
|
9555
|
+
switch (_a.label) {
|
|
9556
|
+
case 0: return [4 /*yield*/, this.searchService.search({
|
|
9557
|
+
fields: ['@type', '@id', 'name', 'units'],
|
|
9558
|
+
limit: 1000,
|
|
9559
|
+
query: {
|
|
9560
|
+
bool: {
|
|
9561
|
+
must: [
|
|
9562
|
+
matchType(schema.NodeType.Term)
|
|
9563
|
+
],
|
|
9564
|
+
should: (this.filterTermTypes || []).map(function (termType) { return matchTermType(termType); }),
|
|
9565
|
+
minimum_should_match: 1
|
|
9503
9566
|
}
|
|
9504
|
-
}
|
|
9505
|
-
|
|
9506
|
-
|
|
9567
|
+
}
|
|
9568
|
+
})];
|
|
9569
|
+
case 1:
|
|
9570
|
+
terms = (_a.sent()).results;
|
|
9507
9571
|
showAllEmissions = this.key !== 'emissionsResourceUse' || (this.filterTermTypes || []).length === 1;
|
|
9508
9572
|
this.terms = showAllEmissions ? terms : [];
|
|
9509
9573
|
this.loading = false;
|
|
@@ -9528,8 +9592,8 @@
|
|
|
9528
9592
|
});
|
|
9529
9593
|
return ImpactAssessmentsProductsLogsComponent;
|
|
9530
9594
|
}());
|
|
9531
|
-
ImpactAssessmentsProductsLogsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ImpactAssessmentsProductsLogsComponent, deps: [{ token: HeSearchService }
|
|
9532
|
-
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 [
|
|
9595
|
+
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 });
|
|
9596
|
+
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"] }] });
|
|
9533
9597
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ImpactAssessmentsProductsLogsComponent, decorators: [{
|
|
9534
9598
|
type: i0.Component,
|
|
9535
9599
|
args: [{
|
|
@@ -9537,7 +9601,7 @@
|
|
|
9537
9601
|
templateUrl: './impact-assessments-products-logs.component.html',
|
|
9538
9602
|
styleUrls: ['./impact-assessments-products-logs.component.scss']
|
|
9539
9603
|
}]
|
|
9540
|
-
}], ctorParameters: function () { return [{ type: HeSearchService }
|
|
9604
|
+
}], ctorParameters: function () { return [{ type: HeSearchService }]; }, propDecorators: { impactAssessment: [{
|
|
9541
9605
|
type: i0.Input
|
|
9542
9606
|
}], key: [{
|
|
9543
9607
|
type: i0.Input
|
|
@@ -9709,7 +9773,7 @@
|
|
|
9709
9773
|
return ImpactAssessmentsProductsComponent;
|
|
9710
9774
|
}());
|
|
9711
9775
|
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 });
|
|
9712
|
-
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 } });
|
|
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", 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 } });
|
|
9713
9777
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ImpactAssessmentsProductsComponent, decorators: [{
|
|
9714
9778
|
type: i0.Component,
|
|
9715
9779
|
args: [{
|
|
@@ -9967,6 +10031,7 @@
|
|
|
9967
10031
|
exports.linkTypeEnabled = linkTypeEnabled;
|
|
9968
10032
|
exports.listColor = listColor;
|
|
9969
10033
|
exports.locationQuery = locationQuery;
|
|
10034
|
+
exports.logsKey = logsKey;
|
|
9970
10035
|
exports.lookupUrl = lookupUrl;
|
|
9971
10036
|
exports.lookups = lookups;
|
|
9972
10037
|
exports.mapsUrl = mapsUrl;
|
|
@@ -10006,8 +10071,7 @@
|
|
|
10006
10071
|
exports.parseData = parseData;
|
|
10007
10072
|
exports.parseDataPath = parseDataPath;
|
|
10008
10073
|
exports.parseLines = parseLines;
|
|
10009
|
-
exports.
|
|
10010
|
-
exports.parseMessage = parseMessage;
|
|
10074
|
+
exports.parseMessage = parseMessage$1;
|
|
10011
10075
|
exports.parseNewValue = parseNewValue;
|
|
10012
10076
|
exports.pathToApiDocsPath = pathToApiDocsPath;
|
|
10013
10077
|
exports.pointToCoordinates = pointToCoordinates;
|