@hestia-earth/ui-components 0.3.0 → 0.3.3

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.
Files changed (32) hide show
  1. package/bundles/hestia-earth-ui-components.umd.js +461 -388
  2. package/bundles/hestia-earth-ui-components.umd.js.map +1 -1
  3. package/common/clipboard/clipboard.component.d.ts +1 -0
  4. package/cycles/cycles-activity-logs/cycles-activity-logs.component.d.ts +42 -10
  5. package/cycles/cycles-emissions-logs/cycles-emissions-logs.component.d.ts +42 -6
  6. package/cycles/cycles-practices-logs/cycles-practices-logs.component.d.ts +42 -10
  7. package/cycles/cycles.model.d.ts +3 -4
  8. package/esm2015/common/clipboard/clipboard.component.js +5 -3
  9. package/esm2015/cycles/cycles-activity-logs/cycles-activity-logs.component.js +11 -21
  10. package/esm2015/cycles/cycles-emissions-logs/cycles-emissions-logs.component.js +12 -14
  11. package/esm2015/cycles/cycles-practices-logs/cycles-practices-logs.component.js +10 -21
  12. package/esm2015/cycles/cycles.model.js +4 -5
  13. package/esm2015/impact-assessments/impact-assessments-products/impact-assessments-products.component.js +2 -2
  14. package/esm2015/impact-assessments/impact-assessments-products-logs/impact-assessments-products-logs.component.js +8 -12
  15. package/esm2015/node/index.js +2 -1
  16. package/esm2015/node/node-link/node-link.component.js +2 -2
  17. package/esm2015/node/node-logs-models/node-logs-models.component.js +59 -325
  18. package/esm2015/node/node-logs-models/node-logs-models.model.js +370 -0
  19. package/esm2015/node/node-missing-lookup-factors/node-missing-lookup-factors.component.js +1 -1
  20. package/esm2015/node/node-value-details/node-value-details.component.js +2 -2
  21. package/esm2015/node/node.service.js +1 -1
  22. package/esm2015/sites/sites-measurements-logs/sites-measurements-logs.component.js +8 -12
  23. package/fesm2015/hestia-earth-ui-components.js +324 -249
  24. package/fesm2015/hestia-earth-ui-components.js.map +1 -1
  25. package/impact-assessments/impact-assessments-products-logs/impact-assessments-products-logs.component.d.ts +37 -6
  26. package/node/index.d.ts +1 -0
  27. package/node/node-logs-models/node-logs-models.component.d.ts +26 -88
  28. package/node/node-logs-models/node-logs-models.model.d.ts +88 -0
  29. package/node/node-missing-lookup-factors/node-missing-lookup-factors.component.d.ts +2 -1
  30. package/node/node.service.d.ts +1 -31
  31. package/package.json +2 -2
  32. 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$1, _c$3;
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$1 = {},
818
- _b$1[schema.TermTermType.emission] = {
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$1[schema.TermTermType.region] = {
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$1.infrastructure = {
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$1.input = {
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$1[schema.TermTermType.measurement] = {
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$1.practice = {
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$1.product = {
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$1[schema.TermTermType.property] = {
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$1));
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 = 'clipboard';
1768
+ this.icon = defaultIcon;
1768
1769
  this.size = 'md';
1769
1770
  this.rotate = 0;
1770
1771
  this.clipboardClass = 'no-print px-3';
1772
+ this.defaultIcon = defaultIcon;
1771
1773
  }
1772
1774
  ClipboardComponent.prototype.onClick = function ($event) {
1773
1775
  $event.stopPropagation();
@@ -1804,7 +1806,7 @@
1804
1806
  return ClipboardComponent;
1805
1807
  }());
1806
1808
  ClipboardComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ClipboardComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
1807
- ClipboardComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ClipboardComponent, selector: "he-clipboard", inputs: { value: "value", disabled: "disabled", hideText: "hideText", icon: "icon", size: "size", rotate: "rotate", clipboardClass: "clipboardClass" }, viewQueries: [{ propertyName: "valueNode", first: true, predicate: ["valueNode"], descendants: true }, { propertyName: "tooltip", first: true, predicate: ["t"], descendants: true }], ngImport: i0__namespace, template: "<span #valueNode [class.is-hidden]=\"hideText\">{{value}}</span>\n\n<span [class]=\"clipboardClass\" pointer (click)=\"!disabled && onClick($event)\"\n ngbTooltip=\"Copied!\" triggers=\"manual\" placement=\"bottom\" container=\"body\" #t=\"ngbTooltip\"\n>\n <fa-icon [icon]=\"icon\" [size]=\"size\" [rotate]=\"rotate\"></fa-icon>\n</span>\n", styles: [""], components: [{ type: i1__namespace.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }], directives: [{ type: i11__namespace.NgbTooltip, selector: "[ngbTooltip]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disableTooltip", "tooltipClass", "openDelay", "closeDelay", "ngbTooltip"], outputs: ["shown", "hidden"], exportAs: ["ngbTooltip"] }] });
1809
+ ClipboardComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ClipboardComponent, selector: "he-clipboard", inputs: { value: "value", disabled: "disabled", hideText: "hideText", icon: "icon", size: "size", rotate: "rotate", clipboardClass: "clipboardClass" }, viewQueries: [{ propertyName: "valueNode", first: true, predicate: ["valueNode"], descendants: true }, { propertyName: "tooltip", first: true, predicate: ["t"], descendants: true }], ngImport: i0__namespace, template: "<span #valueNode [class.is-hidden]=\"hideText\">{{value}}</span>\n\n<span [class]=\"clipboardClass\" pointer (click)=\"!disabled && onClick($event)\"\n ngbTooltip=\"Copied!\" triggers=\"manual\" placement=\"bottom\" container=\"body\" #t=\"ngbTooltip\"\n>\n <fa-icon [icon]=\"icon || defaultIcon\" [size]=\"size\" [rotate]=\"rotate\"></fa-icon>\n</span>\n", styles: [""], components: [{ type: i1__namespace.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }], directives: [{ type: i11__namespace.NgbTooltip, selector: "[ngbTooltip]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disableTooltip", "tooltipClass", "openDelay", "closeDelay", "ngbTooltip"], outputs: ["shown", "hidden"], exportAs: ["ngbTooltip"] }] });
1808
1810
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ClipboardComponent, decorators: [{
1809
1811
  type: i0.Component,
1810
1812
  args: [{
@@ -4268,7 +4270,7 @@
4268
4270
  }]
4269
4271
  }], ctorParameters: function () { return [{ type: i1__namespace$3.HttpClient }, { type: HeCommonService }]; } });
4270
4272
 
4271
- var _a$3, _b, _c$2, _d$3, _e;
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$3 = {},
4475
- _d$3[schema.NodeType.Cycle] = { must: [], must_not: [matchAggregatedQuery] },
4476
- _d$3[schema.NodeType.Source] = { must: [], must_not: [matchAggregatedQuery] },
4477
- _d$3);
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
- * Parse logs for Cycle and Transformation.
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 parseLogs = function (node, logs) { return (node.type || node['@type']) === schema.NodeType.Cycle ? logs : logs[node.term['@id']]; };
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 "" + url + (this.node.aggregated ? "?dataState=" + api.DataState.recalculated : '');
5391
+ return url + "?dataState=" + api.DataState.recalculated;
5391
5392
  },
5392
5393
  enumerable: false,
5393
5394
  configurable: true
@@ -5498,10 +5499,171 @@
5498
5499
  type: i0.Input
5499
5500
  }] } });
5500
5501
 
5501
- var _c$1, _d$2;
5502
5502
  var get$3 = require('lodash.get');
5503
+ var set$1 = require('lodash.set');
5503
5504
  var orderBy$5 = require('lodash.orderby');
5504
- var nodeTypesLowerCase = Object.values(schema.NodeType).map(function (v) { return v.toLowerCase(); });
5505
+ var termTypes = Object.values(schema.TermTermType);
5506
+ var blankNodeTypes = Object.values(schema.SchemaType).filter(function (t) { return !schema.isTypeNode(t); });
5507
+ var schemaTypesLowerCase = Object.values(schema.SchemaType).map(function (v) { return v.toLowerCase(); });
5508
+ var blankNodeTypesLowerCase = blankNodeTypes.map(function (v) { return v.toLowerCase(); });
5509
+ var missingLookupPrefix = 'Missing lookup';
5510
+ var parseFilename = function (filepath) {
5511
+ var _c = __read(filepath.split('.'), 1), filename = _c[0];
5512
+ var ext = termTypes.includes(filename) ? api.SupportedExtensions.xlsx : api.SupportedExtensions.csv;
5513
+ return api.fileToExt(filename, ext);
5514
+ };
5515
+ var parseLookup = function (_c) {
5516
+ var column = _c.column, termid = _c.termid, _d = missingLookupPrefix, missingLookup = _c[_d];
5517
+ return ({
5518
+ filename: parseFilename(missingLookup), termId: termid,
5519
+ column: column
5520
+ });
5521
+ };
5522
+ var csvValue = function (value) { return (value || '').replace('[', '').replace(']', ''); };
5523
+ var parseMessage = function (message) {
5524
+ try {
5525
+ var data = JSON.parse(message);
5526
+ return data.message.split(',').reduce(function (prev, parts) {
5527
+ var _c;
5528
+ var _d = __read(parts.split('='), 2), key = _d[0], value = _d[1];
5529
+ var val = csvValue(value);
5530
+ return Object.assign(Object.assign({}, prev), (key && val ? (_c = {}, _c[key.trim()] = val, _c) : {}));
5531
+ }, { logger: data.logger });
5532
+ }
5533
+ catch (err) {
5534
+ // make sure it works even if one log is malformed
5535
+ return {};
5536
+ }
5537
+ };
5538
+ var omitLogKeys = function (log) { return Object.fromEntries(Object.entries(log).filter(function (_c) {
5539
+ var _d = __read(_c, 1), key = _d[0];
5540
+ return !schemaTypesLowerCase.includes(key);
5541
+ })); };
5542
+ var includeBlankNodes = function (logs, log) { return Object
5543
+ .keys(log)
5544
+ .filter(function (key) { return blankNodeTypesLowerCase.includes(key); })
5545
+ .reduce(function (prev, key) {
5546
+ var _c;
5547
+ return (Object.assign(Object.assign({}, prev), (_c = {}, _c[key] = utils.unique(__spreadArray(__spreadArray([], __read(((typeof prev[key] === 'string' ? [prev[key]] : prev[key]) || []))), [
5548
+ log[key]
5549
+ ])), _c)));
5550
+ }, logs); };
5551
+ var groupLog = function (group, _a) {
5552
+ var logger = _a.logger, term = _a.term, model = _a.model, key = _a.key, should_run = _a.should_run, run_required = _a.run_required, property = _a.property, log = __rest(_a, ["logger", "term", "model", "key", "should_run", "run_required", "property"]);
5553
+ var isOrchestrator = logger.includes('orchestrator');
5554
+ var isKey = !isOrchestrator && !!key;
5555
+ var parentLogKey = ["[\"" + term + "\"]", !isOrchestrator && key || property].filter(Boolean).join('.');
5556
+ var logModelKey = [parentLogKey, model].filter(Boolean).join('.');
5557
+ set$1(group, parentLogKey + ".models", utils.unique(__spreadArray(__spreadArray([], __read(get$3(group, parentLogKey + ".models", []))), [
5558
+ model
5559
+ ])));
5560
+ set$1(group, parentLogKey + ".isKey", isKey);
5561
+ var data = get$3(group, logModelKey, {});
5562
+ data = includeBlankNodes(data, log);
5563
+ if (typeof should_run !== 'undefined') {
5564
+ var shouldRun = should_run === 'True';
5565
+ data = isOrchestrator ? Object.assign(Object.assign({}, data), { shouldRunOrchestrator: shouldRun }) : Object.assign(Object.assign(Object.assign({}, data), omitLogKeys(log)), { shouldRun: shouldRun });
5566
+ }
5567
+ else if (typeof run_required !== 'undefined') {
5568
+ var runRequired = run_required === 'True';
5569
+ data = Object.assign(Object.assign(Object.assign({}, data), (runRequired ? {} : omitLogKeys(log))), {
5570
+ runRequired: runRequired
5571
+ });
5572
+ }
5573
+ else if ('requirements' in log) {
5574
+ var requirements = log.requirements, logData = __rest(log, ["requirements"]);
5575
+ data.requirements = Object.assign(Object.assign({}, (data.requirements || {})), logData);
5576
+ }
5577
+ else if (missingLookupPrefix in log) {
5578
+ data.missingLookups = utils.unique(__spreadArray(__spreadArray([], __read((data.missingLookups || []))), [
5579
+ parseLookup(log)
5580
+ ]));
5581
+ }
5582
+ else if (!isOrchestrator) {
5583
+ data.logs = Object.assign(Object.assign({}, (data.logs || {})), omitLogKeys(log));
5584
+ }
5585
+ set$1(group, logModelKey, data);
5586
+ return group;
5587
+ };
5588
+ var groupLogSubValue = function (group, log, key) {
5589
+ var id = log[key];
5590
+ var data = groupLog(group[id] || {}, log);
5591
+ group[id] = data;
5592
+ if (key === 'transformation') {
5593
+ // add value to the same term/model on parent group
5594
+ Object.entries(group[id]).map(function (_c) {
5595
+ var _d = __read(_c, 2), term = _d[0], models = _d[1];
5596
+ return Object.keys(models).map(function (model) {
5597
+ var _a;
5598
+ if ((_a = group === null || group === void 0 ? void 0 : group[term]) === null || _a === void 0 ? void 0 : _a[model]) {
5599
+ group[term][model][key] = utils.unique(__spreadArray(__spreadArray([], __read((group[term][model][key] || []))), [
5600
+ id
5601
+ ]));
5602
+ }
5603
+ });
5604
+ });
5605
+ }
5606
+ return group;
5607
+ };
5608
+ var subValueKeys = [
5609
+ 'transformation'
5610
+ ];
5611
+ var groupLogsByModel = function (data) { return data.split('\n')
5612
+ .map(parseMessage)
5613
+ .filter(function (v) { return !!(v === null || v === void 0 ? void 0 : v.term) && (v === null || v === void 0 ? void 0 : v.term) !== 'None' && !!(v === null || v === void 0 ? void 0 : v.model); })
5614
+ .reduce(function (group, log) {
5615
+ var subValue = subValueKeys.find(function (v) { return !!log[v]; });
5616
+ return subValue ?
5617
+ subValue === 'transformation' ?
5618
+ // for transformation, do not add to top-level model
5619
+ groupLogSubValue(group, log, subValue) :
5620
+ groupLog(groupLogSubValue(group, log, subValue), log)
5621
+ : groupLog(group, log);
5622
+ }); };
5623
+ var computeTerms = function (originalValues, recalculatedValues, terms, filterTermTypes) { return rxjs.from((terms === null || terms === void 0 ? void 0 : terms.length) ?
5624
+ terms :
5625
+ __spreadArray(__spreadArray([], __read((originalValues || []).map(function (_c) {
5626
+ var term = _c.term;
5627
+ return term;
5628
+ }))), __read((recalculatedValues || []).map(function (_c) {
5629
+ var term = _c.term;
5630
+ return term;
5631
+ }))).filter(function (node) { return !(filterTermTypes === null || filterTermTypes === void 0 ? void 0 : filterTermTypes.length) || filterTermTypes.includes(node.termType); })).pipe(operators.distinct(function (v) { return v['@id']; }), operators.toArray(), operators.map(function (v) { return orderBy$5(v, ['name'], ['asc']); })).toPromise(); };
5632
+ exports.LogStatus = void 0;
5633
+ (function (LogStatus) {
5634
+ LogStatus["success"] = "successful";
5635
+ LogStatus["error"] = "failed";
5636
+ LogStatus["skipHierarchy"] = "not run (model higher up hierarchy run instead)";
5637
+ LogStatus["dataProvided"] = "not run (user provided data retained)";
5638
+ LogStatus["notRequired"] = "not relevant";
5639
+ })(exports.LogStatus || (exports.LogStatus = {}));
5640
+ var hasLogDetails = function (data, logs) {
5641
+ var _a;
5642
+ return [
5643
+ exports.LogStatus.success,
5644
+ exports.LogStatus.error
5645
+ ].includes(logStatus(data, logs)) && ((logs === null || logs === void 0 ? void 0 : logs.requirements) || (logs === null || logs === void 0 ? void 0 : logs.logs) || ((_a = logs === null || logs === void 0 ? void 0 : logs.missingLookups) === null || _a === void 0 ? void 0 : _a.length));
5646
+ };
5647
+ var logStatus = function (data, logs) { return hasLog(logs)
5648
+ ? (!data.isRequired
5649
+ ? exports.LogStatus.notRequired
5650
+ : isRunOrchestrator(logs)
5651
+ ? ('shouldRun' in logs
5652
+ ? logs.shouldRun
5653
+ ? data.isRecalculated
5654
+ ? exports.LogStatus.success
5655
+ : exports.LogStatus.dataProvided
5656
+ : exports.LogStatus.error
5657
+ : exports.LogStatus.dataProvided)
5658
+ : data.isRecalculated
5659
+ ? exports.LogStatus.skipHierarchy
5660
+ : exports.LogStatus.dataProvided)
5661
+ : ([
5662
+ typeof data.originalValue === 'undefined',
5663
+ data.isRecalculated // is recalculated
5664
+ ].every(Boolean)
5665
+ ? exports.LogStatus.skipHierarchy
5666
+ : exports.LogStatus.dataProvided); };
5505
5667
  var reduceValues = function (values, termId) {
5506
5668
  var propertyValues = values
5507
5669
  .map(function (_c) {
@@ -5513,6 +5675,7 @@
5513
5675
  return propertyValues.length ? propertyValues.reduce(function (p, v) { return p + v; }, 0) : undefined;
5514
5676
  };
5515
5677
  var isRunOrchestrator = function (log) { return !('shouldRunOrchestrator' in log) || log.shouldRunOrchestrator; };
5678
+ var isBackground = function (log) { return (log === null || log === void 0 ? void 0 : log.methodTier) === schema.EmissionMethodTier.background; };
5516
5679
  var hasLog = function (log, withOrchestrator) {
5517
5680
  if (withOrchestrator === void 0) { withOrchestrator = true; }
5518
5681
  return !!log && ('shouldRun' in log ||
@@ -5559,7 +5722,7 @@
5559
5722
  var model = _c.model;
5560
5723
  return model;
5561
5724
  }) }); }); };
5562
- var logSubValues = function (logs, original, recalculated, models, _c) {
5725
+ var logSubValues = function (allLogs, logs, original, recalculated, models, _c) {
5563
5726
  var nodeType = _c.nodeType, type = _c.type, termId = _c.termId;
5564
5727
  return utils.unique(__spreadArray(__spreadArray(__spreadArray([], __read(Object.keys(logs).flatMap(function (key) { return [
5565
5728
  logSubValue(logs, key, 'input'),
@@ -5571,21 +5734,29 @@
5571
5734
  .map(function (v) {
5572
5735
  var originalValue = blankNodeValue(original, v.key, v.id);
5573
5736
  var recalculatedValue = blankNodeValue(recalculated, v.key, v.id);
5574
- return Object.assign(Object.assign({}, v), { configModels: v.configModels.map(configWithDocs(models, { nodeType: nodeType, type: type, termId: termId }, v)), originalValue: originalValue, recalculatedValue: recalculatedValue, isRecalculated: !utils.isUndefined(recalculatedValue) && recalculatedValue !== originalValue });
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: [configWithDocs(models, { nodeType: nodeType, type: type, termId: termId }, { key: key }, true)(key)],
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 configWithDocs = function (models, _c, subValue, isKey) {
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)) || findMatchingModel(models, modelKeyParams(node, key))
5795
+ model: findMatchingModel(models, modelParams(node)) ||
5796
+ findMatchingModel(models, modelKeyParams(node, (subValue === null || subValue === void 0 ? void 0 : subValue.key) + "." + methodId)) ||
5797
+ // handle "input.price"
5798
+ findMatchingModel(models, modelKeyParams(node, type.toLowerCase() + "." + (subValue === null || subValue === void 0 ? void 0 : subValue.key))) ||
5799
+ // handle "input.hestiaAggregatedData"
5800
+ findMatchingModel(models, modelKeyParams(node, type.toLowerCase() + "." + methodId))
5633
5801
  };
5634
5802
  };
5635
5803
  };
5804
+ var configModelWithLogs = function (data, logs) { return function (model) { return (Object.assign(Object.assign({}, model), { logs: logs === null || logs === void 0 ? void 0 : logs[model.methodId], status: logStatus(data, logs === null || logs === void 0 ? void 0 : logs[model.methodId]), showLogs: hasLogDetails(data, logs === null || logs === void 0 ? void 0 : logs[model.methodId]) })); }; };
5805
+ var dataWithConfigModelLogs = function (logs) { return function (data) {
5806
+ var subLogKey = data.id || data.key ?
5807
+ data.id || data.key : null;
5808
+ var log = subLogKey ? logs[subLogKey] : logs;
5809
+ return Object.assign(Object.assign({}, data), { configModels: data.configModels.map(function (model) { return Array.isArray(model) ? model.map(configModelWithLogs(data, log)) : configModelWithLogs(data, log)(model); }) });
5810
+ }; };
5636
5811
  /**
5637
5812
  * Group models running in parallel under the same array, as they should appear vertically.
5638
5813
  *
@@ -5660,38 +5835,98 @@
5660
5835
  var groupParallelValues = function (values, models, termId) { return Array.isArray(models)
5661
5836
  ? Object.fromEntries(models.map(function (model) { return [model.methodId, valueByMethodId(values, model.methodId, termId)]; }))
5662
5837
  : {}; };
5663
- var methodIdLabel = function (methodId) { return ({
5664
- transformation: 'Data From Transformation',
5665
- impact_assessment: 'Data From Cycle'
5666
- })[methodId] || utils.keyToLabel(methodId); };
5667
- var LogStatus;
5668
- (function (LogStatus) {
5669
- LogStatus["success"] = "successful";
5670
- LogStatus["error"] = "failed";
5671
- LogStatus["skipHierarchy"] = "not run (model higher up hierarchy run instead)";
5672
- LogStatus["dataProvided"] = "not run (user provided data retained)";
5673
- LogStatus["notRequired"] = "not relevant";
5674
- })(LogStatus || (LogStatus = {}));
5675
- var logIcon = (_c$1 = {},
5676
- _c$1[LogStatus.success] = 'check',
5677
- _c$1[LogStatus.error] = 'times',
5678
- _c$1[LogStatus.skipHierarchy] = ['far', 'circle'],
5679
- _c$1[LogStatus.dataProvided] = 'circle',
5680
- _c$1[LogStatus.notRequired] = 'dot-circle',
5838
+ var groupLogsByTerm = function (nodeType, logs, models, config, allOriginalValues, allRecalculatedValues, nodeKey) {
5839
+ var originalValues = (allOriginalValues || []).filter(function (value) { return !value.deleted; });
5840
+ var recalculatedValues = (allRecalculatedValues || []).filter(function (value) { return !value.deleted; });
5841
+ var type = originalValues.length ?
5842
+ originalValues[0]['@type'] || originalValues[0].type :
5843
+ recalculatedValues.length ?
5844
+ recalculatedValues[0]['@type'] || recalculatedValues[0].type :
5845
+ undefined;
5846
+ return function (term) {
5847
+ var termId = term['@id'];
5848
+ var termLogs = get$3(logs, termId, {});
5849
+ var original = originalValues.filter(function (v) { return termId === v.term['@id']; });
5850
+ var recalculated = recalculatedValues.filter(function (v) { return termId === v.term['@id']; });
5851
+ var hasData = !!original.length || !!recalculated.length || Object.keys(termLogs).length > 0;
5852
+ var configModelsData = { nodeType: nodeType, type: type, termId: termId };
5853
+ var configModels = groupParallelModels(config, termId, nodeKey, utils.unique(__spreadArray(__spreadArray([], __read((termLogs.models || []).filter(function (key) { return isModelLog(termLogs[key]); }))), __read(findConfigModels(config, termId, nodeKey, models).map(function (_c) {
5854
+ var model = _c.model;
5855
+ return model;
5856
+ })))).map(configModelWithDocs(models, configModelsData)));
5857
+ var keys = logKeys(termLogs, original, recalculated, models, configModelsData);
5858
+ var subValues = logSubValues(logs, termLogs, original, recalculated, models, configModelsData);
5859
+ var isRequired = !Object.values(termLogs)
5860
+ .filter(function (v) { return typeof v === 'object' && !Array.isArray(v); })
5861
+ // ignore models that were never going to run
5862
+ .filter(isRunOrchestrator)
5863
+ .every(function (v) { return v.runRequired === false; });
5864
+ return dataWithConfigModelLogs(termLogs)({
5865
+ isOpen: true,
5866
+ canOpen: keys.length > 0 || subValues.length > 0,
5867
+ termId: termId,
5868
+ term: term,
5869
+ type: type,
5870
+ configModels: configModels,
5871
+ original: original,
5872
+ originalValue: reduceValues(original, termId),
5873
+ recalculated: recalculated,
5874
+ recalculatedValue: reduceValues(recalculated, termId),
5875
+ isOriginal: !!original.length,
5876
+ isRecalculated: isRecalculated(recalculated),
5877
+ hasData: hasData,
5878
+ isRequired: isRequired,
5879
+ logs: termLogs,
5880
+ keys: keys,
5881
+ subValues: subValues,
5882
+ allParallel: allParallel(configModels),
5883
+ originalValueByMethodId: groupParallelValues(original, configModels[0], termId),
5884
+ recalculatedValueByMethodId: groupParallelValues(recalculated, configModels[0], termId)
5885
+ });
5886
+ };
5887
+ };
5888
+ var modelCount = function (blankNodeLogs) { return Math.max.apply(Math.max, __spreadArray([
5889
+ 0
5890
+ ], __read(blankNodeLogs.flatMap(function (v) { return __spreadArray(__spreadArray([
5891
+ v.configModels.length
5892
+ ], __read(v.subValues.map(function (s) { var _a, _b; return (_b = (_a = s.configModels) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0; }))), [
5893
+ v.keys.length ? 1 : 0
5894
+ ]); })))); };
5895
+
5896
+ var _b, _c$1;
5897
+ var nodeTypesLowerCase = Object.values(schema.NodeType).map(function (v) { return v.toLowerCase(); });
5898
+ var logIcon = (_b = {},
5899
+ _b[exports.LogStatus.success] = 'check',
5900
+ _b[exports.LogStatus.error] = 'times',
5901
+ _b[exports.LogStatus.skipHierarchy] = ['far', 'circle'],
5902
+ _b[exports.LogStatus.dataProvided] = 'circle',
5903
+ _b[exports.LogStatus.notRequired] = 'dot-circle',
5904
+ _b);
5905
+ var logColor = (_c$1 = {},
5906
+ _c$1[exports.LogStatus.success] = 'success',
5907
+ _c$1[exports.LogStatus.error] = 'danger',
5908
+ _c$1[exports.LogStatus.skipHierarchy] = 'dark',
5909
+ _c$1[exports.LogStatus.dataProvided] = 'dark',
5910
+ _c$1[exports.LogStatus.notRequired] = 'grey',
5681
5911
  _c$1);
5682
- var logColor = (_d$2 = {},
5683
- _d$2[LogStatus.success] = 'success',
5684
- _d$2[LogStatus.error] = 'danger',
5685
- _d$2[LogStatus.skipHierarchy] = 'dark',
5686
- _d$2[LogStatus.dataProvided] = 'dark',
5687
- _d$2[LogStatus.notRequired] = 'grey',
5688
- _d$2);
5912
+ var methodIdLabel = function (methodId) { return methodId ?
5913
+ ({
5914
+ transformation: 'Data From Transformation',
5915
+ impact_assessment: 'Data From Cycle'
5916
+ })[methodId] || utils.keyToLabel(methodId)
5917
+ : ''; };
5918
+ var getModelsAt = function (_b, index) {
5919
+ var configModels = _b.configModels;
5920
+ return configModels[index];
5921
+ };
5922
+ var requirementKeys = function (requirements) { return Object.keys(requirements).filter(function (k) { return !nodeTypesLowerCase.includes(k); }); };
5923
+ var requirementColor = function (value) { return !value || ['None', 'False', '0', '0.0'].includes(value) ? 'danger' : 'white'; };
5689
5924
  var NodeLogsModelsComponent = /** @class */ (function () {
5690
- function NodeLogsModelsComponent(searchService, engineService) {
5925
+ function NodeLogsModelsComponent(nodeService, searchService, engineService) {
5691
5926
  var _this = this;
5927
+ this.nodeService = nodeService;
5692
5928
  this.searchService = searchService;
5693
5929
  this.engineService = engineService;
5694
- this.models = [];
5695
5930
  this.allTerms = [];
5696
5931
  this.allBlankNodes = [];
5697
5932
  this.includeAllModels = true;
@@ -5700,30 +5935,40 @@
5700
5935
  this.terms = [];
5701
5936
  this.baseUrl = baseUrl();
5702
5937
  this.isExternal = isExternal();
5703
- this.hasLog = hasLog;
5938
+ this.LogStatus = exports.LogStatus;
5939
+ this.logIcon = logIcon;
5940
+ this.logColor = logColor;
5704
5941
  this.propertyValue = term.propertyValue;
5942
+ this.getModelsAt = getModelsAt;
5943
+ this.requirementKeys = requirementKeys;
5944
+ this.requirementColor = requirementColor;
5705
5945
  this.loading = true;
5706
5946
  this.blankNodes = [];
5707
5947
  this.methodModelsCount = 0;
5708
5948
  this.rowsCount = 0;
5709
5949
  this.onlyRequired = true;
5710
5950
  this.showLegend = true;
5711
- this.LogStatus = LogStatus;
5712
- this.logIcon = logIcon;
5713
- this.logColor = logColor;
5714
5951
  this.suggestTerm = function (text$) { return text$.pipe(operators.distinctUntilChanged(), operators.switchMap(function (v) { return _this.suggestByTerm(v); })); };
5715
5952
  }
5716
5953
  NodeLogsModelsComponent.prototype.ngOnInit = function () {
5717
5954
  return __awaiter(this, void 0, void 0, function () {
5718
- var _c, models, _d, allModels, _e, originalValues, recalculatedValues, type, _f;
5719
- var _this = this;
5720
- return __generator(this, function (_g) {
5721
- switch (_g.label) {
5955
+ var _b, groupedLogs, logs, nodeType, config, models, _c, engineModels, _d, _e;
5956
+ return __generator(this, function (_f) {
5957
+ switch (_f.label) {
5722
5958
  case 0:
5723
- _c = this;
5724
- return [4 /*yield*/, this.engineService.ochestratorConfig(this.nodeType)];
5959
+ this.logsUrl = this.nodeService.nodeLogsUrl(this.node);
5960
+ // save as local variable to avoid "reserved yield keyword" issue
5961
+ _b = this;
5962
+ return [4 /*yield*/, this.getLogs()];
5725
5963
  case 1:
5726
- _c.config = _g.sent();
5964
+ // save as local variable to avoid "reserved yield keyword" issue
5965
+ _b.logs = _f.sent();
5966
+ groupedLogs = groupLogsByModel(this.logs);
5967
+ logs = this.logsKey ? groupedLogs[this.logsKey] : groupedLogs;
5968
+ nodeType = this.node['@type'] || this.node.type;
5969
+ return [4 /*yield*/, this.engineService.ochestratorConfig(nodeType)];
5970
+ case 2:
5971
+ config = _f.sent();
5727
5972
  return [4 /*yield*/, this.searchService.search({
5728
5973
  fields: ['@type', '@id', 'name'],
5729
5974
  limit: 1000,
@@ -5736,84 +5981,31 @@
5736
5981
  }
5737
5982
  }
5738
5983
  })];
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
5984
  case 3:
5748
- _d.methodsById = _g.sent();
5749
- if (!this.includeAllModels) return [3 /*break*/, 5];
5750
- return [4 /*yield*/, this.engineService.models()];
5985
+ models = (_f.sent()).results;
5986
+ _c = this;
5987
+ 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) {
5988
+ var _b;
5989
+ return (Object.assign(Object.assign({}, prev), (_b = {}, _b[curr['@id']] = curr, _b)));
5990
+ }, {})).toPromise()];
5751
5991
  case 4:
5752
- _e = _g.sent();
5753
- return [3 /*break*/, 6];
5992
+ _c.methodsById = _f.sent();
5993
+ if (!this.includeAllModels) return [3 /*break*/, 6];
5994
+ return [4 /*yield*/, this.engineService.models()];
5754
5995
  case 5:
5755
- _e = [];
5756
- _g.label = 6;
5996
+ _d = _f.sent();
5997
+ return [3 /*break*/, 7];
5757
5998
  case 6:
5758
- allModels = _e;
5759
- originalValues = (this.originalValues || []).filter(function (value) { return !value.deleted; });
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()];
5999
+ _d = [];
6000
+ _f.label = 7;
5768
6001
  case 7:
5769
- _f.allTerms = _g.sent();
5770
- this.allBlankNodes = this.allTerms.flatMap(function (term) {
5771
- var termId = term['@id'];
5772
- var termLogs = get$3(_this.logs, termId, {});
5773
- var original = originalValues.filter(function (v) { return termId === v.term['@id']; });
5774
- var recalculated = recalculatedValues.filter(function (v) { return termId === v.term['@id']; });
5775
- var hasData = !!original.length || !!recalculated.length || Object.keys(termLogs).length > 0;
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
- ]); }))));
6002
+ engineModels = _d;
6003
+ _e = this;
6004
+ return [4 /*yield*/, computeTerms(this.originalValues, this.recalculatedValues, this.terms, this.filterTermTypes)];
6005
+ case 8:
6006
+ _e.allTerms = _f.sent();
6007
+ this.allBlankNodes = this.allTerms.flatMap(groupLogsByTerm(nodeType, logs, engineModels, config, this.originalValues, this.recalculatedValues, this.nodeKey));
6008
+ this.methodModelsCount = modelCount(this.allBlankNodes);
5817
6009
  this.rowsCount = this.allBlankNodes.reduce(function (prev, curr) { return prev + 1 + curr.subValues.length + curr.keys.length; }, 0);
5818
6010
  this.filterResults();
5819
6011
  this.loading = false;
@@ -5822,22 +6014,8 @@
5822
6014
  });
5823
6015
  });
5824
6016
  };
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
- });
6017
+ NodeLogsModelsComponent.prototype.getLogs = function () {
6018
+ return this.nodeService.getLog(this.node).toPromise();
5841
6019
  };
5842
6020
  NodeLogsModelsComponent.prototype.suggestByTerm = function (term) {
5843
6021
  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());
@@ -5845,14 +6023,6 @@
5845
6023
  NodeLogsModelsComponent.prototype.trackByBlankNode = function (_index, node) {
5846
6024
  return node.termId;
5847
6025
  };
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
6026
  Object.defineProperty(NodeLogsModelsComponent.prototype, "filteredType", {
5857
6027
  get: function () {
5858
6028
  var _a;
@@ -5864,8 +6034,8 @@
5864
6034
  NodeLogsModelsComponent.prototype.filterResults = function () {
5865
6035
  var _this = this;
5866
6036
  setTimeout(function () {
5867
- _this.blankNodes = _this.allBlankNodes.filter(function (_c) {
5868
- var isRequired = _c.isRequired, name = _c.term.name;
6037
+ _this.blankNodes = _this.allBlankNodes.filter(function (_b) {
6038
+ var isRequired = _b.isRequired, name = _b.term.name;
5869
6039
  var _a;
5870
6040
  return _this.term
5871
6041
  ? name.toLowerCase().includes(_this.term.toLowerCase())
@@ -5873,76 +6043,15 @@
5873
6043
  });
5874
6044
  });
5875
6045
  };
5876
- /** Logs **/
5877
- NodeLogsModelsComponent.prototype.getSubvalueLogs = function (node, _c) {
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) {
6046
+ NodeLogsModelsComponent.prototype.methodName = function (_b) {
6047
+ var methodId = _b.methodId;
5905
6048
  var _a;
5906
- var log = this.getLogs(node, methodId, subValue);
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';
6049
+ return ((_a = this.methodsById[methodId]) === null || _a === void 0 ? void 0 : _a.name) || methodIdLabel(methodId);
5941
6050
  };
5942
6051
  return NodeLogsModelsComponent;
5943
6052
  }());
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 } });
6053
+ 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 });
6054
+ 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
6055
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: NodeLogsModelsComponent, decorators: [{
5947
6056
  type: i0.Component,
5948
6057
  args: [{
@@ -5950,24 +6059,22 @@
5950
6059
  templateUrl: './node-logs-models.component.html',
5951
6060
  styleUrls: ['./node-logs-models.component.scss']
5952
6061
  }]
5953
- }], ctorParameters: function () { return [{ type: HeSearchService }, { type: HeEngineService }]; }, propDecorators: { nodeType: [{
6062
+ }], ctorParameters: function () { return [{ type: HeNodeService }, { type: HeSearchService }, { type: HeEngineService }]; }, propDecorators: { node: [{
5954
6063
  type: i0.Input
5955
6064
  }], nodeKey: [{
5956
6065
  type: i0.Input
5957
6066
  }], includeAllModels: [{
5958
6067
  type: i0.Input
5959
- }], logsUrl: [{
5960
- type: i0.Input
5961
6068
  }], originalValues: [{
5962
6069
  type: i0.Input
5963
6070
  }], recalculatedValues: [{
5964
6071
  type: i0.Input
5965
6072
  }], terms: [{
5966
6073
  type: i0.Input
5967
- }], logs: [{
5968
- type: i0.Input
5969
6074
  }], filterTermTypes: [{
5970
6075
  type: i0.Input
6076
+ }], logsKey: [{
6077
+ type: i0.Input
5971
6078
  }] } });
5972
6079
 
5973
6080
  var NodeMissingLookupFactorsComponent = /** @class */ (function () {
@@ -6016,7 +6123,7 @@
6016
6123
  'operation', 'impactAssessment', 'properties'
6017
6124
  ];
6018
6125
  var tableKeys = [
6019
- 'inputs', 'transformation', 'value', 'dates', 'methodModel', 'methodTier', 'statsDefinition'
6126
+ 'inputs', 'transformation', 'operation', 'value', 'dates', 'methodModel', 'methodTier', 'statsDefinition'
6020
6127
  ];
6021
6128
  var NodeValueDetailsComponent = /** @class */ (function () {
6022
6129
  function NodeValueDetailsComponent() {
@@ -6243,30 +6350,11 @@
6243
6350
  Tab["products"] = "Products";
6244
6351
  })(Tab || (Tab = {}));
6245
6352
  var CyclesActivityLogsComponent = /** @class */ (function () {
6246
- function CyclesActivityLogsComponent(nodeService) {
6247
- this.nodeService = nodeService;
6248
- this.loading = true;
6353
+ function CyclesActivityLogsComponent() {
6249
6354
  this.NodeType = schema.NodeType;
6250
6355
  this.Tab = Tab;
6251
6356
  this.selectedTab = Tab.products;
6252
6357
  }
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
6358
  Object.defineProperty(CyclesActivityLogsComponent.prototype, "node", {
6271
6359
  get: function () {
6272
6360
  return Object.assign(Object.assign({}, this.cycle), { '@type': schema.NodeType.Cycle, type: schema.NodeType.Cycle, dataState: api.DataState.recalculated });
@@ -6274,10 +6362,17 @@
6274
6362
  enumerable: false,
6275
6363
  configurable: true
6276
6364
  });
6365
+ Object.defineProperty(CyclesActivityLogsComponent.prototype, "logsKey", {
6366
+ get: function () {
6367
+ return logsKey(this.cycle);
6368
+ },
6369
+ enumerable: false,
6370
+ configurable: true
6371
+ });
6277
6372
  return CyclesActivityLogsComponent;
6278
6373
  }());
6279
- CyclesActivityLogsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesActivityLogsComponent, deps: [{ token: HeNodeService }], target: i0__namespace.ɵɵFactoryTarget.Component });
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: "<ng-container *ngIf=\"!loading; else loader\">\n <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 [logsUrl]=\"logsUrl\"\n [nodeType]=\"NodeType.Cycle\"\n [originalValues]=\"original?.products\"\n [recalculatedValues]=\"recalculated?.products\"\n [logs]=\"logs\"\n ></he-node-logs-models>\n\n <he-node-logs-models *ngIf=\"selectedTab === Tab.inputs\"\n [logsUrl]=\"logsUrl\"\n [nodeType]=\"NodeType.Cycle\"\n [originalValues]=\"original?.inputs\"\n [recalculatedValues]=\"recalculated?.inputs\"\n [logs]=\"logs\"\n ></he-node-logs-models>\n</ng-container>\n\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: ["nodeType", "nodeKey", "includeAllModels", "logsUrl", "originalValues", "recalculatedValues", "terms", "logs", "filterTermTypes"] }, { 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"] }] });
6374
+ CyclesActivityLogsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesActivityLogsComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
6375
+ 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
6376
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesActivityLogsComponent, decorators: [{
6282
6377
  type: i0.Component,
6283
6378
  args: [{
@@ -6285,7 +6380,7 @@
6285
6380
  templateUrl: './cycles-activity-logs.component.html',
6286
6381
  styleUrls: ['./cycles-activity-logs.component.scss']
6287
6382
  }]
6288
- }], ctorParameters: function () { return [{ type: HeNodeService }]; }, propDecorators: { cycle: [{
6383
+ }], propDecorators: { cycle: [{
6289
6384
  type: i0.Input
6290
6385
  }], original: [{
6291
6386
  type: i0.Input
@@ -6518,9 +6613,8 @@
6518
6613
  }] } });
6519
6614
 
6520
6615
  var CyclesEmissionsLogsComponent = /** @class */ (function () {
6521
- function CyclesEmissionsLogsComponent(searchService, nodeService) {
6616
+ function CyclesEmissionsLogsComponent(searchService) {
6522
6617
  this.searchService = searchService;
6523
- this.nodeService = nodeService;
6524
6618
  this.originalValues = [];
6525
6619
  this.recalculatedValues = [];
6526
6620
  this.loading = true;
@@ -6530,28 +6624,22 @@
6530
6624
  }
6531
6625
  CyclesEmissionsLogsComponent.prototype.ngOnInit = function () {
6532
6626
  return __awaiter(this, void 0, void 0, function () {
6533
- var logs, emissions;
6627
+ var emissions;
6534
6628
  return __generator(this, function (_a) {
6535
6629
  switch (_a.label) {
6536
- case 0:
6537
- this.logsUrl = this.nodeService.nodeLogsUrl(this.node);
6538
- return [4 /*yield*/, this.nodeService.getModelsLog(this.node)];
6539
- case 1:
6540
- logs = _a.sent();
6541
- this.logs = parseLogs(this.cycle, logs);
6542
- return [4 /*yield*/, this.searchService.search({
6543
- fields: ['@type', '@id', 'name', 'units'],
6544
- limit: 1000,
6545
- query: {
6546
- bool: {
6547
- must: [
6548
- matchType(schema.NodeType.Term),
6549
- matchTermType(schema.TermTermType.emission)
6550
- ]
6551
- }
6630
+ case 0: return [4 /*yield*/, this.searchService.search({
6631
+ fields: ['@type', '@id', 'name', 'units'],
6632
+ limit: 1000,
6633
+ query: {
6634
+ bool: {
6635
+ must: [
6636
+ matchType(schema.NodeType.Term),
6637
+ matchTermType(schema.TermTermType.emission)
6638
+ ]
6552
6639
  }
6553
- })];
6554
- case 2:
6640
+ }
6641
+ })];
6642
+ case 1:
6555
6643
  emissions = (_a.sent()).results;
6556
6644
  this.emissions = emissions;
6557
6645
  this.loading = false;
@@ -6567,10 +6655,17 @@
6567
6655
  enumerable: false,
6568
6656
  configurable: true
6569
6657
  });
6658
+ Object.defineProperty(CyclesEmissionsLogsComponent.prototype, "logsKey", {
6659
+ get: function () {
6660
+ return logsKey(this.cycle);
6661
+ },
6662
+ enumerable: false,
6663
+ configurable: true
6664
+ });
6570
6665
  return CyclesEmissionsLogsComponent;
6571
6666
  }());
6572
- CyclesEmissionsLogsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesEmissionsLogsComponent, deps: [{ token: HeSearchService }, { token: HeNodeService }], target: i0__namespace.ɵɵFactoryTarget.Component });
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 [logsUrl]=\"logsUrl\"\n [nodeType]=\"NodeType.Cycle\"\n [originalValues]=\"originalValues\"\n [recalculatedValues]=\"recalculatedValues\"\n [terms]=\"emissions\"\n [logs]=\"logs\"\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: ["nodeType", "nodeKey", "includeAllModels", "logsUrl", "originalValues", "recalculatedValues", "terms", "logs", "filterTermTypes"] }, { 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"] }] });
6667
+ 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 });
6668
+ 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
6669
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesEmissionsLogsComponent, decorators: [{
6575
6670
  type: i0.Component,
6576
6671
  args: [{
@@ -6578,7 +6673,7 @@
6578
6673
  templateUrl: './cycles-emissions-logs.component.html',
6579
6674
  styleUrls: ['./cycles-emissions-logs.component.scss']
6580
6675
  }]
6581
- }], ctorParameters: function () { return [{ type: HeSearchService }, { type: HeNodeService }]; }, propDecorators: { cycle: [{
6676
+ }], ctorParameters: function () { return [{ type: HeSearchService }]; }, propDecorators: { cycle: [{
6582
6677
  type: i0.Input
6583
6678
  }], originalValues: [{
6584
6679
  type: i0.Input
@@ -6714,31 +6809,12 @@
6714
6809
  }] } });
6715
6810
 
6716
6811
  var CyclesPracticesLogsComponent = /** @class */ (function () {
6717
- function CyclesPracticesLogsComponent(nodeService) {
6718
- this.nodeService = nodeService;
6812
+ function CyclesPracticesLogsComponent() {
6719
6813
  this.originalValues = [];
6720
6814
  this.recalculatedValues = [];
6721
- this.loading = true;
6722
6815
  this.NodeType = schema.NodeType;
6723
6816
  this.models = [];
6724
6817
  }
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
6818
  Object.defineProperty(CyclesPracticesLogsComponent.prototype, "node", {
6743
6819
  get: function () {
6744
6820
  return Object.assign(Object.assign({}, this.cycle), { '@type': schema.NodeType.Cycle, type: schema.NodeType.Cycle, dataState: api.DataState.recalculated });
@@ -6746,10 +6822,17 @@
6746
6822
  enumerable: false,
6747
6823
  configurable: true
6748
6824
  });
6825
+ Object.defineProperty(CyclesPracticesLogsComponent.prototype, "logsKey", {
6826
+ get: function () {
6827
+ return logsKey(this.cycle);
6828
+ },
6829
+ enumerable: false,
6830
+ configurable: true
6831
+ });
6749
6832
  return CyclesPracticesLogsComponent;
6750
6833
  }());
6751
- CyclesPracticesLogsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesPracticesLogsComponent, deps: [{ token: HeNodeService }], target: i0__namespace.ɵɵFactoryTarget.Component });
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 *ngIf=\"!loading; else loader\"\n [logsUrl]=\"logsUrl\"\n [nodeType]=\"NodeType.Cycle\"\n [originalValues]=\"originalValues\"\n [recalculatedValues]=\"recalculatedValues\"\n [logs]=\"logs\"\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: ["nodeType", "nodeKey", "includeAllModels", "logsUrl", "originalValues", "recalculatedValues", "terms", "logs", "filterTermTypes"] }, { 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"] }] });
6834
+ CyclesPracticesLogsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesPracticesLogsComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
6835
+ 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
6836
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesPracticesLogsComponent, decorators: [{
6754
6837
  type: i0.Component,
6755
6838
  args: [{
@@ -6757,7 +6840,7 @@
6757
6840
  templateUrl: './cycles-practices-logs.component.html',
6758
6841
  styleUrls: ['./cycles-practices-logs.component.scss']
6759
6842
  }]
6760
- }], ctorParameters: function () { return [{ type: HeNodeService }]; }, propDecorators: { cycle: [{
6843
+ }], propDecorators: { cycle: [{
6761
6844
  type: i0.Input
6762
6845
  }], originalValues: [{
6763
6846
  type: i0.Input
@@ -8358,9 +8441,8 @@
8358
8441
  };
8359
8442
 
8360
8443
  var SitesMeasurementsLogsComponent = /** @class */ (function () {
8361
- function SitesMeasurementsLogsComponent(searchService, nodeService) {
8444
+ function SitesMeasurementsLogsComponent(searchService) {
8362
8445
  this.searchService = searchService;
8363
- this.nodeService = nodeService;
8364
8446
  this.originalValues = [];
8365
8447
  this.recalculatedValues = [];
8366
8448
  this.loading = true;
@@ -8371,29 +8453,23 @@
8371
8453
  }
8372
8454
  SitesMeasurementsLogsComponent.prototype.ngOnInit = function () {
8373
8455
  return __awaiter(this, void 0, void 0, function () {
8374
- var _a, measurements;
8375
- return __generator(this, function (_b) {
8376
- switch (_b.label) {
8377
- case 0:
8378
- this.logsUrl = this.nodeService.nodeLogsUrl(this.node);
8379
- _a = this;
8380
- return [4 /*yield*/, this.nodeService.getModelsLog(this.node)];
8381
- case 1:
8382
- _a.logs = _b.sent();
8383
- return [4 /*yield*/, this.searchService.search({
8384
- fields: ['@type', '@id', 'name', 'units'],
8385
- limit: 1000,
8386
- query: {
8387
- bool: {
8388
- must: [
8389
- matchType(schema.NodeType.Term),
8390
- matchTermType(schema.TermTermType.measurement)
8391
- ]
8392
- }
8456
+ var measurements;
8457
+ return __generator(this, function (_a) {
8458
+ switch (_a.label) {
8459
+ case 0: return [4 /*yield*/, this.searchService.search({
8460
+ fields: ['@type', '@id', 'name', 'units'],
8461
+ limit: 1000,
8462
+ query: {
8463
+ bool: {
8464
+ must: [
8465
+ matchType(schema.NodeType.Term),
8466
+ matchTermType(schema.TermTermType.measurement)
8467
+ ]
8393
8468
  }
8394
- })];
8395
- case 2:
8396
- measurements = (_b.sent()).results;
8469
+ }
8470
+ })];
8471
+ case 1:
8472
+ measurements = (_a.sent()).results;
8397
8473
  this.measurements = measurements;
8398
8474
  this.loading = false;
8399
8475
  return [2 /*return*/];
@@ -8410,8 +8486,8 @@
8410
8486
  });
8411
8487
  return SitesMeasurementsLogsComponent;
8412
8488
  }());
8413
- SitesMeasurementsLogsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SitesMeasurementsLogsComponent, deps: [{ token: HeSearchService }, { token: HeNodeService }], target: i0__namespace.ɵɵFactoryTarget.Component });
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 [logsUrl]=\"logsUrl\"\n [nodeType]=\"NodeType.Site\"\n [originalValues]=\"originalValues\"\n [recalculatedValues]=\"recalculatedValues\"\n [terms]=\"measurements\"\n [logs]=\"logs\"\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: ["nodeType", "nodeKey", "includeAllModels", "logsUrl", "originalValues", "recalculatedValues", "terms", "logs", "filterTermTypes"] }, { 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"] }] });
8489
+ 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 });
8490
+ 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
8491
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SitesMeasurementsLogsComponent, decorators: [{
8416
8492
  type: i0.Component,
8417
8493
  args: [{
@@ -8419,7 +8495,7 @@
8419
8495
  templateUrl: './sites-measurements-logs.component.html',
8420
8496
  styleUrls: ['./sites-measurements-logs.component.scss']
8421
8497
  }]
8422
- }], ctorParameters: function () { return [{ type: HeSearchService }, { type: HeNodeService }]; }, propDecorators: { site: [{
8498
+ }], ctorParameters: function () { return [{ type: HeSearchService }]; }, propDecorators: { site: [{
8423
8499
  type: i0.Input
8424
8500
  }], originalValues: [{
8425
8501
  type: i0.Input
@@ -9187,7 +9263,7 @@
9187
9263
  return data.logger === 'hestia_earth.models' && data.level === exports.Level.debug;
9188
9264
  }), operators.map(function (_d) {
9189
9265
  var data = _d.data;
9190
- return parseMessage(data.message);
9266
+ return parseMessage$1(data.message);
9191
9267
  }), 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
9268
  var _a;
9193
9269
  var log = values[0];
@@ -9468,9 +9544,8 @@
9468
9544
  }] } });
9469
9545
 
9470
9546
  var ImpactAssessmentsProductsLogsComponent = /** @class */ (function () {
9471
- function ImpactAssessmentsProductsLogsComponent(searchService, nodeService) {
9547
+ function ImpactAssessmentsProductsLogsComponent(searchService) {
9472
9548
  this.searchService = searchService;
9473
- this.nodeService = nodeService;
9474
9549
  this.originalValues = [];
9475
9550
  this.recalculatedValues = [];
9476
9551
  this.loading = true;
@@ -9480,30 +9555,24 @@
9480
9555
  }
9481
9556
  ImpactAssessmentsProductsLogsComponent.prototype.ngOnInit = function () {
9482
9557
  return __awaiter(this, void 0, void 0, function () {
9483
- var _a, terms, showAllEmissions;
9484
- return __generator(this, function (_b) {
9485
- switch (_b.label) {
9486
- case 0:
9487
- this.logsUrl = this.nodeService.nodeLogsUrl(this.node);
9488
- _a = this;
9489
- return [4 /*yield*/, this.nodeService.getModelsLog(this.node)];
9490
- case 1:
9491
- _a.logs = _b.sent();
9492
- return [4 /*yield*/, this.searchService.search({
9493
- fields: ['@type', '@id', 'name', 'units'],
9494
- limit: 1000,
9495
- query: {
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
- }
9558
+ var terms, showAllEmissions;
9559
+ return __generator(this, function (_a) {
9560
+ switch (_a.label) {
9561
+ case 0: return [4 /*yield*/, this.searchService.search({
9562
+ fields: ['@type', '@id', 'name', 'units'],
9563
+ limit: 1000,
9564
+ query: {
9565
+ bool: {
9566
+ must: [
9567
+ matchType(schema.NodeType.Term)
9568
+ ],
9569
+ should: (this.filterTermTypes || []).map(function (termType) { return matchTermType(termType); }),
9570
+ minimum_should_match: 1
9503
9571
  }
9504
- })];
9505
- case 2:
9506
- terms = (_b.sent()).results;
9572
+ }
9573
+ })];
9574
+ case 1:
9575
+ terms = (_a.sent()).results;
9507
9576
  showAllEmissions = this.key !== 'emissionsResourceUse' || (this.filterTermTypes || []).length === 1;
9508
9577
  this.terms = showAllEmissions ? terms : [];
9509
9578
  this.loading = false;
@@ -9528,8 +9597,8 @@
9528
9597
  });
9529
9598
  return ImpactAssessmentsProductsLogsComponent;
9530
9599
  }());
9531
- ImpactAssessmentsProductsLogsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ImpactAssessmentsProductsLogsComponent, deps: [{ token: HeSearchService }, { token: HeNodeService }], target: i0__namespace.ɵɵFactoryTarget.Component });
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 [logsUrl]=\"logsUrl\"\n [nodeType]=\"NodeType.ImpactAssessment\"\n [nodeKey]=\"key\"\n [originalValues]=\"originalValues\"\n [recalculatedValues]=\"recalculatedValues\"\n [terms]=\"terms\"\n [logs]=\"logs\"\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: ["nodeType", "nodeKey", "includeAllModels", "logsUrl", "originalValues", "recalculatedValues", "terms", "logs", "filterTermTypes"] }, { 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"] }] });
9600
+ 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 });
9601
+ 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
9602
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ImpactAssessmentsProductsLogsComponent, decorators: [{
9534
9603
  type: i0.Component,
9535
9604
  args: [{
@@ -9537,7 +9606,7 @@
9537
9606
  templateUrl: './impact-assessments-products-logs.component.html',
9538
9607
  styleUrls: ['./impact-assessments-products-logs.component.scss']
9539
9608
  }]
9540
- }], ctorParameters: function () { return [{ type: HeSearchService }, { type: HeNodeService }]; }, propDecorators: { impactAssessment: [{
9609
+ }], ctorParameters: function () { return [{ type: HeSearchService }]; }, propDecorators: { impactAssessment: [{
9541
9610
  type: i0.Input
9542
9611
  }], key: [{
9543
9612
  type: i0.Input
@@ -9709,7 +9778,7 @@
9709
9778
  return ImpactAssessmentsProductsComponent;
9710
9779
  }());
9711
9780
  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 } });
9781
+ 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
9782
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ImpactAssessmentsProductsComponent, decorators: [{
9714
9783
  type: i0.Component,
9715
9784
  args: [{
@@ -9916,6 +9985,7 @@
9916
9985
  exports.calculateCycleStartDateEnabled = calculateCycleStartDateEnabled;
9917
9986
  exports.clustererImage = clustererImage;
9918
9987
  exports.code = code;
9988
+ exports.computeTerms = computeTerms;
9919
9989
  exports.coordinatesToPoint = coordinatesToPoint;
9920
9990
  exports.copyObject = copyObject;
9921
9991
  exports.countriesQuery = countriesQuery;
@@ -9950,6 +10020,8 @@
9950
10020
  exports.gitHome = gitHome;
9951
10021
  exports.gitRawBaseUrl = gitRawBaseUrl;
9952
10022
  exports.groupChanged = groupChanged;
10023
+ exports.groupLogsByModel = groupLogsByModel;
10024
+ exports.groupLogsByTerm = groupLogsByTerm;
9953
10025
  exports.handleAPIError = handleAPIError;
9954
10026
  exports.hasError = hasError;
9955
10027
  exports.hasWarning = hasWarning;
@@ -9967,6 +10039,7 @@
9967
10039
  exports.linkTypeEnabled = linkTypeEnabled;
9968
10040
  exports.listColor = listColor;
9969
10041
  exports.locationQuery = locationQuery;
10042
+ exports.logsKey = logsKey;
9970
10043
  exports.lookupUrl = lookupUrl;
9971
10044
  exports.lookups = lookups;
9972
10045
  exports.mapsUrl = mapsUrl;
@@ -9990,6 +10063,7 @@
9990
10063
  exports.measurementValue = measurementValue;
9991
10064
  exports.missingNodeErrorMessage = missingNodeErrorMessage;
9992
10065
  exports.missingNodeErrors = missingNodeErrors;
10066
+ exports.modelCount = modelCount;
9993
10067
  exports.modelKeyParams = modelKeyParams;
9994
10068
  exports.modelParams = modelParams;
9995
10069
  exports.multiMatchQuery = multiMatchQuery;
@@ -10006,8 +10080,7 @@
10006
10080
  exports.parseData = parseData;
10007
10081
  exports.parseDataPath = parseDataPath;
10008
10082
  exports.parseLines = parseLines;
10009
- exports.parseLogs = parseLogs;
10010
- exports.parseMessage = parseMessage;
10083
+ exports.parseMessage = parseMessage$1;
10011
10084
  exports.parseNewValue = parseNewValue;
10012
10085
  exports.pathToApiDocsPath = pathToApiDocsPath;
10013
10086
  exports.pointToCoordinates = pointToCoordinates;