@hestia-earth/ui-components 0.21.21 → 0.22.1
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/common/logs-utils.d.ts +1 -1
- package/common/utils.d.ts +3 -3
- package/esm2022/common/logs-utils.mjs +2 -2
- package/esm2022/common/tags-input.directive.mjs +6 -6
- package/esm2022/common/utils.mjs +1 -1
- package/esm2022/files/files-error.model.mjs +13 -10
- package/esm2022/files/files-form.model.mjs +38 -32
- package/esm2022/files/files-upload-errors/files-upload-errors.component.mjs +2 -2
- package/esm2022/impact-assessments/impact-assessments-indicator-breakdown-chart/impact-assessments-indicator-breakdown-chart.component.mjs +3 -3
- package/esm2022/node/node-csv-export-confirm/node-csv-export-confirm.component.mjs +3 -3
- package/esm2022/node/node-logs-file/node-logs-file.component.mjs +3 -3
- package/esm2022/node/node-logs-models/node-logs-models.component.mjs +3 -2
- package/esm2022/node/node-logs-models/node-logs-models.model.mjs +5 -3
- package/fesm2022/hestia-earth-ui-components.mjs +69 -57
- package/fesm2022/hestia-earth-ui-components.mjs.map +1 -1
- package/package.json +4 -4
|
@@ -34,7 +34,7 @@ import { json2csvAsync } from 'json-2-csv';
|
|
|
34
34
|
import isEqual$1 from 'lodash.isequal';
|
|
35
35
|
import * as i4 from '@angular/cdk/drag-drop';
|
|
36
36
|
import { moveItemInArray, DragDropModule } from '@angular/cdk/drag-drop';
|
|
37
|
-
import { headersFromCsv, toCsv
|
|
37
|
+
import { headersFromCsv, toCsv, toJson } from '@hestia-earth/schema-convert';
|
|
38
38
|
import { recommendedProperties } from '@hestia-earth/json-schema';
|
|
39
39
|
import { isCSVIncluded, isDefaultCSVSelected } from '@hestia-earth/json-schema/schema-utils';
|
|
40
40
|
import { create, formatters } from 'jsondiffpatch';
|
|
@@ -1171,8 +1171,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImpor
|
|
|
1171
1171
|
}]
|
|
1172
1172
|
}] });
|
|
1173
1173
|
|
|
1174
|
-
const ignoreKeys = ['@type', 'type', 'added', 'updated', 'addedVersion', 'updatedVersion'];
|
|
1175
|
-
const isValidKey = (key) => !ignoreKeys.includes(key);
|
|
1174
|
+
const ignoreKeys$1 = ['@type', 'type', 'added', 'updated', 'addedVersion', 'updatedVersion'];
|
|
1175
|
+
const isValidKey = (key) => !ignoreKeys$1.includes(key);
|
|
1176
1176
|
const isMethodModelAllowed = (filterMethod) => (node) => node.methodModel?.['@id'] === (filterMethod ? filterMethod['@id'] : getDefaultModelId(node.term?.['@id']));
|
|
1177
1177
|
var NodeKeyState;
|
|
1178
1178
|
(function (NodeKeyState) {
|
|
@@ -4207,10 +4207,10 @@ class TagsInputDirective {
|
|
|
4207
4207
|
return this.elementRef.nativeElement;
|
|
4208
4208
|
}
|
|
4209
4209
|
get tagsInputNode() {
|
|
4210
|
-
return this.elementRef.nativeElement
|
|
4210
|
+
return this.elementRef.nativeElement?.parentNode?.querySelectorAll('.tags-input')?.[0];
|
|
4211
4211
|
}
|
|
4212
4212
|
get tagsInputInput() {
|
|
4213
|
-
return this.tagsInputNode
|
|
4213
|
+
return this.tagsInputNode?.querySelectorAll('.input')?.[0];
|
|
4214
4214
|
}
|
|
4215
4215
|
setInputEvent({ event, listener }) {
|
|
4216
4216
|
this.tagsInputInput.addEventListener(event, listener);
|
|
@@ -4222,7 +4222,7 @@ class TagsInputDirective {
|
|
|
4222
4222
|
addInputValue(value) {
|
|
4223
4223
|
if (value && this.mapValue(value)) {
|
|
4224
4224
|
this.tagsInput.add(value);
|
|
4225
|
-
this.tagsInputInput.value = '';
|
|
4225
|
+
this.tagsInputInput && (this.tagsInputInput.value = '');
|
|
4226
4226
|
}
|
|
4227
4227
|
}
|
|
4228
4228
|
enableTagsInput() {
|
|
@@ -4231,11 +4231,11 @@ class TagsInputDirective {
|
|
|
4231
4231
|
this.tagsInput = new BulmaTagsInput(this.input, options);
|
|
4232
4232
|
// TODO: remove when fixed, @see https://github.com/CreativeBulma/bulma-tagsinput/issues/23
|
|
4233
4233
|
const classes = ['is-small', 'is-large'].filter(v => this.input.classList.contains(v));
|
|
4234
|
-
classes.map(v => this.tagsInputNode.classList.add(v));
|
|
4234
|
+
this.tagsInputNode && classes.map(v => this.tagsInputNode.classList.add(v));
|
|
4235
4235
|
// regex pattern matching
|
|
4236
4236
|
this.tagsInput.on('before.add', value => this.mapValue(value));
|
|
4237
4237
|
// add item on blur if value
|
|
4238
|
-
const onBlur = () => this.addInputValue(this.tagsInputInput
|
|
4238
|
+
const onBlur = () => this.addInputValue(this.tagsInputInput?.value);
|
|
4239
4239
|
this.setInputEvent({ event: 'blur', listener: onBlur });
|
|
4240
4240
|
}
|
|
4241
4241
|
catch (err) {
|
|
@@ -4994,7 +4994,7 @@ const formatLine = ({ data: { timestamp, message } }) => ({
|
|
|
4994
4994
|
timestamp,
|
|
4995
4995
|
...parseMessage$1(message)
|
|
4996
4996
|
});
|
|
4997
|
-
const
|
|
4997
|
+
const logToCsv$1 = (lines) => json2csvAsync(lines.map(formatLine).filter(data => Object.keys(data).length > 1), {
|
|
4998
4998
|
emptyFieldValue: ''
|
|
4999
4999
|
});
|
|
5000
5000
|
|
|
@@ -5305,7 +5305,7 @@ class NodeCsvExportConfirmComponent {
|
|
|
5305
5305
|
}
|
|
5306
5306
|
ngOnInit() {
|
|
5307
5307
|
this.includedNodes = this.nodes.map(node => ({ node, included: true }));
|
|
5308
|
-
this.csvData = toCsv
|
|
5308
|
+
this.csvData = toCsv(this.nodes || [], { includeExising: !this.isUpload });
|
|
5309
5309
|
}
|
|
5310
5310
|
get included() {
|
|
5311
5311
|
return this.includedNodes.filter(({ included }) => included);
|
|
@@ -5316,7 +5316,7 @@ class NodeCsvExportConfirmComponent {
|
|
|
5316
5316
|
}
|
|
5317
5317
|
updateCsvContent() {
|
|
5318
5318
|
const nodes = this.included.map(({ node }) => node);
|
|
5319
|
-
const data = toCsv
|
|
5319
|
+
const data = toCsv(nodes, { includeExising: !this.isUpload, selectedHeaders: this.headers });
|
|
5320
5320
|
this.csvContent = this.headers.length
|
|
5321
5321
|
? this.domSanitizer.bypassSecurityTrustResourceUrl(`data:text/html;charset=utf-8,${encodeURIComponent(data)}`)
|
|
5322
5322
|
: undefined;
|
|
@@ -5459,7 +5459,7 @@ class NodeLogsFileComponent {
|
|
|
5459
5459
|
}), tap(() => (this.loading = false)));
|
|
5460
5460
|
}
|
|
5461
5461
|
async updateCsvContent() {
|
|
5462
|
-
this.csvContent = this.domSanitizer.bypassSecurityTrustResourceUrl(`data:text/html;charset=utf-8,${encodeURIComponent(await
|
|
5462
|
+
this.csvContent = this.domSanitizer.bypassSecurityTrustResourceUrl(`data:text/html;charset=utf-8,${encodeURIComponent(await logToCsv$1(this.allLogs))}`);
|
|
5463
5463
|
}
|
|
5464
5464
|
applyFilters() {
|
|
5465
5465
|
this.nodeLogLines = this.allLogs
|
|
@@ -5712,9 +5712,11 @@ const filterDeleted = (blankNodes) => (blankNodes || []).filter(value => !value.
|
|
|
5712
5712
|
const blankNodeValueByKey = {
|
|
5713
5713
|
property: (values, _k, id) => !!id && values?.length ? (values[0].properties || []).find(p => p.term['@id'] === id)?.value || '' : '',
|
|
5714
5714
|
input: (values, _k, id) => !!id && (values || []).filter(v => v['@type'] === SchemaType.Emission).length
|
|
5715
|
-
?
|
|
5715
|
+
? reduceValues(values.filter(({ inputs }) => (inputs || []).some(input => input['@id'] === id)), id)
|
|
5716
|
+
: '',
|
|
5717
|
+
transformation: (values, _k, id) => values.length
|
|
5718
|
+
? reduceValues(values.filter(({ transformation }) => transformation?.['@id'] === id), id)
|
|
5716
5719
|
: '',
|
|
5717
|
-
transformation: (values, _k, id) => values.length ? propertyValue$1(values.find(({ transformation }) => transformation?.['@id'] === id)?.value, id) : '',
|
|
5718
5720
|
default: (blankNodes, key) => {
|
|
5719
5721
|
const value = blankNodes?.length ? blankNodes[0][key] : null;
|
|
5720
5722
|
return ['string', 'number', 'boolean', 'undefined'].includes(typeof value)
|
|
@@ -6132,6 +6134,7 @@ const matchTermTypeFromKey = {
|
|
|
6132
6134
|
impacts: indicatorTermTermType.term,
|
|
6133
6135
|
endpoints: indicatorTermTermType.term
|
|
6134
6136
|
};
|
|
6137
|
+
const termSearch = (term) => term.replace(/[,\s]/g, '').toLowerCase();
|
|
6135
6138
|
class NodeLogsModelsComponent {
|
|
6136
6139
|
constructor(nodeService, searchService, engineService) {
|
|
6137
6140
|
this.nodeService = nodeService;
|
|
@@ -6192,7 +6195,7 @@ class NodeLogsModelsComponent {
|
|
|
6192
6195
|
return this.nodeService.getLog(this.node).toPromise();
|
|
6193
6196
|
}
|
|
6194
6197
|
suggestByTerm(term) {
|
|
6195
|
-
return from(this.allTerms).pipe(map(v => v.name), filter(v => v
|
|
6198
|
+
return from(this.allTerms).pipe(map(v => v.name), filter(v => termSearch(v).includes(termSearch(term))), toArray());
|
|
6196
6199
|
}
|
|
6197
6200
|
async searchTerms(query) {
|
|
6198
6201
|
const { results } = await this.searchService.search({
|
|
@@ -7747,7 +7750,7 @@ const parseDataPath = (dataPath = '') => {
|
|
|
7747
7750
|
}));
|
|
7748
7751
|
};
|
|
7749
7752
|
const allowedDataPathsLabels = Object.values(SchemaType);
|
|
7750
|
-
// TODO: see if we want to ignore Term label and show the
|
|
7753
|
+
// TODO: see if we want to ignore Term label and show the blank node instead
|
|
7751
7754
|
// const allowedDataPathsLabels = Object.values(SchemaType).filter(v => ![SchemaType.Term].includes(v));
|
|
7752
7755
|
const dataPathLabel = (dataPath = '') => parseDataPath(dataPath)
|
|
7753
7756
|
.filter(({ label }) => allowedDataPathsLabels.includes(label))
|
|
@@ -7921,9 +7924,9 @@ const customErrorMessage = {
|
|
|
7921
7924
|
: 'You may want to add this Transformation.'}`,
|
|
7922
7925
|
'every node should be unique': ({ params }) => `This Node is duplicated. Every Node should be unique.
|
|
7923
7926
|
Uniqueness is determined by the following fields: ${(params?.keys || []).map(code).join(', ')}`,
|
|
7924
|
-
'every item in the list should be unique': ({ params }) => `This
|
|
7925
|
-
? `with the blank
|
|
7926
|
-
: ''}. Every
|
|
7927
|
+
'every item in the list should be unique': ({ params }) => `This blank node is duplicated${params?.duplicatedIndexes?.length
|
|
7928
|
+
? ` with the blank ${pluralize('node', params.duplicatedIndexes.length)} with numbered: ${params.duplicatedIndexes.join(', ')}`
|
|
7929
|
+
: ''}. Every blank node should be unique.
|
|
7927
7930
|
Uniqueness is determined by the following fields: ${(params?.keys || []).map(code).join(', ')}`,
|
|
7928
7931
|
'must contain as many items as values': ({ params, dataPath }) => `The number of ${code(dataPath.split('.').pop())} must match the number of ${code('value')}.
|
|
7929
7932
|
Currently there are ${params?.current} ${code(dataPath.split('.').pop())} but ${params?.expected} ${code('value')}.`,
|
|
@@ -8059,17 +8062,20 @@ const customErrorMessage = {
|
|
|
8059
8062
|
If this is incorrect, pelase add a value.`,
|
|
8060
8063
|
'should contain at least one management node': ({ params }) => `${params?.termType
|
|
8061
8064
|
? `Does not contain information about ${code(params.termType)}.
|
|
8062
|
-
Please consider adding a history of ${code(params.termType)} for as many years as possible in the Management
|
|
8065
|
+
Please consider adding a history of ${code(params.termType)} for as many years as possible in the Management blank nodes.`
|
|
8063
8066
|
: `There is no Management node present in this upload.
|
|
8064
8067
|
We recommend adding this to the Site, including information about current and historical tillage.
|
|
8065
8068
|
`}
|
|
8066
8069
|
We use this information to model CO2 emissions from soil organic carbon changes.`,
|
|
8067
|
-
'can not be used on this termType': ({ params }) => `This Property can only be used on
|
|
8070
|
+
'can not be used on this termType': ({ params }) => `This Property can only be used on blank nodes with the following ${code('term.termType')}: ${params.expected
|
|
8068
8071
|
.map(code)
|
|
8069
8072
|
.join(', ')}.`,
|
|
8070
8073
|
'not a valid GeoJSON': () => `This GeoJSON appears to be invalid.
|
|
8071
8074
|
Please validate your GeoJSON using an online tool like <a href="https://geojson.io/">geojson.io</a>.
|
|
8072
|
-
If you think this is a mistake, please report the error ${reportIssueLink(Repository.schema, Template.bug)}
|
|
8075
|
+
If you think this is a mistake, please report the error ${reportIssueLink(Repository.schema, Template.bug)}.`,
|
|
8076
|
+
'should add the term stockingDensityPermanentPastureAverage': ({ params }) => `You did not specify ${nodeLink({ '@type': NodeType.Term, '@id': params.expected })}.
|
|
8077
|
+
Adding this Practice is essential for Cycles with relative functional unit which happen entirely or partially on permanent pasture.
|
|
8078
|
+
Without this information Hestia cannot calculate animal related emissions.`
|
|
8073
8079
|
};
|
|
8074
8080
|
const formatCustomErrorMessage = (message, error, allErrors = []) => {
|
|
8075
8081
|
const formattedMessage = message && message in customErrorMessage
|
|
@@ -8104,7 +8110,7 @@ const missingNodeErrorMessage = ({ '@type': _t, type, name }, missingIdError) =>
|
|
|
8104
8110
|
${schemaLink(_t || type)} in Hestia, please check the ${code('name')} or ${code('@id')} is correct.
|
|
8105
8111
|
If you are trying to create a new ${schemaLink(_t || type)}, please identify it with an ${code('id')} field.`;
|
|
8106
8112
|
const ARRAY_DELIMITER = ';';
|
|
8107
|
-
const
|
|
8113
|
+
const ignoreKeys = ['filepath', '_cache'];
|
|
8108
8114
|
const defaultSuggestionType = 'default';
|
|
8109
8115
|
const stringValue = (value) => (typeof value === 'undefined' || value === null ? '' : value).toString();
|
|
8110
8116
|
const nonExpandableArrayDataPath = (key) => key.replace(/\[\d+\]$/, '');
|
|
@@ -8272,6 +8278,7 @@ const isAddPropertyEnabled = (node, schemaType, schema, fullKey = '') => !!schem
|
|
|
8272
8278
|
(!fullKey || nestingTypeEnabled(schemaType));
|
|
8273
8279
|
const editableKey = (key) => !['type', '@type', 'termType'].includes(key);
|
|
8274
8280
|
const propertyId = () => v4();
|
|
8281
|
+
const isGeojson = (schema) => schema.geojson;
|
|
8275
8282
|
const propertyUrl = (node, key) => ['@id', 'name'].includes(key) && linkTypeEnabled(node['@type'])
|
|
8276
8283
|
? node['@id']
|
|
8277
8284
|
? {
|
|
@@ -8296,11 +8303,13 @@ const propertyMapsUrl = (node, key, value) => ['type'].includes(key) &&
|
|
|
8296
8303
|
: undefined;
|
|
8297
8304
|
const propertyExternalUrl = (node, key, value) => propertyUrl(node, key) || propertyMapsUrl(node, key, value);
|
|
8298
8305
|
const arrayPlaceholder = (valueType) => `Type a ${valueType} then press Enter`;
|
|
8299
|
-
const defaultPlaceholder = ({ type, examples }, valueType) =>
|
|
8300
|
-
?
|
|
8301
|
-
|
|
8302
|
-
|
|
8303
|
-
|
|
8306
|
+
const defaultPlaceholder = ({ type, examples, geojson }, valueType) => geojson
|
|
8307
|
+
? 'Must be a valid GeoJSON'
|
|
8308
|
+
: examples?.length
|
|
8309
|
+
? Array.isArray(examples[0])
|
|
8310
|
+
? arrayPlaceholder(valueType)
|
|
8311
|
+
: examples[0]
|
|
8312
|
+
: `Must be of type ${type || valueType}`;
|
|
8304
8313
|
const schemaPlacholder = (schema, fullKey) => {
|
|
8305
8314
|
const [parent, ...keys] = fullKey.split('.');
|
|
8306
8315
|
const properties = schema.properties || {};
|
|
@@ -8328,20 +8337,24 @@ const propertyTypeValue = {
|
|
|
8328
8337
|
boolean: val => (`${val}` || '').toLowerCase() === 'true'
|
|
8329
8338
|
};
|
|
8330
8339
|
const propertyValue = (schema, value) => {
|
|
8331
|
-
const valueType = schema
|
|
8332
|
-
?
|
|
8333
|
-
|
|
8334
|
-
|
|
8335
|
-
|
|
8340
|
+
const valueType = isGeojson(schema)
|
|
8341
|
+
? 'json'
|
|
8342
|
+
: schema.type
|
|
8343
|
+
? Array.isArray(schema.type) && typeof value in propertyTypeValue
|
|
8344
|
+
? typeof value
|
|
8345
|
+
: schema.type
|
|
8346
|
+
: 'object';
|
|
8336
8347
|
return propertyTypeValue[valueType in propertyTypeValue ? valueType : 'string'](value, schema);
|
|
8337
8348
|
};
|
|
8338
|
-
const propertyValueType = (schema, value) => (schema
|
|
8339
|
-
?
|
|
8340
|
-
|
|
8341
|
-
|
|
8342
|
-
?
|
|
8343
|
-
: schema.type
|
|
8344
|
-
|
|
8349
|
+
const propertyValueType = (schema, value) => (isGeojson(schema)
|
|
8350
|
+
? 'json'
|
|
8351
|
+
: schema.type
|
|
8352
|
+
? Array.isArray(schema.type)
|
|
8353
|
+
? schema.type[0]
|
|
8354
|
+
: schema.type === 'array'
|
|
8355
|
+
? propertyValueType({ ...schema, type: [schema.items.type] })
|
|
8356
|
+
: schema.type
|
|
8357
|
+
: typeof value);
|
|
8345
8358
|
const propertyTypeParseValue = {
|
|
8346
8359
|
undefined: () => undefined,
|
|
8347
8360
|
object: val => safeJSONParse(val),
|
|
@@ -8366,10 +8379,10 @@ const propertyTypeParseValue = {
|
|
|
8366
8379
|
* @param value
|
|
8367
8380
|
* @returns Value in the correct format.
|
|
8368
8381
|
*/
|
|
8369
|
-
const parseNewValue = (schema, value) => schema
|
|
8370
|
-
? Array.isArray(schema
|
|
8382
|
+
const parseNewValue = (schema, value) => schema?.type
|
|
8383
|
+
? Array.isArray(schema?.type)
|
|
8371
8384
|
? propertyTypeParseValue[typeof value](value, schema)
|
|
8372
|
-
: propertyTypeParseValue[schema.type](value, schema)
|
|
8385
|
+
: propertyTypeParseValue[isGeojson(schema) ? 'json' : schema.type](value, schema)
|
|
8373
8386
|
: value;
|
|
8374
8387
|
const isOpenDefault = (schemaType) => [SchemaType.Term].includes(schemaType);
|
|
8375
8388
|
// can the property be seen when the group is closed
|
|
@@ -8499,7 +8512,7 @@ const singleProperty = (schemas, errors, node, fullKey) => {
|
|
|
8499
8512
|
return propertyFromNode(schemas, errors, parentSchema, true, parent, parentNode)(key);
|
|
8500
8513
|
};
|
|
8501
8514
|
const recursiveProperties = (schemas, errors, nodeSchema, deepEditable, parent = '') => (node) => Object.keys(node)
|
|
8502
|
-
.filter(key => !
|
|
8515
|
+
.filter(key => !ignoreKeys.includes(key))
|
|
8503
8516
|
.map(propertyFromNode(schemas, errors, nodeSchema, deepEditable, parent, node))
|
|
8504
8517
|
.concat(...missingPropertyErrors(node, errors, parent))
|
|
8505
8518
|
.sort(sortProperties);
|
|
@@ -8518,10 +8531,6 @@ const typeToNewProperty = (schemas, schema, nodeSchema, node, fullKey) => {
|
|
|
8518
8531
|
const { schemaType, properties } = schemaRequiredProperties(schemas, schema);
|
|
8519
8532
|
node[key] = node[key] || {};
|
|
8520
8533
|
node[key].type = schemaType;
|
|
8521
|
-
// TODO: handle load schemas from http source
|
|
8522
|
-
if (schemaType.startsWith('http')) {
|
|
8523
|
-
return typeToNewProperty(schemas, { type: 'json' }, nodeSchema, node, fullKey);
|
|
8524
|
-
}
|
|
8525
8534
|
// TODO: handle nodeSchema should be schema unless last recursion
|
|
8526
8535
|
const props = properties
|
|
8527
8536
|
.filter(prop => nestingEnabled(schemaType, prop.key) && !!prop.value)
|
|
@@ -8584,6 +8593,7 @@ const typeToNewProperty = (schemas, schema, nodeSchema, node, fullKey) => {
|
|
|
8584
8593
|
formatter: formatter(key)
|
|
8585
8594
|
};
|
|
8586
8595
|
},
|
|
8596
|
+
geojson: () => typeToNewProperty(schemas, { type: 'json' }, nodeSchema, node, fullKey),
|
|
8587
8597
|
default: () => {
|
|
8588
8598
|
const valueType = propertyValueType(schema);
|
|
8589
8599
|
const value = schema.default || schema.const || valueTypeToDefault[valueType];
|
|
@@ -8608,11 +8618,13 @@ const typeToNewProperty = (schemas, schema, nodeSchema, node, fullKey) => {
|
|
|
8608
8618
|
};
|
|
8609
8619
|
}
|
|
8610
8620
|
};
|
|
8611
|
-
const mapped =
|
|
8612
|
-
? mappings.
|
|
8613
|
-
: schema.type
|
|
8614
|
-
? mappings
|
|
8615
|
-
: mappings
|
|
8621
|
+
const mapped = isGeojson(schema)
|
|
8622
|
+
? mappings.geojson
|
|
8623
|
+
: !schema.type
|
|
8624
|
+
? mappings.object
|
|
8625
|
+
: schema.type in mappings
|
|
8626
|
+
? mappings[schema.type]
|
|
8627
|
+
: mappings.default;
|
|
8616
8628
|
return mapped();
|
|
8617
8629
|
};
|
|
8618
8630
|
const findProperty = (properties, fullKey) => {
|
|
@@ -9606,7 +9618,7 @@ const valueToNodes = (value, type) => Array.isArray(value)
|
|
|
9606
9618
|
const nodesFromError = (error, type) => error ? valueToNodes(error.node, type) || valueToNodes(error.value, error.schema) || [] : [];
|
|
9607
9619
|
const errorCsv = nodes => {
|
|
9608
9620
|
try {
|
|
9609
|
-
return toCsv
|
|
9621
|
+
return toCsv(nodes, { includeExising: true });
|
|
9610
9622
|
}
|
|
9611
9623
|
catch (_err) {
|
|
9612
9624
|
return '';
|
|
@@ -10686,7 +10698,7 @@ const csvHeaders = [
|
|
|
10686
10698
|
'Inputs value',
|
|
10687
10699
|
'Functional Unit'
|
|
10688
10700
|
];
|
|
10689
|
-
const
|
|
10701
|
+
const logToCsv = (logs, impact) => [
|
|
10690
10702
|
csvHeaders.join(','),
|
|
10691
10703
|
...logs
|
|
10692
10704
|
.sort((a, b) => a.impactTermId.localeCompare(b.impactTermId))
|
|
@@ -10742,7 +10754,7 @@ class ImpactAssessmentsIndicatorBreakdownChartComponent {
|
|
|
10742
10754
|
: null;
|
|
10743
10755
|
}), filter(log => !!log), toArray())
|
|
10744
10756
|
.toPromise());
|
|
10745
|
-
this.csvContent = this.domSanitizer.bypassSecurityTrustResourceUrl(`data:text/html;charset=utf-8,${encodeURIComponent(
|
|
10757
|
+
this.csvContent = this.domSanitizer.bypassSecurityTrustResourceUrl(`data:text/html;charset=utf-8,${encodeURIComponent(logToCsv(this.logs, this.impactAssessment))}`);
|
|
10746
10758
|
const { results } = await this.searchService.search({
|
|
10747
10759
|
fields: ['@type', '@id', 'name'],
|
|
10748
10760
|
limit: 1000,
|
|
@@ -11940,5 +11952,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImpor
|
|
|
11940
11952
|
* Generated bundle index. Do not edit.
|
|
11941
11953
|
*/
|
|
11942
11954
|
|
|
11943
|
-
export { ARRAY_DELIMITER, ApplyPurePipe, BibliographiesSearchConfirmComponent, BindOnceDirective, BlankNodeStateComponent, BlankNodeStateNoticeComponent, BlankNodeValueDeltaComponent, ClickOutsideDirective, ClipboardComponent, ColorPalette, CompoundDirective, CompoundPipe, CyclesActivityComponent, CyclesActivityLogsComponent, CyclesAnimalsComponent, CyclesCompletenessComponent, CyclesCompletenessLogsComponent, CyclesEmissionsChartComponent, CyclesEmissionsComponent, CyclesEmissionsLogsComponent, CyclesFunctionalUnitMeasureComponent, CyclesPracticesComponent, CyclesPracticesLogsComponent, CyclesPracticesTimelineComponent, CyclesResultComponent, DataTableComponent, DefaultPipe, DeltaColour, DiffsDisplayType, DropdownComponent, EllipsisPipe, EngineModelsVersionLinkComponent, EngineOrchestratorEditComponent, EngineRequirementsFormComponent, FilesFormComponent, FilesUploadErrorsComponent, FilterComponent, FilterHasOptionsPipe, GetPipe, GlossaryMigrationFormat, HE_API_BASE_URL, HE_CALCULATIONS_BASE_URL, HE_ORCHESTRATOR_BASE_URL, HeAggregationEngineService, HeAuthService, HeBibliographiesModule, HeCommonLightModule, HeCommonModule, HeCommonService, HeCyclesModule, HeEngineModule, HeEngineService, HeFilesModule, HeFontawesomeModule, HeGlossaryService, HeImpactAssessmentsModule, HeMendeleyService, HeNodeCsvService, HeNodeModule, HeNodeService, HeSchemaModule, HeSchemaService, HeSearchService, HeSelectModule, HeSitesModule, HeTermsModule, HeToastService, HeUsersService, ImpactAssessmentsGraphComponent, ImpactAssessmentsIndicatorBreakdownChartComponent, ImpactAssessmentsIndicatorsChartComponent, ImpactAssessmentsProductsComponent, ImpactAssessmentsProductsLogsComponent, IsArrayPipe, IsObjectPipe, IssueConfirmComponent, KeyToLabelPipe, KeysPipe, Level, LinkKeyValueComponent, LogStatus, MAX_RESULTS, MapsDrawingConfirmComponent, MendeleySearchResult, MobileShellComponent, NavigationMenuComponent, NavigationMenuService, NoExtPipe, NodeCsvExportConfirmComponent, NodeCsvSelectHeadersComponent, NodeDiffsComponent, NodeElementDirective, NodeIconComponent, NodeLinkComponent, NodeLogsFileComponent, NodeLogsModelsComponent, NodeMissingLookupFactorsComponent, NodeRecommendationsComponent, NodeValueDetailsComponent, OPTION_GROUP_TOKEN, PluralizePipe, PopoverComponent, PopoverConfirmComponent, PrecisionPipe, RemoveMarkdownPipe, Repository, ResizedDirective, ResizedEvent, SELECT_OPTION_TOKEN, SELECT_TOKEN, SchemaInfoComponent, SchemaVersionLinkComponent, SearchExtendComponent, SelectComponent, SelectOptionComponent, SelectOptionGroupComponent, ShellComponent, SitesMapsComponent, SitesMeasurementsComponent, SitesMeasurementsLogsComponent, SkeletonTextComponent, SocialTagsComponent, SortByPipe, SortSelectComponent, TagsInputDirective, Template, TermsPropertyContentComponent, TermsSubClassOfContentComponent, TermsUnitsDescriptionComponent, ThousandSuffixesPipe, TimesPipe, ToastComponent, ToggleOptionDirective, UnitConverterComponent, addPolygonToFeature, allCountriesQuery, arrayValue, availableProperties, baseUrl, bottom, buildSummary, calculateCycleDuration, calculateCycleDurationEnabled, calculateCycleStartDate, calculateCycleStartDateEnabled, clustererImage, code, compoundToHtml, computeKeys, computeTerms, contactUsEmail, contactUsLink, coordinatesToPoint, copyObject, countriesQuery, createMarker, cropsQuery, d3ellipse, d3wrap, dataPathLabel, dataPathToKey, defaultFeature, defaultLabel, defaultSuggestionType, definitionToSchemaType, distinctUntilChangedDeep, ellipsis, engineGitBaseUrl, engineGitUrl, errorHasError, errorHasWarning, errorText, evaluateSuccess, externalLink, fillColor, fillStyle, filterError, filterParams, findConfigModels, findMatchingModel, findModels, findProperty, findPropertyById, flatFilterData, flatFilterNode, formatCustomErrorMessage, formatError, formatPropertyError, formatter, getColor, gitBranch, gitHome, gitRawBaseUrl, glossaryLink, groupChanged, groupLogsByModel, groupLogsByTerm, groupdLogsByKey, handleAPIError, hasError, hasLeafWithValue, hasWarning, initialFilterState, isAddPropertyEnabled, isChrome, isEqual, isExternal, isMigrationError, isMissingOneOfError, isMissingPropertyError, isSchemaIri, isScrolledBelow, keyToDataPath, levels, linkTypeEnabled, listColor, listColorContinuous, locationQuery, logValueArray, logsKey, lookupUrl, lookups, mapFilterData, mapsUrl, markerIcon, markerPie, matchAggregatedQuery, matchBoolPrefixQuery, matchCountry, matchExactQuery, matchGlobalRegion, matchId, matchNameNormalized, matchNestedKey, matchPhrasePrefixQuery, matchPhraseQuery, matchPrimaryProductQuery, matchQuery, matchRegex, matchRegion, matchTermType, matchType, maxAreaSize, measurementValue, migrationErrorMessage, migrationsUrl, missingNodeErrors, modelCount, modelKeyParams, modelParams, multiMatchQuery, nestedProperty, nestingEnabled, nestingTypeEnabled, nodeAvailableProperties, nodeLink, nodeLogsUrl, nodeUrl, nodeVersion, numberGte, parentKey, parentProperty, parseData, parseDataPath, parseLines, parseMessage$1 as parseMessage, parseNewValue, pathToApiDocsPath, pluralize, pointToCoordinates, polygonBounds, polygonToCoordinates, polygonsFromFeature, populateWithTrackIdsFilterData, primaryProduct, productsQuery, propertyError, propertyId, recursiveProperties, refToSchemaType, refreshPropertyKeys, regionsQuery, repeat, reportIssueLink, reportIssueUrl, safeJSONParse, safeJSONStringify, schemaBaseUrl, schemaLink, schemaRequiredProperties, schemaTypeToDefaultValue, scrollToEl, scrollTop, searchFilterData, searchableTypes, siblingProperty, singleProperty, siteTooBig, sortProperties, strokeColor, strokeStyle, suggestMatchQuery, suggestQuery, takeAfterViewInit, termLocation, termLocationName, termProperties, termTypeLabel,
|
|
11955
|
+
export { ARRAY_DELIMITER, ApplyPurePipe, BibliographiesSearchConfirmComponent, BindOnceDirective, BlankNodeStateComponent, BlankNodeStateNoticeComponent, BlankNodeValueDeltaComponent, ClickOutsideDirective, ClipboardComponent, ColorPalette, CompoundDirective, CompoundPipe, CyclesActivityComponent, CyclesActivityLogsComponent, CyclesAnimalsComponent, CyclesCompletenessComponent, CyclesCompletenessLogsComponent, CyclesEmissionsChartComponent, CyclesEmissionsComponent, CyclesEmissionsLogsComponent, CyclesFunctionalUnitMeasureComponent, CyclesPracticesComponent, CyclesPracticesLogsComponent, CyclesPracticesTimelineComponent, CyclesResultComponent, DataTableComponent, DefaultPipe, DeltaColour, DiffsDisplayType, DropdownComponent, EllipsisPipe, EngineModelsVersionLinkComponent, EngineOrchestratorEditComponent, EngineRequirementsFormComponent, FilesFormComponent, FilesUploadErrorsComponent, FilterComponent, FilterHasOptionsPipe, GetPipe, GlossaryMigrationFormat, HE_API_BASE_URL, HE_CALCULATIONS_BASE_URL, HE_ORCHESTRATOR_BASE_URL, HeAggregationEngineService, HeAuthService, HeBibliographiesModule, HeCommonLightModule, HeCommonModule, HeCommonService, HeCyclesModule, HeEngineModule, HeEngineService, HeFilesModule, HeFontawesomeModule, HeGlossaryService, HeImpactAssessmentsModule, HeMendeleyService, HeNodeCsvService, HeNodeModule, HeNodeService, HeSchemaModule, HeSchemaService, HeSearchService, HeSelectModule, HeSitesModule, HeTermsModule, HeToastService, HeUsersService, ImpactAssessmentsGraphComponent, ImpactAssessmentsIndicatorBreakdownChartComponent, ImpactAssessmentsIndicatorsChartComponent, ImpactAssessmentsProductsComponent, ImpactAssessmentsProductsLogsComponent, IsArrayPipe, IsObjectPipe, IssueConfirmComponent, KeyToLabelPipe, KeysPipe, Level, LinkKeyValueComponent, LogStatus, MAX_RESULTS, MapsDrawingConfirmComponent, MendeleySearchResult, MobileShellComponent, NavigationMenuComponent, NavigationMenuService, NoExtPipe, NodeCsvExportConfirmComponent, NodeCsvSelectHeadersComponent, NodeDiffsComponent, NodeElementDirective, NodeIconComponent, NodeLinkComponent, NodeLogsFileComponent, NodeLogsModelsComponent, NodeMissingLookupFactorsComponent, NodeRecommendationsComponent, NodeValueDetailsComponent, OPTION_GROUP_TOKEN, PluralizePipe, PopoverComponent, PopoverConfirmComponent, PrecisionPipe, RemoveMarkdownPipe, Repository, ResizedDirective, ResizedEvent, SELECT_OPTION_TOKEN, SELECT_TOKEN, SchemaInfoComponent, SchemaVersionLinkComponent, SearchExtendComponent, SelectComponent, SelectOptionComponent, SelectOptionGroupComponent, ShellComponent, SitesMapsComponent, SitesMeasurementsComponent, SitesMeasurementsLogsComponent, SkeletonTextComponent, SocialTagsComponent, SortByPipe, SortSelectComponent, TagsInputDirective, Template, TermsPropertyContentComponent, TermsSubClassOfContentComponent, TermsUnitsDescriptionComponent, ThousandSuffixesPipe, TimesPipe, ToastComponent, ToggleOptionDirective, UnitConverterComponent, addPolygonToFeature, allCountriesQuery, arrayValue, availableProperties, baseUrl, bottom, buildSummary, calculateCycleDuration, calculateCycleDurationEnabled, calculateCycleStartDate, calculateCycleStartDateEnabled, clustererImage, code, compoundToHtml, computeKeys, computeTerms, contactUsEmail, contactUsLink, coordinatesToPoint, copyObject, countriesQuery, createMarker, cropsQuery, d3ellipse, d3wrap, dataPathLabel, dataPathToKey, defaultFeature, defaultLabel, defaultSuggestionType, definitionToSchemaType, distinctUntilChangedDeep, ellipsis, engineGitBaseUrl, engineGitUrl, errorHasError, errorHasWarning, errorText, evaluateSuccess, externalLink, fillColor, fillStyle, filterError, filterParams, findConfigModels, findMatchingModel, findModels, findProperty, findPropertyById, flatFilterData, flatFilterNode, formatCustomErrorMessage, formatError, formatPropertyError, formatter, getColor, gitBranch, gitHome, gitRawBaseUrl, glossaryLink, groupChanged, groupLogsByModel, groupLogsByTerm, groupdLogsByKey, handleAPIError, hasError, hasLeafWithValue, hasWarning, initialFilterState, isAddPropertyEnabled, isChrome, isEqual, isExternal, isMigrationError, isMissingOneOfError, isMissingPropertyError, isSchemaIri, isScrolledBelow, keyToDataPath, levels, linkTypeEnabled, listColor, listColorContinuous, locationQuery, logToCsv$1 as logToCsv, logValueArray, logsKey, lookupUrl, lookups, mapFilterData, mapsUrl, markerIcon, markerPie, matchAggregatedQuery, matchBoolPrefixQuery, matchCountry, matchExactQuery, matchGlobalRegion, matchId, matchNameNormalized, matchNestedKey, matchPhrasePrefixQuery, matchPhraseQuery, matchPrimaryProductQuery, matchQuery, matchRegex, matchRegion, matchTermType, matchType, maxAreaSize, measurementValue, migrationErrorMessage, migrationsUrl, missingNodeErrors, modelCount, modelKeyParams, modelParams, multiMatchQuery, nestedProperty, nestingEnabled, nestingTypeEnabled, nodeAvailableProperties, nodeLink, nodeLogsUrl, nodeUrl, nodeVersion, numberGte, parentKey, parentProperty, parseData, parseDataPath, parseLines, parseMessage$1 as parseMessage, parseNewValue, pathToApiDocsPath, pluralize, pointToCoordinates, polygonBounds, polygonToCoordinates, polygonsFromFeature, populateWithTrackIdsFilterData, primaryProduct, productsQuery, propertyError, propertyId, recursiveProperties, refToSchemaType, refreshPropertyKeys, regionsQuery, repeat, reportIssueLink, reportIssueUrl, safeJSONParse, safeJSONStringify, schemaBaseUrl, schemaLink, schemaRequiredProperties, schemaTypeToDefaultValue, scrollToEl, scrollTop, searchFilterData, searchableTypes, siblingProperty, singleProperty, siteTooBig, sortProperties, strokeColor, strokeStyle, suggestMatchQuery, suggestQuery, takeAfterViewInit, termLocation, termLocationName, termProperties, termTypeLabel, toThousands, typeToNewProperty, updateProperties, valueTypeToDefault, waitFor, wildcardQuery };
|
|
11944
11956
|
//# sourceMappingURL=hestia-earth-ui-components.mjs.map
|