@hestia-earth/ui-components 0.2.6 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/hestia-earth-ui-components.umd.js +134 -121
- package/bundles/hestia-earth-ui-components.umd.js.map +1 -1
- package/common/maps-utils.d.ts +1 -1
- package/common/node-utils.d.ts +3 -2
- package/engine/engine.service.d.ts +1 -0
- package/esm2015/common/link-key-value/link-key-value.component.js +15 -6
- package/esm2015/common/maps-utils.js +12 -9
- package/esm2015/common/node-utils.js +3 -1
- package/esm2015/engine/engine.service.js +2 -2
- package/esm2015/files/files-form.model.js +2 -1
- package/esm2015/impact-assessments/impact-assessments-indicator-breakdown-chart/impact-assessments-indicator-breakdown-chart.component.js +26 -18
- package/esm2015/impact-assessments/impact-assessments-products/impact-assessments-products.component.js +3 -11
- package/esm2015/impact-assessments/impact-assessments-products-logs/impact-assessments-products-logs.component.js +6 -5
- package/esm2015/node/node-logs-models/node-logs-models.component.js +46 -47
- package/esm2015/node/node-value-details/node-value-details.component.js +2 -2
- package/esm2015/sites/sites-maps/sites-maps.component.js +2 -7
- package/esm2015/terms/terms.model.js +2 -2
- package/fesm2015/hestia-earth-ui-components.js +106 -96
- package/fesm2015/hestia-earth-ui-components.js.map +1 -1
- package/impact-assessments/impact-assessments-indicator-breakdown-chart/impact-assessments-indicator-breakdown-chart.component.d.ts +2 -0
- package/impact-assessments/impact-assessments-products/impact-assessments-products.component.d.ts +1 -1
- package/impact-assessments/impact-assessments-products-logs/impact-assessments-products-logs.component.d.ts +1 -1
- package/node/node-logs-models/node-logs-models.component.d.ts +8 -5
- package/package.json +3 -3
|
@@ -23,6 +23,7 @@ import { keyToLabel, isUndefined, isNumber, toPrecision, toDashCase, isBoolean,
|
|
|
23
23
|
import * as pluralize from 'pluralize';
|
|
24
24
|
import { catchError, map, take, mergeMap, debounceTime, distinctUntilChanged, tap, switchMap, reduce, filter, distinct, toArray, mergeAll, groupBy } from 'rxjs/operators';
|
|
25
25
|
import { propertyValue as propertyValue$1, emptyValue } from '@hestia-earth/utils/dist/term';
|
|
26
|
+
import { getDefaultModeId } from '@hestia-earth/glossary';
|
|
26
27
|
import { __rest, __awaiter } from 'tslib';
|
|
27
28
|
import * as csvtojson from 'csvtojson';
|
|
28
29
|
import * as i1$3 from '@angular/common/http';
|
|
@@ -38,7 +39,6 @@ import * as moment from 'moment';
|
|
|
38
39
|
import 'moment/locale/en-gb';
|
|
39
40
|
import { v4 } from 'uuid';
|
|
40
41
|
import MarkerClusterer from '@google/markerclustererplus';
|
|
41
|
-
import { getDefaultModeId } from '@hestia-earth/glossary';
|
|
42
42
|
import ChartDataLabels from 'chartjs-plugin-datalabels';
|
|
43
43
|
|
|
44
44
|
class HeAuthService {
|
|
@@ -480,7 +480,7 @@ const groups = Object.freeze({
|
|
|
480
480
|
},
|
|
481
481
|
practice: {
|
|
482
482
|
label: 'Practices',
|
|
483
|
-
termType: '
|
|
483
|
+
termType: 'Practices',
|
|
484
484
|
children: termTypesToChildren([
|
|
485
485
|
TermTermType.animalManagement,
|
|
486
486
|
TermTermType.aquacultureManagement,
|
|
@@ -682,6 +682,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
682
682
|
}] });
|
|
683
683
|
|
|
684
684
|
const get$5 = require('lodash.get');
|
|
685
|
+
const isMethodModelAllowed = (filterMethod) => (node) => { var _a, _b; return ((_a = node.methodModel) === null || _a === void 0 ? void 0 : _a['@id']) === (filterMethod ? filterMethod['@id'] : getDefaultModeId((_b = node.term) === null || _b === void 0 ? void 0 : _b['@id'])); };
|
|
685
686
|
var NodeKeyState;
|
|
686
687
|
(function (NodeKeyState) {
|
|
687
688
|
NodeKeyState["added"] = "added";
|
|
@@ -1368,9 +1369,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
1368
1369
|
args: ['window:resize', []]
|
|
1369
1370
|
}] } });
|
|
1370
1371
|
|
|
1372
|
+
const valueLink = (value) => isExpandable(value) && value['@id'] ? [baseUrl(), value['@type'].toLowerCase(), value['@id']].join('/') : null;
|
|
1373
|
+
const valueLinkRef = (value, href) => href ? `<a href="${href}">${value.name || value['@id']}</a>` : null;
|
|
1371
1374
|
const stringMapper = {
|
|
1372
1375
|
undefined: () => '',
|
|
1373
|
-
|
|
1376
|
+
blankNode: value => 'term' in value
|
|
1377
|
+
? `${valueLinkRef(value.term, valueLink(value.term))}${'value' in value ? `: ${value.value}` : ''}`
|
|
1378
|
+
: valueLinkRef(value, valueLink(value)) || value.name || value['@id'],
|
|
1379
|
+
object: value => Array.isArray(value)
|
|
1380
|
+
? value.map(toString).join(', ')
|
|
1381
|
+
: value instanceof Date
|
|
1382
|
+
? value.toJSON()
|
|
1383
|
+
: isExpandable(value)
|
|
1384
|
+
? stringMapper.blankNode(value)
|
|
1385
|
+
: JSON.stringify(value, null, 2)
|
|
1374
1386
|
};
|
|
1375
1387
|
const toString = (value) => typeof value in stringMapper ? stringMapper[typeof value](value) : value.toString();
|
|
1376
1388
|
class LinkKeyValueComponent {
|
|
@@ -1388,9 +1400,7 @@ class LinkKeyValueComponent {
|
|
|
1388
1400
|
return toString(this.value);
|
|
1389
1401
|
}
|
|
1390
1402
|
get valueLink() {
|
|
1391
|
-
return
|
|
1392
|
-
[baseUrl(), this.value['@type'].toLowerCase(), this.value['@id']].join('/') :
|
|
1393
|
-
null;
|
|
1403
|
+
return valueLink(this.value);
|
|
1394
1404
|
}
|
|
1395
1405
|
get isArray() {
|
|
1396
1406
|
return Array.isArray(this.value) && this.value.length > 1;
|
|
@@ -1400,7 +1410,7 @@ class LinkKeyValueComponent {
|
|
|
1400
1410
|
}
|
|
1401
1411
|
}
|
|
1402
1412
|
LinkKeyValueComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: LinkKeyValueComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1403
|
-
LinkKeyValueComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: LinkKeyValueComponent, selector: "he-link-key-value", inputs: { node: "node", nodeType: "nodeType", dataKey: "dataKey", key: "key" }, ngImport: i0, template: "<ng-container *ngIf=\"!isUndefined\">\n <ng-container *bindOnce=\"node\">\n <a [href]=\"baseUrl + '/schema/' + type + '#' + key\" target=\"_blank\"><b>{{key}}</b></a>\n <span class=\"pr-2\">:</span>\n <
|
|
1413
|
+
LinkKeyValueComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: LinkKeyValueComponent, selector: "he-link-key-value", inputs: { node: "node", nodeType: "nodeType", dataKey: "dataKey", key: "key" }, ngImport: i0, template: "<ng-container *ngIf=\"!isUndefined\">\n <ng-container *bindOnce=\"node\">\n <a [href]=\"baseUrl + '/schema/' + type + '#' + key\" target=\"_blank\"><b>{{key}}</b></a>\n <span class=\"pr-2\">:</span>\n\n <ng-container *ngIf=\"isArray; else singleValue\">\n <div class=\"array-container pl-2\">\n <p *ngFor=\"let v of value\" [innerHtml]=\"toString(v) | precision:3\"></p>\n </div>\n </ng-container>\n </ng-container>\n</ng-container>\n\n<ng-template #singleValue>\n <div class=\"is-inline-block pr-1\" [innerHtml]=\"valueString | precision:3\"></div>\n\n <he-blank-node-state\n [node]=\"node\" [nodeType]=\"nodeType\" [dataKey]=\"dataKey\" [key]=\"key\"\n ></he-blank-node-state>\n</ng-template>\n", styles: [":host{display:block}.array-container{max-height:100px;overflow-y:auto}\n"], components: [{ type: BlankNodeStateComponent, selector: "he-blank-node-state", inputs: ["nodeType", "dataKey", "key", "node", "state"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: BindOnceDirective, selector: "[bindOnce]", inputs: ["bindOnce"] }, { type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "precision": PrecisionPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1404
1414
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: LinkKeyValueComponent, decorators: [{
|
|
1405
1415
|
type: Component$1,
|
|
1406
1416
|
args: [{
|
|
@@ -1486,9 +1496,11 @@ const feature = Object.freeze({
|
|
|
1486
1496
|
});
|
|
1487
1497
|
const defaultFeature = () => (Object.assign({}, feature));
|
|
1488
1498
|
const pointToCoordinates = (point) => [point.lng(), point.lat()];
|
|
1489
|
-
const coordinatesToPoint = (values) => Array.isArray(values[0])
|
|
1490
|
-
values.map((v) => coordinatesToPoint(v))
|
|
1491
|
-
|
|
1499
|
+
const coordinatesToPoint = (values) => Array.isArray(values[0])
|
|
1500
|
+
? values.map((v) => coordinatesToPoint(v))
|
|
1501
|
+
: values.some(isNaN)
|
|
1502
|
+
? null
|
|
1503
|
+
: new google.maps.LatLng(values[1], values[0]);
|
|
1492
1504
|
const polygonToCoordinates = (polygon) => polygon.getPaths().getArray().map(path => {
|
|
1493
1505
|
const points = path.getArray();
|
|
1494
1506
|
return [
|
|
@@ -1517,11 +1529,12 @@ const polygonsFromFeature = (feat) => feat.type === 'FeatureCollection'
|
|
|
1517
1529
|
: (getCoordinates(feat) || []).map(coordinatesToPolygon);
|
|
1518
1530
|
const polygonBounds = (polygon) => {
|
|
1519
1531
|
var _a;
|
|
1520
|
-
|
|
1521
|
-
Array.isArray(polygon)
|
|
1522
|
-
polygon.
|
|
1523
|
-
((
|
|
1524
|
-
|
|
1532
|
+
const paths = polygon
|
|
1533
|
+
? Array.isArray(polygon)
|
|
1534
|
+
? polygon.flatMap(p => { var _a; return ((_a = p.getPath()) === null || _a === void 0 ? void 0 : _a.getArray()) || []; })
|
|
1535
|
+
: ((_a = polygon.getPath()) === null || _a === void 0 ? void 0 : _a.getArray()) || []
|
|
1536
|
+
: [];
|
|
1537
|
+
return paths.reduce((prev, curr) => prev.extend(curr), new google.maps.LatLngBounds());
|
|
1525
1538
|
};
|
|
1526
1539
|
|
|
1527
1540
|
class MapsDrawingConfirmComponent {
|
|
@@ -4519,6 +4532,10 @@ const reduceValues = (values, termId) => {
|
|
|
4519
4532
|
.filter(v => v !== null);
|
|
4520
4533
|
return propertyValues.length ? propertyValues.reduce((p, v) => p + v, 0) : undefined;
|
|
4521
4534
|
};
|
|
4535
|
+
const isRunOrchestrator = (log) => !('shouldRunOrchestrator' in log) || log.shouldRunOrchestrator;
|
|
4536
|
+
const hasLog = (log, withOrchestrator = true) => !!log && ('shouldRun' in log ||
|
|
4537
|
+
'runRequired' in log ||
|
|
4538
|
+
(withOrchestrator && 'shouldRunOrchestrator' in log));
|
|
4522
4539
|
const isRecalculated = (values, key = 'value') => values.some(v => ([
|
|
4523
4540
|
...(v.added || []),
|
|
4524
4541
|
...(v.updated || [])
|
|
@@ -4549,19 +4566,25 @@ const blankNodeValue = (blankNodes, key, id) => blankNodeValueByKey[key in blank
|
|
|
4549
4566
|
const logSubValue = (logs, key, prop) => logs[key][prop] ? (Array.isArray(logs[key][prop]) ?
|
|
4550
4567
|
logs[key][prop].map(id => ({ key: prop, id })) :
|
|
4551
4568
|
{ key: prop, id: logs[key][prop] }) : undefined;
|
|
4552
|
-
const
|
|
4553
|
-
|
|
4554
|
-
|
|
4555
|
-
|
|
4556
|
-
|
|
4557
|
-
|
|
4558
|
-
|
|
4569
|
+
const logProperties = (nodes, models) => nodes.flatMap(node => (node.properties || []).map(({ term }) => term['@id'])).map(id => ({ key: 'property', id, configModels: findModels(models, id).map(({ model }) => model) }));
|
|
4570
|
+
const logSubValues = (logs, original, recalculated, models) => unique([
|
|
4571
|
+
...Object.keys(logs).flatMap(key => [
|
|
4572
|
+
logSubValue(logs, key, 'input'),
|
|
4573
|
+
logSubValue(logs, key, 'property')
|
|
4574
|
+
]
|
|
4575
|
+
.flat()
|
|
4576
|
+
.filter(Boolean)
|
|
4577
|
+
.map(v => (Object.assign(Object.assign({}, v), { configModels: [key] })))),
|
|
4578
|
+
...logProperties(original, models),
|
|
4579
|
+
...logProperties(recalculated, models)
|
|
4580
|
+
])
|
|
4559
4581
|
.map(v => {
|
|
4560
4582
|
const originalValue = blankNodeValue(original, v.key, v.id);
|
|
4561
4583
|
const recalculatedValue = blankNodeValue(recalculated, v.key, v.id);
|
|
4562
|
-
return Object.assign(Object.assign({}, v), { configModels:
|
|
4584
|
+
return Object.assign(Object.assign({}, v), { configModels: v.configModels, originalValue,
|
|
4563
4585
|
recalculatedValue, isRecalculated: !isUndefined(recalculatedValue) && recalculatedValue !== originalValue });
|
|
4564
|
-
})
|
|
4586
|
+
})
|
|
4587
|
+
.filter(v => v.configModels.length > 0);
|
|
4565
4588
|
const logKeys = (logs, original, recalculated) => Object.keys(logs)
|
|
4566
4589
|
.filter(key => logs[key].isKey)
|
|
4567
4590
|
.map(key => ({
|
|
@@ -4654,11 +4677,12 @@ class NodeLogsModelsComponent {
|
|
|
4654
4677
|
this.terms = [];
|
|
4655
4678
|
this.baseUrl = baseUrl();
|
|
4656
4679
|
this.isExternal = isExternal();
|
|
4680
|
+
this.hasLog = hasLog;
|
|
4657
4681
|
this.loading = true;
|
|
4658
4682
|
this.blankNodes = [];
|
|
4659
4683
|
this.methodModelsCount = 0;
|
|
4660
4684
|
this.rowsCount = 0;
|
|
4661
|
-
this.
|
|
4685
|
+
this.onlyRequired = true;
|
|
4662
4686
|
this.showLegend = true;
|
|
4663
4687
|
this.LogStatus = LogStatus;
|
|
4664
4688
|
this.logIcon = logIcon;
|
|
@@ -4703,8 +4727,11 @@ class NodeLogsModelsComponent {
|
|
|
4703
4727
|
...findConfigModels(this.config, termId, this.nodeKey, allModels).map(({ model }) => model)
|
|
4704
4728
|
]);
|
|
4705
4729
|
const keys = logKeys(termLogs, original, recalculated);
|
|
4706
|
-
const subValues = logSubValues(termLogs, original, recalculated);
|
|
4707
|
-
const isRequired = !Object.values(termLogs)
|
|
4730
|
+
const subValues = logSubValues(termLogs, original, recalculated, allModels);
|
|
4731
|
+
const isRequired = !Object.values(termLogs)
|
|
4732
|
+
// ignore models that were never going to run
|
|
4733
|
+
.filter(isRunOrchestrator)
|
|
4734
|
+
.every(logs => logs.runRequired === false);
|
|
4708
4735
|
return {
|
|
4709
4736
|
isOpen: true,
|
|
4710
4737
|
canOpen: keys.length > 0 || subValues.length > 0,
|
|
@@ -4759,20 +4786,21 @@ class NodeLogsModelsComponent {
|
|
|
4759
4786
|
const value = (blankNodes === null || blankNodes === void 0 ? void 0 : blankNodes.length) ? blankNodes[0][key] : null;
|
|
4760
4787
|
return ['string', 'number', 'boolean'].includes(typeof value) ? (value || '') : null;
|
|
4761
4788
|
}
|
|
4762
|
-
|
|
4763
|
-
return
|
|
4789
|
+
openPopover(popover, { blankNode, methodId, subValue, logs }) {
|
|
4790
|
+
return this.hasLogDetails(blankNode, methodId, subValue) ? popover.open({ logs }) : null;
|
|
4764
4791
|
}
|
|
4765
4792
|
filterResults() {
|
|
4766
4793
|
setTimeout(() => {
|
|
4767
|
-
this.blankNodes = this.allBlankNodes.filter(({
|
|
4794
|
+
this.blankNodes = this.allBlankNodes.filter(({ isRequired, term: { name } }) => this.term
|
|
4768
4795
|
? name.toLowerCase().includes(this.term.toLowerCase())
|
|
4769
|
-
: !this.
|
|
4796
|
+
: !this.onlyRequired || !this.filteredType || isRequired);
|
|
4770
4797
|
});
|
|
4771
4798
|
}
|
|
4772
4799
|
/** Logs **/
|
|
4773
|
-
getSubvalueLogs(node, { id }) {
|
|
4800
|
+
getSubvalueLogs(node, { id, key }) {
|
|
4774
4801
|
// try to get a more precise logs, defaults to id otherwise
|
|
4775
|
-
return get$3(this.logs, [id, node.termId].join('.'), get$3(this.logs, id, {})
|
|
4802
|
+
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
|
|
4803
|
+
);
|
|
4776
4804
|
}
|
|
4777
4805
|
getLogs(node, methodId, subValue) {
|
|
4778
4806
|
const logs = (subValue === null || subValue === void 0 ? void 0 : subValue.key) ? this.getSubvalueLogs(node, subValue) : node.logs || {};
|
|
@@ -4781,9 +4809,6 @@ class NodeLogsModelsComponent {
|
|
|
4781
4809
|
isBackground(log) {
|
|
4782
4810
|
return (log === null || log === void 0 ? void 0 : log.methodTier) === EmissionMethodTier.background;
|
|
4783
4811
|
}
|
|
4784
|
-
isRunOrchestrator(log) {
|
|
4785
|
-
return !('shouldRunOrchestrator' in log) || log.shouldRunOrchestrator;
|
|
4786
|
-
}
|
|
4787
4812
|
isUserProvided(node, methodId, subValue) {
|
|
4788
4813
|
const log = this.getLogs(node, methodId, subValue);
|
|
4789
4814
|
return [
|
|
@@ -4794,13 +4819,6 @@ class NodeLogsModelsComponent {
|
|
|
4794
4819
|
this.hasLog(log, false) // skip if contains logs other than orchestrator
|
|
4795
4820
|
].every(v => !v);
|
|
4796
4821
|
}
|
|
4797
|
-
validSubValue(node, index, subValue) {
|
|
4798
|
-
const methodId = this.getMethodIdAt(node, index, subValue);
|
|
4799
|
-
const log = get$3(node.logs[methodId], subValue === null || subValue === void 0 ? void 0 : subValue.key, null);
|
|
4800
|
-
return !(subValue === null || subValue === void 0 ? void 0 : subValue.id) || (
|
|
4801
|
-
// subValue can be an array
|
|
4802
|
-
Array.isArray(log) ? log.includes(subValue === null || subValue === void 0 ? void 0 : subValue.id) : log === (subValue === null || subValue === void 0 ? void 0 : subValue.id));
|
|
4803
|
-
}
|
|
4804
4822
|
getMethodIdAt(node, index, subValue) {
|
|
4805
4823
|
const { configModels } = subValue || node;
|
|
4806
4824
|
return configModels[index];
|
|
@@ -4813,11 +4831,6 @@ class NodeLogsModelsComponent {
|
|
|
4813
4831
|
(log === null || log === void 0 ? void 0 : log.model) ||
|
|
4814
4832
|
(methodId ? methodIdLabel(methodId) : '');
|
|
4815
4833
|
}
|
|
4816
|
-
hasLog(log, withOrchestrator = true) {
|
|
4817
|
-
return !!log && ('shouldRun' in log ||
|
|
4818
|
-
'runRequired' in log ||
|
|
4819
|
-
(withOrchestrator && 'shouldRunOrchestrator' in log));
|
|
4820
|
-
}
|
|
4821
4834
|
hasLogDetails(node, methodId, subValue) {
|
|
4822
4835
|
var _a;
|
|
4823
4836
|
const log = this.getLogs(node, methodId, subValue);
|
|
@@ -4830,17 +4843,16 @@ class NodeLogsModelsComponent {
|
|
|
4830
4843
|
const log = this.getLogs(node, methodId, subValue);
|
|
4831
4844
|
return this.isUserProvided(node, methodId, subValue)
|
|
4832
4845
|
? LogStatus.dataProvided
|
|
4833
|
-
: (
|
|
4834
|
-
? (
|
|
4835
|
-
?
|
|
4836
|
-
|
|
4837
|
-
|
|
4838
|
-
? log.shouldRun
|
|
4839
|
-
|
|
4840
|
-
|
|
4841
|
-
|
|
4842
|
-
|
|
4843
|
-
: LogStatus.dataProvided))
|
|
4846
|
+
: (hasLog(log)
|
|
4847
|
+
? (!node.isRequired
|
|
4848
|
+
? LogStatus.notRequired
|
|
4849
|
+
: isRunOrchestrator(log)
|
|
4850
|
+
? ('shouldRun' in log
|
|
4851
|
+
? log.shouldRun ? LogStatus.success : LogStatus.error
|
|
4852
|
+
: LogStatus.dataProvided)
|
|
4853
|
+
: node.isRecalculated
|
|
4854
|
+
? LogStatus.skipHierarchy
|
|
4855
|
+
: LogStatus.dataProvided)
|
|
4844
4856
|
: LogStatus.skipHierarchy);
|
|
4845
4857
|
}
|
|
4846
4858
|
requirementKeys(requirements) {
|
|
@@ -4851,7 +4863,7 @@ class NodeLogsModelsComponent {
|
|
|
4851
4863
|
}
|
|
4852
4864
|
}
|
|
4853
4865
|
NodeLogsModelsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NodeLogsModelsComponent, deps: [{ token: HeSearchService }, { token: HeEngineService }], target: i0.ɵɵFactoryTarget.Component });
|
|
4854
|
-
NodeLogsModelsComponent.ɵcmp = i0.ɵɵ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", filteredType: "filteredType" }, ngImport: i0, 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 <span>{{blankNode.originalValue | precision:3 | default:'-'}}</span>\n </td>\n <td>\n <span *ngIf=\"!blankNode.isOriginal || blankNode.isRecalculated; else notRecalculated\">\n {{blankNode.recalculatedValue | precision:3 | default:'-'}}\n </span>\n </td>\n <td class=\"is-nowrap\">\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 </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, methodId:subValue.key, 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)]=\"onlyWithData\"\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=\"validSubValue(blankNode, i, subValue); else noValue\">\n <ng-container *ngIf=\"getMethodIdAt(blankNode, i, subValue); let methodId; else noValue\">\n <ng-template #modelSerie>\n <ng-container *ngTemplateOutlet=\"blankNodeModel; context: {blankNode:blankNode, methodId:methodId, subValue:subValue, logs:getLogs(blankNode, methodId, subValue)}\"></ng-container>\n </ng-template>\n <div *ngIf=\"methodId | isArray; else modelSerie\">\n <p *ngFor=\"let value of methodId\">\n <ng-container *ngTemplateOutlet=\"blankNodeModel; context: {blankNode:blankNode, methodId:value, subValue:subValue, logs:getLogs(blankNode, methodId, subValue)}\"></ng-container>\n </p>\n </div>\n </ng-container>\n </ng-container>\n </td>\n</ng-template>\n\n<ng-template #blankNodeModel let-blankNode=\"blankNode\" let-methodId=\"methodId\" let-subValue=\"subValue\" let-logs=\"logs\">\n <span\n [class.trigger-popover]=\"hasLogDetails(blankNode, methodId, subValue)\"\n [ngbPopover]=\"logDetails\" [autoClose]=\"'outside'\"\n triggers=\"manual\" #p=\"ngbPopover\" placement=\"left\" container=\"body\"\n (click)=\"hasLogDetails(blankNode, methodId, subValue) ? togglePopover(p, { logs }) : null\"\n >\n <span class=\"is-capitalized\">{{methodName(blankNode, 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, methodId, subValue)]}}\">\n <fa-icon [icon]=\"logIcon[logStatus(blankNode, methodId, subValue)]\"></fa-icon>\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", 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.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.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$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.NgbTypeahead, selector: "input[ngbTypeahead]", inputs: ["autocomplete", "placement", "container", "editable", "focusFirst", "showHint", "inputFormatter", "ngbTypeahead", "resultFormatter", "resultTemplate"], outputs: ["selectItem"], exportAs: ["ngbTypeahead"] }, { type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i2.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i1$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { type: i11.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 } });
|
|
4866
|
+
NodeLogsModelsComponent.ɵcmp = i0.ɵɵ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", filteredType: "filteredType" }, ngImport: i0, 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 <span>{{blankNode.originalValue | precision:3 | default:'-'}}</span>\n </td>\n <td>\n <span *ngIf=\"!blankNode.isOriginal || blankNode.isRecalculated; else notRecalculated\">\n {{blankNode.recalculatedValue | precision:3 | default:'-'}}\n </span>\n </td>\n <td class=\"is-nowrap\">\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 </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, methodId:subValue.key, 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=\"getMethodIdAt(blankNode, i, subValue); let methodId; else noValue\">\n <ng-template #modelSerie>\n <ng-container *ngTemplateOutlet=\"blankNodeModel; context: {blankNode:blankNode, methodId:methodId, subValue:subValue, logs:getLogs(blankNode, methodId, subValue)}\"></ng-container>\n </ng-template>\n <div *ngIf=\"methodId | isArray; else modelSerie\">\n <p *ngFor=\"let value of methodId\">\n <ng-container *ngTemplateOutlet=\"blankNodeModel; context: {blankNode:blankNode, methodId:value, subValue:subValue, logs:getLogs(blankNode, value, subValue)}\"></ng-container>\n </p>\n </div>\n </ng-container>\n </td>\n</ng-template>\n\n<ng-template #blankNodeModel let-blankNode=\"blankNode\" let-methodId=\"methodId\" let-subValue=\"subValue\" let-logs=\"logs\">\n <span\n [class.trigger-popover]=\"hasLogDetails(blankNode, 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, subValue, logs })\"\n >\n <span class=\"is-capitalized\">{{methodName(blankNode, 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, methodId, subValue)]}}\">\n <fa-icon [icon]=\"logIcon[logStatus(blankNode, methodId, subValue)]\"></fa-icon>\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", 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.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.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$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.NgbTypeahead, selector: "input[ngbTypeahead]", inputs: ["autocomplete", "placement", "container", "editable", "focusFirst", "showHint", "inputFormatter", "ngbTypeahead", "resultFormatter", "resultTemplate"], outputs: ["selectItem"], exportAs: ["ngbTypeahead"] }, { type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i2.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i1$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { type: i11.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 } });
|
|
4855
4867
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NodeLogsModelsComponent, decorators: [{
|
|
4856
4868
|
type: Component$1,
|
|
4857
4869
|
args: [{
|
|
@@ -4911,7 +4923,7 @@ const additionalKeys = [
|
|
|
4911
4923
|
'methodModelDescription', 'description',
|
|
4912
4924
|
'primary', 'emissionDuration', 'observations', 'statsDefinition',
|
|
4913
4925
|
'term', 'source', 'variety', 'reliability', 'price', 'currency', 'cost', 'revenue', 'economicValueShare',
|
|
4914
|
-
'impactAssessment'
|
|
4926
|
+
'impactAssessment', 'properties'
|
|
4915
4927
|
];
|
|
4916
4928
|
const tableKeys = [
|
|
4917
4929
|
'inputs', 'transformation', 'value', 'dates', 'methodModel', 'methodTier', 'statsDefinition'
|
|
@@ -6365,6 +6377,7 @@ const propertyValueType = (schema, value) => (schema.type ? (Array.isArray(schem
|
|
|
6365
6377
|
propertyValueType(Object.assign(Object.assign({}, schema), { type: [schema.items.type] })) :
|
|
6366
6378
|
schema.type) : typeof value);
|
|
6367
6379
|
const propertyTypeParseValue = {
|
|
6380
|
+
undefined: () => undefined,
|
|
6368
6381
|
object: val => safeJSONParse(val),
|
|
6369
6382
|
array: (val, schema) => {
|
|
6370
6383
|
const { items } = schema;
|
|
@@ -6803,12 +6816,7 @@ class SitesMapsComponent {
|
|
|
6803
6816
|
});
|
|
6804
6817
|
}
|
|
6805
6818
|
centerPolygons(polygons) {
|
|
6806
|
-
|
|
6807
|
-
return (polygons === null || polygons === void 0 ? void 0 : polygons.length) ? this.map.googleMap.fitBounds(polygonBounds(polygons)) : null;
|
|
6808
|
-
}
|
|
6809
|
-
catch (err) {
|
|
6810
|
-
return (polygons === null || polygons === void 0 ? void 0 : polygons.length) ? this.map.googleMap.fitBounds(polygonBounds(polygons[0])) : null;
|
|
6811
|
-
}
|
|
6819
|
+
return (polygons === null || polygons === void 0 ? void 0 : polygons.length) ? this.map.googleMap.fitBounds(polygonBounds(polygons)) : null;
|
|
6812
6820
|
}
|
|
6813
6821
|
addSiteMarkers(sites) {
|
|
6814
6822
|
const siteMarkers = sites.map(siteMarker).filter(Boolean);
|
|
@@ -7571,7 +7579,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
7571
7579
|
const parseLog = (data) => ({
|
|
7572
7580
|
modelId: data.model,
|
|
7573
7581
|
impactTermId: data['key/term'] || data.term || data.indicator,
|
|
7574
|
-
|
|
7582
|
+
blankNodeTermId: data.node,
|
|
7575
7583
|
coefficient: +data.coefficient,
|
|
7576
7584
|
value: +data.value * +data.coefficient
|
|
7577
7585
|
});
|
|
@@ -7592,9 +7600,9 @@ const toCsv = (logs, impact) => [
|
|
|
7592
7600
|
].join(','),
|
|
7593
7601
|
...logs
|
|
7594
7602
|
.sort((a, b) => a.impactTermId.localeCompare(b.impactTermId))
|
|
7595
|
-
.flatMap(({ impactTermId, impactTermUnits, modelId,
|
|
7596
|
-
[impactTermId, impactTermUnits, modelId,
|
|
7597
|
-
...(inputs.map(v => [impactTermId, impactTermUnits, modelId,
|
|
7603
|
+
.flatMap(({ impactTermId, impactTermUnits, modelId, blankNodeTermId, value, inputs }) => [
|
|
7604
|
+
[impactTermId, impactTermUnits, modelId, blankNodeTermId, value, '', ''],
|
|
7605
|
+
...(inputs.map(v => [impactTermId, impactTermUnits, modelId, blankNodeTermId, '', v.name, v.value]))
|
|
7598
7606
|
])
|
|
7599
7607
|
.map(v => {
|
|
7600
7608
|
var _a;
|
|
@@ -7615,25 +7623,33 @@ class ImpactAssessmentsIndicatorBreakdownChartComponent {
|
|
|
7615
7623
|
this.indicators = [];
|
|
7616
7624
|
this.loading = true;
|
|
7617
7625
|
this.terms = [];
|
|
7626
|
+
this.methods = [];
|
|
7618
7627
|
this.noData = false;
|
|
7619
7628
|
}
|
|
7620
7629
|
ngOnInit() {
|
|
7621
7630
|
return __awaiter(this, void 0, void 0, function* () {
|
|
7622
|
-
this.terms = this.indicators.map(({ term }) => term);
|
|
7623
|
-
this.
|
|
7624
|
-
|
|
7631
|
+
this.terms = unique(this.indicators.map(({ term }) => term).filter(Boolean));
|
|
7632
|
+
this.methods = unique(this.indicators.map(({ methodModel }) => methodModel).filter(Boolean));
|
|
7633
|
+
const impacts = [
|
|
7634
|
+
...this.impactAssessment.impacts || [],
|
|
7635
|
+
...this.impactAssessment.endpoints || []
|
|
7636
|
+
];
|
|
7637
|
+
this.logs = (yield of(Object.assign(Object.assign({}, this.impactAssessment), { dataState: DataState.recalculated })).pipe(mergeMap(node => this.nodeService.getLog(node)), map(value => value ? parseLines(value) : []), mergeAll(), filter(({ data }) => data.logger === 'hestia_earth.models' && data.level === Level.debug), map(({ data }) => parseMessage(data.message)), filter(message => 'node' in message), map(parseLog), filter(log => !!log.impactTermId && !!log.blankNodeTermId && !isNaN(log.value) && log.value > 0), groupBy(log => [log.impactTermId, log.blankNodeTermId, log.modelId].join('/')), mergeMap(group => group.pipe(toArray())), map((values) => {
|
|
7638
|
+
var _a;
|
|
7625
7639
|
const log = values[0];
|
|
7626
7640
|
const total = values.reduce((prev, curr) => prev + curr.value, 0);
|
|
7627
|
-
const
|
|
7628
|
-
.
|
|
7629
|
-
|
|
7641
|
+
const blankNodes = ([
|
|
7642
|
+
...this.impactAssessment.emissionsResourceUse || [],
|
|
7643
|
+
...this.impactAssessment.impacts || []
|
|
7644
|
+
])
|
|
7645
|
+
.filter(v => v.term['@id'] === log.blankNodeTermId);
|
|
7646
|
+
const inputs = blankNodes
|
|
7630
7647
|
.filter(v => { var _a; return (_a = v.inputs) === null || _a === void 0 ? void 0 : _a.length; })
|
|
7631
7648
|
.map(v => ({ name: v.inputs.map(i => i['@id']).join(';'), value: v.value * log.coefficient }));
|
|
7632
7649
|
const inputsValue = inputs.reduce((prev, curr) => prev + curr.value, 0);
|
|
7633
|
-
const
|
|
7634
|
-
.filter(v => v.term['@id'] === log.impactTermId);
|
|
7650
|
+
const impact = impacts.find(v => v.term['@id'] === log.impactTermId);
|
|
7635
7651
|
// logs might exist but impact was not added => skip logs
|
|
7636
|
-
return
|
|
7652
|
+
return impact ? Object.assign(Object.assign({}, log), { impactTermUnits: (_a = impact.term) === null || _a === void 0 ? void 0 : _a.units, value: total, inputs,
|
|
7637
7653
|
inputsValue }) : null;
|
|
7638
7654
|
}), filter(log => !!log), toArray()).toPromise());
|
|
7639
7655
|
this.csvContent = this.domSanitizer.bypassSecurityTrustResourceUrl(`data:text/html;charset=utf-8,${encodeURIComponent(toCsv(this.logs, this.impactAssessment))}`);
|
|
@@ -7662,11 +7678,11 @@ class ImpactAssessmentsIndicatorBreakdownChartComponent {
|
|
|
7662
7678
|
initChart() {
|
|
7663
7679
|
var _a, _b, _c;
|
|
7664
7680
|
const logs = this.logs
|
|
7665
|
-
.filter(({ impactTermId }) => impactTermId === this.selectedTerm['@id'])
|
|
7681
|
+
.filter(({ impactTermId, modelId }) => impactTermId === this.selectedTerm['@id'] && (!this.selectedMethod || modelId === this.selectedMethod['@id']))
|
|
7666
7682
|
.sort((a, b) => b.value - a.value);
|
|
7667
7683
|
this.noData = logs.length === 0;
|
|
7668
7684
|
const total = logs.reduce((prev, curr) => prev + curr.value, 0);
|
|
7669
|
-
const labels = logs.map(({
|
|
7685
|
+
const labels = logs.map(({ blankNodeTermId }) => { var _a; return ((_a = this.emissions.find(v => v['@id'] === blankNodeTermId)) === null || _a === void 0 ? void 0 : _a.name) || blankNodeTermId; });
|
|
7670
7686
|
// display the breakdown by input
|
|
7671
7687
|
// const inputs = logs.flatMap(v => v.inputs.map(i => i.name));
|
|
7672
7688
|
// const datasets = [
|
|
@@ -7743,7 +7759,7 @@ class ImpactAssessmentsIndicatorBreakdownChartComponent {
|
|
|
7743
7759
|
}
|
|
7744
7760
|
}
|
|
7745
7761
|
ImpactAssessmentsIndicatorBreakdownChartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ImpactAssessmentsIndicatorBreakdownChartComponent, deps: [{ token: i0.NgZone }, { token: i1$2.DomSanitizer }, { token: HeSearchService }, { token: HeNodeService }], target: i0.ɵɵFactoryTarget.Component });
|
|
7746
|
-
ImpactAssessmentsIndicatorBreakdownChartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ImpactAssessmentsIndicatorBreakdownChartComponent, selector: "he-impact-assessments-indicator-breakdown-chart", inputs: { impactAssessment: "impactAssessment", indicators: "indicators" }, viewQueries: [{ propertyName: "chartRef", first: true, predicate: ["chart"], descendants: true }], ngImport: i0, template: "<div class=\"p-3\" [class.is-hidden]=\"loading || !terms?.length\">\n <div class=\"columns\">\n <div class=\"column\">\n <div class=\"field has-addons\">\n <div class=\"control\">\n <span class=\"button is-small is-static\">Select an Indicator</span>\n </div>\n <div class=\"control is-expanded\">\n <div class=\"select is-fullwidth is-small\">\n <select (change)=\"updateChart()\" [(ngModel)]=\"selectedTerm\" id=\"selectedTerm\">\n <option *ngFor=\"let term of terms\" [ngValue]=\"term\">{{term.name}} ({{term.units}})</option>\n </select>\n </div>\n </div>\n </div>\n </div>\n <div class=\"column is-narrow\">\n <a class=\"button is-dark is-outlined is-small\" [href]=\"csvContent\" [download]=\"id + '-logs.csv'\">\n <fa-icon icon=\"download\"></fa-icon>\n <span class=\"pl-2\">Download All (CSV)</span>\n </a>\n </div>\n </div>\n\n <div class=\"mt-1\">\n <p *ngIf=\"noData\" class=\"has-text-centered\">No breakdown available for {{selectedTerm?.name}}
|
|
7762
|
+
ImpactAssessmentsIndicatorBreakdownChartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ImpactAssessmentsIndicatorBreakdownChartComponent, selector: "he-impact-assessments-indicator-breakdown-chart", inputs: { impactAssessment: "impactAssessment", indicators: "indicators" }, viewQueries: [{ propertyName: "chartRef", first: true, predicate: ["chart"], descendants: true }], ngImport: i0, template: "<div class=\"p-3\" [class.is-hidden]=\"loading || !terms?.length\">\n <div class=\"columns\">\n <div class=\"column\">\n <div class=\"field has-addons\">\n <div class=\"control\">\n <span class=\"button is-small is-static\">Select an Indicator</span>\n </div>\n <div class=\"control is-expanded\">\n <div class=\"select is-fullwidth is-small\">\n <select (change)=\"updateChart()\" [(ngModel)]=\"selectedTerm\" id=\"selectedTerm\">\n <option *ngFor=\"let term of terms\" [ngValue]=\"term\">{{term.name}} ({{term.units}})</option>\n </select>\n </div>\n </div>\n <div class=\"control is-expanded\" *ngIf=\"methods?.length\">\n <div class=\"select is-fullwidth is-small\">\n <select (change)=\"updateChart()\" [(ngModel)]=\"selectedMethod\" id=\"selectedMethod\">\n <option [ngValue]=\"undefined\">Filter Model</option>\n <option *ngFor=\"let term of methods\" [ngValue]=\"term\">{{term.name}}</option>\n </select>\n </div>\n </div>\n </div>\n </div>\n <div class=\"column is-narrow\">\n <a class=\"button is-dark is-outlined is-small\" [href]=\"csvContent\" [download]=\"id + '-logs.csv'\">\n <fa-icon icon=\"download\"></fa-icon>\n <span class=\"pl-2\">Download All (CSV)</span>\n </a>\n </div>\n </div>\n\n <p class=\"is-size-7\" *ngIf=\"!selectedMethod\">\n <i>Selecting a Model is recommended to avoid duplicated entries.</i>\n </p>\n\n <div class=\"mt-1\">\n <p *ngIf=\"noData\" class=\"has-text-centered\">\n <span>No breakdown available for {{selectedTerm?.name}}</span>\n <span class=\"pl-1\" *ngIf=\"selectedMethod\">({{selectedMethod.name}})</span>\n <span>.</span>\n </p>\n <div class=\"chart-container h-100\">\n <canvas #chart></canvas>\n </div>\n </div>\n</div>\n\n<ng-container *ngIf=\"loading\">\n <div class=\"has-text-center py-3\">\n <fa-icon icon=\"spinner\" [pulse]=\"true\" size=\"lg\"></fa-icon>\n </div>\n</ng-container>\n", styles: [":host{display:block;overflow:visible}.chart-container{height:400px;position:relative}\n"], components: [{ type: i1.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }], directives: [{ type: i1$1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
7747
7763
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ImpactAssessmentsIndicatorBreakdownChartComponent, decorators: [{
|
|
7748
7764
|
type: Component$1,
|
|
7749
7765
|
args: [{
|
|
@@ -7879,13 +7895,13 @@ class ImpactAssessmentsProductsLogsComponent {
|
|
|
7879
7895
|
this.loading = true;
|
|
7880
7896
|
this.NodeType = NodeType;
|
|
7881
7897
|
this.models = [];
|
|
7882
|
-
this.
|
|
7898
|
+
this.terms = [];
|
|
7883
7899
|
}
|
|
7884
7900
|
ngOnInit() {
|
|
7885
7901
|
return __awaiter(this, void 0, void 0, function* () {
|
|
7886
7902
|
this.logsUrl = this.nodeService.nodeLogsUrl(this.node);
|
|
7887
7903
|
this.logs = yield this.nodeService.getModelsLog(this.node);
|
|
7888
|
-
const { results:
|
|
7904
|
+
const { results: terms } = yield this.searchService.search({
|
|
7889
7905
|
fields: ['@type', '@id', 'name', 'units'],
|
|
7890
7906
|
limit: 1000,
|
|
7891
7907
|
query: {
|
|
@@ -7898,7 +7914,8 @@ class ImpactAssessmentsProductsLogsComponent {
|
|
|
7898
7914
|
}
|
|
7899
7915
|
}
|
|
7900
7916
|
});
|
|
7901
|
-
this.
|
|
7917
|
+
const showAllEmissions = this.key !== 'emissionsResourceUse' || (this.filterTermTypes || []).length === 1;
|
|
7918
|
+
this.terms = showAllEmissions ? terms : [];
|
|
7902
7919
|
this.loading = false;
|
|
7903
7920
|
});
|
|
7904
7921
|
}
|
|
@@ -7913,7 +7930,7 @@ class ImpactAssessmentsProductsLogsComponent {
|
|
|
7913
7930
|
}
|
|
7914
7931
|
}
|
|
7915
7932
|
ImpactAssessmentsProductsLogsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ImpactAssessmentsProductsLogsComponent, deps: [{ token: HeSearchService }, { token: HeNodeService }], target: i0.ɵɵFactoryTarget.Component });
|
|
7916
|
-
ImpactAssessmentsProductsLogsComponent.ɵcmp = i0.ɵɵ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, 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]=\"
|
|
7933
|
+
ImpactAssessmentsProductsLogsComponent.ɵcmp = i0.ɵɵ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, 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 [filteredType]=\"filteredType\"\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", "filteredType"] }, { type: i1.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.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
7917
7934
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ImpactAssessmentsProductsLogsComponent, decorators: [{
|
|
7918
7935
|
type: Component$1,
|
|
7919
7936
|
args: [{
|
|
@@ -7941,13 +7958,6 @@ var View;
|
|
|
7941
7958
|
View["breakdown"] = "breakdown";
|
|
7942
7959
|
View["logs"] = "logs";
|
|
7943
7960
|
})(View || (View = {}));
|
|
7944
|
-
const isMethodModelAllowed = (filterMethod) => (node) => {
|
|
7945
|
-
var _a, _b, _c, _d;
|
|
7946
|
-
return filterMethod
|
|
7947
|
-
? ((_a = node.methodModel) === null || _a === void 0 ? void 0 : _a['@id']) === filterMethod['@id']
|
|
7948
|
-
: (typeof getDefaultModeId((_b = node.term) === null || _b === void 0 ? void 0 : _b['@id']) === 'undefined' ||
|
|
7949
|
-
((_c = node.methodModel) === null || _c === void 0 ? void 0 : _c['@id']) === getDefaultModeId((_d = node.term) === null || _d === void 0 ? void 0 : _d['@id']));
|
|
7950
|
-
};
|
|
7951
7961
|
class ImpactAssessmentsProductsComponent {
|
|
7952
7962
|
constructor(nodeService) {
|
|
7953
7963
|
this.nodeService = nodeService;
|
|
@@ -8026,7 +8036,7 @@ class ImpactAssessmentsProductsComponent {
|
|
|
8026
8036
|
return name || ((_a = (this.cycles || []).find(v => v['@id'] === id)) === null || _a === void 0 ? void 0 : _a.name);
|
|
8027
8037
|
}
|
|
8028
8038
|
get enableBreakdown() {
|
|
8029
|
-
return !this.isOriginal && this.impactAssessments.length === 1 && this.key
|
|
8039
|
+
return !this.isOriginal && this.impactAssessments.length === 1 && this.key !== 'emissionsResourceUse';
|
|
8030
8040
|
}
|
|
8031
8041
|
isSelected(impact) {
|
|
8032
8042
|
return this.selected.length === 0 || this.selected.includes(impact['@id']);
|
|
@@ -8136,5 +8146,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
8136
8146
|
* Generated bundle index. Do not edit.
|
|
8137
8147
|
*/
|
|
8138
8148
|
|
|
8139
|
-
export { ARRAY_DELIMITER, BibliographiesSearchConfirmComponent, BindOnceDirective, BlankNodeStateComponent, BlankNodeStateNoticeComponent, BlankNodeValueDeltaComponent, ClickOutsideDirective, ClipboardComponent, CyclesActivityComponent, CyclesActivityLogsComponent, CyclesCompletenessComponent, CyclesEmissionsChartComponent, CyclesEmissionsComponent, CyclesEmissionsLogsComponent, CyclesFunctionalUnitMeasureComponent, CyclesPracticesComponent, CyclesPracticesLogsComponent, CyclesPracticesTimelineComponent, CyclesResultComponent, DataTableComponent, DefaultPipe, DeltaColour, DiffsDisplayType, EllipsisPipe, EngineOrchestratorEditComponent, EngineRequirementsFormComponent, FilesFormComponent, GetPipe, HE_API_BASE_URL, HE_CALCULATIONS_BASE_URL, HE_ORCHESTRATOR_BASE_URL, HeAggregationEngineService, HeAuthService, HeBibliographiesModule, HeCommonLightModule, HeCommonModule, HeCommonService, HeCyclesModule, HeEngineModule, HeEngineService, HeFilesModule, HeFontawesomeModule, HeImpactAssessmentsModule, HeMendeleyService, HeNodeCsvService, HeNodeModule, HeNodeService, HeSchemaService, HeSearchModule, HeSearchService, HeSitesModule, HeToastService, HeUsersService, ImpactAssessmentsIndicatorBreakdownChartComponent, ImpactAssessmentsIndicatorsChartComponent, ImpactAssessmentsProductsComponent, ImpactAssessmentsProductsLogsComponent, IsArrayPipe, IssueConfirmComponent, KeyToLabelPipe, KeysPipe, Level, LinkKeyValueComponent, MAX_RESULTS, MapsDrawingConfirmComponent, MendeleySearchResult, NodeCsvExportConfirmComponent, NodeCsvSelectHeadersComponent, NodeDiffsComponent, NodeIconComponent, NodeLinkComponent, NodeLogsFileComponent, NodeLogsModelsComponent, NodeMissingLookupFactorsComponent, NodeRecommendationsComponent, NodeValueDetailsComponent, PluralizePipe, PopoverComponent, PopoverConfirmComponent, PrecisionPipe, Repository, SchemaVersionLinkComponent, SitesMapsComponent, SitesMeasurementsComponent, SitesMeasurementsLogsComponent, SkeletonTextComponent, SocialTagsComponent, SortByPipe, TagsInputDirective, Template, TimesPipe, ToastComponent, UnitConverterComponent, addPolygonToFeature, allCountriesQuery, arrayValue, availableProperties, baseUrl, bottom, buildSummary, calculateCycleDuration, calculateCycleDurationEnabled, calculateCycleStartDate, calculateCycleStartDateEnabled, clustererImage, code, coordinatesToPoint, copyObject, countriesQuery, createMarker, cropsQuery, dataPathToKey, defaultFeature, defaultLabel, defaultSuggestionType, definitionToSchemaType, deserializeSearchFilters, ellipsis, engineGitUrl, errorHasError, errorHasWarning, errorText, evaluateSuccess, filenameWithoutExt, fillColor, fillStyle, filterError, filterParams, findConfigModels, findProperty, findPropertyById, formatCustomErrorMessage, formatError, formatPropertyError, gitBranch, gitHome, gitRawBaseUrl, groupChanged, handleAPIError, hasError, hasWarning, isAddPropertyEnabled, isChrome, isEqual, isExternal, isMissingOneOfError, isMissingPropertyError, isSchemaIri, isScrolledBelow, itemColor, keyToDataPath, levels, linkTypeEnabled, listColor, locationQuery, lookupUrl, lookups, mapsUrl, markerIcon, markerPie, matchAggregatedQuery, matchBoolPrefixQuery, matchCountry, matchExactQuery, matchGlobalRegion, matchNameNormalized, matchNestedKey, matchPhrasePrefixQuery, matchPhraseQuery, matchQuery, matchRegex, matchRegion, matchTermType, matchType, maxAreaSize, measurementValue, missingNodeErrorMessage, missingNodeErrors, multiMatchQuery, nestedProperty, nestingEnabled, nestingTypeEnabled, nodeAvailableProperties, nodeLink, nodeLogsUrl, nodeUrl, numberGte, parentKey, parentProperty, parseData, parseDataPath, parseLines, parseLogs, parseMessage, parseNewValue, pathToApiDocsPath, pointToCoordinates, polygonBounds, polygonToCoordinates, polygonsFromFeature, primaryProduct, propertyError, propertyId, recursiveProperties, refToSchemaType, refreshPropertyKeys, regionsQuery, repeat, safeJSONParse, safeJSONStringify, schemaRequiredProperties, schemaTypeToDefaultValue, scrollToEl, scrollTop, searchQuery, searchResultsFields, searchableTypes, serializeSearchFilters, siblingProperty, singleProperty, siteTooBig, sortOrder, sortProperties, strokeColor, strokeStyle, suggestMatchQuery, suggestQuery, termChildToParent, termLocation, termLocationName, termProperties, termTypeGroups, termTypeLabel, termTypeLookupUrl, toCsv$1 as toCsv, typeToNewProperty, updateProperties, valueTypeToDefault, waitFor, wildcardQuery, worldRegion };
|
|
8149
|
+
export { ARRAY_DELIMITER, BibliographiesSearchConfirmComponent, BindOnceDirective, BlankNodeStateComponent, BlankNodeStateNoticeComponent, BlankNodeValueDeltaComponent, ClickOutsideDirective, ClipboardComponent, CyclesActivityComponent, CyclesActivityLogsComponent, CyclesCompletenessComponent, CyclesEmissionsChartComponent, CyclesEmissionsComponent, CyclesEmissionsLogsComponent, CyclesFunctionalUnitMeasureComponent, CyclesPracticesComponent, CyclesPracticesLogsComponent, CyclesPracticesTimelineComponent, CyclesResultComponent, DataTableComponent, DefaultPipe, DeltaColour, DiffsDisplayType, EllipsisPipe, EngineOrchestratorEditComponent, EngineRequirementsFormComponent, FilesFormComponent, GetPipe, HE_API_BASE_URL, HE_CALCULATIONS_BASE_URL, HE_ORCHESTRATOR_BASE_URL, HeAggregationEngineService, HeAuthService, HeBibliographiesModule, HeCommonLightModule, HeCommonModule, HeCommonService, HeCyclesModule, HeEngineModule, HeEngineService, HeFilesModule, HeFontawesomeModule, HeImpactAssessmentsModule, HeMendeleyService, HeNodeCsvService, HeNodeModule, HeNodeService, HeSchemaService, HeSearchModule, HeSearchService, HeSitesModule, HeToastService, HeUsersService, ImpactAssessmentsIndicatorBreakdownChartComponent, ImpactAssessmentsIndicatorsChartComponent, ImpactAssessmentsProductsComponent, ImpactAssessmentsProductsLogsComponent, IsArrayPipe, IssueConfirmComponent, KeyToLabelPipe, KeysPipe, Level, LinkKeyValueComponent, MAX_RESULTS, MapsDrawingConfirmComponent, MendeleySearchResult, NodeCsvExportConfirmComponent, NodeCsvSelectHeadersComponent, NodeDiffsComponent, NodeIconComponent, NodeLinkComponent, NodeLogsFileComponent, NodeLogsModelsComponent, NodeMissingLookupFactorsComponent, NodeRecommendationsComponent, NodeValueDetailsComponent, PluralizePipe, PopoverComponent, PopoverConfirmComponent, PrecisionPipe, Repository, SchemaVersionLinkComponent, SitesMapsComponent, SitesMeasurementsComponent, SitesMeasurementsLogsComponent, SkeletonTextComponent, SocialTagsComponent, SortByPipe, TagsInputDirective, Template, TimesPipe, ToastComponent, UnitConverterComponent, addPolygonToFeature, allCountriesQuery, arrayValue, availableProperties, baseUrl, bottom, buildSummary, calculateCycleDuration, calculateCycleDurationEnabled, calculateCycleStartDate, calculateCycleStartDateEnabled, clustererImage, code, coordinatesToPoint, copyObject, countriesQuery, createMarker, cropsQuery, dataPathToKey, defaultFeature, defaultLabel, defaultSuggestionType, definitionToSchemaType, deserializeSearchFilters, ellipsis, engineGitUrl, errorHasError, errorHasWarning, errorText, evaluateSuccess, filenameWithoutExt, fillColor, fillStyle, filterError, filterParams, findConfigModels, findModels, findProperty, findPropertyById, formatCustomErrorMessage, formatError, formatPropertyError, gitBranch, gitHome, gitRawBaseUrl, groupChanged, handleAPIError, hasError, hasWarning, isAddPropertyEnabled, isChrome, isEqual, isExternal, isMissingOneOfError, isMissingPropertyError, isSchemaIri, isScrolledBelow, itemColor, keyToDataPath, levels, linkTypeEnabled, listColor, locationQuery, lookupUrl, lookups, mapsUrl, markerIcon, markerPie, matchAggregatedQuery, matchBoolPrefixQuery, matchCountry, matchExactQuery, matchGlobalRegion, matchNameNormalized, matchNestedKey, matchPhrasePrefixQuery, matchPhraseQuery, matchQuery, matchRegex, matchRegion, matchTermType, matchType, maxAreaSize, measurementValue, missingNodeErrorMessage, missingNodeErrors, multiMatchQuery, nestedProperty, nestingEnabled, nestingTypeEnabled, nodeAvailableProperties, nodeLink, nodeLogsUrl, nodeUrl, numberGte, parentKey, parentProperty, parseData, parseDataPath, parseLines, parseLogs, parseMessage, parseNewValue, pathToApiDocsPath, pointToCoordinates, polygonBounds, polygonToCoordinates, polygonsFromFeature, primaryProduct, propertyError, propertyId, recursiveProperties, refToSchemaType, refreshPropertyKeys, regionsQuery, repeat, safeJSONParse, safeJSONStringify, schemaRequiredProperties, schemaTypeToDefaultValue, scrollToEl, scrollTop, searchQuery, searchResultsFields, searchableTypes, serializeSearchFilters, siblingProperty, singleProperty, siteTooBig, sortOrder, sortProperties, strokeColor, strokeStyle, suggestMatchQuery, suggestQuery, termChildToParent, termLocation, termLocationName, termProperties, termTypeGroups, termTypeLabel, termTypeLookupUrl, toCsv$1 as toCsv, typeToNewProperty, updateProperties, valueTypeToDefault, waitFor, wildcardQuery, worldRegion };
|
|
8140
8150
|
//# sourceMappingURL=hestia-earth-ui-components.js.map
|