@hestia-earth/ui-components 0.1.6 → 0.2.2
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 +143 -36
- package/bundles/hestia-earth-ui-components.umd.js.map +1 -1
- package/common/common.module.d.ts +8 -7
- package/common/index.d.ts +1 -0
- package/common/sort-by.pipe.d.ts +7 -0
- package/cycles/cycles-practices/cycles-practices.component.d.ts +1 -0
- package/cycles/cycles-practices-timeline/cycles-practices-timeline.component.d.ts +15 -0
- package/cycles/cycles.module.d.ts +7 -6
- package/cycles/index.d.ts +1 -0
- package/esm2015/common/blank-node-state-notice/blank-node-state-notice.component.js +2 -2
- package/esm2015/common/common.module.js +8 -4
- package/esm2015/common/index.js +2 -1
- package/esm2015/common/sort-by.pipe.js +17 -0
- package/esm2015/cycles/cycles-practices/cycles-practices.component.js +12 -10
- package/esm2015/cycles/cycles-practices-timeline/cycles-practices-timeline.component.js +38 -0
- package/esm2015/cycles/cycles.module.js +5 -1
- package/esm2015/cycles/index.js +2 -1
- package/esm2015/files/files-error.model.js +25 -3
- package/esm2015/fontawesome/fontawesome.module.js +3 -3
- package/esm2015/impact-assessments/impact-assessments-indicator-breakdown-chart/impact-assessments-indicator-breakdown-chart.component.js +38 -21
- package/esm2015/node/node-logs-models/node-logs-models.component.js +2 -2
- package/esm2015/node/node-value-details/node-value-details.component.js +2 -2
- package/esm2015/sites/sites-maps/sites-maps.component.js +6 -5
- package/esm2015/terms/terms.model.js +4 -1
- package/fesm2015/hestia-earth-ui-components.js +133 -36
- package/fesm2015/hestia-earth-ui-components.js.map +1 -1
- package/package.json +7 -7
|
@@ -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.faDotCircle, freeSolidSvgIcons.faDrawPolygon, freeSolidSvgIcons.faEdit, freeSolidSvgIcons.faEllipsisV, 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.faDotCircle, freeSolidSvgIcons.faDrawPolygon, freeSolidSvgIcons.faEdit, freeSolidSvgIcons.faEllipsisV, freeSolidSvgIcons.faExclamationTriangle, freeSolidSvgIcons.faExternalLinkAlt, freeSolidSvgIcons.faFilter, freeSolidSvgIcons.faList, freeSolidSvgIcons.faListAlt, 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);
|
|
396
396
|
}
|
|
397
397
|
return HeFontawesomeModule;
|
|
398
398
|
}());
|
|
@@ -901,6 +901,7 @@
|
|
|
901
901
|
schema.TermTermType.crop,
|
|
902
902
|
schema.TermTermType.cropResidue,
|
|
903
903
|
schema.TermTermType.excreta,
|
|
904
|
+
schema.TermTermType.grass,
|
|
904
905
|
schema.TermTermType.liveAnimal,
|
|
905
906
|
schema.TermTermType.liveAquaticSpecies,
|
|
906
907
|
schema.TermTermType.animalProduct,
|
|
@@ -939,6 +940,8 @@
|
|
|
939
940
|
schema.TermTermType.animalProduct,
|
|
940
941
|
schema.TermTermType.liveAnimal,
|
|
941
942
|
schema.TermTermType.liveAquaticSpecies,
|
|
943
|
+
schema.TermTermType.excreta,
|
|
944
|
+
schema.TermTermType.grass,
|
|
942
945
|
schema.TermTermType.processedFood,
|
|
943
946
|
schema.TermTermType.emission,
|
|
944
947
|
schema.TermTermType.resourceUse,
|
|
@@ -1687,7 +1690,7 @@
|
|
|
1687
1690
|
}
|
|
1688
1691
|
Object.defineProperty(BlankNodeStateNoticeComponent.prototype, "show", {
|
|
1689
1692
|
get: function () {
|
|
1690
|
-
return
|
|
1693
|
+
return this.dataState !== api.DataState.original;
|
|
1691
1694
|
},
|
|
1692
1695
|
enumerable: false,
|
|
1693
1696
|
configurable: true
|
|
@@ -4119,6 +4122,25 @@
|
|
|
4119
4122
|
}]
|
|
4120
4123
|
}] });
|
|
4121
4124
|
|
|
4125
|
+
var orderBy$6 = require('lodash.orderby');
|
|
4126
|
+
var SortByPipe = /** @class */ (function () {
|
|
4127
|
+
function SortByPipe() {
|
|
4128
|
+
}
|
|
4129
|
+
SortByPipe.prototype.transform = function (value, keys, orders) {
|
|
4130
|
+
if (orders === void 0) { orders = ['asc']; }
|
|
4131
|
+
return orderBy$6(value, keys, orders);
|
|
4132
|
+
};
|
|
4133
|
+
return SortByPipe;
|
|
4134
|
+
}());
|
|
4135
|
+
SortByPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SortByPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
|
|
4136
|
+
SortByPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SortByPipe, name: "sortBy" });
|
|
4137
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SortByPipe, decorators: [{
|
|
4138
|
+
type: i0.Pipe,
|
|
4139
|
+
args: [{
|
|
4140
|
+
name: 'sortBy'
|
|
4141
|
+
}]
|
|
4142
|
+
}] });
|
|
4143
|
+
|
|
4122
4144
|
var components$7 = [
|
|
4123
4145
|
BlankNodeStateComponent,
|
|
4124
4146
|
BlankNodeStateNoticeComponent,
|
|
@@ -4136,7 +4158,8 @@
|
|
|
4136
4158
|
TimesPipe,
|
|
4137
4159
|
ClickOutsideDirective,
|
|
4138
4160
|
GetPipe,
|
|
4139
|
-
IsArrayPipe
|
|
4161
|
+
IsArrayPipe,
|
|
4162
|
+
SortByPipe
|
|
4140
4163
|
];
|
|
4141
4164
|
var HeCommonModule = /** @class */ (function () {
|
|
4142
4165
|
function HeCommonModule() {
|
|
@@ -4160,7 +4183,8 @@
|
|
|
4160
4183
|
TimesPipe,
|
|
4161
4184
|
ClickOutsideDirective,
|
|
4162
4185
|
GetPipe,
|
|
4163
|
-
IsArrayPipe
|
|
4186
|
+
IsArrayPipe,
|
|
4187
|
+
SortByPipe], imports: [i2.CommonModule, i1$1.FormsModule, i5.RouterModule,
|
|
4164
4188
|
i11.NgbTypeaheadModule, i11.NgbTooltipModule, i11.NgbPopoverModule,
|
|
4165
4189
|
i1$4.GoogleMapsModule,
|
|
4166
4190
|
HeCommonLightModule], exports: [i11.NgbTypeaheadModule, i11.NgbTooltipModule, i11.NgbPopoverModule,
|
|
@@ -4181,7 +4205,8 @@
|
|
|
4181
4205
|
TimesPipe,
|
|
4182
4206
|
ClickOutsideDirective,
|
|
4183
4207
|
GetPipe,
|
|
4184
|
-
IsArrayPipe
|
|
4208
|
+
IsArrayPipe,
|
|
4209
|
+
SortByPipe] });
|
|
4185
4210
|
HeCommonModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeCommonModule, imports: [[
|
|
4186
4211
|
i2.CommonModule, i1$1.FormsModule, i5.RouterModule,
|
|
4187
4212
|
i11.NgbTypeaheadModule, i11.NgbTooltipModule, i11.NgbPopoverModule,
|
|
@@ -5843,7 +5868,7 @@
|
|
|
5843
5868
|
return NodeLogsModelsComponent;
|
|
5844
5869
|
}());
|
|
5845
5870
|
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 });
|
|
5846
|
-
NodeLogsModelsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: NodeLogsModelsComponent, selector: "he-node-logs-models", inputs: { nodeType: "nodeType", nodeKey: "nodeKey", includeAllModels: "includeAllModels", logsUrl: "logsUrl", originalValues: "originalValues", recalculatedValues: "recalculatedValues", terms: "terms", logs: "logs", 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 <he-data-table class=\"mb-1 is-small\" [small]=\"true\" [nbRows]=\"rowsCount\" maxHeight=\"320\">\n <table class=\"table is-narrow is-striped\">\n <thead>\n <tr>\n <th class=\"width-auto\">\n <div class=\"field\">\n <div class=\"control is-expanded has-icons-right\">\n <input class=\"input search-input is-small\"\n [(ngModel)]=\"term\" name=\"term\"\n placeholder=\"Filter by name\"\n [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>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 <tr *ngIf=\"!loading && blankNodes.length === 0\">\n <td class=\"has-text-centered\" colspan=\"5\">\n <span>No data</span>\n </td>\n </tr>\n <ng-container *ngFor=\"let blankNode of blankNodes; trackBy: trackByBlankNode\">\n <tr [class.has-sub-rows]=\"blankNode.canOpen\">\n <td class=\"width-auto\" [attr.title]=\"blankNode.term.name\">\n <a class=\"is-inline-block is-align-top pr-2 open-node\"\n (click)=\"blankNode.isOpen = !blankNode.isOpen\"\n *ngIf=\"blankNode.canOpen\"\n >\n <fa-icon icon=\"angle-down\" [class.is-hidden]=\"!blankNode.isOpen\"></fa-icon>\n <fa-icon icon=\"angle-right\" [class.is-hidden]=\"blankNode.isOpen\"></fa-icon>\n </a>\n <he-node-link class=\"is-inline-block\" [node]=\"blankNode.term\">\n <span class=\"is-nowrap has-text-ellipsis\">{{blankNode.term.name}}</span>\n </he-node-link>\n </td>\n <td>\n <span>{{blankNode.originalValue | precision:3 | default:'-'}}</span>\n </td>\n <td>\n <span *ngIf=\"!blankNode.isOriginal || blankNode.isRecalculated; else notRecalculated\">\n {{blankNode.recalculatedValue | precision:3 | default:'-'}}\n </span>\n </td>\n <td class=\"is-nowrap\">\n <he-blank-node-value-delta *ngIf=\"blankNode.original.length && blankNode.isRecalculated; else noValue\"\n [value]=\"blankNode.recalculatedValue\"\n [originalValue]=\"blankNode.originalValue\"\n ></he-blank-node-value-delta>\n </td>\n <ng-container *ngTemplateOutlet=\"blankNodeModels; context: {blankNode: blankNode}\"></ng-container>\n </tr>\n\n <ng-container *ngIf=\"blankNode.keys?.length\">\n <tr\n *ngFor=\"let subValue of blankNode.keys\"\n [class.is-hidden]=\"!blankNode.isOpen\"\n [class.has-sub-rows]=\"blankNode.subValues?.length\"\n >\n <td class=\"width-auto has-text-left\">\n <span class=\"is-inline-block is-align-top pl-3 pr-1 field-node\">Field:</span>\n\n <a class=\"is-inline-block\" *ngIf=\"blankNode.type\"\n [href]=\"baseUrl + '/schema/' + blankNode.type + '#' + subValue.key\" target=\"_blank\" [title]=\"subValue.key\"\n >\n <span class=\"is-nowrap has-text-ellipsis\">{{subValue.key}}</span>\n </a>\n <span class=\"is-inline-block is-align-top\" *ngIf=\"!blankNode.type\">{{subValue.key}}</span>\n </td>\n <td>\n <span *ngIf=\"subValue.originalValue !== null; else noValue\">{{subValue.originalValue | precision:3 | default:'-'}}</span>\n </td>\n <td>\n <span *ngIf=\"subValue.isRecalculated; else notRecalculated\">\n {{subValue.recalculatedValue | precision:3 | default:'-'}}\n </span>\n </td>\n <td>-</td>\n <td class=\"blank-node-index-key\">\n <ng-container *ngTemplateOutlet=\"blankNodeModel; context: {blankNode:blankNode, methodId:subValue.key, logs:getLogs(blankNode, subValue.key)}\"></ng-container>\n </td>\n <td *ngIf=\"methodModelsCount > 1\" [attr.colspan]=\"methodModelsCount - 1\"></td>\n </tr>\n </ng-container>\n\n <tr\n *ngFor=\"let subValue of blankNode.subValues\"\n [class.is-hidden]=\"!blankNode.isOpen\"\n >\n <td class=\"width-auto has-text-left\">\n <span class=\"is-inline-block is-align-top pl-3\">{{subValue.key | keyToLabel}}</span>\n\n <ng-container *ngIf=\"subValue.id\">\n <span class=\"is-inline-block\" class=\"is-inline-block is-align-top pr-1\">:</span>\n\n <ng-container [ngSwitch]=\"subValue.key\">\n <span class=\"is-inline-block\" *ngSwitchCase=\"'backgroundData'\">{{subValue.id | keyToLabel}}</span>\n <he-node-link *ngSwitchDefault class=\"is-block pl-4\" [node]=\"{'@type':'Term','@id':subValue.id}\" [attr.title]=\"subValue.id | keyToLabel\">\n <span class=\"is-nowrap has-text-ellipsis\">{{subValue.id | keyToLabel}}</span>\n </he-node-link>\n </ng-container>\n </ng-container>\n </td>\n <td>\n <span *ngIf=\"subValue.originalValue !== null; else noValue\">{{subValue.originalValue | precision:3 | default:'-'}}</span>\n </td>\n <td>\n <span *ngIf=\"subValue.isRecalculated; else notRecalculated\">\n {{subValue.recalculatedValue | precision:3 | default:'-'}}\n </span>\n </td>\n <td>-</td>\n <ng-container *ngTemplateOutlet=\"blankNodeModels; context: {blankNode: blankNode, subValue: subValue}\"></ng-container>\n </tr>\n </ng-container>\n </tbody>\n </table>\n </he-data-table>\n\n <div class=\"is-size-7 is-italic\">\n <div class=\"columns is-variable is-1 my-0\">\n <div class=\"column is-narrow\">\n <p>\n <a class=\"is-inline-block pr-2\"\n (click)=\"showLegend = !showLegend\"\n >\n <fa-icon icon=\"angle-down\" [class.is-hidden]=\"!showLegend\"></fa-icon>\n <fa-icon icon=\"angle-right\" [class.is-hidden]=\"showLegend\"></fa-icon>\n </a>\n <span class=\"is-inline-block\">Legend:</span>\n </p>\n <ul class=\"content pl-2\" [class.is-hidden]=\"!showLegend\">\n <li\n class=\"has-text-{{logColor[status.value]}}\"\n *ngFor=\"let status of LogStatus | keys\"\n >\n <fa-icon [icon]=\"logIcon[status.value]\"></fa-icon>\n <span class=\"pl-1\">{{status.value}}</span>\n </li>\n </ul>\n </div>\n <div class=\"column has-text-right\" *ngIf=\"filteredType\">\n <label class=\"is-inline-block checkbox\">\n <input type=\"checkbox\" class=\"selector\"\n [(ngModel)]=\"onlyWithData\"\n (change)=\"filterResults()\"\n >\n <span class=\"ml-2\">Show only relevant {{filteredType | pluralize}}</span>\n </label>\n </div>\n </div>\n </div>\n</div>\n\n<ng-template #blankNodeModels let-blankNode=\"blankNode\" let-subValue=\"subValue\">\n <td class=\"blank-node-index-{{i}}\" *ngFor=\"let c of methodModelsCount | times; let i = index\">\n <ng-container *ngIf=\"validSubValue(blankNode, i, subValue); else noValue\">\n <ng-container *ngIf=\"getMethodIdAt(blankNode, i, subValue); let methodId; else noValue\">\n <ng-template #modelSerie>\n <ng-container *ngTemplateOutlet=\"blankNodeModel; context: {blankNode:blankNode, methodId:methodId, subValue:subValue, logs:getLogs(blankNode, methodId, subValue)}\"></ng-container>\n </ng-template>\n <div *ngIf=\"methodId | isArray; else modelSerie\">\n <p *ngFor=\"let value of methodId\">\n <ng-container *ngTemplateOutlet=\"blankNodeModel; context: {blankNode:blankNode, methodId:value, subValue:subValue, logs:getLogs(blankNode, methodId, subValue)}\"></ng-container>\n </p>\n </div>\n </ng-container>\n </ng-container>\n </td>\n</ng-template>\n\n<ng-template #blankNodeModel let-blankNode=\"blankNode\" let-methodId=\"methodId\" let-subValue=\"subValue\" let-logs=\"logs\">\n <span\n [class.trigger-popover]=\"hasLogDetails(blankNode, methodId, subValue)\"\n [ngbPopover]=\"logDetails\" [autoClose]=\"'outside'\"\n triggers=\"manual\" #p=\"ngbPopover\" placement=\"left\" container=\"body\"\n (click)=\"hasLogDetails(blankNode, methodId, subValue) ? togglePopover(p, { logs }) : null\"\n >\n <span class=\"is-capitalized\">{{methodName(blankNode, methodId, subValue)}}</span>\n <span class=\"pl-1\" *ngIf=\"hasLog(logs) && logs?.methodTier\">[{{logs.methodTier}}]</span>\n <span class=\"pl-1 has-text-{{logColor[logStatus(blankNode, methodId, subValue)]}}\">\n <fa-icon [icon]=\"logIcon[logStatus(blankNode, methodId, subValue)]\"></fa-icon>\n </span>\n </span>\n</ng-template>\n\n<ng-template #noValue>-</ng-template>\n\n<ng-template #notRecalculated>not recalculated</ng-template>\n\n<ng-template #logDetails let-logs=\"logs\">\n <ng-container *ngIf=\"logs.requirements\">\n <p class=\"is-requirement\" *ngFor=\"let key of requirementKeys(logs.requirements)\" class=\"has-text-{{requirementColor(logs.requirements[key])}}\">\n {{key}}: {{logs.requirements[key]}}\n </p>\n </ng-container>\n <ng-container *ngIf=\"logs.logs\">\n <p class=\"is-log\" *ngFor=\"let key of logs.logs | keys\">\n {{key.key}}: {{key.value}}\n </p>\n </ng-container>\n <ng-container *ngIf=\"logs.missingLookups?.length\">\n <p class=\"mt-2\">Missing lookups:</p>\n\n <div class=\"table-container data-table-container\">\n <table class=\"table is-fullwidth mb-0\">\n <thead class=\"has-background-black\">\n <tr>\n <th>\n <span class=\"has-text-white\">Filename</span>\n </th>\n <th>\n <span class=\"has-text-white\">Column Title</span>\n </th>\n <th>\n <span class=\"has-text-white\">Row (term.id)</span>\n </th>\n </tr>\n </thead>\n <tbody class=\"has-background-black has-text-white\">\n <tr *ngFor=\"let data of logs.missingLookups\">\n <td>{{data.filename}}</td>\n <td>{{data.column}}</td>\n <td>{{data.termId}}</td>\n </tr>\n </tbody>\n </table>\n </div>\n </ng-container>\n</ng-template>\n", styles: [":host{display:block}::ng-deep tr.has-sub-rows td{border-bottom-style:dotted}::ng-deep td he-node-link{width:190px}::ng-deep td .open-node+he-node-link{width:170px}\n"], components: [{ type: i1__namespace.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }, { type: DataTableComponent, selector: "he-data-table", inputs: ["minHeight", "maxHeight", "nbRows", "small", "height", "width"] }, { type: NodeLinkComponent, selector: "he-node-link", inputs: ["node", "showExternalLink"] }, { type: BlankNodeValueDeltaComponent, selector: "he-blank-node-value-delta", inputs: ["value", "originalValue", "displayType"] }], directives: [{ type: i2__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1__namespace$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i11__namespace.NgbTypeahead, selector: "input[ngbTypeahead]", inputs: ["autocomplete", "placement", "container", "editable", "focusFirst", "showHint", "inputFormatter", "ngbTypeahead", "resultFormatter", "resultTemplate"], outputs: ["selectItem"], exportAs: ["ngbTypeahead"] }, { type: i1__namespace$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1__namespace$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i2__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i2__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i2__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i2__namespace.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i1__namespace$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { type: i11__namespace.NgbPopover, selector: "[ngbPopover]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disablePopover", "popoverClass", "openDelay", "closeDelay", "ngbPopover", "popoverTitle"], outputs: ["shown", "hidden"], exportAs: ["ngbPopover"] }], pipes: { "times": TimesPipe, "default": DefaultPipe, "precision": PrecisionPipe, "keyToLabel": KeyToLabelPipe, "keys": KeysPipe, "pluralize": PluralizePipe, "isArray": IsArrayPipe } });
|
|
5871
|
+
NodeLogsModelsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: NodeLogsModelsComponent, selector: "he-node-logs-models", inputs: { nodeType: "nodeType", nodeKey: "nodeKey", includeAllModels: "includeAllModels", logsUrl: "logsUrl", originalValues: "originalValues", recalculatedValues: "recalculatedValues", terms: "terms", logs: "logs", 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 <he-data-table class=\"mb-1 is-small\" [small]=\"true\" [nbRows]=\"rowsCount\" maxHeight=\"320\">\n <table class=\"table is-narrow is-striped\">\n <thead>\n <tr>\n <th class=\"width-auto\">\n <div class=\"field\">\n <div class=\"control is-expanded has-icons-right\">\n <input class=\"input search-input is-small\"\n [(ngModel)]=\"term\" name=\"term\"\n placeholder=\"Filter by name\"\n [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>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 <tr *ngIf=\"!loading && blankNodes.length === 0\">\n <td class=\"has-text-centered\" colspan=\"5\">\n <span>No data</span>\n </td>\n </tr>\n <ng-container *ngFor=\"let blankNode of blankNodes; trackBy: trackByBlankNode\">\n <tr [class.has-sub-rows]=\"blankNode.canOpen\">\n <td class=\"width-auto\" [attr.title]=\"blankNode.term.name\">\n <a class=\"is-inline-block is-align-top pr-2 open-node\"\n (click)=\"blankNode.isOpen = !blankNode.isOpen\"\n *ngIf=\"blankNode.canOpen\"\n >\n <fa-icon icon=\"angle-down\" [class.is-hidden]=\"!blankNode.isOpen\"></fa-icon>\n <fa-icon icon=\"angle-right\" [class.is-hidden]=\"blankNode.isOpen\"></fa-icon>\n </a>\n <he-node-link class=\"is-inline-block\" [node]=\"blankNode.term\">\n <span class=\"is-nowrap has-text-ellipsis\">{{blankNode.term.name}}</span>\n </he-node-link>\n </td>\n <td>\n <span>{{blankNode.originalValue | precision:3 | default:'-'}}</span>\n </td>\n <td>\n <span *ngIf=\"!blankNode.isOriginal || blankNode.isRecalculated; else notRecalculated\">\n {{blankNode.recalculatedValue | precision:3 | default:'-'}}\n </span>\n </td>\n <td class=\"is-nowrap\">\n <he-blank-node-value-delta *ngIf=\"blankNode.original.length && blankNode.isRecalculated; else noValue\"\n [value]=\"blankNode.recalculatedValue\"\n [originalValue]=\"blankNode.originalValue\"\n ></he-blank-node-value-delta>\n </td>\n <ng-container *ngTemplateOutlet=\"blankNodeModels; context: {blankNode: blankNode}\"></ng-container>\n </tr>\n\n <ng-container *ngIf=\"blankNode.keys?.length\">\n <tr\n *ngFor=\"let subValue of blankNode.keys\"\n [class.is-hidden]=\"!blankNode.isOpen\"\n [class.has-sub-rows]=\"blankNode.subValues?.length\"\n >\n <td class=\"width-auto has-text-left\">\n <span class=\"is-inline-block is-align-top pl-3 pr-1 field-node\">Field:</span>\n\n <a class=\"is-inline-block\" *ngIf=\"blankNode.type\"\n [href]=\"baseUrl + '/schema/' + blankNode.type + '#' + subValue.key\" target=\"_blank\" [title]=\"subValue.key\"\n >\n <span class=\"is-nowrap has-text-ellipsis\">{{subValue.key}}</span>\n </a>\n <span class=\"is-inline-block is-align-top\" *ngIf=\"!blankNode.type\">{{subValue.key}}</span>\n </td>\n <td>\n <span *ngIf=\"subValue.originalValue !== null; else noValue\">{{subValue.originalValue | precision:3 | default:'-'}}</span>\n </td>\n <td>\n <span *ngIf=\"subValue.isRecalculated; else notRecalculated\">\n {{subValue.recalculatedValue | precision:3 | default:'-'}}\n </span>\n </td>\n <td>-</td>\n <td class=\"blank-node-index-key\">\n <ng-container *ngTemplateOutlet=\"blankNodeModel; context: {blankNode:blankNode, methodId:subValue.key, logs:getLogs(blankNode, subValue.key)}\"></ng-container>\n </td>\n <td *ngIf=\"methodModelsCount > 1\" [attr.colspan]=\"methodModelsCount - 1\"></td>\n </tr>\n </ng-container>\n\n <tr\n *ngFor=\"let subValue of blankNode.subValues\"\n [class.is-hidden]=\"!blankNode.isOpen\"\n >\n <td class=\"width-auto has-text-left\">\n <span class=\"is-inline-block is-align-top pl-3\">{{subValue.key | keyToLabel}}</span>\n\n <ng-container *ngIf=\"subValue.id\">\n <span class=\"is-inline-block\" class=\"is-inline-block is-align-top pr-1\">:</span>\n\n <ng-container [ngSwitch]=\"subValue.key\">\n <span class=\"is-inline-block\" *ngSwitchCase=\"'backgroundData'\">{{subValue.id | keyToLabel}}</span>\n <he-node-link *ngSwitchDefault class=\"is-block pl-4\" [node]=\"{'@type':'Term','@id':subValue.id}\" [attr.title]=\"subValue.id | keyToLabel\">\n <span class=\"is-nowrap has-text-ellipsis\">{{subValue.id | keyToLabel}}</span>\n </he-node-link>\n </ng-container>\n </ng-container>\n </td>\n <td>\n <span *ngIf=\"subValue.originalValue !== null; else noValue\">{{subValue.originalValue | precision:3 | default:'-'}}</span>\n </td>\n <td>\n <span *ngIf=\"subValue.isRecalculated; else notRecalculated\">\n {{subValue.recalculatedValue | precision:3 | default:'-'}}\n </span>\n </td>\n <td>-</td>\n <ng-container *ngTemplateOutlet=\"blankNodeModels; context: {blankNode: blankNode, subValue: subValue}\"></ng-container>\n </tr>\n </ng-container>\n </tbody>\n </table>\n </he-data-table>\n\n <div class=\"is-size-7 is-italic\">\n <div class=\"columns is-variable is-1 my-0\">\n <div class=\"column is-narrow\">\n <p>\n <a class=\"is-inline-block pr-2\"\n (click)=\"showLegend = !showLegend\"\n >\n <fa-icon icon=\"angle-down\" [class.is-hidden]=\"!showLegend\"></fa-icon>\n <fa-icon icon=\"angle-right\" [class.is-hidden]=\"showLegend\"></fa-icon>\n </a>\n <span class=\"is-inline-block\">Legend:</span>\n </p>\n <ul class=\"content pl-2\" [class.is-hidden]=\"!showLegend\">\n <li\n class=\"has-text-{{logColor[status.value]}}\"\n *ngFor=\"let status of LogStatus | keys\"\n >\n <fa-icon [icon]=\"logIcon[status.value]\"></fa-icon>\n <span class=\"pl-1\">{{status.value}}</span>\n </li>\n </ul>\n </div>\n <div class=\"column has-text-right\" *ngIf=\"filteredType\">\n <label class=\"is-inline-block checkbox\">\n <input type=\"checkbox\" class=\"selector\"\n [(ngModel)]=\"onlyWithData\"\n (change)=\"filterResults()\"\n >\n <span class=\"ml-2\">Show only relevant {{filteredType | pluralize}}</span>\n </label>\n </div>\n </div>\n </div>\n</div>\n\n<ng-template #blankNodeModels let-blankNode=\"blankNode\" let-subValue=\"subValue\">\n <td class=\"blank-node-index-{{i}}\" *ngFor=\"let c of methodModelsCount | times; let i = index\">\n <ng-container *ngIf=\"validSubValue(blankNode, i, subValue); else noValue\">\n <ng-container *ngIf=\"getMethodIdAt(blankNode, i, subValue); let methodId; else noValue\">\n <ng-template #modelSerie>\n <ng-container *ngTemplateOutlet=\"blankNodeModel; context: {blankNode:blankNode, methodId:methodId, subValue:subValue, logs:getLogs(blankNode, methodId, subValue)}\"></ng-container>\n </ng-template>\n <div *ngIf=\"methodId | isArray; else modelSerie\">\n <p *ngFor=\"let value of methodId\">\n <ng-container *ngTemplateOutlet=\"blankNodeModel; context: {blankNode:blankNode, methodId:value, subValue:subValue, logs:getLogs(blankNode, methodId, subValue)}\"></ng-container>\n </p>\n </div>\n </ng-container>\n </ng-container>\n </td>\n</ng-template>\n\n<ng-template #blankNodeModel let-blankNode=\"blankNode\" let-methodId=\"methodId\" let-subValue=\"subValue\" let-logs=\"logs\">\n <span\n [class.trigger-popover]=\"hasLogDetails(blankNode, methodId, subValue)\"\n [ngbPopover]=\"logDetails\" [autoClose]=\"'outside'\"\n triggers=\"manual\" #p=\"ngbPopover\" placement=\"left\" container=\"body\"\n (click)=\"hasLogDetails(blankNode, methodId, subValue) ? togglePopover(p, { logs }) : null\"\n >\n <span class=\"is-capitalized\">{{methodName(blankNode, methodId, subValue)}}</span>\n <span class=\"pl-1\" *ngIf=\"hasLog(logs) && logs?.methodTier\">[{{logs.methodTier}}]</span>\n <span class=\"pl-1 has-text-{{logColor[logStatus(blankNode, methodId, subValue)]}}\">\n <fa-icon [icon]=\"logIcon[logStatus(blankNode, methodId, subValue)]\"></fa-icon>\n </span>\n </span>\n</ng-template>\n\n<ng-template #noValue>-</ng-template>\n\n<ng-template #notRecalculated>not recalculated</ng-template>\n\n<ng-template #logDetails let-logs=\"logs\">\n <ng-container *ngIf=\"logs.requirements\">\n <p class=\"is-requirement\" *ngFor=\"let key of requirementKeys(logs.requirements)\">\n {{key}}: {{logs.requirements[key]}}\n </p>\n </ng-container>\n <ng-container *ngIf=\"logs.logs\">\n <p class=\"is-log\" *ngFor=\"let key of logs.logs | keys\">\n {{key.key}}: {{key.value}}\n </p>\n </ng-container>\n <ng-container *ngIf=\"logs.missingLookups?.length\">\n <p class=\"mt-2\">Missing lookups:</p>\n\n <div class=\"table-container data-table-container\">\n <table class=\"table is-fullwidth mb-0\">\n <thead class=\"has-background-black\">\n <tr>\n <th>\n <span class=\"has-text-white\">Filename</span>\n </th>\n <th>\n <span class=\"has-text-white\">Column Title</span>\n </th>\n <th>\n <span class=\"has-text-white\">Row (term.id)</span>\n </th>\n </tr>\n </thead>\n <tbody class=\"has-background-black has-text-white\">\n <tr *ngFor=\"let data of logs.missingLookups\">\n <td>{{data.filename}}</td>\n <td>{{data.column}}</td>\n <td>{{data.termId}}</td>\n </tr>\n </tbody>\n </table>\n </div>\n </ng-container>\n</ng-template>\n", styles: [":host{display:block}::ng-deep tr.has-sub-rows td{border-bottom-style:dotted}::ng-deep td he-node-link{width:190px}::ng-deep td .open-node+he-node-link{width:170px}\n"], components: [{ type: i1__namespace.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }, { type: DataTableComponent, selector: "he-data-table", inputs: ["minHeight", "maxHeight", "nbRows", "small", "height", "width"] }, { type: NodeLinkComponent, selector: "he-node-link", inputs: ["node", "showExternalLink"] }, { type: BlankNodeValueDeltaComponent, selector: "he-blank-node-value-delta", inputs: ["value", "originalValue", "displayType"] }], directives: [{ type: i2__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1__namespace$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i11__namespace.NgbTypeahead, selector: "input[ngbTypeahead]", inputs: ["autocomplete", "placement", "container", "editable", "focusFirst", "showHint", "inputFormatter", "ngbTypeahead", "resultFormatter", "resultTemplate"], outputs: ["selectItem"], exportAs: ["ngbTypeahead"] }, { type: i1__namespace$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1__namespace$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i2__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i2__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i2__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i2__namespace.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i1__namespace$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { type: i11__namespace.NgbPopover, selector: "[ngbPopover]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disablePopover", "popoverClass", "openDelay", "closeDelay", "ngbPopover", "popoverTitle"], outputs: ["shown", "hidden"], exportAs: ["ngbPopover"] }], pipes: { "times": TimesPipe, "default": DefaultPipe, "precision": PrecisionPipe, "keyToLabel": KeyToLabelPipe, "keys": KeysPipe, "pluralize": PluralizePipe, "isArray": IsArrayPipe } });
|
|
5847
5872
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: NodeLogsModelsComponent, decorators: [{
|
|
5848
5873
|
type: i0.Component,
|
|
5849
5874
|
args: [{
|
|
@@ -5917,7 +5942,7 @@
|
|
|
5917
5942
|
'impactAssessment'
|
|
5918
5943
|
];
|
|
5919
5944
|
var tableKeys = [
|
|
5920
|
-
'inputs', 'value', 'dates', 'methodModel', 'methodTier', 'statsDefinition'
|
|
5945
|
+
'inputs', 'transformation', 'value', 'dates', 'methodModel', 'methodTier', 'statsDefinition'
|
|
5921
5946
|
];
|
|
5922
5947
|
var NodeValueDetailsComponent = /** @class */ (function () {
|
|
5923
5948
|
function NodeValueDetailsComponent() {
|
|
@@ -6574,6 +6599,48 @@
|
|
|
6574
6599
|
type: i0.Input
|
|
6575
6600
|
}] } });
|
|
6576
6601
|
|
|
6602
|
+
var CyclesPracticesTimelineComponent = /** @class */ (function () {
|
|
6603
|
+
function CyclesPracticesTimelineComponent(el) {
|
|
6604
|
+
this.el = el;
|
|
6605
|
+
this.now = new Date();
|
|
6606
|
+
this.TermTermType = schema.TermTermType;
|
|
6607
|
+
}
|
|
6608
|
+
Object.defineProperty(CyclesPracticesTimelineComponent.prototype, "practices", {
|
|
6609
|
+
get: function () {
|
|
6610
|
+
return (this.cycle.practices || []).map(function (p) {
|
|
6611
|
+
var _a;
|
|
6612
|
+
return !p.startDate && ((_a = p.dates) === null || _a === void 0 ? void 0 : _a.length) ? Object.assign(Object.assign({}, p), { startDate: p.dates[0] }) : p;
|
|
6613
|
+
});
|
|
6614
|
+
},
|
|
6615
|
+
enumerable: false,
|
|
6616
|
+
configurable: true
|
|
6617
|
+
});
|
|
6618
|
+
CyclesPracticesTimelineComponent.prototype.trackByPractice = function (_index, _b) {
|
|
6619
|
+
var term = _b.term;
|
|
6620
|
+
return term['@id'];
|
|
6621
|
+
};
|
|
6622
|
+
Object.defineProperty(CyclesPracticesTimelineComponent.prototype, "lineWidth", {
|
|
6623
|
+
get: function () {
|
|
6624
|
+
return this.el.nativeElement.offsetWidth - 60;
|
|
6625
|
+
},
|
|
6626
|
+
enumerable: false,
|
|
6627
|
+
configurable: true
|
|
6628
|
+
});
|
|
6629
|
+
return CyclesPracticesTimelineComponent;
|
|
6630
|
+
}());
|
|
6631
|
+
CyclesPracticesTimelineComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesPracticesTimelineComponent, deps: [{ token: i0__namespace.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
6632
|
+
CyclesPracticesTimelineComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesPracticesTimelineComponent, selector: "he-cycles-practices-timeline", inputs: { cycle: "cycle" }, ngImport: i0__namespace, template: "<ul class=\"content pl-4 ml-4 pb-4\">\n <li class=\"is-relative m-0\"\n *ngFor=\"let practice of practices | sortBy:['startDate','endDate']:['asc','asc']; trackBy: trackByPractice\"\n >\n <div class=\"is-relative\"\n [style.width]=\"lineWidth + 'px'\"\n >\n <span *ngIf=\"practice.startDate\">{{practice.startDate | date:'YYYY-MM-dd'}}</span>\n <span *ngIf=\"!practice.startDate\">\n <ng-container *ngIf=\"practice.term?.termType === TermTermType.operation\">No date</ng-container>\n </span>\n <span class=\"px-1\"\n [class.is-invisible]=\"!practice.startDate || !practice.endDate\"\n >-</span>\n <span\n [class.is-invisible]=\"!practice.endDate\"\n >{{(practice.endDate || now) | date:'YYYY-MM-dd'}}</span>\n <span class=\"pl-4\">{{practice.term.name}}</span>\n <he-blank-node-state class=\"ml-1\"\n [node]=\"practice\"\n key=\"value\"\n ></he-blank-node-state>\n </div>\n </li>\n</ul>\n", styles: ["ul{max-height:400px;overflow-y:auto}ul li{width:4px;padding-top:20px;background:#485fc7}ul li:after{content:\"\";position:absolute;left:50%;bottom:2px;transform:translate(-50%);width:20px;height:20px;border-radius:50%;background:inherit}ul li>div{width:600px;margin-left:24px}ul li>div>span{display:inline-block}ul li>div>span:nth-child(1),ul li>div>span:nth-child(3){width:94px}\n"], components: [{ type: BlankNodeStateComponent, selector: "he-blank-node-state", inputs: ["nodeType", "dataKey", "key", "node", "state"] }], directives: [{ type: i2__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "sortBy": SortByPipe, "date": i2__namespace.DatePipe } });
|
|
6633
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesPracticesTimelineComponent, decorators: [{
|
|
6634
|
+
type: i0.Component,
|
|
6635
|
+
args: [{
|
|
6636
|
+
selector: 'he-cycles-practices-timeline',
|
|
6637
|
+
templateUrl: './cycles-practices-timeline.component.html',
|
|
6638
|
+
styleUrls: ['./cycles-practices-timeline.component.scss']
|
|
6639
|
+
}]
|
|
6640
|
+
}], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }]; }, propDecorators: { cycle: [{
|
|
6641
|
+
type: i0.Input
|
|
6642
|
+
}] } });
|
|
6643
|
+
|
|
6577
6644
|
var CyclesPracticesLogsComponent = /** @class */ (function () {
|
|
6578
6645
|
function CyclesPracticesLogsComponent(nodeService) {
|
|
6579
6646
|
this.nodeService = nodeService;
|
|
@@ -6630,6 +6697,7 @@
|
|
|
6630
6697
|
var View$2;
|
|
6631
6698
|
(function (View) {
|
|
6632
6699
|
View["table"] = "table";
|
|
6700
|
+
View["timeline"] = "timeline";
|
|
6633
6701
|
View["logs"] = "logs";
|
|
6634
6702
|
})(View$2 || (View$2 = {}));
|
|
6635
6703
|
var CyclesPracticesComponent = /** @class */ (function () {
|
|
@@ -6676,7 +6744,7 @@
|
|
|
6676
6744
|
return CyclesPracticesComponent;
|
|
6677
6745
|
}());
|
|
6678
6746
|
CyclesPracticesComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesPracticesComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
6679
|
-
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: "<div class=\"columns is-variable is-align-items-center is-2 m-0\">\n <div class=\"column is-hidden-mobile\"></div>\n <ng-container
|
|
6747
|
+
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: "<div class=\"columns is-variable is-align-items-center is-2 m-0\">\n <div class=\"column is-hidden-mobile\"></div>\n <ng-container *ngIf=\"selectedView === View.table && practices.length\">\n <div class=\"column is-narrow\">\n <button class=\"button is-dark is-outlined is-small\" (click)=\"showDownload = true\">\n <fa-icon icon=\"download\"></fa-icon>\n <span class=\"pl-2\">Download (CSV)</span>\n </button>\n </div>\n <div class=\"column is-narrow col-sep\"></div>\n </ng-container>\n <div class=\"column is-narrow\" *ngIf=\"cycles.length === 1\">\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\">\n <button class=\"button is-small\" [class.is-active]=\"selectedView === View.timeline\" (click)=\"selectedView = View.timeline\">\n <span class=\"icon is-small\">\n <fa-icon icon=\"list-alt\" aria-hidden=\"true\"></fa-icon>\n </span>\n <span>Timeline view</span>\n </button>\n </div>\n <div class=\"control\" *ngIf=\"!isOriginal\">\n <button class=\"button is-small\" [class.is-active]=\"selectedView === View.logs\" (click)=\"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 <ng-container *ngIf=\"practices.length; else emptyTable\">\n <he-data-table class=\"mb-1 is-small\" [small]=\"true\" [nbRows]=\"cycles.length\" maxHeight=\"320\">\n <table class=\"table is-narrow is-striped\">\n <thead>\n <tr>\n <th class=\"width-auto\"></th>\n <th class=\"has-border-right\"></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 class=\"has-border-right\">\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.term || cycle\">\n <span class=\"is-nowrap has-text-ellipsis\">{{i + 1}}. {{defaultLabel(cycle)}}</span>\n </he-node-link>\n </td>\n <td class=\"has-border-right\">\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']].node\"\n key=\"value\"\n ></he-blank-node-state>\n </span>\n </td>\n </tr>\n </ng-container>\n </tbody>\n </table>\n </he-data-table>\n\n <he-blank-node-state-notice [dataState]=\"dataState\" [showDeleted]=\"true\"></he-blank-node-state-notice>\n </ng-container>\n</div>\n\n<div class=\"px-3 pb-3\" *ngIf=\"selectedView === View.timeline\">\n <he-cycles-practices-timeline\n [cycle]=\"cycles[0]\"\n ></he-cycles-practices-timeline>\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\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=\"has-text-centered\">\n <span>No data</span>\n </div>\n</ng-template>\n\n<ng-template #emptyValue>\n <span>-</span>\n</ng-template>\n\n<ng-template #details let-node=\"cycle\" let-data=\"data\" let-key=\"key\">\n <p><b>{{defaultLabel(node)}}</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}he-data-table ::ng-deep .table thead tr th:nth-child(2),he-data-table ::ng-deep .table tbody tr td:nth-child(2){max-width:102px;width:102px}\n"], components: [{ type: i1__namespace.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }, { type: DataTableComponent, selector: "he-data-table", inputs: ["minHeight", "maxHeight", "nbRows", "small", "height", "width"] }, { type: NodeLinkComponent, selector: "he-node-link", inputs: ["node", "showExternalLink"] }, { type: 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: CyclesPracticesTimelineComponent, selector: "he-cycles-practices-timeline", inputs: ["cycle"] }, { 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: i2__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i11__namespace.NgbPopover, selector: "[ngbPopover]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disablePopover", "popoverClass", "openDelay", "closeDelay", "ngbPopover", "popoverTitle"], outputs: ["shown", "hidden"], exportAs: ["ngbPopover"] }], pipes: { "ellipsis": EllipsisPipe, "default": DefaultPipe, "precision": PrecisionPipe } });
|
|
6680
6748
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesPracticesComponent, decorators: [{
|
|
6681
6749
|
type: i0.Component,
|
|
6682
6750
|
args: [{
|
|
@@ -6821,6 +6889,7 @@
|
|
|
6821
6889
|
CyclesFunctionalUnitMeasureComponent,
|
|
6822
6890
|
CyclesPracticesComponent,
|
|
6823
6891
|
CyclesPracticesLogsComponent,
|
|
6892
|
+
CyclesPracticesTimelineComponent,
|
|
6824
6893
|
CyclesResultComponent
|
|
6825
6894
|
];
|
|
6826
6895
|
var HeCyclesModule = /** @class */ (function () {
|
|
@@ -6838,6 +6907,7 @@
|
|
|
6838
6907
|
CyclesFunctionalUnitMeasureComponent,
|
|
6839
6908
|
CyclesPracticesComponent,
|
|
6840
6909
|
CyclesPracticesLogsComponent,
|
|
6910
|
+
CyclesPracticesTimelineComponent,
|
|
6841
6911
|
CyclesResultComponent], imports: [i2.CommonModule, i1$1.FormsModule,
|
|
6842
6912
|
HeCommonModule,
|
|
6843
6913
|
HeNodeModule], exports: [CyclesActivityComponent,
|
|
@@ -6849,6 +6919,7 @@
|
|
|
6849
6919
|
CyclesFunctionalUnitMeasureComponent,
|
|
6850
6920
|
CyclesPracticesComponent,
|
|
6851
6921
|
CyclesPracticesLogsComponent,
|
|
6922
|
+
CyclesPracticesTimelineComponent,
|
|
6852
6923
|
CyclesResultComponent] });
|
|
6853
6924
|
HeCyclesModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeCyclesModule, imports: [[
|
|
6854
6925
|
i2.CommonModule, i1$1.FormsModule,
|
|
@@ -7086,7 +7157,7 @@
|
|
|
7086
7157
|
'should NOT have additional properties': function (_g, errorCount) {
|
|
7087
7158
|
var params = _g.params;
|
|
7088
7159
|
return errorCount === 1 ?
|
|
7089
|
-
"The following field does not exist: " + (params === null || params === void 0 ? void 0 : params.additionalProperty) :
|
|
7160
|
+
"The following field does not exist: " + (params === null || params === void 0 ? void 0 : params.additionalProperty) + " or is not allowed in this case." :
|
|
7090
7161
|
"should not have additional properties";
|
|
7091
7162
|
},
|
|
7092
7163
|
'should match pattern "^\\d{13}$"': function () { return "should be composed of 13 numbers"; },
|
|
@@ -7166,6 +7237,22 @@
|
|
|
7166
7237
|
_g['must be equal to previous product multiplied by the share'] = function () { return "Products from a transformation which are an Input in to the next transformation must follow the following rule:\n " + code('previous.product.value * current.previousTransformationShare / 100 == current.input.value'); },
|
|
7167
7238
|
_g['at least one Input must be a Product of the Cycle'] = function () { return "A Transformation converts a Product from a Cycle into another Product.\n Therefore, at least one Input into the Transformation must be a Product of the Cycle."; },
|
|
7168
7239
|
_g['must have only one entry with the same term.termType = excretaManagement'] = function () { return "There can only be one Practice of type excretaManagement in a Cycle.\n To represent multiple excreta management systems either use multiple Cycles and link them together,\n or use Transformations within a Cycle and link those together."; },
|
|
7240
|
+
_g['must add the linked inputs to the cycle'] = function (_g, errorCount) {
|
|
7241
|
+
var params = _g.params;
|
|
7242
|
+
var _a, _b;
|
|
7243
|
+
return (errorCount === 1 ?
|
|
7244
|
+
'You have stated some Emissions were created by some Inputs.' :
|
|
7245
|
+
"You have stated that " + code((_a = params === null || params === void 0 ? void 0 : params.term) === null || _a === void 0 ? void 0 : _a.name) + " was created by the following Inputs " + ((_b = params === null || params === void 0 ? void 0 : params.expected) === null || _b === void 0 ? void 0 : _b.map(function (e) { return code(e.name); }).join(' , '))) + ".\n However, these Inputs do not exist in the Cycle.\n Please add these Inputs, even if you do not have a value for them.";
|
|
7246
|
+
},
|
|
7247
|
+
_g['must add the linked transformations to the cycle'] = function (_g, errorCount) {
|
|
7248
|
+
var level = _g.level, params = _g.params;
|
|
7249
|
+
var _a, _b;
|
|
7250
|
+
return (errorCount === 1 ?
|
|
7251
|
+
'You have stated some Emissions were created by some Transformations.' :
|
|
7252
|
+
"You have specified that" + code((_a = params === null || params === void 0 ? void 0 : params.term) === null || _a === void 0 ? void 0 : _a.name) + " was created during a Transformation with the Term name " + code((_b = params === null || params === void 0 ? void 0 : params.expected) === null || _b === void 0 ? void 0 : _b.name) + ".") + ".\n However, we cannot find a Transformation within the Cycle with this Term name.\n " + (level === 'error' ?
|
|
7253
|
+
'Please check the Terms used in the Emissions and/or the Transformations.' :
|
|
7254
|
+
'You may want to add this Transformation.');
|
|
7255
|
+
},
|
|
7169
7256
|
_g['every item in the list should be unique'] = function (_g) {
|
|
7170
7257
|
var params = _g.params;
|
|
7171
7258
|
return "This Blank Node is duplicated. Every Blank Node should be unique.\n Uniqueness is determined by the following fields: " + ((params === null || params === void 0 ? void 0 : params.keys) || []).map(code).join(', ');
|
|
@@ -7220,6 +7307,7 @@
|
|
|
7220
7307
|
var params = _g.params;
|
|
7221
7308
|
return "We recommend adding a Source to all data items.\n This can be done by adding the " + code(params === null || params === void 0 ? void 0 : params.current) + " field.\n Sources can also be specified for each data item (i.e., each Input, Emission, Product, Practice, Measurement, or Infrastructure).";
|
|
7222
7309
|
},
|
|
7310
|
+
_g['cover crop cycle contains non cover crop product'] = function () { return "You have specified that this crop is a cover crop using a Practice.\n A cover crop is defined as \"a crop which is left in the field without any fraction harvested by the end of the Cycle\".\n The Products of this Cycle are incompatible with this crop being a cover crop.\n Please check the Products or the Practices."; },
|
|
7223
7311
|
_g);
|
|
7224
7312
|
var formatCustomErrorMessage = function (message, error, errorCount) {
|
|
7225
7313
|
if (errorCount === void 0) { errorCount = 1; }
|
|
@@ -8031,17 +8119,19 @@
|
|
|
8031
8119
|
});
|
|
8032
8120
|
};
|
|
8033
8121
|
SitesMapsComponent.prototype.centerMarker = function (marker) {
|
|
8122
|
+
var _this = this;
|
|
8034
8123
|
var center = marker.getPosition();
|
|
8035
8124
|
this.center = center ? { lat: center.lat(), lng: center.lng() } : defaultCenter;
|
|
8125
|
+
setTimeout(function () {
|
|
8126
|
+
_this.map.googleMap.setCenter(_this.center);
|
|
8127
|
+
});
|
|
8036
8128
|
};
|
|
8037
8129
|
SitesMapsComponent.prototype.centerPolygons = function (polygons) {
|
|
8038
8130
|
try {
|
|
8039
|
-
return polygons.length ? this.map.googleMap.fitBounds(polygonBounds(polygons)) : null;
|
|
8131
|
+
return (polygons === null || polygons === void 0 ? void 0 : polygons.length) ? this.map.googleMap.fitBounds(polygonBounds(polygons)) : null;
|
|
8040
8132
|
}
|
|
8041
8133
|
catch (err) {
|
|
8042
|
-
|
|
8043
|
-
this.map.googleMap.fitBounds(polygonBounds(polygons[0]));
|
|
8044
|
-
}
|
|
8134
|
+
return (polygons === null || polygons === void 0 ? void 0 : polygons.length) ? this.map.googleMap.fitBounds(polygonBounds(polygons[0])) : null;
|
|
8045
8135
|
}
|
|
8046
8136
|
};
|
|
8047
8137
|
SitesMapsComponent.prototype.addSiteMarkers = function (sites) {
|
|
@@ -8940,8 +9030,9 @@
|
|
|
8940
9030
|
}] });
|
|
8941
9031
|
|
|
8942
9032
|
var parseLog = function (data) { return ({
|
|
8943
|
-
|
|
8944
|
-
|
|
9033
|
+
modelId: data.model,
|
|
9034
|
+
impactTermId: data['key/term'] || data.term || data.indicator,
|
|
9035
|
+
emissionsResourceUseTermId: data.node,
|
|
8945
9036
|
coefficient: +data.coefficient,
|
|
8946
9037
|
value: +data.value * +data.coefficient
|
|
8947
9038
|
}); };
|
|
@@ -8949,23 +9040,31 @@
|
|
|
8949
9040
|
schema.TermTermType.emission,
|
|
8950
9041
|
schema.TermTermType.characterisedIndicator
|
|
8951
9042
|
];
|
|
8952
|
-
var toCsv = function (logs) { return __spreadArray([
|
|
9043
|
+
var toCsv = function (logs, impact) { return __spreadArray([
|
|
8953
9044
|
[
|
|
8954
|
-
'Model',
|
|
8955
9045
|
'Impact',
|
|
9046
|
+
'Impact Unit',
|
|
9047
|
+
'Method',
|
|
9048
|
+
'Emission',
|
|
8956
9049
|
'Value',
|
|
8957
9050
|
'Inputs',
|
|
8958
|
-
'Inputs value'
|
|
9051
|
+
'Inputs value',
|
|
9052
|
+
'Functional Unit'
|
|
8959
9053
|
].join(',')
|
|
8960
9054
|
], __read(logs
|
|
8961
|
-
.sort(function (a, b) { return a.
|
|
9055
|
+
.sort(function (a, b) { return a.impactTermId.localeCompare(b.impactTermId); })
|
|
8962
9056
|
.flatMap(function (_d) {
|
|
8963
|
-
var
|
|
9057
|
+
var impactTermId = _d.impactTermId, impactTermUnits = _d.impactTermUnits, modelId = _d.modelId, emissionsResourceUseTermId = _d.emissionsResourceUseTermId, value = _d.value, inputs = _d.inputs;
|
|
8964
9058
|
return __spreadArray([
|
|
8965
|
-
[
|
|
8966
|
-
], __read((inputs.map(function (v) { return [
|
|
9059
|
+
[impactTermId, impactTermUnits, modelId, emissionsResourceUseTermId, value, '', '']
|
|
9060
|
+
], __read((inputs.map(function (v) { return [impactTermId, impactTermUnits, modelId, emissionsResourceUseTermId, '', v.name, v.value]; }))));
|
|
8967
9061
|
})
|
|
8968
|
-
.map(function (v) {
|
|
9062
|
+
.map(function (v) {
|
|
9063
|
+
var _a;
|
|
9064
|
+
return __spreadArray(__spreadArray([], __read(v)), [
|
|
9065
|
+
(_a = impact.product) === null || _a === void 0 ? void 0 : _a.units
|
|
9066
|
+
]).join(',');
|
|
9067
|
+
}))).join('\n'); };
|
|
8969
9068
|
var ImpactAssessmentsIndicatorBreakdownChartComponent = /** @class */ (function () {
|
|
8970
9069
|
function ImpactAssessmentsIndicatorBreakdownChartComponent(ngZone, domSanitizer, searchService, nodeService) {
|
|
8971
9070
|
this.ngZone = ngZone;
|
|
@@ -8981,7 +9080,7 @@
|
|
|
8981
9080
|
}
|
|
8982
9081
|
ImpactAssessmentsIndicatorBreakdownChartComponent.prototype.ngOnInit = function () {
|
|
8983
9082
|
return __awaiter(this, void 0, void 0, function () {
|
|
8984
|
-
var _d,
|
|
9083
|
+
var _d, results;
|
|
8985
9084
|
var _this = this;
|
|
8986
9085
|
return __generator(this, function (_e) {
|
|
8987
9086
|
switch (_e.label) {
|
|
@@ -8997,18 +9096,24 @@
|
|
|
8997
9096
|
}), operators.map(function (_d) {
|
|
8998
9097
|
var data = _d.data;
|
|
8999
9098
|
return parseMessage(data.message);
|
|
9000
|
-
}), operators.filter(function (message) { return 'node' in message; }), operators.map(parseLog), operators.filter(function (log) { return !!log.
|
|
9099
|
+
}), operators.filter(function (message) { return 'node' in message; }), operators.map(parseLog), operators.filter(function (log) { return !!log.impactTermId && !!log.emissionsResourceUseTermId && !isNaN(log.value) && log.value > 0; }), operators.groupBy(function (log) { return [log.impactTermId, log.emissionsResourceUseTermId].join('/'); }), operators.mergeMap(function (group) { return group.pipe(operators.toArray()); }), operators.map(function (values) {
|
|
9100
|
+
var _a, _b;
|
|
9001
9101
|
var log = values[0];
|
|
9002
9102
|
var total = values.reduce(function (prev, curr) { return prev + curr.value; }, 0);
|
|
9003
|
-
var
|
|
9004
|
-
.filter(function (v) {
|
|
9103
|
+
var emissions = (_this.impactAssessment.emissionsResourceUse || [])
|
|
9104
|
+
.filter(function (v) { return v.term['@id'] === log.emissionsResourceUseTermId; });
|
|
9105
|
+
var inputs = emissions
|
|
9106
|
+
.filter(function (v) { var _a; return (_a = v.inputs) === null || _a === void 0 ? void 0 : _a.length; })
|
|
9005
9107
|
.map(function (v) { return ({ name: v.inputs.map(function (i) { return i['@id']; }).join(';'), value: v.value * log.coefficient }); });
|
|
9006
9108
|
var inputsValue = inputs.reduce(function (prev, curr) { return prev + curr.value; }, 0);
|
|
9007
|
-
|
|
9008
|
-
|
|
9109
|
+
var impacts = (_this.impactAssessment.impacts || [])
|
|
9110
|
+
.filter(function (v) { return v.term['@id'] === log.impactTermId; });
|
|
9111
|
+
// logs might exist but impact was not added => skip logs
|
|
9112
|
+
return impacts.length ? Object.assign(Object.assign({}, log), { impactTermUnits: (_b = (_a = impacts === null || impacts === void 0 ? void 0 : impacts[0]) === null || _a === void 0 ? void 0 : _a.term) === null || _b === void 0 ? void 0 : _b.units, value: total, inputs: inputs, inputsValue: inputsValue }) : null;
|
|
9113
|
+
}), operators.filter(function (log) { return !!log; }), operators.toArray()).toPromise()];
|
|
9009
9114
|
case 1:
|
|
9010
9115
|
_d.logs = (_e.sent());
|
|
9011
|
-
this.csvContent = this.domSanitizer.bypassSecurityTrustResourceUrl("data:text/html;charset=utf-8," + encodeURIComponent(toCsv(this.logs)));
|
|
9116
|
+
this.csvContent = this.domSanitizer.bypassSecurityTrustResourceUrl("data:text/html;charset=utf-8," + encodeURIComponent(toCsv(this.logs, this.impactAssessment)));
|
|
9012
9117
|
return [4 /*yield*/, this.searchService.search({
|
|
9013
9118
|
fields: ['@type', '@id', 'name'],
|
|
9014
9119
|
limit: 1000,
|
|
@@ -9023,8 +9128,8 @@
|
|
|
9023
9128
|
}
|
|
9024
9129
|
})];
|
|
9025
9130
|
case 2:
|
|
9026
|
-
|
|
9027
|
-
this.emissions =
|
|
9131
|
+
results = (_e.sent()).results;
|
|
9132
|
+
this.emissions = results;
|
|
9028
9133
|
this.loading = false;
|
|
9029
9134
|
this.selectedTerm = this.terms[0];
|
|
9030
9135
|
this.updateChart();
|
|
@@ -9045,16 +9150,16 @@
|
|
|
9045
9150
|
var _a, _b, _c;
|
|
9046
9151
|
var logs = this.logs
|
|
9047
9152
|
.filter(function (_d) {
|
|
9048
|
-
var
|
|
9049
|
-
return
|
|
9153
|
+
var impactTermId = _d.impactTermId;
|
|
9154
|
+
return impactTermId === _this.selectedTerm['@id'];
|
|
9050
9155
|
})
|
|
9051
9156
|
.sort(function (a, b) { return b.value - a.value; });
|
|
9052
9157
|
this.noData = logs.length === 0;
|
|
9053
9158
|
var total = logs.reduce(function (prev, curr) { return prev + curr.value; }, 0);
|
|
9054
9159
|
var labels = logs.map(function (_d) {
|
|
9055
|
-
var
|
|
9160
|
+
var emissionsResourceUseTermId = _d.emissionsResourceUseTermId;
|
|
9056
9161
|
var _a;
|
|
9057
|
-
return ((_a = _this.emissions.find(function (v) { return v['@id'] ===
|
|
9162
|
+
return ((_a = _this.emissions.find(function (v) { return v['@id'] === emissionsResourceUseTermId; })) === null || _a === void 0 ? void 0 : _a.name) || emissionsResourceUseTermId;
|
|
9058
9163
|
});
|
|
9059
9164
|
// display the breakdown by input
|
|
9060
9165
|
// const inputs = logs.flatMap(v => v.inputs.map(i => i.name));
|
|
@@ -9659,6 +9764,7 @@
|
|
|
9659
9764
|
exports.CyclesFunctionalUnitMeasureComponent = CyclesFunctionalUnitMeasureComponent;
|
|
9660
9765
|
exports.CyclesPracticesComponent = CyclesPracticesComponent;
|
|
9661
9766
|
exports.CyclesPracticesLogsComponent = CyclesPracticesLogsComponent;
|
|
9767
|
+
exports.CyclesPracticesTimelineComponent = CyclesPracticesTimelineComponent;
|
|
9662
9768
|
exports.CyclesResultComponent = CyclesResultComponent;
|
|
9663
9769
|
exports.DataTableComponent = DataTableComponent;
|
|
9664
9770
|
exports.DefaultPipe = DefaultPipe;
|
|
@@ -9724,6 +9830,7 @@
|
|
|
9724
9830
|
exports.SitesMeasurementsLogsComponent = SitesMeasurementsLogsComponent;
|
|
9725
9831
|
exports.SkeletonTextComponent = SkeletonTextComponent;
|
|
9726
9832
|
exports.SocialTagsComponent = SocialTagsComponent;
|
|
9833
|
+
exports.SortByPipe = SortByPipe;
|
|
9727
9834
|
exports.TagsInputDirective = TagsInputDirective;
|
|
9728
9835
|
exports.TimesPipe = TimesPipe;
|
|
9729
9836
|
exports.ToastComponent = ToastComponent;
|