@hestia-earth/ui-components 0.0.27 → 0.0.28
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 +118 -29
- package/bundles/hestia-earth-ui-components.umd.js.map +1 -1
- package/engine/engine-requirements-form/engine-requirements-form.component.d.ts +26 -0
- package/engine/engine.module.d.ts +6 -4
- package/engine/engine.service.d.ts +21 -2
- package/engine/index.d.ts +1 -0
- package/esm2015/cycles/cycles-activity-logs/cycles-activity-logs.component.js +3 -3
- package/esm2015/engine/engine-requirements-form/engine-requirements-form.component.js +75 -0
- package/esm2015/engine/engine.module.js +11 -6
- package/esm2015/engine/engine.service.js +19 -4
- package/esm2015/engine/index.js +2 -1
- package/esm2015/impact-assessments/impact-assessments-indicator-breakdown-chart/impact-assessments-indicator-breakdown-chart.component.js +2 -2
- package/esm2015/node/node-logs-models/node-logs-models.component.js +16 -16
- package/fesm2015/hestia-earth-ui-components.js +106 -27
- package/fesm2015/hestia-earth-ui-components.js.map +1 -1
- package/node/node-logs-models/node-logs-models.component.d.ts +3 -6
- package/package.json +1 -1
|
@@ -17,7 +17,7 @@ import { faAngleDoubleLeft, faAngleDoubleRight, faAngleDown, faAngleLeft, faAngl
|
|
|
17
17
|
import * as i1$1 from '@angular/platform-browser';
|
|
18
18
|
import { ReplaySubject, of, forkJoin, from, zip } from 'rxjs';
|
|
19
19
|
import { getColor } from 'random-material-color';
|
|
20
|
-
import { NodeType, isExpandable, TermTermType, EmissionMethodTier, nestedSearchableKeys, SchemaType, SCHEMA_VERSION, sortKeysByType, CycleFunctionalUnit, SiteSiteType, isTypeValid, isTypeNode, typeToSchemaType } from '@hestia-earth/schema';
|
|
20
|
+
import { NodeType, isExpandable, TermTermType, EmissionMethodTier, nestedSearchableKeys, SchemaType, SCHEMA_VERSION, sortKeysByType, CycleFunctionalUnit, productTermTermType, SiteSiteType, isTypeValid, isTypeNode, typeToSchemaType } from '@hestia-earth/schema';
|
|
21
21
|
import { fileToExt, nodeTypeToParam, DataState, SupportedExtensions } from '@hestia-earth/api';
|
|
22
22
|
import { keyToLabel, isUndefined, isNumber, toPrecision, toDashCase, isBoolean, ConvertUnits, converters, convertValue, isEmpty, isEqual, unique, diffInDays } from '@hestia-earth/utils';
|
|
23
23
|
import * as pluralize from 'pluralize';
|
|
@@ -913,6 +913,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
913
913
|
}]
|
|
914
914
|
}], ctorParameters: function () { return [{ type: i1$2.HttpClient }, { type: HeNodeService }]; } });
|
|
915
915
|
|
|
916
|
+
const HE_CALCULATIONS_BASE_URL = new InjectionToken('HE_CALCULATIONS_BASE_URL');
|
|
916
917
|
const HE_ORCHESTRATOR_BASE_URL = new InjectionToken('HE_ORCHESTRATOR_BASE_URL');
|
|
917
918
|
const engineGitUrl = () => `${gitHome}/hestia-engine-models/-/blob/${gitBranch()}`;
|
|
918
919
|
const engineRawUrl = () => `${gitRawBaseUrl}/hestia-engine-models/-/raw/${gitBranch()}`;
|
|
@@ -941,7 +942,8 @@ const pathToApiDocsPath = (model, term) => [
|
|
|
941
942
|
].filter(Boolean).join('-')
|
|
942
943
|
].join('/');
|
|
943
944
|
class HeEngineService {
|
|
944
|
-
constructor(_orchestratorBaseUrl, http) {
|
|
945
|
+
constructor(_calculationsBaseUrl, _orchestratorBaseUrl, http) {
|
|
946
|
+
this._calculationsBaseUrl = _calculationsBaseUrl;
|
|
945
947
|
this._orchestratorBaseUrl = _orchestratorBaseUrl;
|
|
946
948
|
this.http = http;
|
|
947
949
|
this.modelsLoading = false;
|
|
@@ -978,6 +980,16 @@ class HeEngineService {
|
|
|
978
980
|
model(model) {
|
|
979
981
|
return this.model$(model).pipe(take(1)).toPromise();
|
|
980
982
|
}
|
|
983
|
+
listModels(params) {
|
|
984
|
+
return this.http.get(`${this._calculationsBaseUrl}/models`, {
|
|
985
|
+
params: filterParams(params)
|
|
986
|
+
}).toPromise();
|
|
987
|
+
}
|
|
988
|
+
getRequirements(params) {
|
|
989
|
+
return this.http.get(`${this._calculationsBaseUrl}/requirements`, {
|
|
990
|
+
params: filterParams(params)
|
|
991
|
+
}).toPromise();
|
|
992
|
+
}
|
|
981
993
|
orchestratorConfigUrl(type) {
|
|
982
994
|
const configUrl = gitHome + this._orchestratorBaseUrl.substring(this._orchestratorBaseUrl.indexOf('hestia-earth') + 'hestia-earth'.length);
|
|
983
995
|
return type ? `${configUrl}/${type}.json` : configUrl.substring(0, configUrl.indexOf('/raw'));
|
|
@@ -988,7 +1000,7 @@ class HeEngineService {
|
|
|
988
1000
|
}).toPromise();
|
|
989
1001
|
}
|
|
990
1002
|
}
|
|
991
|
-
HeEngineService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HeEngineService, deps: [{ token: HE_ORCHESTRATOR_BASE_URL }, { token: i1$2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1003
|
+
HeEngineService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HeEngineService, deps: [{ token: HE_CALCULATIONS_BASE_URL }, { token: HE_ORCHESTRATOR_BASE_URL }, { token: i1$2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
992
1004
|
HeEngineService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HeEngineService, providedIn: 'root' });
|
|
993
1005
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HeEngineService, decorators: [{
|
|
994
1006
|
type: Injectable,
|
|
@@ -996,6 +1008,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
996
1008
|
providedIn: 'root'
|
|
997
1009
|
}]
|
|
998
1010
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
1011
|
+
type: Inject,
|
|
1012
|
+
args: [HE_CALCULATIONS_BASE_URL]
|
|
1013
|
+
}] }, { type: undefined, decorators: [{
|
|
999
1014
|
type: Inject,
|
|
1000
1015
|
args: [HE_ORCHESTRATOR_BASE_URL]
|
|
1001
1016
|
}] }, { type: i1$2.HttpClient }]; } });
|
|
@@ -4334,10 +4349,16 @@ const isRecalculated = (values, key = 'value') => values.some(v => ([
|
|
|
4334
4349
|
const blankNodeValueByKey = {
|
|
4335
4350
|
property: (values, _k, id) => {
|
|
4336
4351
|
var _a;
|
|
4337
|
-
return !!id && values.length
|
|
4352
|
+
return !!id && (values === null || values === void 0 ? void 0 : values.length)
|
|
4338
4353
|
? ((_a = (values[0].properties || []).find(p => p.term['@id'] === id)) === null || _a === void 0 ? void 0 : _a.value) || ''
|
|
4339
4354
|
: '';
|
|
4340
4355
|
},
|
|
4356
|
+
input: (values, _k, id) => {
|
|
4357
|
+
var _a;
|
|
4358
|
+
return !!id && (values === null || values === void 0 ? void 0 : values.length)
|
|
4359
|
+
? propertyValue$1((_a = values.find(({ inputs }) => inputs.some(input => input['@id'] === id))) === null || _a === void 0 ? void 0 : _a.value, id)
|
|
4360
|
+
: '';
|
|
4361
|
+
},
|
|
4341
4362
|
transformation: () => null,
|
|
4342
4363
|
default: (blankNodes, key) => {
|
|
4343
4364
|
const value = (blankNodes === null || blankNodes === void 0 ? void 0 : blankNodes.length) ? blankNodes[0][key] : null;
|
|
@@ -4353,9 +4374,7 @@ const logSubValues = (logs, original, recalculated) => Object.keys(logs)
|
|
|
4353
4374
|
.flatMap(key => [
|
|
4354
4375
|
logSubValue(logs, key, 'input'),
|
|
4355
4376
|
logSubValue(logs, key, 'property'),
|
|
4356
|
-
logSubValue(logs, key, 'transformation')
|
|
4357
|
-
// for background data without input, convert term to input so it is displayed below the term
|
|
4358
|
-
isBackgroundNoInput(logs, key) ? { key: 'backgroundData' } : undefined
|
|
4377
|
+
logSubValue(logs, key, 'transformation')
|
|
4359
4378
|
]
|
|
4360
4379
|
.flat()
|
|
4361
4380
|
.filter(Boolean)
|
|
@@ -4528,10 +4547,6 @@ class NodeLogsModelsComponent {
|
|
|
4528
4547
|
trackByBlankNode(_index, node) {
|
|
4529
4548
|
return node.termId;
|
|
4530
4549
|
}
|
|
4531
|
-
get showOriginalValue() {
|
|
4532
|
-
var _a;
|
|
4533
|
-
return (_a = this.originalValues) === null || _a === void 0 ? void 0 : _a.length;
|
|
4534
|
-
}
|
|
4535
4550
|
keyValue(blankNodes, key) {
|
|
4536
4551
|
const value = (blankNodes === null || blankNodes === void 0 ? void 0 : blankNodes.length) ? blankNodes[0][key] : null;
|
|
4537
4552
|
return ['string', 'number', 'boolean'].includes(typeof value) ? (value || '') : null;
|
|
@@ -4546,13 +4561,13 @@ class NodeLogsModelsComponent {
|
|
|
4546
4561
|
});
|
|
4547
4562
|
}
|
|
4548
4563
|
/** Logs **/
|
|
4549
|
-
|
|
4550
|
-
|
|
4564
|
+
getSubvalueLogs(node, { id }) {
|
|
4565
|
+
// try to get a more precise logs, defaults to id otherwise
|
|
4566
|
+
return get$3(this.logs, [id, node.termId].join('.'), get$3(this.logs, id, {}));
|
|
4551
4567
|
}
|
|
4552
4568
|
getLogs(node, methodId, subValue) {
|
|
4553
|
-
|
|
4554
|
-
|
|
4555
|
-
: node.logs[methodId];
|
|
4569
|
+
const logs = (subValue === null || subValue === void 0 ? void 0 : subValue.key) ? this.getSubvalueLogs(node, subValue) : node.logs || {};
|
|
4570
|
+
return logs[methodId];
|
|
4556
4571
|
}
|
|
4557
4572
|
isBackground(log) {
|
|
4558
4573
|
return (log === null || log === void 0 ? void 0 : log.methodTier) === EmissionMethodTier.background;
|
|
@@ -4599,7 +4614,7 @@ class NodeLogsModelsComponent {
|
|
|
4599
4614
|
return [
|
|
4600
4615
|
LogStatus.success,
|
|
4601
4616
|
LogStatus.error
|
|
4602
|
-
].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));
|
|
4617
|
+
].includes(this.logStatus(node, methodId, subValue)) && ((log === null || log === void 0 ? void 0 : log.requirements) || (log === null || log === void 0 ? void 0 : log.logs) || ((_a = log === null || log === void 0 ? void 0 : log.missingLookups) === null || _a === void 0 ? void 0 : _a.length));
|
|
4603
4618
|
}
|
|
4604
4619
|
logStatus(node, methodId, subValue) {
|
|
4605
4620
|
const log = this.getLogs(node, methodId, subValue);
|
|
@@ -4623,7 +4638,7 @@ class NodeLogsModelsComponent {
|
|
|
4623
4638
|
}
|
|
4624
4639
|
}
|
|
4625
4640
|
NodeLogsModelsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NodeLogsModelsComponent, deps: [{ token: HeSearchService }, { token: HeEngineService }], target: i0.ɵɵFactoryTarget.Component });
|
|
4626
|
-
NodeLogsModelsComponent.ɵcmp = i0.ɵɵ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, 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=\"showOriginalValue\">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.originalValue | precision:3 | default:'-'}}</span>\n </td>\n <td>\n <span *ngIf=\"!blankNode.isOriginal || blankNode.isRecalculated; else notUpdated\">\n {{blankNode.recalculatedValue | precision:3 | default:'-'}}\n </span>\n </td>\n <td *ngIf=\"showOriginalValue\" class=\"is-nowrap\">\n <he-blank-node-value-delta *ngIf=\"blankNode.isRecalculated\"\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 *ngIf=\"showOriginalValue\">\n <span *ngIf=\"subValue.originalValue !== null\">{{subValue.originalValue | precision:3 | default:'-'}}</span>\n </td>\n <td>\n <span *ngIf=\"subValue.recalculatedValue !== null\">\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 *ngIf=\"showOriginalValue\">\n <span *ngIf=\"subValue.originalValue !== null\">{{subValue.originalValue | precision:3 | default:'-'}}</span>\n </td>\n <td>\n <span *ngIf=\"subValue.recalculatedValue !== null\">\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 </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-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 #notUpdated>\n <span>not updated</span>\n</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}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.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.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$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.NgbTypeahead, selector: "input[ngbTypeahead]", inputs: ["autocomplete", "placement", "container", "editable", "focusFirst", "showHint", "inputFormatter", "ngbTypeahead", "resultFormatter", "resultTemplate"], outputs: ["selectItem"], exportAs: ["ngbTypeahead"] }, { type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i6.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i6.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i6.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i1$4.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { type: i10.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 } });
|
|
4641
|
+
NodeLogsModelsComponent.ɵcmp = i0.ɵɵ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, 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>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.originalValue | precision:3 | default:'-'}}</span>\n </td>\n <td>\n <span *ngIf=\"!blankNode.isOriginal || blankNode.isRecalculated; else notUpdated\">\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.recalculatedValue !== null; else noValue\">\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.recalculatedValue !== null; else noValue\">\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 </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); 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 #notUpdated>\n <span>not updated</span>\n</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}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.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.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$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.NgbTypeahead, selector: "input[ngbTypeahead]", inputs: ["autocomplete", "placement", "container", "editable", "focusFirst", "showHint", "inputFormatter", "ngbTypeahead", "resultFormatter", "resultTemplate"], outputs: ["selectItem"], exportAs: ["ngbTypeahead"] }, { type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i6.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i6.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i6.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i1$4.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { type: i10.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 } });
|
|
4627
4642
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NodeLogsModelsComponent, decorators: [{
|
|
4628
4643
|
type: Component$1,
|
|
4629
4644
|
args: [{
|
|
@@ -4797,7 +4812,7 @@ class CyclesActivityLogsComponent {
|
|
|
4797
4812
|
this.loading = true;
|
|
4798
4813
|
this.NodeType = NodeType;
|
|
4799
4814
|
this.Tab = Tab;
|
|
4800
|
-
this.selectedTab = Tab.
|
|
4815
|
+
this.selectedTab = Tab.products;
|
|
4801
4816
|
}
|
|
4802
4817
|
ngOnInit() {
|
|
4803
4818
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -4811,7 +4826,7 @@ class CyclesActivityLogsComponent {
|
|
|
4811
4826
|
}
|
|
4812
4827
|
}
|
|
4813
4828
|
CyclesActivityLogsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CyclesActivityLogsComponent, deps: [{ token: HeNodeService }], target: i0.ɵɵFactoryTarget.Component });
|
|
4814
|
-
CyclesActivityLogsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesActivityLogsComponent, selector: "he-cycles-activity-logs", inputs: { original: "original", recalculated: "recalculated" }, ngImport: i0, template: "<ng-container *ngIf=\"!loading; else loader\">\n <div class=\"tabs mb-1\">\n <ul>\n <li [class.is-active]=\"selectedTab === Tab.
|
|
4829
|
+
CyclesActivityLogsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesActivityLogsComponent, selector: "he-cycles-activity-logs", inputs: { original: "original", recalculated: "recalculated" }, ngImport: i0, template: "<ng-container *ngIf=\"!loading; else loader\">\n <div class=\"tabs mb-1\">\n <ul>\n <li [class.is-active]=\"selectedTab === Tab.products\">\n <a (click)=\"selectedTab = Tab.products\">Products</a>\n </li>\n <li [class.is-active]=\"selectedTab === Tab.inputs\">\n <a (click)=\"selectedTab = Tab.inputs\">Inputs</a>\n </li>\n </ul>\n </div>\n\n <he-node-logs-models [class.is-hidden]=\"selectedTab !== Tab.products\"\n [logsUrl]=\"logsUrl\"\n [nodeType]=\"NodeType.Cycle\"\n [originalValues]=\"original?.products\"\n [recalculatedValues]=\"recalculated?.products\"\n [logs]=\"logs\"\n ></he-node-logs-models>\n\n <he-node-logs-models [class.is-hidden]=\"selectedTab !== Tab.inputs\"\n [logsUrl]=\"logsUrl\"\n [nodeType]=\"NodeType.Cycle\"\n [originalValues]=\"original?.inputs\"\n [recalculatedValues]=\"recalculated?.inputs\"\n [logs]=\"logs\"\n ></he-node-logs-models>\n</ng-container>\n\n\n<ng-template #loader>\n <div class=\"has-text-center py-3\">\n <fa-icon icon=\"spinner\" [pulse]=\"true\" size=\"lg\"></fa-icon>\n </div>\n</ng-template>\n", styles: [":host{display:block}\n"], components: [{ type: NodeLogsModelsComponent, selector: "he-node-logs-models", inputs: ["nodeType", "nodeKey", "logsUrl", "originalValues", "recalculatedValues", "terms", "logs", "filteredType"] }, { type: i1.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
4815
4830
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CyclesActivityLogsComponent, decorators: [{
|
|
4816
4831
|
type: Component$1,
|
|
4817
4832
|
args: [{
|
|
@@ -5450,17 +5465,81 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
5450
5465
|
type: Input
|
|
5451
5466
|
}] } });
|
|
5452
5467
|
|
|
5468
|
+
class EngineRequirementsFormComponent {
|
|
5469
|
+
constructor(formBuilder, searchService) {
|
|
5470
|
+
this.formBuilder = formBuilder;
|
|
5471
|
+
this.searchService = searchService;
|
|
5472
|
+
this.form = this.formBuilder.group({
|
|
5473
|
+
productTermId: [undefined],
|
|
5474
|
+
productTermType: [undefined],
|
|
5475
|
+
tier: [undefined],
|
|
5476
|
+
siteType: [undefined]
|
|
5477
|
+
});
|
|
5478
|
+
this.productTermTermType = productTermTermType.term;
|
|
5479
|
+
this.EmissionMethodTier = EmissionMethodTier;
|
|
5480
|
+
this.SiteSiteType = SiteSiteType;
|
|
5481
|
+
this.suggestingProductTermId = false;
|
|
5482
|
+
this.suggestProductTermId = (text$) => text$.pipe(debounceTime(300), distinctUntilChanged(), tap(() => this.suggestingProductTermId = true), switchMap(term => term.length < 1 ? [] : this.suggestTerm(term)), tap(() => this.suggestingProductTermId = false));
|
|
5483
|
+
this.inputFormatterProductTermId = ({ name }) => name;
|
|
5484
|
+
}
|
|
5485
|
+
suggestTerm(term) {
|
|
5486
|
+
return this.searchService.suggest(term, NodeType.Term, null, {
|
|
5487
|
+
bool: {
|
|
5488
|
+
must: [
|
|
5489
|
+
matchType(NodeType.Term),
|
|
5490
|
+
{
|
|
5491
|
+
bool: {
|
|
5492
|
+
should: suggestMatchQuery(term),
|
|
5493
|
+
minimum_should_match: 1
|
|
5494
|
+
}
|
|
5495
|
+
},
|
|
5496
|
+
{
|
|
5497
|
+
bool: {
|
|
5498
|
+
should: productTermTermType.term.map(matchTermType),
|
|
5499
|
+
minimum_should_match: 1
|
|
5500
|
+
}
|
|
5501
|
+
}
|
|
5502
|
+
]
|
|
5503
|
+
}
|
|
5504
|
+
});
|
|
5505
|
+
}
|
|
5506
|
+
/**
|
|
5507
|
+
* Return if form is valid.
|
|
5508
|
+
*/
|
|
5509
|
+
get valid() {
|
|
5510
|
+
return this.form ? !this.form.invalid : true;
|
|
5511
|
+
}
|
|
5512
|
+
formValue() {
|
|
5513
|
+
const _a = (this.form ? this.form.getRawValue() : { productTermId: undefined }), { productTermId } = _a, value = __rest(_a, ["productTermId"]);
|
|
5514
|
+
return Object.assign(Object.assign({}, value), (productTermId ? { productTermId: productTermId['@id'] } : {}) // selected as a JSON-LD Object
|
|
5515
|
+
);
|
|
5516
|
+
}
|
|
5517
|
+
}
|
|
5518
|
+
EngineRequirementsFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: EngineRequirementsFormComponent, deps: [{ token: i1$4.FormBuilder }, { token: HeSearchService }], target: i0.ɵɵFactoryTarget.Component });
|
|
5519
|
+
EngineRequirementsFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: EngineRequirementsFormComponent, selector: "he-engine-requirements-form", ngImport: i0, template: "<form class=\"needs-validation mt-3\" novalidate\n [formGroup]=\"form\"\n>\n <div class=\"field is-horizontal\">\n <div class=\"field-label is-normal\">\n <label class=\"label\" for=\"productTermId\">\n <span>Product Term ID</span>\n </label>\n </div>\n <div class=\"field-body\">\n <div class=\"field\">\n <div class=\"control is-expanded\" [class.has-icons-right]=\"suggestingProductTermId\">\n <input class=\"input\"\n formControlName=\"productTermId\" name=\"productTermId\"\n placeholder=\"Search product by ID or name\"\n [editable]=\"false\"\n [ngbTypeahead]=\"suggestProductTermId\"\n [resultTemplate]=\"suggestionProductTermId\"\n [inputFormatter]=\"inputFormatterProductTermId\"\n >\n <span class=\"icon is-right has-text-grey-dark\" [class.is-hidden]=\"!suggestingProductTermId\">\n <fa-icon icon=\"spinner\" [pulse]=\"true\"></fa-icon>\n </span>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"field is-horizontal mt-3\">\n <div class=\"field-label is-normal\">\n <label class=\"label\" for=\"productTermType\">\n <span>Product Term Type</span>\n </label>\n </div>\n <div class=\"field-body\">\n <div class=\"field\">\n <div class=\"control is-expanded\">\n <div class=\"select is-fullwidth\">\n <select formControlName=\"productTermType\" name=\"productTermType\">\n <option [ngValue]=\"undefined\">Select a Type</option>\n <option *ngFor=\"let termType of productTermTermType\" [value]=\"termType\">{{termType | keyToLabel}}</option>\n </select>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"field is-horizontal mt-3\">\n <div class=\"field-label is-normal\">\n <label class=\"label\" for=\"tier\">\n <span>Emissions Method Tier</span>\n </label>\n </div>\n <div class=\"field-body\">\n <div class=\"field\">\n <div class=\"control is-expanded\">\n <div class=\"select is-fullwidth\">\n <select formControlName=\"tier\" name=\"tier\">\n <option [ngValue]=\"undefined\">Select a Tier</option>\n <option *ngFor=\"let tier of EmissionMethodTier | keys\" [value]=\"tier.value\">{{tier.value}}</option>\n </select>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"field is-horizontal mt-3\">\n <div class=\"field-label is-normal\">\n <label class=\"label\" for=\"siteType\">\n <span>Site Type</span>\n </label>\n </div>\n <div class=\"field-body\">\n <div class=\"field\">\n <div class=\"control is-expanded\">\n <div class=\"select is-fullwidth\">\n <select formControlName=\"siteType\" name=\"siteType\">\n <option [ngValue]=\"undefined\">Select a Type</option>\n <option *ngFor=\"let siteType of SiteSiteType | keys\" [value]=\"siteType.value\">{{siteType.value}}</option>\n </select>\n </div>\n </div>\n </div>\n </div>\n </div>\n</form>\n\n<ng-template #suggestionProductTermId let-r=\"result\" let-t=\"term\">\n <ngb-highlight [result]=\"r.name\" [term]=\"t\"></ngb-highlight>\n</ng-template>\n", styles: [""], components: [{ type: i1.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }, { type: i10.NgbHighlight, selector: "ngb-highlight", inputs: ["highlightClass", "result", "term"] }], directives: [{ type: i1$4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1$4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1$4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1$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.NgbTypeahead, selector: "input[ngbTypeahead]", inputs: ["autocomplete", "placement", "container", "editable", "focusFirst", "showHint", "inputFormatter", "ngbTypeahead", "resultFormatter", "resultTemplate"], outputs: ["selectItem"], exportAs: ["ngbTypeahead"] }, { type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$4.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i1$4.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i1$4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1$4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "keyToLabel": KeyToLabelPipe, "keys": KeysPipe } });
|
|
5520
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: EngineRequirementsFormComponent, decorators: [{
|
|
5521
|
+
type: Component$1,
|
|
5522
|
+
args: [{
|
|
5523
|
+
selector: 'he-engine-requirements-form',
|
|
5524
|
+
templateUrl: './engine-requirements-form.component.html',
|
|
5525
|
+
styleUrls: ['./engine-requirements-form.component.scss']
|
|
5526
|
+
}]
|
|
5527
|
+
}], ctorParameters: function () { return [{ type: i1$4.FormBuilder }, { type: HeSearchService }]; } });
|
|
5528
|
+
|
|
5453
5529
|
const components$3 = [
|
|
5454
|
-
EngineOrchestratorEditComponent
|
|
5530
|
+
EngineOrchestratorEditComponent,
|
|
5531
|
+
EngineRequirementsFormComponent
|
|
5455
5532
|
];
|
|
5456
5533
|
class HeEngineModule {
|
|
5457
5534
|
}
|
|
5458
5535
|
HeEngineModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HeEngineModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
5459
|
-
HeEngineModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HeEngineModule, declarations: [EngineOrchestratorEditComponent
|
|
5536
|
+
HeEngineModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HeEngineModule, declarations: [EngineOrchestratorEditComponent,
|
|
5537
|
+
EngineRequirementsFormComponent], imports: [CommonModule, ReactiveFormsModule,
|
|
5460
5538
|
HeCommonModule,
|
|
5461
|
-
HeNodeModule], exports: [EngineOrchestratorEditComponent
|
|
5539
|
+
HeNodeModule], exports: [EngineOrchestratorEditComponent,
|
|
5540
|
+
EngineRequirementsFormComponent] });
|
|
5462
5541
|
HeEngineModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HeEngineModule, imports: [[
|
|
5463
|
-
CommonModule,
|
|
5542
|
+
CommonModule, ReactiveFormsModule,
|
|
5464
5543
|
HeCommonModule,
|
|
5465
5544
|
HeNodeModule
|
|
5466
5545
|
]] });
|
|
@@ -5470,7 +5549,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
5470
5549
|
declarations: components$3,
|
|
5471
5550
|
exports: components$3,
|
|
5472
5551
|
imports: [
|
|
5473
|
-
CommonModule,
|
|
5552
|
+
CommonModule, ReactiveFormsModule,
|
|
5474
5553
|
HeCommonModule,
|
|
5475
5554
|
HeNodeModule
|
|
5476
5555
|
]
|
|
@@ -7081,7 +7160,7 @@ class ImpactAssessmentsIndicatorBreakdownChartComponent {
|
|
|
7081
7160
|
ngOnInit() {
|
|
7082
7161
|
return __awaiter(this, void 0, void 0, function* () {
|
|
7083
7162
|
this.terms = this.indicators.map(({ term }) => term);
|
|
7084
|
-
this.logs = (yield of(Object.assign(Object.assign({}, this.impactAssessment), { dataState: DataState.recalculated })).pipe(mergeMap(node => this.nodeService.getLog(node)), map(value => value ? parseLines(value) : []), mergeAll(), filter(({ data }) => data.logger === 'hestia_earth.models' && data.level === Level.debug), map(({ data }) => parseMessage(data.message)), filter(message => 'node' in message), map(parseLog), filter(log => !isNaN(log.value) && log.value > 0), groupBy(log => [log.indicator, log.emission].join('/')), mergeMap(group => group.pipe(toArray())), map(values => {
|
|
7163
|
+
this.logs = (yield of(Object.assign(Object.assign({}, this.impactAssessment), { dataState: DataState.recalculated })).pipe(mergeMap(node => this.nodeService.getLog(node)), map(value => value ? parseLines(value) : []), mergeAll(), filter(({ data }) => data.logger === 'hestia_earth.models' && data.level === Level.debug), map(({ data }) => parseMessage(data.message)), filter(message => 'node' in message), map(parseLog), filter(log => !!log.indicator && !!log.emission && !isNaN(log.value) && log.value > 0), groupBy(log => [log.indicator, log.emission].join('/')), mergeMap(group => group.pipe(toArray())), map(values => {
|
|
7085
7164
|
const total = values.reduce((prev, curr) => prev + curr.value, 0);
|
|
7086
7165
|
return Object.assign(Object.assign({}, values[0]), { value: total });
|
|
7087
7166
|
}), toArray()).toPromise());
|
|
@@ -7551,5 +7630,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
7551
7630
|
* Generated bundle index. Do not edit.
|
|
7552
7631
|
*/
|
|
7553
7632
|
|
|
7554
|
-
export { ARRAY_DELIMITER, BibliographiesSearchConfirmComponent, BindOnceDirective, BlankNodeStateComponent, BlankNodeStateNoticeComponent, BlankNodeValueDeltaComponent, ClickOutsideDirective, ClipboardComponent, CyclesActivityComponent, CyclesActivityLogsComponent, CyclesCompletenessComponent, CyclesEmissionsChartComponent, CyclesEmissionsComponent, CyclesEmissionsLogsComponent, CyclesFunctionalUnitMeasureComponent, CyclesPracticesComponent, CyclesPracticesLogsComponent, CyclesResultComponent, DefaultPipe, DeltaColour, DiffsDisplayType, EllipsisPipe, EngineOrchestratorEditComponent, FilesFormComponent, GetPipe, HE_API_BASE_URL, HE_ORCHESTRATOR_BASE_URL, HeAggregationEngineService, HeAuthService, HeBibliographiesModule, HeCommonLightModule, HeCommonModule, HeCommonService, HeCyclesModule, HeEngineModule, HeEngineService, HeFilesModule, HeFontawesomeModule, HeImpactAssessmentsModule, HeMendeleyService, HeNodeCsvService, HeNodeModule, HeNodeService, HeSchemaService, HeSearchModule, HeSearchService, HeSitesModule, HeToastService, HeUsersService, ImpactAssessmentsIndicatorBreakdownChartComponent, ImpactAssessmentsIndicatorsChartComponent, ImpactAssessmentsProductsComponent, ImpactAssessmentsProductsLogsComponent, IsArrayPipe, KeyToLabelPipe, KeysPipe, Level, LinkKeyValueComponent, MAX_RESULTS, MapsDrawingConfirmComponent, MendeleySearchResult, NodeCsvExportConfirmComponent, NodeCsvSelectHeadersComponent, NodeDiffsComponent, NodeIconComponent, NodeLinkComponent, NodeLogsFileComponent, NodeLogsModelsComponent, NodeMissingLookupFactorsComponent, NodeValueDetailsComponent, PluralizePipe, PopoverComponent, PopoverConfirmComponent, PrecisionPipe, SchemaVersionLinkComponent, SitesMapsComponent, SitesMeasurementsComponent, SitesMeasurementsLogsComponent, SkeletonTextComponent, SocialTagsComponent, TagsInputDirective, TimesPipe, ToastComponent, UnitConverterComponent, addPolygonToFeature, allCountriesQuery, arrayValue, availableProperties, baseUrl, bottom, buildSummary, calculateCycleDuration, calculateCycleDurationEnabled, calculateCycleStartDate, calculateCycleStartDateEnabled, clustererImage, code, coordinatesToPoint, countriesQuery, createMarker, cropsQuery, dataPathToKey, defaultFeature, defaultLabel, defaultSuggestionType, definitionToSchemaType, deserializeSearchFilters, ellipsis, engineGitUrl, errorHasError, errorHasWarning, errorText, evaluateSuccess, filenameWithoutExt, fillColor, fillStyle, filterError, filterParams, findConfigModels, findProperty, findPropertyById, formatCustomErrorMessage, formatError, formatPropertyError, gitBranch, gitHome, gitRawBaseUrl, groupChanged, handleAPIError, hasError, hasWarning, isAddPropertyEnabled, isChrome, isExternal, isMissingOneOfError, isMissingPropertyError, isSchemaIri, isScrolledBelow, itemColor, keyToDataPath, levels, linkTypeEnabled, listColor, locationQuery, lookupUrl, lookups, mapsUrl, markerIcon, markerPie, matchAggregatedQuery, matchBoolPrefixQuery, matchCountry, matchExactQuery, matchGlobalRegion, matchNameNormalized, matchNestedKey, matchPhrasePrefixQuery, matchPhraseQuery, matchQuery, matchRegex, matchRegion, matchTermType, matchType, maxAreaSize, measurementValue, missingNodeErrorMessage, missingNodeErrors, multiMatchQuery, nestedProperty, nestingEnabled, nestingTypeEnabled, nodeAvailableProperties, nodeLink, nodeLogsUrl, nodeUrl, numberGte, parentKey, parentProperty, parseData, parseDataPath, parseLines, parseMessage, parseNewValue, pathToApiDocsPath, pointToCoordinates, polygonBounds, polygonToCoordinates, polygonsFromFeature, primaryProduct, propertyError, propertyId, recursiveProperties, refToSchemaType, refreshPropertyKeys, regionsQuery, repeat, safeJSONParse, safeJSONStringify, schemaRequiredProperties, schemaTypeToDefaultValue, scrollToEl, scrollTop, searchQuery, searchResultsFields, searchableTypes, serializeSearchFilters, siblingProperty, singleProperty, siteTooBig, sortOrder, sortProperties, strokeColor, strokeStyle, suggestMatchQuery, suggestQuery, termChildToParent, termLocation, termLocationName, termProperties, termTypeGroups, termTypeLabel, termTypeLookupUrl, toCsv$1 as toCsv, typeToNewProperty, updateProperties, valueTypeToDefault, waitFor, wildcardQuery, worldRegion };
|
|
7633
|
+
export { ARRAY_DELIMITER, BibliographiesSearchConfirmComponent, BindOnceDirective, BlankNodeStateComponent, BlankNodeStateNoticeComponent, BlankNodeValueDeltaComponent, ClickOutsideDirective, ClipboardComponent, CyclesActivityComponent, CyclesActivityLogsComponent, CyclesCompletenessComponent, CyclesEmissionsChartComponent, CyclesEmissionsComponent, CyclesEmissionsLogsComponent, CyclesFunctionalUnitMeasureComponent, CyclesPracticesComponent, CyclesPracticesLogsComponent, CyclesResultComponent, DefaultPipe, DeltaColour, DiffsDisplayType, EllipsisPipe, EngineOrchestratorEditComponent, EngineRequirementsFormComponent, FilesFormComponent, GetPipe, HE_API_BASE_URL, HE_CALCULATIONS_BASE_URL, HE_ORCHESTRATOR_BASE_URL, HeAggregationEngineService, HeAuthService, HeBibliographiesModule, HeCommonLightModule, HeCommonModule, HeCommonService, HeCyclesModule, HeEngineModule, HeEngineService, HeFilesModule, HeFontawesomeModule, HeImpactAssessmentsModule, HeMendeleyService, HeNodeCsvService, HeNodeModule, HeNodeService, HeSchemaService, HeSearchModule, HeSearchService, HeSitesModule, HeToastService, HeUsersService, ImpactAssessmentsIndicatorBreakdownChartComponent, ImpactAssessmentsIndicatorsChartComponent, ImpactAssessmentsProductsComponent, ImpactAssessmentsProductsLogsComponent, IsArrayPipe, KeyToLabelPipe, KeysPipe, Level, LinkKeyValueComponent, MAX_RESULTS, MapsDrawingConfirmComponent, MendeleySearchResult, NodeCsvExportConfirmComponent, NodeCsvSelectHeadersComponent, NodeDiffsComponent, NodeIconComponent, NodeLinkComponent, NodeLogsFileComponent, NodeLogsModelsComponent, NodeMissingLookupFactorsComponent, NodeValueDetailsComponent, PluralizePipe, PopoverComponent, PopoverConfirmComponent, PrecisionPipe, SchemaVersionLinkComponent, SitesMapsComponent, SitesMeasurementsComponent, SitesMeasurementsLogsComponent, SkeletonTextComponent, SocialTagsComponent, TagsInputDirective, TimesPipe, ToastComponent, UnitConverterComponent, addPolygonToFeature, allCountriesQuery, arrayValue, availableProperties, baseUrl, bottom, buildSummary, calculateCycleDuration, calculateCycleDurationEnabled, calculateCycleStartDate, calculateCycleStartDateEnabled, clustererImage, code, coordinatesToPoint, countriesQuery, createMarker, cropsQuery, dataPathToKey, defaultFeature, defaultLabel, defaultSuggestionType, definitionToSchemaType, deserializeSearchFilters, ellipsis, engineGitUrl, errorHasError, errorHasWarning, errorText, evaluateSuccess, filenameWithoutExt, fillColor, fillStyle, filterError, filterParams, findConfigModels, findProperty, findPropertyById, formatCustomErrorMessage, formatError, formatPropertyError, gitBranch, gitHome, gitRawBaseUrl, groupChanged, handleAPIError, hasError, hasWarning, isAddPropertyEnabled, isChrome, isExternal, isMissingOneOfError, isMissingPropertyError, isSchemaIri, isScrolledBelow, itemColor, keyToDataPath, levels, linkTypeEnabled, listColor, locationQuery, lookupUrl, lookups, mapsUrl, markerIcon, markerPie, matchAggregatedQuery, matchBoolPrefixQuery, matchCountry, matchExactQuery, matchGlobalRegion, matchNameNormalized, matchNestedKey, matchPhrasePrefixQuery, matchPhraseQuery, matchQuery, matchRegex, matchRegion, matchTermType, matchType, maxAreaSize, measurementValue, missingNodeErrorMessage, missingNodeErrors, multiMatchQuery, nestedProperty, nestingEnabled, nestingTypeEnabled, nodeAvailableProperties, nodeLink, nodeLogsUrl, nodeUrl, numberGte, parentKey, parentProperty, parseData, parseDataPath, parseLines, parseMessage, parseNewValue, pathToApiDocsPath, pointToCoordinates, polygonBounds, polygonToCoordinates, polygonsFromFeature, primaryProduct, propertyError, propertyId, recursiveProperties, refToSchemaType, refreshPropertyKeys, regionsQuery, repeat, safeJSONParse, safeJSONStringify, schemaRequiredProperties, schemaTypeToDefaultValue, scrollToEl, scrollTop, searchQuery, searchResultsFields, searchableTypes, serializeSearchFilters, siblingProperty, singleProperty, siteTooBig, sortOrder, sortProperties, strokeColor, strokeStyle, suggestMatchQuery, suggestQuery, termChildToParent, termLocation, termLocationName, termProperties, termTypeGroups, termTypeLabel, termTypeLookupUrl, toCsv$1 as toCsv, typeToNewProperty, updateProperties, valueTypeToDefault, waitFor, wildcardQuery, worldRegion };
|
|
7555
7634
|
//# sourceMappingURL=hestia-earth-ui-components.js.map
|