@hestia-earth/ui-components 0.0.4 → 0.0.5
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 +392 -506
- package/bundles/hestia-earth-ui-components.umd.js.map +1 -1
- package/common/common.service.d.ts +1 -2
- package/common/public-api.d.ts +1 -0
- package/common/toast/toast.component.d.ts +2 -2
- package/common/toast.service.d.ts +3 -3
- package/common/utils.d.ts +3 -11
- package/cycles/public-api.d.ts +1 -0
- package/engine/aggregation-engine.service.d.ts +8 -20
- package/engine/engine.service.d.ts +2 -6
- package/esm2015/common/common.service.js +1 -7
- package/esm2015/common/public-api.js +2 -1
- package/esm2015/common/toast/toast.component.js +3 -3
- package/esm2015/common/toast.service.js +5 -5
- package/esm2015/common/utils.js +3 -61
- package/esm2015/cycles/public-api.js +2 -1
- package/esm2015/engine/aggregation-engine.service.js +11 -47
- package/esm2015/engine/engine.service.js +9 -15
- package/esm2015/impact-assessments/impact-assessments-products/impact-assessments-products.component.js +3 -3
- package/esm2015/mendeley/mendeley.service.js +1 -1
- package/esm2015/node/node-csv.service.js +1 -1
- package/esm2015/node/node.service.js +26 -16
- package/esm2015/schema/schema.service.js +1 -1
- package/esm2015/search/search.service.js +1 -1
- package/fesm2015/hestia-earth-ui-components.js +281 -372
- package/fesm2015/hestia-earth-ui-components.js.map +1 -1
- package/impact-assessments/impact-assessments-products/impact-assessments-products.component.d.ts +2 -2
- package/mendeley/mendeley.service.d.ts +2 -2
- package/node/node-csv.service.d.ts +1 -1
- package/node/node.service.d.ts +16 -7
- package/package.json +1 -1
- package/schema/schema.service.d.ts +1 -1
- package/search/search.service.d.ts +2 -2
|
@@ -418,9 +418,10 @@
|
|
|
418
418
|
}], ctorParameters: function () { return [{ type: i1__namespace.FaIconLibrary }]; } });
|
|
419
419
|
|
|
420
420
|
var _a$6, _b$3;
|
|
421
|
-
var get$
|
|
421
|
+
var get$4 = require('lodash.get');
|
|
422
422
|
var gitHome = 'https://gitlab.com/hestia-earth';
|
|
423
423
|
var gitRawBaseUrl = 'https://glcdn.githack.com/hestia-earth';
|
|
424
|
+
var gitBranch = function () { return ['dev', 'staging'].some(function (env) { return baseUrl().includes(env); }) ? 'develop' : 'master'; };
|
|
424
425
|
var isChrome = function () { return window.navigator.userAgent.includes('Chrome'); };
|
|
425
426
|
var baseUrl = function () { return window.location.origin.includes('localhost') ?
|
|
426
427
|
'https://www-dev.hestia.earth' :
|
|
@@ -429,18 +430,8 @@
|
|
|
429
430
|
'https://www.hestia.earth'; };
|
|
430
431
|
var isExternal = function () { return baseUrl() !== window.location.origin; };
|
|
431
432
|
;
|
|
432
|
-
var loadScript = function (src) { return new Promise(function (resolve, reject) {
|
|
433
|
-
if (!src || document.body.querySelectorAll('script[src="' + src + '"]').length > 0) {
|
|
434
|
-
return resolve({});
|
|
435
|
-
}
|
|
436
|
-
var script = document.createElement('script');
|
|
437
|
-
script.onload = resolve;
|
|
438
|
-
script.onerror = reject;
|
|
439
|
-
script.src = src;
|
|
440
|
-
document.body.appendChild(script);
|
|
441
|
-
}); };
|
|
442
433
|
var parseErrorStatus = function (error) { return ((error === null || error === void 0 ? void 0 : error.statusText) || '').toLowerCase().replace(/\s/g, '-'); };
|
|
443
|
-
var parseErrorMessage = function (error) { return get$
|
|
434
|
+
var parseErrorMessage = function (error) { return get$4(error, 'error.error', get$4(error, 'error.message', get$4(error, 'error', get$4(error, 'message', error)))); };
|
|
444
435
|
var handleAPIError = function (error) {
|
|
445
436
|
try {
|
|
446
437
|
error = parseErrorMessage(error);
|
|
@@ -455,21 +446,6 @@
|
|
|
455
446
|
var err = parseErrorMessage(error);
|
|
456
447
|
return parseErrorStatus(err) || err;
|
|
457
448
|
};
|
|
458
|
-
var toFormData = function (data, formData) {
|
|
459
|
-
if (formData === void 0) { formData = new FormData(); }
|
|
460
|
-
for (var key in data) {
|
|
461
|
-
if (data.hasOwnProperty(key)) {
|
|
462
|
-
var value = data[key];
|
|
463
|
-
if (typeof value === 'object') {
|
|
464
|
-
formData.append(key, JSON.stringify(value));
|
|
465
|
-
}
|
|
466
|
-
else {
|
|
467
|
-
formData.append(key, value);
|
|
468
|
-
}
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
return formData;
|
|
472
|
-
};
|
|
473
449
|
var filterParams = function (obj) {
|
|
474
450
|
var res = {};
|
|
475
451
|
Object.keys(obj).sort().forEach(function (key) {
|
|
@@ -480,14 +456,6 @@
|
|
|
480
456
|
});
|
|
481
457
|
return res;
|
|
482
458
|
};
|
|
483
|
-
var toSearchParams = function (params) {
|
|
484
|
-
if (params === void 0) { params = {}; }
|
|
485
|
-
var searchParams = new URLSearchParams();
|
|
486
|
-
Object.keys(params)
|
|
487
|
-
.filter(function (key) { return typeof params[key] !== 'undefined'; })
|
|
488
|
-
.forEach(function (key) { return searchParams.append(key, "" + params[key]); });
|
|
489
|
-
return searchParams;
|
|
490
|
-
};
|
|
491
459
|
var waitFor = function (variable, callback) {
|
|
492
460
|
if (variable in window) {
|
|
493
461
|
return callback();
|
|
@@ -502,23 +470,6 @@
|
|
|
502
470
|
setTimeout(function () { return el ? el.scrollIntoView() : (retries < 10 ? scrollToEl(id, retries + 1) : null); }, 100);
|
|
503
471
|
};
|
|
504
472
|
var scrollTop = function () { return window.scrollTo(0, 0); };
|
|
505
|
-
var animateCounter = function (total, callback) {
|
|
506
|
-
var animationDuration = 10;
|
|
507
|
-
var step = Math.pow(10, ("" + total).length - 1);
|
|
508
|
-
var maxSteps = parseInt("" + total / step, 10);
|
|
509
|
-
var current = 0;
|
|
510
|
-
var interval = setInterval(function () {
|
|
511
|
-
callback(current);
|
|
512
|
-
current += (step / animationDuration);
|
|
513
|
-
if (current > maxSteps * step) {
|
|
514
|
-
animationDuration = 100;
|
|
515
|
-
}
|
|
516
|
-
if (current > total) {
|
|
517
|
-
callback(total);
|
|
518
|
-
clearInterval(interval);
|
|
519
|
-
}
|
|
520
|
-
}, animationDuration);
|
|
521
|
-
};
|
|
522
473
|
var safeJSONParse = function (value, defaultValue) {
|
|
523
474
|
try {
|
|
524
475
|
return typeof value === 'string' ? JSON.parse(value) : value;
|
|
@@ -582,7 +533,7 @@
|
|
|
582
533
|
group[termId].values[nodeId].nodes.push(blankNode);
|
|
583
534
|
group[termId].values[nodeId].value = concatBlankNodeValue(group[termId].values[nodeId].value, blankNode.value);
|
|
584
535
|
grouppedValueKeys.forEach(function (arrayKey) {
|
|
585
|
-
var newValue = get$
|
|
536
|
+
var newValue = get$4(blankNode, arrayKey, []);
|
|
586
537
|
group[termId].values[nodeId][arrayKey] = __spreadArray(__spreadArray([], __read((group[termId].values[nodeId][arrayKey] || []))), __read((Array.isArray(newValue) ? newValue : [newValue])));
|
|
587
538
|
});
|
|
588
539
|
return group;
|
|
@@ -592,7 +543,7 @@
|
|
|
592
543
|
Object.keys(group.values).map(function (nodeId) {
|
|
593
544
|
var index = group.values[nodeId].index;
|
|
594
545
|
var termId = group.term['@id'];
|
|
595
|
-
var originalValue = get$
|
|
546
|
+
var originalValue = get$4(originalValues, "[" + index + "]." + key, []).filter(function (val) { return val.term['@id'] === termId; });
|
|
596
547
|
if (originalValue.length > 0) {
|
|
597
548
|
var value = originalValue.reduce(function (array, curr) { return concatBlankNodeValue(array, curr.value); }, []);
|
|
598
549
|
group.originalValues[nodeId] = { value: propertyValue$1(value) };
|
|
@@ -601,7 +552,6 @@
|
|
|
601
552
|
});
|
|
602
553
|
return groups;
|
|
603
554
|
};
|
|
604
|
-
var sortByFn = function (key, asc) { return function (a, b) { return asc ? get$5(a, key, '').localeCompare(get$5(b, key, '')) : get$5(b, key, '').localeCompare(get$5(a, key, '')); }; };
|
|
605
555
|
var ellipsis = function (text, maxlength) {
|
|
606
556
|
if (text === void 0) { text = ''; }
|
|
607
557
|
if (maxlength === void 0) { maxlength = 20; }
|
|
@@ -625,8 +575,6 @@
|
|
|
625
575
|
// handle years
|
|
626
576
|
.replace(/([0-9]{4})/g, function (g) { return "-" + g; }) :
|
|
627
577
|
null; };
|
|
628
|
-
var nodeTypeToString = function (type) { return "" + type.charAt(0).toLowerCase() + type.substring(1); };
|
|
629
|
-
var parseNodeType = function (type) { return Object.values(schema.NodeType).find(function (v) { return v.toString().toLowerCase() === (type || '').toLowerCase(); }); };
|
|
630
578
|
var nodeDefaultLabel = (_a$6 = {},
|
|
631
579
|
_a$6[schema.NodeType.ImpactAssessment] = function (_a) {
|
|
632
580
|
var name = _a.name, country = _a.country, endDate = _a.endDate, product = _a.product;
|
|
@@ -644,20 +592,6 @@
|
|
|
644
592
|
var defaultLabel = function (node) { return node ? (node['@type'] in nodeDefaultLabel ? nodeDefaultLabel[node['@type']](node) : node.name) || node['@id'] || node.id : ''; };
|
|
645
593
|
var itemColor = function (index) { return randomMaterialColor.getColor({ text: "" + index }); };
|
|
646
594
|
var listColor = function (_v, index) { return itemColor(index); };
|
|
647
|
-
var minutesBefore = function (date, minutes) {
|
|
648
|
-
if (minutes === void 0) { minutes = 1; }
|
|
649
|
-
date.setMinutes(date.getMinutes() - minutes);
|
|
650
|
-
return date;
|
|
651
|
-
};
|
|
652
|
-
var hoursBefore = function (date, hours) {
|
|
653
|
-
if (hours === void 0) { hours = 1; }
|
|
654
|
-
date.setHours(date.getHours() - hours);
|
|
655
|
-
return date;
|
|
656
|
-
};
|
|
657
|
-
var repeat = function (times) {
|
|
658
|
-
if (times === void 0) { times = 0; }
|
|
659
|
-
return (Array.from(Array(times), Math.random));
|
|
660
|
-
};
|
|
661
595
|
exports.DeltaDisplayType = void 0;
|
|
662
596
|
(function (DeltaDisplayType) {
|
|
663
597
|
DeltaDisplayType["absolute"] = "absolute";
|
|
@@ -683,6 +617,10 @@
|
|
|
683
617
|
DeltaColour["Danger"] = "danger";
|
|
684
618
|
})(exports.DeltaColour || (exports.DeltaColour = {}));
|
|
685
619
|
var emptyValue = function (value) { return utils.isEmpty(value) || isNaN(propertyValue$1(value)); };
|
|
620
|
+
var repeat = function (times) {
|
|
621
|
+
if (times === void 0) { times = 0; }
|
|
622
|
+
return (Array.from(Array(times), Math.random));
|
|
623
|
+
};
|
|
686
624
|
var filenameWithoutExt = function (filename) {
|
|
687
625
|
if (filename === void 0) { filename = ''; }
|
|
688
626
|
var file = api.fileToExt(filename, '');
|
|
@@ -855,295 +793,7 @@
|
|
|
855
793
|
type: i0.Input
|
|
856
794
|
}] } });
|
|
857
795
|
|
|
858
|
-
var _a$4, _b$1, _c$1
|
|
859
|
-
var searchableTypes = [
|
|
860
|
-
schema.NodeType.Cycle,
|
|
861
|
-
schema.NodeType.Source
|
|
862
|
-
];
|
|
863
|
-
var serializeSearchFilters = function (filters) { return Object.keys(filters || {})
|
|
864
|
-
.filter(function (key) { return filters[key].length; })
|
|
865
|
-
.map(function (key) { return key + "=" + filters[key].filter(Boolean).join('|'); })
|
|
866
|
-
.join(';'); };
|
|
867
|
-
var deserializeSearchFilters = function (filters) { return (filters || '').split(';').reduce(function (prev, curr) {
|
|
868
|
-
var _a = __read(curr.split('='), 2), key = _a[0], values = _a[1];
|
|
869
|
-
prev[key] = (values || '').split('|').filter(Boolean);
|
|
870
|
-
return prev;
|
|
871
|
-
}, {}); };
|
|
872
|
-
var matchType = function (type) { return Object.freeze({
|
|
873
|
-
match: { '@type': type }
|
|
874
|
-
}); };
|
|
875
|
-
var matchTermType = function (termType) { return Object.freeze({
|
|
876
|
-
match: { termType: termType }
|
|
877
|
-
}); };
|
|
878
|
-
var matchRegex = function (key, value) {
|
|
879
|
-
var _a;
|
|
880
|
-
return Object.freeze({
|
|
881
|
-
regexp: (_a = {}, _a[key] = { value: value.toString() }, _a)
|
|
882
|
-
});
|
|
883
|
-
};
|
|
884
|
-
var matchQuery = function (key, value, boost) {
|
|
885
|
-
var _a;
|
|
886
|
-
return Object.freeze({
|
|
887
|
-
match: (_a = {},
|
|
888
|
-
_a[key] = Object.assign({ query: value }, (boost ? { boost: boost } : {})),
|
|
889
|
-
_a)
|
|
890
|
-
});
|
|
891
|
-
};
|
|
892
|
-
var matchExactQuery = function (key, value, boost) { return matchQuery(key + ".keyword", value, boost); };
|
|
893
|
-
var matchNameNormalized = function (query, boost) {
|
|
894
|
-
if (boost === void 0) { boost = 20; }
|
|
895
|
-
return Object.freeze({
|
|
896
|
-
match: { nameNormalized: { query: query, boost: boost } }
|
|
897
|
-
});
|
|
898
|
-
};
|
|
899
|
-
var numberGte = function (key, value) {
|
|
900
|
-
var _a;
|
|
901
|
-
return Object.freeze({
|
|
902
|
-
range: (_a = {}, _a[key] = { gte: value }, _a)
|
|
903
|
-
});
|
|
904
|
-
};
|
|
905
|
-
var multiMatchQuery = function (query, fields, type, boost, analyzer) {
|
|
906
|
-
if (type === void 0) { type = 'best_fields'; }
|
|
907
|
-
return Object.freeze({
|
|
908
|
-
multi_match: Object.assign(Object.assign({ query: query, fields: fields, type: type }, (boost ? { boost: boost } : {})), (analyzer ? { analyzer: analyzer } : {}))
|
|
909
|
-
});
|
|
910
|
-
};
|
|
911
|
-
var matchPhraseQuery = function (query, boost) {
|
|
912
|
-
var fields = [];
|
|
913
|
-
for (var _i = 2; _i < arguments.length; _i++) {
|
|
914
|
-
fields[_i - 2] = arguments[_i];
|
|
915
|
-
}
|
|
916
|
-
return fields.length ? multiMatchQuery(query, fields, 'phrase', boost) : matchExactQuery('name', query, boost);
|
|
917
|
-
};
|
|
918
|
-
var matchPhrasePrefixQuery = function (query, boost) {
|
|
919
|
-
if (boost === void 0) { boost = 2; }
|
|
920
|
-
var fields = [];
|
|
921
|
-
for (var _i = 2; _i < arguments.length; _i++) {
|
|
922
|
-
fields[_i - 2] = arguments[_i];
|
|
923
|
-
}
|
|
924
|
-
return fields.length ?
|
|
925
|
-
multiMatchQuery(query, fields, 'phrase_prefix', boost) :
|
|
926
|
-
Object.freeze({
|
|
927
|
-
match_phrase_prefix: {
|
|
928
|
-
nameSearchAsYouType: {
|
|
929
|
-
query: query,
|
|
930
|
-
boost: boost
|
|
931
|
-
}
|
|
932
|
-
}
|
|
933
|
-
});
|
|
934
|
-
};
|
|
935
|
-
var matchBoolPrefixQuery = function (query, boost) {
|
|
936
|
-
if (boost === void 0) { boost = 1; }
|
|
937
|
-
var fields = [];
|
|
938
|
-
for (var _i = 2; _i < arguments.length; _i++) {
|
|
939
|
-
fields[_i - 2] = arguments[_i];
|
|
940
|
-
}
|
|
941
|
-
return fields.length ?
|
|
942
|
-
multiMatchQuery(query, fields, 'bool_prefix', boost) :
|
|
943
|
-
Object.freeze({
|
|
944
|
-
match_bool_prefix: {
|
|
945
|
-
name: {
|
|
946
|
-
query: query,
|
|
947
|
-
boost: boost
|
|
948
|
-
}
|
|
949
|
-
}
|
|
950
|
-
});
|
|
951
|
-
};
|
|
952
|
-
var wildcardQuery = function (query, boost) {
|
|
953
|
-
if (boost === void 0) { boost = 3; }
|
|
954
|
-
var fields = [];
|
|
955
|
-
for (var _i = 2; _i < arguments.length; _i++) {
|
|
956
|
-
fields[_i - 2] = arguments[_i];
|
|
957
|
-
}
|
|
958
|
-
return Object.freeze({
|
|
959
|
-
simple_query_string: {
|
|
960
|
-
query: "*" + query + "*",
|
|
961
|
-
fields: fields,
|
|
962
|
-
analyze_wildcard: true,
|
|
963
|
-
boost: boost
|
|
964
|
-
}
|
|
965
|
-
});
|
|
966
|
-
};
|
|
967
|
-
var matchCountryLevel = { match: { gadmLevel: 0 } };
|
|
968
|
-
var matchGlobalRegion = { regexp: { '@id': 'region-*' } };
|
|
969
|
-
var matchCountry = Object.freeze({
|
|
970
|
-
bool: {
|
|
971
|
-
should: [
|
|
972
|
-
matchCountryLevel,
|
|
973
|
-
matchGlobalRegion
|
|
974
|
-
],
|
|
975
|
-
minimum_should_match: 1
|
|
976
|
-
}
|
|
977
|
-
});
|
|
978
|
-
var countriesQuery = Object.freeze({
|
|
979
|
-
bool: {
|
|
980
|
-
must: [
|
|
981
|
-
matchType(schema.NodeType.Term),
|
|
982
|
-
matchTermType(schema.TermTermType.region),
|
|
983
|
-
matchCountryLevel
|
|
984
|
-
]
|
|
985
|
-
}
|
|
986
|
-
});
|
|
987
|
-
var allCountriesQuery = Object.freeze({
|
|
988
|
-
bool: Object.assign({ must: [
|
|
989
|
-
matchType(schema.NodeType.Term),
|
|
990
|
-
matchTermType(schema.TermTermType.region)
|
|
991
|
-
] }, matchCountry.bool)
|
|
992
|
-
});
|
|
993
|
-
var matchRegion = numberGte('gadmLevel', 1);
|
|
994
|
-
var regionsQuery = Object.freeze({
|
|
995
|
-
bool: {
|
|
996
|
-
must: [
|
|
997
|
-
matchType(schema.NodeType.Term),
|
|
998
|
-
matchTermType(schema.TermTermType.region),
|
|
999
|
-
matchRegion
|
|
1000
|
-
]
|
|
1001
|
-
}
|
|
1002
|
-
});
|
|
1003
|
-
var worldRegion = Object.freeze({
|
|
1004
|
-
'@id': 'region-world',
|
|
1005
|
-
name: 'World'
|
|
1006
|
-
});
|
|
1007
|
-
var cropsQuery = Object.freeze({
|
|
1008
|
-
bool: {
|
|
1009
|
-
must: [
|
|
1010
|
-
matchType(schema.NodeType.Term),
|
|
1011
|
-
matchTermType(schema.TermTermType.crop)
|
|
1012
|
-
]
|
|
1013
|
-
}
|
|
1014
|
-
});
|
|
1015
|
-
var matchAggregatedQuery = matchQuery('aggregated', true);
|
|
1016
|
-
var isNestedKey = function (key) { return schema.nestedSearchableKeys.includes(key.split('.')[0]); };
|
|
1017
|
-
var matchNestedKey = function (key, query) { return isNestedKey(key) ? {
|
|
1018
|
-
nested: { path: key.split('.')[0], query: query }
|
|
1019
|
-
} : query; };
|
|
1020
|
-
/**
|
|
1021
|
-
* List of fields to return in the search results.
|
|
1022
|
-
*/
|
|
1023
|
-
var searchResultsFields = Object.freeze((_a$4 = {},
|
|
1024
|
-
_a$4[schema.NodeType.Cycle] = [
|
|
1025
|
-
'description', 'dataDescription', 'endDate',
|
|
1026
|
-
'emissionsCount', 'inputsCount', 'productsCount',
|
|
1027
|
-
'site.location', 'site.country.name', 'site.region.name'
|
|
1028
|
-
],
|
|
1029
|
-
_a$4[schema.NodeType.Source] = ['bibliography.title', 'bibliography.documentDOI'],
|
|
1030
|
-
_a$4[schema.NodeType.ImpactAssessment] = ['emissionsResourceUseCount', 'impactsCount', 'country.name'],
|
|
1031
|
-
_a$4));
|
|
1032
|
-
/**
|
|
1033
|
-
* List of fields to search in.
|
|
1034
|
-
*/
|
|
1035
|
-
var searchFields = Object.freeze((_b$1 = {},
|
|
1036
|
-
_b$1[schema.NodeType.Cycle] = ['name', 'description', 'dataDescription'],
|
|
1037
|
-
_b$1[schema.NodeType.Source] = ['name', 'bibliography.title'],
|
|
1038
|
-
_b$1[schema.NodeType.ImpactAssessment] = ['name', 'product.name', 'country.name'],
|
|
1039
|
-
_b$1));
|
|
1040
|
-
var searchFieldsNested = Object.freeze((_c$1 = {},
|
|
1041
|
-
_c$1[schema.NodeType.Cycle] = [
|
|
1042
|
-
'inputs.term.name',
|
|
1043
|
-
'emissions.term.name',
|
|
1044
|
-
'practices.term.name'
|
|
1045
|
-
],
|
|
1046
|
-
_c$1[schema.NodeType.Source] = [],
|
|
1047
|
-
_c$1[schema.NodeType.ImpactAssessment] = [
|
|
1048
|
-
'emissionsResourceUse.term.name',
|
|
1049
|
-
'impacts.term.name'
|
|
1050
|
-
],
|
|
1051
|
-
_c$1));
|
|
1052
|
-
/**
|
|
1053
|
-
* Specific strict queries per type.
|
|
1054
|
-
*/
|
|
1055
|
-
var searchQueries = (_d$1 = {},
|
|
1056
|
-
_d$1[schema.NodeType.Cycle] = { must: [], must_not: [matchAggregatedQuery] },
|
|
1057
|
-
_d$1[schema.NodeType.Source] = { must: [], must_not: [matchAggregatedQuery] },
|
|
1058
|
-
_d$1);
|
|
1059
|
-
var searchFiltersKeys = (_e = {},
|
|
1060
|
-
_e[schema.NodeType.Cycle] = function (key) { return key; },
|
|
1061
|
-
_e[schema.NodeType.Source] = function (key) { return key; },
|
|
1062
|
-
_e);
|
|
1063
|
-
/* eslint-disable complexity */
|
|
1064
|
-
var searchQuery = function (type, query, filters, aggregated) {
|
|
1065
|
-
var boolQuery = (Object.assign(Object.assign({ must: [
|
|
1066
|
-
matchType(type),
|
|
1067
|
-
aggregated ? matchAggregatedQuery : null
|
|
1068
|
-
].filter(Boolean) }, (query ? {
|
|
1069
|
-
should: __spreadArray([
|
|
1070
|
-
matchPhraseQuery.apply(void 0, __spreadArray([query, 100], __read(searchFields[type]))),
|
|
1071
|
-
matchPhrasePrefixQuery.apply(void 0, __spreadArray([query, 20], __read(searchFields[type]))),
|
|
1072
|
-
matchBoolPrefixQuery.apply(void 0, __spreadArray([query, 10], __read(searchFields[type])))
|
|
1073
|
-
], __read(searchFieldsNested[type].map(function (field) { return matchNestedKey(field, matchBoolPrefixQuery(query, 1, field)); }))),
|
|
1074
|
-
minimum_should_match: 1
|
|
1075
|
-
} : {})), { must_not: [
|
|
1076
|
-
aggregated ? null : matchAggregatedQuery
|
|
1077
|
-
].filter(Boolean) }));
|
|
1078
|
-
var keys = Object.keys(filters || {}).filter(function (key) { return filters[key].length; });
|
|
1079
|
-
return {
|
|
1080
|
-
bool: keys.length ? {
|
|
1081
|
-
must: keys.map(function (key) {
|
|
1082
|
-
var filterKey = searchFiltersKeys[type](key);
|
|
1083
|
-
return {
|
|
1084
|
-
bool: {
|
|
1085
|
-
should: filters[key]
|
|
1086
|
-
.map(function (value) { return matchNestedKey(filterKey, matchExactQuery(filterKey, value)); })
|
|
1087
|
-
.map(function (must) {
|
|
1088
|
-
var localQuery = JSON.parse(JSON.stringify(boolQuery));
|
|
1089
|
-
localQuery.must.push(must);
|
|
1090
|
-
return { bool: localQuery };
|
|
1091
|
-
}),
|
|
1092
|
-
minimum_should_match: 1
|
|
1093
|
-
}
|
|
1094
|
-
};
|
|
1095
|
-
})
|
|
1096
|
-
} : boolQuery
|
|
1097
|
-
};
|
|
1098
|
-
};
|
|
1099
|
-
/* eslint-enable complexity */
|
|
1100
|
-
|
|
1101
|
-
var primaryProduct = function (_a) {
|
|
1102
|
-
var products = _a.products;
|
|
1103
|
-
return (products || []).find(function (_a) {
|
|
1104
|
-
var primary = _a.primary;
|
|
1105
|
-
return primary;
|
|
1106
|
-
});
|
|
1107
|
-
};
|
|
1108
|
-
|
|
1109
|
-
var HE_API_BASE_URL = new i0.InjectionToken('HE_API_BASE_URL');
|
|
1110
|
-
var HeCommonService = /** @class */ (function () {
|
|
1111
|
-
function HeCommonService(_apiBaseUrl) {
|
|
1112
|
-
this._apiBaseUrl = _apiBaseUrl;
|
|
1113
|
-
}
|
|
1114
|
-
Object.defineProperty(HeCommonService.prototype, "apiBaseUrl", {
|
|
1115
|
-
get: function () {
|
|
1116
|
-
return this._apiBaseUrl || '/api';
|
|
1117
|
-
},
|
|
1118
|
-
enumerable: false,
|
|
1119
|
-
configurable: true
|
|
1120
|
-
});
|
|
1121
|
-
Object.defineProperty(HeCommonService.prototype, "gitBranch", {
|
|
1122
|
-
get: function () {
|
|
1123
|
-
return ['dev', 'staging'].some(function (env) { return baseUrl().includes(env); })
|
|
1124
|
-
? 'develop'
|
|
1125
|
-
: 'master';
|
|
1126
|
-
},
|
|
1127
|
-
enumerable: false,
|
|
1128
|
-
configurable: true
|
|
1129
|
-
});
|
|
1130
|
-
return HeCommonService;
|
|
1131
|
-
}());
|
|
1132
|
-
HeCommonService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeCommonService, deps: [{ token: HE_API_BASE_URL }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1133
|
-
HeCommonService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeCommonService, providedIn: 'root' });
|
|
1134
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeCommonService, decorators: [{
|
|
1135
|
-
type: i0.Injectable,
|
|
1136
|
-
args: [{
|
|
1137
|
-
providedIn: 'root'
|
|
1138
|
-
}]
|
|
1139
|
-
}], ctorParameters: function () {
|
|
1140
|
-
return [{ type: undefined, decorators: [{
|
|
1141
|
-
type: i0.Inject,
|
|
1142
|
-
args: [HE_API_BASE_URL]
|
|
1143
|
-
}] }];
|
|
1144
|
-
} });
|
|
1145
|
-
|
|
1146
|
-
var _a$3, _b, _c;
|
|
796
|
+
var _a$4, _b$1, _c$1;
|
|
1147
797
|
var termProperties = function (term) { return Object.keys(term).filter(function (key) { return !schema.isExpandable(term[key]) && ![
|
|
1148
798
|
'pinned', 'expanded', 'extended', 'selected', 'loading',
|
|
1149
799
|
'_score', '@type', '@id', '@context', 'createdAt',
|
|
@@ -1169,20 +819,20 @@
|
|
|
1169
819
|
lng: longitude
|
|
1170
820
|
});
|
|
1171
821
|
};
|
|
1172
|
-
var termTypeToLabel = (_a$
|
|
1173
|
-
_a$
|
|
1174
|
-
_a$
|
|
1175
|
-
_a$
|
|
1176
|
-
_a$
|
|
1177
|
-
_a$
|
|
1178
|
-
_a$
|
|
822
|
+
var termTypeToLabel = (_a$4 = {},
|
|
823
|
+
_a$4[schema.TermTermType.methodEmissionResourceUse] = 'Method (Emissions)',
|
|
824
|
+
_a$4[schema.TermTermType.methodMeasurement] = 'Method (Measurement)',
|
|
825
|
+
_a$4[schema.TermTermType.pesticideAI] = 'Pesticide Active Ingredient',
|
|
826
|
+
_a$4[schema.TermTermType.standardsLabels] = 'Standards & Labels',
|
|
827
|
+
_a$4[schema.TermTermType.usdaSoilType] = 'USDA Soil Type',
|
|
828
|
+
_a$4);
|
|
1179
829
|
var termTypeLabel = function (type) {
|
|
1180
830
|
if (type === void 0) { type = 'N/A'; }
|
|
1181
831
|
return type in termTypeToLabel ? termTypeToLabel[type] : keyToLabel(type);
|
|
1182
832
|
};
|
|
1183
833
|
var termTypesToChildren = function (termTypes) { return termTypes.map(function (termType) { return ({ label: termTypeLabel(termType), termType: termType }); }); };
|
|
1184
|
-
var groups = Object.freeze((_b = {},
|
|
1185
|
-
_b[schema.TermTermType.emission] = {
|
|
834
|
+
var groups = Object.freeze((_b$1 = {},
|
|
835
|
+
_b$1[schema.TermTermType.emission] = {
|
|
1186
836
|
label: 'Emissions & Resource Use',
|
|
1187
837
|
termType: 'Emissions & Resource Use',
|
|
1188
838
|
children: termTypesToChildren([
|
|
@@ -1194,12 +844,12 @@
|
|
|
1194
844
|
schema.TermTermType.methodEmissionResourceUse
|
|
1195
845
|
])
|
|
1196
846
|
},
|
|
1197
|
-
_b[schema.TermTermType.region] = {
|
|
847
|
+
_b$1[schema.TermTermType.region] = {
|
|
1198
848
|
label: termTypeLabel(schema.TermTermType.region),
|
|
1199
849
|
termType: schema.TermTermType.region,
|
|
1200
850
|
children: []
|
|
1201
851
|
},
|
|
1202
|
-
_b.infrastructure = {
|
|
852
|
+
_b$1.infrastructure = {
|
|
1203
853
|
label: 'Infrastructure & Equipment',
|
|
1204
854
|
termType: 'Infrastructure & Equipment',
|
|
1205
855
|
children: termTypesToChildren([
|
|
@@ -1210,7 +860,7 @@
|
|
|
1210
860
|
schema.TermTermType.machinery
|
|
1211
861
|
])
|
|
1212
862
|
},
|
|
1213
|
-
_b.input = {
|
|
863
|
+
_b$1.input = {
|
|
1214
864
|
label: 'Inputs',
|
|
1215
865
|
termType: 'Inputs',
|
|
1216
866
|
children: termTypesToChildren([
|
|
@@ -1228,7 +878,7 @@
|
|
|
1228
878
|
schema.TermTermType.water
|
|
1229
879
|
])
|
|
1230
880
|
},
|
|
1231
|
-
_b[schema.TermTermType.measurement] = {
|
|
881
|
+
_b$1[schema.TermTermType.measurement] = {
|
|
1232
882
|
label: 'Measurements',
|
|
1233
883
|
termType: 'Measurements',
|
|
1234
884
|
children: termTypesToChildren([
|
|
@@ -1239,7 +889,7 @@
|
|
|
1239
889
|
schema.TermTermType.methodMeasurement
|
|
1240
890
|
])
|
|
1241
891
|
},
|
|
1242
|
-
_b.practice = {
|
|
892
|
+
_b$1.practice = {
|
|
1243
893
|
label: 'Practices',
|
|
1244
894
|
termType: 'Production Practices',
|
|
1245
895
|
children: termTypesToChildren([
|
|
@@ -1257,7 +907,7 @@
|
|
|
1257
907
|
schema.TermTermType.waterRegime,
|
|
1258
908
|
])
|
|
1259
909
|
},
|
|
1260
|
-
_b.product = {
|
|
910
|
+
_b$1.product = {
|
|
1261
911
|
label: 'Products',
|
|
1262
912
|
termType: 'Products',
|
|
1263
913
|
children: termTypesToChildren([
|
|
@@ -1270,12 +920,12 @@
|
|
|
1270
920
|
schema.TermTermType.processedFood
|
|
1271
921
|
])
|
|
1272
922
|
},
|
|
1273
|
-
_b[schema.TermTermType.property] = {
|
|
923
|
+
_b$1[schema.TermTermType.property] = {
|
|
1274
924
|
label: termTypeLabel(schema.TermTermType.property),
|
|
1275
925
|
termType: schema.TermTermType.property,
|
|
1276
926
|
children: []
|
|
1277
927
|
},
|
|
1278
|
-
_b));
|
|
928
|
+
_b$1));
|
|
1279
929
|
var termTypeGroups = [
|
|
1280
930
|
groups.property,
|
|
1281
931
|
groups.region,
|
|
@@ -1286,10 +936,10 @@
|
|
|
1286
936
|
groups.measurement,
|
|
1287
937
|
groups.infrastructure
|
|
1288
938
|
];
|
|
1289
|
-
var termToParent = (_c = {},
|
|
1290
|
-
_c[schema.TermTermType.property] = 'Properties',
|
|
1291
|
-
_c[schema.TermTermType.region] = 'Geographies',
|
|
1292
|
-
_c);
|
|
939
|
+
var termToParent = (_c$1 = {},
|
|
940
|
+
_c$1[schema.TermTermType.property] = 'Properties',
|
|
941
|
+
_c$1[schema.TermTermType.region] = 'Geographies',
|
|
942
|
+
_c$1);
|
|
1293
943
|
var termChildToParent = function (termType) { return termTypeGroups.find(function (_a) {
|
|
1294
944
|
var children = _a.children;
|
|
1295
945
|
return (children || []).some(function (child) { return child.termType === termType; });
|
|
@@ -1344,6 +994,52 @@
|
|
|
1344
994
|
schema.TermTermType.standardsLabels
|
|
1345
995
|
];
|
|
1346
996
|
|
|
997
|
+
var HE_API_BASE_URL = new i0.InjectionToken('HE_API_BASE_URL');
|
|
998
|
+
var HeCommonService = /** @class */ (function () {
|
|
999
|
+
function HeCommonService(_apiBaseUrl) {
|
|
1000
|
+
this._apiBaseUrl = _apiBaseUrl;
|
|
1001
|
+
}
|
|
1002
|
+
Object.defineProperty(HeCommonService.prototype, "apiBaseUrl", {
|
|
1003
|
+
get: function () {
|
|
1004
|
+
return this._apiBaseUrl || '/api';
|
|
1005
|
+
},
|
|
1006
|
+
enumerable: false,
|
|
1007
|
+
configurable: true
|
|
1008
|
+
});
|
|
1009
|
+
return HeCommonService;
|
|
1010
|
+
}());
|
|
1011
|
+
HeCommonService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeCommonService, deps: [{ token: HE_API_BASE_URL }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1012
|
+
HeCommonService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeCommonService, providedIn: 'root' });
|
|
1013
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeCommonService, decorators: [{
|
|
1014
|
+
type: i0.Injectable,
|
|
1015
|
+
args: [{
|
|
1016
|
+
providedIn: 'root'
|
|
1017
|
+
}]
|
|
1018
|
+
}], ctorParameters: function () {
|
|
1019
|
+
return [{ type: undefined, decorators: [{
|
|
1020
|
+
type: i0.Inject,
|
|
1021
|
+
args: [HE_API_BASE_URL]
|
|
1022
|
+
}] }];
|
|
1023
|
+
} });
|
|
1024
|
+
|
|
1025
|
+
var nodeTypeUrl = function (apiBaseUrl, type) { return type ? apiBaseUrl + "/" + api.nodeTypeToParam(type) : ''; };
|
|
1026
|
+
/**
|
|
1027
|
+
* Get the full url to fetch the node data.
|
|
1028
|
+
*
|
|
1029
|
+
* @param apiBaseUrl The url of the API hosting the data.
|
|
1030
|
+
* @param node The node with a type, id and optionally a dataState
|
|
1031
|
+
* @returns The full url.
|
|
1032
|
+
*/
|
|
1033
|
+
var nodeUrl = function (apiBaseUrl, _a) {
|
|
1034
|
+
var dataState = _a.dataState, node = __rest(_a, ["dataState"]);
|
|
1035
|
+
return nodeTypeUrl(apiBaseUrl, node['@type'] || node.type) + "/" + (node['@id'] || node.id) + (dataState ? "?dataState=" + dataState : '');
|
|
1036
|
+
};
|
|
1037
|
+
var nodeLogsUrl = function (apiBaseUrl, _a) {
|
|
1038
|
+
var dataState = _a.dataState, node = __rest(_a, ["dataState"]);
|
|
1039
|
+
return nodeUrl(apiBaseUrl, node) + "/log" + (dataState ? "?dataState=" + dataState : '');
|
|
1040
|
+
};
|
|
1041
|
+
var lookupUrl = function (filename) { return filename.startsWith('http') ? filename : baseUrl() + "/glossary/lookups/" + filename + ".csv"; };
|
|
1042
|
+
var termTypeLookupUrl = function (termType) { return baseUrl() + "/glossary/" + termChildToParent(termType).termType + "/" + termType + ".csv"; };
|
|
1347
1043
|
var HeNodeService = /** @class */ (function () {
|
|
1348
1044
|
function HeNodeService(http, authService, commonService) {
|
|
1349
1045
|
this.http = http;
|
|
@@ -1398,28 +1094,20 @@
|
|
|
1398
1094
|
.catch(function () { return (responseType === 'json' ? ({}) : ''); });
|
|
1399
1095
|
};
|
|
1400
1096
|
HeNodeService.prototype.nodeTypeUrl = function (type) {
|
|
1401
|
-
return this.commonService.apiBaseUrl
|
|
1097
|
+
return nodeTypeUrl(this.commonService.apiBaseUrl, type);
|
|
1402
1098
|
};
|
|
1403
|
-
HeNodeService.prototype.nodeUrl = function (
|
|
1404
|
-
|
|
1405
|
-
return this.nodeTypeUrl(node['@type'] || node.type) + "/" + (node['@id'] || node.id) + (dataState ? "?dataState=" + dataState : '');
|
|
1406
|
-
};
|
|
1407
|
-
HeNodeService.prototype.nodeLogsUrl = function (_a) {
|
|
1408
|
-
var dataState = _a.dataState, node = __rest(_a, ["dataState"]);
|
|
1409
|
-
return this.nodeUrl(node) + "/log" + (dataState ? "?dataState=" + dataState : '');
|
|
1099
|
+
HeNodeService.prototype.nodeUrl = function (node) {
|
|
1100
|
+
return nodeUrl(this.commonService.apiBaseUrl, node);
|
|
1410
1101
|
};
|
|
1411
|
-
HeNodeService.prototype.
|
|
1412
|
-
return
|
|
1413
|
-
};
|
|
1414
|
-
HeNodeService.prototype.termTypeLookupUrl = function (termType) {
|
|
1415
|
-
return baseUrl() + "/glossary/" + termChildToParent(termType).termType + "/" + termType + ".csv";
|
|
1102
|
+
HeNodeService.prototype.nodeLogsUrl = function (node) {
|
|
1103
|
+
return nodeLogsUrl(this.commonService.apiBaseUrl, node);
|
|
1416
1104
|
};
|
|
1417
1105
|
HeNodeService.prototype.downloadLookup = function (filename) {
|
|
1418
1106
|
return __awaiter(this, void 0, void 0, function () {
|
|
1419
1107
|
var url;
|
|
1420
1108
|
return __generator(this, function (_b) {
|
|
1421
1109
|
try {
|
|
1422
|
-
url =
|
|
1110
|
+
url = lookupUrl(filename);
|
|
1423
1111
|
return [2 /*return*/, this.downloadRaw(url, 'text')];
|
|
1424
1112
|
}
|
|
1425
1113
|
catch (_err) {
|
|
@@ -1439,7 +1127,7 @@
|
|
|
1439
1127
|
return [4 /*yield*/, this.downloadLookup(termType)];
|
|
1440
1128
|
case 1:
|
|
1441
1129
|
data = _b.sent();
|
|
1442
|
-
return [2 /*return*/, (data === null || data === void 0 ? void 0 : data.startsWith('term.id')) ?
|
|
1130
|
+
return [2 /*return*/, (data === null || data === void 0 ? void 0 : data.startsWith('term.id')) ? lookupUrl(termType) : null];
|
|
1443
1131
|
case 2:
|
|
1444
1132
|
_err_1 = _b.sent();
|
|
1445
1133
|
return [2 /*return*/, null];
|
|
@@ -1459,54 +1147,15 @@
|
|
|
1459
1147
|
}]
|
|
1460
1148
|
}], ctorParameters: function () { return [{ type: i1__namespace$1.HttpClient }, { type: HeAuthService }, { type: HeCommonService }]; } });
|
|
1461
1149
|
|
|
1462
|
-
var
|
|
1150
|
+
var gitUrl$1 = function () { return gitHome + "/hestia-aggregation-engine/-/blob/" + gitBranch(); };
|
|
1151
|
+
var rawUrl$1 = function () { return gitRawBaseUrl + "/hestia-aggregation-engine/-/raw/" + gitBranch(); };
|
|
1463
1152
|
var lookups = Object.freeze({
|
|
1464
1153
|
cropYield: 'region-crop-cropGroupingFaostatProduction-yield',
|
|
1465
1154
|
cropGroupingColumn: 'cropGroupingFaostatProduction'
|
|
1466
1155
|
});
|
|
1467
|
-
var extractGroupedDataClosesDate = function (data, year) {
|
|
1468
|
-
var dataByDate = (data || '').split(';').reduce(function (prev, curr) {
|
|
1469
|
-
var _d;
|
|
1470
|
-
return (Object.assign(Object.assign({}, prev), (curr.length > 0 && curr.split(':')[1] !== '-' ? (_d = {}, _d[curr.split(':')[0]] = curr.split(':')[1], _d) : {})));
|
|
1471
|
-
}, {});
|
|
1472
|
-
var years = Object.keys(dataByDate).map(function (v) { return +v; });
|
|
1473
|
-
var closestYear = years.reduce(function (prev, curr) { return Math.abs(curr - year) < Math.abs(prev - year) ? curr : prev; }, 0);
|
|
1474
|
-
return closestYear ? +dataByDate[closestYear] / 10 : null;
|
|
1475
|
-
};
|
|
1476
|
-
var cropGrouping = function (lookup, product) { return (lookup.find(function (_d) {
|
|
1477
|
-
var term = _d.term;
|
|
1478
|
-
return term.id === (product === null || product === void 0 ? void 0 : product.term['@id']);
|
|
1479
|
-
}) || {})[lookups.cropGroupingColumn]; };
|
|
1480
|
-
var cropYieldCountry = function (cropYield, cycle) { return cropYield.find(function (_d) {
|
|
1481
|
-
var term = _d.term;
|
|
1482
|
-
return term.id === get$4(cycle, 'site.country.@id', worldRegion['@id']);
|
|
1483
|
-
}) || {}; };
|
|
1484
|
-
var extendCycle = function (_d) {
|
|
1485
|
-
var crop = _d.crop, cropYield = _d.cropYield;
|
|
1486
|
-
return function (cycle) {
|
|
1487
|
-
var _a, _b, _c;
|
|
1488
|
-
var product = primaryProduct(cycle);
|
|
1489
|
-
var grouping = cropGrouping(crop, product);
|
|
1490
|
-
var countryData = cropYieldCountry(cropYield, cycle)[grouping];
|
|
1491
|
-
var countryValue = extractGroupedDataClosesDate(countryData, +(cycle.endDate || ''));
|
|
1492
|
-
var productValue = propertyValue$1(product === null || product === void 0 ? void 0 : product.value);
|
|
1493
|
-
return {
|
|
1494
|
-
cycle: cycle,
|
|
1495
|
-
name: (_a = product === null || product === void 0 ? void 0 : product.term) === null || _a === void 0 ? void 0 : _a.name,
|
|
1496
|
-
startDate: cycle.startDate,
|
|
1497
|
-
endDate: cycle.endDate,
|
|
1498
|
-
country: ((_c = (_b = cycle.site) === null || _b === void 0 ? void 0 : _b.country) === null || _c === void 0 ? void 0 : _c.name) || worldRegion.name,
|
|
1499
|
-
observations: propertyValue$1(product === null || product === void 0 ? void 0 : product.observations) || 0,
|
|
1500
|
-
yield: productValue,
|
|
1501
|
-
faoYield: countryValue || undefined,
|
|
1502
|
-
diff: delta(productValue, countryValue)
|
|
1503
|
-
};
|
|
1504
|
-
};
|
|
1505
|
-
};
|
|
1506
1156
|
var HeAggregationEngineService = /** @class */ (function () {
|
|
1507
|
-
function HeAggregationEngineService(http,
|
|
1157
|
+
function HeAggregationEngineService(http, nodeService) {
|
|
1508
1158
|
this.http = http;
|
|
1509
|
-
this.commonService = commonService;
|
|
1510
1159
|
this.nodeService = nodeService;
|
|
1511
1160
|
this.modelsLoading = false;
|
|
1512
1161
|
this.modelsLoaded = false;
|
|
@@ -1518,38 +1167,24 @@
|
|
|
1518
1167
|
}
|
|
1519
1168
|
HeAggregationEngineService.prototype.init = function () {
|
|
1520
1169
|
return __awaiter(this, void 0, void 0, function () {
|
|
1521
|
-
return __generator(this, function (
|
|
1522
|
-
switch (
|
|
1170
|
+
return __generator(this, function (_b) {
|
|
1171
|
+
switch (_b.label) {
|
|
1523
1172
|
case 0: return [4 /*yield*/, this.loadModels().toPromise()];
|
|
1524
1173
|
case 1:
|
|
1525
|
-
|
|
1174
|
+
_b.sent();
|
|
1526
1175
|
return [2 /*return*/];
|
|
1527
1176
|
}
|
|
1528
1177
|
});
|
|
1529
1178
|
});
|
|
1530
|
-
};
|
|
1531
|
-
Object.defineProperty(HeAggregationEngineService.prototype, "gitUrl", {
|
|
1532
|
-
get: function () {
|
|
1533
|
-
return gitHome + "/hestia-aggregation-engine/-/blob/" + this.commonService.gitBranch;
|
|
1534
|
-
},
|
|
1535
|
-
enumerable: false,
|
|
1536
|
-
configurable: true
|
|
1537
|
-
});
|
|
1538
|
-
Object.defineProperty(HeAggregationEngineService.prototype, "rawUrl", {
|
|
1539
|
-
get: function () {
|
|
1540
|
-
return gitRawBaseUrl + "/hestia-aggregation-engine/-/raw/" + this.commonService.gitBranch;
|
|
1541
|
-
},
|
|
1542
|
-
enumerable: false,
|
|
1543
|
-
configurable: true
|
|
1544
|
-
});
|
|
1179
|
+
};
|
|
1545
1180
|
HeAggregationEngineService.prototype.loadModels = function () {
|
|
1546
1181
|
var _this = this;
|
|
1547
1182
|
this.modelsLoading = true;
|
|
1548
|
-
return this.http.get(
|
|
1549
|
-
var links =
|
|
1183
|
+
return this.http.get(rawUrl$1() + "/model-links.json").pipe(operators.catchError(function () { return rxjs.of({ links: [] }); }), operators.map(function (_b) {
|
|
1184
|
+
var links = _b.links;
|
|
1550
1185
|
_this._models.next(links.map(function (_a) {
|
|
1551
1186
|
var modelPath = _a.path, docPath = _a.docPath, link = __rest(_a, ["path", "docPath"]);
|
|
1552
|
-
return (Object.assign(Object.assign({}, link), { path:
|
|
1187
|
+
return (Object.assign(Object.assign({}, link), { path: gitUrl$1() + "/" + modelPath, docPath: gitUrl$1() + "/" + docPath }));
|
|
1553
1188
|
}));
|
|
1554
1189
|
_this.modelsLoading = false;
|
|
1555
1190
|
_this.modelsLoaded = true;
|
|
@@ -1575,11 +1210,11 @@
|
|
|
1575
1210
|
HeAggregationEngineService.prototype.loadLookup = function (filename) {
|
|
1576
1211
|
return __awaiter(this, void 0, void 0, function () {
|
|
1577
1212
|
var data;
|
|
1578
|
-
return __generator(this, function (
|
|
1579
|
-
switch (
|
|
1213
|
+
return __generator(this, function (_b) {
|
|
1214
|
+
switch (_b.label) {
|
|
1580
1215
|
case 0: return [4 /*yield*/, this.nodeService.downloadLookup(filename)];
|
|
1581
1216
|
case 1:
|
|
1582
|
-
data =
|
|
1217
|
+
data = _b.sent();
|
|
1583
1218
|
return [2 /*return*/, csvtojson__namespace({ delimiter: 'auto' }).fromString(data)];
|
|
1584
1219
|
}
|
|
1585
1220
|
});
|
|
@@ -1609,16 +1244,18 @@
|
|
|
1609
1244
|
};
|
|
1610
1245
|
return HeAggregationEngineService;
|
|
1611
1246
|
}());
|
|
1612
|
-
HeAggregationEngineService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeAggregationEngineService, deps: [{ token: i1__namespace$1.HttpClient }, { token:
|
|
1247
|
+
HeAggregationEngineService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeAggregationEngineService, deps: [{ token: i1__namespace$1.HttpClient }, { token: HeNodeService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1613
1248
|
HeAggregationEngineService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeAggregationEngineService, providedIn: 'root' });
|
|
1614
1249
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeAggregationEngineService, decorators: [{
|
|
1615
1250
|
type: i0.Injectable,
|
|
1616
1251
|
args: [{
|
|
1617
1252
|
providedIn: 'root'
|
|
1618
1253
|
}]
|
|
1619
|
-
}], ctorParameters: function () { return [{ type: i1__namespace$1.HttpClient }, { type:
|
|
1254
|
+
}], ctorParameters: function () { return [{ type: i1__namespace$1.HttpClient }, { type: HeNodeService }]; } });
|
|
1620
1255
|
|
|
1621
1256
|
var HE_ORCHESTRATOR_BASE_URL = new i0.InjectionToken('HE_ORCHESTRATOR_BASE_URL');
|
|
1257
|
+
var gitUrl = function () { return gitHome + "/hestia-engine-models/-/blob/" + gitBranch(); };
|
|
1258
|
+
var rawUrl = function () { return gitRawBaseUrl + "/hestia-engine-models/-/raw/" + gitBranch(); };
|
|
1622
1259
|
var findConfigModels = function (_b, modelId, modelKey) {
|
|
1623
1260
|
var models = _b.models;
|
|
1624
1261
|
return models.flat().filter(function (_b) {
|
|
@@ -1636,9 +1273,8 @@
|
|
|
1636
1273
|
].filter(Boolean).join('-')
|
|
1637
1274
|
].join('/'); };
|
|
1638
1275
|
var HeEngineService = /** @class */ (function () {
|
|
1639
|
-
function HeEngineService(http
|
|
1276
|
+
function HeEngineService(http) {
|
|
1640
1277
|
this.http = http;
|
|
1641
|
-
this.commonService = commonService;
|
|
1642
1278
|
this.modelsLoading = false;
|
|
1643
1279
|
this.modelsLoaded = false;
|
|
1644
1280
|
this._models = new rxjs.ReplaySubject(1);
|
|
@@ -1656,28 +1292,14 @@
|
|
|
1656
1292
|
});
|
|
1657
1293
|
});
|
|
1658
1294
|
};
|
|
1659
|
-
Object.defineProperty(HeEngineService.prototype, "gitUrl", {
|
|
1660
|
-
get: function () {
|
|
1661
|
-
return gitHome + "/hestia-engine-models/-/blob/" + this.commonService.gitBranch;
|
|
1662
|
-
},
|
|
1663
|
-
enumerable: false,
|
|
1664
|
-
configurable: true
|
|
1665
|
-
});
|
|
1666
|
-
Object.defineProperty(HeEngineService.prototype, "rawUrl", {
|
|
1667
|
-
get: function () {
|
|
1668
|
-
return gitRawBaseUrl + "/hestia-engine-models/-/raw/" + this.commonService.gitBranch;
|
|
1669
|
-
},
|
|
1670
|
-
enumerable: false,
|
|
1671
|
-
configurable: true
|
|
1672
|
-
});
|
|
1673
1295
|
HeEngineService.prototype.loadModels = function () {
|
|
1674
1296
|
var _this = this;
|
|
1675
1297
|
this.modelsLoading = true;
|
|
1676
|
-
return this.http.get(
|
|
1298
|
+
return this.http.get(rawUrl() + "/model-links.json").pipe(operators.catchError(function () { return rxjs.of({ links: [] }); }), operators.map(function (_b) {
|
|
1677
1299
|
var links = _b.links;
|
|
1678
1300
|
_this._models.next(links.map(function (_a) {
|
|
1679
1301
|
var path = _a.path, docPath = _a.docPath, link = __rest(_a, ["path", "docPath"]);
|
|
1680
|
-
return (Object.assign(Object.assign({}, link), { path:
|
|
1302
|
+
return (Object.assign(Object.assign({}, link), { path: gitUrl() + "/" + path, docPath: gitUrl() + "/" + docPath, apiDocsPath: pathToApiDocsPath(link.model, link.term || link.modelKey) }));
|
|
1681
1303
|
}));
|
|
1682
1304
|
_this.modelsLoading = false;
|
|
1683
1305
|
_this.modelsLoaded = true;
|
|
@@ -1707,14 +1329,14 @@
|
|
|
1707
1329
|
};
|
|
1708
1330
|
return HeEngineService;
|
|
1709
1331
|
}());
|
|
1710
|
-
HeEngineService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeEngineService, deps: [{ token: i1__namespace$1.HttpClient }
|
|
1332
|
+
HeEngineService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeEngineService, deps: [{ token: i1__namespace$1.HttpClient }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1711
1333
|
HeEngineService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeEngineService, providedIn: 'root' });
|
|
1712
1334
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeEngineService, decorators: [{
|
|
1713
1335
|
type: i0.Injectable,
|
|
1714
1336
|
args: [{
|
|
1715
1337
|
providedIn: 'root'
|
|
1716
1338
|
}]
|
|
1717
|
-
}], ctorParameters: function () { return [{ type: i1__namespace$1.HttpClient }
|
|
1339
|
+
}], ctorParameters: function () { return [{ type: i1__namespace$1.HttpClient }]; } });
|
|
1718
1340
|
|
|
1719
1341
|
var NodeKeyState;
|
|
1720
1342
|
(function (NodeKeyState) {
|
|
@@ -2390,11 +2012,11 @@
|
|
|
2390
2012
|
}] } });
|
|
2391
2013
|
|
|
2392
2014
|
var toastId = 0;
|
|
2393
|
-
var
|
|
2394
|
-
function
|
|
2015
|
+
var HeToastService = /** @class */ (function () {
|
|
2016
|
+
function HeToastService() {
|
|
2395
2017
|
this.toasts = new rxjs.ReplaySubject(1);
|
|
2396
2018
|
}
|
|
2397
|
-
|
|
2019
|
+
HeToastService.prototype.success = function (message, duration) {
|
|
2398
2020
|
if (duration === void 0) { duration = 3000; }
|
|
2399
2021
|
this.toasts.next({
|
|
2400
2022
|
id: ++toastId,
|
|
@@ -2404,7 +2026,7 @@
|
|
|
2404
2026
|
showRawMessage: true
|
|
2405
2027
|
});
|
|
2406
2028
|
};
|
|
2407
|
-
|
|
2029
|
+
HeToastService.prototype.error = function (message, showRawMessage, duration) {
|
|
2408
2030
|
if (showRawMessage === void 0) { showRawMessage = true; }
|
|
2409
2031
|
if (duration === void 0) { duration = 3000; }
|
|
2410
2032
|
this.toasts.next({
|
|
@@ -2415,11 +2037,11 @@
|
|
|
2415
2037
|
showRawMessage: showRawMessage
|
|
2416
2038
|
});
|
|
2417
2039
|
};
|
|
2418
|
-
return
|
|
2040
|
+
return HeToastService;
|
|
2419
2041
|
}());
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type:
|
|
2042
|
+
HeToastService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeToastService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
2043
|
+
HeToastService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeToastService, providedIn: 'root' });
|
|
2044
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeToastService, decorators: [{
|
|
2423
2045
|
type: i0.Injectable,
|
|
2424
2046
|
args: [{
|
|
2425
2047
|
providedIn: 'root'
|
|
@@ -2451,7 +2073,7 @@
|
|
|
2451
2073
|
};
|
|
2452
2074
|
return ToastComponent;
|
|
2453
2075
|
}());
|
|
2454
|
-
ToastComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ToastComponent, deps: [{ token:
|
|
2076
|
+
ToastComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ToastComponent, deps: [{ token: HeToastService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
2455
2077
|
ToastComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ToastComponent, selector: "he-toast", ngImport: i0__namespace, template: "<div class=\"mb-3 columns is-centered is-vcentered\">\n <div class=\"notification is-{{toast.color}}\" role=\"alert\" *ngFor=\"let toast of toasts\">\n <button class=\"delete\" aria-label=\"delete\" (click)=\"dismiss(toast)\">\n <span aria-hidden=\"true\">×</span>\n </button>\n <strong [ngSwitch]=\"toast.color\">\n <ng-container *ngSwitchCase=\"'danger'\">\n <ng-container [ngSwitch]=\"toast.message\">\n <span *ngSwitchCase=\"'Unauthorized'\">You are not allowed to perform this action.</span>\n <span *ngSwitchCase=\"'form-invalid'\">Please fix all the errors on this page.</span>\n <span *ngSwitchCase=\"'users-email-already-taken'\">Email already taken.</span>\n <span *ngSwitchCase=\"'users-auth-already-taken'\">Account already connected.</span>\n <span *ngSwitchDefault>\n <span *ngIf=\"toast.showRawMessage\">{{toast.message}}</span>\n <span [class.is-hidden]=\"toast.showRawMessage\">An unknown error occurred. Please try again later.</span>\n </span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <span *ngIf=\"toast.showRawMessage\">{{toast.message}}</span>\n <span [class.is-hidden]=\"toast.showRawMessage\">An unknown error occurred. Please try again later.</span>\n </ng-container>\n </strong>\n </div>\n</div>\n", styles: [":host{bottom:0;position:fixed;width:100%}\n"], directives: [{ type: i3__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i3__namespace.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i3__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
2456
2078
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ToastComponent, decorators: [{
|
|
2457
2079
|
type: i0.Component,
|
|
@@ -2460,7 +2082,7 @@
|
|
|
2460
2082
|
templateUrl: './toast.component.html',
|
|
2461
2083
|
styleUrls: ['./toast.component.scss']
|
|
2462
2084
|
}]
|
|
2463
|
-
}], ctorParameters: function () { return [{ type:
|
|
2085
|
+
}], ctorParameters: function () { return [{ type: HeToastService }]; } });
|
|
2464
2086
|
|
|
2465
2087
|
var KeysPipe = /** @class */ (function () {
|
|
2466
2088
|
function KeysPipe() {
|
|
@@ -2944,6 +2566,249 @@
|
|
|
2944
2566
|
}]
|
|
2945
2567
|
}], ctorParameters: function () { return [{ type: i1__namespace$1.HttpClient }, { type: HeCommonService }]; } });
|
|
2946
2568
|
|
|
2569
|
+
var _a$3, _b, _c, _d$1, _e;
|
|
2570
|
+
var searchableTypes = [
|
|
2571
|
+
schema.NodeType.Cycle,
|
|
2572
|
+
schema.NodeType.Source
|
|
2573
|
+
];
|
|
2574
|
+
var serializeSearchFilters = function (filters) { return Object.keys(filters || {})
|
|
2575
|
+
.filter(function (key) { return filters[key].length; })
|
|
2576
|
+
.map(function (key) { return key + "=" + filters[key].filter(Boolean).join('|'); })
|
|
2577
|
+
.join(';'); };
|
|
2578
|
+
var deserializeSearchFilters = function (filters) { return (filters || '').split(';').reduce(function (prev, curr) {
|
|
2579
|
+
var _a = __read(curr.split('='), 2), key = _a[0], values = _a[1];
|
|
2580
|
+
prev[key] = (values || '').split('|').filter(Boolean);
|
|
2581
|
+
return prev;
|
|
2582
|
+
}, {}); };
|
|
2583
|
+
var matchType = function (type) { return Object.freeze({
|
|
2584
|
+
match: { '@type': type }
|
|
2585
|
+
}); };
|
|
2586
|
+
var matchTermType = function (termType) { return Object.freeze({
|
|
2587
|
+
match: { termType: termType }
|
|
2588
|
+
}); };
|
|
2589
|
+
var matchRegex = function (key, value) {
|
|
2590
|
+
var _a;
|
|
2591
|
+
return Object.freeze({
|
|
2592
|
+
regexp: (_a = {}, _a[key] = { value: value.toString() }, _a)
|
|
2593
|
+
});
|
|
2594
|
+
};
|
|
2595
|
+
var matchQuery = function (key, value, boost) {
|
|
2596
|
+
var _a;
|
|
2597
|
+
return Object.freeze({
|
|
2598
|
+
match: (_a = {},
|
|
2599
|
+
_a[key] = Object.assign({ query: value }, (boost ? { boost: boost } : {})),
|
|
2600
|
+
_a)
|
|
2601
|
+
});
|
|
2602
|
+
};
|
|
2603
|
+
var matchExactQuery = function (key, value, boost) { return matchQuery(key + ".keyword", value, boost); };
|
|
2604
|
+
var matchNameNormalized = function (query, boost) {
|
|
2605
|
+
if (boost === void 0) { boost = 20; }
|
|
2606
|
+
return Object.freeze({
|
|
2607
|
+
match: { nameNormalized: { query: query, boost: boost } }
|
|
2608
|
+
});
|
|
2609
|
+
};
|
|
2610
|
+
var numberGte = function (key, value) {
|
|
2611
|
+
var _a;
|
|
2612
|
+
return Object.freeze({
|
|
2613
|
+
range: (_a = {}, _a[key] = { gte: value }, _a)
|
|
2614
|
+
});
|
|
2615
|
+
};
|
|
2616
|
+
var multiMatchQuery = function (query, fields, type, boost, analyzer) {
|
|
2617
|
+
if (type === void 0) { type = 'best_fields'; }
|
|
2618
|
+
return Object.freeze({
|
|
2619
|
+
multi_match: Object.assign(Object.assign({ query: query, fields: fields, type: type }, (boost ? { boost: boost } : {})), (analyzer ? { analyzer: analyzer } : {}))
|
|
2620
|
+
});
|
|
2621
|
+
};
|
|
2622
|
+
var matchPhraseQuery = function (query, boost) {
|
|
2623
|
+
var fields = [];
|
|
2624
|
+
for (var _i = 2; _i < arguments.length; _i++) {
|
|
2625
|
+
fields[_i - 2] = arguments[_i];
|
|
2626
|
+
}
|
|
2627
|
+
return fields.length ? multiMatchQuery(query, fields, 'phrase', boost) : matchExactQuery('name', query, boost);
|
|
2628
|
+
};
|
|
2629
|
+
var matchPhrasePrefixQuery = function (query, boost) {
|
|
2630
|
+
if (boost === void 0) { boost = 2; }
|
|
2631
|
+
var fields = [];
|
|
2632
|
+
for (var _i = 2; _i < arguments.length; _i++) {
|
|
2633
|
+
fields[_i - 2] = arguments[_i];
|
|
2634
|
+
}
|
|
2635
|
+
return fields.length ?
|
|
2636
|
+
multiMatchQuery(query, fields, 'phrase_prefix', boost) :
|
|
2637
|
+
Object.freeze({
|
|
2638
|
+
match_phrase_prefix: {
|
|
2639
|
+
nameSearchAsYouType: {
|
|
2640
|
+
query: query,
|
|
2641
|
+
boost: boost
|
|
2642
|
+
}
|
|
2643
|
+
}
|
|
2644
|
+
});
|
|
2645
|
+
};
|
|
2646
|
+
var matchBoolPrefixQuery = function (query, boost) {
|
|
2647
|
+
if (boost === void 0) { boost = 1; }
|
|
2648
|
+
var fields = [];
|
|
2649
|
+
for (var _i = 2; _i < arguments.length; _i++) {
|
|
2650
|
+
fields[_i - 2] = arguments[_i];
|
|
2651
|
+
}
|
|
2652
|
+
return fields.length ?
|
|
2653
|
+
multiMatchQuery(query, fields, 'bool_prefix', boost) :
|
|
2654
|
+
Object.freeze({
|
|
2655
|
+
match_bool_prefix: {
|
|
2656
|
+
name: {
|
|
2657
|
+
query: query,
|
|
2658
|
+
boost: boost
|
|
2659
|
+
}
|
|
2660
|
+
}
|
|
2661
|
+
});
|
|
2662
|
+
};
|
|
2663
|
+
var wildcardQuery = function (query, boost) {
|
|
2664
|
+
if (boost === void 0) { boost = 3; }
|
|
2665
|
+
var fields = [];
|
|
2666
|
+
for (var _i = 2; _i < arguments.length; _i++) {
|
|
2667
|
+
fields[_i - 2] = arguments[_i];
|
|
2668
|
+
}
|
|
2669
|
+
return Object.freeze({
|
|
2670
|
+
simple_query_string: {
|
|
2671
|
+
query: "*" + query + "*",
|
|
2672
|
+
fields: fields,
|
|
2673
|
+
analyze_wildcard: true,
|
|
2674
|
+
boost: boost
|
|
2675
|
+
}
|
|
2676
|
+
});
|
|
2677
|
+
};
|
|
2678
|
+
var matchCountryLevel = { match: { gadmLevel: 0 } };
|
|
2679
|
+
var matchGlobalRegion = { regexp: { '@id': 'region-*' } };
|
|
2680
|
+
var matchCountry = Object.freeze({
|
|
2681
|
+
bool: {
|
|
2682
|
+
should: [
|
|
2683
|
+
matchCountryLevel,
|
|
2684
|
+
matchGlobalRegion
|
|
2685
|
+
],
|
|
2686
|
+
minimum_should_match: 1
|
|
2687
|
+
}
|
|
2688
|
+
});
|
|
2689
|
+
var countriesQuery = Object.freeze({
|
|
2690
|
+
bool: {
|
|
2691
|
+
must: [
|
|
2692
|
+
matchType(schema.NodeType.Term),
|
|
2693
|
+
matchTermType(schema.TermTermType.region),
|
|
2694
|
+
matchCountryLevel
|
|
2695
|
+
]
|
|
2696
|
+
}
|
|
2697
|
+
});
|
|
2698
|
+
var allCountriesQuery = Object.freeze({
|
|
2699
|
+
bool: Object.assign({ must: [
|
|
2700
|
+
matchType(schema.NodeType.Term),
|
|
2701
|
+
matchTermType(schema.TermTermType.region)
|
|
2702
|
+
] }, matchCountry.bool)
|
|
2703
|
+
});
|
|
2704
|
+
var matchRegion = numberGte('gadmLevel', 1);
|
|
2705
|
+
var regionsQuery = Object.freeze({
|
|
2706
|
+
bool: {
|
|
2707
|
+
must: [
|
|
2708
|
+
matchType(schema.NodeType.Term),
|
|
2709
|
+
matchTermType(schema.TermTermType.region),
|
|
2710
|
+
matchRegion
|
|
2711
|
+
]
|
|
2712
|
+
}
|
|
2713
|
+
});
|
|
2714
|
+
var worldRegion = Object.freeze({
|
|
2715
|
+
'@id': 'region-world',
|
|
2716
|
+
name: 'World'
|
|
2717
|
+
});
|
|
2718
|
+
var cropsQuery = Object.freeze({
|
|
2719
|
+
bool: {
|
|
2720
|
+
must: [
|
|
2721
|
+
matchType(schema.NodeType.Term),
|
|
2722
|
+
matchTermType(schema.TermTermType.crop)
|
|
2723
|
+
]
|
|
2724
|
+
}
|
|
2725
|
+
});
|
|
2726
|
+
var matchAggregatedQuery = matchQuery('aggregated', true);
|
|
2727
|
+
var isNestedKey = function (key) { return schema.nestedSearchableKeys.includes(key.split('.')[0]); };
|
|
2728
|
+
var matchNestedKey = function (key, query) { return isNestedKey(key) ? {
|
|
2729
|
+
nested: { path: key.split('.')[0], query: query }
|
|
2730
|
+
} : query; };
|
|
2731
|
+
/**
|
|
2732
|
+
* List of fields to return in the search results.
|
|
2733
|
+
*/
|
|
2734
|
+
var searchResultsFields = Object.freeze((_a$3 = {},
|
|
2735
|
+
_a$3[schema.NodeType.Cycle] = [
|
|
2736
|
+
'description', 'dataDescription', 'endDate',
|
|
2737
|
+
'emissionsCount', 'inputsCount', 'productsCount',
|
|
2738
|
+
'site.location', 'site.country.name', 'site.region.name'
|
|
2739
|
+
],
|
|
2740
|
+
_a$3[schema.NodeType.Source] = ['bibliography.title', 'bibliography.documentDOI'],
|
|
2741
|
+
_a$3[schema.NodeType.ImpactAssessment] = ['emissionsResourceUseCount', 'impactsCount', 'country.name'],
|
|
2742
|
+
_a$3));
|
|
2743
|
+
/**
|
|
2744
|
+
* List of fields to search in.
|
|
2745
|
+
*/
|
|
2746
|
+
var searchFields = Object.freeze((_b = {},
|
|
2747
|
+
_b[schema.NodeType.Cycle] = ['name', 'description', 'dataDescription'],
|
|
2748
|
+
_b[schema.NodeType.Source] = ['name', 'bibliography.title'],
|
|
2749
|
+
_b[schema.NodeType.ImpactAssessment] = ['name', 'product.name', 'country.name'],
|
|
2750
|
+
_b));
|
|
2751
|
+
var searchFieldsNested = Object.freeze((_c = {},
|
|
2752
|
+
_c[schema.NodeType.Cycle] = [
|
|
2753
|
+
'inputs.term.name',
|
|
2754
|
+
'emissions.term.name',
|
|
2755
|
+
'practices.term.name'
|
|
2756
|
+
],
|
|
2757
|
+
_c[schema.NodeType.Source] = [],
|
|
2758
|
+
_c[schema.NodeType.ImpactAssessment] = [
|
|
2759
|
+
'emissionsResourceUse.term.name',
|
|
2760
|
+
'impacts.term.name'
|
|
2761
|
+
],
|
|
2762
|
+
_c));
|
|
2763
|
+
/**
|
|
2764
|
+
* Specific strict queries per type.
|
|
2765
|
+
*/
|
|
2766
|
+
var searchQueries = (_d$1 = {},
|
|
2767
|
+
_d$1[schema.NodeType.Cycle] = { must: [], must_not: [matchAggregatedQuery] },
|
|
2768
|
+
_d$1[schema.NodeType.Source] = { must: [], must_not: [matchAggregatedQuery] },
|
|
2769
|
+
_d$1);
|
|
2770
|
+
var searchFiltersKeys = (_e = {},
|
|
2771
|
+
_e[schema.NodeType.Cycle] = function (key) { return key; },
|
|
2772
|
+
_e[schema.NodeType.Source] = function (key) { return key; },
|
|
2773
|
+
_e);
|
|
2774
|
+
/* eslint-disable complexity */
|
|
2775
|
+
var searchQuery = function (type, query, filters, aggregated) {
|
|
2776
|
+
var boolQuery = (Object.assign(Object.assign({ must: [
|
|
2777
|
+
matchType(type),
|
|
2778
|
+
aggregated ? matchAggregatedQuery : null
|
|
2779
|
+
].filter(Boolean) }, (query ? {
|
|
2780
|
+
should: __spreadArray([
|
|
2781
|
+
matchPhraseQuery.apply(void 0, __spreadArray([query, 100], __read(searchFields[type]))),
|
|
2782
|
+
matchPhrasePrefixQuery.apply(void 0, __spreadArray([query, 20], __read(searchFields[type]))),
|
|
2783
|
+
matchBoolPrefixQuery.apply(void 0, __spreadArray([query, 10], __read(searchFields[type])))
|
|
2784
|
+
], __read(searchFieldsNested[type].map(function (field) { return matchNestedKey(field, matchBoolPrefixQuery(query, 1, field)); }))),
|
|
2785
|
+
minimum_should_match: 1
|
|
2786
|
+
} : {})), { must_not: [
|
|
2787
|
+
aggregated ? null : matchAggregatedQuery
|
|
2788
|
+
].filter(Boolean) }));
|
|
2789
|
+
var keys = Object.keys(filters || {}).filter(function (key) { return filters[key].length; });
|
|
2790
|
+
return {
|
|
2791
|
+
bool: keys.length ? {
|
|
2792
|
+
must: keys.map(function (key) {
|
|
2793
|
+
var filterKey = searchFiltersKeys[type](key);
|
|
2794
|
+
return {
|
|
2795
|
+
bool: {
|
|
2796
|
+
should: filters[key]
|
|
2797
|
+
.map(function (value) { return matchNestedKey(filterKey, matchExactQuery(filterKey, value)); })
|
|
2798
|
+
.map(function (must) {
|
|
2799
|
+
var localQuery = JSON.parse(JSON.stringify(boolQuery));
|
|
2800
|
+
localQuery.must.push(must);
|
|
2801
|
+
return { bool: localQuery };
|
|
2802
|
+
}),
|
|
2803
|
+
minimum_should_match: 1
|
|
2804
|
+
}
|
|
2805
|
+
};
|
|
2806
|
+
})
|
|
2807
|
+
} : boolQuery
|
|
2808
|
+
};
|
|
2809
|
+
};
|
|
2810
|
+
/* eslint-enable complexity */
|
|
2811
|
+
|
|
2947
2812
|
var emptySearchResult = function () { return ({
|
|
2948
2813
|
time: 0,
|
|
2949
2814
|
count: 0,
|
|
@@ -3234,6 +3099,14 @@
|
|
|
3234
3099
|
emptyFieldValue: ''
|
|
3235
3100
|
}); };
|
|
3236
3101
|
|
|
3102
|
+
var primaryProduct = function (_a) {
|
|
3103
|
+
var products = _a.products;
|
|
3104
|
+
return (products || []).find(function (_a) {
|
|
3105
|
+
var primary = _a.primary;
|
|
3106
|
+
return primary;
|
|
3107
|
+
});
|
|
3108
|
+
};
|
|
3109
|
+
|
|
3237
3110
|
var _a$1;
|
|
3238
3111
|
var linkTypeEnabled = function (type) { return [
|
|
3239
3112
|
schema.NodeType.Cycle,
|
|
@@ -7327,7 +7200,7 @@
|
|
|
7327
7200
|
};
|
|
7328
7201
|
return ImpactAssessmentsProductsComponent;
|
|
7329
7202
|
}());
|
|
7330
|
-
ImpactAssessmentsProductsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ImpactAssessmentsProductsComponent, deps: [{ token: i1__namespace$4.FormBuilder }, { token: HeNodeService }, { token: HeSearchService }, { token:
|
|
7203
|
+
ImpactAssessmentsProductsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ImpactAssessmentsProductsComponent, deps: [{ token: i1__namespace$4.FormBuilder }, { token: HeNodeService }, { token: HeSearchService }, { token: HeToastService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
7331
7204
|
ImpactAssessmentsProductsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ImpactAssessmentsProductsComponent, selector: "he-impact-assessments-products", inputs: { cycles: "cycles", impactAssessments: "impactAssessments", key: "key", dataState: "dataState", enableCompare: "enableCompare", filterTermTypes: "filterTermTypes", enableFilterMethodModel: "enableFilterMethodModel" }, usesOnChanges: true, ngImport: i0__namespace, template: "<ng-container *ngIf=\"indicators.length; else emptyTable\">\n <div class=\"columns is-variable is-2 m-0\">\n <div class=\"column is-hidden-mobile\"></div>\n <div class=\"column is-narrow\">\n <div class=\"field has-addons\">\n <div class=\"control\">\n <button class=\"button is-small\" [class.is-active]=\"selectedView === View.table\" (click)=\"selectedView = View.table\">\n <span class=\"icon is-small\">\n <fa-icon icon=\"list\" aria-hidden=\"true\"></fa-icon>\n </span>\n <span>Table view</span>\n </button>\n </div>\n <div class=\"control\" *ngIf=\"impactAssessments.length > 1\">\n <button class=\"button is-small\" [class.is-active]=\"selectedView === View.chart\" (click)=\"selectedView = View.chart\">\n <span class=\"icon is-small\">\n <fa-icon icon=\"chart-bar\" aria-hidden=\"true\"></fa-icon>\n </span>\n <span>Chart view</span>\n </button>\n </div>\n <div class=\"control\" *ngIf=\"enableBreakdown\">\n <button class=\"button is-small\" [class.is-active]=\"selectedView === View.breakdown\" (click)=\"selectedView = View.breakdown\">\n <span class=\"icon is-small\">\n <fa-icon icon=\"chart-bar\" aria-hidden=\"true\"></fa-icon>\n </span>\n <span>Breakdown view</span>\n </button>\n </div>\n <div class=\"control\" *ngIf=\"!isOriginal && impactAssessments.length === 1\">\n <button class=\"button is-small\" [class.is-active]=\"selectedView === View.logs\" (click)=\"showRecalculationLogs()\">\n <span class=\"icon is-small\">\n <fa-icon icon=\"calculator\" aria-hidden=\"true\"></fa-icon>\n </span>\n <span>Recalculations logs</span>\n </button>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"px-3 pb-3\" [class.is-hidden]=\"selectedView !== View.table\">\n <div class=\"has-text-right mb-2\">\n <button class=\"button is-dark is-outlined is-small\" (click)=\"showDownload = true\">\n <fa-icon icon=\"download\"></fa-icon>\n <span class=\"pl-2\">Download (CSV)</span>\n </button>\n </div>\n\n <div class=\"table-container data-table-container mb-1\" *bindOnce=\"indicators\">\n <table class=\"table is-narrow data-table has-children-{{indicators.length + 1}}\">\n <thead>\n <tr>\n <th class=\"width-auto\">\n <div class=\"select is-small\" *ngIf=\"enableFilterMethodModel\">\n <select name=\"selectedMethodModel\"\n (change)=\"updateImpacts()\" [(ngModel)]=\"selectedMethodModel\"\n >\n <option [ngValue]=\"undefined\">Filter Model</option>\n <option *ngFor=\"let term of methodModels\" [ngValue]=\"term\">{{term.name}}</option>\n </select>\n </div>\n </th>\n <th></th>\n <th *ngFor=\"let indicator of indicators\"\n [attr.title]=\"indicator.value.term.name\"\n >\n <he-node-link [node]=\"indicator.value.term\">\n <span>{{indicator.value.term.name | ellipsis:30}}</span>\n </he-node-link>\n </th>\n </tr>\n <tr>\n <th class=\"width-auto\">\n <a [href]=\"baseUrl + '/schema/ImpactAssessment#functionalUnit'\" target=\"_blank\">Functional unit:</a>\n <span class=\"pl-1\">1 kg</span>\n </th>\n <th>Product</th>\n <th *ngFor=\"let indicator of indicators\"\n [attr.title]=\"indicator.value.term.units\"\n >{{indicator.value.term.units}}</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let impactAssessment of impactAssessments; trackBy: trackById; let i = index\">\n <td class=\"width-auto\" [attr.title]=\"impactName(impactAssessment)\" [style.border-left-color]=\"itemColor(i)\">\n <label *ngIf=\"enableCompare\" class=\"is-inline-block checkbox\">\n <input type=\"checkbox\" class=\"selector\"\n (change)=\"toggleImpact(impactAssessment)\"\n [checked]=\"isSelected(impactAssessment)\"\n >\n </label>\n <he-node-link class=\"is-inline-block\" [node]=\"impactAssessment\">\n <span class=\"is-nowrap has-text-ellipsis\">{{i + 1}}. {{impactName(impactAssessment)}}</span>\n </he-node-link>\n </td>\n <td [attr.title]=\"impactAssessment.product?.name\">\n <he-node-link *ngIf=\"impactAssessment.product\" [node]=\"impactAssessment.product\">\n <span>{{impactAssessment.product.name | ellipsis:30}}</span>\n </he-node-link>\n </td>\n <td class=\"is-nowrap\" *ngFor=\"let indicator of indicators\">\n <span *ngIf=\"indicator.value.values[impactAssessment['@id']]; else emptyValue\"\n class=\"trigger-popover\"\n [ngbPopover]=\"details\" [autoClose]=\"'outside'\"\n triggers=\"manual\" #p=\"ngbPopover\" placement=\"left\" container=\"body\"\n (click)=\"togglePopover(p, { data: indicator.value.values[impactAssessment['@id']], impactAssessment: impactAssessment, key: key })\"\n >\n <span pointer>{{propertyValue(indicator.value.values[impactAssessment['@id']].value, key === 'impacts') | precision:3 | default:'-'}}</span>\n <he-blank-node-state class=\"ml-1\"\n [node]=\"indicator.value.values[impactAssessment['@id']].nodes[0]\"\n key=\"value\"\n [state]=\"impactAssessment.aggregated ? 'aggregated' : null\"\n ></he-blank-node-state>\n </span>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n\n <he-blank-node-state-notice [dataState]=\"dataState\"></he-blank-node-state-notice>\n\n <form *ngIf=\"enableCompare\" class=\"mt-2\" [formGroup]=\"form\" (submit)=\"form.valid && addImpact()\">\n <div class=\"field has-addons\">\n <div class=\"control\">\n <span class=\"button is-small is-static\">Compare with Aggregated Impact Assessment</span>\n </div>\n <div class=\"control is-expanded\" [class.has-icons-right]=\"suggesting || loading\">\n <input class=\"input is-small\"\n placeholder=\"Search by name or id\"\n formControlName=\"search\" name=\"search\"\n\n [ngbTypeahead]=\"suggestImpactAssessment\"\n [inputFormatter]=\"formatter\"\n [resultTemplate]=\"suggestion\"\n [focusFirst]=\"true\"\n >\n <span class=\"icon is-small is-right has-text-grey-dark\" [class.is-hidden]=\"!(suggesting || loading)\">\n <fa-icon icon=\"spinner\" [pulse]=\"true\" size=\"sm\"></fa-icon>\n </span>\n </div>\n <div class=\"control\">\n <button class=\"button is-small\" type=\"submit\" [disabled]=\"suggesting || loading\">\n <fa-icon icon=\"plus\"></fa-icon>\n </button>\n </div>\n </div>\n </form>\n </div>\n\n <he-impact-assessments-indicator-breakdown-chart *ngIf=\"selectedView === View.breakdown\"\n [impactAssessment]=\"impactAssessments[0]\"\n [indicators]=\"impactAssessments[0][key]\"\n ></he-impact-assessments-indicator-breakdown-chart>\n\n <he-impact-assessments-indicators-chart *ngIf=\"impactAssessments.length > 1\" [class.is-hidden]=\"selectedView !== View.chart\"\n [key]=\"key\"\n [impactAssessments]=\"selectedImpactAssessments\"\n [filterTermTypes]=\"filterTermTypes\"\n ></he-impact-assessments-indicators-chart>\n\n <he-impact-assessments-products-logs *ngIf=\"selectedView === View.logs && !isOriginal\"\n [key]=\"key\"\n [impactAssessment]=\"impactAssessments[0]\"\n [filterTermTypes]=\"filterTermTypes\"\n [originalValues]=\"originalValues[0][key]\"\n [recalculatedValues]=\"impactAssessments[0][key]\"\n ></he-impact-assessments-products-logs>\n</ng-container>\n\n<he-node-csv-export-confirm *ngIf=\"showDownload\"\n [nodes]=\"impactAssessments\" [filename]=\"'impact-' + key + '.csv'\" [isUpload]=\"false\"\n [headerKeys]=\"['impactAssessment.id', 'impactAssessment.@id', 'impactAssessment.' + key + '.']\"\n (closed)=\"showDownload = false\"\n></he-node-csv-export-confirm>\n\n<ng-template #emptyTable>\n <div class=\"panel-block\">\n <span>No data</span>\n </div>\n</ng-template>\n\n<ng-template #emptyValue>\n <span>-</span>\n</ng-template>\n\n<ng-template #details let-node=\"impactAssessment\" let-data=\"data\" let-key=\"key\">\n <p *bindOnce=\"node\">\n <b>\n <span *ngIf=\"data.cycle\">{{cycleLabel(node.cycle)}}</span>\n <span *ngIf=\"!data.cycle\">{{data.name}}</span>\n </b>\n </p>\n <he-node-value-details\n [data]=\"data\" [nodeType]=\"node['@type']\" [dataKey]=\"key\"\n ></he-node-value-details>\n</ng-template>\n\n<ng-template #suggestion let-impact=\"result\" let-t=\"term\">\n <div class=\"is-block\">\n <ngb-highlight [result]=\"impact.name || impact.cycle.name\" [term]=\"t\"></ngb-highlight>\n </div>\n <div class=\"columns is-flex\">\n <div class=\"column\" *ngIf=\"impact.country\">\n <span class=\"pr-1 has-text-underline\">Country:</span>\n <span class=\"is-inline-flex\"><ngb-highlight [result]=\"impact.country.name\" [term]=\"t\"></ngb-highlight></span>\n </div>\n <div class=\"column\" *ngIf=\"impact.product\">\n <span class=\"pr-1 has-text-underline\">Product:</span>\n <span class=\"is-inline-flex\"><ngb-highlight [result]=\"impact.product.name\" [term]=\"t\"></ngb-highlight></span>\n </div>\n <div class=\"column\" *ngIf=\"impact.endDate\">\n <span class=\"pr-1 has-text-underline\">Date:</span>\n <span class=\"is-inline-flex\"><ngb-highlight [result]=\"impact.endDate\" [term]=\"t\"></ngb-highlight></span>\n </div>\n </div>\n</ng-template>\n", styles: ["label.checkbox{width:20px}td he-node-link{width:160px}table.data-table td:first-child{border-left-width:8px}\n"], components: [{ type: i1__namespace.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }, { type: NodeLinkComponent, selector: "he-node-link", inputs: ["node", "showExternalLink"] }, { type: BlankNodeStateComponent, selector: "he-blank-node-state", inputs: ["nodeType", "dataKey", "key", "node", "state"] }, { type: BlankNodeStateNoticeComponent, selector: "he-blank-node-state-notice", inputs: ["dataState", "showDeleted"] }, { type: ImpactAssessmentsIndicatorBreakdownChartComponent, selector: "he-impact-assessments-indicator-breakdown-chart", inputs: ["impactAssessment", "indicators"] }, { type: ImpactAssessmentsIndicatorsChartComponent, selector: "he-impact-assessments-indicators-chart", inputs: ["impactAssessments", "key", "filterTermTypes"] }, { type: ImpactAssessmentsProductsLogsComponent, selector: "he-impact-assessments-products-logs", inputs: ["impactAssessment", "key", "filterTermTypes", "originalValues", "recalculatedValues"] }, { type: NodeCsvExportConfirmComponent, selector: "he-node-csv-export-confirm", inputs: ["nodes", "filename", "headerKeys", "extension", "isUpload"], outputs: ["closed"] }, { type: NodeValueDetailsComponent, selector: "he-node-value-details", inputs: ["data", "nodeType", "dataKey"] }, { type: i10__namespace.NgbHighlight, selector: "ngb-highlight", inputs: ["highlightClass", "result", "term"] }], directives: [{ type: i3__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: BindOnceDirective, selector: "[bindOnce]", inputs: ["bindOnce"] }, { type: i1__namespace$4.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i1__namespace$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1__namespace$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i1__namespace$4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1__namespace$4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i3__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10__namespace.NgbPopover, selector: "[ngbPopover]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disablePopover", "popoverClass", "openDelay", "closeDelay", "ngbPopover", "popoverTitle"], outputs: ["shown", "hidden"], exportAs: ["ngbPopover"] }, { type: i1__namespace$4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1__namespace$4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1__namespace$4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1__namespace$4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i10__namespace.NgbTypeahead, selector: "input[ngbTypeahead]", inputs: ["autocomplete", "placement", "container", "editable", "focusFirst", "showHint", "inputFormatter", "ngbTypeahead", "resultFormatter", "resultTemplate"], outputs: ["selectItem"], exportAs: ["ngbTypeahead"] }, { type: i1__namespace$4.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }], pipes: { "ellipsis": EllipsisPipe, "default": DefaultPipe, "precision": PrecisionPipe } });
|
|
7332
7205
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ImpactAssessmentsProductsComponent, decorators: [{
|
|
7333
7206
|
type: i0.Component,
|
|
@@ -7336,7 +7209,7 @@
|
|
|
7336
7209
|
templateUrl: './impact-assessments-products.component.html',
|
|
7337
7210
|
styleUrls: ['./impact-assessments-products.component.scss']
|
|
7338
7211
|
}]
|
|
7339
|
-
}], ctorParameters: function () { return [{ type: i1__namespace$4.FormBuilder }, { type: HeNodeService }, { type: HeSearchService }, { type:
|
|
7212
|
+
}], ctorParameters: function () { return [{ type: i1__namespace$4.FormBuilder }, { type: HeNodeService }, { type: HeSearchService }, { type: HeToastService }]; }, propDecorators: { cycles: [{
|
|
7340
7213
|
type: i0.Input
|
|
7341
7214
|
}], impactAssessments: [{
|
|
7342
7215
|
type: i0.Input
|
|
@@ -7477,6 +7350,7 @@
|
|
|
7477
7350
|
exports.HeSearchModule = HeSearchModule;
|
|
7478
7351
|
exports.HeSearchService = HeSearchService;
|
|
7479
7352
|
exports.HeSitesModule = HeSitesModule;
|
|
7353
|
+
exports.HeToastService = HeToastService;
|
|
7480
7354
|
exports.HeUsersService = HeUsersService;
|
|
7481
7355
|
exports.ImpactAssessmentsIndicatorBreakdownChartComponent = ImpactAssessmentsIndicatorBreakdownChartComponent;
|
|
7482
7356
|
exports.ImpactAssessmentsIndicatorsChartComponent = ImpactAssessmentsIndicatorsChartComponent;
|
|
@@ -7510,17 +7384,20 @@
|
|
|
7510
7384
|
exports.TagsInputDirective = TagsInputDirective;
|
|
7511
7385
|
exports.TimesPipe = TimesPipe;
|
|
7512
7386
|
exports.ToastComponent = ToastComponent;
|
|
7513
|
-
exports.ToastService = ToastService;
|
|
7514
7387
|
exports.UnitConverterComponent = UnitConverterComponent;
|
|
7388
|
+
exports.addPolygonToFeature = addPolygonToFeature;
|
|
7515
7389
|
exports.allCountriesQuery = allCountriesQuery;
|
|
7516
|
-
exports.animateCounter = animateCounter;
|
|
7517
7390
|
exports.arrayValue = arrayValue;
|
|
7518
7391
|
exports.availableProperties = availableProperties;
|
|
7519
7392
|
exports.baseUrl = baseUrl;
|
|
7520
7393
|
exports.bottom = bottom;
|
|
7394
|
+
exports.clustererImage = clustererImage;
|
|
7395
|
+
exports.coordinatesToPoint = coordinatesToPoint;
|
|
7521
7396
|
exports.countriesQuery = countriesQuery;
|
|
7397
|
+
exports.createMarker = createMarker;
|
|
7522
7398
|
exports.cropsQuery = cropsQuery;
|
|
7523
7399
|
exports.dataValue = dataValue;
|
|
7400
|
+
exports.defaultFeature = defaultFeature;
|
|
7524
7401
|
exports.defaultLabel = defaultLabel;
|
|
7525
7402
|
exports.definitionToSchemaType = definitionToSchemaType;
|
|
7526
7403
|
exports.delta = delta;
|
|
@@ -7529,15 +7406,17 @@
|
|
|
7529
7406
|
exports.emptyValue = emptyValue;
|
|
7530
7407
|
exports.errorText = errorText;
|
|
7531
7408
|
exports.filenameWithoutExt = filenameWithoutExt;
|
|
7409
|
+
exports.fillColor = fillColor;
|
|
7410
|
+
exports.fillStyle = fillStyle;
|
|
7532
7411
|
exports.filterParams = filterParams;
|
|
7533
7412
|
exports.findPropertyById = findPropertyById;
|
|
7413
|
+
exports.gitBranch = gitBranch;
|
|
7534
7414
|
exports.gitHome = gitHome;
|
|
7535
7415
|
exports.gitRawBaseUrl = gitRawBaseUrl;
|
|
7536
7416
|
exports.groupNodesByTerm = groupNodesByTerm;
|
|
7537
7417
|
exports.grouppedKeys = grouppedKeys;
|
|
7538
7418
|
exports.grouppedValueKeys = grouppedValueKeys;
|
|
7539
7419
|
exports.handleAPIError = handleAPIError;
|
|
7540
|
-
exports.hoursBefore = hoursBefore;
|
|
7541
7420
|
exports.isChrome = isChrome;
|
|
7542
7421
|
exports.isExternal = isExternal;
|
|
7543
7422
|
exports.isSchemaIri = isSchemaIri;
|
|
@@ -7547,8 +7426,11 @@
|
|
|
7547
7426
|
exports.levels = levels;
|
|
7548
7427
|
exports.linkTypeEnabled = linkTypeEnabled;
|
|
7549
7428
|
exports.listColor = listColor;
|
|
7550
|
-
exports.
|
|
7429
|
+
exports.locationQuery = locationQuery;
|
|
7430
|
+
exports.lookupUrl = lookupUrl;
|
|
7551
7431
|
exports.mapsUrl = mapsUrl;
|
|
7432
|
+
exports.markerIcon = markerIcon;
|
|
7433
|
+
exports.markerPie = markerPie;
|
|
7552
7434
|
exports.matchAggregatedQuery = matchAggregatedQuery;
|
|
7553
7435
|
exports.matchBoolPrefixQuery = matchBoolPrefixQuery;
|
|
7554
7436
|
exports.matchCountry = matchCountry;
|
|
@@ -7565,16 +7447,20 @@
|
|
|
7565
7447
|
exports.matchType = matchType;
|
|
7566
7448
|
exports.maxAreaSize = maxAreaSize;
|
|
7567
7449
|
exports.measurementValue = measurementValue;
|
|
7568
|
-
exports.minutesBefore = minutesBefore;
|
|
7569
7450
|
exports.multiMatchQuery = multiMatchQuery;
|
|
7570
7451
|
exports.nestingEnabled = nestingEnabled;
|
|
7571
7452
|
exports.nestingTypeEnabled = nestingTypeEnabled;
|
|
7572
|
-
exports.
|
|
7453
|
+
exports.nodeLogsUrl = nodeLogsUrl;
|
|
7454
|
+
exports.nodeUrl = nodeUrl;
|
|
7573
7455
|
exports.numberGte = numberGte;
|
|
7574
7456
|
exports.parseData = parseData;
|
|
7575
7457
|
exports.parseLines = parseLines;
|
|
7576
7458
|
exports.parseMessage = parseMessage;
|
|
7577
|
-
exports.
|
|
7459
|
+
exports.pointToCoordinates = pointToCoordinates;
|
|
7460
|
+
exports.polygonBounds = polygonBounds;
|
|
7461
|
+
exports.polygonToCoordinates = polygonToCoordinates;
|
|
7462
|
+
exports.polygonsFromFeature = polygonsFromFeature;
|
|
7463
|
+
exports.primaryProduct = primaryProduct;
|
|
7578
7464
|
exports.propertyValue = propertyValue$1;
|
|
7579
7465
|
exports.refToSchemaType = refToSchemaType;
|
|
7580
7466
|
exports.regionsQuery = regionsQuery;
|
|
@@ -7591,8 +7477,9 @@
|
|
|
7591
7477
|
exports.searchableTypes = searchableTypes;
|
|
7592
7478
|
exports.serializeSearchFilters = serializeSearchFilters;
|
|
7593
7479
|
exports.siteTooBig = siteTooBig;
|
|
7594
|
-
exports.sortByFn = sortByFn;
|
|
7595
7480
|
exports.sortOrder = sortOrder;
|
|
7481
|
+
exports.strokeColor = strokeColor;
|
|
7482
|
+
exports.strokeStyle = strokeStyle;
|
|
7596
7483
|
exports.suggestMatchQuery = suggestMatchQuery;
|
|
7597
7484
|
exports.suggestQuery = suggestQuery;
|
|
7598
7485
|
exports.termChildToParent = termChildToParent;
|
|
@@ -7601,10 +7488,9 @@
|
|
|
7601
7488
|
exports.termProperties = termProperties;
|
|
7602
7489
|
exports.termTypeGroups = termTypeGroups;
|
|
7603
7490
|
exports.termTypeLabel = termTypeLabel;
|
|
7491
|
+
exports.termTypeLookupUrl = termTypeLookupUrl;
|
|
7604
7492
|
exports.toCsv = toCsv$1;
|
|
7605
7493
|
exports.toDashCase = toDashCase;
|
|
7606
|
-
exports.toFormData = toFormData;
|
|
7607
|
-
exports.toSearchParams = toSearchParams;
|
|
7608
7494
|
exports.valueTypeToDefault = valueTypeToDefault;
|
|
7609
7495
|
exports.waitFor = waitFor;
|
|
7610
7496
|
exports.wildcardQuery = wildcardQuery;
|