@hestia-earth/ui-components 0.0.18 → 0.0.21
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 +267 -486
- package/bundles/hestia-earth-ui-components.umd.js.map +1 -1
- package/common/blank-node-state/blank-node-state.component.d.ts +1 -1
- package/cycles/cycles-activity/cycles-activity.component.d.ts +4 -2
- package/cycles/cycles-completeness/cycles-completeness.component.d.ts +3 -1
- package/cycles/cycles-emissions/cycles-emissions.component.d.ts +3 -11
- package/cycles/cycles-emissions-chart/cycles-emissions-chart.component.d.ts +2 -1
- package/cycles/cycles-practices/cycles-practices.component.d.ts +3 -11
- package/cycles/cycles-result/cycles-result.component.d.ts +3 -1
- package/cycles/cycles.module.d.ts +5 -6
- package/cycles/index.d.ts +0 -1
- package/esm2015/common/blank-node-state/blank-node-state.component.js +2 -2
- package/esm2015/cycles/cycles-activity/cycles-activity.component.js +17 -23
- package/esm2015/cycles/cycles-completeness/cycles-completeness.component.js +8 -2
- package/esm2015/cycles/cycles-emissions/cycles-emissions.component.js +17 -56
- package/esm2015/cycles/cycles-emissions-chart/cycles-emissions-chart.component.js +18 -8
- package/esm2015/cycles/cycles-practices/cycles-practices.component.js +16 -55
- package/esm2015/cycles/cycles-result/cycles-result.component.js +19 -6
- package/esm2015/cycles/cycles.module.js +4 -8
- package/esm2015/cycles/index.js +1 -2
- package/esm2015/files/files-error.model.js +3 -3
- package/esm2015/files/files-form/files-form.component.js +1 -1
- package/esm2015/fontawesome/fontawesome.module.js +3 -3
- package/esm2015/impact-assessments/impact-assessments-indicators-chart/impact-assessments-indicators-chart.component.js +24 -54
- package/esm2015/impact-assessments/impact-assessments-products/impact-assessments-products.component.js +30 -131
- package/esm2015/node/node-logs-models/node-logs-models.component.js +81 -31
- package/esm2015/node/node.service.js +1 -1
- package/esm2015/sites/sites-maps/sites-maps.component.js +10 -3
- package/esm2015/sites/sites-measurements/sites-measurements.component.js +8 -2
- package/fesm2015/hestia-earth-ui-components.js +196 -375
- package/fesm2015/hestia-earth-ui-components.js.map +1 -1
- package/impact-assessments/impact-assessments-indicators-chart/impact-assessments-indicators-chart.component.d.ts +5 -8
- package/impact-assessments/impact-assessments-products/impact-assessments-products.component.d.ts +5 -30
- package/node/node-logs-models/node-logs-models.component.d.ts +30 -4
- package/node/node.service.d.ts +1 -0
- package/package.json +1 -1
- package/sites/sites-maps/sites-maps.component.d.ts +3 -1
- package/sites/sites-measurements/sites-measurements.component.d.ts +3 -1
- package/cycles/cycles-suggest-form/cycles-suggest-form.component.d.ts +0 -23
- package/esm2015/cycles/cycles-suggest-form/cycles-suggest-form.component.js +0 -83
|
@@ -392,7 +392,7 @@
|
|
|
392
392
|
// free-regular
|
|
393
393
|
freeRegularSvgIcons.faClone, freeRegularSvgIcons.faCircle, freeRegularSvgIcons.faIdBadge,
|
|
394
394
|
// free-solid
|
|
395
|
-
freeSolidSvgIcons.faAngleDoubleLeft, freeSolidSvgIcons.faAngleDoubleRight, freeSolidSvgIcons.faAngleDown, freeSolidSvgIcons.faAngleLeft, freeSolidSvgIcons.faAngleRight, freeSolidSvgIcons.faBookOpen, freeSolidSvgIcons.faBuilding, freeSolidSvgIcons.faCalculator, freeSolidSvgIcons.faChartBar, freeSolidSvgIcons.faCheck, freeSolidSvgIcons.faCircle, freeSolidSvgIcons.faClipboard, freeSolidSvgIcons.faClipboardList, freeSolidSvgIcons.faClone, freeSolidSvgIcons.faComments, freeSolidSvgIcons.faDownload, freeSolidSvgIcons.faDrawPolygon, freeSolidSvgIcons.faEdit, freeSolidSvgIcons.faExclamationTriangle, freeSolidSvgIcons.faExternalLinkAlt, freeSolidSvgIcons.faFilter, freeSolidSvgIcons.faList, freeSolidSvgIcons.faLongArrowAltDown, freeSolidSvgIcons.faLongArrowAltUp, freeSolidSvgIcons.faLongArrowAltLeft, freeSolidSvgIcons.faLongArrowAltRight, freeSolidSvgIcons.faMap, freeSolidSvgIcons.faMapMarked, freeSolidSvgIcons.faMapMarkedAlt, freeSolidSvgIcons.faPlus, freeSolidSvgIcons.faPlusCircle, freeSolidSvgIcons.faSearch, freeSolidSvgIcons.faSeedling, freeSolidSvgIcons.faSpellCheck, freeSolidSvgIcons.faSpinner, freeSolidSvgIcons.faTimes, freeSolidSvgIcons.faUser);
|
|
395
|
+
freeSolidSvgIcons.faAngleDoubleLeft, freeSolidSvgIcons.faAngleDoubleRight, freeSolidSvgIcons.faAngleDown, freeSolidSvgIcons.faAngleLeft, freeSolidSvgIcons.faAngleRight, freeSolidSvgIcons.faBookOpen, freeSolidSvgIcons.faBuilding, freeSolidSvgIcons.faCalculator, freeSolidSvgIcons.faChartBar, freeSolidSvgIcons.faCheck, freeSolidSvgIcons.faCircle, freeSolidSvgIcons.faClipboard, freeSolidSvgIcons.faClipboardList, freeSolidSvgIcons.faClone, freeSolidSvgIcons.faComments, freeSolidSvgIcons.faDownload, freeSolidSvgIcons.faDrawPolygon, freeSolidSvgIcons.faEdit, freeSolidSvgIcons.faExclamationTriangle, freeSolidSvgIcons.faExternalLinkAlt, freeSolidSvgIcons.faFilter, freeSolidSvgIcons.faList, freeSolidSvgIcons.faLongArrowAltDown, freeSolidSvgIcons.faLongArrowAltUp, freeSolidSvgIcons.faLongArrowAltLeft, freeSolidSvgIcons.faLongArrowAltRight, freeSolidSvgIcons.faMap, freeSolidSvgIcons.faMapMarked, freeSolidSvgIcons.faMapMarkedAlt, freeSolidSvgIcons.faMinusCircle, freeSolidSvgIcons.faPlus, freeSolidSvgIcons.faPlusCircle, freeSolidSvgIcons.faSearch, freeSolidSvgIcons.faSeedling, freeSolidSvgIcons.faSpellCheck, freeSolidSvgIcons.faSpinner, freeSolidSvgIcons.faTimes, freeSolidSvgIcons.faUser);
|
|
396
396
|
}
|
|
397
397
|
return HeFontawesomeModule;
|
|
398
398
|
}());
|
|
@@ -1609,7 +1609,7 @@
|
|
|
1609
1609
|
type: i0.Input
|
|
1610
1610
|
}] } });
|
|
1611
1611
|
|
|
1612
|
-
var _a$4, _b$1, _c$1, _d$
|
|
1612
|
+
var _a$4, _b$1, _c$1, _d$3;
|
|
1613
1613
|
var SUCCESS_CRITERION_MAX_DELTA_PERCENT = 5;
|
|
1614
1614
|
var WARNING_CRITERION_MAX_DELTA_PERCENT = 20;
|
|
1615
1615
|
exports.DeltaColour = void 0;
|
|
@@ -1655,9 +1655,9 @@
|
|
|
1655
1655
|
var matchingCondition = Object.values(PercentDeltaConditions).find(function (value) { return calculatePercentDeltaConditions[value](original, recalculated); }) || 'default';
|
|
1656
1656
|
return calculatePercentDeltaResult[matchingCondition](original, recalculated) * 100;
|
|
1657
1657
|
};
|
|
1658
|
-
var customDeltaFuncs = (_d$
|
|
1659
|
-
_d$
|
|
1660
|
-
_d$
|
|
1658
|
+
var customDeltaFuncs = (_d$3 = {},
|
|
1659
|
+
_d$3[exports.DeltaDisplayType.percent] = calculatePercentDelta,
|
|
1660
|
+
_d$3);
|
|
1661
1661
|
var evaluateSuccess = function (deltaValue) { return Math.abs(deltaValue) < SUCCESS_CRITERION_MAX_DELTA_PERCENT
|
|
1662
1662
|
? exports.DeltaColour.Success
|
|
1663
1663
|
: Math.abs(deltaValue) < WARNING_CRITERION_MAX_DELTA_PERCENT
|
|
@@ -4063,7 +4063,7 @@
|
|
|
4063
4063
|
}]
|
|
4064
4064
|
}], ctorParameters: function () { return [{ type: i1__namespace$2.HttpClient }, { type: HeCommonService }]; } });
|
|
4065
4065
|
|
|
4066
|
-
var _a$3, _b, _c, _d$
|
|
4066
|
+
var _a$3, _b, _c, _d$2, _e$1;
|
|
4067
4067
|
var searchableTypes = [
|
|
4068
4068
|
schema.NodeType.Cycle,
|
|
4069
4069
|
schema.NodeType.Source
|
|
@@ -4266,14 +4266,14 @@
|
|
|
4266
4266
|
/**
|
|
4267
4267
|
* Specific strict queries per type.
|
|
4268
4268
|
*/
|
|
4269
|
-
var searchQueries = (_d$
|
|
4270
|
-
_d$
|
|
4271
|
-
_d$
|
|
4272
|
-
_d$
|
|
4273
|
-
var searchFiltersKeys = (_e = {},
|
|
4274
|
-
_e[schema.NodeType.Cycle] = function (key) { return key; },
|
|
4275
|
-
_e[schema.NodeType.Source] = function (key) { return key; },
|
|
4276
|
-
_e);
|
|
4269
|
+
var searchQueries = (_d$2 = {},
|
|
4270
|
+
_d$2[schema.NodeType.Cycle] = { must: [], must_not: [matchAggregatedQuery] },
|
|
4271
|
+
_d$2[schema.NodeType.Source] = { must: [], must_not: [matchAggregatedQuery] },
|
|
4272
|
+
_d$2);
|
|
4273
|
+
var searchFiltersKeys = (_e$1 = {},
|
|
4274
|
+
_e$1[schema.NodeType.Cycle] = function (key) { return key; },
|
|
4275
|
+
_e$1[schema.NodeType.Source] = function (key) { return key; },
|
|
4276
|
+
_e$1);
|
|
4277
4277
|
/* eslint-disable complexity */
|
|
4278
4278
|
var searchQuery = function (type, query, filters, aggregated) {
|
|
4279
4279
|
var boolQuery = (Object.assign(Object.assign({ must: [
|
|
@@ -5255,9 +5255,10 @@
|
|
|
5255
5255
|
type: i0.Input
|
|
5256
5256
|
}] } });
|
|
5257
5257
|
|
|
5258
|
+
var _d$1, _e;
|
|
5258
5259
|
var get$3 = require('lodash.get');
|
|
5259
5260
|
var orderBy$5 = require('lodash.orderby');
|
|
5260
|
-
var reduceValues = function (values, termId) { return values.length ? values.reduce(function (p, v) { return p + propertyValue$1(v.value, termId); }, 0) :
|
|
5261
|
+
var reduceValues = function (values, termId) { return values.length ? values.reduce(function (p, v) { return p + propertyValue$1(v.value, termId); }, 0) : undefined; };
|
|
5261
5262
|
var logSubValue = function (logs, key, prop) { return logs[key][prop] ? (Array.isArray(logs[key][prop]) ?
|
|
5262
5263
|
logs[key][prop].map(function (value) { return ({ key: prop, value: value }); }) :
|
|
5263
5264
|
{ key: prop, value: logs[key][prop] }) : undefined; };
|
|
@@ -5272,6 +5273,28 @@
|
|
|
5272
5273
|
.filter(Boolean)
|
|
5273
5274
|
.map(function (v) { return (Object.assign(Object.assign({}, v), { configModels: [key] })); }); }); };
|
|
5274
5275
|
var logKeys = function (logs) { return Object.keys(logs).filter(function (key) { return logs[key].isKey; }); };
|
|
5276
|
+
var LogStatus;
|
|
5277
|
+
(function (LogStatus) {
|
|
5278
|
+
LogStatus["success"] = "successful";
|
|
5279
|
+
LogStatus["error"] = "failed";
|
|
5280
|
+
LogStatus["skipHierarchy"] = "not run (model higher up hierarchy run instead)";
|
|
5281
|
+
LogStatus["dataProvided"] = "not run (user provided data retained)";
|
|
5282
|
+
LogStatus["notRequired"] = "not run (not required to run)";
|
|
5283
|
+
})(LogStatus || (LogStatus = {}));
|
|
5284
|
+
var logIcon = (_d$1 = {},
|
|
5285
|
+
_d$1[LogStatus.success] = 'check',
|
|
5286
|
+
_d$1[LogStatus.error] = 'times',
|
|
5287
|
+
_d$1[LogStatus.skipHierarchy] = ['far', 'circle'],
|
|
5288
|
+
_d$1[LogStatus.dataProvided] = 'circle',
|
|
5289
|
+
_d$1[LogStatus.notRequired] = 'minus-circle',
|
|
5290
|
+
_d$1);
|
|
5291
|
+
var logColor = (_e = {},
|
|
5292
|
+
_e[LogStatus.success] = 'success',
|
|
5293
|
+
_e[LogStatus.error] = 'danger',
|
|
5294
|
+
_e[LogStatus.skipHierarchy] = 'dark',
|
|
5295
|
+
_e[LogStatus.dataProvided] = 'dark',
|
|
5296
|
+
_e[LogStatus.notRequired] = 'grey',
|
|
5297
|
+
_e);
|
|
5275
5298
|
var NodeLogsModelsComponent = /** @class */ (function () {
|
|
5276
5299
|
function NodeLogsModelsComponent(searchService, hestiaEngineService) {
|
|
5277
5300
|
var _this = this;
|
|
@@ -5289,6 +5312,10 @@
|
|
|
5289
5312
|
this.blankNodes = [];
|
|
5290
5313
|
this.methodModelsCount = 0;
|
|
5291
5314
|
this.onlyWithData = true;
|
|
5315
|
+
this.showLegend = true;
|
|
5316
|
+
this.LogStatus = LogStatus;
|
|
5317
|
+
this.logIcon = logIcon;
|
|
5318
|
+
this.logColor = logColor;
|
|
5292
5319
|
this.suggestTerm = function (text$) { return text$.pipe(operators.distinctUntilChanged(), operators.switchMap(function (v) { return _this.suggestByTerm(v); })); };
|
|
5293
5320
|
}
|
|
5294
5321
|
NodeLogsModelsComponent.prototype.ngOnInit = function () {
|
|
@@ -5336,16 +5363,16 @@
|
|
|
5336
5363
|
case 4:
|
|
5337
5364
|
_f.allTerms = _g.sent();
|
|
5338
5365
|
this.allBlankNodes = this.allTerms.flatMap(function (term) {
|
|
5339
|
-
var
|
|
5366
|
+
var termLogs = get$3(_this.logs, term['@id'], {});
|
|
5340
5367
|
var original = originalValues.filter(function (v) { return term['@id'] === v.term['@id']; });
|
|
5341
5368
|
var recalculated = recalculatedValues.filter(function (v) { return term['@id'] === v.term['@id']; });
|
|
5342
|
-
var hasData = !!original.length || !!recalculated.length || Object.keys(
|
|
5369
|
+
var hasData = !!original.length || !!recalculated.length || Object.keys(termLogs).length > 0;
|
|
5343
5370
|
var configModels = utils.unique(__spreadArray(__spreadArray([], __read(findConfigModels(_this.config, term['@id'], _this.nodeKey).map(function (_d) {
|
|
5344
5371
|
var model = _d.model;
|
|
5345
5372
|
return model;
|
|
5346
|
-
}))), __read(Object.keys(
|
|
5347
|
-
var keys = logKeys(
|
|
5348
|
-
var subValues = logSubValues(
|
|
5373
|
+
}))), __read(Object.keys(termLogs).filter(function (key) { return !isBackgroundNoInput(termLogs, key); })))).filter(function (key) { return !(key in termLogs) || (!termLogs[key].isKey && !termLogs[key].input && !termLogs[key].property); });
|
|
5374
|
+
var keys = logKeys(termLogs);
|
|
5375
|
+
var subValues = logSubValues(termLogs);
|
|
5349
5376
|
return {
|
|
5350
5377
|
isOpen: true,
|
|
5351
5378
|
canOpen: keys.length > 0 || subValues.length > 0,
|
|
@@ -5354,9 +5381,10 @@
|
|
|
5354
5381
|
configModels: configModels,
|
|
5355
5382
|
original: reduceValues(original, term['@id']),
|
|
5356
5383
|
recalculated: reduceValues(recalculated, term['@id']),
|
|
5357
|
-
|
|
5384
|
+
isOriginal: !!original.length,
|
|
5385
|
+
isRecalculated: recalculated.some(function (v) { return (__spreadArray(__spreadArray([], __read((v.added || []))), __read((v.updated || [])))).includes('value'); }),
|
|
5358
5386
|
hasData: hasData,
|
|
5359
|
-
logs:
|
|
5387
|
+
logs: termLogs,
|
|
5360
5388
|
keys: keys,
|
|
5361
5389
|
subValues: subValues
|
|
5362
5390
|
};
|
|
@@ -5394,6 +5422,31 @@
|
|
|
5394
5422
|
NodeLogsModelsComponent.prototype.togglePopover = function (popover, context) {
|
|
5395
5423
|
return popover.isOpen() ? popover.close() : popover.open(context);
|
|
5396
5424
|
};
|
|
5425
|
+
NodeLogsModelsComponent.prototype.isBackground = function (_d, methodId) {
|
|
5426
|
+
var logs = _d.logs;
|
|
5427
|
+
var log = logs[methodId];
|
|
5428
|
+
return (log === null || log === void 0 ? void 0 : log.methodTier) === schema.EmissionMethodTier.background;
|
|
5429
|
+
};
|
|
5430
|
+
NodeLogsModelsComponent.prototype.isRequired = function (_d, methodId) {
|
|
5431
|
+
var logs = _d.logs;
|
|
5432
|
+
var log = logs[methodId];
|
|
5433
|
+
return !('shouldRunOrchestrator' in log) || log.shouldRunOrchestrator;
|
|
5434
|
+
};
|
|
5435
|
+
NodeLogsModelsComponent.prototype.shouldRun = function (_d, methodId) {
|
|
5436
|
+
var logs = _d.logs;
|
|
5437
|
+
var log = logs[methodId];
|
|
5438
|
+
return log.shouldRun;
|
|
5439
|
+
};
|
|
5440
|
+
NodeLogsModelsComponent.prototype.isUserProvided = function (node, methodId) {
|
|
5441
|
+
var log = node.logs[methodId];
|
|
5442
|
+
return [
|
|
5443
|
+
typeof node.original === 'undefined',
|
|
5444
|
+
node.isRecalculated,
|
|
5445
|
+
this.isBackground(node, methodId),
|
|
5446
|
+
log === null || log === void 0 ? void 0 : log.isKey,
|
|
5447
|
+
this.hasLog(node, methodId, false) // skip if contains logs other than orchestrator
|
|
5448
|
+
].every(function (v) { return !v; });
|
|
5449
|
+
};
|
|
5397
5450
|
NodeLogsModelsComponent.prototype.validSubValue = function (node, index, subValue) {
|
|
5398
5451
|
var methodId = this.getMethodIdAt(node, index, subValue);
|
|
5399
5452
|
var log = get$3(node.logs[methodId], subValue === null || subValue === void 0 ? void 0 : subValue.key, null);
|
|
@@ -5413,30 +5466,32 @@
|
|
|
5413
5466
|
((_c = logs[methodId]) === null || _c === void 0 ? void 0 : _c.model) ||
|
|
5414
5467
|
(methodId ? keyToLabel(methodId) : '');
|
|
5415
5468
|
};
|
|
5416
|
-
NodeLogsModelsComponent.prototype.
|
|
5417
|
-
var log = node.logs[methodId];
|
|
5418
|
-
return (log === null || log === void 0 ? void 0 : log.methodTier) === schema.EmissionMethodTier.background;
|
|
5419
|
-
};
|
|
5420
|
-
NodeLogsModelsComponent.prototype.isSkipped = function (node, methodId) {
|
|
5421
|
-
var log = node.logs[methodId];
|
|
5422
|
-
return [
|
|
5423
|
-
node.isRecalculated,
|
|
5424
|
-
this.isBackground(node, methodId),
|
|
5425
|
-
log === null || log === void 0 ? void 0 : log.isKey,
|
|
5426
|
-
this.hasLog(node, methodId)
|
|
5427
|
-
].every(function (v) { return !v; });
|
|
5428
|
-
};
|
|
5429
|
-
NodeLogsModelsComponent.prototype.hasLog = function (_d, methodId) {
|
|
5469
|
+
NodeLogsModelsComponent.prototype.hasLog = function (_d, methodId, withOrchestrator) {
|
|
5430
5470
|
var logs = _d.logs;
|
|
5431
|
-
|
|
5471
|
+
if (withOrchestrator === void 0) { withOrchestrator = true; }
|
|
5472
|
+
return methodId in logs && ('shouldRun' in logs[methodId] ||
|
|
5473
|
+
(withOrchestrator && 'shouldRunOrchestrator' in logs[methodId]));
|
|
5432
5474
|
};
|
|
5433
5475
|
NodeLogsModelsComponent.prototype.hasLogDetails = function (node, methodId) {
|
|
5434
5476
|
var _a;
|
|
5435
5477
|
var log = node.logs[methodId];
|
|
5436
|
-
return
|
|
5437
|
-
|
|
5438
|
-
|
|
5439
|
-
|
|
5478
|
+
return [
|
|
5479
|
+
LogStatus.success,
|
|
5480
|
+
LogStatus.error
|
|
5481
|
+
].includes(this.logStatus(node, methodId)) && ((log === null || log === void 0 ? void 0 : log.requirements) || (log === null || log === void 0 ? void 0 : log.logs) || ((_a = log === null || log === void 0 ? void 0 : log.missingLookups) === null || _a === void 0 ? void 0 : _a.length));
|
|
5482
|
+
};
|
|
5483
|
+
NodeLogsModelsComponent.prototype.logStatus = function (node, methodId) {
|
|
5484
|
+
return this.isUserProvided(node, methodId) ?
|
|
5485
|
+
LogStatus.dataProvided :
|
|
5486
|
+
(this.hasLog(node, methodId) ?
|
|
5487
|
+
(this.isRequired(node, methodId) ?
|
|
5488
|
+
(this.shouldRun(node, methodId) ?
|
|
5489
|
+
LogStatus.success :
|
|
5490
|
+
LogStatus.error) :
|
|
5491
|
+
(node.isRecalculated ?
|
|
5492
|
+
LogStatus.skipHierarchy :
|
|
5493
|
+
LogStatus.notRequired)) :
|
|
5494
|
+
LogStatus.skipHierarchy);
|
|
5440
5495
|
};
|
|
5441
5496
|
NodeLogsModelsComponent.prototype.requirementColor = function (value) {
|
|
5442
5497
|
return !value || ['None', 'False', '0', '0.0'].includes(value) ? 'danger' : 'white';
|
|
@@ -5454,7 +5509,7 @@
|
|
|
5454
5509
|
return NodeLogsModelsComponent;
|
|
5455
5510
|
}());
|
|
5456
5511
|
NodeLogsModelsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: NodeLogsModelsComponent, deps: [{ token: HeSearchService }, { token: HeEngineService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
5457
|
-
NodeLogsModelsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: NodeLogsModelsComponent, selector: "he-node-logs-models", inputs: { nodeType: "nodeType", nodeKey: "nodeKey", logsUrl: "logsUrl", originalValues: "originalValues", recalculatedValues: "recalculatedValues", terms: "terms", logs: "logs", filteredType: "filteredType" }, ngImport: i0__namespace, template: "<div class=\"px-3 pb-3\">\n <div class=\"has-text-right mb-2\" *ngIf=\"!isExternal\">\n <a class=\"is-size-7\" *ngIf=\"logsUrl\" [href]=\"logsUrl\" target=\"_blank\">\n <fa-icon icon=\"external-link-alt\"></fa-icon>\n <span class=\"pl-2\">Open Full Logs</span>\n </a>\n </div>\n\n <div class=\"table-container data-table-container mb-1\">\n <table class=\"table is-narrow data-table\">\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 [editable]=\"false\"\n [ngbTypeahead]=\"suggestTerm\"\n (selectItem)=\"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>Original</th>\n <th>Recalculated</th>\n <th *ngIf=\"originalValues?.length\">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 colspan=\"5\">\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 <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>\n <span>{{blankNode.original | precision:3 | default:'-'}}</span>\n </td>\n <td>\n <span *ngIf=\"blankNode.isRecalculated; else notUpdated\">\n {{blankNode.recalculated | precision:3 | default:'-'}}\n </span>\n </td>\n <td *ngIf=\"originalValues?.length\" class=\"is-nowrap\">\n <he-blank-node-value-delta *ngIf=\"blankNode.isRecalculated\"\n [value]=\"blankNode.recalculated\"\n [originalValue]=\"blankNode.original\"\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 key of blankNode.keys\"\n [class.is-hidden]=\"!blankNode.isOpen\"\n [class.has-sub-rows]=\"blankNode.subValues?.length\"\n >\n <td class=\"width-auto\">\n <div class=\"pl-3 has-text-left\">\n <span class=\"pr-1 is-align-top\">Field:</span>\n <a class=\"is-inline-block\" *ngIf=\"blankNode.type\"\n [href]=\"baseUrl + '/schema/' + blankNode.type + '#' + key\" target=\"_blank\" [title]=\"key\"\n >\n <span class=\"is-nowrap has-text-ellipsis\">{{key}}</span>\n </a>\n <span class=\"is-inline-block is-align-top\" *ngIf=\"!blankNode.type\">{{key}}</span>\n </div>\n </td>\n <td [attr.colspan]=\"originalValues?.length ? 3 : 2\"></td>\n <td class=\"blank-node-index-key\">\n <ng-container *ngTemplateOutlet=\"blankNodeModel; context: {blankNode: blankNode, methodId: 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>\n <div class=\"pl-3 has-text-left\">\n <div class=\"is-inline-block is-nowrap has-text-ellipsis\">\n <span class=\"is-align-top\">{{subValue.key | keyToLabel}}</span>\n <ng-container *ngIf=\"subValue.value\">\n <span class=\"pr-1 is-align-top\">:</span>\n <ng-container [ngSwitch]=\"subValue.key\">\n <span *ngSwitchCase=\"'backgroundData'\">{{subValue.value | keyToLabel}}</span>\n <ng-container *ngSwitchDefault>\n <he-node-link class=\"is-inline-block\" [node]=\"{'@type':'Term','@id':subValue.value}\">\n <span class=\"is-nowrap has-text-ellipsis\">{{subValue.value | keyToLabel}}</span>\n </he-node-link>\n </ng-container>\n </ng-container>\n </ng-container>\n </div>\n </div>\n </td>\n <td [attr.colspan]=\"originalValues?.length ? 3 : 2\"></td>\n <ng-container *ngTemplateOutlet=\"blankNodeModels; context: {blankNode: blankNode, subValue: subValue}\"></ng-container>\n </tr>\n </ng-container>\n </tbody>\n </table>\n </div>\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 <span>Models:</span>\n </div>\n <div class=\"column is-narrow has-text-success\">\n <fa-icon icon=\"check\"></fa-icon>\n <span class=\"pl-1\">successful</span>\n </div>\n <div class=\"column is-narrow has-text-danger\">\n <fa-icon icon=\"times\"></fa-icon>\n <span class=\"pl-1\">failed</span>\n </div>\n <div class=\"column is-narrow has-text-dark\">\n <fa-icon [icon]=\"['far', 'circle']\"></fa-icon>\n <span class=\"pl-1\">not run (model higher up hierarchy run instead)</span>\n </div>\n <div class=\"column is-narrow has-text-dark\">\n <fa-icon icon=\"circle\"></fa-icon>\n <span class=\"pl-1\">not run (user provided data retained)</span>\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 >\n <span class=\"ml-2\">Show only recalculated {{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)\">\n <ng-container *ngIf=\"getMethodIdAt(blankNode, i, subValue); let methodId\">\n <ng-container *ngTemplateOutlet=\"blankNodeModel; context: {blankNode: blankNode, methodId: methodId}\"></ng-container>\n </ng-container>\n </ng-container>\n </td>\n</ng-template>\n\n<ng-template #blankNodeModel let-blankNode=\"blankNode\" let-methodId=\"methodId\">\n <span\n [class.trigger-popover]=\"hasLogDetails(blankNode, methodId)\"\n [ngbPopover]=\"logDetails\" [autoClose]=\"'outside'\"\n triggers=\"manual\" #p=\"ngbPopover\" placement=\"left\" container=\"body\"\n (click)=\"hasLogDetails(blankNode, methodId) ? togglePopover(p, { log: blankNode.logs[methodId] }) : null\"\n >\n <span class=\"is-capitalized\">{{methodName(blankNode, methodId)}}</span>\n <span class=\"pl-1\" *ngIf=\"hasLog(blankNode, methodId) && blankNode.logs[methodId].methodTier\">[{{blankNode.logs[methodId].methodTier}}]</span>\n <span class=\"pl-1 has-text-{{logColor(blankNode, methodId)}}\">\n <fa-icon *ngIf=\"isSkipped(blankNode, methodId)\" icon=\"circle\"></fa-icon>\n <fa-icon *ngIf=\"!isSkipped(blankNode, methodId) && !hasLog(blankNode, methodId)\" [icon]=\"['far', 'circle']\"></fa-icon>\n <fa-icon *ngIf=\"!isSkipped(blankNode, methodId) && hasLog(blankNode, methodId)\" [icon]=\"blankNode.logs[methodId].shouldRun ? 'check' : 'times'\"></fa-icon>\n </span>\n </span>\n</ng-template>\n\n<ng-template #notUpdated>\n <span>not updated</span>\n</ng-template>\n\n<ng-template #logDetails let-log=\"log\">\n <ng-container *ngIf=\"log.requirements\">\n <p *ngFor=\"let key of log.requirements | keys\" class=\"has-text-{{requirementColor(key.value)}}\">\n {{key.key}}: {{key.value}}\n </p>\n </ng-container>\n <ng-container *ngIf=\"log.logs\">\n <p *ngFor=\"let key of log.logs | keys\">\n {{key.key}}: {{key.value}}\n </p>\n </ng-container>\n <ng-container *ngIf=\"log.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 log.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}table.data-table th:nth-child(2),table.data-table td:nth-child(2){min-width:60px}table.data-table th:nth-child(3),table.data-table td:nth-child(3){min-width:100px}table.data-table tr.has-sub-rows td{border-bottom-style:dotted}table.data-table td he-node-link{width:190px}table.data-table td .open-node+he-node-link{width:170px}\n"], components: [{ type: i1__namespace.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }, { type: NodeLinkComponent, selector: "he-node-link", inputs: ["node", "showExternalLink"] }, { type: BlankNodeValueDeltaComponent, selector: "he-blank-node-value-delta", inputs: ["value", "originalValue", "displayType"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1__namespace$4.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: i10__namespace.NgbTypeahead, selector: "input[ngbTypeahead]", inputs: ["autocomplete", "placement", "container", "editable", "focusFirst", "showHint", "inputFormatter", "ngbTypeahead", "resultFormatter", "resultTemplate"], outputs: ["selectItem"], exportAs: ["ngbTypeahead"] }, { type: i1__namespace$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1__namespace$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i6__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i6__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i6__namespace.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i1__namespace$4.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { type: i10__namespace.NgbPopover, selector: "[ngbPopover]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disablePopover", "popoverClass", "openDelay", "closeDelay", "ngbPopover", "popoverTitle"], outputs: ["shown", "hidden"], exportAs: ["ngbPopover"] }], pipes: { "times": TimesPipe, "default": DefaultPipe, "precision": PrecisionPipe, "keyToLabel": KeyToLabelPipe, "pluralize": PluralizePipe, "keys": KeysPipe } });
|
|
5512
|
+
NodeLogsModelsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: NodeLogsModelsComponent, selector: "he-node-logs-models", inputs: { nodeType: "nodeType", nodeKey: "nodeKey", logsUrl: "logsUrl", originalValues: "originalValues", recalculatedValues: "recalculatedValues", terms: "terms", logs: "logs", filteredType: "filteredType" }, ngImport: i0__namespace, template: "<div class=\"px-3 pb-3\">\n <div class=\"has-text-right mb-2\" *ngIf=\"!isExternal\">\n <a class=\"is-size-7\" *ngIf=\"logsUrl\" [href]=\"logsUrl\" target=\"_blank\">\n <fa-icon icon=\"external-link-alt\"></fa-icon>\n <span class=\"pl-2\">Open Full Logs</span>\n </a>\n </div>\n\n <div class=\"table-container data-table-container mb-1\">\n <table class=\"table is-narrow data-table\">\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 [editable]=\"false\"\n [ngbTypeahead]=\"suggestTerm\"\n (selectItem)=\"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>Original</th>\n <th>Recalculated</th>\n <th *ngIf=\"originalValues?.length\">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 colspan=\"5\">\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 <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>\n <span>{{blankNode.original | precision:3 | default:'-'}}</span>\n </td>\n <td>\n <span *ngIf=\"!blankNode.isOriginal || blankNode.isRecalculated; else notUpdated\">\n {{blankNode.recalculated | precision:3 | default:'-'}}\n </span>\n </td>\n <td *ngIf=\"originalValues?.length\" class=\"is-nowrap\">\n <he-blank-node-value-delta *ngIf=\"blankNode.isRecalculated\"\n [value]=\"blankNode.recalculated\"\n [originalValue]=\"blankNode.original\"\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 key of blankNode.keys\"\n [class.is-hidden]=\"!blankNode.isOpen\"\n [class.has-sub-rows]=\"blankNode.subValues?.length\"\n >\n <td class=\"width-auto\">\n <div class=\"pl-3 has-text-left\">\n <span class=\"pr-1 is-align-top\">Field:</span>\n <a class=\"is-inline-block\" *ngIf=\"blankNode.type\"\n [href]=\"baseUrl + '/schema/' + blankNode.type + '#' + key\" target=\"_blank\" [title]=\"key\"\n >\n <span class=\"is-nowrap has-text-ellipsis\">{{key}}</span>\n </a>\n <span class=\"is-inline-block is-align-top\" *ngIf=\"!blankNode.type\">{{key}}</span>\n </div>\n </td>\n <td [attr.colspan]=\"originalValues?.length ? 3 : 2\"></td>\n <td class=\"blank-node-index-key\">\n <ng-container *ngTemplateOutlet=\"blankNodeModel; context: {blankNode: blankNode, methodId: 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>\n <div class=\"pl-3 has-text-left\">\n <div class=\"is-inline-block is-nowrap has-text-ellipsis\">\n <span class=\"is-align-top\">{{subValue.key | keyToLabel}}</span>\n <ng-container *ngIf=\"subValue.value\">\n <span class=\"pr-1 is-align-top\">:</span>\n <ng-container [ngSwitch]=\"subValue.key\">\n <span *ngSwitchCase=\"'backgroundData'\">{{subValue.value | keyToLabel}}</span>\n <ng-container *ngSwitchDefault>\n <he-node-link class=\"is-inline-block\" [node]=\"{'@type':'Term','@id':subValue.value}\">\n <span class=\"is-nowrap has-text-ellipsis\">{{subValue.value | keyToLabel}}</span>\n </he-node-link>\n </ng-container>\n </ng-container>\n </ng-container>\n </div>\n </div>\n </td>\n <td [attr.colspan]=\"originalValues?.length ? 3 : 2\"></td>\n <ng-container *ngTemplateOutlet=\"blankNodeModels; context: {blankNode: blankNode, subValue: subValue}\"></ng-container>\n </tr>\n </ng-container>\n </tbody>\n </table>\n </div>\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 >\n <span class=\"ml-2\">Show only recalculated {{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)\">\n <ng-container *ngIf=\"getMethodIdAt(blankNode, i, subValue); let methodId\">\n <ng-container *ngTemplateOutlet=\"blankNodeModel; context: {blankNode: blankNode, methodId: methodId}\"></ng-container>\n </ng-container>\n </ng-container>\n </td>\n</ng-template>\n\n<ng-template #blankNodeModel let-blankNode=\"blankNode\" let-methodId=\"methodId\">\n <span\n [class.trigger-popover]=\"hasLogDetails(blankNode, methodId)\"\n [ngbPopover]=\"logDetails\" [autoClose]=\"'outside'\"\n triggers=\"manual\" #p=\"ngbPopover\" placement=\"left\" container=\"body\"\n (click)=\"hasLogDetails(blankNode, methodId) ? togglePopover(p, { log: blankNode.logs[methodId] }) : null\"\n >\n <span class=\"is-capitalized\">{{methodName(blankNode, methodId)}}</span>\n <span class=\"pl-1\" *ngIf=\"hasLog(blankNode, methodId) && blankNode.logs[methodId].methodTier\">[{{blankNode.logs[methodId].methodTier}}]</span>\n <span class=\"pl-1 has-text-{{logColor[logStatus(blankNode, methodId)]}}\">\n <fa-icon [icon]=\"logIcon[logStatus(blankNode, methodId)]\"></fa-icon>\n </span>\n </span>\n</ng-template>\n\n<ng-template #notUpdated>\n <span>not updated</span>\n</ng-template>\n\n<ng-template #logDetails let-log=\"log\">\n <ng-container *ngIf=\"log.requirements\">\n <p *ngFor=\"let key of log.requirements | keys\" class=\"has-text-{{requirementColor(key.value)}}\">\n {{key.key}}: {{key.value}}\n </p>\n </ng-container>\n <ng-container *ngIf=\"log.logs\">\n <p *ngFor=\"let key of log.logs | keys\">\n {{key.key}}: {{key.value}}\n </p>\n </ng-container>\n <ng-container *ngIf=\"log.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 log.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}table.data-table th:nth-child(2),table.data-table td:nth-child(2){min-width:60px}table.data-table th:nth-child(3),table.data-table td:nth-child(3){min-width:100px}table.data-table tr.has-sub-rows td{border-bottom-style:dotted}table.data-table td he-node-link{width:190px}table.data-table td .open-node+he-node-link{width:170px}\n"], components: [{ type: i1__namespace.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }, { type: NodeLinkComponent, selector: "he-node-link", inputs: ["node", "showExternalLink"] }, { type: BlankNodeValueDeltaComponent, selector: "he-blank-node-value-delta", inputs: ["value", "originalValue", "displayType"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1__namespace$4.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: i10__namespace.NgbTypeahead, selector: "input[ngbTypeahead]", inputs: ["autocomplete", "placement", "container", "editable", "focusFirst", "showHint", "inputFormatter", "ngbTypeahead", "resultFormatter", "resultTemplate"], outputs: ["selectItem"], exportAs: ["ngbTypeahead"] }, { type: i1__namespace$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1__namespace$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i6__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i6__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i6__namespace.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i1__namespace$4.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { type: i10__namespace.NgbPopover, selector: "[ngbPopover]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disablePopover", "popoverClass", "openDelay", "closeDelay", "ngbPopover", "popoverTitle"], outputs: ["shown", "hidden"], exportAs: ["ngbPopover"] }], pipes: { "times": TimesPipe, "default": DefaultPipe, "precision": PrecisionPipe, "keyToLabel": KeyToLabelPipe, "keys": KeysPipe, "pluralize": PluralizePipe } });
|
|
5458
5513
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: NodeLogsModelsComponent, decorators: [{
|
|
5459
5514
|
type: i0.Component,
|
|
5460
5515
|
args: [{
|
|
@@ -5638,92 +5693,6 @@
|
|
|
5638
5693
|
type: i0.Input
|
|
5639
5694
|
}] } });
|
|
5640
5695
|
|
|
5641
|
-
var MIN_TYPEAHEAD_LENGTH$2 = 1;
|
|
5642
|
-
var CyclesSuggestFormComponent = /** @class */ (function () {
|
|
5643
|
-
function CyclesSuggestFormComponent(formBuilder, nodeService, searchService) {
|
|
5644
|
-
var _this = this;
|
|
5645
|
-
this.formBuilder = formBuilder;
|
|
5646
|
-
this.nodeService = nodeService;
|
|
5647
|
-
this.searchService = searchService;
|
|
5648
|
-
this.cycles = [];
|
|
5649
|
-
this.cycleAdded = new i0.EventEmitter();
|
|
5650
|
-
this.form = this.formBuilder.group({
|
|
5651
|
-
search: ['', i1$2.Validators.required]
|
|
5652
|
-
});
|
|
5653
|
-
this.loading = false;
|
|
5654
|
-
this.suggesting = false;
|
|
5655
|
-
this.formatter = function (_b) {
|
|
5656
|
-
var id = _b["@id"];
|
|
5657
|
-
return id;
|
|
5658
|
-
};
|
|
5659
|
-
this.suggestCycle = function (text$) { return text$.pipe(operators.debounceTime(300), operators.distinctUntilChanged(), operators.tap(function () { return _this.suggesting = true; }), operators.switchMap(function (term) { return _this.suggest(term); }), operators.tap(function () { return _this.suggesting = false; })); };
|
|
5660
|
-
}
|
|
5661
|
-
CyclesSuggestFormComponent.prototype.suggest = function (term) {
|
|
5662
|
-
return term.length < MIN_TYPEAHEAD_LENGTH$2 ?
|
|
5663
|
-
rxjs.of([]) :
|
|
5664
|
-
this.searchService.suggest(term, schema.NodeType.Cycle, [], {
|
|
5665
|
-
bool: {
|
|
5666
|
-
must: [
|
|
5667
|
-
matchType(schema.NodeType.Cycle),
|
|
5668
|
-
matchAggregatedQuery
|
|
5669
|
-
],
|
|
5670
|
-
must_not: this.cycles.map(function (_b) {
|
|
5671
|
-
var id = _b["@id"];
|
|
5672
|
-
return matchExactQuery('@id', id);
|
|
5673
|
-
}),
|
|
5674
|
-
should: [
|
|
5675
|
-
matchPhraseQuery(term, 100, '@id', 'name'),
|
|
5676
|
-
matchPhrasePrefixQuery(term, 20, '@id', 'name'),
|
|
5677
|
-
matchBoolPrefixQuery(term, 10, '@id', 'name')
|
|
5678
|
-
],
|
|
5679
|
-
minimum_should_match: 1
|
|
5680
|
-
}
|
|
5681
|
-
}, 10, ['name', 'site.country.name', 'products.name', 'endDate']);
|
|
5682
|
-
};
|
|
5683
|
-
CyclesSuggestFormComponent.prototype.loadCycle = function (id) {
|
|
5684
|
-
return this.nodeService.get({
|
|
5685
|
-
'@type': schema.NodeType.Cycle,
|
|
5686
|
-
'@id': id
|
|
5687
|
-
}, false);
|
|
5688
|
-
};
|
|
5689
|
-
CyclesSuggestFormComponent.prototype.submit = function () {
|
|
5690
|
-
var _a;
|
|
5691
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
5692
|
-
var id, cycle;
|
|
5693
|
-
return __generator(this, function (_b) {
|
|
5694
|
-
switch (_b.label) {
|
|
5695
|
-
case 0:
|
|
5696
|
-
this.loading = true;
|
|
5697
|
-
id = this.form.value.search["@id"];
|
|
5698
|
-
return [4 /*yield*/, this.loadCycle(id)];
|
|
5699
|
-
case 1:
|
|
5700
|
-
cycle = _b.sent();
|
|
5701
|
-
this.cycleAdded.emit(cycle);
|
|
5702
|
-
(_a = this.form.get('search')) === null || _a === void 0 ? void 0 : _a.setValue('');
|
|
5703
|
-
this.form.updateValueAndValidity();
|
|
5704
|
-
this.loading = false;
|
|
5705
|
-
return [2 /*return*/];
|
|
5706
|
-
}
|
|
5707
|
-
});
|
|
5708
|
-
});
|
|
5709
|
-
};
|
|
5710
|
-
return CyclesSuggestFormComponent;
|
|
5711
|
-
}());
|
|
5712
|
-
CyclesSuggestFormComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesSuggestFormComponent, deps: [{ token: i1__namespace$4.FormBuilder }, { token: HeNodeService }, { token: HeSearchService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
5713
|
-
CyclesSuggestFormComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesSuggestFormComponent, selector: "he-cycles-suggest-form", inputs: { cycles: "cycles" }, outputs: { cycleAdded: "cycleAdded" }, ngImport: i0__namespace, template: "<form class=\"mt-2\" [formGroup]=\"form\" (submit)=\"form.valid && submit()\">\n <div class=\"field has-addons\">\n <div class=\"control\">\n <span class=\"button is-small is-static\">Compare with Aggregated Cycle</span>\n </div>\n <div class=\"control is-expanded\" [class.has-icons-right]=\"suggesting || loading\">\n <input class=\"input is-small\"\n placeholder=\"Search by name or id\"\n formControlName=\"search\" name=\"search\"\n\n [ngbTypeahead]=\"suggestCycle\"\n [inputFormatter]=\"formatter\"\n [resultTemplate]=\"suggestion\"\n [focusFirst]=\"true\"\n >\n <span class=\"icon is-small is-right has-text-grey-dark\" [class.is-hidden]=\"!(suggesting || loading)\">\n <fa-icon icon=\"spinner\" [pulse]=\"true\" size=\"sm\"></fa-icon>\n </span>\n </div>\n <div class=\"control\">\n <button class=\"button is-small\" type=\"submit\" [disabled]=\"suggesting || loading\">\n <fa-icon icon=\"plus\"></fa-icon>\n </button>\n </div>\n </div>\n</form>\n\n<ng-template #suggestion let-cycle=\"result\" let-t=\"term\">\n <div class=\"is-block\">\n <ngb-highlight [result]=\"cycle.name\" [term]=\"t\"></ngb-highlight>\n </div>\n <div class=\"columns is-flex\">\n <div class=\"column\" *ngIf=\"cycle.site?.country?.name\">\n <span class=\"pr-1 has-text-underline\">Country:</span>\n <span class=\"is-inline-flex\"><ngb-highlight [result]=\"cycle.site.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=\"cycle.endDate\">\n <span class=\"pr-1 has-text-underline\">Date:</span>\n <span class=\"is-inline-flex\"><ngb-highlight [result]=\"cycle.endDate\" [term]=\"t\"></ngb-highlight></span>\n </div>\n </div>\n</ng-template>\n", styles: [""], components: [{ type: i1__namespace.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }, { type: i10__namespace.NgbHighlight, selector: "ngb-highlight", inputs: ["highlightClass", "result", "term"] }], directives: [{ type: i1__namespace$4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1__namespace$4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1__namespace$4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1__namespace$4.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: i10__namespace.NgbTypeahead, selector: "input[ngbTypeahead]", inputs: ["autocomplete", "placement", "container", "editable", "focusFirst", "showHint", "inputFormatter", "ngbTypeahead", "resultFormatter", "resultTemplate"], outputs: ["selectItem"], exportAs: ["ngbTypeahead"] }, { type: i1__namespace$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1__namespace$4.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
5714
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesSuggestFormComponent, decorators: [{
|
|
5715
|
-
type: i0.Component,
|
|
5716
|
-
args: [{
|
|
5717
|
-
selector: 'he-cycles-suggest-form',
|
|
5718
|
-
templateUrl: './cycles-suggest-form.component.html',
|
|
5719
|
-
styleUrls: ['./cycles-suggest-form.component.scss']
|
|
5720
|
-
}]
|
|
5721
|
-
}], ctorParameters: function () { return [{ type: i1__namespace$4.FormBuilder }, { type: HeNodeService }, { type: HeSearchService }]; }, propDecorators: { cycles: [{
|
|
5722
|
-
type: i0.Input
|
|
5723
|
-
}], cycleAdded: [{
|
|
5724
|
-
type: i0.Output
|
|
5725
|
-
}] } });
|
|
5726
|
-
|
|
5727
5696
|
var Tab;
|
|
5728
5697
|
(function (Tab) {
|
|
5729
5698
|
Tab["inputs"] = "Inputs";
|
|
@@ -5788,9 +5757,11 @@
|
|
|
5788
5757
|
function CyclesActivityComponent() {
|
|
5789
5758
|
this.originalValues = [];
|
|
5790
5759
|
this.cycles = [];
|
|
5760
|
+
this.selected = [];
|
|
5791
5761
|
this.enableCompare = true;
|
|
5792
5762
|
this.baseUrl = baseUrl();
|
|
5793
5763
|
this.propertyValue = propertyValue$1;
|
|
5764
|
+
this.defaultLabel = defaultLabel;
|
|
5794
5765
|
this.showDownload = false;
|
|
5795
5766
|
this.View = View$4;
|
|
5796
5767
|
this.selectedView = View$4.table;
|
|
@@ -5824,21 +5795,13 @@
|
|
|
5824
5795
|
CyclesActivityComponent.prototype.togglePopover = function (popover, context) {
|
|
5825
5796
|
return popover.isOpen() ? popover.close() : popover.open(context);
|
|
5826
5797
|
};
|
|
5827
|
-
|
|
5828
|
-
|
|
5829
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
5830
|
-
return __generator(this, function (_a) {
|
|
5831
|
-
this.cycles = __spreadArray(__spreadArray([], __read(this.cycles)), [
|
|
5832
|
-
cycle
|
|
5833
|
-
]);
|
|
5834
|
-
return [2 /*return*/, this.update()];
|
|
5835
|
-
});
|
|
5836
|
-
});
|
|
5798
|
+
CyclesActivityComponent.prototype.isSelected = function (cycle) {
|
|
5799
|
+
return this.selected.length === 0 || this.selected.includes(cycle['@id']);
|
|
5837
5800
|
};
|
|
5838
5801
|
return CyclesActivityComponent;
|
|
5839
5802
|
}());
|
|
5840
5803
|
CyclesActivityComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesActivityComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
5841
|
-
CyclesActivityComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesActivityComponent, selector: "he-cycles-activity", inputs: { originalValues: "originalValues", cycles: "cycles", dataState: "dataState", enableCompare: "enableCompare" }, usesOnChanges: true, ngImport: i0__namespace, template: "<ng-container *ngIf=\"inputs.length || products.length; else emptyTable\">\n <div class=\"columns is-variable is-2 m-0\">\n <div class=\"column is-hidden-mobile\"></div>\n <div class=\"column is-narrow\">\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=\"!isOriginal && cycles.length === 1\">\n <button class=\"button is-small\" [class.is-active]=\"selectedView === View.logs\" (click)=\"selectedView = View.logs\">\n <span class=\"icon is-small\">\n <fa-icon icon=\"calculator\" aria-hidden=\"true\"></fa-icon>\n </span>\n <span>Recalculations logs</span>\n </button>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"px-3 pb-3\" [class.is-hidden]=\"selectedView !== View.table\">\n <div class=\"has-text-right mb-2\">\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\n <div class=\"table-container data-table-container mb-1\">\n <table class=\"table is-narrow data-table has-children-{{inputs.length + products.length}}\">\n <thead>\n <tr>\n <th class=\"width-auto\"></th>\n <th></th>\n <th *ngFor=\"let product of products\"\n [attr.title]=\"product.value.term.name\"\n >\n <he-node-link [node]=\"product.value.term\">\n <span>{{product.value.term.name | ellipsis:30}}</span>\n </he-node-link>\n </th>\n <th *ngFor=\"let input of inputs\"\n [attr.title]=\"input.value.term.name\"\n >\n <he-node-link [node]=\"input.value.term\">\n <span>{{input.value.term.name | ellipsis:30}}</span>\n </he-node-link>\n </th>\n </tr>\n <tr>\n <th class=\"width-auto\"></th>\n <th>\n <a [href]=\"baseUrl + '/schema/Cycle#functionalUnit'\" target=\"_blank\">Functional unit</a>\n </th>\n <th *ngFor=\"let product of products\"\n [attr.title]=\"product.value.term.units\"\n >{{product.value.term.units}}</th>\n <th *ngFor=\"let input of inputs\"\n [attr.title]=\"input.value.term.units\"\n >{{input.value.term.units}}</th>\n </tr>\n </thead>\n <tbody>\n <
|
|
5804
|
+
CyclesActivityComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesActivityComponent, selector: "he-cycles-activity", inputs: { originalValues: "originalValues", cycles: "cycles", selected: "selected", dataState: "dataState", enableCompare: "enableCompare" }, usesOnChanges: true, ngImport: i0__namespace, template: "<ng-container *ngIf=\"inputs.length || products.length; else emptyTable\">\n <div class=\"columns is-variable is-2 m-0\">\n <div class=\"column is-hidden-mobile\"></div>\n <div class=\"column is-narrow\">\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=\"!isOriginal && cycles.length === 1\">\n <button class=\"button is-small\" [class.is-active]=\"selectedView === View.logs\" (click)=\"selectedView = View.logs\">\n <span class=\"icon is-small\">\n <fa-icon icon=\"calculator\" aria-hidden=\"true\"></fa-icon>\n </span>\n <span>Recalculations logs</span>\n </button>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"px-3 pb-3\" [class.is-hidden]=\"selectedView !== View.table\">\n <div class=\"has-text-right mb-2\">\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\n <div class=\"table-container data-table-container mb-1\">\n <table class=\"table is-narrow data-table has-children-{{inputs.length + products.length}}\">\n <thead>\n <tr>\n <th class=\"width-auto\"></th>\n <th></th>\n <th *ngFor=\"let product of products\"\n [attr.title]=\"product.value.term.name\"\n >\n <he-node-link [node]=\"product.value.term\">\n <span>{{product.value.term.name | ellipsis:30}}</span>\n </he-node-link>\n </th>\n <th *ngFor=\"let input of inputs\"\n [attr.title]=\"input.value.term.name\"\n >\n <he-node-link [node]=\"input.value.term\">\n <span>{{input.value.term.name | ellipsis:30}}</span>\n </he-node-link>\n </th>\n </tr>\n <tr>\n <th class=\"width-auto\"></th>\n <th>\n <a [href]=\"baseUrl + '/schema/Cycle#functionalUnit'\" target=\"_blank\">Functional unit</a>\n </th>\n <th *ngFor=\"let product of products\"\n [attr.title]=\"product.value.term.units\"\n >{{product.value.term.units}}</th>\n <th *ngFor=\"let input of inputs\"\n [attr.title]=\"input.value.term.units\"\n >{{input.value.term.units}}</th>\n </tr>\n </thead>\n <tbody>\n <ng-container *ngFor=\"let cycle of cycles; trackBy: trackById; let i = index\">\n <tr *ngIf=\"isSelected(cycle)\">\n <td class=\"width-auto\" [attr.title]=\"defaultLabel(cycle)\">\n <he-node-link [node]=\"cycle\">\n <span class=\"is-nowrap has-text-ellipsis\">{{i + 1}}. {{defaultLabel(cycle)}}</span>\n </he-node-link>\n </td>\n <td>\n <he-cycles-functional-unit-measure [cycle]=\"cycle\"></he-cycles-functional-unit-measure>\n </td>\n <td class=\"is-nowrap\" *ngFor=\"let product of products\">\n <span *ngIf=\"product.value.values[cycle['@id']]; else emptyValue\"\n class=\"trigger-popover\"\n [ngbPopover]=\"details\" [autoClose]=\"'outside'\"\n triggers=\"manual\" #p=\"ngbPopover\" placement=\"left\" container=\"body\"\n (click)=\"togglePopover(p, { data: product.value.values[cycle['@id']], cycle: cycle, key: 'products' })\"\n >\n <span pointer>{{propertyValue(product.value.values[cycle['@id']].value, product.value.term['@id']) | precision:3 | default:'-'}}</span>\n <he-blank-node-state class=\"ml-1\"\n [node]=\"product.value.values[cycle['@id']].nodes[0]\"\n key=\"value\"\n ></he-blank-node-state>\n </span>\n </td>\n <td class=\"is-nowrap\" *ngFor=\"let input of inputs\">\n <span *ngIf=\"input.value.values[cycle['@id']]; else emptyValue\"\n class=\"trigger-popover\"\n [ngbPopover]=\"details\" [autoClose]=\"'outside'\"\n triggers=\"manual\" #p=\"ngbPopover\" placement=\"left\" container=\"body\"\n (click)=\"togglePopover(p, { data: input.value.values[cycle['@id']], cycle: cycle, key: 'inputs' })\"\n >\n <span pointer>{{propertyValue(input.value.values[cycle['@id']].value, input.value.term['@id']) | precision:3 | default:'-'}}</span>\n <he-blank-node-state class=\"ml-1\"\n [node]=\"input.value.values[cycle['@id']].nodes[0]\"\n key=\"value\"\n ></he-blank-node-state>\n </span>\n </td>\n </tr>\n </ng-container>\n </tbody>\n </table>\n </div>\n\n <he-blank-node-state-notice [dataState]=\"dataState\"></he-blank-node-state-notice>\n </div>\n\n <he-cycles-activity-logs *ngIf=\"selectedView === View.logs && !isOriginal\"\n [original]=\"originalValues[0]\"\n [recalculated]=\"cycles[0]\"\n ></he-cycles-activity-logs>\n</ng-container>\n\n<he-node-csv-export-confirm *ngIf=\"showDownload\"\n [nodes]=\"cycles\" filename=\"cycle-inputs-products.csv\" [isUpload]=\"false\"\n [headerKeys]=\"['cycle.id', 'cycle.@id', 'cycle.inputs.', 'cycle.products.']\"\n (closed)=\"showDownload = false\"\n></he-node-csv-export-confirm>\n\n<ng-template #emptyTable>\n <div class=\"panel-block\">\n <span>No activity data</span>\n </div>\n</ng-template>\n\n<ng-template #emptyValue>\n <span>-</span>\n</ng-template>\n\n<ng-template #details let-node=\"cycle\" let-data=\"data\" let-key=\"key\">\n <p><b>{{node.name}}</b></p>\n <he-node-value-details\n [data]=\"data\" [nodeType]=\"node['@type']\" [dataKey]=\"key\"\n ></he-node-value-details>\n</ng-template>\n", styles: ["fa-icon{display:inline-block;width:10px}\n"], components: [{ type: i1__namespace.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }, { type: NodeLinkComponent, selector: "he-node-link", inputs: ["node", "showExternalLink"] }, { type: CyclesFunctionalUnitMeasureComponent, selector: "he-cycles-functional-unit-measure", inputs: ["cycle"] }, { type: BlankNodeStateComponent, selector: "he-blank-node-state", inputs: ["nodeType", "dataKey", "key", "node", "state"] }, { type: BlankNodeStateNoticeComponent, selector: "he-blank-node-state-notice", inputs: ["dataState", "showAggregated", "showDeleted", "showUnchanged"] }, { type: CyclesActivityLogsComponent, selector: "he-cycles-activity-logs", inputs: ["original", "recalculated"] }, { type: NodeCsvExportConfirmComponent, selector: "he-node-csv-export-confirm", inputs: ["nodes", "filename", "headerKeys", "extension", "isUpload"], outputs: ["closed"] }, { type: NodeValueDetailsComponent, selector: "he-node-value-details", inputs: ["data", "nodeType", "dataKey"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10__namespace.NgbPopover, selector: "[ngbPopover]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disablePopover", "popoverClass", "openDelay", "closeDelay", "ngbPopover", "popoverTitle"], outputs: ["shown", "hidden"], exportAs: ["ngbPopover"] }], pipes: { "ellipsis": EllipsisPipe, "default": DefaultPipe, "precision": PrecisionPipe } });
|
|
5842
5805
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesActivityComponent, decorators: [{
|
|
5843
5806
|
type: i0.Component,
|
|
5844
5807
|
args: [{
|
|
@@ -5850,6 +5813,8 @@
|
|
|
5850
5813
|
type: i0.Input
|
|
5851
5814
|
}], cycles: [{
|
|
5852
5815
|
type: i0.Input
|
|
5816
|
+
}], selected: [{
|
|
5817
|
+
type: i0.Input
|
|
5853
5818
|
}], dataState: [{
|
|
5854
5819
|
type: i0.Input
|
|
5855
5820
|
}], enableCompare: [{
|
|
@@ -5862,6 +5827,7 @@
|
|
|
5862
5827
|
var CyclesCompletenessComponent = /** @class */ (function () {
|
|
5863
5828
|
function CyclesCompletenessComponent() {
|
|
5864
5829
|
this.cycles = [];
|
|
5830
|
+
this.selected = [];
|
|
5865
5831
|
this.baseUrl = baseUrl();
|
|
5866
5832
|
this.defaultLabel = defaultLabel;
|
|
5867
5833
|
this.keyToLabel = keyToLabel;
|
|
@@ -5877,10 +5843,13 @@
|
|
|
5877
5843
|
enumerable: false,
|
|
5878
5844
|
configurable: true
|
|
5879
5845
|
});
|
|
5846
|
+
CyclesCompletenessComponent.prototype.isSelected = function (cycle) {
|
|
5847
|
+
return this.selected.length === 0 || this.selected.includes(cycle['@id']);
|
|
5848
|
+
};
|
|
5880
5849
|
return CyclesCompletenessComponent;
|
|
5881
5850
|
}());
|
|
5882
5851
|
CyclesCompletenessComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesCompletenessComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
5883
|
-
CyclesCompletenessComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesCompletenessComponent, selector: "he-cycles-completeness", inputs: { cycles: "cycles", dataState: "dataState" }, ngImport: i0__namespace, template: "<div class=\"p-3\" *ngIf=\"cycles.length; else emptyTable\">\n <div class=\"table-container data-table-container mb-1\">\n <table class=\"table is-narrow data-table has-children-{{cycles.length}}\">\n <thead>\n <tr>\n <th class=\"width-auto\"></th>\n <th *ngFor=\"let completeness of completenessKeys\"\n [attr.title]=\"completeness\"\n ><a [href]=\"baseUrl + '/schema/Completeness#' + completeness\" target=\"_blank\">{{keyToLabel(completeness)}}</a></th>\n </tr>\n </thead>\n <tbody>\n <
|
|
5852
|
+
CyclesCompletenessComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesCompletenessComponent, selector: "he-cycles-completeness", inputs: { cycles: "cycles", selected: "selected", dataState: "dataState" }, ngImport: i0__namespace, template: "<div class=\"p-3\" *ngIf=\"cycles.length; else emptyTable\">\n <div class=\"table-container data-table-container mb-1\">\n <table class=\"table is-narrow data-table has-children-{{cycles.length}}\">\n <thead>\n <tr>\n <th class=\"width-auto\"></th>\n <th *ngFor=\"let completeness of completenessKeys\"\n [attr.title]=\"completeness\"\n ><a [href]=\"baseUrl + '/schema/Completeness#' + completeness\" target=\"_blank\">{{keyToLabel(completeness)}}</a></th>\n </tr>\n </thead>\n <tbody>\n <ng-container *ngFor=\"let cycle of cycles; trackBy: trackById; let i = index\">\n <tr *ngIf=\"isSelected(cycle)\">\n <td class=\"width-auto\" [attr.title]=\"defaultLabel(cycle)\">\n <he-node-link [node]=\"cycle\">\n <span class=\"is-nowrap has-text-ellipsis\">{{i + 1}}. {{defaultLabel(cycle)}}</span>\n </he-node-link>\n </td>\n <td class=\"is-nowrap\" *ngFor=\"let completeness of completenessKeys\">\n <span>{{cycle.dataCompleteness[completeness] ? 'Complete' : 'Incomplete'}}</span>\n <he-blank-node-state class=\"ml-1\"\n [node]=\"cycle.dataCompleteness\"\n [key]=\"completeness\"\n ></he-blank-node-state>\n </td>\n </tr>\n </ng-container>\n </tbody>\n </table>\n </div>\n <he-blank-node-state-notice [dataState]=\"dataState\" [showAggregated]=\"false\"></he-blank-node-state-notice>\n</div>\n\n<ng-template #emptyTable>\n <div class=\"panel-block\">\n <span>No completeness data</span>\n </div>\n</ng-template>\n", styles: [""], components: [{ type: NodeLinkComponent, selector: "he-node-link", inputs: ["node", "showExternalLink"] }, { type: BlankNodeStateComponent, selector: "he-blank-node-state", inputs: ["nodeType", "dataKey", "key", "node", "state"] }, { type: BlankNodeStateNoticeComponent, selector: "he-blank-node-state-notice", inputs: ["dataState", "showAggregated", "showDeleted", "showUnchanged"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
5884
5853
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesCompletenessComponent, decorators: [{
|
|
5885
5854
|
type: i0.Component,
|
|
5886
5855
|
args: [{
|
|
@@ -5890,13 +5859,16 @@
|
|
|
5890
5859
|
}]
|
|
5891
5860
|
}], propDecorators: { cycles: [{
|
|
5892
5861
|
type: i0.Input
|
|
5862
|
+
}], selected: [{
|
|
5863
|
+
type: i0.Input
|
|
5893
5864
|
}], dataState: [{
|
|
5894
5865
|
type: i0.Input
|
|
5895
5866
|
}] } });
|
|
5896
5867
|
|
|
5868
|
+
var isSelected$1 = function (selected, v) { return selected.length === 0 || selected.includes(v['@id']); };
|
|
5897
5869
|
var cycleValue = function (cycle, values) { var _a; return (((_a = values[cycle['@id']]) === null || _a === void 0 ? void 0 : _a.nodes[0]) || { value: [0] }).value; };
|
|
5898
|
-
var cycleName = function (cycle, index) { return index + 1 + ". " + cycle
|
|
5899
|
-
var cycleDataset = function (values, termId
|
|
5870
|
+
var cycleName = function (cycle, index) { return index + 1 + ". " + defaultLabel(cycle); };
|
|
5871
|
+
var cycleDataset = function (values, termId, cycle, index) {
|
|
5900
5872
|
var label = cycleName(cycle, index);
|
|
5901
5873
|
var color = itemColor(index);
|
|
5902
5874
|
var data = [propertyValue$1(cycleValue(cycle, values), termId)];
|
|
@@ -5907,10 +5879,11 @@
|
|
|
5907
5879
|
backgroundColor: color,
|
|
5908
5880
|
borderColor: color
|
|
5909
5881
|
};
|
|
5910
|
-
};
|
|
5882
|
+
};
|
|
5911
5883
|
var CyclesEmissionsChartComponent = /** @class */ (function () {
|
|
5912
5884
|
function CyclesEmissionsChartComponent() {
|
|
5913
5885
|
this.cycles = [];
|
|
5886
|
+
this.selected = [];
|
|
5914
5887
|
this.emissionPerCycle = {};
|
|
5915
5888
|
this.terms = [];
|
|
5916
5889
|
}
|
|
@@ -5921,15 +5894,20 @@
|
|
|
5921
5894
|
if ('cycles' in changes && !changes.cycles.firstChange) {
|
|
5922
5895
|
return this.init();
|
|
5923
5896
|
}
|
|
5897
|
+
if ('selected' in changes && !changes.selected.firstChange) {
|
|
5898
|
+
return this.init();
|
|
5899
|
+
}
|
|
5924
5900
|
};
|
|
5925
5901
|
CyclesEmissionsChartComponent.prototype.init = function () {
|
|
5926
|
-
|
|
5902
|
+
var _this = this;
|
|
5903
|
+
var cycles = this.cycles.filter(function (v) { return isSelected$1(_this.selected, v); });
|
|
5904
|
+
this.emissionPerCycle = groupNodesByTerm(cycles, 'emissions');
|
|
5927
5905
|
this.terms = Object.values(this.emissionPerCycle)
|
|
5928
5906
|
.filter(function (_d) {
|
|
5929
5907
|
var values = _d.values;
|
|
5930
5908
|
return Object.values(values).some(function (_d) {
|
|
5931
5909
|
var _e = __read(_d.nodes, 1), value = _e[0].value;
|
|
5932
|
-
return propertyValue$1(value)
|
|
5910
|
+
return propertyValue$1(value) >= 0;
|
|
5933
5911
|
});
|
|
5934
5912
|
})
|
|
5935
5913
|
.map(function (_d) {
|
|
@@ -5940,11 +5918,14 @@
|
|
|
5940
5918
|
return this.selectedTerm ? this.updateChart() : null;
|
|
5941
5919
|
};
|
|
5942
5920
|
CyclesEmissionsChartComponent.prototype.updateChart = function () {
|
|
5921
|
+
var _this = this;
|
|
5943
5922
|
var _a, _b, _c;
|
|
5944
5923
|
var labels = [(_b = (_a = this.selectedTerm) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : ''];
|
|
5945
5924
|
var termId = this.selectedTerm['@id'];
|
|
5946
5925
|
var values = this.emissionPerCycle[termId].values;
|
|
5947
|
-
var datasets = this.cycles
|
|
5926
|
+
var datasets = this.cycles
|
|
5927
|
+
.map(function (cycle, index) { return isSelected$1(_this.selected, cycle) ? cycleDataset(values, termId, cycle, index) : null; })
|
|
5928
|
+
.filter(Boolean);
|
|
5948
5929
|
if (this.chart) {
|
|
5949
5930
|
this.chart.destroy();
|
|
5950
5931
|
}
|
|
@@ -5977,7 +5958,7 @@
|
|
|
5977
5958
|
return CyclesEmissionsChartComponent;
|
|
5978
5959
|
}());
|
|
5979
5960
|
CyclesEmissionsChartComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesEmissionsChartComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
5980
|
-
CyclesEmissionsChartComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesEmissionsChartComponent, selector: "he-cycles-emissions-chart", inputs: { cycles: "cycles" }, viewQueries: [{ propertyName: "chartRef", first: true, predicate: ["chart"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div class=\"p-3\" [class.is-hidden]=\"!terms?.length\">\n <div class=\"field is-horizontal\">\n <div class=\"field-label is-normal\">\n <label class=\"label\" for=\"selectedTerm\">\n <span>Select a column</span>\n </label>\n </div>\n <div class=\"field-body\">\n <div class=\"control\">\n <div class=\"select is-small\">\n <select (change)=\"updateChart()\" [(ngModel)]=\"selectedTerm\" id=\"selectedTerm\">\n <option *ngFor=\"let term of terms\" [ngValue]=\"term\">{{term.name}}</option>\n </select>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"mt-1\">\n <div class=\"chart-container\">\n <canvas #chart></canvas>\n </div>\n </div>\n</div>\n", styles: [":host{display:block;overflow:visible}.chart-container{height:400px;position:relative}\n"], directives: [{ type: i1__namespace$4.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i1__namespace$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1__namespace$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1__namespace$4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1__namespace$4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }] });
|
|
5961
|
+
CyclesEmissionsChartComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesEmissionsChartComponent, selector: "he-cycles-emissions-chart", inputs: { cycles: "cycles", selected: "selected" }, viewQueries: [{ propertyName: "chartRef", first: true, predicate: ["chart"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div class=\"p-3\" [class.is-hidden]=\"!terms?.length\">\n <div class=\"field is-horizontal\">\n <div class=\"field-label is-normal\">\n <label class=\"label\" for=\"selectedTerm\">\n <span>Select a column</span>\n </label>\n </div>\n <div class=\"field-body\">\n <div class=\"control\">\n <div class=\"select is-small\">\n <select (change)=\"updateChart()\" [(ngModel)]=\"selectedTerm\" id=\"selectedTerm\">\n <option *ngFor=\"let term of terms\" [ngValue]=\"term\">{{term.name}}</option>\n </select>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"mt-1\">\n <div class=\"chart-container\">\n <canvas #chart></canvas>\n </div>\n </div>\n</div>\n", styles: [":host{display:block;overflow:visible}.chart-container{height:400px;position:relative}\n"], directives: [{ type: i1__namespace$4.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i1__namespace$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1__namespace$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1__namespace$4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1__namespace$4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }] });
|
|
5981
5962
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesEmissionsChartComponent, decorators: [{
|
|
5982
5963
|
type: i0.Component,
|
|
5983
5964
|
args: [{
|
|
@@ -5990,6 +5971,8 @@
|
|
|
5990
5971
|
args: ['chart']
|
|
5991
5972
|
}], cycles: [{
|
|
5992
5973
|
type: i0.Input
|
|
5974
|
+
}], selected: [{
|
|
5975
|
+
type: i0.Input
|
|
5993
5976
|
}] } });
|
|
5994
5977
|
|
|
5995
5978
|
var CyclesEmissionsLogsComponent = /** @class */ (function () {
|
|
@@ -6071,14 +6054,13 @@
|
|
|
6071
6054
|
function CyclesEmissionsComponent() {
|
|
6072
6055
|
this.originalValues = [];
|
|
6073
6056
|
this.cycles = [];
|
|
6074
|
-
this.
|
|
6057
|
+
this.selected = [];
|
|
6075
6058
|
this.baseUrl = baseUrl();
|
|
6076
6059
|
this.propertyValue = propertyValue$1;
|
|
6077
|
-
this.
|
|
6060
|
+
this.defaultLabel = defaultLabel;
|
|
6078
6061
|
this.showDownload = false;
|
|
6079
6062
|
this.View = View$3;
|
|
6080
6063
|
this.selectedView = View$3.table;
|
|
6081
|
-
this.selectedCycles = [];
|
|
6082
6064
|
this.emissions = [];
|
|
6083
6065
|
}
|
|
6084
6066
|
CyclesEmissionsComponent.prototype.ngOnChanges = function (changes) {
|
|
@@ -6102,52 +6084,17 @@
|
|
|
6102
6084
|
CyclesEmissionsComponent.prototype.update = function () {
|
|
6103
6085
|
var emissionsPerCycle = groupNodesByTerm(this.cycles, 'emissions', this.originalValues);
|
|
6104
6086
|
this.emissions = orderBy$3(grouppedKeys(emissionsPerCycle), ['value.methodTierOrder', 'key'], ['asc', 'asc']);
|
|
6105
|
-
this.selectAllCycles();
|
|
6106
6087
|
};
|
|
6107
6088
|
CyclesEmissionsComponent.prototype.togglePopover = function (popover, context) {
|
|
6108
6089
|
return popover.isOpen() ? popover.close() : popover.open(context);
|
|
6109
6090
|
};
|
|
6110
|
-
// Add from suggestion
|
|
6111
|
-
CyclesEmissionsComponent.prototype.addCycle = function (cycle) {
|
|
6112
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
6113
|
-
return __generator(this, function (_a) {
|
|
6114
|
-
this.cycles = __spreadArray(__spreadArray([], __read(this.cycles)), [
|
|
6115
|
-
cycle
|
|
6116
|
-
]);
|
|
6117
|
-
return [2 /*return*/, this.update()];
|
|
6118
|
-
});
|
|
6119
|
-
});
|
|
6120
|
-
};
|
|
6121
|
-
// Cycle selection
|
|
6122
|
-
CyclesEmissionsComponent.prototype.selectAllCycles = function () {
|
|
6123
|
-
this.selectedCycles = this.cycles.slice();
|
|
6124
|
-
};
|
|
6125
|
-
CyclesEmissionsComponent.prototype.unselectAllCycles = function () {
|
|
6126
|
-
this.selectedCycles = [];
|
|
6127
|
-
};
|
|
6128
|
-
CyclesEmissionsComponent.prototype.toggleAllCycles = function () {
|
|
6129
|
-
return this.selectedCycles.length ? this.selectAllCycles() : this.unselectAllCycles();
|
|
6130
|
-
};
|
|
6131
|
-
CyclesEmissionsComponent.prototype.selectCycle = function (cycle) {
|
|
6132
|
-
this.selectedCycles = __spreadArray(__spreadArray([], __read(this.selectedCycles)), [
|
|
6133
|
-
cycle
|
|
6134
|
-
]);
|
|
6135
|
-
};
|
|
6136
|
-
CyclesEmissionsComponent.prototype.unselectCycle = function (index) {
|
|
6137
|
-
this.selectedCycles.splice(index, 1);
|
|
6138
|
-
this.selectedCycles = this.selectedCycles.slice();
|
|
6139
|
-
};
|
|
6140
|
-
CyclesEmissionsComponent.prototype.toggleCycle = function (cycle) {
|
|
6141
|
-
var index = this.selectedCycles.indexOf(cycle);
|
|
6142
|
-
return index >= 0 ? this.unselectCycle(index) : this.selectCycle(cycle);
|
|
6143
|
-
};
|
|
6144
6091
|
CyclesEmissionsComponent.prototype.isSelected = function (cycle) {
|
|
6145
|
-
return this.
|
|
6092
|
+
return this.selected.length === 0 || this.selected.includes(cycle['@id']);
|
|
6146
6093
|
};
|
|
6147
6094
|
return CyclesEmissionsComponent;
|
|
6148
6095
|
}());
|
|
6149
6096
|
CyclesEmissionsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesEmissionsComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
6150
|
-
CyclesEmissionsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesEmissionsComponent, selector: "he-cycles-emissions", inputs: { originalValues: "originalValues", cycles: "cycles",
|
|
6097
|
+
CyclesEmissionsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesEmissionsComponent, selector: "he-cycles-emissions", inputs: { originalValues: "originalValues", cycles: "cycles", selected: "selected", dataState: "dataState" }, usesOnChanges: true, ngImport: i0__namespace, template: "<ng-container *ngIf=\"emissions.length; else emptyTable\">\n <div class=\"columns is-variable is-2 m-0\">\n <div class=\"column is-hidden-mobile\"></div>\n <div class=\"column is-narrow\">\n <div class=\"field has-addons\">\n <div class=\"control\">\n <button class=\"button is-small\" [class.is-active]=\"selectedView === View.table\" (click)=\"selectedView = View.table\">\n <span class=\"icon is-small\">\n <fa-icon icon=\"list\" aria-hidden=\"true\"></fa-icon>\n </span>\n <span>Table view</span>\n </button>\n </div>\n <div class=\"control\" *ngIf=\"cycles.length > 1\">\n <button class=\"button is-small\" [class.is-active]=\"selectedView === View.chart\" (click)=\"selectedView = View.chart\">\n <span class=\"icon is-small\">\n <fa-icon icon=\"chart-bar\" aria-hidden=\"true\"></fa-icon>\n </span>\n <span>Chart view</span>\n </button>\n </div>\n <div class=\"control\" *ngIf=\"!isOriginal && cycles.length === 1\">\n <button class=\"button is-small\" [class.is-active]=\"selectedView === View.logs\" (click)=\"selectedView = View.logs\">\n <span class=\"icon is-small\">\n <fa-icon icon=\"calculator\" aria-hidden=\"true\"></fa-icon>\n </span>\n <span>Recalculations logs</span>\n </button>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"px-3 pb-3\" [class.is-hidden]=\"selectedView !== View.table\">\n <div class=\"has-text-right mb-2\">\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\n <div class=\"table-container data-table-container mb-1\">\n <table class=\"table is-narrow data-table has-children-{{emissions.length}}\">\n <thead>\n <tr>\n <th class=\"width-auto\"></th>\n <th></th>\n <th *ngFor=\"let emission of emissions\"\n [attr.title]=\"emission.value.term.name\"\n >\n <he-node-link [node]=\"emission.value.term\">\n <span>{{emission.value.term.name | ellipsis:30}}</span>\n </he-node-link>\n </th>\n </tr>\n <tr>\n <th class=\"width-auto\"></th>\n <th>\n <a [href]=\"baseUrl + '/schema/Cycle#functionalUnit'\" target=\"_blank\">Functional unit</a>\n </th>\n <th *ngFor=\"let emission of emissions\"\n [attr.title]=\"emission.value.term.units\"\n >{{emission.value.term.units}}</th>\n </tr>\n </thead>\n <tbody>\n <ng-container *ngFor=\"let cycle of cycles; trackBy: trackById; let i = index\">\n <tr *ngIf=\"isSelected(cycle)\">\n <td class=\"width-auto\" [attr.title]=\"defaultLabel(cycle)\">\n <he-node-link [node]=\"cycle\">\n <span class=\"is-nowrap has-text-ellipsis\">{{i + 1}}. {{defaultLabel(cycle)}}</span>\n </he-node-link>\n </td>\n <td>\n <he-cycles-functional-unit-measure [cycle]=\"cycles[0]\"></he-cycles-functional-unit-measure>\n </td>\n <td class=\"is-nowrap\" *ngFor=\"let emission of emissions\">\n <span *ngIf=\"emission.value.values[cycle['@id']]; else emptyValue\"\n class=\"trigger-popover\"\n [ngbPopover]=\"details\" [autoClose]=\"'outside'\"\n triggers=\"manual\" #p=\"ngbPopover\" placement=\"left\" container=\"body\"\n (click)=\"togglePopover(p, { data: emission.value.values[cycle['@id']], cycle: cycle, key: 'emissions' })\"\n >\n <span pointer>{{propertyValue(emission.value.values[cycle['@id']].value, emission.value.term['@id']) | precision:3 | default:'-'}}</span>\n <he-blank-node-state class=\"ml-1\"\n [node]=\"emission.value.values[cycle['@id']].nodes[0]\"\n key=\"value\"\n ></he-blank-node-state>\n </span>\n </td>\n </tr>\n </ng-container>\n </tbody>\n </table>\n </div>\n\n <he-blank-node-state-notice [dataState]=\"dataState\" [showDeleted]=\"true\"></he-blank-node-state-notice>\n </div>\n\n <he-cycles-emissions-chart *ngIf=\"cycles.length > 1\" [class.is-hidden]=\"selectedView !== View.chart\"\n [cycles]=\"cycles\" [selected]=\"selected\"\n ></he-cycles-emissions-chart>\n\n <he-cycles-emissions-logs *ngIf=\"selectedView === View.logs && !isOriginal\"\n [cycle]=\"cycles[0]\"\n [originalValues]=\"originalValues[0]?.emissions\"\n [recalculatedValues]=\"cycles[0]?.emissions\"\n ></he-cycles-emissions-logs>\n</ng-container>\n\n<he-node-csv-export-confirm *ngIf=\"showDownload\"\n [nodes]=\"cycles\" filename=\"cycle-emissions.csv\" [isUpload]=\"false\"\n [headerKeys]=\"['cycle.id', 'cycle.@id', 'cycle.emissions.']\"\n (closed)=\"showDownload = false\"\n></he-node-csv-export-confirm>\n\n<ng-template #emptyTable>\n <div class=\"panel-block\">\n <span>No data</span>\n </div>\n</ng-template>\n\n<ng-template #emptyValue>\n <span>-</span>\n</ng-template>\n\n<ng-template #details let-node=\"cycle\" let-data=\"data\" let-key=\"key\">\n <p><b>{{node.name}}</b></p>\n <he-node-value-details\n [data]=\"data\" [nodeType]=\"node['@type']\" [dataKey]=\"key\"\n ></he-node-value-details>\n</ng-template>\n", styles: ["fa-icon{display:inline-block;width:10px}\n"], components: [{ type: i1__namespace.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }, { type: NodeLinkComponent, selector: "he-node-link", inputs: ["node", "showExternalLink"] }, { type: CyclesFunctionalUnitMeasureComponent, selector: "he-cycles-functional-unit-measure", inputs: ["cycle"] }, { type: BlankNodeStateComponent, selector: "he-blank-node-state", inputs: ["nodeType", "dataKey", "key", "node", "state"] }, { type: BlankNodeStateNoticeComponent, selector: "he-blank-node-state-notice", inputs: ["dataState", "showAggregated", "showDeleted", "showUnchanged"] }, { type: CyclesEmissionsChartComponent, selector: "he-cycles-emissions-chart", inputs: ["cycles", "selected"] }, { type: CyclesEmissionsLogsComponent, selector: "he-cycles-emissions-logs", inputs: ["cycle", "originalValues", "recalculatedValues"] }, { type: NodeCsvExportConfirmComponent, selector: "he-node-csv-export-confirm", inputs: ["nodes", "filename", "headerKeys", "extension", "isUpload"], outputs: ["closed"] }, { type: NodeValueDetailsComponent, selector: "he-node-value-details", inputs: ["data", "nodeType", "dataKey"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10__namespace.NgbPopover, selector: "[ngbPopover]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disablePopover", "popoverClass", "openDelay", "closeDelay", "ngbPopover", "popoverTitle"], outputs: ["shown", "hidden"], exportAs: ["ngbPopover"] }], pipes: { "ellipsis": EllipsisPipe, "default": DefaultPipe, "precision": PrecisionPipe } });
|
|
6151
6098
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesEmissionsComponent, decorators: [{
|
|
6152
6099
|
type: i0.Component,
|
|
6153
6100
|
args: [{
|
|
@@ -6159,9 +6106,9 @@
|
|
|
6159
6106
|
type: i0.Input
|
|
6160
6107
|
}], cycles: [{
|
|
6161
6108
|
type: i0.Input
|
|
6162
|
-
}],
|
|
6109
|
+
}], selected: [{
|
|
6163
6110
|
type: i0.Input
|
|
6164
|
-
}],
|
|
6111
|
+
}], dataState: [{
|
|
6165
6112
|
type: i0.Input
|
|
6166
6113
|
}] } });
|
|
6167
6114
|
|
|
@@ -6227,14 +6174,13 @@
|
|
|
6227
6174
|
function CyclesPracticesComponent() {
|
|
6228
6175
|
this.originalValues = [];
|
|
6229
6176
|
this.cycles = [];
|
|
6230
|
-
this.
|
|
6177
|
+
this.selected = [];
|
|
6231
6178
|
this.baseUrl = baseUrl();
|
|
6232
6179
|
this.propertyValue = propertyValue$1;
|
|
6233
|
-
this.
|
|
6180
|
+
this.defaultLabel = defaultLabel;
|
|
6234
6181
|
this.showDownload = false;
|
|
6235
6182
|
this.View = View$2;
|
|
6236
6183
|
this.selectedView = View$2.table;
|
|
6237
|
-
this.selectedCycles = [];
|
|
6238
6184
|
this.practices = [];
|
|
6239
6185
|
}
|
|
6240
6186
|
CyclesPracticesComponent.prototype.ngOnChanges = function (changes) {
|
|
@@ -6258,52 +6204,17 @@
|
|
|
6258
6204
|
CyclesPracticesComponent.prototype.update = function () {
|
|
6259
6205
|
var practicesPerCycle = groupNodesByTerm(this.cycles, 'practices', this.originalValues);
|
|
6260
6206
|
this.practices = orderBy$2(grouppedKeys(practicesPerCycle), ['key'], ['asc']);
|
|
6261
|
-
this.selectAllCycles();
|
|
6262
6207
|
};
|
|
6263
6208
|
CyclesPracticesComponent.prototype.togglePopover = function (popover, context) {
|
|
6264
6209
|
return popover.isOpen() ? popover.close() : popover.open(context);
|
|
6265
6210
|
};
|
|
6266
|
-
// Add from suggestion
|
|
6267
|
-
CyclesPracticesComponent.prototype.addCycle = function (cycle) {
|
|
6268
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
6269
|
-
return __generator(this, function (_a) {
|
|
6270
|
-
this.cycles = __spreadArray(__spreadArray([], __read(this.cycles)), [
|
|
6271
|
-
cycle
|
|
6272
|
-
]);
|
|
6273
|
-
return [2 /*return*/, this.update()];
|
|
6274
|
-
});
|
|
6275
|
-
});
|
|
6276
|
-
};
|
|
6277
|
-
// Cycle selection
|
|
6278
|
-
CyclesPracticesComponent.prototype.selectAllCycles = function () {
|
|
6279
|
-
this.selectedCycles = this.cycles.slice();
|
|
6280
|
-
};
|
|
6281
|
-
CyclesPracticesComponent.prototype.unselectAllCycles = function () {
|
|
6282
|
-
this.selectedCycles = [];
|
|
6283
|
-
};
|
|
6284
|
-
CyclesPracticesComponent.prototype.toggleAllCycles = function () {
|
|
6285
|
-
return this.selectedCycles.length ? this.selectAllCycles() : this.unselectAllCycles();
|
|
6286
|
-
};
|
|
6287
|
-
CyclesPracticesComponent.prototype.selectCycle = function (cycle) {
|
|
6288
|
-
this.selectedCycles = __spreadArray(__spreadArray([], __read(this.selectedCycles)), [
|
|
6289
|
-
cycle
|
|
6290
|
-
]);
|
|
6291
|
-
};
|
|
6292
|
-
CyclesPracticesComponent.prototype.unselectCycle = function (index) {
|
|
6293
|
-
this.selectedCycles.splice(index, 1);
|
|
6294
|
-
this.selectedCycles = this.selectedCycles.slice();
|
|
6295
|
-
};
|
|
6296
|
-
CyclesPracticesComponent.prototype.toggleCycle = function (cycle) {
|
|
6297
|
-
var index = this.selectedCycles.indexOf(cycle);
|
|
6298
|
-
return index >= 0 ? this.unselectCycle(index) : this.selectCycle(cycle);
|
|
6299
|
-
};
|
|
6300
6211
|
CyclesPracticesComponent.prototype.isSelected = function (cycle) {
|
|
6301
|
-
return this.
|
|
6212
|
+
return this.selected.length === 0 || this.selected.includes(cycle['@id']);
|
|
6302
6213
|
};
|
|
6303
6214
|
return CyclesPracticesComponent;
|
|
6304
6215
|
}());
|
|
6305
6216
|
CyclesPracticesComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesPracticesComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
6306
|
-
CyclesPracticesComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesPracticesComponent, selector: "he-cycles-practices", inputs: { originalValues: "originalValues", cycles: "cycles",
|
|
6217
|
+
CyclesPracticesComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesPracticesComponent, selector: "he-cycles-practices", inputs: { originalValues: "originalValues", cycles: "cycles", selected: "selected", dataState: "dataState" }, usesOnChanges: true, ngImport: i0__namespace, template: "<ng-container *ngIf=\"practices.length; else emptyTable\">\n <div class=\"columns is-variable is-2 m-0\">\n <div class=\"column is-hidden-mobile\"></div>\n <div class=\"column is-narrow\">\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=\"!isOriginal && cycles.length === 1\">\n <button class=\"button is-small\" [class.is-active]=\"selectedView === View.logs\" (click)=\"selectedView = View.logs\">\n <span class=\"icon is-small\">\n <fa-icon icon=\"calculator\" aria-hidden=\"true\"></fa-icon>\n </span>\n <span>Recalculations logs</span>\n </button>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"px-3 pb-3\" [class.is-hidden]=\"selectedView !== View.table\">\n <div class=\"has-text-right mb-2\">\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\n <div class=\"table-container data-table-container mb-1\">\n <table class=\"table is-narrow data-table has-children-{{practices.length}}\">\n <thead>\n <tr>\n <th class=\"width-auto\"></th>\n <th></th>\n <th *ngFor=\"let practice of practices\"\n [attr.title]=\"practice.value.term.name\"\n >\n <he-node-link [node]=\"practice.value.term\">\n <span>{{practice.value.term.name | ellipsis:30}}</span>\n </he-node-link>\n </th>\n </tr>\n <tr>\n <th class=\"width-auto\"></th>\n <th>\n <a [href]=\"baseUrl + '/schema/Cycle#functionalUnit'\" target=\"_blank\">Functional unit</a>\n </th>\n <th *ngFor=\"let practice of practices\"\n [attr.title]=\"practice.value.term.units\"\n >{{practice.value.term.units}}</th>\n </tr>\n </thead>\n <tbody>\n <ng-container *ngFor=\"let cycle of cycles; trackBy: trackById; let i = index\">\n <tr *ngIf=\"isSelected(cycle)\">\n <td class=\"width-auto\" [attr.title]=\"defaultLabel(cycle)\">\n <he-node-link [node]=\"cycle\">\n <span class=\"is-nowrap has-text-ellipsis\">{{i + 1}}. {{defaultLabel(cycle)}}</span>\n </he-node-link>\n </td>\n <td>\n <he-cycles-functional-unit-measure [cycle]=\"cycles[0]\"></he-cycles-functional-unit-measure>\n </td>\n <td class=\"is-nowrap\" *ngFor=\"let practice of practices\">\n <span *ngIf=\"practice.value.values[cycle['@id']]; else emptyValue\"\n class=\"trigger-popover\"\n [ngbPopover]=\"details\" [autoClose]=\"'outside'\"\n triggers=\"manual\" #p=\"ngbPopover\" placement=\"left\" container=\"body\"\n (click)=\"togglePopover(p, { data: practice.value.values[cycle['@id']], cycle: cycle, key: 'practices' })\"\n >\n <span pointer>{{propertyValue(practice.value.values[cycle['@id']].value, practice.value.term['@id']) | precision:3 | default:'-'}}</span>\n <he-blank-node-state class=\"ml-1\"\n [node]=\"practice.value.values[cycle['@id']].nodes[0]\"\n key=\"value\"\n ></he-blank-node-state>\n </span>\n </td>\n </tr>\n </ng-container>\n </tbody>\n </table>\n </div>\n\n <he-blank-node-state-notice [dataState]=\"dataState\" [showDeleted]=\"true\"></he-blank-node-state-notice>\n </div>\n\n <he-cycles-practices-logs *ngIf=\"selectedView === View.logs && !isOriginal\"\n [cycle]=\"cycles[0]\"\n [originalValues]=\"originalValues[0]?.practices\"\n [recalculatedValues]=\"cycles[0]?.practices\"\n ></he-cycles-practices-logs>\n</ng-container>\n\n<he-node-csv-export-confirm *ngIf=\"showDownload\"\n [nodes]=\"cycles\" filename=\"cycle-practices.csv\" [isUpload]=\"false\"\n [headerKeys]=\"['cycle.id', 'cycle.@id', 'cycle.practices.']\"\n (closed)=\"showDownload = false\"\n></he-node-csv-export-confirm>\n\n<ng-template #emptyTable>\n <div class=\"panel-block\">\n <span>No data</span>\n </div>\n</ng-template>\n\n<ng-template #emptyValue>\n <span>-</span>\n</ng-template>\n\n<ng-template #details let-node=\"cycle\" let-data=\"data\" let-key=\"key\">\n <p><b>{{node.name}}</b></p>\n <he-node-value-details\n [data]=\"data\" [nodeType]=\"node['@type']\" [dataKey]=\"key\"\n ></he-node-value-details>\n</ng-template>\n", styles: ["fa-icon{display:inline-block;width:10px}\n"], components: [{ type: i1__namespace.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }, { type: NodeLinkComponent, selector: "he-node-link", inputs: ["node", "showExternalLink"] }, { type: CyclesFunctionalUnitMeasureComponent, selector: "he-cycles-functional-unit-measure", inputs: ["cycle"] }, { type: BlankNodeStateComponent, selector: "he-blank-node-state", inputs: ["nodeType", "dataKey", "key", "node", "state"] }, { type: BlankNodeStateNoticeComponent, selector: "he-blank-node-state-notice", inputs: ["dataState", "showAggregated", "showDeleted", "showUnchanged"] }, { type: CyclesPracticesLogsComponent, selector: "he-cycles-practices-logs", inputs: ["cycle", "originalValues", "recalculatedValues"] }, { type: NodeCsvExportConfirmComponent, selector: "he-node-csv-export-confirm", inputs: ["nodes", "filename", "headerKeys", "extension", "isUpload"], outputs: ["closed"] }, { type: NodeValueDetailsComponent, selector: "he-node-value-details", inputs: ["data", "nodeType", "dataKey"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10__namespace.NgbPopover, selector: "[ngbPopover]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disablePopover", "popoverClass", "openDelay", "closeDelay", "ngbPopover", "popoverTitle"], outputs: ["shown", "hidden"], exportAs: ["ngbPopover"] }], pipes: { "ellipsis": EllipsisPipe, "default": DefaultPipe, "precision": PrecisionPipe } });
|
|
6307
6218
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesPracticesComponent, decorators: [{
|
|
6308
6219
|
type: i0.Component,
|
|
6309
6220
|
args: [{
|
|
@@ -6315,15 +6226,16 @@
|
|
|
6315
6226
|
type: i0.Input
|
|
6316
6227
|
}], cycles: [{
|
|
6317
6228
|
type: i0.Input
|
|
6318
|
-
}],
|
|
6229
|
+
}], selected: [{
|
|
6319
6230
|
type: i0.Input
|
|
6320
|
-
}],
|
|
6231
|
+
}], dataState: [{
|
|
6321
6232
|
type: i0.Input
|
|
6322
6233
|
}] } });
|
|
6323
6234
|
|
|
6324
6235
|
var CyclesResultComponent = /** @class */ (function () {
|
|
6325
6236
|
function CyclesResultComponent() {
|
|
6326
6237
|
this.cycles = [];
|
|
6238
|
+
this.selected = [];
|
|
6327
6239
|
}
|
|
6328
6240
|
CyclesResultComponent.prototype.ngAfterViewInit = function () {
|
|
6329
6241
|
chart_js.Chart.scaleService.updateScaleDefaults('category', {
|
|
@@ -6337,14 +6249,27 @@
|
|
|
6337
6249
|
if ('cycles' in changes && !changes.cycles.firstChange) {
|
|
6338
6250
|
return this.init();
|
|
6339
6251
|
}
|
|
6252
|
+
if ('selected' in changes && !changes.selected.firstChange) {
|
|
6253
|
+
return this.init();
|
|
6254
|
+
}
|
|
6255
|
+
};
|
|
6256
|
+
CyclesResultComponent.prototype.isSelected = function (cycle) {
|
|
6257
|
+
return this.selected.length === 0 || this.selected.includes(cycle['@id']);
|
|
6340
6258
|
};
|
|
6341
6259
|
CyclesResultComponent.prototype.init = function () {
|
|
6342
6260
|
var _this = this;
|
|
6343
|
-
var labels = this.cycles
|
|
6344
|
-
|
|
6345
|
-
|
|
6261
|
+
var labels = this.cycles
|
|
6262
|
+
.map(function (cycle, index) { return ({ cycle: cycle, index: index }); })
|
|
6263
|
+
.filter(function (_b) {
|
|
6264
|
+
var cycle = _b.cycle;
|
|
6265
|
+
return _this.isSelected(cycle);
|
|
6266
|
+
})
|
|
6267
|
+
.map(function (_b) {
|
|
6268
|
+
var cycle = _b.cycle, index = _b.index;
|
|
6269
|
+
return index + 1 + ". " + defaultLabel(cycle);
|
|
6346
6270
|
});
|
|
6347
|
-
var
|
|
6271
|
+
var cycles = this.cycles.filter(function (v) { return _this.isSelected(v); });
|
|
6272
|
+
var productsPerCycle = groupNodesByTerm(cycles, 'products');
|
|
6348
6273
|
var datasets = Object.values(productsPerCycle).map(function (_b, index) {
|
|
6349
6274
|
var _c = _b.term, name = _c.name, units = _c.units, termId = _c["@id"], values = _b.values;
|
|
6350
6275
|
var color = itemColor(index);
|
|
@@ -6353,7 +6278,7 @@
|
|
|
6353
6278
|
backgroundColor: color,
|
|
6354
6279
|
borderColor: color,
|
|
6355
6280
|
barPercentage: 0.5,
|
|
6356
|
-
data:
|
|
6281
|
+
data: cycles.map(function (_b) {
|
|
6357
6282
|
var id = _b["@id"];
|
|
6358
6283
|
return values[id] ? propertyValue$1(values[id].value, termId) : 0;
|
|
6359
6284
|
})
|
|
@@ -6405,7 +6330,7 @@
|
|
|
6405
6330
|
return CyclesResultComponent;
|
|
6406
6331
|
}());
|
|
6407
6332
|
CyclesResultComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesResultComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
6408
|
-
CyclesResultComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesResultComponent, selector: "he-cycles-result", inputs: { cycles: "cycles" }, viewQueries: [{ propertyName: "chartRef", first: true, predicate: ["chart"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div class=\"chart-container\">\n <canvas #chart>{{chart}}</canvas>\n</div>\n", styles: [":host{display:block}.chart-container{height:100%;min-height:300px;position:relative}\n"] });
|
|
6333
|
+
CyclesResultComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesResultComponent, selector: "he-cycles-result", inputs: { cycles: "cycles", selected: "selected" }, viewQueries: [{ propertyName: "chartRef", first: true, predicate: ["chart"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div class=\"chart-container\">\n <canvas #chart>{{chart}}</canvas>\n</div>\n", styles: [":host{display:block}.chart-container{height:100%;min-height:300px;position:relative}\n"] });
|
|
6409
6334
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesResultComponent, decorators: [{
|
|
6410
6335
|
type: i0.Component,
|
|
6411
6336
|
args: [{
|
|
@@ -6418,6 +6343,8 @@
|
|
|
6418
6343
|
args: ['chart']
|
|
6419
6344
|
}], cycles: [{
|
|
6420
6345
|
type: i0.Input
|
|
6346
|
+
}], selected: [{
|
|
6347
|
+
type: i0.Input
|
|
6421
6348
|
}] } });
|
|
6422
6349
|
|
|
6423
6350
|
var components$3 = [
|
|
@@ -6430,8 +6357,7 @@
|
|
|
6430
6357
|
CyclesFunctionalUnitMeasureComponent,
|
|
6431
6358
|
CyclesPracticesComponent,
|
|
6432
6359
|
CyclesPracticesLogsComponent,
|
|
6433
|
-
CyclesResultComponent
|
|
6434
|
-
CyclesSuggestFormComponent
|
|
6360
|
+
CyclesResultComponent
|
|
6435
6361
|
];
|
|
6436
6362
|
var HeCyclesModule = /** @class */ (function () {
|
|
6437
6363
|
function HeCyclesModule() {
|
|
@@ -6448,8 +6374,7 @@
|
|
|
6448
6374
|
CyclesFunctionalUnitMeasureComponent,
|
|
6449
6375
|
CyclesPracticesComponent,
|
|
6450
6376
|
CyclesPracticesLogsComponent,
|
|
6451
|
-
CyclesResultComponent,
|
|
6452
|
-
CyclesSuggestFormComponent], imports: [i6.CommonModule, i1$2.FormsModule, i1$2.ReactiveFormsModule,
|
|
6377
|
+
CyclesResultComponent], imports: [i6.CommonModule, i1$2.FormsModule, i1$2.ReactiveFormsModule,
|
|
6453
6378
|
HeCommonModule,
|
|
6454
6379
|
HeNodeModule], exports: [CyclesActivityComponent,
|
|
6455
6380
|
CyclesActivityLogsComponent,
|
|
@@ -6460,8 +6385,7 @@
|
|
|
6460
6385
|
CyclesFunctionalUnitMeasureComponent,
|
|
6461
6386
|
CyclesPracticesComponent,
|
|
6462
6387
|
CyclesPracticesLogsComponent,
|
|
6463
|
-
CyclesResultComponent
|
|
6464
|
-
CyclesSuggestFormComponent] });
|
|
6388
|
+
CyclesResultComponent] });
|
|
6465
6389
|
HeCyclesModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeCyclesModule, imports: [[
|
|
6466
6390
|
i6.CommonModule, i1$2.FormsModule, i1$2.ReactiveFormsModule,
|
|
6467
6391
|
HeCommonModule,
|
|
@@ -6608,7 +6532,7 @@
|
|
|
6608
6532
|
},
|
|
6609
6533
|
_f['must contain as many items as values'] = function (_f) {
|
|
6610
6534
|
var params = _f.params, dataPath = _f.dataPath;
|
|
6611
|
-
return "The number of " + dataPath.split('.').pop + " must match the number of
|
|
6535
|
+
return "The number of " + code(dataPath.split('.').pop()) + " must match the number of " + code('value') + ".\n Currently there are " + (params === null || params === void 0 ? void 0 : params.current) + " " + code(dataPath.split('.').pop()) + " but " + (params === null || params === void 0 ? void 0 : params.expected) + " " + code('value') + ".";
|
|
6612
6536
|
},
|
|
6613
6537
|
_f['is too generic'] = function (_f) {
|
|
6614
6538
|
var params = _f.params;
|
|
@@ -7359,19 +7283,19 @@
|
|
|
7359
7283
|
}); }));
|
|
7360
7284
|
};
|
|
7361
7285
|
|
|
7362
|
-
var isSite = function (
|
|
7363
|
-
var type =
|
|
7286
|
+
var isSite = function (_b) {
|
|
7287
|
+
var type = _b["@type"], id = _b["@id"];
|
|
7364
7288
|
return type === schema.NodeType.Site && !!id;
|
|
7365
7289
|
};
|
|
7366
|
-
var siteLocation = function (
|
|
7367
|
-
var latitude =
|
|
7290
|
+
var siteLocation = function (_b) {
|
|
7291
|
+
var latitude = _b.latitude, longitude = _b.longitude;
|
|
7368
7292
|
return latitude && longitude ? ({
|
|
7369
7293
|
lat: latitude,
|
|
7370
7294
|
lng: longitude
|
|
7371
7295
|
}) : undefined;
|
|
7372
7296
|
};
|
|
7373
|
-
var siteDefaultLocation = function (
|
|
7374
|
-
var region =
|
|
7297
|
+
var siteDefaultLocation = function (_b) {
|
|
7298
|
+
var region = _b.region, country = _b.country;
|
|
7375
7299
|
var markers = [
|
|
7376
7300
|
region ? createMarker(termLocation(region), termLocationName(region).name, undefined, 20) : undefined,
|
|
7377
7301
|
country ? createMarker(termLocation(country), termLocationName(country).name, undefined, 40) : undefined
|
|
@@ -7379,12 +7303,12 @@
|
|
|
7379
7303
|
return (markers.length ? markers[0] : undefined);
|
|
7380
7304
|
};
|
|
7381
7305
|
var siteMarker = function (site) { return createMarker(site ? siteLocation(site) : undefined, site.name); };
|
|
7382
|
-
var sitePolygon = function (
|
|
7383
|
-
var boundary =
|
|
7306
|
+
var sitePolygon = function (_b) {
|
|
7307
|
+
var boundary = _b.boundary;
|
|
7384
7308
|
return (boundary ? polygonsFromFeature(boundary) : undefined);
|
|
7385
7309
|
};
|
|
7386
|
-
var regions = function (sites) { return utils.unique(sites.map(function (
|
|
7387
|
-
var country =
|
|
7310
|
+
var regions = function (sites) { return utils.unique(sites.map(function (_b) {
|
|
7311
|
+
var country = _b.country, region = _b.region;
|
|
7388
7312
|
return region ? region['@id'] : (country ? country['@id'] : null);
|
|
7389
7313
|
}).filter(Boolean)); };
|
|
7390
7314
|
var defaultCenter = { lat: 0, lng: 0 };
|
|
@@ -7394,6 +7318,7 @@
|
|
|
7394
7318
|
this.loaded = false;
|
|
7395
7319
|
this.loadPolygons = true;
|
|
7396
7320
|
this.sites = [];
|
|
7321
|
+
this.selected = [];
|
|
7397
7322
|
this.nodes = [];
|
|
7398
7323
|
this.center = defaultCenter;
|
|
7399
7324
|
this.zoom = 2;
|
|
@@ -7411,25 +7336,28 @@
|
|
|
7411
7336
|
SitesMapsComponent.prototype.ngAfterViewInit = function () {
|
|
7412
7337
|
return this.googleLoaded && this.loadData();
|
|
7413
7338
|
};
|
|
7339
|
+
SitesMapsComponent.prototype.isSelected = function (site) {
|
|
7340
|
+
return this.selected.length === 0 || this.selected.includes(site['@id']);
|
|
7341
|
+
};
|
|
7414
7342
|
SitesMapsComponent.prototype.loadData = function () {
|
|
7415
7343
|
return __awaiter(this, void 0, void 0, function () {
|
|
7416
7344
|
var sites, markers, polygons, termPolygons;
|
|
7417
7345
|
var _this = this;
|
|
7418
|
-
return __generator(this, function (
|
|
7419
|
-
switch (
|
|
7346
|
+
return __generator(this, function (_b) {
|
|
7347
|
+
switch (_b.label) {
|
|
7420
7348
|
case 0:
|
|
7421
7349
|
// loaded data as geojson
|
|
7422
7350
|
this.map.googleMap.data.setStyle(function () { return (Object.assign(Object.assign({}, strokeStyle), { strokeOpacity: 0.1 })); });
|
|
7423
7351
|
return [4 /*yield*/, this.getSites()];
|
|
7424
7352
|
case 1:
|
|
7425
|
-
sites =
|
|
7353
|
+
sites = _b.sent();
|
|
7426
7354
|
markers = this.addSiteMarkers(sites);
|
|
7427
7355
|
polygons = sites.flatMap(sitePolygon).filter(Boolean);
|
|
7428
7356
|
polygons.map(function (polygon) { return polygon === null || polygon === void 0 ? void 0 : polygon.setMap(_this.map.googleMap); });
|
|
7429
7357
|
this.loaded = true;
|
|
7430
7358
|
return [4 /*yield*/, Promise.all(regions(sites).map(function (v) { return _this.addTermsPolygons(v); }))];
|
|
7431
7359
|
case 2:
|
|
7432
|
-
termPolygons = (
|
|
7360
|
+
termPolygons = (_b.sent()).flat();
|
|
7433
7361
|
this.showNoLocation = markers.length === 0 && polygons.length === 0 && termPolygons.length === 0;
|
|
7434
7362
|
return [2 /*return*/, markers.length ?
|
|
7435
7363
|
this.centerMarker(markers[0]) :
|
|
@@ -7447,19 +7375,19 @@
|
|
|
7447
7375
|
};
|
|
7448
7376
|
SitesMapsComponent.prototype.addTermsPolygons = function (id) {
|
|
7449
7377
|
return __awaiter(this, void 0, void 0, function () {
|
|
7450
|
-
var
|
|
7451
|
-
return __generator(this, function (
|
|
7452
|
-
switch (
|
|
7378
|
+
var _b;
|
|
7379
|
+
return __generator(this, function (_c) {
|
|
7380
|
+
switch (_c.label) {
|
|
7453
7381
|
case 0:
|
|
7454
7382
|
if (!this.loadPolygons) return [3 /*break*/, 2];
|
|
7455
7383
|
return [4 /*yield*/, this.termPolygons(id)];
|
|
7456
7384
|
case 1:
|
|
7457
|
-
|
|
7385
|
+
_b = _c.sent();
|
|
7458
7386
|
return [3 /*break*/, 3];
|
|
7459
7387
|
case 2:
|
|
7460
|
-
|
|
7461
|
-
|
|
7462
|
-
case 3: return [2 /*return*/,
|
|
7388
|
+
_b = [];
|
|
7389
|
+
_c.label = 3;
|
|
7390
|
+
case 3: return [2 /*return*/, _b];
|
|
7463
7391
|
}
|
|
7464
7392
|
});
|
|
7465
7393
|
});
|
|
@@ -7487,82 +7415,83 @@
|
|
|
7487
7415
|
};
|
|
7488
7416
|
SitesMapsComponent.prototype.loadSite = function (node) {
|
|
7489
7417
|
return __awaiter(this, void 0, void 0, function () {
|
|
7490
|
-
var
|
|
7491
|
-
return __generator(this, function (
|
|
7492
|
-
switch (
|
|
7418
|
+
var _b;
|
|
7419
|
+
return __generator(this, function (_c) {
|
|
7420
|
+
switch (_c.label) {
|
|
7493
7421
|
case 0:
|
|
7494
7422
|
if (!('schemaVersion' in node)) return [3 /*break*/, 1];
|
|
7495
|
-
|
|
7423
|
+
_b = node;
|
|
7496
7424
|
return [3 /*break*/, 3];
|
|
7497
7425
|
case 1: return [4 /*yield*/, this.nodeService.get(node)];
|
|
7498
7426
|
case 2:
|
|
7499
|
-
|
|
7500
|
-
|
|
7427
|
+
_b = _c.sent();
|
|
7428
|
+
_c.label = 3;
|
|
7501
7429
|
case 3:
|
|
7502
7430
|
// means the site was already downloaded
|
|
7503
|
-
return [2 /*return*/,
|
|
7431
|
+
return [2 /*return*/, _b];
|
|
7504
7432
|
}
|
|
7505
7433
|
});
|
|
7506
7434
|
});
|
|
7507
7435
|
};
|
|
7508
7436
|
SitesMapsComponent.prototype.siteData = function (node) {
|
|
7509
7437
|
return __awaiter(this, void 0, void 0, function () {
|
|
7510
|
-
var
|
|
7511
|
-
return __generator(this, function (
|
|
7512
|
-
switch (
|
|
7438
|
+
var _b, _c, _d, _e;
|
|
7439
|
+
return __generator(this, function (_f) {
|
|
7440
|
+
switch (_f.label) {
|
|
7513
7441
|
case 0:
|
|
7514
7442
|
if (![
|
|
7515
7443
|
schema.NodeType.Site,
|
|
7516
7444
|
schema.NodeType.Organisation
|
|
7517
7445
|
].includes(node.type)) return [3 /*break*/, 1];
|
|
7518
|
-
|
|
7446
|
+
_b = node;
|
|
7519
7447
|
return [3 /*break*/, 7];
|
|
7520
7448
|
case 1:
|
|
7521
7449
|
if (!isSite(node)) return [3 /*break*/, 2];
|
|
7522
|
-
|
|
7450
|
+
_c = this.loadSite(node);
|
|
7523
7451
|
return [3 /*break*/, 6];
|
|
7524
7452
|
case 2:
|
|
7525
7453
|
if (!('site' in node && isSite(node.site))) return [3 /*break*/, 3];
|
|
7526
|
-
|
|
7454
|
+
_d = this.loadSite(node.site);
|
|
7527
7455
|
return [3 /*break*/, 5];
|
|
7528
7456
|
case 3:
|
|
7529
|
-
|
|
7457
|
+
_e = this.siteData;
|
|
7530
7458
|
return [4 /*yield*/, this.loadSite(node)];
|
|
7531
7459
|
case 4:
|
|
7532
|
-
|
|
7533
|
-
|
|
7460
|
+
_d = _e.apply(this, [_f.sent()]);
|
|
7461
|
+
_f.label = 5;
|
|
7534
7462
|
case 5:
|
|
7535
|
-
|
|
7536
|
-
|
|
7463
|
+
_c = (_d);
|
|
7464
|
+
_f.label = 6;
|
|
7537
7465
|
case 6:
|
|
7538
|
-
|
|
7539
|
-
|
|
7540
|
-
case 7: return [2 /*return*/,
|
|
7466
|
+
_b = (_c);
|
|
7467
|
+
_f.label = 7;
|
|
7468
|
+
case 7: return [2 /*return*/, _b];
|
|
7541
7469
|
}
|
|
7542
7470
|
});
|
|
7543
7471
|
});
|
|
7544
7472
|
};
|
|
7545
7473
|
SitesMapsComponent.prototype.getSites = function () {
|
|
7546
7474
|
var _this = this;
|
|
7547
|
-
var
|
|
7475
|
+
var _a;
|
|
7476
|
+
var nodes = ((_a = this.sites) === null || _a === void 0 ? void 0 : _a.length) ? this.sites.filter(function (site) { return _this.isSelected(site); }) : this.nodes;
|
|
7548
7477
|
return Promise.all(nodes.map(function (node) { return _this.siteData(node); }));
|
|
7549
7478
|
};
|
|
7550
7479
|
SitesMapsComponent.prototype.termPolygons = function (id) {
|
|
7551
7480
|
return __awaiter(this, void 0, void 0, function () {
|
|
7552
7481
|
var data, polygons, _err_1;
|
|
7553
7482
|
var _this = this;
|
|
7554
|
-
return __generator(this, function (
|
|
7555
|
-
switch (
|
|
7483
|
+
return __generator(this, function (_b) {
|
|
7484
|
+
switch (_b.label) {
|
|
7556
7485
|
case 0:
|
|
7557
|
-
|
|
7486
|
+
_b.trys.push([0, 2, , 3]);
|
|
7558
7487
|
return [4 /*yield*/, this.nodeService.downloadRaw(baseUrl() + "/gadm/" + id + ".geojson")];
|
|
7559
7488
|
case 1:
|
|
7560
|
-
data =
|
|
7489
|
+
data = _b.sent();
|
|
7561
7490
|
polygons = polygonsFromFeature(data);
|
|
7562
7491
|
polygons.map(function (polygon) { return polygon.setMap(_this.map.googleMap); });
|
|
7563
7492
|
return [2 /*return*/, polygons];
|
|
7564
7493
|
case 2:
|
|
7565
|
-
_err_1 =
|
|
7494
|
+
_err_1 = _b.sent();
|
|
7566
7495
|
// ignore error if the file does not exist
|
|
7567
7496
|
return [2 /*return*/, []];
|
|
7568
7497
|
case 3: return [2 /*return*/];
|
|
@@ -7573,7 +7502,7 @@
|
|
|
7573
7502
|
return SitesMapsComponent;
|
|
7574
7503
|
}());
|
|
7575
7504
|
SitesMapsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SitesMapsComponent, deps: [{ token: HeNodeService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
7576
|
-
SitesMapsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SitesMapsComponent, selector: "he-sites-maps", inputs: { loadPolygons: "loadPolygons", sites: "sites", nodes: "nodes", center: "center", zoom: "zoom", showNotice: "showNotice" }, viewQueries: [{ propertyName: "map", first: true, predicate: i1$4.GoogleMap, descendants: true }], ngImport: i0__namespace, template: "<google-map *ngIf=\"googleLoaded\"\n height=\"100%\"\n width=\"100%\"\n [zoom]=\"zoom\"\n [center]=\"center\"\n></google-map>\n\n<p *ngIf=\"showNotice\" class=\"mt-2 is-italic is-size-7\">The information provided might not be complete</p>\n\n<div class=\"no-location has-text-center has-text-light\" *ngIf=\"showNoLocation\">\n <span>No precise location data</span>\n</div>\n", styles: [":host{display:block;height:100%;position:relative;width:100%}.no-location{background-color:#0000004d;left:0;height:100%;position:absolute;top:0;width:100%;z-index:9}.no-location>span{display:inline-block;margin-top:12%}\n"], components: [{ type: i1__namespace$3.GoogleMap, selector: "google-map", inputs: ["height", "width", "center", "zoom", "options", "mapTypeId"], outputs: ["authFailure", "boundsChanged", "centerChanged", "mapClick", "mapDblclick", "mapDrag", "mapDragend", "mapDragstart", "headingChanged", "idle", "maptypeidChanged", "mapMousemove", "mapMouseout", "mapMouseover", "projectionChanged", "mapRightclick", "tilesloaded", "tiltChanged", "zoomChanged"], exportAs: ["googleMap"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
7505
|
+
SitesMapsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SitesMapsComponent, selector: "he-sites-maps", inputs: { loadPolygons: "loadPolygons", sites: "sites", selected: "selected", nodes: "nodes", center: "center", zoom: "zoom", showNotice: "showNotice" }, viewQueries: [{ propertyName: "map", first: true, predicate: i1$4.GoogleMap, descendants: true }], ngImport: i0__namespace, template: "<google-map *ngIf=\"googleLoaded\"\n height=\"100%\"\n width=\"100%\"\n [zoom]=\"zoom\"\n [center]=\"center\"\n></google-map>\n\n<p *ngIf=\"showNotice\" class=\"mt-2 is-italic is-size-7\">The information provided might not be complete</p>\n\n<div class=\"no-location has-text-center has-text-light\" *ngIf=\"showNoLocation\">\n <span>No precise location data</span>\n</div>\n", styles: [":host{display:block;height:100%;position:relative;width:100%}.no-location{background-color:#0000004d;left:0;height:100%;position:absolute;top:0;width:100%;z-index:9}.no-location>span{display:inline-block;margin-top:12%}\n"], components: [{ type: i1__namespace$3.GoogleMap, selector: "google-map", inputs: ["height", "width", "center", "zoom", "options", "mapTypeId"], outputs: ["authFailure", "boundsChanged", "centerChanged", "mapClick", "mapDblclick", "mapDrag", "mapDragend", "mapDragstart", "headingChanged", "idle", "maptypeidChanged", "mapMousemove", "mapMouseout", "mapMouseover", "projectionChanged", "mapRightclick", "tilesloaded", "tiltChanged", "zoomChanged"], exportAs: ["googleMap"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
7577
7506
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SitesMapsComponent, decorators: [{
|
|
7578
7507
|
type: i0.Component,
|
|
7579
7508
|
args: [{
|
|
@@ -7588,6 +7517,8 @@
|
|
|
7588
7517
|
type: i0.Input
|
|
7589
7518
|
}], sites: [{
|
|
7590
7519
|
type: i0.Input
|
|
7520
|
+
}], selected: [{
|
|
7521
|
+
type: i0.Input
|
|
7591
7522
|
}], nodes: [{
|
|
7592
7523
|
type: i0.Input
|
|
7593
7524
|
}], center: [{
|
|
@@ -7695,6 +7626,7 @@
|
|
|
7695
7626
|
function SitesMeasurementsComponent() {
|
|
7696
7627
|
this.originalValues = [];
|
|
7697
7628
|
this.sites = [];
|
|
7629
|
+
this.selected = [];
|
|
7698
7630
|
this.showDownload = false;
|
|
7699
7631
|
this.View = View$1;
|
|
7700
7632
|
this.selectedView = View$1.table;
|
|
@@ -7736,10 +7668,13 @@
|
|
|
7736
7668
|
enumerable: false,
|
|
7737
7669
|
configurable: true
|
|
7738
7670
|
});
|
|
7671
|
+
SitesMeasurementsComponent.prototype.isSelected = function (site) {
|
|
7672
|
+
return this.selected.length === 0 || this.selected.includes(site['@id']);
|
|
7673
|
+
};
|
|
7739
7674
|
return SitesMeasurementsComponent;
|
|
7740
7675
|
}());
|
|
7741
7676
|
SitesMeasurementsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SitesMeasurementsComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
7742
|
-
SitesMeasurementsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SitesMeasurementsComponent, selector: "he-sites-measurements", inputs: { originalValues: "originalValues", sites: "sites", dataState: "dataState" }, usesOnChanges: true, ngImport: i0__namespace, template: "<ng-container *ngIf=\"measurements.length; else emptyTable\">\n <div class=\"columns is-variable is-2 m-0\">\n <div class=\"column is-hidden-mobile\"></div>\n <div class=\"column is-narrow\">\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=\"!isOriginal && sites.length === 1\">\n <button class=\"button is-small\" [class.is-active]=\"selectedView === View.logs\" (click)=\"selectedView = View.logs\">\n <span class=\"icon is-small\">\n <fa-icon icon=\"calculator\" aria-hidden=\"true\"></fa-icon>\n </span>\n <span>Recalculations logs</span>\n </button>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"px-3 pb-3\" [class.is-hidden]=\"selectedView !== View.table\">\n <div class=\"has-text-right mb-2\">\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\n <div class=\"table-container data-table-container mb-1\">\n <table class=\"table is-narrow data-table has-children-{{measurements.length}}\">\n <thead>\n <tr>\n <th class=\"width-auto\"></th>\n <th *ngFor=\"let measurement of measurements\"\n [attr.title]=\"measurement.value.term.name\"\n >\n <he-node-link [node]=\"measurement.value.term\">\n <span>{{measurement.value.term.name | ellipsis:30}}</span>\n </he-node-link>\n </th>\n </tr>\n <tr>\n <th class=\"width-auto\"></th>\n <th *ngFor=\"let measurement of measurements\"\n [attr.title]=\"measurement.value.term.units\"\n >{{measurement.value.term.units}}</th>\n </tr>\n </thead>\n <tbody>\n <
|
|
7677
|
+
SitesMeasurementsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SitesMeasurementsComponent, selector: "he-sites-measurements", inputs: { originalValues: "originalValues", sites: "sites", selected: "selected", dataState: "dataState" }, usesOnChanges: true, ngImport: i0__namespace, template: "<ng-container *ngIf=\"measurements.length; else emptyTable\">\n <div class=\"columns is-variable is-2 m-0\">\n <div class=\"column is-hidden-mobile\"></div>\n <div class=\"column is-narrow\">\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=\"!isOriginal && sites.length === 1\">\n <button class=\"button is-small\" [class.is-active]=\"selectedView === View.logs\" (click)=\"selectedView = View.logs\">\n <span class=\"icon is-small\">\n <fa-icon icon=\"calculator\" aria-hidden=\"true\"></fa-icon>\n </span>\n <span>Recalculations logs</span>\n </button>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"px-3 pb-3\" [class.is-hidden]=\"selectedView !== View.table\">\n <div class=\"has-text-right mb-2\">\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\n <div class=\"table-container data-table-container mb-1\">\n <table class=\"table is-narrow data-table has-children-{{measurements.length}}\">\n <thead>\n <tr>\n <th class=\"width-auto\"></th>\n <th *ngFor=\"let measurement of measurements\"\n [attr.title]=\"measurement.value.term.name\"\n >\n <he-node-link [node]=\"measurement.value.term\">\n <span>{{measurement.value.term.name | ellipsis:30}}</span>\n </he-node-link>\n </th>\n </tr>\n <tr>\n <th class=\"width-auto\"></th>\n <th *ngFor=\"let measurement of measurements\"\n [attr.title]=\"measurement.value.term.units\"\n >{{measurement.value.term.units}}</th>\n </tr>\n </thead>\n <tbody>\n <ng-container *ngFor=\"let site of sites; trackBy: trackById; let i = index\">\n <tr *ngIf=\"isSelected(site)\">\n <td class=\"width-auto\" [attr.title]=\"defaultLabel(site)\">\n <he-node-link [node]=\"site\">\n <span class=\"is-nowrap has-text-ellipsis\">{{i + 1}}. {{defaultLabel(site)}}</span>\n </he-node-link>\n </td>\n <td class=\"is-nowrap\" *ngFor=\"let measurement of measurements\">\n <span *ngIf=\"measurement.value.values[site['@id']]\"\n class=\"trigger-popover\"\n [ngbPopover]=\"details\" [autoClose]=\"'outside'\"\n triggers=\"manual\" #p=\"ngbPopover\" placement=\"left\" container=\"body\"\n (click)=\"togglePopover(p, { data: measurement.value.values[site['@id']], site: site, key: 'measurements' })\"\n >\n <span pointer>{{measurementValue(measurement.value.values[site['@id']], measurement.value.term['@id']) | precision:3 | default:'-'}}</span>\n <he-blank-node-state class=\"ml-1\"\n [node]=\"measurement.value.values[site['@id']].nodes[0]\"\n key=\"value\"\n ></he-blank-node-state>\n </span>\n <span *ngIf=\"!measurement.value.values[site['@id']]\">\n <span>-</span>\n <sup class=\"pl-1\" *ngIf=\"siteTooBig(site)\">(1)</sup>\n </span>\n </td>\n </tr>\n </ng-container>\n </tbody>\n </table>\n </div>\n\n <he-blank-node-state-notice [dataState]=\"dataState\"></he-blank-node-state-notice>\n\n <p class=\"is-size-7 is-italic\" *ngIf=\"showAreaTooBig\">\n (1) This region is >{{maxAreaSize}}km2 and is too large to reliably gap fill Measurements.\n </p>\n </div>\n\n <he-sites-measurements-logs *ngIf=\"selectedView === View.logs && !isOriginal\"\n [site]=\"sites[0]\"\n [originalValues]=\"originalValues[0].measurements\"\n [recalculatedValues]=\"sites[0].measurements\"\n ></he-sites-measurements-logs>\n</ng-container>\n\n<he-node-csv-export-confirm *ngIf=\"showDownload\"\n [nodes]=\"sites\" filename=\"site-measurements.csv\" [isUpload]=\"false\"\n [headerKeys]=\"['site.id', 'site.@id', 'site.measurements.']\"\n (closed)=\"showDownload = false\"\n></he-node-csv-export-confirm>\n\n<ng-template #emptyTable>\n <div class=\"panel-block\">\n <span>No data</span>\n </div>\n</ng-template>\n\n<ng-template #emptyValue>\n <span>-</span>\n</ng-template>\n\n<ng-template #details let-node=\"site\" let-data=\"data\" let-key=\"key\">\n <p><b>{{node.name}}</b></p>\n <he-node-value-details\n [data]=\"data\" [nodeType]=\"node['@type']\" [dataKey]=\"key\"\n ></he-node-value-details>\n</ng-template>\n", styles: ["fa-icon{display:inline-block;width:10px}\n"], components: [{ type: i1__namespace.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }, { type: NodeLinkComponent, selector: "he-node-link", inputs: ["node", "showExternalLink"] }, { type: BlankNodeStateComponent, selector: "he-blank-node-state", inputs: ["nodeType", "dataKey", "key", "node", "state"] }, { type: BlankNodeStateNoticeComponent, selector: "he-blank-node-state-notice", inputs: ["dataState", "showAggregated", "showDeleted", "showUnchanged"] }, { type: SitesMeasurementsLogsComponent, selector: "he-sites-measurements-logs", inputs: ["site", "originalValues", "recalculatedValues"] }, { type: NodeCsvExportConfirmComponent, selector: "he-node-csv-export-confirm", inputs: ["nodes", "filename", "headerKeys", "extension", "isUpload"], outputs: ["closed"] }, { type: NodeValueDetailsComponent, selector: "he-node-value-details", inputs: ["data", "nodeType", "dataKey"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10__namespace.NgbPopover, selector: "[ngbPopover]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disablePopover", "popoverClass", "openDelay", "closeDelay", "ngbPopover", "popoverTitle"], outputs: ["shown", "hidden"], exportAs: ["ngbPopover"] }], pipes: { "ellipsis": EllipsisPipe, "default": DefaultPipe, "precision": PrecisionPipe } });
|
|
7743
7678
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SitesMeasurementsComponent, decorators: [{
|
|
7744
7679
|
type: i0.Component,
|
|
7745
7680
|
args: [{
|
|
@@ -7751,6 +7686,8 @@
|
|
|
7751
7686
|
type: i0.Input
|
|
7752
7687
|
}], sites: [{
|
|
7753
7688
|
type: i0.Input
|
|
7689
|
+
}], selected: [{
|
|
7690
|
+
type: i0.Input
|
|
7754
7691
|
}], dataState: [{
|
|
7755
7692
|
type: i0.Input
|
|
7756
7693
|
}] } });
|
|
@@ -8227,7 +8164,7 @@
|
|
|
8227
8164
|
return FilesFormComponent;
|
|
8228
8165
|
}());
|
|
8229
8166
|
FilesFormComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FilesFormComponent, deps: [{ token: i0__namespace.ElementRef }, { token: HeSearchService }, { token: HeUsersService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
8230
|
-
FilesFormComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FilesFormComponent, selector: "he-files-form", inputs: { schemas: "schemas", errors: "errors", node: "node", nodeMap: "nodeMap", editable: "editable", errorMode: "errorMode", deepEditable: "deepEditable", errorsEditable: "errorsEditable" }, outputs: { nodeChange: "nodeChange", nodeErorrResolved: "nodeErorrResolved", nodeErrorAdded: "nodeErrorAdded" }, ngImport: i0__namespace, template: "<div class=\"card\">\n <div class=\"card-toggle p-4\" (click)=\"isOpen = !isOpen\" pointer>\n <fa-icon icon=\"angle-down\" [class.is-hidden]=\"!isOpen\"></fa-icon>\n <fa-icon icon=\"angle-right\" [class.is-hidden]=\"isOpen\"></fa-icon>\n <span *ngIf=\"nodeProperty\" class=\"is-px-2\"\n [class.has-text-danger]=\"nodeProperty.hasError\"\n [class.has-text-warning]=\"nodeProperty.hasWarning\"\n >\n <he-node-icon [type]=\"nodeProperty.schemaType\"></he-node-icon>\n </span>\n </div>\n\n <ng-container *ngIf=\"editable && isOpen && nodeProperty\">\n <ng-container *ngTemplateOutlet=\"showNewProperty; context: {$implicit: nodeProperty}\"></ng-container>\n </ng-container>\n\n <div class=\"card-content\">\n <ng-container *ngIf=\"isOpen\">\n <div class=\"pb-3 mb-2\" *ngIf=\"errorsEditable\">\n <ng-container *ngTemplateOutlet=\"nodeErrorForm; context: {$implicit: nodeProperty}\"></ng-container>\n </div>\n\n <div class=\"mb-4\" *ngIf=\"nodeProperty?.error\">\n <ng-container *ngTemplateOutlet=\"propertyError; context: {property: nodeProperty, edit: true}\"></ng-container>\n </div>\n </ng-container>\n\n <div class=\"columns is-multiline\">\n <ng-container *ngFor=\"let property of properties; trackBy: trackByProperty\">\n <ng-container *ngTemplateOutlet=\"showProperty; context: {$implicit: property}\"></ng-container>\n </ng-container>\n </div>\n\n <ng-container *ngIf=\"isOpen\">\n <ng-container *ngTemplateOutlet=\"propertyMap; context: {$implicit: nodeProperty}\"></ng-container>\n </ng-container>\n </div>\n</div>\n\n<he-maps-drawing-confirm *ngIf=\"!!mapDrawingProperty\"\n [value]=\"mapDrawingProperty.value\" [modes]=\"mapDrawingModes(mapDrawingProperty)\"\n (closed)=\"onMapDrawingClosed($event)\"\n></he-maps-drawing-confirm>\n\n<he-bibliographies-search-confirm *ngIf=\"!!bibliographiesSearchProperty\"\n [search]=\"bibliographiesSearchProperty.value\"\n [searchBy]=\"bibliographiesSearchKey(bibliographiesSearchProperty)\"\n [searchSources]=\"bibliographiesSearchSources\"\n (closed)=\"onBibliographiesSearchClosed($event)\"\n></he-bibliographies-search-confirm>\n\n<ng-template #labelDescription let-property>\n <span\n class=\"trigger-popover\"\n [ngbPopover]=\"property.schema?.description\" [autoClose]=\"'outside'\"\n triggers=\"hover\" placement=\"right\" container=\"body\"\n >\n <span>{{property.key}}</span>\n </span>\n</ng-template>\n\n<ng-template #labelDefault let-property>\n <span>{{property.key}}</span>\n</ng-template>\n\n<ng-template #showProperty let-property>\n <ng-container *ngIf=\"(isOpen || property.closedVisible) && !property.isHidden\">\n <div class=\"column is-6\"\n [id]=\"property.fullKey + '_' + property.id\"\n [class.is-12]=\"property.properties.length || !property.key\"\n [ngSwitch]=\"!!property.properties.length\"\n >\n <div class=\"columns is-multiline is-variable is-1\" *ngSwitchCase=\"false\">\n <div class=\"column is-3 py-1\" *ngIf=\"property.key\">\n <label class=\"label has-text-right-tablet has-text-ellipsis\"\n *bindOnce=\"property\"\n [for]=\"property.id\"\n >\n <ng-container\n *ngTemplateOutlet=\"property.schema?.description && editable && property.editable ? labelDescription : labelDefault; context: {$implicit: property}\">\n </ng-container>\n </label>\n </div>\n\n <div class=\"column is-9 py-1\" [class.is-12]=\"!property.key\">\n <div class=\"field\">\n <ng-container *ngTemplateOutlet=\"inputForm; context: {$implicit: property}\"></ng-container>\n\n <ng-container *ngIf=\"(editable || errorsEditable) && (property.hasError || property.hasWarning)\">\n <ng-container *ngTemplateOutlet=\"propertyError; context: {property: property, edit: false}\"></ng-container>\n </ng-container>\n </div>\n </div>\n </div>\n\n <div class=\"panel\" *ngSwitchCase=\"true\"\n [class.is-link]=\"errorMode && property.changed\"\n [class.is-danger]=\"!property.changed && property.hasError\"\n [class.is-warning]=\"!property.changed && property.hasWarning\"\n [class.is-default]=\"!property.changed && !property.hasError && !property.hasWarning\"\n >\n <div class=\"open-group panel-heading py-0\"\n (click)=\"property.isOpen = !property.isOpen\" pointer\n [class.is-open]=\"property.isOpen\"\n [class.has-text-white]=\"(errorMode && property.changed) || property.hasError || property.hasWarning\"\n >\n <div class=\"columns is-mobile is-vcentered\">\n <span class=\"column is-narrow py-1 my-0\">\n <fa-icon icon=\"angle-down\" [class.is-hidden]=\"!property.isOpen\"></fa-icon>\n <fa-icon icon=\"angle-right\" [class.is-hidden]=\"property.isOpen\"></fa-icon>\n </span>\n <span class=\"column py-1 my-0\">\n <span class=\"is-size-6\">{{property.key}}</span>\n </span>\n <span *ngIf=\"property.schemaType\" class=\"column is-narrow py-1 my-0\">\n <span class=\"tags mb-0 has-addons\">\n <span class=\"tag mb-0 is-light\">Type</span>\n <span class=\"tag mb-0 is-white\">\n <he-schema-version-link linkClass=\"is-small\" [node]=\"{'@type': property.schemaType}\">\n <span>{{property.schemaType}}</span>\n </he-schema-version-link>\n </span>\n </span>\n </span>\n <he-popover-confirm class=\"column is-narrow py-1 my-0 px-0\"\n *ngIf=\"editable && !errorsEditable\"\n ngbTooltip=\"Remove group\" placement=\"top\"\n [message]=\"'<p>This will remove the group completely.</p>' + (property.isRequired ? '<p><u>Warning: this field is required.</u></p>' : '') + '<p>Do you confirm?</p>'\"\n popoverClass=\"px-3\"\n (confirmed)=\"propertyChanged(null, property)\"\n >\n <fa-icon icon=\"times\" size=\"sm\"></fa-icon>\n </he-popover-confirm>\n </div>\n </div>\n <div class=\"panel-block is-block p-0\" *ngIf=\"property.isOpen\">\n <ng-container [ngSwitch]=\"property.isArray\">\n <div class=\"px-3 pt-4\" *ngIf=\"property.error\">\n <ng-container *ngTemplateOutlet=\"propertyError; context: {property: property, edit: true}\"></ng-container>\n </div>\n\n <div class=\"mt-3\" *ngSwitchCase=\"false\">\n <p class=\"help py-1 px-2\" *ngIf=\"editable && !property.editable\">\n To change the {{property.key}}, please delete it first, then add the field again\n </p>\n <ng-container *ngIf=\"editable && property.editable\">\n <ng-container [ngSwitch]=\"property.schema?.title\">\n <p class=\"help py-1 px-2\" *ngSwitchCase=\"'Bibliography'\">\n Search by Title or Document DOI to auto-populate the fields using the Mendeley catalogue\n </p>\n </ng-container>\n </ng-container>\n\n <ng-container *ngTemplateOutlet=\"showNewProperty; context: {$implicit: property}\"></ng-container>\n\n <div class=\"px-3 mt-1\" *ngIf=\"errorsEditable\">\n <ng-container *ngTemplateOutlet=\"nodeErrorForm; context: {$implicit: property}\"></ng-container>\n </div>\n\n <div class=\"property-group py-2 px-3 mt-2\">\n <div class=\"columns is-multiline mb-0\">\n <ng-container *ngFor=\"let prop2 of property.properties; trackBy: trackByProperty\">\n <ng-container *ngTemplateOutlet=\"showProperty; context: {$implicit: prop2}\"></ng-container>\n </ng-container>\n </div>\n </div>\n </div>\n\n <div class=\"py-2 px-3 mt-2\" *ngSwitchCase=\"true\">\n <div class=\"mt-1\" *ngIf=\"errorsEditable\">\n <ng-container *ngTemplateOutlet=\"nodeErrorForm; context: {$implicit: property}\"></ng-container>\n </div>\n\n <ng-container *ngFor=\"let prop2 of property.properties; trackBy: trackByProperty\">\n <div class=\"card p-0 my-4\" *ngIf=\"prop2.key\"\n [id]=\"prop2.fullKey + '_' + prop2.id\"\n >\n <div class=\"property-array-number\">\n <div class=\"tags has-addons\">\n <span class=\"tag is-dark\">{{prop2.key}}</span>\n <ng-container *ngIf=\"editable && !errorsEditable && property.editable\">\n <span class=\"tag is-info\" pointer\n (click)=\"duplicateArrayGroup(property, prop2)\"\n [ngbTooltip]=\"'Duplicate ' + pluralize(property.key, 1)\" placement=\"top\"\n >\n <fa-icon icon=\"clone\" size=\"sm\"></fa-icon>\n </span>\n <span class=\"tag is-light\" pointer\n *ngIf=\"prop2.key !== '0'\"\n (click)=\"moveArrayGroupUp(property, prop2)\"\n ngbTooltip=\"Move Up\" placement=\"top\"\n >\n <fa-icon icon=\"long-arrow-alt-up\" size=\"sm\"></fa-icon>\n </span>\n <span class=\"tag is-light\" pointer\n *ngIf=\"prop2.key !== property.properties.length - 1\"\n (click)=\"moveArrayGroupDown(property, prop2)\"\n ngbTooltip=\"Move Down\" placement=\"top\"\n >\n <fa-icon icon=\"long-arrow-alt-down\" size=\"sm\"></fa-icon>\n </span>\n <he-popover-confirm class=\"tag is-delete\"\n [ngbTooltip]=\"'Remove ' + pluralize(property.key, 1)\" placement=\"top\"\n message=\"This will remove the group completely. Do you confirm?\" position=\"right\"\n (confirmed)=\"removeArrayGroup(property, prop2)\"\n ></he-popover-confirm>\n </ng-container>\n </div>\n </div>\n\n <ng-container *ngTemplateOutlet=\"showNewProperty; context: {$implicit: prop2}\"></ng-container>\n\n <div class=\"px-4 mt-2\" *ngIf=\"errorsEditable\">\n <ng-container *ngTemplateOutlet=\"nodeErrorForm; context: {$implicit: prop2}\"></ng-container>\n </div>\n\n <div class=\"px-4 mt-2\" *ngIf=\"prop2.error\">\n <ng-container *ngTemplateOutlet=\"propertyError; context: {property: prop2, edit: true}\"></ng-container>\n </div>\n\n <div class=\"property-group card-content p-3\">\n <div class=\"columns is-multiline my-0\">\n <ng-container *ngFor=\"let prop3 of prop2.properties; trackBy: trackByProperty\">\n <ng-container *ngTemplateOutlet=\"showProperty; context: {$implicit: prop3}\"></ng-container>\n </ng-container>\n </div>\n </div>\n </div>\n </ng-container>\n\n <button class=\"button is-dark is-outlined is-small\" type=\"button\"\n *ngIf=\"editable && !errorsEditable\"\n (click)=\"addArrayGroup(property)\"\n >\n <fa-icon icon=\"plus-circle\"></fa-icon>\n <span class=\"pl-2\">Add</span>\n <span class=\"pl-1\">{{property.key | pluralize:1}}</span>\n </button>\n </div>\n </ng-container>\n </div>\n </div>\n </div>\n </ng-container>\n</ng-template>\n\n<ng-template #inputForm let-property>\n <ng-container *ngIf=\"property.key\">\n <ng-container [ngSwitch]=\"property.suggestions?.type\">\n <ng-container *ngSwitchCase=\"'select'\">\n <ng-container *ngTemplateOutlet=\"inputSelect; context: {$implicit: property}\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <ng-container *ngTemplateOutlet=\"inputInput; context: {$implicit: property}\"></ng-container>\n </ng-container>\n </ng-container>\n </ng-container>\n</ng-template>\n\n<ng-template #inputInput let-property>\n <div class=\"field mb-0\" [class.has-addons]=\"hasAddons(property)\">\n <div class=\"control is-expanded\"\n [class.has-icons-right]=\"property.loading\"\n >\n <input class=\"input is-small search-input\"\n [class.is-dark]=\"property.key === 'type'\"\n [class.is-link]=\"errorMode && property.changed\"\n [class.is-danger]=\"(!property.changed && property.hasError) || isRequired(property)\"\n [class.is-warning]=\"!property.changed && property.hasWarning\"\n\n [(ngModel)]=\"property.value\" #propertyModel=\"ngModel\"\n [type]=\"property.schema?.type === 'number' ? 'number' : 'string'\"\n [id]=\"property.id\"\n name=\"randomname\"\n [readonly]=\"!editable || !property.editable || property.schema?.internal\"\n [placeholder]=\"property.placeholder\"\n [appTagsInput]=\"{enabled: editable && property.editable && property.schema?.type === 'array', items: property.schema?.items, delimiter: ';', allowDuplicates: true, placeholder: property.placeholder}\"\n (change)=\"propertyChanged($event.target.value, property)\"\n\n [pattern]=\"property.schema?.pattern\"\n [required]=\"property.fullKey.endsWith('id') && property.fullKey !== 'id'\"\n [min]=\"property.schema?.minimum\"\n [max]=\"property.schema?.maximum\"\n\n [ngbTypeahead]=\"propertySuggest(property.fullKey, property.suggestions?.type)\"\n [resultTemplate]=\"suggestion\"\n [inputFormatter]=\"formatter\"\n [focusFirst]=\"true\"\n (focus)=\"editable && property.editable && typeaheadFocus($event)\"\n (selectItem)=\"suggestionSelected($event.item, property)\"\n >\n\n <span class=\"icon is-small is-right has-text-grey-dark\" [class.is-hidden]=\"!property.loading\">\n <fa-icon icon=\"spinner\" [pulse]=\"true\" size=\"sm\"></fa-icon>\n </span>\n </div>\n <ng-container *ngTemplateOutlet=\"inputAddons; context: {$implicit: property}\"></ng-container>\n </div>\n <p class=\"help is-danger-light\"\n *ngIf=\"!property.hasError && propertyModel.invalid\"\n >\n <span *bindOnce=\"propertyModel.errors\" [innerHTML]=\"formatPropertyError(propertyModel.errors, property)\"></span>\n </p>\n</ng-template>\n\n<ng-template #inputSelect let-property>\n <div class=\"field mb-0\" [class.has-addons]=\"hasAddons(property)\">\n <div class=\"control is-expanded\">\n <div class=\"select is-small is-fullwidth\"\n [class.is-link]=\"errorMode && property.changed\"\n [class.is-danger]=\"(!property.changed && property.hasError) || isRequired(property)\"\n [class.is-warning]=\"!property.changed && property.hasWarning\"\n >\n <select\n [(ngModel)]=\"property.value\" #propertyModel=\"ngModel\"\n [id]=\"property.id\"\n name=\"randomname\"\n [disabled]=\"!editable || !property.editable || property.schema?.internal\"\n (change)=\"propertyChanged($event.target.value, property)\"\n >\n <option value=\"\">Select</option>\n <ng-container *bindOnce=\"property.suggestions\">\n <option *ngFor=\"let value of property.suggestions.values; trackBy: trackByIndex\" [value]=\"value\">{{value}}</option>\n </ng-container>\n </select>\n </div>\n </div>\n <ng-container *ngTemplateOutlet=\"inputAddons; context: {$implicit: property}\"></ng-container>\n </div>\n</ng-template>\n\n<ng-template #removeFieldAddon let-property>\n <div class=\"control\" *ngIf=\"!errorsEditable && !property.isRequired\">\n <a class=\"button is-small\" title=\"Remove field\"\n [class.is-outlined]=\"!property.changed && (property.hasError || property.hasWarning)\"\n [class.is-danger]=\"!property.changed && property.hasError\"\n [class.is-warning]=\"!property.changed && property.hasWarning\"\n (click)=\"$event.stopPropagation(); propertyChanged(null, property)\"\n >\n <fa-icon icon=\"times\"></fa-icon>\n </a>\n </div>\n</ng-template>\n\n<ng-template #inputAddons let-property>\n <he-popover-confirm class=\"control\"\n *ngIf=\"enableAddError(property)\"\n position=\"left\"\n [content]=\"popupErrorForm\"\n (confirmed)=\"addError(property, $event)\"\n >\n <span class=\"button is-small\">\n <fa-icon icon=\"comments\"></fa-icon>\n </span>\n </he-popover-confirm>\n\n <ng-container *ngIf=\"editable && property.editable\">\n <ng-container [ngSwitch]=\"property.schemaType\">\n <ng-container *ngSwitchCase=\"SchemaType.Actor\">\n <ng-container *ngTemplateOutlet=\"actorAddons; context: {$implicit: property}\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"SchemaType.Cycle\">\n <ng-container *ngTemplateOutlet=\"cycleAddons; context: {$implicit: property}\"></ng-container>\n </ng-container>\n </ng-container>\n <ng-container *bindOnce=\"property\">\n <div class=\"control\" *ngIf=\"mapDrawingModes(property).length\">\n <button class=\"button is-small\" title=\"Pick on Map\"\n (click)=\"mapDrawingProperty = property\"\n >\n <fa-icon icon=\"map-marked-alt\"></fa-icon>\n </button>\n </div>\n <div class=\"control\" *ngIf=\"bibliographiesSearchKey(property)\">\n <button class=\"button is-small\" title=\"Advanced Search\"\n (click)=\"bibliographiesSearchProperty = property\"\n >\n <fa-icon icon=\"search\"></fa-icon>\n </button>\n </div>\n </ng-container>\n\n <ng-container *ngTemplateOutlet=\"removeFieldAddon; context: {$implicit: property}\"></ng-container>\n </ng-container>\n <div class=\"control\" *ngIf=\"addPropertyEnabled(property)\">\n <a class=\"button is-small is-danger\" title=\"Add field\"\n (click)=\"$event.stopPropagation(); addMissingProperty(property)\"\n >\n <fa-icon icon=\"plus-circle\"></fa-icon>\n <span class=\"pl-2\">Add</span>\n </a>\n </div>\n <div class=\"control\" *ngIf=\"isRequired(property)\">\n <label class=\"button is-small is-danger\" [for]=\"property.id\"\n ngbTooltip=\"This field is required\" placement=\"top\"\n >\n <fa-icon icon=\"exclamation-triangle\"></fa-icon>\n </label>\n </div>\n <ng-container *ngIf=\"property.externalUrl?.url\">\n <div class=\"control\">\n <a class=\"button is-small\"\n [href]=\"property.externalUrl.url + (property.externalUrl.urlParamValue ? property.value : '')\"\n target=\"_blank\"\n [title]=\"property.externalUrl.title\"\n [ngClass]=\"{'is-dark is-outlined': property.key === 'type'}\"\n [attr.disabled]=\"property.externalUrl.urlParamValue && !property.value ? true : null\"\n >\n <fa-icon [icon]=\"property.externalUrl.icon || 'external-link-alt'\"></fa-icon>\n </a>\n </div>\n </ng-container>\n <ng-container *ngIf=\"unitConverterEnabled(property)\">\n <div class=\"control\">\n <button class=\"button is-small\" title=\"Open calculator\"\n [ngbPopover]=\"convertUnits\" autoClose=\"outside\"\n triggers=\"manual\" #p=\"ngbPopover\" placement=\"bottom\" container=\"body\"\n (click)=\"openUnitConverter(p, property)\"\n >\n <fa-icon icon=\"calculator\"></fa-icon>\n </button>\n </div>\n </ng-container>\n</ng-template>\n\n<ng-template #actorAddons let-property>\n <div class=\"control\" *ngIf=\"property.key === '@id'\">\n <button class=\"button is-small\" title=\"Add myself as Actor\"\n (click)=\"setUserActorId(property)\"\n >\n <fa-icon [icon]=\"['far', 'id-badge']\"></fa-icon>\n </button>\n </div>\n</ng-template>\n\n<ng-template #cycleAddons let-property>\n <div class=\"control\" *ngIf=\"property.key === 'cycleDuration'\">\n <button class=\"button is-small\" title=\"Calculate value from startDate and endDate\"\n (click)=\"calculateCycleDuration(property)\"\n [disabled]=\"!calculateCycleDurationEnabled(property)\"\n >\n <fa-icon icon=\"calculator\"></fa-icon>\n </button>\n </div>\n <div class=\"control\" *ngIf=\"property.key === 'startDate'\">\n <button class=\"button is-small\" title=\"Calculate value from endDate and cycleDuration\"\n (click)=\"calculateCycleStartDate(property)\"\n [disabled]=\"!calculateCycleStartDateEnabled(property)\"\n >\n <fa-icon icon=\"calculator\"></fa-icon>\n </button>\n </div>\n</ng-template>\n\n<ng-template #showNewProperty let-property>\n <header class=\"card-header\" *ngIf=\"editable && property.editable && (property.addPropertyEnabled || deepEditable); else padder\">\n <form class=\"py-3 px-4 is-flex-grow-1\" (submit)=\"addProperty(property)\" novalidate>\n <div class=\"field is-horizontal\">\n <div class=\"field-label is-small\">\n <label class=\"label\" [for]=\"property.id + '_new'\">\n <span>Add new field</span>\n </label>\n </div>\n <div class=\"field-body\">\n <div class=\"field has-addons\">\n <div class=\"control is-expanded\">\n <input class=\"input is-small\"\n [(ngModel)]=\"property.newProperty\"\n [id]=\"property.id + '_new'\"\n name=\"randomname\"\n placeholder=\"Search and select field from results\"\n\n [ngbTypeahead]=\"suggestNewProperty(property.fullKey)\"\n [resultTemplate]=\"suggestion\"\n [inputFormatter]=\"formatter\"\n [focusFirst]=\"false\"\n [editable]=\"false\"\n (focus)=\"typeaheadFocus($event)\"\n >\n </div>\n <div class=\"control\">\n <button class=\"button is-small\" type=\"submit\"\n [disabled]=\"!property.newProperty || !property.newProperty.name\"\n >\n <fa-icon icon=\"plus\"></fa-icon>\n <span class=\"pl-2\">Add</span>\n </button>\n </div>\n </div>\n </div>\n </div>\n </form>\n </header>\n</ng-template>\n\n<ng-template #propertyError let-property=\"property\" let-edit=\"edit\">\n <p class=\"help\"\n [class.is-danger]=\"property.hasError\"\n [class.is-warning]=\"property.hasWarning\"\n *ngIf=\"property.error\"\n >\n <span class=\"is-pre-wrap\" *bindOnce=\"property.error\" [innerHTML]=\"property.error.message\"></span>\n <a class=\"pl-2\"\n *ngIf=\"edit && errorsEditable && property.error.index >= 0\"\n (click)=\"editError(property)\"\n >\n <fa-icon class=\"pr-2\" icon=\"edit\"></fa-icon>\n <span>Edit</span>\n </a>\n <a class=\"pl-2\"\n *ngIf=\"(property.hasWarning || errorsEditable) && property.error.index >= 0\"\n (click)=\"resolveError(property)\"\n >\n <fa-icon class=\"pr-2\" icon=\"check\"></fa-icon>\n <span>Resolved</span>\n </a>\n </p>\n</ng-template>\n\n<ng-template #propertyMap let-property>\n <div class=\"panel is-default\" *ngIf=\"showMap\">\n <div class=\"open-group panel-heading py-0\"\n (click)=\"mapVisible = !mapVisible\" pointer\n [class.is-open]=\"mapVisible\"\n >\n <div class=\"columns is-mobile is-vcentered mb-0\">\n <span class=\"column is-narrow py-1 my-0\">\n <fa-icon icon=\"angle-down\" [class.is-hidden]=\"!mapVisible\"></fa-icon>\n <fa-icon icon=\"angle-right\" [class.is-hidden]=\"mapVisible\"></fa-icon>\n </span>\n <span class=\"column py-1 my-0\">\n <span class=\"is-size-6\">View on Map</span>\n </span>\n </div>\n </div>\n <div class=\"panel-block is-block p-0\" [class.is-hidden]=\"!mapVisible\">\n <he-sites-maps [sites]=\"[node]\" [showNotice]=\"false\"></he-sites-maps>\n </div>\n </div>\n</ng-template>\n\n<ng-template #nodeErrorForm let-property>\n <ng-container *ngIf=\"property.newError && property.editable\">\n <div class=\"field has-addons\">\n <div class=\"control\">\n <div class=\"select is-small\">\n <select [(ngModel)]=\"property.newError.level\">\n <option [value]=\"undefined\">Select Level</option>\n <option value=\"error\">Error</option>\n <option value=\"warning\">Warning</option>\n </select>\n </div>\n </div>\n <div class=\"control is-expanded\">\n <textarea class=\"textarea is-small\"\n [(ngModel)]=\"property.newError.message\"\n placeholder=\"Enter your message here\"\n rows=\"1\"\n ></textarea>\n </div>\n <div class=\"control\">\n <button class=\"button is-small\"\n [disabled]=\"!property.newError.level || !property.newError.message\"\n (click)=\"addError(property, property.newError)\"\n >\n <fa-icon icon=\"plus-circle\"></fa-icon>\n <span class=\"pl-2\">Add</span>\n </button>\n </div>\n </div>\n </ng-container>\n</ng-template>\n\n<ng-template #popupErrorForm let-data=\"data\">\n <div class=\"field has-addons\">\n <div class=\"control\">\n <div class=\"select\">\n <select [(ngModel)]=\"data.level\">\n <option [value]=\"undefined\">Select Level</option>\n <option value=\"error\">Error</option>\n <option value=\"warning\">Warning</option>\n </select>\n </div>\n </div>\n <div class=\"control\">\n <input class=\"input\"\n [(ngModel)]=\"data.message\"\n placeholder=\"Enter your message here\"\n >\n </div>\n </div>\n</ng-template>\n\n<ng-template #suggestion let-r=\"result\" let-t=\"term\">\n <ngb-highlight\n [title]=\"r.bibliography?.title || r.bibliography?.documentDOI || r.bibliography?.scopus || r.name\"\n [result]=\"r.bibliography?.title || r.bibliography?.documentDOI || r.bibliography?.scopus || r.name\"\n [term]=\"t\"\n ></ngb-highlight>\n</ng-template>\n\n<ng-template #padder>\n <div class=\"pt-1\"></div>\n</ng-template>\n\n<ng-template #convertUnits let-value=\"value\" let-term=\"term\" let-units=\"units\">\n <he-unit-converter [value]=\"value\" [term]=\"term\" [toUnits]=\"units\"></he-unit-converter>\n</ng-template>\n", styles: [".panel.is-default .panel-heading{background-color:#ededed;color:#363636}.card-toggle{left:0;position:absolute;top:0}@media screen and (max-width: 768px){.card-toggle{position:relative}}.card-toggle>fa-icon{display:inline-block;width:10px}.card{overflow:visible}.card .card{box-shadow:2px 2px #36363652,0 0 0 1px #36363652}.card .card>.card-header{box-shadow:0 2px 1px #36363652}.property-array-number{left:-4px;position:absolute;top:-12px}.property-array-number .tag.is-delete{border:1px solid rgba(54,54,54,.32)}.control>.button{height:100%}.is-danger-light{color:#f5758f}he-sites-maps{height:200px}\n"], components: [{ type: i1__namespace.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }, { type: NodeIconComponent, selector: "he-node-icon", inputs: ["type", "size"] }, { type: MapsDrawingConfirmComponent, selector: "he-maps-drawing-confirm", inputs: ["value", "modes", "center", "zoom"], outputs: ["closed"] }, { type: BibliographiesSearchConfirmComponent, selector: "he-bibliographies-search-confirm", inputs: ["search", "searchSources", "searchBibliographies", "searchBy"], outputs: ["closed"] }, { type: SchemaVersionLinkComponent, selector: "he-schema-version-link", inputs: ["node", "showExternalLink", "linkClass", "text"] }, { type: PopoverConfirmComponent, selector: "he-popover-confirm", inputs: ["message", "content", "position", "popoverClass"], outputs: ["confirmed"] }, { type: SitesMapsComponent, selector: "he-sites-maps", inputs: ["loadPolygons", "sites", "nodes", "center", "zoom", "showNotice"] }, { type: i10__namespace.NgbHighlight, selector: "ngb-highlight", inputs: ["highlightClass", "result", "term"] }, { type: UnitConverterComponent, selector: "he-unit-converter", inputs: ["term", "value", "fromUnits", "toUnits"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10__namespace.NgbPopover, selector: "[ngbPopover]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disablePopover", "popoverClass", "openDelay", "closeDelay", "ngbPopover", "popoverTitle"], outputs: ["shown", "hidden"], exportAs: ["ngbPopover"] }, { type: i6__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i6__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: BindOnceDirective, selector: "[bindOnce]", inputs: ["bindOnce"] }, { type: i10__namespace.NgbTooltip, selector: "[ngbTooltip]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disableTooltip", "tooltipClass", "openDelay", "closeDelay", "ngbTooltip"], outputs: ["shown", "hidden"], exportAs: ["ngbTooltip"] }, { type: i6__namespace.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i1__namespace$4.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: i10__namespace.NgbTypeahead, selector: "input[ngbTypeahead]", inputs: ["autocomplete", "placement", "container", "editable", "focusFirst", "showHint", "inputFormatter", "ngbTypeahead", "resultFormatter", "resultTemplate"], outputs: ["selectItem"], exportAs: ["ngbTypeahead"] }, { type: i1__namespace$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1__namespace$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: TagsInputDirective, selector: "[appTagsInput]", inputs: ["appTagsInput"] }, { type: i1__namespace$4.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { type: i1__namespace$4.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i1__namespace$4.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i1__namespace$4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1__namespace$4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i6__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1__namespace$4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1__namespace$4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1__namespace$4.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }], pipes: { "pluralize": PluralizePipe } });
|
|
8167
|
+
FilesFormComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FilesFormComponent, selector: "he-files-form", inputs: { schemas: "schemas", errors: "errors", node: "node", nodeMap: "nodeMap", editable: "editable", errorMode: "errorMode", deepEditable: "deepEditable", errorsEditable: "errorsEditable" }, outputs: { nodeChange: "nodeChange", nodeErorrResolved: "nodeErorrResolved", nodeErrorAdded: "nodeErrorAdded" }, ngImport: i0__namespace, template: "<div class=\"card\">\n <div class=\"card-toggle p-4\" (click)=\"isOpen = !isOpen\" pointer>\n <fa-icon icon=\"angle-down\" [class.is-hidden]=\"!isOpen\"></fa-icon>\n <fa-icon icon=\"angle-right\" [class.is-hidden]=\"isOpen\"></fa-icon>\n <span *ngIf=\"nodeProperty\" class=\"is-px-2\"\n [class.has-text-danger]=\"nodeProperty.hasError\"\n [class.has-text-warning]=\"nodeProperty.hasWarning\"\n >\n <he-node-icon [type]=\"nodeProperty.schemaType\"></he-node-icon>\n </span>\n </div>\n\n <ng-container *ngIf=\"editable && isOpen && nodeProperty\">\n <ng-container *ngTemplateOutlet=\"showNewProperty; context: {$implicit: nodeProperty}\"></ng-container>\n </ng-container>\n\n <div class=\"card-content\">\n <ng-container *ngIf=\"isOpen\">\n <div class=\"pb-3 mb-2\" *ngIf=\"errorsEditable\">\n <ng-container *ngTemplateOutlet=\"nodeErrorForm; context: {$implicit: nodeProperty}\"></ng-container>\n </div>\n\n <div class=\"mb-4\" *ngIf=\"nodeProperty?.error\">\n <ng-container *ngTemplateOutlet=\"propertyError; context: {property: nodeProperty, edit: true}\"></ng-container>\n </div>\n </ng-container>\n\n <div class=\"columns is-multiline\">\n <ng-container *ngFor=\"let property of properties; trackBy: trackByProperty\">\n <ng-container *ngTemplateOutlet=\"showProperty; context: {$implicit: property}\"></ng-container>\n </ng-container>\n </div>\n\n <ng-container *ngIf=\"isOpen\">\n <ng-container *ngTemplateOutlet=\"propertyMap; context: {$implicit: nodeProperty}\"></ng-container>\n </ng-container>\n </div>\n</div>\n\n<he-maps-drawing-confirm *ngIf=\"!!mapDrawingProperty\"\n [value]=\"mapDrawingProperty.value\" [modes]=\"mapDrawingModes(mapDrawingProperty)\"\n (closed)=\"onMapDrawingClosed($event)\"\n></he-maps-drawing-confirm>\n\n<he-bibliographies-search-confirm *ngIf=\"!!bibliographiesSearchProperty\"\n [search]=\"bibliographiesSearchProperty.value\"\n [searchBy]=\"bibliographiesSearchKey(bibliographiesSearchProperty)\"\n [searchSources]=\"bibliographiesSearchSources\"\n (closed)=\"onBibliographiesSearchClosed($event)\"\n></he-bibliographies-search-confirm>\n\n<ng-template #labelDescription let-property>\n <span\n class=\"trigger-popover\"\n [ngbPopover]=\"property.schema?.description\" [autoClose]=\"'outside'\"\n triggers=\"hover\" placement=\"right\" container=\"body\"\n >\n <span>{{property.key}}</span>\n </span>\n</ng-template>\n\n<ng-template #labelDefault let-property>\n <span>{{property.key}}</span>\n</ng-template>\n\n<ng-template #showProperty let-property>\n <ng-container *ngIf=\"(isOpen || property.closedVisible) && !property.isHidden\">\n <div class=\"column is-6\"\n [id]=\"property.fullKey + '_' + property.id\"\n [class.is-12]=\"property.properties.length || !property.key\"\n [ngSwitch]=\"!!property.properties.length\"\n >\n <div class=\"columns is-multiline is-variable is-1\" *ngSwitchCase=\"false\">\n <div class=\"column is-3 py-1\" *ngIf=\"property.key\">\n <label class=\"label has-text-right-tablet has-text-ellipsis\"\n *bindOnce=\"property\"\n [for]=\"property.id\"\n >\n <ng-container\n *ngTemplateOutlet=\"property.schema?.description && editable && property.editable ? labelDescription : labelDefault; context: {$implicit: property}\">\n </ng-container>\n </label>\n </div>\n\n <div class=\"column is-9 py-1\" [class.is-12]=\"!property.key\">\n <div class=\"field\">\n <ng-container *ngTemplateOutlet=\"inputForm; context: {$implicit: property}\"></ng-container>\n\n <ng-container *ngIf=\"(editable || errorsEditable) && (property.hasError || property.hasWarning)\">\n <ng-container *ngTemplateOutlet=\"propertyError; context: {property: property, edit: false}\"></ng-container>\n </ng-container>\n </div>\n </div>\n </div>\n\n <div class=\"panel\" *ngSwitchCase=\"true\"\n [class.is-link]=\"errorMode && property.changed\"\n [class.is-danger]=\"!property.changed && property.hasError\"\n [class.is-warning]=\"!property.changed && property.hasWarning\"\n [class.is-default]=\"!property.changed && !property.hasError && !property.hasWarning\"\n >\n <div class=\"open-group panel-heading py-0\"\n (click)=\"property.isOpen = !property.isOpen\" pointer\n [class.is-open]=\"property.isOpen\"\n [class.has-text-white]=\"(errorMode && property.changed) || property.hasError || property.hasWarning\"\n >\n <div class=\"columns is-mobile is-vcentered\">\n <span class=\"column is-narrow py-1 my-0\">\n <fa-icon icon=\"angle-down\" [class.is-hidden]=\"!property.isOpen\"></fa-icon>\n <fa-icon icon=\"angle-right\" [class.is-hidden]=\"property.isOpen\"></fa-icon>\n </span>\n <span class=\"column py-1 my-0\">\n <span class=\"is-size-6\">{{property.key}}</span>\n </span>\n <span *ngIf=\"property.schemaType\" class=\"column is-narrow py-1 my-0\">\n <span class=\"tags mb-0 has-addons\">\n <span class=\"tag mb-0 is-light\">Type</span>\n <span class=\"tag mb-0 is-white\">\n <he-schema-version-link linkClass=\"is-small\" [node]=\"{'@type': property.schemaType}\">\n <span>{{property.schemaType}}</span>\n </he-schema-version-link>\n </span>\n </span>\n </span>\n <he-popover-confirm class=\"column is-narrow py-1 my-0 px-0\"\n *ngIf=\"editable && !errorsEditable\"\n ngbTooltip=\"Remove group\" placement=\"top\"\n [message]=\"'<p>This will remove the group completely.</p>' + (property.isRequired ? '<p><u>Warning: this field is required.</u></p>' : '') + '<p>Do you confirm?</p>'\"\n popoverClass=\"px-3\"\n (confirmed)=\"propertyChanged(null, property)\"\n >\n <fa-icon icon=\"times\" size=\"sm\"></fa-icon>\n </he-popover-confirm>\n </div>\n </div>\n <div class=\"panel-block is-block p-0\" *ngIf=\"property.isOpen\">\n <ng-container [ngSwitch]=\"property.isArray\">\n <div class=\"px-3 pt-4\" *ngIf=\"property.error\">\n <ng-container *ngTemplateOutlet=\"propertyError; context: {property: property, edit: true}\"></ng-container>\n </div>\n\n <div class=\"mt-3\" *ngSwitchCase=\"false\">\n <p class=\"help py-1 px-2\" *ngIf=\"editable && !property.editable\">\n To change the {{property.key}}, please delete it first, then add the field again\n </p>\n <ng-container *ngIf=\"editable && property.editable\">\n <ng-container [ngSwitch]=\"property.schema?.title\">\n <p class=\"help py-1 px-2\" *ngSwitchCase=\"'Bibliography'\">\n Search by Title or Document DOI to auto-populate the fields using the Mendeley catalogue\n </p>\n </ng-container>\n </ng-container>\n\n <ng-container *ngTemplateOutlet=\"showNewProperty; context: {$implicit: property}\"></ng-container>\n\n <div class=\"px-3 mt-1\" *ngIf=\"errorsEditable\">\n <ng-container *ngTemplateOutlet=\"nodeErrorForm; context: {$implicit: property}\"></ng-container>\n </div>\n\n <div class=\"property-group py-2 px-3 mt-2\">\n <div class=\"columns is-multiline mb-0\">\n <ng-container *ngFor=\"let prop2 of property.properties; trackBy: trackByProperty\">\n <ng-container *ngTemplateOutlet=\"showProperty; context: {$implicit: prop2}\"></ng-container>\n </ng-container>\n </div>\n </div>\n </div>\n\n <div class=\"py-2 px-3 mt-2\" *ngSwitchCase=\"true\">\n <div class=\"mt-1\" *ngIf=\"errorsEditable\">\n <ng-container *ngTemplateOutlet=\"nodeErrorForm; context: {$implicit: property}\"></ng-container>\n </div>\n\n <ng-container *ngFor=\"let prop2 of property.properties; trackBy: trackByProperty\">\n <div class=\"card p-0 my-4\" *ngIf=\"prop2.key\"\n [id]=\"prop2.fullKey + '_' + prop2.id\"\n >\n <div class=\"property-array-number\">\n <div class=\"tags has-addons\">\n <span class=\"tag is-dark\">{{prop2.key}}</span>\n <ng-container *ngIf=\"editable && !errorsEditable && property.editable\">\n <span class=\"tag is-info\" pointer\n (click)=\"duplicateArrayGroup(property, prop2)\"\n [ngbTooltip]=\"'Duplicate ' + pluralize(property.key, 1)\" placement=\"top\"\n >\n <fa-icon icon=\"clone\" size=\"sm\"></fa-icon>\n </span>\n <span class=\"tag is-light\" pointer\n *ngIf=\"prop2.key !== '0'\"\n (click)=\"moveArrayGroupUp(property, prop2)\"\n ngbTooltip=\"Move Up\" placement=\"top\"\n >\n <fa-icon icon=\"long-arrow-alt-up\" size=\"sm\"></fa-icon>\n </span>\n <span class=\"tag is-light\" pointer\n *ngIf=\"prop2.key !== property.properties.length - 1\"\n (click)=\"moveArrayGroupDown(property, prop2)\"\n ngbTooltip=\"Move Down\" placement=\"top\"\n >\n <fa-icon icon=\"long-arrow-alt-down\" size=\"sm\"></fa-icon>\n </span>\n <he-popover-confirm class=\"tag is-delete\"\n [ngbTooltip]=\"'Remove ' + pluralize(property.key, 1)\" placement=\"top\"\n message=\"This will remove the group completely. Do you confirm?\" position=\"right\"\n (confirmed)=\"removeArrayGroup(property, prop2)\"\n ></he-popover-confirm>\n </ng-container>\n </div>\n </div>\n\n <ng-container *ngTemplateOutlet=\"showNewProperty; context: {$implicit: prop2}\"></ng-container>\n\n <div class=\"px-4 mt-2\" *ngIf=\"errorsEditable\">\n <ng-container *ngTemplateOutlet=\"nodeErrorForm; context: {$implicit: prop2}\"></ng-container>\n </div>\n\n <div class=\"px-4 mt-2\" *ngIf=\"prop2.error\">\n <ng-container *ngTemplateOutlet=\"propertyError; context: {property: prop2, edit: true}\"></ng-container>\n </div>\n\n <div class=\"property-group card-content p-3\">\n <div class=\"columns is-multiline my-0\">\n <ng-container *ngFor=\"let prop3 of prop2.properties; trackBy: trackByProperty\">\n <ng-container *ngTemplateOutlet=\"showProperty; context: {$implicit: prop3}\"></ng-container>\n </ng-container>\n </div>\n </div>\n </div>\n </ng-container>\n\n <button class=\"button is-dark is-outlined is-small\" type=\"button\"\n *ngIf=\"editable && !errorsEditable\"\n (click)=\"addArrayGroup(property)\"\n >\n <fa-icon icon=\"plus-circle\"></fa-icon>\n <span class=\"pl-2\">Add</span>\n <span class=\"pl-1\">{{property.key | pluralize:1}}</span>\n </button>\n </div>\n </ng-container>\n </div>\n </div>\n </div>\n </ng-container>\n</ng-template>\n\n<ng-template #inputForm let-property>\n <ng-container *ngIf=\"property.key\">\n <ng-container [ngSwitch]=\"property.suggestions?.type\">\n <ng-container *ngSwitchCase=\"'select'\">\n <ng-container *ngTemplateOutlet=\"inputSelect; context: {$implicit: property}\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <ng-container *ngTemplateOutlet=\"inputInput; context: {$implicit: property}\"></ng-container>\n </ng-container>\n </ng-container>\n </ng-container>\n</ng-template>\n\n<ng-template #inputInput let-property>\n <div class=\"field mb-0\" [class.has-addons]=\"hasAddons(property)\">\n <div class=\"control is-expanded\"\n [class.has-icons-right]=\"property.loading\"\n >\n <input class=\"input is-small search-input\"\n [class.is-dark]=\"property.key === 'type'\"\n [class.is-link]=\"errorMode && property.changed\"\n [class.is-danger]=\"(!property.changed && property.hasError) || isRequired(property)\"\n [class.is-warning]=\"!property.changed && property.hasWarning\"\n\n [(ngModel)]=\"property.value\" #propertyModel=\"ngModel\"\n [type]=\"property.schema?.type === 'number' ? 'number' : 'string'\"\n [id]=\"property.id\"\n name=\"randomname\"\n [readonly]=\"!editable || !property.editable || property.schema?.internal\"\n [placeholder]=\"property.placeholder\"\n [appTagsInput]=\"{enabled: editable && property.editable && property.schema?.type === 'array', items: property.schema?.items, delimiter: ';', allowDuplicates: true, placeholder: property.placeholder}\"\n (change)=\"propertyChanged($event.target.value, property)\"\n\n [pattern]=\"property.schema?.pattern\"\n [required]=\"property.fullKey.endsWith('id') && property.fullKey !== 'id'\"\n [min]=\"property.schema?.minimum\"\n [max]=\"property.schema?.maximum\"\n\n [ngbTypeahead]=\"propertySuggest(property.fullKey, property.suggestions?.type)\"\n [resultTemplate]=\"suggestion\"\n [inputFormatter]=\"formatter\"\n [focusFirst]=\"true\"\n (focus)=\"editable && property.editable && typeaheadFocus($event)\"\n (selectItem)=\"suggestionSelected($event.item, property)\"\n >\n\n <span class=\"icon is-small is-right has-text-grey-dark\" [class.is-hidden]=\"!property.loading\">\n <fa-icon icon=\"spinner\" [pulse]=\"true\" size=\"sm\"></fa-icon>\n </span>\n </div>\n <ng-container *ngTemplateOutlet=\"inputAddons; context: {$implicit: property}\"></ng-container>\n </div>\n <p class=\"help is-danger-light\"\n *ngIf=\"!property.hasError && propertyModel.invalid\"\n >\n <span *bindOnce=\"propertyModel.errors\" [innerHTML]=\"formatPropertyError(propertyModel.errors, property)\"></span>\n </p>\n</ng-template>\n\n<ng-template #inputSelect let-property>\n <div class=\"field mb-0\" [class.has-addons]=\"hasAddons(property)\">\n <div class=\"control is-expanded\">\n <div class=\"select is-small is-fullwidth\"\n [class.is-link]=\"errorMode && property.changed\"\n [class.is-danger]=\"(!property.changed && property.hasError) || isRequired(property)\"\n [class.is-warning]=\"!property.changed && property.hasWarning\"\n >\n <select\n [(ngModel)]=\"property.value\" #propertyModel=\"ngModel\"\n [id]=\"property.id\"\n name=\"randomname\"\n [disabled]=\"!editable || !property.editable || property.schema?.internal\"\n (change)=\"propertyChanged($event.target.value, property)\"\n >\n <option value=\"\">Select</option>\n <ng-container *bindOnce=\"property.suggestions\">\n <option *ngFor=\"let value of property.suggestions.values; trackBy: trackByIndex\" [value]=\"value\">{{value}}</option>\n </ng-container>\n </select>\n </div>\n </div>\n <ng-container *ngTemplateOutlet=\"inputAddons; context: {$implicit: property}\"></ng-container>\n </div>\n</ng-template>\n\n<ng-template #removeFieldAddon let-property>\n <div class=\"control\" *ngIf=\"!errorsEditable && !property.isRequired\">\n <a class=\"button is-small\" title=\"Remove field\"\n [class.is-outlined]=\"!property.changed && (property.hasError || property.hasWarning)\"\n [class.is-danger]=\"!property.changed && property.hasError\"\n [class.is-warning]=\"!property.changed && property.hasWarning\"\n (click)=\"$event.stopPropagation(); propertyChanged(null, property)\"\n >\n <fa-icon icon=\"times\"></fa-icon>\n </a>\n </div>\n</ng-template>\n\n<ng-template #inputAddons let-property>\n <he-popover-confirm class=\"control\"\n *ngIf=\"enableAddError(property)\"\n position=\"left\"\n [content]=\"popupErrorForm\"\n (confirmed)=\"addError(property, $event)\"\n >\n <span class=\"button is-small\">\n <fa-icon icon=\"comments\"></fa-icon>\n </span>\n </he-popover-confirm>\n\n <ng-container *ngIf=\"editable && property.editable\">\n <ng-container [ngSwitch]=\"property.schemaType\">\n <ng-container *ngSwitchCase=\"SchemaType.Actor\">\n <ng-container *ngTemplateOutlet=\"actorAddons; context: {$implicit: property}\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"SchemaType.Cycle\">\n <ng-container *ngTemplateOutlet=\"cycleAddons; context: {$implicit: property}\"></ng-container>\n </ng-container>\n </ng-container>\n <ng-container *bindOnce=\"property\">\n <div class=\"control\" *ngIf=\"mapDrawingModes(property).length\">\n <button class=\"button is-small\" title=\"Pick on Map\"\n (click)=\"mapDrawingProperty = property\"\n >\n <fa-icon icon=\"map-marked-alt\"></fa-icon>\n </button>\n </div>\n <div class=\"control\" *ngIf=\"bibliographiesSearchKey(property)\">\n <button class=\"button is-small\" title=\"Advanced Search\"\n (click)=\"bibliographiesSearchProperty = property\"\n >\n <fa-icon icon=\"search\"></fa-icon>\n </button>\n </div>\n </ng-container>\n\n <ng-container *ngTemplateOutlet=\"removeFieldAddon; context: {$implicit: property}\"></ng-container>\n </ng-container>\n <div class=\"control\" *ngIf=\"addPropertyEnabled(property)\">\n <a class=\"button is-small is-danger\" title=\"Add field\"\n (click)=\"$event.stopPropagation(); addMissingProperty(property)\"\n >\n <fa-icon icon=\"plus-circle\"></fa-icon>\n <span class=\"pl-2\">Add</span>\n </a>\n </div>\n <div class=\"control\" *ngIf=\"isRequired(property)\">\n <label class=\"button is-small is-danger\" [for]=\"property.id\"\n ngbTooltip=\"This field is required\" placement=\"top\"\n >\n <fa-icon icon=\"exclamation-triangle\"></fa-icon>\n </label>\n </div>\n <ng-container *ngIf=\"property.externalUrl?.url\">\n <div class=\"control\">\n <a class=\"button is-small\"\n [href]=\"property.externalUrl.url + (property.externalUrl.urlParamValue ? property.value : '')\"\n target=\"_blank\"\n [title]=\"property.externalUrl.title\"\n [ngClass]=\"{'is-dark is-outlined': property.key === 'type'}\"\n [attr.disabled]=\"property.externalUrl.urlParamValue && !property.value ? true : null\"\n >\n <fa-icon [icon]=\"property.externalUrl.icon || 'external-link-alt'\"></fa-icon>\n </a>\n </div>\n </ng-container>\n <ng-container *ngIf=\"unitConverterEnabled(property)\">\n <div class=\"control\">\n <button class=\"button is-small\" title=\"Open calculator\"\n [ngbPopover]=\"convertUnits\" autoClose=\"outside\"\n triggers=\"manual\" #p=\"ngbPopover\" placement=\"bottom\" container=\"body\"\n (click)=\"openUnitConverter(p, property)\"\n >\n <fa-icon icon=\"calculator\"></fa-icon>\n </button>\n </div>\n </ng-container>\n</ng-template>\n\n<ng-template #actorAddons let-property>\n <div class=\"control\" *ngIf=\"property.key === '@id'\">\n <button class=\"button is-small\" title=\"Add myself as Actor\"\n (click)=\"setUserActorId(property)\"\n >\n <fa-icon [icon]=\"['far', 'id-badge']\"></fa-icon>\n </button>\n </div>\n</ng-template>\n\n<ng-template #cycleAddons let-property>\n <div class=\"control\" *ngIf=\"property.key === 'cycleDuration'\">\n <button class=\"button is-small\" title=\"Calculate value from startDate and endDate\"\n (click)=\"calculateCycleDuration(property)\"\n [disabled]=\"!calculateCycleDurationEnabled(property)\"\n >\n <fa-icon icon=\"calculator\"></fa-icon>\n </button>\n </div>\n <div class=\"control\" *ngIf=\"property.key === 'startDate'\">\n <button class=\"button is-small\" title=\"Calculate value from endDate and cycleDuration\"\n (click)=\"calculateCycleStartDate(property)\"\n [disabled]=\"!calculateCycleStartDateEnabled(property)\"\n >\n <fa-icon icon=\"calculator\"></fa-icon>\n </button>\n </div>\n</ng-template>\n\n<ng-template #showNewProperty let-property>\n <header class=\"card-header\" *ngIf=\"editable && property.editable && (property.addPropertyEnabled || deepEditable); else padder\">\n <form class=\"py-3 px-4 is-flex-grow-1\" (submit)=\"addProperty(property)\" novalidate>\n <div class=\"field is-horizontal\">\n <div class=\"field-label is-small\">\n <label class=\"label\" [for]=\"property.id + '_new'\">\n <span>Add new field</span>\n </label>\n </div>\n <div class=\"field-body\">\n <div class=\"field has-addons\">\n <div class=\"control is-expanded\">\n <input class=\"input is-small\"\n [(ngModel)]=\"property.newProperty\"\n [id]=\"property.id + '_new'\"\n name=\"randomname\"\n placeholder=\"Search and select field from results\"\n\n [ngbTypeahead]=\"suggestNewProperty(property.fullKey)\"\n [resultTemplate]=\"suggestion\"\n [inputFormatter]=\"formatter\"\n [focusFirst]=\"false\"\n [editable]=\"false\"\n (focus)=\"typeaheadFocus($event)\"\n >\n </div>\n <div class=\"control\">\n <button class=\"button is-small\" type=\"submit\"\n [disabled]=\"!property.newProperty || !property.newProperty.name\"\n >\n <fa-icon icon=\"plus\"></fa-icon>\n <span class=\"pl-2\">Add</span>\n </button>\n </div>\n </div>\n </div>\n </div>\n </form>\n </header>\n</ng-template>\n\n<ng-template #propertyError let-property=\"property\" let-edit=\"edit\">\n <p class=\"help\"\n [class.is-danger]=\"property.hasError\"\n [class.is-warning]=\"property.hasWarning\"\n *ngIf=\"property.error\"\n >\n <span class=\"is-pre-wrap\" *bindOnce=\"property.error\" [innerHTML]=\"property.error.message\"></span>\n <a class=\"pl-2\"\n *ngIf=\"edit && errorsEditable && property.error.index >= 0\"\n (click)=\"editError(property)\"\n >\n <fa-icon class=\"pr-2\" icon=\"edit\"></fa-icon>\n <span>Edit</span>\n </a>\n <a class=\"pl-2\"\n *ngIf=\"(property.hasWarning || errorsEditable) && property.error.index >= 0\"\n (click)=\"resolveError(property)\"\n >\n <fa-icon class=\"pr-2\" icon=\"check\"></fa-icon>\n <span>Resolved</span>\n </a>\n </p>\n</ng-template>\n\n<ng-template #propertyMap let-property>\n <div class=\"panel is-default\" *ngIf=\"showMap\">\n <div class=\"open-group panel-heading py-0\"\n (click)=\"mapVisible = !mapVisible\" pointer\n [class.is-open]=\"mapVisible\"\n >\n <div class=\"columns is-mobile is-vcentered mb-0\">\n <span class=\"column is-narrow py-1 my-0\">\n <fa-icon icon=\"angle-down\" [class.is-hidden]=\"!mapVisible\"></fa-icon>\n <fa-icon icon=\"angle-right\" [class.is-hidden]=\"mapVisible\"></fa-icon>\n </span>\n <span class=\"column py-1 my-0\">\n <span class=\"is-size-6\">View on Map</span>\n </span>\n </div>\n </div>\n <div class=\"panel-block is-block p-0\" [class.is-hidden]=\"!mapVisible\">\n <he-sites-maps [sites]=\"[node]\" [showNotice]=\"false\"></he-sites-maps>\n </div>\n </div>\n</ng-template>\n\n<ng-template #nodeErrorForm let-property>\n <ng-container *ngIf=\"property.newError && property.editable\">\n <div class=\"field has-addons\">\n <div class=\"control\">\n <div class=\"select is-small\">\n <select [(ngModel)]=\"property.newError.level\">\n <option [value]=\"undefined\">Select Level</option>\n <option value=\"error\">Error</option>\n <option value=\"warning\">Warning</option>\n </select>\n </div>\n </div>\n <div class=\"control is-expanded\">\n <textarea class=\"textarea is-small\"\n [(ngModel)]=\"property.newError.message\"\n placeholder=\"Enter your message here\"\n rows=\"1\"\n ></textarea>\n </div>\n <div class=\"control\">\n <button class=\"button is-small\"\n [disabled]=\"!property.newError.level || !property.newError.message\"\n (click)=\"addError(property, property.newError)\"\n >\n <fa-icon icon=\"plus-circle\"></fa-icon>\n <span class=\"pl-2\">Add</span>\n </button>\n </div>\n </div>\n </ng-container>\n</ng-template>\n\n<ng-template #popupErrorForm let-data=\"data\">\n <div class=\"field has-addons\">\n <div class=\"control\">\n <div class=\"select\">\n <select [(ngModel)]=\"data.level\">\n <option [value]=\"undefined\">Select Level</option>\n <option value=\"error\">Error</option>\n <option value=\"warning\">Warning</option>\n </select>\n </div>\n </div>\n <div class=\"control\">\n <input class=\"input\"\n [(ngModel)]=\"data.message\"\n placeholder=\"Enter your message here\"\n >\n </div>\n </div>\n</ng-template>\n\n<ng-template #suggestion let-r=\"result\" let-t=\"term\">\n <ngb-highlight\n [title]=\"r.bibliography?.title || r.bibliography?.documentDOI || r.bibliography?.scopus || r.name\"\n [result]=\"r.bibliography?.title || r.bibliography?.documentDOI || r.bibliography?.scopus || r.name\"\n [term]=\"t\"\n ></ngb-highlight>\n</ng-template>\n\n<ng-template #padder>\n <div class=\"pt-1\"></div>\n</ng-template>\n\n<ng-template #convertUnits let-value=\"value\" let-term=\"term\" let-units=\"units\">\n <he-unit-converter [value]=\"value\" [term]=\"term\" [toUnits]=\"units\"></he-unit-converter>\n</ng-template>\n", styles: [".panel.is-default .panel-heading{background-color:#ededed;color:#363636}.card-toggle{left:0;position:absolute;top:0}@media screen and (max-width: 768px){.card-toggle{position:relative}}.card-toggle>fa-icon{display:inline-block;width:10px}.card{overflow:visible}.card .card{box-shadow:2px 2px #36363652,0 0 0 1px #36363652}.card .card>.card-header{box-shadow:0 2px 1px #36363652}.property-array-number{left:-4px;position:absolute;top:-12px}.property-array-number .tag.is-delete{border:1px solid rgba(54,54,54,.32)}.control>.button{height:100%}.is-danger-light{color:#f5758f}he-sites-maps{height:200px}\n"], components: [{ type: i1__namespace.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }, { type: NodeIconComponent, selector: "he-node-icon", inputs: ["type", "size"] }, { type: MapsDrawingConfirmComponent, selector: "he-maps-drawing-confirm", inputs: ["value", "modes", "center", "zoom"], outputs: ["closed"] }, { type: BibliographiesSearchConfirmComponent, selector: "he-bibliographies-search-confirm", inputs: ["search", "searchSources", "searchBibliographies", "searchBy"], outputs: ["closed"] }, { type: SchemaVersionLinkComponent, selector: "he-schema-version-link", inputs: ["node", "showExternalLink", "linkClass", "text"] }, { type: PopoverConfirmComponent, selector: "he-popover-confirm", inputs: ["message", "content", "position", "popoverClass"], outputs: ["confirmed"] }, { type: SitesMapsComponent, selector: "he-sites-maps", inputs: ["loadPolygons", "sites", "selected", "nodes", "center", "zoom", "showNotice"] }, { type: i10__namespace.NgbHighlight, selector: "ngb-highlight", inputs: ["highlightClass", "result", "term"] }, { type: UnitConverterComponent, selector: "he-unit-converter", inputs: ["term", "value", "fromUnits", "toUnits"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10__namespace.NgbPopover, selector: "[ngbPopover]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disablePopover", "popoverClass", "openDelay", "closeDelay", "ngbPopover", "popoverTitle"], outputs: ["shown", "hidden"], exportAs: ["ngbPopover"] }, { type: i6__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i6__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: BindOnceDirective, selector: "[bindOnce]", inputs: ["bindOnce"] }, { type: i10__namespace.NgbTooltip, selector: "[ngbTooltip]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disableTooltip", "tooltipClass", "openDelay", "closeDelay", "ngbTooltip"], outputs: ["shown", "hidden"], exportAs: ["ngbTooltip"] }, { type: i6__namespace.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i1__namespace$4.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: i10__namespace.NgbTypeahead, selector: "input[ngbTypeahead]", inputs: ["autocomplete", "placement", "container", "editable", "focusFirst", "showHint", "inputFormatter", "ngbTypeahead", "resultFormatter", "resultTemplate"], outputs: ["selectItem"], exportAs: ["ngbTypeahead"] }, { type: i1__namespace$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1__namespace$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: TagsInputDirective, selector: "[appTagsInput]", inputs: ["appTagsInput"] }, { type: i1__namespace$4.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { type: i1__namespace$4.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i1__namespace$4.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i1__namespace$4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1__namespace$4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i6__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1__namespace$4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1__namespace$4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1__namespace$4.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }], pipes: { "pluralize": PluralizePipe } });
|
|
8231
8168
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FilesFormComponent, decorators: [{
|
|
8232
8169
|
type: i0.Component,
|
|
8233
8170
|
args: [{
|
|
@@ -8477,9 +8414,10 @@
|
|
|
8477
8414
|
type: i0.Input
|
|
8478
8415
|
}] } });
|
|
8479
8416
|
|
|
8417
|
+
var isSelected = function (selected, v) { return selected.length === 0 || selected.includes(v['@id']); };
|
|
8480
8418
|
var impactValue = function (impact, values) { var _a; return (((_a = values[impact['@id']]) === null || _a === void 0 ? void 0 : _a.nodes[0]) || { value: 0 }).value; };
|
|
8481
8419
|
var impactName = function (impact, index) { return index + 1 + ". " + defaultLabel(impact); };
|
|
8482
|
-
var impactAssessmentDataset = function (values
|
|
8420
|
+
var impactAssessmentDataset = function (values, impact, index) {
|
|
8483
8421
|
var label = impactName(impact, index);
|
|
8484
8422
|
var color = itemColor(index);
|
|
8485
8423
|
var data = [impactValue(impact, values)];
|
|
@@ -8490,10 +8428,11 @@
|
|
|
8490
8428
|
backgroundColor: color,
|
|
8491
8429
|
borderColor: color
|
|
8492
8430
|
};
|
|
8493
|
-
};
|
|
8431
|
+
};
|
|
8494
8432
|
var ImpactAssessmentsIndicatorsChartComponent = /** @class */ (function () {
|
|
8495
8433
|
function ImpactAssessmentsIndicatorsChartComponent() {
|
|
8496
8434
|
this.impactAssessments = [];
|
|
8435
|
+
this.selected = [];
|
|
8497
8436
|
this.key = 'impacts';
|
|
8498
8437
|
this.indicatorPerImpactAssessment = {};
|
|
8499
8438
|
this.terms = [];
|
|
@@ -8505,6 +8444,9 @@
|
|
|
8505
8444
|
if ('impactAssessments' in changes && !changes.impactAssessments.firstChange) {
|
|
8506
8445
|
return this.init();
|
|
8507
8446
|
}
|
|
8447
|
+
if ('selected' in changes && !changes.selected.firstChange) {
|
|
8448
|
+
return this.init();
|
|
8449
|
+
}
|
|
8508
8450
|
};
|
|
8509
8451
|
ImpactAssessmentsIndicatorsChartComponent.prototype.termAllowed = function (term) {
|
|
8510
8452
|
var _a;
|
|
@@ -8512,13 +8454,14 @@
|
|
|
8512
8454
|
};
|
|
8513
8455
|
ImpactAssessmentsIndicatorsChartComponent.prototype.init = function () {
|
|
8514
8456
|
var _this = this;
|
|
8515
|
-
this.
|
|
8457
|
+
var impacts = this.impactAssessments.filter(function (v) { return isSelected(_this.selected, v); });
|
|
8458
|
+
this.indicatorPerImpactAssessment = groupNodesByTerm(impacts, this.key);
|
|
8516
8459
|
this.terms = Object.values(this.indicatorPerImpactAssessment)
|
|
8517
8460
|
.filter(function (_d) {
|
|
8518
8461
|
var term = _d.term, values = _d.values;
|
|
8519
8462
|
return _this.termAllowed(term) && Object.values(values).some(function (_d) {
|
|
8520
8463
|
var _e = __read(_d.nodes, 1), value = _e[0].value;
|
|
8521
|
-
return value
|
|
8464
|
+
return value >= 0;
|
|
8522
8465
|
});
|
|
8523
8466
|
})
|
|
8524
8467
|
.map(function (_d) {
|
|
@@ -8526,17 +8469,20 @@
|
|
|
8526
8469
|
return term;
|
|
8527
8470
|
});
|
|
8528
8471
|
this.selectedTerm = this.terms.includes(this.selectedTerm) ? this.selectedTerm : this.terms[0];
|
|
8529
|
-
return this.selectedTerm ? this.
|
|
8472
|
+
return this.selectedTerm ? this.updateChart() : null;
|
|
8530
8473
|
};
|
|
8531
|
-
ImpactAssessmentsIndicatorsChartComponent.prototype.
|
|
8474
|
+
ImpactAssessmentsIndicatorsChartComponent.prototype.updateChart = function () {
|
|
8475
|
+
var _this = this;
|
|
8532
8476
|
var _a, _b, _c;
|
|
8533
8477
|
var labels = [(_b = (_a = this.selectedTerm) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : ''];
|
|
8534
8478
|
var values = this.indicatorPerImpactAssessment[this.selectedTerm['@id']].values;
|
|
8535
|
-
var datasets = this.impactAssessments
|
|
8536
|
-
|
|
8537
|
-
|
|
8479
|
+
var datasets = this.impactAssessments
|
|
8480
|
+
.map(function (impact, index) { return isSelected(_this.selected, impact) ? impactAssessmentDataset(values, impact, index) : null; })
|
|
8481
|
+
.filter(Boolean);
|
|
8482
|
+
if (this.chart) {
|
|
8483
|
+
this.chart.destroy();
|
|
8538
8484
|
}
|
|
8539
|
-
this.
|
|
8485
|
+
this.chart = new chart_js.Chart((_c = this.chartRef) === null || _c === void 0 ? void 0 : _c.nativeElement, {
|
|
8540
8486
|
type: 'bar',
|
|
8541
8487
|
data: {
|
|
8542
8488
|
labels: labels,
|
|
@@ -8562,47 +8508,10 @@
|
|
|
8562
8508
|
}
|
|
8563
8509
|
});
|
|
8564
8510
|
};
|
|
8565
|
-
ImpactAssessmentsIndicatorsChartComponent.prototype.updatePieChart = function () {
|
|
8566
|
-
var _a, _b, _c;
|
|
8567
|
-
var values = this.indicatorPerImpactAssessment[this.selectedTerm['@id']].values;
|
|
8568
|
-
var labels = this.impactAssessments.map(impactName);
|
|
8569
|
-
var colors = this.impactAssessments.map(listColor);
|
|
8570
|
-
var data = this.impactAssessments.map(function (impact) { return impactValue(impact, values); });
|
|
8571
|
-
var datasets = [{
|
|
8572
|
-
label: (_b = (_a = this.selectedTerm) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : '',
|
|
8573
|
-
data: data,
|
|
8574
|
-
backgroundColor: colors,
|
|
8575
|
-
hoverOffset: 4
|
|
8576
|
-
}];
|
|
8577
|
-
if (this.pieChart) {
|
|
8578
|
-
this.pieChart.destroy();
|
|
8579
|
-
}
|
|
8580
|
-
this.pieChart = new chart_js.Chart((_c = this.pieChartRef) === null || _c === void 0 ? void 0 : _c.nativeElement, {
|
|
8581
|
-
type: 'pie',
|
|
8582
|
-
data: {
|
|
8583
|
-
labels: labels,
|
|
8584
|
-
datasets: datasets
|
|
8585
|
-
},
|
|
8586
|
-
options: {
|
|
8587
|
-
responsive: true,
|
|
8588
|
-
maintainAspectRatio: false,
|
|
8589
|
-
legend: {
|
|
8590
|
-
display: false
|
|
8591
|
-
},
|
|
8592
|
-
layout: {
|
|
8593
|
-
padding: 0
|
|
8594
|
-
}
|
|
8595
|
-
}
|
|
8596
|
-
});
|
|
8597
|
-
};
|
|
8598
|
-
ImpactAssessmentsIndicatorsChartComponent.prototype.updateCharts = function () {
|
|
8599
|
-
this.updateBarChart();
|
|
8600
|
-
this.updatePieChart();
|
|
8601
|
-
};
|
|
8602
8511
|
return ImpactAssessmentsIndicatorsChartComponent;
|
|
8603
8512
|
}());
|
|
8604
8513
|
ImpactAssessmentsIndicatorsChartComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ImpactAssessmentsIndicatorsChartComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
8605
|
-
ImpactAssessmentsIndicatorsChartComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ImpactAssessmentsIndicatorsChartComponent, selector: "he-impact-assessments-indicators-chart", inputs: { impactAssessments: "impactAssessments", key: "key", filterTermTypes: "filterTermTypes" }, viewQueries: [{ propertyName: "
|
|
8514
|
+
ImpactAssessmentsIndicatorsChartComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ImpactAssessmentsIndicatorsChartComponent, selector: "he-impact-assessments-indicators-chart", inputs: { impactAssessments: "impactAssessments", selected: "selected", key: "key", filterTermTypes: "filterTermTypes" }, viewQueries: [{ propertyName: "chartRef", first: true, predicate: ["chart"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div class=\"p-3\" [class.is-hidden]=\"!terms?.length\">\n <div class=\"field is-horizontal\">\n <div class=\"field-label is-normal\">\n <label class=\"label\" for=\"selectedTerm\">\n <span>Select a column</span>\n </label>\n </div>\n <div class=\"field-body\">\n <div class=\"control\">\n <div class=\"select is-small\">\n <select (change)=\"updateChart()\" [(ngModel)]=\"selectedTerm\" id=\"selectedTerm\">\n <option *ngFor=\"let term of terms\" [ngValue]=\"term\">{{term.name}}</option>\n </select>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"mt-1\">\n <div class=\"chart-container\">\n <canvas #chart></canvas>\n </div>\n </div>\n</div>\n", styles: [":host{display:block;overflow:visible}.chart-container{height:400px;position:relative}\n"], directives: [{ type: i1__namespace$4.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i1__namespace$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1__namespace$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1__namespace$4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1__namespace$4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }] });
|
|
8606
8515
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ImpactAssessmentsIndicatorsChartComponent, decorators: [{
|
|
8607
8516
|
type: i0.Component,
|
|
8608
8517
|
args: [{
|
|
@@ -8610,14 +8519,13 @@
|
|
|
8610
8519
|
templateUrl: './impact-assessments-indicators-chart.component.html',
|
|
8611
8520
|
styleUrls: ['./impact-assessments-indicators-chart.component.scss']
|
|
8612
8521
|
}]
|
|
8613
|
-
}], propDecorators: {
|
|
8614
|
-
type: i0.ViewChild,
|
|
8615
|
-
args: ['barChart']
|
|
8616
|
-
}], pieChartRef: [{
|
|
8522
|
+
}], propDecorators: { chartRef: [{
|
|
8617
8523
|
type: i0.ViewChild,
|
|
8618
|
-
args: ['
|
|
8524
|
+
args: ['chart']
|
|
8619
8525
|
}], impactAssessments: [{
|
|
8620
8526
|
type: i0.Input
|
|
8527
|
+
}], selected: [{
|
|
8528
|
+
type: i0.Input
|
|
8621
8529
|
}], key: [{
|
|
8622
8530
|
type: i0.Input
|
|
8623
8531
|
}], filterTermTypes: [{
|
|
@@ -8708,42 +8616,25 @@
|
|
|
8708
8616
|
View["logs"] = "logs";
|
|
8709
8617
|
})(View || (View = {}));
|
|
8710
8618
|
var ImpactAssessmentsProductsComponent = /** @class */ (function () {
|
|
8711
|
-
function ImpactAssessmentsProductsComponent(
|
|
8712
|
-
var _this = this;
|
|
8713
|
-
this.formBuilder = formBuilder;
|
|
8619
|
+
function ImpactAssessmentsProductsComponent(nodeService) {
|
|
8714
8620
|
this.nodeService = nodeService;
|
|
8715
|
-
this.searchService = searchService;
|
|
8716
|
-
this.toastService = toastService;
|
|
8717
8621
|
this.dataStateValues = {};
|
|
8718
8622
|
this.impactAssessments = [];
|
|
8623
|
+
this.selected = [];
|
|
8719
8624
|
this.key = 'impacts';
|
|
8720
|
-
this.enableCompare = true;
|
|
8721
8625
|
this.enableFilterMethodModel = false;
|
|
8626
|
+
this.loading = false;
|
|
8722
8627
|
this.propertyValue = propertyValue$1;
|
|
8723
|
-
this.itemColor = itemColor;
|
|
8724
8628
|
this.baseUrl = baseUrl();
|
|
8725
8629
|
this.showDownload = false;
|
|
8726
8630
|
this.View = View;
|
|
8727
8631
|
this.selectedView = View.table;
|
|
8728
8632
|
this.methodModels = [];
|
|
8729
8633
|
this.indicators = [];
|
|
8730
|
-
// Adding impacts to compare
|
|
8731
|
-
this.form = this.formBuilder.group({
|
|
8732
|
-
search: ['', i1$2.Validators.required]
|
|
8733
|
-
});
|
|
8734
|
-
this.selectedImpactAssessments = [];
|
|
8735
|
-
this.loading = false;
|
|
8736
|
-
this.suggesting = false;
|
|
8737
|
-
this.formatter = function (_b) {
|
|
8738
|
-
var id = _b["@id"];
|
|
8739
|
-
return id;
|
|
8740
|
-
};
|
|
8741
|
-
this.suggestImpactAssessment = function (text$) { return text$.pipe(operators.debounceTime(300), operators.distinctUntilChanged(), operators.tap(function () { return _this.suggesting = true; }), operators.switchMap(function (term) { return _this.suggest(term); }), operators.tap(function () { return _this.suggesting = false; })); };
|
|
8742
8634
|
}
|
|
8743
8635
|
ImpactAssessmentsProductsComponent.prototype.ngOnChanges = function (changes) {
|
|
8744
8636
|
if ('impactAssessments' in changes) {
|
|
8745
8637
|
this.dataStateValues[this.dataState] = changes.impactAssessments.currentValue.slice();
|
|
8746
|
-
this.selectAllImpacts();
|
|
8747
8638
|
return this.update();
|
|
8748
8639
|
}
|
|
8749
8640
|
if ('dataState' in changes) {
|
|
@@ -8845,6 +8736,9 @@
|
|
|
8845
8736
|
enumerable: false,
|
|
8846
8737
|
configurable: true
|
|
8847
8738
|
});
|
|
8739
|
+
ImpactAssessmentsProductsComponent.prototype.isSelected = function (impact) {
|
|
8740
|
+
return this.selected.length === 0 || this.selected.includes(impact['@id']);
|
|
8741
|
+
};
|
|
8848
8742
|
// Recalculation logs
|
|
8849
8743
|
ImpactAssessmentsProductsComponent.prototype.showRecalculationLogs = function () {
|
|
8850
8744
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -8864,122 +8758,10 @@
|
|
|
8864
8758
|
});
|
|
8865
8759
|
});
|
|
8866
8760
|
};
|
|
8867
|
-
// Compare
|
|
8868
|
-
ImpactAssessmentsProductsComponent.prototype.selectAllImpacts = function () {
|
|
8869
|
-
this.selectedImpactAssessments = this.impactAssessments.slice();
|
|
8870
|
-
};
|
|
8871
|
-
ImpactAssessmentsProductsComponent.prototype.unselectAllImpacts = function () {
|
|
8872
|
-
this.selectedImpactAssessments = [];
|
|
8873
|
-
};
|
|
8874
|
-
ImpactAssessmentsProductsComponent.prototype.toggleAllImpacts = function () {
|
|
8875
|
-
return this.selectedImpactAssessments.length ? this.selectAllImpacts() : this.unselectAllImpacts();
|
|
8876
|
-
};
|
|
8877
|
-
ImpactAssessmentsProductsComponent.prototype.selectImpact = function (impact) {
|
|
8878
|
-
this.selectedImpactAssessments = __spreadArray(__spreadArray([], __read(this.selectedImpactAssessments)), [
|
|
8879
|
-
impact
|
|
8880
|
-
]);
|
|
8881
|
-
};
|
|
8882
|
-
ImpactAssessmentsProductsComponent.prototype.unselectImpact = function (index) {
|
|
8883
|
-
this.selectedImpactAssessments.splice(index, 1);
|
|
8884
|
-
this.selectedImpactAssessments = this.selectedImpactAssessments.slice();
|
|
8885
|
-
};
|
|
8886
|
-
ImpactAssessmentsProductsComponent.prototype.toggleImpact = function (impact) {
|
|
8887
|
-
var index = this.selectedImpactAssessments.indexOf(impact);
|
|
8888
|
-
return index >= 0 ? this.unselectImpact(index) : this.selectImpact(impact);
|
|
8889
|
-
};
|
|
8890
|
-
ImpactAssessmentsProductsComponent.prototype.isSelected = function (impact) {
|
|
8891
|
-
return this.selectedImpactAssessments.includes(impact);
|
|
8892
|
-
};
|
|
8893
|
-
ImpactAssessmentsProductsComponent.prototype.suggest = function (term) {
|
|
8894
|
-
return term.length < MIN_TYPEAHEAD_LENGTH ?
|
|
8895
|
-
rxjs.of([]) :
|
|
8896
|
-
this.searchService.suggest(term, schema.NodeType.ImpactAssessment, [], {
|
|
8897
|
-
bool: {
|
|
8898
|
-
must: [
|
|
8899
|
-
matchType(schema.NodeType.ImpactAssessment),
|
|
8900
|
-
matchAggregatedQuery
|
|
8901
|
-
],
|
|
8902
|
-
must_not: this.impactAssessments.map(function (_b) {
|
|
8903
|
-
var id = _b["@id"];
|
|
8904
|
-
return matchExactQuery('@id', id);
|
|
8905
|
-
}),
|
|
8906
|
-
should: [
|
|
8907
|
-
matchPhraseQuery(term, 100, '@id', 'name', 'cycle.name'),
|
|
8908
|
-
matchPhrasePrefixQuery(term, 20, '@id', 'name', 'cycle.name'),
|
|
8909
|
-
matchBoolPrefixQuery(term, 10, '@id', 'name', 'cycle.name')
|
|
8910
|
-
],
|
|
8911
|
-
minimum_should_match: 1
|
|
8912
|
-
}
|
|
8913
|
-
}, 10, ['cycle.name', 'country.name', 'product.name', 'endDate']);
|
|
8914
|
-
};
|
|
8915
|
-
ImpactAssessmentsProductsComponent.prototype.loadImpact = function (id) {
|
|
8916
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
8917
|
-
var impact, _b, _c, _d, _e, _f;
|
|
8918
|
-
return __generator(this, function (_g) {
|
|
8919
|
-
switch (_g.label) {
|
|
8920
|
-
case 0: return [4 /*yield*/, this.nodeService.get({
|
|
8921
|
-
'@type': schema.NodeType.ImpactAssessment,
|
|
8922
|
-
'@id': id,
|
|
8923
|
-
dataState: api.DataState.recalculated
|
|
8924
|
-
}, false)];
|
|
8925
|
-
case 1:
|
|
8926
|
-
impact = _g.sent();
|
|
8927
|
-
if (!impact['@id']) return [3 /*break*/, 3];
|
|
8928
|
-
_d = (_c = Object).assign;
|
|
8929
|
-
_e = [Object.assign({}, impact)];
|
|
8930
|
-
_f = {};
|
|
8931
|
-
return [4 /*yield*/, this.fetchCycle(impact)];
|
|
8932
|
-
case 2:
|
|
8933
|
-
_b = _d.apply(_c, _e.concat([(_f.cycle = _g.sent(), _f)]));
|
|
8934
|
-
return [3 /*break*/, 4];
|
|
8935
|
-
case 3:
|
|
8936
|
-
_b = null;
|
|
8937
|
-
_g.label = 4;
|
|
8938
|
-
case 4: return [2 /*return*/, _b];
|
|
8939
|
-
}
|
|
8940
|
-
});
|
|
8941
|
-
});
|
|
8942
|
-
};
|
|
8943
|
-
ImpactAssessmentsProductsComponent.prototype.fetchCycle = function (_b) {
|
|
8944
|
-
var cycle = _b.cycle;
|
|
8945
|
-
return !cycle || cycle.name ? cycle : this.nodeService.get({
|
|
8946
|
-
'@type': schema.NodeType.Cycle,
|
|
8947
|
-
'@id': cycle['@id']
|
|
8948
|
-
});
|
|
8949
|
-
};
|
|
8950
|
-
ImpactAssessmentsProductsComponent.prototype.addImpact = function () {
|
|
8951
|
-
var _a;
|
|
8952
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
8953
|
-
var _b, id, name, impact;
|
|
8954
|
-
return __generator(this, function (_c) {
|
|
8955
|
-
switch (_c.label) {
|
|
8956
|
-
case 0:
|
|
8957
|
-
this.loading = true;
|
|
8958
|
-
_b = this.form.value.search, id = _b["@id"], name = _b.name;
|
|
8959
|
-
return [4 /*yield*/, this.loadImpact(id)];
|
|
8960
|
-
case 1:
|
|
8961
|
-
impact = _c.sent();
|
|
8962
|
-
if (impact) {
|
|
8963
|
-
this.impactAssessments = __spreadArray(__spreadArray([], __read(this.impactAssessments)), [
|
|
8964
|
-
impact
|
|
8965
|
-
]);
|
|
8966
|
-
this.selectImpact(impact);
|
|
8967
|
-
}
|
|
8968
|
-
else {
|
|
8969
|
-
this.toastService.error("Error while loading " + (name || id));
|
|
8970
|
-
}
|
|
8971
|
-
this.loading = false;
|
|
8972
|
-
(_a = this.form.get('search')) === null || _a === void 0 ? void 0 : _a.setValue('');
|
|
8973
|
-
this.form.updateValueAndValidity();
|
|
8974
|
-
return [2 /*return*/, this.update()];
|
|
8975
|
-
}
|
|
8976
|
-
});
|
|
8977
|
-
});
|
|
8978
|
-
};
|
|
8979
8761
|
return ImpactAssessmentsProductsComponent;
|
|
8980
8762
|
}());
|
|
8981
|
-
ImpactAssessmentsProductsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ImpactAssessmentsProductsComponent, deps: [{ token:
|
|
8982
|
-
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", enableCompare: "enableCompare", filterTermTypes: "filterTermTypes", enableFilterMethodModel: "enableFilterMethodModel" }, usesOnChanges: true, ngImport: i0__namespace, template: "<ng-container *ngIf=\"indicators.length; else emptyTable\">\n <div class=\"columns is-variable is-2 m-0\">\n <div class=\"column is-hidden-mobile\"></div>\n <div class=\"column is-narrow\">\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 && impactAssessments.length === 1\">\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 <div class=\"has-text-right mb-2\">\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\n <div class=\"table-container data-table-container mb-1\" *bindOnce=\"indicators\">\n <table class=\"table is-narrow data-table has-children-{{indicators.length + 1}}\">\n <thead>\n <tr>\n <th class=\"width-auto\">\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></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\">\n <a [href]=\"baseUrl + '/schema/ImpactAssessment#functionalUnit'\" target=\"_blank\">Functional unit:</a>\n <span class=\"pl-1\">1 kg</span>\n </th>\n <th>Product</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 <tr *ngFor=\"let impactAssessment of impactAssessments; trackBy: trackById; let i = index\">\n <td class=\"width-auto\" [attr.title]=\"impactName(impactAssessment)\" [style.border-left-color]=\"itemColor(i)\">\n <label *ngIf=\"enableCompare\" class=\"is-inline-block checkbox\">\n <input type=\"checkbox\" class=\"selector\"\n (change)=\"toggleImpact(impactAssessment)\"\n [checked]=\"isSelected(impactAssessment)\"\n >\n </label>\n <he-node-link class=\"is-inline-block\" [node]=\"impactAssessment\">\n <span class=\"is-nowrap has-text-ellipsis\">{{i + 1}}. {{impactName(impactAssessment)}}</span>\n </he-node-link>\n </td>\n <td [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']].nodes[0]\"\n key=\"value\"\n [state]=\"impactAssessment.aggregated ? 'aggregated' : undefined\"\n ></he-blank-node-state>\n </span>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n\n <he-blank-node-state-notice [dataState]=\"dataState\"></he-blank-node-state-notice>\n\n <form *ngIf=\"enableCompare\" class=\"mt-2\" [formGroup]=\"form\" (submit)=\"form.valid && addImpact()\">\n <div class=\"field has-addons\">\n <div class=\"control\">\n <span class=\"button is-small is-static\">Compare with Aggregated Impact Assessment</span>\n </div>\n <div class=\"control is-expanded\" [class.has-icons-right]=\"suggesting || loading\">\n <input class=\"input is-small\"\n placeholder=\"Search by name or id\"\n formControlName=\"search\" name=\"search\"\n\n [ngbTypeahead]=\"suggestImpactAssessment\"\n [inputFormatter]=\"formatter\"\n [resultTemplate]=\"suggestion\"\n [focusFirst]=\"true\"\n >\n <span class=\"icon is-small is-right has-text-grey-dark\" [class.is-hidden]=\"!(suggesting || loading)\">\n <fa-icon icon=\"spinner\" [pulse]=\"true\" size=\"sm\"></fa-icon>\n </span>\n </div>\n <div class=\"control\">\n <button class=\"button is-small\" type=\"submit\" [disabled]=\"suggesting || loading\">\n <fa-icon icon=\"plus\"></fa-icon>\n </button>\n </div>\n </div>\n </form>\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]=\"selectedImpactAssessments\"\n [filterTermTypes]=\"filterTermTypes\"\n ></he-impact-assessments-indicators-chart>\n\n <he-impact-assessments-products-logs *ngIf=\"selectedView === View.logs && !isOriginal\"\n [key]=\"key\"\n [impactAssessment]=\"impactAssessments[0]\"\n [filterTermTypes]=\"filterTermTypes\"\n [originalValues]=\"originalValues[0][key]\"\n [recalculatedValues]=\"impactAssessments[0][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=\"panel-block\">\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: ["label.checkbox{width:20px}td he-node-link{width:160px}table.data-table td:first-child{border-left-width:8px}\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: 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: i10__namespace.NgbHighlight, selector: "ngb-highlight", inputs: ["highlightClass", "result", "term"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: BindOnceDirective, selector: "[bindOnce]", inputs: ["bindOnce"] }, { type: i1__namespace$4.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i1__namespace$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1__namespace$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i1__namespace$4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1__namespace$4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10__namespace.NgbPopover, selector: "[ngbPopover]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disablePopover", "popoverClass", "openDelay", "closeDelay", "ngbPopover", "popoverTitle"], outputs: ["shown", "hidden"], exportAs: ["ngbPopover"] }, { type: i1__namespace$4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1__namespace$4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1__namespace$4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1__namespace$4.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: i10__namespace.NgbTypeahead, selector: "input[ngbTypeahead]", inputs: ["autocomplete", "placement", "container", "editable", "focusFirst", "showHint", "inputFormatter", "ngbTypeahead", "resultFormatter", "resultTemplate"], outputs: ["selectItem"], exportAs: ["ngbTypeahead"] }, { type: i1__namespace$4.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }], pipes: { "ellipsis": EllipsisPipe, "default": DefaultPipe, "precision": PrecisionPipe } });
|
|
8763
|
+
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 });
|
|
8764
|
+
ImpactAssessmentsProductsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ImpactAssessmentsProductsComponent, selector: "he-impact-assessments-products", inputs: { cycles: "cycles", impactAssessments: "impactAssessments", selected: "selected", key: "key", dataState: "dataState", filterTermTypes: "filterTermTypes", enableFilterMethodModel: "enableFilterMethodModel" }, usesOnChanges: true, ngImport: i0__namespace, template: "<ng-container *ngIf=\"indicators.length; else emptyTable\">\n <div class=\"columns is-variable is-2 m-0\">\n <div class=\"column is-hidden-mobile\"></div>\n <div class=\"column is-narrow\">\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 && impactAssessments.length === 1\">\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 <div class=\"has-text-right mb-2\">\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\n <div class=\"table-container data-table-container mb-1\">\n <table class=\"table is-narrow data-table has-children-{{indicators.length + 1}}\">\n <thead>\n <tr>\n <th class=\"width-auto\">\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></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\">\n <a [href]=\"baseUrl + '/schema/ImpactAssessment#functionalUnit'\" target=\"_blank\">Functional unit:</a>\n <span class=\"pl-1\">1 kg</span>\n </th>\n <th>Product</th>\n <th *ngFor=\"let indicator of indicators\"\n [attr.title]=\"indicator.value.term.units\"\n >{{indicator.value.term.units}}</th>\n </tr>\n </thead>\n <tbody>\n <ng-container *ngFor=\"let impactAssessment of impactAssessments; trackBy: trackById; let i = index\">\n <tr *ngIf=\"isSelected(impactAssessment)\">\n <td class=\"width-auto\" [attr.title]=\"impactName(impactAssessment)\">\n <he-node-link [node]=\"impactAssessment\">\n <span class=\"is-nowrap has-text-ellipsis\">{{i + 1}}. {{impactName(impactAssessment)}}</span>\n </he-node-link>\n </td>\n <td [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']].nodes[0]\"\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 </div>\n\n <he-blank-node-state-notice [dataState]=\"dataState\"></he-blank-node-state-notice>\n </div>\n\n <he-impact-assessments-indicator-breakdown-chart *ngIf=\"selectedView === View.breakdown\"\n [impactAssessment]=\"impactAssessments[0]\"\n [indicators]=\"impactAssessments[0][key]\"\n ></he-impact-assessments-indicator-breakdown-chart>\n\n <he-impact-assessments-indicators-chart *ngIf=\"impactAssessments.length > 1\" [class.is-hidden]=\"selectedView !== View.chart\"\n [key]=\"key\"\n [impactAssessments]=\"impactAssessments\" [selected]=\"selected\"\n [filterTermTypes]=\"filterTermTypes\"\n ></he-impact-assessments-indicators-chart>\n\n <he-impact-assessments-products-logs *ngIf=\"selectedView === View.logs && !isOriginal\"\n [key]=\"key\"\n [impactAssessment]=\"impactAssessments[0]\"\n [filterTermTypes]=\"filterTermTypes\"\n [originalValues]=\"originalValues[0][key]\"\n [recalculatedValues]=\"impactAssessments[0][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=\"panel-block\">\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}\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: NodeLinkComponent, selector: "he-node-link", inputs: ["node", "showExternalLink"] }, { type: BlankNodeStateComponent, selector: "he-blank-node-state", inputs: ["nodeType", "dataKey", "key", "node", "state"] }, { type: BlankNodeStateNoticeComponent, selector: "he-blank-node-state-notice", inputs: ["dataState", "showAggregated", "showDeleted", "showUnchanged"] }, { type: ImpactAssessmentsIndicatorBreakdownChartComponent, selector: "he-impact-assessments-indicator-breakdown-chart", inputs: ["impactAssessment", "indicators"] }, { type: ImpactAssessmentsIndicatorsChartComponent, selector: "he-impact-assessments-indicators-chart", inputs: ["impactAssessments", "selected", "key", "filterTermTypes"] }, { type: ImpactAssessmentsProductsLogsComponent, selector: "he-impact-assessments-products-logs", inputs: ["impactAssessment", "key", "filterTermTypes", "originalValues", "recalculatedValues"] }, { type: NodeCsvExportConfirmComponent, selector: "he-node-csv-export-confirm", inputs: ["nodes", "filename", "headerKeys", "extension", "isUpload"], outputs: ["closed"] }, { type: NodeValueDetailsComponent, selector: "he-node-value-details", inputs: ["data", "nodeType", "dataKey"] }, { type: i10__namespace.NgbHighlight, selector: "ngb-highlight", inputs: ["highlightClass", "result", "term"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1__namespace$4.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i1__namespace$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1__namespace$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i1__namespace$4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1__namespace$4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10__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 } });
|
|
8983
8765
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ImpactAssessmentsProductsComponent, decorators: [{
|
|
8984
8766
|
type: i0.Component,
|
|
8985
8767
|
args: [{
|
|
@@ -8987,16 +8769,16 @@
|
|
|
8987
8769
|
templateUrl: './impact-assessments-products.component.html',
|
|
8988
8770
|
styleUrls: ['./impact-assessments-products.component.scss']
|
|
8989
8771
|
}]
|
|
8990
|
-
}], ctorParameters: function () { return [{ type:
|
|
8772
|
+
}], ctorParameters: function () { return [{ type: HeNodeService }]; }, propDecorators: { cycles: [{
|
|
8991
8773
|
type: i0.Input
|
|
8992
8774
|
}], impactAssessments: [{
|
|
8993
8775
|
type: i0.Input
|
|
8776
|
+
}], selected: [{
|
|
8777
|
+
type: i0.Input
|
|
8994
8778
|
}], key: [{
|
|
8995
8779
|
type: i0.Input
|
|
8996
8780
|
}], dataState: [{
|
|
8997
8781
|
type: i0.Input
|
|
8998
|
-
}], enableCompare: [{
|
|
8999
|
-
type: i0.Input
|
|
9000
8782
|
}], filterTermTypes: [{
|
|
9001
8783
|
type: i0.Input
|
|
9002
8784
|
}], enableFilterMethodModel: [{
|
|
@@ -9105,7 +8887,6 @@
|
|
|
9105
8887
|
exports.CyclesPracticesComponent = CyclesPracticesComponent;
|
|
9106
8888
|
exports.CyclesPracticesLogsComponent = CyclesPracticesLogsComponent;
|
|
9107
8889
|
exports.CyclesResultComponent = CyclesResultComponent;
|
|
9108
|
-
exports.CyclesSuggestFormComponent = CyclesSuggestFormComponent;
|
|
9109
8890
|
exports.DefaultPipe = DefaultPipe;
|
|
9110
8891
|
exports.EllipsisPipe = EllipsisPipe;
|
|
9111
8892
|
exports.FilesFormComponent = FilesFormComponent;
|