@hestia-earth/ui-components 0.3.3 → 0.3.6
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 +117 -66
- package/bundles/hestia-earth-ui-components.umd.js.map +1 -1
- package/common/link-key-value/link-key-value.component.d.ts +1 -0
- package/esm2015/common/link-key-value/link-key-value.component.js +9 -3
- package/esm2015/common/node-utils.js +3 -3
- package/esm2015/cycles/cycles-functional-unit-measure/cycles-functional-unit-measure.component.js +2 -2
- package/esm2015/cycles/cycles-practices/cycles-practices.component.js +3 -2
- package/esm2015/files/files-error.model.js +5 -3
- package/esm2015/impact-assessments/impact-assessments-indicator-breakdown-chart/impact-assessments-indicator-breakdown-chart.component.js +3 -3
- package/esm2015/impact-assessments/impact-assessments-products/impact-assessments-products.component.js +2 -2
- package/esm2015/node/node-link/node-link.component.js +2 -2
- package/esm2015/node/node-logs-models/node-logs-models.model.js +41 -15
- package/esm2015/node/node-value-details/node-value-details.component.js +8 -4
- package/esm2015/node/node.service.js +3 -3
- package/fesm2015/hestia-earth-ui-components.js +69 -30
- package/fesm2015/hestia-earth-ui-components.js.map +1 -1
- package/node/node-logs-models/node-logs-models.model.d.ts +2 -1
- package/node/node-value-details/node-value-details.component.d.ts +2 -1
- package/node/node.service.d.ts +5 -1
- package/package.json +2 -2
|
@@ -1091,7 +1091,7 @@
|
|
|
1091
1091
|
}] });
|
|
1092
1092
|
|
|
1093
1093
|
var get$5 = require('lodash.get');
|
|
1094
|
-
var isMethodModelAllowed = function (filterMethod) { return function (node) { var _a, _b; return ((_a = node.methodModel) === null || _a === void 0 ? void 0 : _a['@id']) === (filterMethod ? filterMethod['@id'] : glossary.
|
|
1094
|
+
var isMethodModelAllowed = function (filterMethod) { return function (node) { var _a, _b; return ((_a = node.methodModel) === null || _a === void 0 ? void 0 : _a['@id']) === (filterMethod ? filterMethod['@id'] : glossary.getDefaultModelId((_b = node.term) === null || _b === void 0 ? void 0 : _b['@id'])); }; };
|
|
1095
1095
|
var NodeKeyState;
|
|
1096
1096
|
(function (NodeKeyState) {
|
|
1097
1097
|
NodeKeyState["added"] = "added";
|
|
@@ -1252,9 +1252,9 @@
|
|
|
1252
1252
|
params: filterParams({ dataState: dataState })
|
|
1253
1253
|
}).toPromise().catch(handleAPIError);
|
|
1254
1254
|
};
|
|
1255
|
-
HeNodeService.prototype.
|
|
1255
|
+
HeNodeService.prototype.getErrorLog = function (_a) {
|
|
1256
1256
|
var dataState = _a.dataState, node = __rest(_a, ["dataState"]);
|
|
1257
|
-
return this.http.get(this.nodeUrl(node) + "/log/
|
|
1257
|
+
return this.http.get(this.nodeUrl(node) + "/log/error", {
|
|
1258
1258
|
headers: this.authService.headers,
|
|
1259
1259
|
params: filterParams({ dataState: dataState })
|
|
1260
1260
|
}).toPromise().catch(handleAPIError);
|
|
@@ -1939,6 +1939,13 @@
|
|
|
1939
1939
|
this.baseUrl = baseUrl();
|
|
1940
1940
|
this.toString = toString;
|
|
1941
1941
|
}
|
|
1942
|
+
Object.defineProperty(LinkKeyValueComponent.prototype, "isInlineBlock", {
|
|
1943
|
+
get: function () {
|
|
1944
|
+
return this.isArray;
|
|
1945
|
+
},
|
|
1946
|
+
enumerable: false,
|
|
1947
|
+
configurable: true
|
|
1948
|
+
});
|
|
1942
1949
|
Object.defineProperty(LinkKeyValueComponent.prototype, "type", {
|
|
1943
1950
|
get: function () {
|
|
1944
1951
|
return this.node['@type'] || this.node.type;
|
|
@@ -1984,7 +1991,7 @@
|
|
|
1984
1991
|
return LinkKeyValueComponent;
|
|
1985
1992
|
}());
|
|
1986
1993
|
LinkKeyValueComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: LinkKeyValueComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1987
|
-
LinkKeyValueComponent.ɵcmp = i0__namespace.ɵɵ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__namespace, 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__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: BindOnceDirective, selector: "[bindOnce]", inputs: ["bindOnce"] }, { type: i2__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "precision": PrecisionPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
1994
|
+
LinkKeyValueComponent.ɵcmp = i0__namespace.ɵɵ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" }, host: { properties: { "class.is-inline-block": "this.isInlineBlock" } }, ngImport: i0__namespace, 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__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: BindOnceDirective, selector: "[bindOnce]", inputs: ["bindOnce"] }, { type: i2__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "precision": PrecisionPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
1988
1995
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: LinkKeyValueComponent, decorators: [{
|
|
1989
1996
|
type: i0.Component,
|
|
1990
1997
|
args: [{
|
|
@@ -2001,6 +2008,9 @@
|
|
|
2001
2008
|
type: i0.Input
|
|
2002
2009
|
}], key: [{
|
|
2003
2010
|
type: i0.Input
|
|
2011
|
+
}], isInlineBlock: [{
|
|
2012
|
+
type: i0.HostBinding,
|
|
2013
|
+
args: ['class.is-inline-block']
|
|
2004
2014
|
}] } });
|
|
2005
2015
|
|
|
2006
2016
|
var locationQuery = function (bounds, searchField) {
|
|
@@ -5388,7 +5398,7 @@
|
|
|
5388
5398
|
this.node['@type'].toLowerCase(),
|
|
5389
5399
|
this.id
|
|
5390
5400
|
].filter(Boolean).join('/');
|
|
5391
|
-
return url + "?dataState=" + api.DataState.recalculated;
|
|
5401
|
+
return "" + url + (this.node.aggregated ? "?dataState=" + api.DataState.recalculated : '');
|
|
5392
5402
|
},
|
|
5393
5403
|
enumerable: false,
|
|
5394
5404
|
configurable: true
|
|
@@ -5508,12 +5518,12 @@
|
|
|
5508
5518
|
var blankNodeTypesLowerCase = blankNodeTypes.map(function (v) { return v.toLowerCase(); });
|
|
5509
5519
|
var missingLookupPrefix = 'Missing lookup';
|
|
5510
5520
|
var parseFilename = function (filepath) {
|
|
5511
|
-
var
|
|
5521
|
+
var _b = __read(filepath.split('.'), 1), filename = _b[0];
|
|
5512
5522
|
var ext = termTypes.includes(filename) ? api.SupportedExtensions.xlsx : api.SupportedExtensions.csv;
|
|
5513
5523
|
return api.fileToExt(filename, ext);
|
|
5514
5524
|
};
|
|
5515
|
-
var parseLookup = function (
|
|
5516
|
-
var column =
|
|
5525
|
+
var parseLookup = function (_b) {
|
|
5526
|
+
var column = _b.column, termid = _b.termid, _c = missingLookupPrefix, missingLookup = _b[_c];
|
|
5517
5527
|
return ({
|
|
5518
5528
|
filename: parseFilename(missingLookup), termId: termid,
|
|
5519
5529
|
column: column
|
|
@@ -5524,10 +5534,10 @@
|
|
|
5524
5534
|
try {
|
|
5525
5535
|
var data = JSON.parse(message);
|
|
5526
5536
|
return data.message.split(',').reduce(function (prev, parts) {
|
|
5527
|
-
var
|
|
5528
|
-
var
|
|
5537
|
+
var _b;
|
|
5538
|
+
var _c = __read(parts.split('='), 2), key = _c[0], value = _c[1];
|
|
5529
5539
|
var val = csvValue(value);
|
|
5530
|
-
return Object.assign(Object.assign({}, prev), (key && val ? (
|
|
5540
|
+
return Object.assign(Object.assign({}, prev), (key && val ? (_b = {}, _b[key.trim()] = val, _b) : {}));
|
|
5531
5541
|
}, { logger: data.logger });
|
|
5532
5542
|
}
|
|
5533
5543
|
catch (err) {
|
|
@@ -5535,29 +5545,31 @@
|
|
|
5535
5545
|
return {};
|
|
5536
5546
|
}
|
|
5537
5547
|
};
|
|
5538
|
-
var omitLogKeys = function (log) { return Object.fromEntries(Object.entries(log).filter(function (
|
|
5539
|
-
var
|
|
5548
|
+
var omitLogKeys = function (log) { return Object.fromEntries(Object.entries(log).filter(function (_b) {
|
|
5549
|
+
var _c = __read(_b, 1), key = _c[0];
|
|
5540
5550
|
return !schemaTypesLowerCase.includes(key);
|
|
5541
5551
|
})); };
|
|
5542
5552
|
var includeBlankNodes = function (logs, log) { return Object
|
|
5543
5553
|
.keys(log)
|
|
5544
5554
|
.filter(function (key) { return blankNodeTypesLowerCase.includes(key); })
|
|
5545
5555
|
.reduce(function (prev, key) {
|
|
5546
|
-
var
|
|
5547
|
-
return (Object.assign(Object.assign({}, prev), (
|
|
5556
|
+
var _b;
|
|
5557
|
+
return (Object.assign(Object.assign({}, prev), (_b = {}, _b[key] = utils.unique(__spreadArray(__spreadArray([], __read(((typeof prev[key] === 'string' ? [prev[key]] : prev[key]) || []))), [
|
|
5548
5558
|
log[key]
|
|
5549
|
-
])),
|
|
5559
|
+
])), _b)));
|
|
5550
5560
|
}, logs); };
|
|
5551
5561
|
var groupLog = function (group, _a) {
|
|
5552
5562
|
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
5563
|
var isOrchestrator = logger.includes('orchestrator');
|
|
5554
5564
|
var isKey = !isOrchestrator && !!key;
|
|
5565
|
+
var isProperty = !isOrchestrator && !!property;
|
|
5555
5566
|
var parentLogKey = ["[\"" + term + "\"]", !isOrchestrator && key || property].filter(Boolean).join('.');
|
|
5556
5567
|
var logModelKey = [parentLogKey, model].filter(Boolean).join('.');
|
|
5557
5568
|
set$1(group, parentLogKey + ".models", utils.unique(__spreadArray(__spreadArray([], __read(get$3(group, parentLogKey + ".models", []))), [
|
|
5558
5569
|
model
|
|
5559
5570
|
])));
|
|
5560
5571
|
set$1(group, parentLogKey + ".isKey", isKey);
|
|
5572
|
+
set$1(group, parentLogKey + ".isProperty", isProperty);
|
|
5561
5573
|
var data = get$3(group, logModelKey, {});
|
|
5562
5574
|
data = includeBlankNodes(data, log);
|
|
5563
5575
|
if (typeof should_run !== 'undefined') {
|
|
@@ -5591,8 +5603,8 @@
|
|
|
5591
5603
|
group[id] = data;
|
|
5592
5604
|
if (key === 'transformation') {
|
|
5593
5605
|
// add value to the same term/model on parent group
|
|
5594
|
-
Object.entries(group[id]).map(function (
|
|
5595
|
-
var
|
|
5606
|
+
Object.entries(group[id]).map(function (_b) {
|
|
5607
|
+
var _c = __read(_b, 2), term = _c[0], models = _c[1];
|
|
5596
5608
|
return Object.keys(models).map(function (model) {
|
|
5597
5609
|
var _a;
|
|
5598
5610
|
if ((_a = group === null || group === void 0 ? void 0 : group[term]) === null || _a === void 0 ? void 0 : _a[model]) {
|
|
@@ -5608,7 +5620,7 @@
|
|
|
5608
5620
|
var subValueKeys = [
|
|
5609
5621
|
'transformation'
|
|
5610
5622
|
];
|
|
5611
|
-
var groupLogsByModel = function (data) { return data.split('\n')
|
|
5623
|
+
var groupLogsByModel = function (data) { return data.trim().split('\n')
|
|
5612
5624
|
.map(parseMessage)
|
|
5613
5625
|
.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
5626
|
.reduce(function (group, log) {
|
|
@@ -5619,14 +5631,14 @@
|
|
|
5619
5631
|
groupLogSubValue(group, log, subValue) :
|
|
5620
5632
|
groupLog(groupLogSubValue(group, log, subValue), log)
|
|
5621
5633
|
: groupLog(group, log);
|
|
5622
|
-
}); };
|
|
5634
|
+
}, {}); };
|
|
5623
5635
|
var computeTerms = function (originalValues, recalculatedValues, terms, filterTermTypes) { return rxjs.from((terms === null || terms === void 0 ? void 0 : terms.length) ?
|
|
5624
5636
|
terms :
|
|
5625
|
-
__spreadArray(__spreadArray([], __read((originalValues || []).map(function (
|
|
5626
|
-
var term =
|
|
5637
|
+
__spreadArray(__spreadArray([], __read((originalValues || []).map(function (_b) {
|
|
5638
|
+
var term = _b.term;
|
|
5627
5639
|
return term;
|
|
5628
|
-
}))), __read((recalculatedValues || []).map(function (
|
|
5629
|
-
var term =
|
|
5640
|
+
}))), __read((recalculatedValues || []).map(function (_b) {
|
|
5641
|
+
var term = _b.term;
|
|
5630
5642
|
return term;
|
|
5631
5643
|
}))).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
5644
|
exports.LogStatus = void 0;
|
|
@@ -5664,10 +5676,20 @@
|
|
|
5664
5676
|
].every(Boolean)
|
|
5665
5677
|
? exports.LogStatus.skipHierarchy
|
|
5666
5678
|
: exports.LogStatus.dataProvided); };
|
|
5679
|
+
var mergeSubValues = function (values) { return Object.values(values.reduce(function (prev, _b) {
|
|
5680
|
+
var id = _b.id, key = _b.key, configModels = _b.configModels;
|
|
5681
|
+
var uniqueKey = [key, id].filter(Boolean).join('.');
|
|
5682
|
+
prev[uniqueKey] = {
|
|
5683
|
+
id: id,
|
|
5684
|
+
key: key,
|
|
5685
|
+
configModels: __spreadArray(__spreadArray([], __read(((prev[uniqueKey] || {}).configModels || []))), __read((configModels || [])))
|
|
5686
|
+
};
|
|
5687
|
+
return prev;
|
|
5688
|
+
}, {})); };
|
|
5667
5689
|
var reduceValues = function (values, termId) {
|
|
5668
5690
|
var propertyValues = values
|
|
5669
|
-
.map(function (
|
|
5670
|
-
var value =
|
|
5691
|
+
.map(function (_b) {
|
|
5692
|
+
var value = _b.value;
|
|
5671
5693
|
return term.propertyValue(value, termId);
|
|
5672
5694
|
})
|
|
5673
5695
|
// propertyValue may return null if the value is null or undefined, therefore remove them from total
|
|
@@ -5696,8 +5718,8 @@
|
|
|
5696
5718
|
input: function (values, _k, id) {
|
|
5697
5719
|
var _a;
|
|
5698
5720
|
return !!id && (values === null || values === void 0 ? void 0 : values.length)
|
|
5699
|
-
? term.propertyValue((_a = values.find(function (
|
|
5700
|
-
var inputs =
|
|
5721
|
+
? term.propertyValue((_a = values.find(function (_b) {
|
|
5722
|
+
var inputs = _b.inputs;
|
|
5701
5723
|
return (inputs || []).some(function (input) { return input['@id'] === id; });
|
|
5702
5724
|
})) === null || _a === void 0 ? void 0 : _a.value, id)
|
|
5703
5725
|
: '';
|
|
@@ -5715,33 +5737,48 @@
|
|
|
5715
5737
|
var logSubValue = function (logs, key, prop) { return logs[key][prop] ? (Array.isArray(logs[key][prop]) ?
|
|
5716
5738
|
logs[key][prop].map(function (id) { return ({ key: prop, id: id }); }) :
|
|
5717
5739
|
{ key: prop, id: logs[key][prop] }) : undefined; };
|
|
5718
|
-
var logProperties = function (nodes, models) { return nodes.flatMap(function (node) { return (node.properties || []).map(function (
|
|
5719
|
-
var term =
|
|
5740
|
+
var logProperties = function (nodes, models) { return nodes.flatMap(function (node) { return (node.properties || []).map(function (_b) {
|
|
5741
|
+
var term = _b.term;
|
|
5720
5742
|
return term['@id'];
|
|
5721
|
-
}); }).map(function (id) { return ({ key: 'property', id: id, configModels: findModels(models, id).map(function (
|
|
5722
|
-
var model =
|
|
5743
|
+
}); }).map(function (id) { return ({ key: 'property', id: id, configModels: findModels(models, id).map(function (_b) {
|
|
5744
|
+
var model = _b.model;
|
|
5723
5745
|
return model;
|
|
5724
5746
|
}) }); }); };
|
|
5725
|
-
var logSubValues = function (allLogs, logs, original, recalculated, models,
|
|
5726
|
-
var nodeType =
|
|
5727
|
-
return
|
|
5747
|
+
var logSubValues = function (allLogs, logs, original, recalculated, models, _b) {
|
|
5748
|
+
var nodeType = _b.nodeType, type = _b.type, termId = _b.termId;
|
|
5749
|
+
return mergeSubValues(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(Object.keys(logs)
|
|
5750
|
+
.filter(function (id) { return logs[id].isProperty; })
|
|
5751
|
+
.map(function (id) { return ({
|
|
5752
|
+
id: id,
|
|
5753
|
+
key: 'property',
|
|
5754
|
+
configModels: (logs[id].models || []).filter(function (v) { return hasLog(logs[id][v]); })
|
|
5755
|
+
}); }))), __read(Object.keys(logs).flatMap(function (key) { return [
|
|
5728
5756
|
logSubValue(logs, key, 'input'),
|
|
5729
5757
|
logSubValue(logs, key, 'property')
|
|
5730
5758
|
]
|
|
5731
5759
|
.flat()
|
|
5732
5760
|
.filter(Boolean)
|
|
5733
|
-
.map(function (v) { return (Object.assign(Object.assign({}, v), { configModels: [key] })); }); }))), __read(logProperties(original, models))), __read(logProperties(recalculated, models))))
|
|
5734
|
-
.map(function (
|
|
5735
|
-
var
|
|
5736
|
-
var
|
|
5737
|
-
|
|
5761
|
+
.map(function (v) { return (Object.assign(Object.assign({}, v), { configModels: v.configModels || [key] })); }); }))), __read(logProperties(original, models))), __read(logProperties(recalculated, models))))
|
|
5762
|
+
.map(function (_b) {
|
|
5763
|
+
var key = _b.key, id = _b.id, configModels = _b.configModels;
|
|
5764
|
+
var originalValue = blankNodeValue(original, key, id);
|
|
5765
|
+
var recalculatedValue = blankNodeValue(recalculated, key, id);
|
|
5766
|
+
return {
|
|
5767
|
+
key: key,
|
|
5768
|
+
id: id,
|
|
5769
|
+
configModels: configModels.map(configModelWithDocs(models, { nodeType: nodeType, type: type, termId: termId }, { key: key, id: id })),
|
|
5770
|
+
originalValue: originalValue,
|
|
5771
|
+
recalculatedValue: recalculatedValue,
|
|
5772
|
+
isRecalculated: !utils.isUndefined(recalculatedValue) && recalculatedValue !== originalValue,
|
|
5773
|
+
isRequired: true
|
|
5774
|
+
};
|
|
5738
5775
|
})
|
|
5739
5776
|
.filter(function (v) { return v.configModels.length > 0; })
|
|
5740
|
-
.map(dataWithConfigModelLogs(allLogs));
|
|
5777
|
+
.map(function (v) { return v.key === 'property' ? dataWithConfigModelLogs(logs)(v) : dataWithConfigModelLogs(allLogs)(v); });
|
|
5741
5778
|
};
|
|
5742
5779
|
// const hasKey = (blankNodes: blankNode[], key: string) => (blankNodes || []).some(n => key in n);
|
|
5743
|
-
var logKeys = function (logs, original, recalculated, models,
|
|
5744
|
-
var nodeType =
|
|
5780
|
+
var logKeys = function (logs, original, recalculated, models, _b) {
|
|
5781
|
+
var nodeType = _b.nodeType, type = _b.type, termId = _b.termId;
|
|
5745
5782
|
return Object.keys(logs)
|
|
5746
5783
|
.filter(function (key) { return logs[key].isKey; })
|
|
5747
5784
|
.map(function (key) { return ({
|
|
@@ -5782,8 +5819,8 @@
|
|
|
5782
5819
|
}).filter(Boolean);
|
|
5783
5820
|
return indexes.length ? indexes[0] : '';
|
|
5784
5821
|
};
|
|
5785
|
-
var configModelWithDocs = function (models,
|
|
5786
|
-
var nodeType =
|
|
5822
|
+
var configModelWithDocs = function (models, _b, subValue) {
|
|
5823
|
+
var nodeType = _b.nodeType, type = _b.type, termId = _b.termId, termType = _b.termType;
|
|
5787
5824
|
return function (methodId) {
|
|
5788
5825
|
var node = {
|
|
5789
5826
|
'@type': nodeType,
|
|
@@ -5793,6 +5830,8 @@
|
|
|
5793
5830
|
return {
|
|
5794
5831
|
methodId: methodId,
|
|
5795
5832
|
model: findMatchingModel(models, modelParams(node)) ||
|
|
5833
|
+
// handle "liveAnimal"
|
|
5834
|
+
(termType && findMatchingModel(models, modelKeyParams(node, termType))) ||
|
|
5796
5835
|
findMatchingModel(models, modelKeyParams(node, (subValue === null || subValue === void 0 ? void 0 : subValue.key) + "." + methodId)) ||
|
|
5797
5836
|
// handle "input.price"
|
|
5798
5837
|
findMatchingModel(models, modelKeyParams(node, type.toLowerCase() + "." + (subValue === null || subValue === void 0 ? void 0 : subValue.key))) ||
|
|
@@ -5820,8 +5859,8 @@
|
|
|
5820
5859
|
order: modelConfigOrder(config.models, termId, modelKey, model.methodId)
|
|
5821
5860
|
}); });
|
|
5822
5861
|
return modelsWithOrder
|
|
5823
|
-
.reduce(function (prev,
|
|
5824
|
-
var model =
|
|
5862
|
+
.reduce(function (prev, _b) {
|
|
5863
|
+
var model = _b.model, order = _b.order;
|
|
5825
5864
|
var isArray = order.includes('.');
|
|
5826
5865
|
var arrayIndex = isArray ? order.split('.')[0] : prev.length;
|
|
5827
5866
|
prev[arrayIndex] = isArray ? __spreadArray(__spreadArray([], __read((prev[arrayIndex] || []))), [model]) : model;
|
|
@@ -5845,13 +5884,14 @@
|
|
|
5845
5884
|
undefined;
|
|
5846
5885
|
return function (term) {
|
|
5847
5886
|
var termId = term['@id'];
|
|
5887
|
+
var termType = term.termType;
|
|
5848
5888
|
var termLogs = get$3(logs, termId, {});
|
|
5849
5889
|
var original = originalValues.filter(function (v) { return termId === v.term['@id']; });
|
|
5850
5890
|
var recalculated = recalculatedValues.filter(function (v) { return termId === v.term['@id']; });
|
|
5851
5891
|
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 (
|
|
5854
|
-
var model =
|
|
5892
|
+
var configModelsData = { nodeType: nodeType, type: type, termId: termId, termType: termType };
|
|
5893
|
+
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 (_b) {
|
|
5894
|
+
var model = _b.model;
|
|
5855
5895
|
return model;
|
|
5856
5896
|
})))).map(configModelWithDocs(models, configModelsData)));
|
|
5857
5897
|
var keys = logKeys(termLogs, original, recalculated, models, configModelsData);
|
|
@@ -5889,9 +5929,7 @@
|
|
|
5889
5929
|
0
|
|
5890
5930
|
], __read(blankNodeLogs.flatMap(function (v) { return __spreadArray(__spreadArray([
|
|
5891
5931
|
v.configModels.length
|
|
5892
|
-
], __read(v.subValues.map(function (s) { var _a
|
|
5893
|
-
v.keys.length ? 1 : 0
|
|
5894
|
-
]); })))); };
|
|
5932
|
+
], __read((v.subValues.map(function (s) { var _a; return ((_a = s.configModels) === null || _a === void 0 ? void 0 : _a.length) || 0; })))), __read((v.keys.map(function (s) { var _a; return ((_a = s.configModels) === null || _a === void 0 ? void 0 : _a.length) || 0; })))); })))); };
|
|
5895
5933
|
|
|
5896
5934
|
var _b, _c$1;
|
|
5897
5935
|
var nodeTypesLowerCase = Object.values(schema.NodeType).map(function (v) { return v.toLowerCase(); });
|
|
@@ -6132,6 +6170,10 @@
|
|
|
6132
6170
|
this.additionalKeys = additionalKeys;
|
|
6133
6171
|
this.tableKeys = tableKeys;
|
|
6134
6172
|
}
|
|
6173
|
+
NodeValueDetailsComponent.prototype.ngOnInit = function () {
|
|
6174
|
+
var _this = this;
|
|
6175
|
+
this.tableKeys = tableKeys.filter(function (key) { var _a; return (((_a = _this.data) === null || _a === void 0 ? void 0 : _a.nodes) || []).some(function (node) { return key in node; }); });
|
|
6176
|
+
};
|
|
6135
6177
|
Object.defineProperty(NodeValueDetailsComponent.prototype, "type", {
|
|
6136
6178
|
get: function () {
|
|
6137
6179
|
var _a;
|
|
@@ -6140,14 +6182,18 @@
|
|
|
6140
6182
|
enumerable: false,
|
|
6141
6183
|
configurable: true
|
|
6142
6184
|
});
|
|
6143
|
-
NodeValueDetailsComponent.prototype
|
|
6144
|
-
|
|
6145
|
-
|
|
6146
|
-
|
|
6185
|
+
Object.defineProperty(NodeValueDetailsComponent.prototype, "showInline", {
|
|
6186
|
+
get: function () {
|
|
6187
|
+
var _a, _b;
|
|
6188
|
+
return ((_b = (_a = this.data) === null || _a === void 0 ? void 0 : _a.nodes) === null || _b === void 0 ? void 0 : _b.length) === 1;
|
|
6189
|
+
},
|
|
6190
|
+
enumerable: false,
|
|
6191
|
+
configurable: true
|
|
6192
|
+
});
|
|
6147
6193
|
return NodeValueDetailsComponent;
|
|
6148
6194
|
}());
|
|
6149
6195
|
NodeValueDetailsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: NodeValueDetailsComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
6150
|
-
NodeValueDetailsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: NodeValueDetailsComponent, selector: "he-node-value-details", inputs: { data: "data", nodeType: "nodeType", dataKey: "dataKey" }, ngImport: i0__namespace, template: "<ng-container *bindOnce=\"data\">\n <ng-container *ngIf=\"
|
|
6196
|
+
NodeValueDetailsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: NodeValueDetailsComponent, selector: "he-node-value-details", inputs: { data: "data", nodeType: "nodeType", dataKey: "dataKey" }, ngImport: i0__namespace, template: "<ng-container *bindOnce=\"data\">\n <ng-container *ngIf=\"showInline; else asTable\">\n <ng-container *ngFor=\"let key of keys\">\n <he-link-key-value [node]=\"data!.nodes[0]\" [nodeType]=\"nodeType\" [dataKey]=\"dataKey\" [key]=\"key\"></he-link-key-value>\n </ng-container>\n <ng-container *ngFor=\"let key of additionalKeys\">\n <he-link-key-value [node]=\"data!.nodes[0]\" [nodeType]=\"nodeType\" [dataKey]=\"dataKey\" [key]=\"key\"></he-link-key-value>\n </ng-container>\n </ng-container>\n</ng-container>\n\n<ng-template #asTable>\n <he-link-key-value [node]=\"data!.nodes[0]\" [nodeType]=\"nodeType\" [dataKey]=\"dataKey\" key=\"term\"></he-link-key-value>\n\n <div class=\"table-container mt-2\">\n <table class=\"table is-narrow\">\n <thead>\n <th *ngFor=\"let key of tableKeys\">\n <a [href]=\"baseUrl + '/schema/' + type + '#' + key\" target=\"_blank\"><b>{{key}}</b></a>\n </th>\n </thead>\n <tbody>\n <tr *ngFor=\"let node of data!.nodes\">\n <td *ngFor=\"let key of tableKeys\">\n <he-link-key-value [node]=\"node\" [nodeType]=\"nodeType\" [dataKey]=\"dataKey\" [key]=\"key\"></he-link-key-value>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n</ng-template>\n", styles: ["table{background-color:transparent;color:#fff}table::ng-deep he-link-key-value>a:first-child,table::ng-deep he-link-key-value>a:first-child+span{display:none}\n"], components: [{ type: LinkKeyValueComponent, selector: "he-link-key-value", inputs: ["node", "nodeType", "dataKey", "key"] }], directives: [{ type: BindOnceDirective, selector: "[bindOnce]", inputs: ["bindOnce"] }, { type: i2__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
6151
6197
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: NodeValueDetailsComponent, decorators: [{
|
|
6152
6198
|
type: i0.Component,
|
|
6153
6199
|
args: [{
|
|
@@ -6331,7 +6377,7 @@
|
|
|
6331
6377
|
return CyclesFunctionalUnitMeasureComponent;
|
|
6332
6378
|
}());
|
|
6333
6379
|
CyclesFunctionalUnitMeasureComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesFunctionalUnitMeasureComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
6334
|
-
CyclesFunctionalUnitMeasureComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesFunctionalUnitMeasureComponent, selector: "he-cycles-functional-unit-measure", inputs: { cycle: "cycle" }, ngImport: i0__namespace, template: "<span class=\"
|
|
6380
|
+
CyclesFunctionalUnitMeasureComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesFunctionalUnitMeasureComponent, selector: "he-cycles-functional-unit-measure", inputs: { cycle: "cycle" }, ngImport: i0__namespace, template: "<span class=\"is-nowrap has-text-ellipsis\" [ngSwitch]=\"cycle?.functionalUnit\" [attr.title]=\"cycle?.functionalUnit\">\n <ng-container *ngSwitchCase=\"CycleFunctionalUnit['1 ha']\">1 hectare</ng-container>\n <ng-container *ngSwitchDefault>relative</ng-container>\n</span>\n", styles: [":host{display:inline-block}\n"], directives: [{ type: i2__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i2__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i2__namespace.NgSwitchDefault, selector: "[ngSwitchDefault]" }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
6335
6381
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesFunctionalUnitMeasureComponent, decorators: [{
|
|
6336
6382
|
type: i0.Component,
|
|
6337
6383
|
args: [{
|
|
@@ -6897,15 +6943,16 @@
|
|
|
6897
6943
|
};
|
|
6898
6944
|
Object.defineProperty(CyclesPracticesComponent.prototype, "showTimeline", {
|
|
6899
6945
|
get: function () {
|
|
6900
|
-
|
|
6946
|
+
var _a, _b;
|
|
6947
|
+
return (((_b = (_a = this.cycles) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.practices) || []).some(function (p) { var _a; return timelineTermType.includes((_a = p.term) === null || _a === void 0 ? void 0 : _a.termType); });
|
|
6901
6948
|
},
|
|
6902
6949
|
enumerable: false,
|
|
6903
6950
|
configurable: true
|
|
6904
6951
|
});
|
|
6905
6952
|
// Recalculation logs
|
|
6906
|
-
CyclesPracticesComponent.prototype.selectIndex = function (
|
|
6953
|
+
CyclesPracticesComponent.prototype.selectIndex = function (_c) {
|
|
6907
6954
|
var _this = this;
|
|
6908
|
-
var value =
|
|
6955
|
+
var value = _c.target.value;
|
|
6909
6956
|
this.selectedIndex = -1;
|
|
6910
6957
|
// force a refresh of the logs
|
|
6911
6958
|
setTimeout(function () { return (_this.selectedIndex = +value); });
|
|
@@ -7275,7 +7322,10 @@
|
|
|
7275
7322
|
var contactUsEmail = 'community@hestia.earth';
|
|
7276
7323
|
var externalLink = function (href, text) { return "<a href=\"" + href + "\" target=\"_blank\">" + text + "</a>"; };
|
|
7277
7324
|
var glossaryLink = function (text) { return externalLink(baseUrl() + "/glossary", text); };
|
|
7278
|
-
var glossaryTypeLink = function (type
|
|
7325
|
+
var glossaryTypeLink = function (type, text) {
|
|
7326
|
+
if (text === void 0) { text = termTypeLabel(type); }
|
|
7327
|
+
return externalLink(baseUrl() + "/glossary?termType=" + type, text);
|
|
7328
|
+
};
|
|
7279
7329
|
var termLink = function (_g) {
|
|
7280
7330
|
var id = _g.id, name = _g.name;
|
|
7281
7331
|
return externalLink(baseUrl() + "/term/" + id, name);
|
|
@@ -7476,6 +7526,7 @@
|
|
|
7476
7526
|
var params = _g.params;
|
|
7477
7527
|
return (errorCount === 1 ? code(params === null || params === void 0 ? void 0 : params.term.name) + " exists" : 'Some Emissions exist') + " in both the Cycle and the Transformation but " + (errorCount === 1 ? 'it is' : 'they are') + " not linked using " + code('cycle.emissions.X.transformation.term') + ". This may be an error.";
|
|
7478
7528
|
},
|
|
7529
|
+
_g['should add an animal production system'] = function () { return "For animal production cycles, we recommend specifying the animal production " + glossaryTypeLink(schema.TermTermType.system) + " as a Practice.\n You can find a list of systems in the " + glossaryTypeLink(schema.TermTermType.system, 'Glossary') + "."; },
|
|
7479
7530
|
_g);
|
|
7480
7531
|
var formatCustomErrorMessage = function (message, error, errorCount) {
|
|
7481
7532
|
if (errorCount === void 0) { errorCount = 1; }
|
|
@@ -9248,11 +9299,11 @@
|
|
|
9248
9299
|
return __generator(this, function (_e) {
|
|
9249
9300
|
switch (_e.label) {
|
|
9250
9301
|
case 0:
|
|
9251
|
-
this.terms = utils.unique(this.indicators.map(function (_d) {
|
|
9302
|
+
this.terms = utils.unique((this.indicators || []).map(function (_d) {
|
|
9252
9303
|
var term = _d.term;
|
|
9253
9304
|
return term;
|
|
9254
9305
|
}).filter(Boolean));
|
|
9255
|
-
this.methods = utils.unique(this.indicators.map(function (_d) {
|
|
9306
|
+
this.methods = utils.unique((this.indicators || []).map(function (_d) {
|
|
9256
9307
|
var methodModel = _d.methodModel;
|
|
9257
9308
|
return methodModel;
|
|
9258
9309
|
}).filter(Boolean));
|
|
@@ -9778,7 +9829,7 @@
|
|
|
9778
9829
|
return ImpactAssessmentsProductsComponent;
|
|
9779
9830
|
}());
|
|
9780
9831
|
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 });
|
|
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 } });
|
|
9832
|
+
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\" [attr.title]=\"impactAssessment.product?.units\">\n <span class=\"is-nowrap has-text-ellipsis\">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 } });
|
|
9782
9833
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ImpactAssessmentsProductsComponent, decorators: [{
|
|
9783
9834
|
type: i0.Component,
|
|
9784
9835
|
args: [{
|