@hestia-earth/ui-components 0.0.2 → 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 +474 -542
- package/bundles/hestia-earth-ui-components.umd.js.map +1 -1
- package/common/blank-node-diffs/blank-node-diffs.service.d.ts +5 -0
- package/common/blank-node-value-delta/blank-node-value-delta.component.d.ts +1 -1
- package/common/blank-node-value-delta/blank-node-value-delta.service.d.ts +6 -0
- 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 +15 -12
- 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/bibliographies/bibliographies-search-confirm/bibliographies-search-confirm.component.js +2 -2
- package/esm2015/common/blank-node-diffs/blank-node-diffs.component.js +3 -16
- package/esm2015/common/blank-node-diffs/blank-node-diffs.service.js +20 -0
- package/esm2015/common/blank-node-value-delta/blank-node-value-delta.component.js +5 -7
- package/esm2015/common/blank-node-value-delta/blank-node-value-delta.service.js +31 -0
- package/esm2015/common/common.service.js +1 -7
- package/esm2015/common/maps-drawing-confirm/maps-drawing-confirm.component.js +2 -2
- package/esm2015/common/popover/popover.component.js +2 -2
- package/esm2015/common/popover-confirm/popover-confirm.component.js +2 -2
- 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 +15 -64
- 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/files/files-form/files-form.component.js +2 -2
- 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-export-confirm/node-csv-export-confirm.component.js +2 -2
- 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 +350 -400
- 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
- package/styles.scss +1 -0
|
@@ -417,10 +417,11 @@
|
|
|
417
417
|
}]
|
|
418
418
|
}], ctorParameters: function () { return [{ type: i1__namespace.FaIconLibrary }]; } });
|
|
419
419
|
|
|
420
|
-
var _a$
|
|
421
|
-
var get$
|
|
420
|
+
var _a$6, _b$3;
|
|
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,10 +575,8 @@
|
|
|
625
575
|
// handle years
|
|
626
576
|
.replace(/([0-9]{4})/g, function (g) { return "-" + g; }) :
|
|
627
577
|
null; };
|
|
628
|
-
var
|
|
629
|
-
|
|
630
|
-
var nodeDefaultLabel = (_a$5 = {},
|
|
631
|
-
_a$5[schema.NodeType.ImpactAssessment] = function (_a) {
|
|
578
|
+
var nodeDefaultLabel = (_a$6 = {},
|
|
579
|
+
_a$6[schema.NodeType.ImpactAssessment] = function (_a) {
|
|
632
580
|
var name = _a.name, country = _a.country, endDate = _a.endDate, product = _a.product;
|
|
633
581
|
return name ? name.replace((product === null || product === void 0 ? void 0 : product.name) + ", ", '') : [
|
|
634
582
|
product === null || product === void 0 ? void 0 : product.name,
|
|
@@ -636,45 +584,43 @@
|
|
|
636
584
|
endDate
|
|
637
585
|
].filter(Boolean).join(', ');
|
|
638
586
|
},
|
|
639
|
-
_a$
|
|
587
|
+
_a$6[schema.NodeType.Site] = function (_a) {
|
|
640
588
|
var name = _a.name, description = _a.description;
|
|
641
589
|
return name || description;
|
|
642
590
|
},
|
|
643
|
-
_a$
|
|
591
|
+
_a$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";
|
|
664
598
|
DeltaDisplayType["percent"] = "percent";
|
|
665
599
|
})(exports.DeltaDisplayType || (exports.DeltaDisplayType = {}));
|
|
666
|
-
var deltaPerType = (_b$
|
|
667
|
-
_b$
|
|
668
|
-
_b$
|
|
669
|
-
_b$
|
|
670
|
-
var roundValue = function (value) { return +(
|
|
671
|
-
var delta = function (value, originalValue, displayType) {
|
|
600
|
+
var deltaPerType = (_b$3 = {},
|
|
601
|
+
_b$3[exports.DeltaDisplayType.absolute] = function (value, original) { return value - original; },
|
|
602
|
+
_b$3[exports.DeltaDisplayType.percent] = function (value, original) { return ((value - original) / original) * 100; },
|
|
603
|
+
_b$3);
|
|
604
|
+
var roundValue = function (value) { return +("" + value).substring(0, 10); };
|
|
605
|
+
var delta = function (value, originalValue, displayType, customDeltaFuncs) {
|
|
672
606
|
if (displayType === void 0) { displayType = exports.DeltaDisplayType.percent; }
|
|
673
607
|
var vvalue = roundValue(propertyValue$1(value));
|
|
674
608
|
var voriginalValue = roundValue(propertyValue$1(originalValue));
|
|
675
|
-
var
|
|
609
|
+
var deltaFuncs = Object.assign(Object.assign({}, deltaPerType), customDeltaFuncs);
|
|
610
|
+
var diff = vvalue === voriginalValue ? 0 : deltaFuncs[displayType](vvalue, voriginalValue);
|
|
676
611
|
return Number.isFinite(diff) ? (diff === -0 ? 0 : diff) : 0;
|
|
677
612
|
};
|
|
613
|
+
exports.DeltaColour = void 0;
|
|
614
|
+
(function (DeltaColour) {
|
|
615
|
+
DeltaColour["Success"] = "success";
|
|
616
|
+
DeltaColour["Warning"] = "warning";
|
|
617
|
+
DeltaColour["Danger"] = "danger";
|
|
618
|
+
})(exports.DeltaColour || (exports.DeltaColour = {}));
|
|
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
|
+
};
|
|
678
624
|
var filenameWithoutExt = function (filename) {
|
|
679
625
|
if (filename === void 0) { filename = ''; }
|
|
680
626
|
var file = api.fileToExt(filename, '');
|
|
@@ -682,6 +628,57 @@
|
|
|
682
628
|
return file.endsWith('.') ? file.substring(0, file.length - 1) : file;
|
|
683
629
|
};
|
|
684
630
|
|
|
631
|
+
var reduceValues$1 = function (values) { return values.length ? values.reduce(function (p, v) { return p + propertyValue$1(v.value); }, 0) : undefined; };
|
|
632
|
+
var formatValues = function (originalValues, recalculatedValues) {
|
|
633
|
+
if (originalValues === void 0) { originalValues = []; }
|
|
634
|
+
if (recalculatedValues === void 0) { recalculatedValues = []; }
|
|
635
|
+
var originalValuesFiltered = originalValues.filter(function (value) { return !value.deleted; });
|
|
636
|
+
var recalculatedValuesFiltered = recalculatedValues.filter(function (value) { return !value.deleted; });
|
|
637
|
+
var terms = utils.unique(__spreadArray(__spreadArray([], __read(originalValuesFiltered)), __read(recalculatedValuesFiltered)).map(function (v) { return v.term['@id']; })).sort();
|
|
638
|
+
var values = terms.map(function (termId) {
|
|
639
|
+
var original = originalValuesFiltered.filter(function (v) { return termId === v.term['@id']; });
|
|
640
|
+
var recalculated = recalculatedValuesFiltered.filter(function (v) { return termId === v.term['@id']; });
|
|
641
|
+
var term = (original[0] || recalculated[0] || { term: { '@id': termId } }).term;
|
|
642
|
+
return {
|
|
643
|
+
term: term,
|
|
644
|
+
original: reduceValues$1(original),
|
|
645
|
+
recalculated: reduceValues$1(recalculated)
|
|
646
|
+
};
|
|
647
|
+
});
|
|
648
|
+
return values;
|
|
649
|
+
};
|
|
650
|
+
|
|
651
|
+
var _a$5, _b$2, _c$2;
|
|
652
|
+
var SUCCESS_CRITERION_MAX_DELTA_PERCENT = 5;
|
|
653
|
+
var WARNING_CRITERION_MAX_DELTA_PERCENT = 20;
|
|
654
|
+
var PercentDeltaConditions;
|
|
655
|
+
(function (PercentDeltaConditions) {
|
|
656
|
+
PercentDeltaConditions["recalculated0"] = "recalculated should be 0";
|
|
657
|
+
PercentDeltaConditions["original0"] = "original is 0";
|
|
658
|
+
})(PercentDeltaConditions || (PercentDeltaConditions = {}));
|
|
659
|
+
var calculatePercentDeltaConditions = (_a$5 = {},
|
|
660
|
+
_a$5[PercentDeltaConditions.recalculated0] = function (original, recalculated) { return original > 0 && recalculated === 0; },
|
|
661
|
+
_a$5[PercentDeltaConditions.original0] = function (original, recalculated) { return original === 0 && recalculated > 0; },
|
|
662
|
+
_a$5);
|
|
663
|
+
var calculatePercentDeltaResult = (_b$2 = {},
|
|
664
|
+
_b$2[PercentDeltaConditions.recalculated0] = function (original, recalculated) { return (recalculated - original) / (original + 1); },
|
|
665
|
+
// Always considered an error so deliberately exceed SUCCESS_CRITERION_MAX_DELTA_PERCENT
|
|
666
|
+
_b$2[PercentDeltaConditions.original0] = function (original, recalculated) { return Math.sign(recalculated - original); },
|
|
667
|
+
_b$2.default = function (original, recalculated) { return (recalculated - original) / original; },
|
|
668
|
+
_b$2);
|
|
669
|
+
var calculatePercentDelta = function (recalculated, original) {
|
|
670
|
+
var matchingCondition = Object.values(PercentDeltaConditions).find(function (value) { return calculatePercentDeltaConditions[value](original, recalculated); }) || 'default';
|
|
671
|
+
return calculatePercentDeltaResult[matchingCondition](original, recalculated) * 100;
|
|
672
|
+
};
|
|
673
|
+
var customDeltaFuncs = (_c$2 = {},
|
|
674
|
+
_c$2[exports.DeltaDisplayType.percent] = calculatePercentDelta,
|
|
675
|
+
_c$2);
|
|
676
|
+
var evaluateSuccess = function (delta) { return Math.abs(delta) < SUCCESS_CRITERION_MAX_DELTA_PERCENT
|
|
677
|
+
? exports.DeltaColour.Success
|
|
678
|
+
: Math.abs(delta) < WARNING_CRITERION_MAX_DELTA_PERCENT
|
|
679
|
+
? exports.DeltaColour.Warning
|
|
680
|
+
: exports.DeltaColour.Danger; };
|
|
681
|
+
|
|
685
682
|
/* eslint-disable @angular-eslint/directive-selector */
|
|
686
683
|
var BindOnceDirective = /** @class */ (function () {
|
|
687
684
|
function BindOnceDirective(templateRef, viewContainerRef) {
|
|
@@ -724,7 +721,6 @@
|
|
|
724
721
|
}]
|
|
725
722
|
}] });
|
|
726
723
|
|
|
727
|
-
var emptyValue = function (value) { return utils.isEmpty(value) || isNaN(propertyValue$1(value)); };
|
|
728
724
|
var BlankNodeValueDeltaComponent = /** @class */ (function () {
|
|
729
725
|
function BlankNodeValueDeltaComponent() {
|
|
730
726
|
this.displayType = exports.DeltaDisplayType.percent;
|
|
@@ -739,15 +735,14 @@
|
|
|
739
735
|
});
|
|
740
736
|
Object.defineProperty(BlankNodeValueDeltaComponent.prototype, "delta", {
|
|
741
737
|
get: function () {
|
|
742
|
-
return delta(this.value, this.originalValue, this.displayType);
|
|
738
|
+
return delta(this.value, this.originalValue, this.displayType, customDeltaFuncs);
|
|
743
739
|
},
|
|
744
740
|
enumerable: false,
|
|
745
741
|
configurable: true
|
|
746
742
|
});
|
|
747
743
|
Object.defineProperty(BlankNodeValueDeltaComponent.prototype, "color", {
|
|
748
744
|
get: function () {
|
|
749
|
-
|
|
750
|
-
return this.displayType === exports.DeltaDisplayType.percent ? (value < 5 ? 'success' : (value < 20 ? 'warning' : 'danger')) : '';
|
|
745
|
+
return this.displayType === exports.DeltaDisplayType.percent ? evaluateSuccess(this.delta) : '';
|
|
751
746
|
},
|
|
752
747
|
enumerable: false,
|
|
753
748
|
configurable: true
|
|
@@ -771,7 +766,6 @@
|
|
|
771
766
|
type: i0.Input
|
|
772
767
|
}] } });
|
|
773
768
|
|
|
774
|
-
var reduceValues$1 = function (values) { return values.length ? values.reduce(function (p, v) { return p + propertyValue$1(v.value); }, 0) : undefined; };
|
|
775
769
|
var BlankNodeDiffsComponent = /** @class */ (function () {
|
|
776
770
|
function BlankNodeDiffsComponent() {
|
|
777
771
|
this.originalValues = [];
|
|
@@ -780,19 +774,7 @@
|
|
|
780
774
|
this.values = [];
|
|
781
775
|
}
|
|
782
776
|
BlankNodeDiffsComponent.prototype.ngOnInit = function () {
|
|
783
|
-
|
|
784
|
-
var recalculatedValues = (this.recalculatedValues || []).filter(function (value) { return !value.deleted; });
|
|
785
|
-
var terms = utils.unique(__spreadArray(__spreadArray([], __read(originalValues)), __read(recalculatedValues)).map(function (v) { return v.term['@id']; })).sort();
|
|
786
|
-
this.values = terms.map(function (termId) {
|
|
787
|
-
var original = originalValues.filter(function (v) { return termId === v.term['@id']; });
|
|
788
|
-
var recalculated = recalculatedValues.filter(function (v) { return termId === v.term['@id']; });
|
|
789
|
-
var term = (original[0] || recalculated[0] || { term: { '@id': termId } }).term;
|
|
790
|
-
return {
|
|
791
|
-
term: term,
|
|
792
|
-
original: reduceValues$1(original),
|
|
793
|
-
recalculated: reduceValues$1(recalculated),
|
|
794
|
-
};
|
|
795
|
-
});
|
|
777
|
+
this.values = formatValues(this.originalValues, this.recalculatedValues);
|
|
796
778
|
};
|
|
797
779
|
return BlankNodeDiffsComponent;
|
|
798
780
|
}());
|
|
@@ -811,295 +793,7 @@
|
|
|
811
793
|
type: i0.Input
|
|
812
794
|
}] } });
|
|
813
795
|
|
|
814
|
-
var _a$4, _b$1, _c$1
|
|
815
|
-
var searchableTypes = [
|
|
816
|
-
schema.NodeType.Cycle,
|
|
817
|
-
schema.NodeType.Source
|
|
818
|
-
];
|
|
819
|
-
var serializeSearchFilters = function (filters) { return Object.keys(filters || {})
|
|
820
|
-
.filter(function (key) { return filters[key].length; })
|
|
821
|
-
.map(function (key) { return key + "=" + filters[key].filter(Boolean).join('|'); })
|
|
822
|
-
.join(';'); };
|
|
823
|
-
var deserializeSearchFilters = function (filters) { return (filters || '').split(';').reduce(function (prev, curr) {
|
|
824
|
-
var _a = __read(curr.split('='), 2), key = _a[0], values = _a[1];
|
|
825
|
-
prev[key] = (values || '').split('|').filter(Boolean);
|
|
826
|
-
return prev;
|
|
827
|
-
}, {}); };
|
|
828
|
-
var matchType = function (type) { return Object.freeze({
|
|
829
|
-
match: { '@type': type }
|
|
830
|
-
}); };
|
|
831
|
-
var matchTermType = function (termType) { return Object.freeze({
|
|
832
|
-
match: { termType: termType }
|
|
833
|
-
}); };
|
|
834
|
-
var matchRegex = function (key, value) {
|
|
835
|
-
var _a;
|
|
836
|
-
return Object.freeze({
|
|
837
|
-
regexp: (_a = {}, _a[key] = { value: value.toString() }, _a)
|
|
838
|
-
});
|
|
839
|
-
};
|
|
840
|
-
var matchQuery = function (key, value, boost) {
|
|
841
|
-
var _a;
|
|
842
|
-
return Object.freeze({
|
|
843
|
-
match: (_a = {},
|
|
844
|
-
_a[key] = Object.assign({ query: value }, (boost ? { boost: boost } : {})),
|
|
845
|
-
_a)
|
|
846
|
-
});
|
|
847
|
-
};
|
|
848
|
-
var matchExactQuery = function (key, value, boost) { return matchQuery(key + ".keyword", value, boost); };
|
|
849
|
-
var matchNameNormalized = function (query, boost) {
|
|
850
|
-
if (boost === void 0) { boost = 20; }
|
|
851
|
-
return Object.freeze({
|
|
852
|
-
match: { nameNormalized: { query: query, boost: boost } }
|
|
853
|
-
});
|
|
854
|
-
};
|
|
855
|
-
var numberGte = function (key, value) {
|
|
856
|
-
var _a;
|
|
857
|
-
return Object.freeze({
|
|
858
|
-
range: (_a = {}, _a[key] = { gte: value }, _a)
|
|
859
|
-
});
|
|
860
|
-
};
|
|
861
|
-
var multiMatchQuery = function (query, fields, type, boost, analyzer) {
|
|
862
|
-
if (type === void 0) { type = 'best_fields'; }
|
|
863
|
-
return Object.freeze({
|
|
864
|
-
multi_match: Object.assign(Object.assign({ query: query, fields: fields, type: type }, (boost ? { boost: boost } : {})), (analyzer ? { analyzer: analyzer } : {}))
|
|
865
|
-
});
|
|
866
|
-
};
|
|
867
|
-
var matchPhraseQuery = function (query, boost) {
|
|
868
|
-
var fields = [];
|
|
869
|
-
for (var _i = 2; _i < arguments.length; _i++) {
|
|
870
|
-
fields[_i - 2] = arguments[_i];
|
|
871
|
-
}
|
|
872
|
-
return fields.length ? multiMatchQuery(query, fields, 'phrase', boost) : matchExactQuery('name', query, boost);
|
|
873
|
-
};
|
|
874
|
-
var matchPhrasePrefixQuery = function (query, boost) {
|
|
875
|
-
if (boost === void 0) { boost = 2; }
|
|
876
|
-
var fields = [];
|
|
877
|
-
for (var _i = 2; _i < arguments.length; _i++) {
|
|
878
|
-
fields[_i - 2] = arguments[_i];
|
|
879
|
-
}
|
|
880
|
-
return fields.length ?
|
|
881
|
-
multiMatchQuery(query, fields, 'phrase_prefix', boost) :
|
|
882
|
-
Object.freeze({
|
|
883
|
-
match_phrase_prefix: {
|
|
884
|
-
nameSearchAsYouType: {
|
|
885
|
-
query: query,
|
|
886
|
-
boost: boost
|
|
887
|
-
}
|
|
888
|
-
}
|
|
889
|
-
});
|
|
890
|
-
};
|
|
891
|
-
var matchBoolPrefixQuery = function (query, boost) {
|
|
892
|
-
if (boost === void 0) { boost = 1; }
|
|
893
|
-
var fields = [];
|
|
894
|
-
for (var _i = 2; _i < arguments.length; _i++) {
|
|
895
|
-
fields[_i - 2] = arguments[_i];
|
|
896
|
-
}
|
|
897
|
-
return fields.length ?
|
|
898
|
-
multiMatchQuery(query, fields, 'bool_prefix', boost) :
|
|
899
|
-
Object.freeze({
|
|
900
|
-
match_bool_prefix: {
|
|
901
|
-
name: {
|
|
902
|
-
query: query,
|
|
903
|
-
boost: boost
|
|
904
|
-
}
|
|
905
|
-
}
|
|
906
|
-
});
|
|
907
|
-
};
|
|
908
|
-
var wildcardQuery = function (query, boost) {
|
|
909
|
-
if (boost === void 0) { boost = 3; }
|
|
910
|
-
var fields = [];
|
|
911
|
-
for (var _i = 2; _i < arguments.length; _i++) {
|
|
912
|
-
fields[_i - 2] = arguments[_i];
|
|
913
|
-
}
|
|
914
|
-
return Object.freeze({
|
|
915
|
-
simple_query_string: {
|
|
916
|
-
query: "*" + query + "*",
|
|
917
|
-
fields: fields,
|
|
918
|
-
analyze_wildcard: true,
|
|
919
|
-
boost: boost
|
|
920
|
-
}
|
|
921
|
-
});
|
|
922
|
-
};
|
|
923
|
-
var matchCountryLevel = { match: { gadmLevel: 0 } };
|
|
924
|
-
var matchGlobalRegion = { regexp: { '@id': 'region-*' } };
|
|
925
|
-
var matchCountry = Object.freeze({
|
|
926
|
-
bool: {
|
|
927
|
-
should: [
|
|
928
|
-
matchCountryLevel,
|
|
929
|
-
matchGlobalRegion
|
|
930
|
-
],
|
|
931
|
-
minimum_should_match: 1
|
|
932
|
-
}
|
|
933
|
-
});
|
|
934
|
-
var countriesQuery = Object.freeze({
|
|
935
|
-
bool: {
|
|
936
|
-
must: [
|
|
937
|
-
matchType(schema.NodeType.Term),
|
|
938
|
-
matchTermType(schema.TermTermType.region),
|
|
939
|
-
matchCountryLevel
|
|
940
|
-
]
|
|
941
|
-
}
|
|
942
|
-
});
|
|
943
|
-
var allCountriesQuery = Object.freeze({
|
|
944
|
-
bool: Object.assign({ must: [
|
|
945
|
-
matchType(schema.NodeType.Term),
|
|
946
|
-
matchTermType(schema.TermTermType.region)
|
|
947
|
-
] }, matchCountry.bool)
|
|
948
|
-
});
|
|
949
|
-
var matchRegion = numberGte('gadmLevel', 1);
|
|
950
|
-
var regionsQuery = Object.freeze({
|
|
951
|
-
bool: {
|
|
952
|
-
must: [
|
|
953
|
-
matchType(schema.NodeType.Term),
|
|
954
|
-
matchTermType(schema.TermTermType.region),
|
|
955
|
-
matchRegion
|
|
956
|
-
]
|
|
957
|
-
}
|
|
958
|
-
});
|
|
959
|
-
var worldRegion = Object.freeze({
|
|
960
|
-
'@id': 'region-world',
|
|
961
|
-
name: 'World'
|
|
962
|
-
});
|
|
963
|
-
var cropsQuery = Object.freeze({
|
|
964
|
-
bool: {
|
|
965
|
-
must: [
|
|
966
|
-
matchType(schema.NodeType.Term),
|
|
967
|
-
matchTermType(schema.TermTermType.crop)
|
|
968
|
-
]
|
|
969
|
-
}
|
|
970
|
-
});
|
|
971
|
-
var matchAggregatedQuery = matchQuery('aggregated', true);
|
|
972
|
-
var isNestedKey = function (key) { return schema.nestedSearchableKeys.includes(key.split('.')[0]); };
|
|
973
|
-
var matchNestedKey = function (key, query) { return isNestedKey(key) ? {
|
|
974
|
-
nested: { path: key.split('.')[0], query: query }
|
|
975
|
-
} : query; };
|
|
976
|
-
/**
|
|
977
|
-
* List of fields to return in the search results.
|
|
978
|
-
*/
|
|
979
|
-
var searchResultsFields = Object.freeze((_a$4 = {},
|
|
980
|
-
_a$4[schema.NodeType.Cycle] = [
|
|
981
|
-
'description', 'dataDescription', 'endDate',
|
|
982
|
-
'emissionsCount', 'inputsCount', 'productsCount',
|
|
983
|
-
'site.location', 'site.country.name', 'site.region.name'
|
|
984
|
-
],
|
|
985
|
-
_a$4[schema.NodeType.Source] = ['bibliography.title', 'bibliography.documentDOI'],
|
|
986
|
-
_a$4[schema.NodeType.ImpactAssessment] = ['emissionsResourceUseCount', 'impactsCount', 'country.name'],
|
|
987
|
-
_a$4));
|
|
988
|
-
/**
|
|
989
|
-
* List of fields to search in.
|
|
990
|
-
*/
|
|
991
|
-
var searchFields = Object.freeze((_b$1 = {},
|
|
992
|
-
_b$1[schema.NodeType.Cycle] = ['name', 'description', 'dataDescription'],
|
|
993
|
-
_b$1[schema.NodeType.Source] = ['name', 'bibliography.title'],
|
|
994
|
-
_b$1[schema.NodeType.ImpactAssessment] = ['name', 'product.name', 'country.name'],
|
|
995
|
-
_b$1));
|
|
996
|
-
var searchFieldsNested = Object.freeze((_c$1 = {},
|
|
997
|
-
_c$1[schema.NodeType.Cycle] = [
|
|
998
|
-
'inputs.term.name',
|
|
999
|
-
'emissions.term.name',
|
|
1000
|
-
'practices.term.name'
|
|
1001
|
-
],
|
|
1002
|
-
_c$1[schema.NodeType.Source] = [],
|
|
1003
|
-
_c$1[schema.NodeType.ImpactAssessment] = [
|
|
1004
|
-
'emissionsResourceUse.term.name',
|
|
1005
|
-
'impacts.term.name'
|
|
1006
|
-
],
|
|
1007
|
-
_c$1));
|
|
1008
|
-
/**
|
|
1009
|
-
* Specific strict queries per type.
|
|
1010
|
-
*/
|
|
1011
|
-
var searchQueries = (_d$1 = {},
|
|
1012
|
-
_d$1[schema.NodeType.Cycle] = { must: [], must_not: [matchAggregatedQuery] },
|
|
1013
|
-
_d$1[schema.NodeType.Source] = { must: [], must_not: [matchAggregatedQuery] },
|
|
1014
|
-
_d$1);
|
|
1015
|
-
var searchFiltersKeys = (_e = {},
|
|
1016
|
-
_e[schema.NodeType.Cycle] = function (key) { return key; },
|
|
1017
|
-
_e[schema.NodeType.Source] = function (key) { return key; },
|
|
1018
|
-
_e);
|
|
1019
|
-
/* eslint-disable complexity */
|
|
1020
|
-
var searchQuery = function (type, query, filters, aggregated) {
|
|
1021
|
-
var boolQuery = (Object.assign(Object.assign({ must: [
|
|
1022
|
-
matchType(type),
|
|
1023
|
-
aggregated ? matchAggregatedQuery : null
|
|
1024
|
-
].filter(Boolean) }, (query ? {
|
|
1025
|
-
should: __spreadArray([
|
|
1026
|
-
matchPhraseQuery.apply(void 0, __spreadArray([query, 100], __read(searchFields[type]))),
|
|
1027
|
-
matchPhrasePrefixQuery.apply(void 0, __spreadArray([query, 20], __read(searchFields[type]))),
|
|
1028
|
-
matchBoolPrefixQuery.apply(void 0, __spreadArray([query, 10], __read(searchFields[type])))
|
|
1029
|
-
], __read(searchFieldsNested[type].map(function (field) { return matchNestedKey(field, matchBoolPrefixQuery(query, 1, field)); }))),
|
|
1030
|
-
minimum_should_match: 1
|
|
1031
|
-
} : {})), { must_not: [
|
|
1032
|
-
aggregated ? null : matchAggregatedQuery
|
|
1033
|
-
].filter(Boolean) }));
|
|
1034
|
-
var keys = Object.keys(filters || {}).filter(function (key) { return filters[key].length; });
|
|
1035
|
-
return {
|
|
1036
|
-
bool: keys.length ? {
|
|
1037
|
-
must: keys.map(function (key) {
|
|
1038
|
-
var filterKey = searchFiltersKeys[type](key);
|
|
1039
|
-
return {
|
|
1040
|
-
bool: {
|
|
1041
|
-
should: filters[key]
|
|
1042
|
-
.map(function (value) { return matchNestedKey(filterKey, matchExactQuery(filterKey, value)); })
|
|
1043
|
-
.map(function (must) {
|
|
1044
|
-
var localQuery = JSON.parse(JSON.stringify(boolQuery));
|
|
1045
|
-
localQuery.must.push(must);
|
|
1046
|
-
return { bool: localQuery };
|
|
1047
|
-
}),
|
|
1048
|
-
minimum_should_match: 1
|
|
1049
|
-
}
|
|
1050
|
-
};
|
|
1051
|
-
})
|
|
1052
|
-
} : boolQuery
|
|
1053
|
-
};
|
|
1054
|
-
};
|
|
1055
|
-
/* eslint-enable complexity */
|
|
1056
|
-
|
|
1057
|
-
var primaryProduct = function (_a) {
|
|
1058
|
-
var products = _a.products;
|
|
1059
|
-
return (products || []).find(function (_a) {
|
|
1060
|
-
var primary = _a.primary;
|
|
1061
|
-
return primary;
|
|
1062
|
-
});
|
|
1063
|
-
};
|
|
1064
|
-
|
|
1065
|
-
var HE_API_BASE_URL = new i0.InjectionToken('HE_API_BASE_URL');
|
|
1066
|
-
var HeCommonService = /** @class */ (function () {
|
|
1067
|
-
function HeCommonService(_apiBaseUrl) {
|
|
1068
|
-
this._apiBaseUrl = _apiBaseUrl;
|
|
1069
|
-
}
|
|
1070
|
-
Object.defineProperty(HeCommonService.prototype, "apiBaseUrl", {
|
|
1071
|
-
get: function () {
|
|
1072
|
-
return this._apiBaseUrl || '/api';
|
|
1073
|
-
},
|
|
1074
|
-
enumerable: false,
|
|
1075
|
-
configurable: true
|
|
1076
|
-
});
|
|
1077
|
-
Object.defineProperty(HeCommonService.prototype, "gitBranch", {
|
|
1078
|
-
get: function () {
|
|
1079
|
-
return ['dev', 'staging'].some(function (env) { return baseUrl().includes(env); })
|
|
1080
|
-
? 'develop'
|
|
1081
|
-
: 'master';
|
|
1082
|
-
},
|
|
1083
|
-
enumerable: false,
|
|
1084
|
-
configurable: true
|
|
1085
|
-
});
|
|
1086
|
-
return HeCommonService;
|
|
1087
|
-
}());
|
|
1088
|
-
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 });
|
|
1089
|
-
HeCommonService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeCommonService, providedIn: 'root' });
|
|
1090
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeCommonService, decorators: [{
|
|
1091
|
-
type: i0.Injectable,
|
|
1092
|
-
args: [{
|
|
1093
|
-
providedIn: 'root'
|
|
1094
|
-
}]
|
|
1095
|
-
}], ctorParameters: function () {
|
|
1096
|
-
return [{ type: undefined, decorators: [{
|
|
1097
|
-
type: i0.Inject,
|
|
1098
|
-
args: [HE_API_BASE_URL]
|
|
1099
|
-
}] }];
|
|
1100
|
-
} });
|
|
1101
|
-
|
|
1102
|
-
var _a$3, _b, _c;
|
|
796
|
+
var _a$4, _b$1, _c$1;
|
|
1103
797
|
var termProperties = function (term) { return Object.keys(term).filter(function (key) { return !schema.isExpandable(term[key]) && ![
|
|
1104
798
|
'pinned', 'expanded', 'extended', 'selected', 'loading',
|
|
1105
799
|
'_score', '@type', '@id', '@context', 'createdAt',
|
|
@@ -1125,20 +819,20 @@
|
|
|
1125
819
|
lng: longitude
|
|
1126
820
|
});
|
|
1127
821
|
};
|
|
1128
|
-
var termTypeToLabel = (_a$
|
|
1129
|
-
_a$
|
|
1130
|
-
_a$
|
|
1131
|
-
_a$
|
|
1132
|
-
_a$
|
|
1133
|
-
_a$
|
|
1134
|
-
_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);
|
|
1135
829
|
var termTypeLabel = function (type) {
|
|
1136
830
|
if (type === void 0) { type = 'N/A'; }
|
|
1137
831
|
return type in termTypeToLabel ? termTypeToLabel[type] : keyToLabel(type);
|
|
1138
832
|
};
|
|
1139
833
|
var termTypesToChildren = function (termTypes) { return termTypes.map(function (termType) { return ({ label: termTypeLabel(termType), termType: termType }); }); };
|
|
1140
|
-
var groups = Object.freeze((_b = {},
|
|
1141
|
-
_b[schema.TermTermType.emission] = {
|
|
834
|
+
var groups = Object.freeze((_b$1 = {},
|
|
835
|
+
_b$1[schema.TermTermType.emission] = {
|
|
1142
836
|
label: 'Emissions & Resource Use',
|
|
1143
837
|
termType: 'Emissions & Resource Use',
|
|
1144
838
|
children: termTypesToChildren([
|
|
@@ -1150,12 +844,12 @@
|
|
|
1150
844
|
schema.TermTermType.methodEmissionResourceUse
|
|
1151
845
|
])
|
|
1152
846
|
},
|
|
1153
|
-
_b[schema.TermTermType.region] = {
|
|
847
|
+
_b$1[schema.TermTermType.region] = {
|
|
1154
848
|
label: termTypeLabel(schema.TermTermType.region),
|
|
1155
849
|
termType: schema.TermTermType.region,
|
|
1156
850
|
children: []
|
|
1157
851
|
},
|
|
1158
|
-
_b.infrastructure = {
|
|
852
|
+
_b$1.infrastructure = {
|
|
1159
853
|
label: 'Infrastructure & Equipment',
|
|
1160
854
|
termType: 'Infrastructure & Equipment',
|
|
1161
855
|
children: termTypesToChildren([
|
|
@@ -1166,7 +860,7 @@
|
|
|
1166
860
|
schema.TermTermType.machinery
|
|
1167
861
|
])
|
|
1168
862
|
},
|
|
1169
|
-
_b.input = {
|
|
863
|
+
_b$1.input = {
|
|
1170
864
|
label: 'Inputs',
|
|
1171
865
|
termType: 'Inputs',
|
|
1172
866
|
children: termTypesToChildren([
|
|
@@ -1184,7 +878,7 @@
|
|
|
1184
878
|
schema.TermTermType.water
|
|
1185
879
|
])
|
|
1186
880
|
},
|
|
1187
|
-
_b[schema.TermTermType.measurement] = {
|
|
881
|
+
_b$1[schema.TermTermType.measurement] = {
|
|
1188
882
|
label: 'Measurements',
|
|
1189
883
|
termType: 'Measurements',
|
|
1190
884
|
children: termTypesToChildren([
|
|
@@ -1195,7 +889,7 @@
|
|
|
1195
889
|
schema.TermTermType.methodMeasurement
|
|
1196
890
|
])
|
|
1197
891
|
},
|
|
1198
|
-
_b.practice = {
|
|
892
|
+
_b$1.practice = {
|
|
1199
893
|
label: 'Practices',
|
|
1200
894
|
termType: 'Production Practices',
|
|
1201
895
|
children: termTypesToChildren([
|
|
@@ -1213,7 +907,7 @@
|
|
|
1213
907
|
schema.TermTermType.waterRegime,
|
|
1214
908
|
])
|
|
1215
909
|
},
|
|
1216
|
-
_b.product = {
|
|
910
|
+
_b$1.product = {
|
|
1217
911
|
label: 'Products',
|
|
1218
912
|
termType: 'Products',
|
|
1219
913
|
children: termTypesToChildren([
|
|
@@ -1226,12 +920,12 @@
|
|
|
1226
920
|
schema.TermTermType.processedFood
|
|
1227
921
|
])
|
|
1228
922
|
},
|
|
1229
|
-
_b[schema.TermTermType.property] = {
|
|
923
|
+
_b$1[schema.TermTermType.property] = {
|
|
1230
924
|
label: termTypeLabel(schema.TermTermType.property),
|
|
1231
925
|
termType: schema.TermTermType.property,
|
|
1232
926
|
children: []
|
|
1233
927
|
},
|
|
1234
|
-
_b));
|
|
928
|
+
_b$1));
|
|
1235
929
|
var termTypeGroups = [
|
|
1236
930
|
groups.property,
|
|
1237
931
|
groups.region,
|
|
@@ -1242,10 +936,10 @@
|
|
|
1242
936
|
groups.measurement,
|
|
1243
937
|
groups.infrastructure
|
|
1244
938
|
];
|
|
1245
|
-
var termToParent = (_c = {},
|
|
1246
|
-
_c[schema.TermTermType.property] = 'Properties',
|
|
1247
|
-
_c[schema.TermTermType.region] = 'Geographies',
|
|
1248
|
-
_c);
|
|
939
|
+
var termToParent = (_c$1 = {},
|
|
940
|
+
_c$1[schema.TermTermType.property] = 'Properties',
|
|
941
|
+
_c$1[schema.TermTermType.region] = 'Geographies',
|
|
942
|
+
_c$1);
|
|
1249
943
|
var termChildToParent = function (termType) { return termTypeGroups.find(function (_a) {
|
|
1250
944
|
var children = _a.children;
|
|
1251
945
|
return (children || []).some(function (child) { return child.termType === termType; });
|
|
@@ -1300,6 +994,52 @@
|
|
|
1300
994
|
schema.TermTermType.standardsLabels
|
|
1301
995
|
];
|
|
1302
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"; };
|
|
1303
1043
|
var HeNodeService = /** @class */ (function () {
|
|
1304
1044
|
function HeNodeService(http, authService, commonService) {
|
|
1305
1045
|
this.http = http;
|
|
@@ -1354,28 +1094,20 @@
|
|
|
1354
1094
|
.catch(function () { return (responseType === 'json' ? ({}) : ''); });
|
|
1355
1095
|
};
|
|
1356
1096
|
HeNodeService.prototype.nodeTypeUrl = function (type) {
|
|
1357
|
-
return this.commonService.apiBaseUrl
|
|
1358
|
-
};
|
|
1359
|
-
HeNodeService.prototype.nodeUrl = function (_a) {
|
|
1360
|
-
var dataState = _a.dataState, node = __rest(_a, ["dataState"]);
|
|
1361
|
-
return this.nodeTypeUrl(node['@type'] || node.type) + "/" + (node['@id'] || node.id) + (dataState ? "?dataState=" + dataState : '');
|
|
1362
|
-
};
|
|
1363
|
-
HeNodeService.prototype.nodeLogsUrl = function (_a) {
|
|
1364
|
-
var dataState = _a.dataState, node = __rest(_a, ["dataState"]);
|
|
1365
|
-
return this.nodeUrl(node) + "/log" + (dataState ? "?dataState=" + dataState : '');
|
|
1097
|
+
return nodeTypeUrl(this.commonService.apiBaseUrl, type);
|
|
1366
1098
|
};
|
|
1367
|
-
HeNodeService.prototype.
|
|
1368
|
-
return
|
|
1099
|
+
HeNodeService.prototype.nodeUrl = function (node) {
|
|
1100
|
+
return nodeUrl(this.commonService.apiBaseUrl, node);
|
|
1369
1101
|
};
|
|
1370
|
-
HeNodeService.prototype.
|
|
1371
|
-
return
|
|
1102
|
+
HeNodeService.prototype.nodeLogsUrl = function (node) {
|
|
1103
|
+
return nodeLogsUrl(this.commonService.apiBaseUrl, node);
|
|
1372
1104
|
};
|
|
1373
1105
|
HeNodeService.prototype.downloadLookup = function (filename) {
|
|
1374
1106
|
return __awaiter(this, void 0, void 0, function () {
|
|
1375
1107
|
var url;
|
|
1376
1108
|
return __generator(this, function (_b) {
|
|
1377
1109
|
try {
|
|
1378
|
-
url =
|
|
1110
|
+
url = lookupUrl(filename);
|
|
1379
1111
|
return [2 /*return*/, this.downloadRaw(url, 'text')];
|
|
1380
1112
|
}
|
|
1381
1113
|
catch (_err) {
|
|
@@ -1395,7 +1127,7 @@
|
|
|
1395
1127
|
return [4 /*yield*/, this.downloadLookup(termType)];
|
|
1396
1128
|
case 1:
|
|
1397
1129
|
data = _b.sent();
|
|
1398
|
-
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];
|
|
1399
1131
|
case 2:
|
|
1400
1132
|
_err_1 = _b.sent();
|
|
1401
1133
|
return [2 /*return*/, null];
|
|
@@ -1415,54 +1147,15 @@
|
|
|
1415
1147
|
}]
|
|
1416
1148
|
}], ctorParameters: function () { return [{ type: i1__namespace$1.HttpClient }, { type: HeAuthService }, { type: HeCommonService }]; } });
|
|
1417
1149
|
|
|
1418
|
-
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(); };
|
|
1419
1152
|
var lookups = Object.freeze({
|
|
1420
1153
|
cropYield: 'region-crop-cropGroupingFaostatProduction-yield',
|
|
1421
1154
|
cropGroupingColumn: 'cropGroupingFaostatProduction'
|
|
1422
1155
|
});
|
|
1423
|
-
var extractGroupedDataClosesDate = function (data, year) {
|
|
1424
|
-
var dataByDate = (data || '').split(';').reduce(function (prev, curr) {
|
|
1425
|
-
var _d;
|
|
1426
|
-
return (Object.assign(Object.assign({}, prev), (curr.length > 0 && curr.split(':')[1] !== '-' ? (_d = {}, _d[curr.split(':')[0]] = curr.split(':')[1], _d) : {})));
|
|
1427
|
-
}, {});
|
|
1428
|
-
var years = Object.keys(dataByDate).map(function (v) { return +v; });
|
|
1429
|
-
var closestYear = years.reduce(function (prev, curr) { return Math.abs(curr - year) < Math.abs(prev - year) ? curr : prev; }, 0);
|
|
1430
|
-
return closestYear ? +dataByDate[closestYear] / 10 : null;
|
|
1431
|
-
};
|
|
1432
|
-
var cropGrouping = function (lookup, product) { return (lookup.find(function (_d) {
|
|
1433
|
-
var term = _d.term;
|
|
1434
|
-
return term.id === (product === null || product === void 0 ? void 0 : product.term['@id']);
|
|
1435
|
-
}) || {})[lookups.cropGroupingColumn]; };
|
|
1436
|
-
var cropYieldCountry = function (cropYield, cycle) { return cropYield.find(function (_d) {
|
|
1437
|
-
var term = _d.term;
|
|
1438
|
-
return term.id === get$4(cycle, 'site.country.@id', worldRegion['@id']);
|
|
1439
|
-
}) || {}; };
|
|
1440
|
-
var extendCycle = function (_d) {
|
|
1441
|
-
var crop = _d.crop, cropYield = _d.cropYield;
|
|
1442
|
-
return function (cycle) {
|
|
1443
|
-
var _a, _b, _c;
|
|
1444
|
-
var product = primaryProduct(cycle);
|
|
1445
|
-
var grouping = cropGrouping(crop, product);
|
|
1446
|
-
var countryData = cropYieldCountry(cropYield, cycle)[grouping];
|
|
1447
|
-
var countryValue = extractGroupedDataClosesDate(countryData, +(cycle.endDate || ''));
|
|
1448
|
-
var productValue = propertyValue$1(product === null || product === void 0 ? void 0 : product.value);
|
|
1449
|
-
return {
|
|
1450
|
-
cycle: cycle,
|
|
1451
|
-
name: (_a = product === null || product === void 0 ? void 0 : product.term) === null || _a === void 0 ? void 0 : _a.name,
|
|
1452
|
-
startDate: cycle.startDate,
|
|
1453
|
-
endDate: cycle.endDate,
|
|
1454
|
-
country: ((_c = (_b = cycle.site) === null || _b === void 0 ? void 0 : _b.country) === null || _c === void 0 ? void 0 : _c.name) || worldRegion.name,
|
|
1455
|
-
observations: propertyValue$1(product === null || product === void 0 ? void 0 : product.observations) || 0,
|
|
1456
|
-
yield: productValue,
|
|
1457
|
-
faoYield: countryValue || undefined,
|
|
1458
|
-
diff: delta(productValue, countryValue)
|
|
1459
|
-
};
|
|
1460
|
-
};
|
|
1461
|
-
};
|
|
1462
1156
|
var HeAggregationEngineService = /** @class */ (function () {
|
|
1463
|
-
function HeAggregationEngineService(http,
|
|
1157
|
+
function HeAggregationEngineService(http, nodeService) {
|
|
1464
1158
|
this.http = http;
|
|
1465
|
-
this.commonService = commonService;
|
|
1466
1159
|
this.nodeService = nodeService;
|
|
1467
1160
|
this.modelsLoading = false;
|
|
1468
1161
|
this.modelsLoaded = false;
|
|
@@ -1474,38 +1167,24 @@
|
|
|
1474
1167
|
}
|
|
1475
1168
|
HeAggregationEngineService.prototype.init = function () {
|
|
1476
1169
|
return __awaiter(this, void 0, void 0, function () {
|
|
1477
|
-
return __generator(this, function (
|
|
1478
|
-
switch (
|
|
1170
|
+
return __generator(this, function (_b) {
|
|
1171
|
+
switch (_b.label) {
|
|
1479
1172
|
case 0: return [4 /*yield*/, this.loadModels().toPromise()];
|
|
1480
1173
|
case 1:
|
|
1481
|
-
|
|
1174
|
+
_b.sent();
|
|
1482
1175
|
return [2 /*return*/];
|
|
1483
1176
|
}
|
|
1484
1177
|
});
|
|
1485
1178
|
});
|
|
1486
|
-
};
|
|
1487
|
-
Object.defineProperty(HeAggregationEngineService.prototype, "gitUrl", {
|
|
1488
|
-
get: function () {
|
|
1489
|
-
return gitHome + "/hestia-aggregation-engine/-/blob/" + this.commonService.gitBranch;
|
|
1490
|
-
},
|
|
1491
|
-
enumerable: false,
|
|
1492
|
-
configurable: true
|
|
1493
|
-
});
|
|
1494
|
-
Object.defineProperty(HeAggregationEngineService.prototype, "rawUrl", {
|
|
1495
|
-
get: function () {
|
|
1496
|
-
return gitRawBaseUrl + "/hestia-aggregation-engine/-/raw/" + this.commonService.gitBranch;
|
|
1497
|
-
},
|
|
1498
|
-
enumerable: false,
|
|
1499
|
-
configurable: true
|
|
1500
|
-
});
|
|
1179
|
+
};
|
|
1501
1180
|
HeAggregationEngineService.prototype.loadModels = function () {
|
|
1502
1181
|
var _this = this;
|
|
1503
1182
|
this.modelsLoading = true;
|
|
1504
|
-
return this.http.get(
|
|
1505
|
-
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;
|
|
1506
1185
|
_this._models.next(links.map(function (_a) {
|
|
1507
1186
|
var modelPath = _a.path, docPath = _a.docPath, link = __rest(_a, ["path", "docPath"]);
|
|
1508
|
-
return (Object.assign(Object.assign({}, link), { path:
|
|
1187
|
+
return (Object.assign(Object.assign({}, link), { path: gitUrl$1() + "/" + modelPath, docPath: gitUrl$1() + "/" + docPath }));
|
|
1509
1188
|
}));
|
|
1510
1189
|
_this.modelsLoading = false;
|
|
1511
1190
|
_this.modelsLoaded = true;
|
|
@@ -1531,11 +1210,11 @@
|
|
|
1531
1210
|
HeAggregationEngineService.prototype.loadLookup = function (filename) {
|
|
1532
1211
|
return __awaiter(this, void 0, void 0, function () {
|
|
1533
1212
|
var data;
|
|
1534
|
-
return __generator(this, function (
|
|
1535
|
-
switch (
|
|
1213
|
+
return __generator(this, function (_b) {
|
|
1214
|
+
switch (_b.label) {
|
|
1536
1215
|
case 0: return [4 /*yield*/, this.nodeService.downloadLookup(filename)];
|
|
1537
1216
|
case 1:
|
|
1538
|
-
data =
|
|
1217
|
+
data = _b.sent();
|
|
1539
1218
|
return [2 /*return*/, csvtojson__namespace({ delimiter: 'auto' }).fromString(data)];
|
|
1540
1219
|
}
|
|
1541
1220
|
});
|
|
@@ -1565,16 +1244,18 @@
|
|
|
1565
1244
|
};
|
|
1566
1245
|
return HeAggregationEngineService;
|
|
1567
1246
|
}());
|
|
1568
|
-
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 });
|
|
1569
1248
|
HeAggregationEngineService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeAggregationEngineService, providedIn: 'root' });
|
|
1570
1249
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeAggregationEngineService, decorators: [{
|
|
1571
1250
|
type: i0.Injectable,
|
|
1572
1251
|
args: [{
|
|
1573
1252
|
providedIn: 'root'
|
|
1574
1253
|
}]
|
|
1575
|
-
}], ctorParameters: function () { return [{ type: i1__namespace$1.HttpClient }, { type:
|
|
1254
|
+
}], ctorParameters: function () { return [{ type: i1__namespace$1.HttpClient }, { type: HeNodeService }]; } });
|
|
1576
1255
|
|
|
1577
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(); };
|
|
1578
1259
|
var findConfigModels = function (_b, modelId, modelKey) {
|
|
1579
1260
|
var models = _b.models;
|
|
1580
1261
|
return models.flat().filter(function (_b) {
|
|
@@ -1592,9 +1273,8 @@
|
|
|
1592
1273
|
].filter(Boolean).join('-')
|
|
1593
1274
|
].join('/'); };
|
|
1594
1275
|
var HeEngineService = /** @class */ (function () {
|
|
1595
|
-
function HeEngineService(http
|
|
1276
|
+
function HeEngineService(http) {
|
|
1596
1277
|
this.http = http;
|
|
1597
|
-
this.commonService = commonService;
|
|
1598
1278
|
this.modelsLoading = false;
|
|
1599
1279
|
this.modelsLoaded = false;
|
|
1600
1280
|
this._models = new rxjs.ReplaySubject(1);
|
|
@@ -1612,28 +1292,14 @@
|
|
|
1612
1292
|
});
|
|
1613
1293
|
});
|
|
1614
1294
|
};
|
|
1615
|
-
Object.defineProperty(HeEngineService.prototype, "gitUrl", {
|
|
1616
|
-
get: function () {
|
|
1617
|
-
return gitHome + "/hestia-engine-models/-/blob/" + this.commonService.gitBranch;
|
|
1618
|
-
},
|
|
1619
|
-
enumerable: false,
|
|
1620
|
-
configurable: true
|
|
1621
|
-
});
|
|
1622
|
-
Object.defineProperty(HeEngineService.prototype, "rawUrl", {
|
|
1623
|
-
get: function () {
|
|
1624
|
-
return gitRawBaseUrl + "/hestia-engine-models/-/raw/" + this.commonService.gitBranch;
|
|
1625
|
-
},
|
|
1626
|
-
enumerable: false,
|
|
1627
|
-
configurable: true
|
|
1628
|
-
});
|
|
1629
1295
|
HeEngineService.prototype.loadModels = function () {
|
|
1630
1296
|
var _this = this;
|
|
1631
1297
|
this.modelsLoading = true;
|
|
1632
|
-
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) {
|
|
1633
1299
|
var links = _b.links;
|
|
1634
1300
|
_this._models.next(links.map(function (_a) {
|
|
1635
1301
|
var path = _a.path, docPath = _a.docPath, link = __rest(_a, ["path", "docPath"]);
|
|
1636
|
-
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) }));
|
|
1637
1303
|
}));
|
|
1638
1304
|
_this.modelsLoading = false;
|
|
1639
1305
|
_this.modelsLoaded = true;
|
|
@@ -1663,14 +1329,14 @@
|
|
|
1663
1329
|
};
|
|
1664
1330
|
return HeEngineService;
|
|
1665
1331
|
}());
|
|
1666
|
-
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 });
|
|
1667
1333
|
HeEngineService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeEngineService, providedIn: 'root' });
|
|
1668
1334
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeEngineService, decorators: [{
|
|
1669
1335
|
type: i0.Injectable,
|
|
1670
1336
|
args: [{
|
|
1671
1337
|
providedIn: 'root'
|
|
1672
1338
|
}]
|
|
1673
|
-
}], ctorParameters: function () { return [{ type: i1__namespace$1.HttpClient }
|
|
1339
|
+
}], ctorParameters: function () { return [{ type: i1__namespace$1.HttpClient }]; } });
|
|
1674
1340
|
|
|
1675
1341
|
var NodeKeyState;
|
|
1676
1342
|
(function (NodeKeyState) {
|
|
@@ -2123,7 +1789,7 @@
|
|
|
2123
1789
|
return MapsDrawingConfirmComponent;
|
|
2124
1790
|
}());
|
|
2125
1791
|
MapsDrawingConfirmComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: MapsDrawingConfirmComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
2126
|
-
MapsDrawingConfirmComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: MapsDrawingConfirmComponent, selector: "he-maps-drawing-confirm", inputs: { value: "value", modes: "modes", center: "center", zoom: "zoom" }, outputs: { closed: "closed" }, viewQueries: [{ propertyName: "map", first: true, predicate: i1$2.GoogleMap, descendants: true }], ngImport: i0__namespace, template: "<div class=\"modal is-large is-active\">\n <div class=\"modal-background\"></div>\n <div class=\"modal-card\">\n <header class=\"modal-card-head\">\n <p class=\"modal-card-title\">Draw on Map</p>\n <button class=\"delete\" aria-label=\"close\" (click)=\"closed.next(value)\"></button>\n </header>\n <section class=\"modal-card-body p-0\">\n <google-map\n height=\"100%\"\n width=\"100%\"\n [zoom]=\"zoom\"\n [center]=\"center\"\n [options]=\"options\"\n ></google-map>\n </section>\n <footer class=\"modal-card-foot\">\n <button class=\"button is-primary\" (click)=\"confirm()\">\n <span
|
|
1792
|
+
MapsDrawingConfirmComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: MapsDrawingConfirmComponent, selector: "he-maps-drawing-confirm", inputs: { value: "value", modes: "modes", center: "center", zoom: "zoom" }, outputs: { closed: "closed" }, viewQueries: [{ propertyName: "map", first: true, predicate: i1$2.GoogleMap, descendants: true }], ngImport: i0__namespace, template: "<div class=\"modal is-large is-active\">\n <div class=\"modal-background\"></div>\n <div class=\"modal-card\">\n <header class=\"modal-card-head\">\n <p class=\"modal-card-title\">Draw on Map</p>\n <button class=\"delete\" aria-label=\"close\" (click)=\"closed.next(value)\"></button>\n </header>\n <section class=\"modal-card-body p-0\">\n <google-map\n height=\"100%\"\n width=\"100%\"\n [zoom]=\"zoom\"\n [center]=\"center\"\n [options]=\"options\"\n ></google-map>\n </section>\n <footer class=\"modal-card-foot\">\n <button class=\"button is-primary\" (click)=\"confirm()\">\n <span>Confirm</span>\n </button>\n <button class=\"button\" (click)=\"closed.next(value)\">\n <span>Close</span>\n </button>\n <button class=\"button is-danger is-outlined\" (click)=\"clear()\">\n <fa-icon class=\"mr-2\" icon=\"times\"></fa-icon>\n <span>Clear</span>\n </button>\n </footer>\n </div>\n</div>\n", styles: ["google-map{display:block;height:100%;max-height:calc(100vh - 146px);min-height:500px}\n"], components: [{ type: i1__namespace$2.GoogleMap, selector: "google-map", inputs: ["height", "width", "center", "zoom", "options", "mapTypeId"], outputs: ["authFailure", "boundsChanged", "centerChanged", "mapClick", "mapDblclick", "mapDrag", "mapDragend", "mapDragstart", "headingChanged", "idle", "maptypeidChanged", "mapMousemove", "mapMouseout", "mapMouseover", "projectionChanged", "mapRightclick", "tilesloaded", "tiltChanged", "zoomChanged"], exportAs: ["googleMap"] }, { 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"] }] });
|
|
2127
1793
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: MapsDrawingConfirmComponent, decorators: [{
|
|
2128
1794
|
type: i0.Component,
|
|
2129
1795
|
args: [{
|
|
@@ -2160,7 +1826,7 @@
|
|
|
2160
1826
|
return PopoverComponent;
|
|
2161
1827
|
}());
|
|
2162
1828
|
PopoverComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: PopoverComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
2163
|
-
PopoverComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: PopoverComponent, selector: "he-popover", inputs: { message: "message", content: "content", data: "data", position: "position" }, host: { listeners: { "click": "onClick($event)" } }, ngImport: i0__namespace, template: "<div class=\"is-inline-block popover is-popover-{{position}}\" [class.is-popover-active]=\"active\">\n <ng-content></ng-content>\n\n <div class=\"popover-content\">\n\n <ng-template\n [ngTemplateOutlet]=\"content || ct\"\n [ngTemplateOutletContext]=\"{message: message, data: data}\"\n ></ng-template>\n\n <footer>\n <ng-content select=\"[actions]\"></ng-content>\n <button class=\"button is-small\" (click)=\"$event.stopPropagation(); active = false\">\n <span
|
|
1829
|
+
PopoverComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: PopoverComponent, selector: "he-popover", inputs: { message: "message", content: "content", data: "data", position: "position" }, host: { listeners: { "click": "onClick($event)" } }, ngImport: i0__namespace, template: "<div class=\"is-inline-block popover is-popover-{{position}}\" [class.is-popover-active]=\"active\">\n <ng-content></ng-content>\n\n <div class=\"popover-content\">\n\n <ng-template\n [ngTemplateOutlet]=\"content || ct\"\n [ngTemplateOutletContext]=\"{message: message, data: data}\"\n ></ng-template>\n\n <footer>\n <ng-content select=\"[actions]\"></ng-content>\n <button class=\"button is-small\" (click)=\"$event.stopPropagation(); active = false\">\n <span>Close</span>\n </button>\n </footer>\n </div>\n</div>\n\n<ng-template #ct>\n <p class=\"mb-2 is-pre-wrap\" [innerHtml]=\"message\"></p>\n</ng-template>\n", styles: [":host{cursor:pointer;display:block}.popover{position:relative;display:inline-block}.popover .popover-content{z-index:99999;position:absolute;display:none;font-size:.75rem;padding:.4rem .8rem;color:#4a4a4a;background-color:#fff;border-radius:4px;box-shadow:0 2px 3px #0a0a0a1a,0 0 0 1px #0a0a0a1a;width:max-content;max-width:24rem}.popover .popover-content:before{position:absolute;content:\"\";border-style:solid;pointer-events:none;height:0;width:0;top:100%;left:50%;border-color:transparent;border-bottom-color:#fff;border-left-color:#fff;border-width:.4rem;margin-left:-.4rem;margin-top:-.4rem;transform-origin:center;box-shadow:-1px 1px 2px #0a0a0a33}.popover .popover-content{top:auto!important;bottom:100%!important;left:50%!important;right:auto!important;transform:translate(-50%,-.7rem)!important}.popover .popover-content:before{top:100%!important;bottom:auto!important;left:50%!important;right:auto!important;transform:rotate(-45deg)}.popover.is-popover-right .popover-content{top:auto!important;bottom:50%!important;left:100%!important;right:auto!important;transform:translate(.7rem,50%)!important}.popover.is-popover-right .popover-content:before{top:50%!important;bottom:auto!important;left:0!important;right:auto!important;transform:rotate(45deg)}.popover.is-popover-bottom .popover-content{top:100%!important;bottom:auto!important;left:50%!important;right:auto!important;transform:translate(-50%,.7rem)!important}.popover.is-popover-bottom .popover-content:before{top:0!important;bottom:auto!important;left:50%!important;right:auto!important;transform:rotate(135deg)}.popover.is-popover-left .popover-content{top:auto!important;bottom:50%!important;left:auto!important;right:100%!important;transform:translate(-.7rem,50%)!important}.popover.is-popover-left .popover-content:before{top:50%!important;bottom:auto!important;left:100%!important;right:auto!important;transform:rotate(-135deg)}.popover.is-popover-active .popover-content,.popover.is-popover-hover:hover .popover-content,.popover .popover-trigger:focus~.popover-content{display:block}\n"], directives: [{ type: i3__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
|
|
2164
1830
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: PopoverComponent, decorators: [{
|
|
2165
1831
|
type: i0.Component,
|
|
2166
1832
|
args: [{
|
|
@@ -2193,7 +1859,7 @@
|
|
|
2193
1859
|
return PopoverConfirmComponent;
|
|
2194
1860
|
}());
|
|
2195
1861
|
PopoverConfirmComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: PopoverConfirmComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
2196
|
-
PopoverConfirmComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: PopoverConfirmComponent, selector: "he-popover-confirm", inputs: { message: "message", content: "content", position: "position", popoverClass: "popoverClass" }, outputs: { confirmed: "confirmed" }, viewQueries: [{ propertyName: "popover", first: true, predicate: PopoverComponent, descendants: true }], ngImport: i0__namespace, template: "<he-popover [message]=\"message\" [content]=\"content\" [data]=\"data\" [position]=\"position\" [class]=\"popoverClass\">\n <ng-content></ng-content>\n\n <ng-container actions>\n <button class=\"button is-small is-primary mr-2\" (click)=\"$event.stopPropagation(); confirm()\">\n <span
|
|
1862
|
+
PopoverConfirmComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: PopoverConfirmComponent, selector: "he-popover-confirm", inputs: { message: "message", content: "content", position: "position", popoverClass: "popoverClass" }, outputs: { confirmed: "confirmed" }, viewQueries: [{ propertyName: "popover", first: true, predicate: PopoverComponent, descendants: true }], ngImport: i0__namespace, template: "<he-popover [message]=\"message\" [content]=\"content\" [data]=\"data\" [position]=\"position\" [class]=\"popoverClass\">\n <ng-content></ng-content>\n\n <ng-container actions>\n <button class=\"button is-small is-primary mr-2\" (click)=\"$event.stopPropagation(); confirm()\">\n <span>Confirm</span>\n </button>\n </ng-container>\n</he-popover>\n", styles: ["he-popover{height:100%;width:100%}\n"], components: [{ type: PopoverComponent, selector: "he-popover", inputs: ["message", "content", "data", "position"] }] });
|
|
2197
1863
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: PopoverConfirmComponent, decorators: [{
|
|
2198
1864
|
type: i0.Component,
|
|
2199
1865
|
args: [{
|
|
@@ -2346,11 +2012,11 @@
|
|
|
2346
2012
|
}] } });
|
|
2347
2013
|
|
|
2348
2014
|
var toastId = 0;
|
|
2349
|
-
var
|
|
2350
|
-
function
|
|
2015
|
+
var HeToastService = /** @class */ (function () {
|
|
2016
|
+
function HeToastService() {
|
|
2351
2017
|
this.toasts = new rxjs.ReplaySubject(1);
|
|
2352
2018
|
}
|
|
2353
|
-
|
|
2019
|
+
HeToastService.prototype.success = function (message, duration) {
|
|
2354
2020
|
if (duration === void 0) { duration = 3000; }
|
|
2355
2021
|
this.toasts.next({
|
|
2356
2022
|
id: ++toastId,
|
|
@@ -2360,7 +2026,7 @@
|
|
|
2360
2026
|
showRawMessage: true
|
|
2361
2027
|
});
|
|
2362
2028
|
};
|
|
2363
|
-
|
|
2029
|
+
HeToastService.prototype.error = function (message, showRawMessage, duration) {
|
|
2364
2030
|
if (showRawMessage === void 0) { showRawMessage = true; }
|
|
2365
2031
|
if (duration === void 0) { duration = 3000; }
|
|
2366
2032
|
this.toasts.next({
|
|
@@ -2371,11 +2037,11 @@
|
|
|
2371
2037
|
showRawMessage: showRawMessage
|
|
2372
2038
|
});
|
|
2373
2039
|
};
|
|
2374
|
-
return
|
|
2040
|
+
return HeToastService;
|
|
2375
2041
|
}());
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
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: [{
|
|
2379
2045
|
type: i0.Injectable,
|
|
2380
2046
|
args: [{
|
|
2381
2047
|
providedIn: 'root'
|
|
@@ -2407,7 +2073,7 @@
|
|
|
2407
2073
|
};
|
|
2408
2074
|
return ToastComponent;
|
|
2409
2075
|
}());
|
|
2410
|
-
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 });
|
|
2411
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"] }] });
|
|
2412
2078
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ToastComponent, decorators: [{
|
|
2413
2079
|
type: i0.Component,
|
|
@@ -2416,7 +2082,7 @@
|
|
|
2416
2082
|
templateUrl: './toast.component.html',
|
|
2417
2083
|
styleUrls: ['./toast.component.scss']
|
|
2418
2084
|
}]
|
|
2419
|
-
}], ctorParameters: function () { return [{ type:
|
|
2085
|
+
}], ctorParameters: function () { return [{ type: HeToastService }]; } });
|
|
2420
2086
|
|
|
2421
2087
|
var KeysPipe = /** @class */ (function () {
|
|
2422
2088
|
function KeysPipe() {
|
|
@@ -2900,6 +2566,249 @@
|
|
|
2900
2566
|
}]
|
|
2901
2567
|
}], ctorParameters: function () { return [{ type: i1__namespace$1.HttpClient }, { type: HeCommonService }]; } });
|
|
2902
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
|
+
|
|
2903
2812
|
var emptySearchResult = function () { return ({
|
|
2904
2813
|
time: 0,
|
|
2905
2814
|
count: 0,
|
|
@@ -3090,7 +2999,7 @@
|
|
|
3090
2999
|
return BibliographiesSearchConfirmComponent;
|
|
3091
3000
|
}());
|
|
3092
3001
|
BibliographiesSearchConfirmComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: BibliographiesSearchConfirmComponent, deps: [{ token: i1__namespace$4.FormBuilder }, { token: HeMendeleyService }, { token: HeSearchService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
3093
|
-
BibliographiesSearchConfirmComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: BibliographiesSearchConfirmComponent, selector: "he-bibliographies-search-confirm", inputs: { search: "search", searchSources: "searchSources", searchBibliographies: "searchBibliographies", searchBy: "searchBy" }, outputs: { closed: "closed" }, ngImport: i0__namespace, template: "<div class=\"modal is-large is-active\">\n <div class=\"modal-background\"></div>\n <div class=\"modal-card\">\n <header class=\"modal-card-head\">\n <p class=\"modal-card-title\">Search Bibliographies</p>\n <button class=\"delete\" aria-label=\"close\" (click)=\"cancel()\"></button>\n </header>\n <section class=\"modal-card-body\">\n <form [formGroup]=\"formGroup\" novalidate>\n <div class=\"field has-addons\">\n <div class=\"control is-expanded has-icons-right\">\n <input class=\"input search-input\"\n [attr.placeholder]=\"'Search bibliography by ' + searchBy\"\n formControlName=\"search\" name=\"randomname\" autocomplete=\"off\"\n (focus)=\"searchFocus($event)\"\n >\n <a class=\"icon is-small is-right\" (click)=\"!loading && resetSearch()\" [ngSwitch]=\"loading\">\n <fa-icon *ngSwitchCase=\"true\" icon=\"spinner\" [pulse]=\"true\"></fa-icon>\n <fa-icon *ngSwitchCase=\"false\" icon=\"times\"></fa-icon>\n </a>\n </div>\n </div>\n </form>\n\n <div class=\"mt-2\">\n <span
|
|
3002
|
+
BibliographiesSearchConfirmComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: BibliographiesSearchConfirmComponent, selector: "he-bibliographies-search-confirm", inputs: { search: "search", searchSources: "searchSources", searchBibliographies: "searchBibliographies", searchBy: "searchBy" }, outputs: { closed: "closed" }, ngImport: i0__namespace, template: "<div class=\"modal is-large is-active\">\n <div class=\"modal-background\"></div>\n <div class=\"modal-card\">\n <header class=\"modal-card-head\">\n <p class=\"modal-card-title\">Search Bibliographies</p>\n <button class=\"delete\" aria-label=\"close\" (click)=\"cancel()\"></button>\n </header>\n <section class=\"modal-card-body\">\n <form [formGroup]=\"formGroup\" novalidate>\n <div class=\"field has-addons\">\n <div class=\"control is-expanded has-icons-right\">\n <input class=\"input search-input\"\n [attr.placeholder]=\"'Search bibliography by ' + searchBy\"\n formControlName=\"search\" name=\"randomname\" autocomplete=\"off\"\n (focus)=\"searchFocus($event)\"\n >\n <a class=\"icon is-small is-right\" (click)=\"!loading && resetSearch()\" [ngSwitch]=\"loading\">\n <fa-icon *ngSwitchCase=\"true\" icon=\"spinner\" [pulse]=\"true\"></fa-icon>\n <fa-icon *ngSwitchCase=\"false\" icon=\"times\"></fa-icon>\n </a>\n </div>\n </div>\n </form>\n\n <div class=\"mt-2\">\n <span [class.is-hidden]=\"loading || !searchControl?.value || hasResults\">\n No bibliographies found matching query.\n </span>\n\n <ul>\n <li *ngFor=\"let result of results | async\">\n <a class=\"is-block p-1 search-result\" (click)=\"selectResult(result)\"\n [class.is-active]=\"selectedResult === result\"\n >\n <ngb-highlight\n [result]=\"result.bibliography ? result.bibliography.title : result.title\"\n [term]=\"searchControl?.value\"\n ></ngb-highlight>\n\n <span class=\"px-1\">-</span>\n\n <span class=\"px-1\"><i>{{result.name}}</i></span>\n\n <span class=\"px-1\"\n *ngIf=\"result.bibliography?.documentDOI || result.documentDOI\"\n >- <b>documentDOI:</b>\n </span>\n <ngb-highlight\n [result]=\"result.bibliography ? result.bibliography.documentDOI : result.documentDOI\"\n [term]=\"searchControl?.value\"\n ></ngb-highlight>\n\n <span class=\"px-1\"\n *ngIf=\"result.bibliography?.scopus || result.scopus\"\n >- <b>scopus:</b>\n </span>\n <ngb-highlight\n [result]=\"result.bibliography?.scopus || result.scopus\"\n [term]=\"searchControl?.value\"\n ></ngb-highlight>\n\n <span>\n <ng-container *ngTemplateOutlet=\"mendeleyLink; context: {$implicit: result.bibliography ? result.bibliography.mendeleyID : result.mendeleyID}\"></ng-container>\n </span>\n </a>\n </li>\n </ul>\n </div>\n </section>\n <footer class=\"modal-card-foot\">\n <button class=\"button is-primary\" (click)=\"confirm()\" [disabled]=\"!selectedResult\">\n <span>Confirm</span>\n </button>\n <button class=\"button\" (click)=\"cancel()\">\n <span>Close</span>\n </button>\n </footer>\n </div>\n</div>\n\n<ng-template #mendeleyLink let-id>\n <a *ngIf=\"id\" [href]=\"'https://www.mendeley.com/catalogue/' + id\" target=\"_blank\"\n (click)=\"$event.stopPropagation()\"\n >\n <fa-icon class=\"ml-2\" icon=\"external-link-alt\" size=\"sm\"></fa-icon>\n </a>\n</ng-template>\n", styles: ["ngb-highlight,span{vertical-align:middle;white-space:normal;width:auto}\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: i10__namespace.NgbHighlight, selector: "ngb-highlight", inputs: ["highlightClass", "result", "term"] }], directives: [{ type: i1__namespace$4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1__namespace$4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1__namespace$4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1__namespace$4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i1__namespace$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1__namespace$4.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i3__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i3__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "async": i3__namespace.AsyncPipe } });
|
|
3094
3003
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: BibliographiesSearchConfirmComponent, decorators: [{
|
|
3095
3004
|
type: i0.Component,
|
|
3096
3005
|
args: [{
|
|
@@ -3190,6 +3099,14 @@
|
|
|
3190
3099
|
emptyFieldValue: ''
|
|
3191
3100
|
}); };
|
|
3192
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
|
+
|
|
3193
3110
|
var _a$1;
|
|
3194
3111
|
var linkTypeEnabled = function (type) { return [
|
|
3195
3112
|
schema.NodeType.Cycle,
|
|
@@ -3587,7 +3504,7 @@
|
|
|
3587
3504
|
return NodeCsvExportConfirmComponent;
|
|
3588
3505
|
}());
|
|
3589
3506
|
NodeCsvExportConfirmComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: NodeCsvExportConfirmComponent, deps: [{ token: i1__namespace$3.DomSanitizer }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
3590
|
-
NodeCsvExportConfirmComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: NodeCsvExportConfirmComponent, selector: "he-node-csv-export-confirm", inputs: { nodes: "nodes", filename: "filename", headerKeys: "headerKeys", extension: "extension", isUpload: "isUpload" }, outputs: { closed: "closed" }, ngImport: i0__namespace, template: "<div class=\"modal is-active\">\n <div class=\"modal-background\"></div>\n <div class=\"modal-card\">\n <header class=\"modal-card-head\">\n <p class=\"modal-card-title\">Export as CSV</p>\n <button class=\"delete\" aria-label=\"close\" (click)=\"closed.next(true)\"></button>\n </header>\n <section class=\"modal-card-body\">\n <div class=\"notification is-info\" role=\"alert\" *ngIf=\"isUpload\">\n <span
|
|
3507
|
+
NodeCsvExportConfirmComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: NodeCsvExportConfirmComponent, selector: "he-node-csv-export-confirm", inputs: { nodes: "nodes", filename: "filename", headerKeys: "headerKeys", extension: "extension", isUpload: "isUpload" }, outputs: { closed: "closed" }, ngImport: i0__namespace, template: "<div class=\"modal is-active\">\n <div class=\"modal-background\"></div>\n <div class=\"modal-card\">\n <header class=\"modal-card-head\">\n <p class=\"modal-card-title\">Export as CSV</p>\n <button class=\"delete\" aria-label=\"close\" (click)=\"closed.next(true)\"></button>\n </header>\n <section class=\"modal-card-body\">\n <div class=\"notification is-info\" role=\"alert\" *ngIf=\"isUpload\">\n <span>After Download, you can edit and</span>\n <a class=\"px-1\" routerLink=\"../\">upload the CSV file</a>\n <span>to submit your content on the Hestia platform, and your draft will remain unchanged.</span>\n\n <p>\n <span>Alternatively, you can import the CSV file right back by clicking on the \"Import from CSV\" button and selecting the exported file.</span>\n </p>\n </div>\n\n <ng-container *ngIf=\"!isUpload && includedNodes.length > 1\">\n <p class=\"mb-2\">\n <b>{{includedNodes.length}}</b>\n <span class=\"px-1\">Nodes will be included in your download.</span>\n <a (click)=\"showIncludeNodes = !showIncludeNodes\">\n <ng-container *ngIf=\"!showIncludeNodes\">Show list</ng-container>\n <ng-container *ngIf=\"showIncludeNodes\">Hide list</ng-container>\n </a>\n </p>\n\n <div class=\"table-container\" *ngIf=\"showIncludeNodes\">\n <table class=\"table is-fullwidth is-hoverable mb-0\">\n <thead class=\"has-background-black\">\n <tr>\n <th>\n <span class=\"has-text-white\">@type</span>\n </th>\n <th>\n <span class=\"has-text-white\">@id</span>\n </th>\n <th>\n <span class=\"has-text-white\">Name</span>\n </th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let node of includedNodes\">\n <td>\n <span *bindOnce=\"node\">{{node.node['@type']}}</span>\n </td>\n <td>\n <span *bindOnce=\"node\">{{node.node['@id']}}</span>\n </td>\n <td>\n <span *bindOnce=\"node\">{{node.node.name}}</span>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n </ng-container>\n\n <he-node-csv-select-headers [class.is-hidden]=\"isUpload\"\n [csv]=\"csvData\" [keys]=\"headerKeys\" [includeDefaultCSV]=\"isUpload\"\n (headersChanged)=\"headersUpdated($event)\"\n ></he-node-csv-select-headers>\n </section>\n <footer class=\"modal-card-foot\">\n <a class=\"button is-success\" target=\"_blank\"\n [attr.disabled]=\"csvContent ? null : true\"\n [href]=\"csvContent\"\n [attr.download]=\"csvContent ? downloadFilename : null\"\n (click)=\"closed.next(true)\"\n >\n <fa-icon class=\"mr-2\" icon=\"download\"></fa-icon>\n <span>Download CSV</span>\n </a>\n <button class=\"button\" (click)=\"closed.next(true)\">\n <span>Cancel</span>\n </button>\n </footer>\n </div>\n</div>\n", styles: [""], components: [{ type: NodeCsvSelectHeadersComponent, selector: "he-node-csv-select-headers", inputs: ["csv", "keys", "includeDefaultCSV"], outputs: ["headersChanged"] }, { 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"] }], directives: [{ type: i3__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4__namespace.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["routerLink", "target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo"] }, { type: i3__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: BindOnceDirective, selector: "[bindOnce]", inputs: ["bindOnce"] }] });
|
|
3591
3508
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: NodeCsvExportConfirmComponent, decorators: [{
|
|
3592
3509
|
type: i0.Component,
|
|
3593
3510
|
args: [{
|
|
@@ -6532,7 +6449,7 @@
|
|
|
6532
6449
|
return FilesFormComponent;
|
|
6533
6450
|
}());
|
|
6534
6451
|
FilesFormComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FilesFormComponent, deps: [{ token: i0__namespace.ElementRef }, { token: HeSearchService }, { token: HeUsersService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
6535
|
-
FilesFormComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FilesFormComponent, selector: "he-files-form", inputs: { schemas: "schemas", errors: "errors", node: "node", nodeMap: "nodeMap", editable: "editable", errorMode: "errorMode", deepEditable: "deepEditable", errorsEditable: "errorsEditable" }, outputs: { nodeChange: "nodeChange", nodeErorrResolved: "nodeErorrResolved", nodeErrorAdded: "nodeErrorAdded" }, ngImport: i0__namespace, template: "<div class=\"card\">\n <div class=\"card-toggle p-4\" (click)=\"isOpen = !isOpen\" pointer>\n <fa-icon icon=\"angle-down\" [class.is-hidden]=\"!isOpen\"></fa-icon>\n <fa-icon icon=\"angle-right\" [class.is-hidden]=\"isOpen\"></fa-icon>\n <span *ngIf=\"nodeProperty\" class=\"is-px-2\"\n [class.has-text-danger]=\"nodeProperty.hasError\"\n [class.has-text-warning]=\"nodeProperty.hasWarning\"\n >\n <he-node-icon [type]=\"nodeProperty.schemaType\"></he-node-icon>\n </span>\n </div>\n\n <ng-container *ngIf=\"editable && isOpen && nodeProperty\">\n <ng-container *ngTemplateOutlet=\"showNewProperty; context: {$implicit: nodeProperty}\"></ng-container>\n </ng-container>\n\n <div class=\"card-content\">\n <ng-container *ngIf=\"isOpen\">\n <div class=\"pb-3 mb-2\" *ngIf=\"errorsEditable\">\n <ng-container *ngTemplateOutlet=\"nodeErrorForm; context: {$implicit: nodeProperty}\"></ng-container>\n </div>\n\n <div class=\"mb-4\" *ngIf=\"nodeProperty?.error\">\n <ng-container *ngTemplateOutlet=\"propertyError; context: {property: nodeProperty, edit: true}\"></ng-container>\n </div>\n </ng-container>\n\n <div class=\"columns is-multiline\">\n <ng-container *ngFor=\"let property of properties; trackBy: trackByProperty\">\n <ng-container *ngTemplateOutlet=\"showProperty; context: {$implicit: property}\"></ng-container>\n </ng-container>\n </div>\n\n <ng-container *ngIf=\"isOpen\">\n <ng-container *ngTemplateOutlet=\"propertyMap; context: {$implicit: nodeProperty}\"></ng-container>\n </ng-container>\n </div>\n</div>\n\n<he-maps-drawing-confirm *ngIf=\"!!mapDrawingProperty\"\n [value]=\"mapDrawingProperty.value\" [modes]=\"mapDrawingModes(mapDrawingProperty)\"\n (closed)=\"onMapDrawingClosed($event)\"\n></he-maps-drawing-confirm>\n\n<he-bibliographies-search-confirm *ngIf=\"!!bibliographiesSearchProperty\"\n [search]=\"bibliographiesSearchProperty.value\"\n [searchBy]=\"bibliographiesSearchKey(bibliographiesSearchProperty)\"\n [searchSources]=\"bibliographiesSearchSources\"\n (closed)=\"onBibliographiesSearchClosed($event)\"\n></he-bibliographies-search-confirm>\n\n<ng-template #labelDescription let-property>\n <span\n class=\"trigger-popover\"\n [ngbPopover]=\"property.schema?.description\" [autoClose]=\"'outside'\"\n triggers=\"hover\" placement=\"right\" container=\"body\"\n >\n <span>{{property.key}}</span>\n </span>\n</ng-template>\n\n<ng-template #labelDefault let-property>\n <span>{{property.key}}</span>\n</ng-template>\n\n<ng-template #showProperty let-property>\n <ng-container *ngIf=\"(isOpen || property.closedVisible) && !property.isHidden\">\n <div class=\"column is-6\"\n [id]=\"property.fullKey + '_' + property.id\"\n [class.is-12]=\"property.properties.length || !property.key\"\n [ngSwitch]=\"!!property.properties.length\"\n >\n <div class=\"columns is-multiline is-variable is-1\" *ngSwitchCase=\"false\">\n <div class=\"column is-3 py-1\" *ngIf=\"property.key\">\n <label class=\"label has-text-right-tablet has-text-ellipsis\"\n *bindOnce=\"property\"\n [for]=\"property.id\"\n >\n <ng-container\n *ngTemplateOutlet=\"property.schema?.description && editable && property.editable ? labelDescription : labelDefault; context: {$implicit: property}\">\n </ng-container>\n </label>\n </div>\n\n <div class=\"column is-9 py-1\" [class.is-12]=\"!property.key\">\n <div class=\"field\">\n <ng-container *ngTemplateOutlet=\"inputForm; context: {$implicit: property}\"></ng-container>\n\n <ng-container *ngIf=\"(editable || errorsEditable) && (property.hasError || property.hasWarning)\">\n <ng-container *ngTemplateOutlet=\"propertyError; context: {property: property, edit: false}\"></ng-container>\n </ng-container>\n </div>\n </div>\n </div>\n\n <div class=\"panel\" *ngSwitchCase=\"true\"\n [class.is-link]=\"errorMode && property.changed\"\n [class.is-danger]=\"!property.changed && property.hasError\"\n [class.is-warning]=\"!property.changed && property.hasWarning\"\n [class.is-default]=\"!property.changed && !property.hasError && !property.hasWarning\"\n >\n <div class=\"open-group panel-heading py-0\"\n (click)=\"property.isOpen = !property.isOpen\" pointer\n [class.is-open]=\"property.isOpen\"\n [class.has-text-white]=\"(errorMode && property.changed) || property.hasError || property.hasWarning\"\n >\n <div class=\"columns is-mobile is-vcentered\">\n <span class=\"column is-narrow py-1 my-0\">\n <fa-icon icon=\"angle-down\" [class.is-hidden]=\"!property.isOpen\"></fa-icon>\n <fa-icon icon=\"angle-right\" [class.is-hidden]=\"property.isOpen\"></fa-icon>\n </span>\n <span class=\"column py-1 my-0\">\n <span class=\"is-size-6\">{{property.key}}</span>\n </span>\n <span *ngIf=\"property.schemaType\" class=\"column is-narrow py-1 my-0\">\n <span class=\"tags mb-0 has-addons\">\n <span class=\"tag mb-0 is-light\">Type</span>\n <span class=\"tag mb-0 is-white\">\n <he-schema-version-link linkClass=\"is-small\" [node]=\"{'@type': property.schemaType}\">\n <span>{{property.schemaType}}</span>\n </he-schema-version-link>\n </span>\n </span>\n </span>\n <he-popover-confirm class=\"column is-narrow py-1 my-0 px-0\"\n *ngIf=\"editable && !errorsEditable\"\n ngbTooltip=\"Remove group\" placement=\"top\"\n [message]=\"'<p>This will remove the group completely.</p>' + (property.isRequired ? '<p><u>Warning: this field is required.</u></p>' : '') + '<p>Do you confirm?</p>'\"\n popoverClass=\"px-3\"\n (confirmed)=\"propertyChanged(null, property)\"\n >\n <fa-icon icon=\"times\" size=\"sm\"></fa-icon>\n </he-popover-confirm>\n </div>\n </div>\n <div class=\"panel-block is-block p-0\" *ngIf=\"property.isOpen\">\n <ng-container [ngSwitch]=\"property.isArray\">\n <div class=\"px-3 pt-4\" *ngIf=\"property.error\">\n <ng-container *ngTemplateOutlet=\"propertyError; context: {property: property, edit: true}\"></ng-container>\n </div>\n\n <div class=\"mt-3\" *ngSwitchCase=\"false\">\n <p class=\"help py-1 px-2\" *ngIf=\"editable && !property.editable\">\n To change the {{property.key}}, please delete it first, then add the field again\n </p>\n <ng-container *ngIf=\"editable && property.editable\">\n <ng-container [ngSwitch]=\"property.schema?.title\">\n <p class=\"help py-1 px-2\" *ngSwitchCase=\"'Bibliography'\">\n Search by Title or Document DOI to auto-populate the fields using the Mendeley catalogue\n </p>\n </ng-container>\n </ng-container>\n\n <ng-container *ngTemplateOutlet=\"showNewProperty; context: {$implicit: property}\"></ng-container>\n\n <div class=\"px-3 mt-1\" *ngIf=\"errorsEditable\">\n <ng-container *ngTemplateOutlet=\"nodeErrorForm; context: {$implicit: property}\"></ng-container>\n </div>\n\n <div class=\"property-group py-2 px-3 mt-2\">\n <div class=\"columns is-multiline mb-0\">\n <ng-container *ngFor=\"let prop2 of property.properties; trackBy: trackByProperty\">\n <ng-container *ngTemplateOutlet=\"showProperty; context: {$implicit: prop2}\"></ng-container>\n </ng-container>\n </div>\n </div>\n </div>\n\n <div class=\"py-2 px-3 mt-2\" *ngSwitchCase=\"true\">\n <div class=\"mt-1\" *ngIf=\"errorsEditable\">\n <ng-container *ngTemplateOutlet=\"nodeErrorForm; context: {$implicit: property}\"></ng-container>\n </div>\n\n <ng-container *ngFor=\"let prop2 of property.properties; trackBy: trackByProperty\">\n <div class=\"card p-0 my-4\" *ngIf=\"prop2.key\"\n [id]=\"prop2.fullKey + '_' + prop2.id\"\n >\n <div class=\"property-array-number\">\n <div class=\"tags has-addons\">\n <span class=\"tag is-dark\">{{prop2.key}}</span>\n <ng-container *ngIf=\"editable && !errorsEditable && property.editable\">\n <span class=\"tag is-info\" pointer\n (click)=\"duplicateArrayGroup(property, prop2)\"\n [ngbTooltip]=\"'Duplicate ' + pluralize(property.key, 1)\" placement=\"top\"\n >\n <fa-icon icon=\"clone\" size=\"sm\"></fa-icon>\n </span>\n <span class=\"tag is-light\" pointer\n *ngIf=\"prop2.key !== '0'\"\n (click)=\"moveArrayGroupUp(property, prop2)\"\n ngbTooltip=\"Move Up\" placement=\"top\"\n >\n <fa-icon icon=\"long-arrow-alt-up\" size=\"sm\"></fa-icon>\n </span>\n <span class=\"tag is-light\" pointer\n *ngIf=\"prop2.key !== property.properties.length - 1\"\n (click)=\"moveArrayGroupDown(property, prop2)\"\n ngbTooltip=\"Move Down\" placement=\"top\"\n >\n <fa-icon icon=\"long-arrow-alt-down\" size=\"sm\"></fa-icon>\n </span>\n <he-popover-confirm class=\"tag is-delete\"\n [ngbTooltip]=\"'Remove ' + pluralize(property.key, 1)\" placement=\"top\"\n message=\"This will remove the group completely. Do you confirm?\" position=\"right\"\n (confirmed)=\"removeArrayGroup(property, prop2)\"\n ></he-popover-confirm>\n </ng-container>\n </div>\n </div>\n\n <ng-container *ngTemplateOutlet=\"showNewProperty; context: {$implicit: prop2}\"></ng-container>\n\n <div class=\"px-4 mt-2\" *ngIf=\"errorsEditable\">\n <ng-container *ngTemplateOutlet=\"nodeErrorForm; context: {$implicit: prop2}\"></ng-container>\n </div>\n\n <div class=\"px-4 mt-2\" *ngIf=\"prop2.error\">\n <ng-container *ngTemplateOutlet=\"propertyError; context: {property: prop2, edit: true}\"></ng-container>\n </div>\n\n <div class=\"property-group card-content p-3\">\n <div class=\"columns is-multiline my-0\">\n <ng-container *ngFor=\"let prop3 of prop2.properties; trackBy: trackByProperty\">\n <ng-container *ngTemplateOutlet=\"showProperty; context: {$implicit: prop3}\"></ng-container>\n </ng-container>\n </div>\n </div>\n </div>\n </ng-container>\n\n <button class=\"button is-dark is-outlined is-small\" type=\"button\"\n *ngIf=\"editable && !errorsEditable\"\n (click)=\"addArrayGroup(property)\"\n >\n <fa-icon icon=\"plus-circle\"></fa-icon>\n <span class=\"pl-2\" i18n=\"@@add\">Add</span>\n <span class=\"pl-1\">{{property.key | pluralize:1}}</span>\n </button>\n </div>\n </ng-container>\n </div>\n </div>\n </div>\n </ng-container>\n</ng-template>\n\n<ng-template #inputForm let-property>\n <ng-container *ngIf=\"property.key\">\n <ng-container [ngSwitch]=\"property.suggestions?.type\">\n <ng-container *ngSwitchCase=\"'select'\">\n <ng-container *ngTemplateOutlet=\"inputSelect; context: {$implicit: property}\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <ng-container *ngTemplateOutlet=\"inputInput; context: {$implicit: property}\"></ng-container>\n </ng-container>\n </ng-container>\n </ng-container>\n</ng-template>\n\n<ng-template #inputInput let-property>\n <div class=\"field mb-0\" [class.has-addons]=\"hasAddons(property)\">\n <div class=\"control is-expanded\"\n [class.has-icons-right]=\"property.loading\"\n >\n <input class=\"input is-small search-input\"\n [class.is-dark]=\"property.key === 'type'\"\n [class.is-link]=\"errorMode && property.changed\"\n [class.is-danger]=\"(!property.changed && property.hasError) || isRequired(property)\"\n [class.is-warning]=\"!property.changed && property.hasWarning\"\n\n [(ngModel)]=\"property.value\" #propertyModel=\"ngModel\"\n [type]=\"property.schema?.type === 'number' ? 'number' : 'string'\"\n [id]=\"property.id\"\n name=\"randomname\"\n [readonly]=\"!editable || !property.editable || property.schema?.internal\"\n [placeholder]=\"property.placeholder\"\n [appTagsInput]=\"{enabled: editable && property.editable && property.schema?.type === 'array', items: property.schema?.items, delimiter: ';', allowDuplicates: true, placeholder: property.placeholder}\"\n (change)=\"propertyChanged($event.target.value, property)\"\n\n [pattern]=\"property.schema?.pattern\"\n [required]=\"property.fullKey.endsWith('id') && property.fullKey !== 'id'\"\n [min]=\"property.schema?.minimum\"\n [max]=\"property.schema?.maximum\"\n\n [ngbTypeahead]=\"propertySuggest(property.fullKey, property.suggestions?.type)\"\n [resultTemplate]=\"suggestion\"\n [inputFormatter]=\"formatter\"\n [focusFirst]=\"true\"\n (focus)=\"editable && property.editable && typeaheadFocus($event)\"\n (selectItem)=\"suggestionSelected($event.item, property)\"\n >\n\n <span class=\"icon is-small is-right has-text-grey-dark\" [class.is-hidden]=\"!property.loading\">\n <fa-icon icon=\"spinner\" [pulse]=\"true\" size=\"sm\"></fa-icon>\n </span>\n </div>\n <ng-container *ngTemplateOutlet=\"inputAddons; context: {$implicit: property}\"></ng-container>\n </div>\n <p class=\"help is-danger-light\"\n *ngIf=\"!property.hasError && propertyModel.invalid\"\n >\n <span *bindOnce=\"propertyModel.errors\" [innerHTML]=\"formatPropertyError(propertyModel.errors, property)\"></span>\n </p>\n</ng-template>\n\n<ng-template #inputSelect let-property>\n <div class=\"field mb-0\" [class.has-addons]=\"hasAddons(property)\">\n <div class=\"control is-expanded\">\n <div class=\"select is-small is-fullwidth\"\n [class.is-link]=\"errorMode && property.changed\"\n [class.is-danger]=\"(!property.changed && property.hasError) || isRequired(property)\"\n [class.is-warning]=\"!property.changed && property.hasWarning\"\n >\n <select\n [(ngModel)]=\"property.value\" #propertyModel=\"ngModel\"\n [id]=\"property.id\"\n name=\"randomname\"\n [disabled]=\"!editable || !property.editable || property.schema?.internal\"\n (change)=\"propertyChanged($event.target.value, property)\"\n >\n <option value=\"\">Select</option>\n <ng-container *bindOnce=\"property.suggestions\">\n <option *ngFor=\"let value of property.suggestions.values; trackBy: trackByIndex\" [value]=\"value\">{{value}}</option>\n </ng-container>\n </select>\n </div>\n </div>\n <ng-container *ngTemplateOutlet=\"inputAddons; context: {$implicit: property}\"></ng-container>\n </div>\n</ng-template>\n\n<ng-template #removeFieldAddon let-property>\n <div class=\"control\" *ngIf=\"!errorsEditable && !property.isRequired\">\n <a class=\"button is-small\" title=\"Remove field\"\n [class.is-outlined]=\"!property.changed && (property.hasError || property.hasWarning)\"\n [class.is-danger]=\"!property.changed && property.hasError\"\n [class.is-warning]=\"!property.changed && property.hasWarning\"\n (click)=\"$event.stopPropagation(); propertyChanged(null, property)\"\n >\n <fa-icon icon=\"times\"></fa-icon>\n </a>\n </div>\n</ng-template>\n\n<ng-template #inputAddons let-property>\n <he-popover-confirm class=\"control\"\n *ngIf=\"enableAddError(property)\"\n position=\"left\"\n [content]=\"popupErrorForm\"\n (confirmed)=\"addError(property, $event)\"\n >\n <span class=\"button is-small\">\n <fa-icon icon=\"comments\"></fa-icon>\n </span>\n </he-popover-confirm>\n\n <ng-container *ngIf=\"editable && property.editable\">\n <ng-container [ngSwitch]=\"property.schemaType\">\n <ng-container *ngSwitchCase=\"SchemaType.Actor\">\n <ng-container *ngTemplateOutlet=\"actorAddons; context: {$implicit: property}\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"SchemaType.Cycle\">\n <ng-container *ngTemplateOutlet=\"cycleAddons; context: {$implicit: property}\"></ng-container>\n </ng-container>\n </ng-container>\n <ng-container *bindOnce=\"property\">\n <div class=\"control\" *ngIf=\"mapDrawingModes(property).length\">\n <button class=\"button is-small\" title=\"Pick on Map\"\n (click)=\"mapDrawingProperty = property\"\n >\n <fa-icon icon=\"map-marked-alt\"></fa-icon>\n </button>\n </div>\n <div class=\"control\" *ngIf=\"bibliographiesSearchKey(property)\">\n <button class=\"button is-small\" title=\"Advanced Search\"\n (click)=\"bibliographiesSearchProperty = property\"\n >\n <fa-icon icon=\"search\"></fa-icon>\n </button>\n </div>\n </ng-container>\n\n <ng-container *ngTemplateOutlet=\"removeFieldAddon; context: {$implicit: property}\"></ng-container>\n </ng-container>\n <div class=\"control\" *ngIf=\"addPropertyEnabled(property)\">\n <a class=\"button is-small is-danger\" title=\"Add field\"\n (click)=\"$event.stopPropagation(); addMissingProperty(property)\"\n >\n <fa-icon icon=\"plus-circle\"></fa-icon>\n <span class=\"pl-2\" i18n=\"@@add\">Add</span>\n </a>\n </div>\n <div class=\"control\" *ngIf=\"isRequired(property)\">\n <label class=\"button is-small is-danger\" [for]=\"property.id\"\n ngbTooltip=\"This field is required\" placement=\"top\"\n >\n <fa-icon icon=\"exclamation-triangle\"></fa-icon>\n </label>\n </div>\n <ng-container *ngIf=\"property.externalUrl?.url\">\n <div class=\"control\">\n <a class=\"button is-small\"\n [href]=\"property.externalUrl.url + (property.externalUrl.urlParamValue ? property.value : '')\"\n target=\"_blank\"\n [title]=\"property.externalUrl.title\"\n [ngClass]=\"{'is-dark is-outlined': property.key === 'type'}\"\n [attr.disabled]=\"property.externalUrl.urlParamValue && !property.value ? true : null\"\n >\n <fa-icon [icon]=\"property.externalUrl.icon || 'external-link-alt'\"></fa-icon>\n </a>\n </div>\n </ng-container>\n <ng-container *ngIf=\"unitConverterEnabled(property)\">\n <div class=\"control\">\n <button class=\"button is-small\" title=\"Open calculator\"\n [ngbPopover]=\"convertUnits\" autoClose=\"outside\"\n triggers=\"manual\" #p=\"ngbPopover\" placement=\"bottom\" container=\"body\"\n (click)=\"openUnitConverter(p, property)\"\n >\n <fa-icon icon=\"calculator\"></fa-icon>\n </button>\n </div>\n </ng-container>\n</ng-template>\n\n<ng-template #actorAddons let-property>\n <div class=\"control\" *ngIf=\"property.key === '@id'\">\n <button class=\"button is-small\" title=\"Add myself as Actor\"\n (click)=\"setUserActorId(property)\"\n >\n <fa-icon [icon]=\"['far', 'id-badge']\"></fa-icon>\n </button>\n </div>\n</ng-template>\n\n<ng-template #cycleAddons let-property>\n <div class=\"control\" *ngIf=\"property.key === 'cycleDuration'\">\n <button class=\"button is-small\" title=\"Calculate value from startDate and endDate\"\n (click)=\"calculateCycleDuration(property)\"\n [disabled]=\"!calculateCycleDurationEnabled(property)\"\n >\n <fa-icon icon=\"calculator\"></fa-icon>\n </button>\n </div>\n <div class=\"control\" *ngIf=\"property.key === 'startDate'\">\n <button class=\"button is-small\" title=\"Calculate value from endDate and cycleDuration\"\n (click)=\"calculateCycleStartDate(property)\"\n [disabled]=\"!calculateCycleStartDateEnabled(property)\"\n >\n <fa-icon icon=\"calculator\"></fa-icon>\n </button>\n </div>\n</ng-template>\n\n<ng-template #showNewProperty let-property>\n <header class=\"card-header\" *ngIf=\"editable && property.editable && (property.addPropertyEnabled || deepEditable); else padder\">\n <form class=\"py-3 px-4 is-flex-grow-1\" (submit)=\"addProperty(property)\" novalidate>\n <div class=\"field is-horizontal\">\n <div class=\"field-label is-small\">\n <label class=\"label\" [for]=\"property.id + '_new'\">\n <span i18n=\"@@files.form.newProperty\">Add new field</span>\n </label>\n </div>\n <div class=\"field-body\">\n <div class=\"field has-addons\">\n <div class=\"control is-expanded\">\n <input class=\"input is-small\"\n [(ngModel)]=\"property.newProperty\"\n [id]=\"property.id + '_new'\"\n name=\"randomname\"\n placeholder=\"Search and select field from results\"\n\n [ngbTypeahead]=\"suggestNewProperty(property.fullKey)\"\n [resultTemplate]=\"suggestion\"\n [inputFormatter]=\"formatter\"\n [focusFirst]=\"false\"\n [editable]=\"false\"\n (focus)=\"typeaheadFocus($event)\"\n >\n </div>\n <div class=\"control\">\n <button class=\"button is-small\" type=\"submit\"\n [disabled]=\"!property.newProperty || !property.newProperty.name\"\n >\n <fa-icon icon=\"plus\"></fa-icon>\n <span class=\"pl-2\" i18n=\"@@add\">Add</span>\n </button>\n </div>\n </div>\n </div>\n </div>\n </form>\n </header>\n</ng-template>\n\n<ng-template #propertyError let-property=\"property\" let-edit=\"edit\">\n <p class=\"help\"\n [class.is-danger]=\"property.hasError\"\n [class.is-warning]=\"property.hasWarning\"\n *ngIf=\"property.error\"\n >\n <span class=\"is-pre-wrap\" *bindOnce=\"property.error\" [innerHTML]=\"property.error.message\"></span>\n <a class=\"pl-2\"\n *ngIf=\"edit && errorsEditable && property.error.index >= 0\"\n (click)=\"editError(property)\"\n >\n <fa-icon class=\"pr-2\" icon=\"edit\"></fa-icon>\n <span i18n=\"@@edit\">Edit</span>\n </a>\n <a class=\"pl-2\"\n *ngIf=\"(property.hasWarning || errorsEditable) && property.error.index >= 0\"\n (click)=\"resolveError(property)\"\n >\n <fa-icon class=\"pr-2\" icon=\"check\"></fa-icon>\n <span i18n=\"@@resolved\">Resolved</span>\n </a>\n </p>\n</ng-template>\n\n<ng-template #propertyMap let-property>\n <div class=\"panel is-default\" *ngIf=\"showMap\">\n <div class=\"open-group panel-heading py-0\"\n (click)=\"mapVisible = !mapVisible\" pointer\n [class.is-open]=\"mapVisible\"\n >\n <div class=\"columns is-mobile is-vcentered mb-0\">\n <span class=\"column is-narrow py-1 my-0\">\n <fa-icon icon=\"angle-down\" [class.is-hidden]=\"!mapVisible\"></fa-icon>\n <fa-icon icon=\"angle-right\" [class.is-hidden]=\"mapVisible\"></fa-icon>\n </span>\n <span class=\"column py-1 my-0\">\n <span class=\"is-size-6\">View on Map</span>\n </span>\n </div>\n </div>\n <div class=\"panel-block is-block p-0\" [class.is-hidden]=\"!mapVisible\">\n <he-sites-maps [sites]=\"[node]\" [showNotice]=\"false\"></he-sites-maps>\n </div>\n </div>\n</ng-template>\n\n<ng-template #nodeErrorForm let-property>\n <ng-container *ngIf=\"property.newError && property.editable\">\n <div class=\"field has-addons\">\n <div class=\"control\">\n <div class=\"select is-small\">\n <select [(ngModel)]=\"property.newError.level\">\n <option [value]=\"undefined\">Select Level</option>\n <option value=\"error\">Error</option>\n <option value=\"warning\">Warning</option>\n </select>\n </div>\n </div>\n <div class=\"control is-expanded\">\n <textarea class=\"textarea is-small\"\n [(ngModel)]=\"property.newError.message\"\n placeholder=\"Enter your message here\"\n rows=\"1\"\n ></textarea>\n </div>\n <div class=\"control\">\n <button class=\"button is-small\"\n [disabled]=\"!property.newError.level || !property.newError.message\"\n (click)=\"addError(property, property.newError)\"\n >\n <fa-icon icon=\"plus-circle\"></fa-icon>\n <span class=\"pl-2\" i18n=\"@@add\">Add</span>\n </button>\n </div>\n </div>\n </ng-container>\n</ng-template>\n\n<ng-template #popupErrorForm let-data=\"data\">\n <div class=\"field has-addons\">\n <div class=\"control\">\n <div class=\"select\">\n <select [(ngModel)]=\"data.level\">\n <option [value]=\"undefined\">Select Level</option>\n <option value=\"error\">Error</option>\n <option value=\"warning\">Warning</option>\n </select>\n </div>\n </div>\n <div class=\"control\">\n <input class=\"input\"\n [(ngModel)]=\"data.message\"\n placeholder=\"Enter your message here\"\n >\n </div>\n </div>\n</ng-template>\n\n<ng-template #suggestion let-r=\"result\" let-t=\"term\">\n <ngb-highlight\n [title]=\"r.bibliography?.title || r.bibliography?.documentDOI || r.bibliography?.scopus || r.name\"\n [result]=\"r.bibliography?.title || r.bibliography?.documentDOI || r.bibliography?.scopus || r.name\"\n [term]=\"t\"\n ></ngb-highlight>\n</ng-template>\n\n<ng-template #padder>\n <div class=\"pt-1\"></div>\n</ng-template>\n\n<ng-template #convertUnits let-value=\"value\" let-term=\"term\" let-units=\"units\">\n <he-unit-converter [value]=\"value\" [term]=\"term\" [toUnits]=\"units\"></he-unit-converter>\n</ng-template>\n", styles: [".panel.is-default .panel-heading{background-color:#ededed;color:#363636}.card-toggle{left:0;position:absolute;top:0}@media screen and (max-width: 768px){.card-toggle{position:relative}}.card-toggle>fa-icon{display:inline-block;width:10px}.card{overflow:visible}.card .card{box-shadow:2px 2px #36363652,0 0 0 1px #36363652}.card .card>.card-header{box-shadow:0 2px 1px #36363652}.property-array-number{left:-4px;position:absolute;top:-12px}.property-array-number .tag.is-delete{border:1px solid rgba(54,54,54,.32)}.control>.button{height:100%}.is-danger-light{color:#f5758f}he-sites-maps{height:200px}\n"], components: [{ type: i1__namespace.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }, { type: NodeIconComponent, selector: "he-node-icon", inputs: ["type", "size"] }, { type: MapsDrawingConfirmComponent, selector: "he-maps-drawing-confirm", inputs: ["value", "modes", "center", "zoom"], outputs: ["closed"] }, { type: BibliographiesSearchConfirmComponent, selector: "he-bibliographies-search-confirm", inputs: ["search", "searchSources", "searchBibliographies", "searchBy"], outputs: ["closed"] }, { type: SchemaVersionLinkComponent, selector: "he-schema-version-link", inputs: ["node", "showExternalLink", "linkClass", "text"] }, { type: PopoverConfirmComponent, selector: "he-popover-confirm", inputs: ["message", "content", "position", "popoverClass"], outputs: ["confirmed"] }, { type: SitesMapsComponent, selector: "he-sites-maps", inputs: ["loadPolygons", "sites", "nodes", "center", "zoom", "showNotice"] }, { type: i10__namespace.NgbHighlight, selector: "ngb-highlight", inputs: ["highlightClass", "result", "term"] }, { type: UnitConverterComponent, selector: "he-unit-converter", inputs: ["term", "value", "fromUnits", "toUnits"] }], directives: [{ type: i3__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { 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: i3__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: BindOnceDirective, selector: "[bindOnce]", inputs: ["bindOnce"] }, { type: i10__namespace.NgbTooltip, selector: "[ngbTooltip]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disableTooltip", "tooltipClass", "openDelay", "closeDelay", "ngbTooltip"], outputs: ["shown", "hidden"], exportAs: ["ngbTooltip"] }, { type: i3__namespace.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i1__namespace$4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i10__namespace.NgbTypeahead, selector: "input[ngbTypeahead]", inputs: ["autocomplete", "placement", "container", "editable", "focusFirst", "showHint", "inputFormatter", "ngbTypeahead", "resultFormatter", "resultTemplate"], outputs: ["selectItem"], exportAs: ["ngbTypeahead"] }, { type: i1__namespace$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1__namespace$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: TagsInputDirective, selector: "[appTagsInput]", inputs: ["appTagsInput"] }, { type: i1__namespace$4.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { type: i1__namespace$4.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i1__namespace$4.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i1__namespace$4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1__namespace$4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i3__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1__namespace$4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1__namespace$4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1__namespace$4.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }], pipes: { "pluralize": PluralizePipe } });
|
|
6452
|
+
FilesFormComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FilesFormComponent, selector: "he-files-form", inputs: { schemas: "schemas", errors: "errors", node: "node", nodeMap: "nodeMap", editable: "editable", errorMode: "errorMode", deepEditable: "deepEditable", errorsEditable: "errorsEditable" }, outputs: { nodeChange: "nodeChange", nodeErorrResolved: "nodeErorrResolved", nodeErrorAdded: "nodeErrorAdded" }, ngImport: i0__namespace, template: "<div class=\"card\">\n <div class=\"card-toggle p-4\" (click)=\"isOpen = !isOpen\" pointer>\n <fa-icon icon=\"angle-down\" [class.is-hidden]=\"!isOpen\"></fa-icon>\n <fa-icon icon=\"angle-right\" [class.is-hidden]=\"isOpen\"></fa-icon>\n <span *ngIf=\"nodeProperty\" class=\"is-px-2\"\n [class.has-text-danger]=\"nodeProperty.hasError\"\n [class.has-text-warning]=\"nodeProperty.hasWarning\"\n >\n <he-node-icon [type]=\"nodeProperty.schemaType\"></he-node-icon>\n </span>\n </div>\n\n <ng-container *ngIf=\"editable && isOpen && nodeProperty\">\n <ng-container *ngTemplateOutlet=\"showNewProperty; context: {$implicit: nodeProperty}\"></ng-container>\n </ng-container>\n\n <div class=\"card-content\">\n <ng-container *ngIf=\"isOpen\">\n <div class=\"pb-3 mb-2\" *ngIf=\"errorsEditable\">\n <ng-container *ngTemplateOutlet=\"nodeErrorForm; context: {$implicit: nodeProperty}\"></ng-container>\n </div>\n\n <div class=\"mb-4\" *ngIf=\"nodeProperty?.error\">\n <ng-container *ngTemplateOutlet=\"propertyError; context: {property: nodeProperty, edit: true}\"></ng-container>\n </div>\n </ng-container>\n\n <div class=\"columns is-multiline\">\n <ng-container *ngFor=\"let property of properties; trackBy: trackByProperty\">\n <ng-container *ngTemplateOutlet=\"showProperty; context: {$implicit: property}\"></ng-container>\n </ng-container>\n </div>\n\n <ng-container *ngIf=\"isOpen\">\n <ng-container *ngTemplateOutlet=\"propertyMap; context: {$implicit: nodeProperty}\"></ng-container>\n </ng-container>\n </div>\n</div>\n\n<he-maps-drawing-confirm *ngIf=\"!!mapDrawingProperty\"\n [value]=\"mapDrawingProperty.value\" [modes]=\"mapDrawingModes(mapDrawingProperty)\"\n (closed)=\"onMapDrawingClosed($event)\"\n></he-maps-drawing-confirm>\n\n<he-bibliographies-search-confirm *ngIf=\"!!bibliographiesSearchProperty\"\n [search]=\"bibliographiesSearchProperty.value\"\n [searchBy]=\"bibliographiesSearchKey(bibliographiesSearchProperty)\"\n [searchSources]=\"bibliographiesSearchSources\"\n (closed)=\"onBibliographiesSearchClosed($event)\"\n></he-bibliographies-search-confirm>\n\n<ng-template #labelDescription let-property>\n <span\n class=\"trigger-popover\"\n [ngbPopover]=\"property.schema?.description\" [autoClose]=\"'outside'\"\n triggers=\"hover\" placement=\"right\" container=\"body\"\n >\n <span>{{property.key}}</span>\n </span>\n</ng-template>\n\n<ng-template #labelDefault let-property>\n <span>{{property.key}}</span>\n</ng-template>\n\n<ng-template #showProperty let-property>\n <ng-container *ngIf=\"(isOpen || property.closedVisible) && !property.isHidden\">\n <div class=\"column is-6\"\n [id]=\"property.fullKey + '_' + property.id\"\n [class.is-12]=\"property.properties.length || !property.key\"\n [ngSwitch]=\"!!property.properties.length\"\n >\n <div class=\"columns is-multiline is-variable is-1\" *ngSwitchCase=\"false\">\n <div class=\"column is-3 py-1\" *ngIf=\"property.key\">\n <label class=\"label has-text-right-tablet has-text-ellipsis\"\n *bindOnce=\"property\"\n [for]=\"property.id\"\n >\n <ng-container\n *ngTemplateOutlet=\"property.schema?.description && editable && property.editable ? labelDescription : labelDefault; context: {$implicit: property}\">\n </ng-container>\n </label>\n </div>\n\n <div class=\"column is-9 py-1\" [class.is-12]=\"!property.key\">\n <div class=\"field\">\n <ng-container *ngTemplateOutlet=\"inputForm; context: {$implicit: property}\"></ng-container>\n\n <ng-container *ngIf=\"(editable || errorsEditable) && (property.hasError || property.hasWarning)\">\n <ng-container *ngTemplateOutlet=\"propertyError; context: {property: property, edit: false}\"></ng-container>\n </ng-container>\n </div>\n </div>\n </div>\n\n <div class=\"panel\" *ngSwitchCase=\"true\"\n [class.is-link]=\"errorMode && property.changed\"\n [class.is-danger]=\"!property.changed && property.hasError\"\n [class.is-warning]=\"!property.changed && property.hasWarning\"\n [class.is-default]=\"!property.changed && !property.hasError && !property.hasWarning\"\n >\n <div class=\"open-group panel-heading py-0\"\n (click)=\"property.isOpen = !property.isOpen\" pointer\n [class.is-open]=\"property.isOpen\"\n [class.has-text-white]=\"(errorMode && property.changed) || property.hasError || property.hasWarning\"\n >\n <div class=\"columns is-mobile is-vcentered\">\n <span class=\"column is-narrow py-1 my-0\">\n <fa-icon icon=\"angle-down\" [class.is-hidden]=\"!property.isOpen\"></fa-icon>\n <fa-icon icon=\"angle-right\" [class.is-hidden]=\"property.isOpen\"></fa-icon>\n </span>\n <span class=\"column py-1 my-0\">\n <span class=\"is-size-6\">{{property.key}}</span>\n </span>\n <span *ngIf=\"property.schemaType\" class=\"column is-narrow py-1 my-0\">\n <span class=\"tags mb-0 has-addons\">\n <span class=\"tag mb-0 is-light\">Type</span>\n <span class=\"tag mb-0 is-white\">\n <he-schema-version-link linkClass=\"is-small\" [node]=\"{'@type': property.schemaType}\">\n <span>{{property.schemaType}}</span>\n </he-schema-version-link>\n </span>\n </span>\n </span>\n <he-popover-confirm class=\"column is-narrow py-1 my-0 px-0\"\n *ngIf=\"editable && !errorsEditable\"\n ngbTooltip=\"Remove group\" placement=\"top\"\n [message]=\"'<p>This will remove the group completely.</p>' + (property.isRequired ? '<p><u>Warning: this field is required.</u></p>' : '') + '<p>Do you confirm?</p>'\"\n popoverClass=\"px-3\"\n (confirmed)=\"propertyChanged(null, property)\"\n >\n <fa-icon icon=\"times\" size=\"sm\"></fa-icon>\n </he-popover-confirm>\n </div>\n </div>\n <div class=\"panel-block is-block p-0\" *ngIf=\"property.isOpen\">\n <ng-container [ngSwitch]=\"property.isArray\">\n <div class=\"px-3 pt-4\" *ngIf=\"property.error\">\n <ng-container *ngTemplateOutlet=\"propertyError; context: {property: property, edit: true}\"></ng-container>\n </div>\n\n <div class=\"mt-3\" *ngSwitchCase=\"false\">\n <p class=\"help py-1 px-2\" *ngIf=\"editable && !property.editable\">\n To change the {{property.key}}, please delete it first, then add the field again\n </p>\n <ng-container *ngIf=\"editable && property.editable\">\n <ng-container [ngSwitch]=\"property.schema?.title\">\n <p class=\"help py-1 px-2\" *ngSwitchCase=\"'Bibliography'\">\n Search by Title or Document DOI to auto-populate the fields using the Mendeley catalogue\n </p>\n </ng-container>\n </ng-container>\n\n <ng-container *ngTemplateOutlet=\"showNewProperty; context: {$implicit: property}\"></ng-container>\n\n <div class=\"px-3 mt-1\" *ngIf=\"errorsEditable\">\n <ng-container *ngTemplateOutlet=\"nodeErrorForm; context: {$implicit: property}\"></ng-container>\n </div>\n\n <div class=\"property-group py-2 px-3 mt-2\">\n <div class=\"columns is-multiline mb-0\">\n <ng-container *ngFor=\"let prop2 of property.properties; trackBy: trackByProperty\">\n <ng-container *ngTemplateOutlet=\"showProperty; context: {$implicit: prop2}\"></ng-container>\n </ng-container>\n </div>\n </div>\n </div>\n\n <div class=\"py-2 px-3 mt-2\" *ngSwitchCase=\"true\">\n <div class=\"mt-1\" *ngIf=\"errorsEditable\">\n <ng-container *ngTemplateOutlet=\"nodeErrorForm; context: {$implicit: property}\"></ng-container>\n </div>\n\n <ng-container *ngFor=\"let prop2 of property.properties; trackBy: trackByProperty\">\n <div class=\"card p-0 my-4\" *ngIf=\"prop2.key\"\n [id]=\"prop2.fullKey + '_' + prop2.id\"\n >\n <div class=\"property-array-number\">\n <div class=\"tags has-addons\">\n <span class=\"tag is-dark\">{{prop2.key}}</span>\n <ng-container *ngIf=\"editable && !errorsEditable && property.editable\">\n <span class=\"tag is-info\" pointer\n (click)=\"duplicateArrayGroup(property, prop2)\"\n [ngbTooltip]=\"'Duplicate ' + pluralize(property.key, 1)\" placement=\"top\"\n >\n <fa-icon icon=\"clone\" size=\"sm\"></fa-icon>\n </span>\n <span class=\"tag is-light\" pointer\n *ngIf=\"prop2.key !== '0'\"\n (click)=\"moveArrayGroupUp(property, prop2)\"\n ngbTooltip=\"Move Up\" placement=\"top\"\n >\n <fa-icon icon=\"long-arrow-alt-up\" size=\"sm\"></fa-icon>\n </span>\n <span class=\"tag is-light\" pointer\n *ngIf=\"prop2.key !== property.properties.length - 1\"\n (click)=\"moveArrayGroupDown(property, prop2)\"\n ngbTooltip=\"Move Down\" placement=\"top\"\n >\n <fa-icon icon=\"long-arrow-alt-down\" size=\"sm\"></fa-icon>\n </span>\n <he-popover-confirm class=\"tag is-delete\"\n [ngbTooltip]=\"'Remove ' + pluralize(property.key, 1)\" placement=\"top\"\n message=\"This will remove the group completely. Do you confirm?\" position=\"right\"\n (confirmed)=\"removeArrayGroup(property, prop2)\"\n ></he-popover-confirm>\n </ng-container>\n </div>\n </div>\n\n <ng-container *ngTemplateOutlet=\"showNewProperty; context: {$implicit: prop2}\"></ng-container>\n\n <div class=\"px-4 mt-2\" *ngIf=\"errorsEditable\">\n <ng-container *ngTemplateOutlet=\"nodeErrorForm; context: {$implicit: prop2}\"></ng-container>\n </div>\n\n <div class=\"px-4 mt-2\" *ngIf=\"prop2.error\">\n <ng-container *ngTemplateOutlet=\"propertyError; context: {property: prop2, edit: true}\"></ng-container>\n </div>\n\n <div class=\"property-group card-content p-3\">\n <div class=\"columns is-multiline my-0\">\n <ng-container *ngFor=\"let prop3 of prop2.properties; trackBy: trackByProperty\">\n <ng-container *ngTemplateOutlet=\"showProperty; context: {$implicit: prop3}\"></ng-container>\n </ng-container>\n </div>\n </div>\n </div>\n </ng-container>\n\n <button class=\"button is-dark is-outlined is-small\" type=\"button\"\n *ngIf=\"editable && !errorsEditable\"\n (click)=\"addArrayGroup(property)\"\n >\n <fa-icon icon=\"plus-circle\"></fa-icon>\n <span class=\"pl-2\">Add</span>\n <span class=\"pl-1\">{{property.key | pluralize:1}}</span>\n </button>\n </div>\n </ng-container>\n </div>\n </div>\n </div>\n </ng-container>\n</ng-template>\n\n<ng-template #inputForm let-property>\n <ng-container *ngIf=\"property.key\">\n <ng-container [ngSwitch]=\"property.suggestions?.type\">\n <ng-container *ngSwitchCase=\"'select'\">\n <ng-container *ngTemplateOutlet=\"inputSelect; context: {$implicit: property}\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <ng-container *ngTemplateOutlet=\"inputInput; context: {$implicit: property}\"></ng-container>\n </ng-container>\n </ng-container>\n </ng-container>\n</ng-template>\n\n<ng-template #inputInput let-property>\n <div class=\"field mb-0\" [class.has-addons]=\"hasAddons(property)\">\n <div class=\"control is-expanded\"\n [class.has-icons-right]=\"property.loading\"\n >\n <input class=\"input is-small search-input\"\n [class.is-dark]=\"property.key === 'type'\"\n [class.is-link]=\"errorMode && property.changed\"\n [class.is-danger]=\"(!property.changed && property.hasError) || isRequired(property)\"\n [class.is-warning]=\"!property.changed && property.hasWarning\"\n\n [(ngModel)]=\"property.value\" #propertyModel=\"ngModel\"\n [type]=\"property.schema?.type === 'number' ? 'number' : 'string'\"\n [id]=\"property.id\"\n name=\"randomname\"\n [readonly]=\"!editable || !property.editable || property.schema?.internal\"\n [placeholder]=\"property.placeholder\"\n [appTagsInput]=\"{enabled: editable && property.editable && property.schema?.type === 'array', items: property.schema?.items, delimiter: ';', allowDuplicates: true, placeholder: property.placeholder}\"\n (change)=\"propertyChanged($event.target.value, property)\"\n\n [pattern]=\"property.schema?.pattern\"\n [required]=\"property.fullKey.endsWith('id') && property.fullKey !== 'id'\"\n [min]=\"property.schema?.minimum\"\n [max]=\"property.schema?.maximum\"\n\n [ngbTypeahead]=\"propertySuggest(property.fullKey, property.suggestions?.type)\"\n [resultTemplate]=\"suggestion\"\n [inputFormatter]=\"formatter\"\n [focusFirst]=\"true\"\n (focus)=\"editable && property.editable && typeaheadFocus($event)\"\n (selectItem)=\"suggestionSelected($event.item, property)\"\n >\n\n <span class=\"icon is-small is-right has-text-grey-dark\" [class.is-hidden]=\"!property.loading\">\n <fa-icon icon=\"spinner\" [pulse]=\"true\" size=\"sm\"></fa-icon>\n </span>\n </div>\n <ng-container *ngTemplateOutlet=\"inputAddons; context: {$implicit: property}\"></ng-container>\n </div>\n <p class=\"help is-danger-light\"\n *ngIf=\"!property.hasError && propertyModel.invalid\"\n >\n <span *bindOnce=\"propertyModel.errors\" [innerHTML]=\"formatPropertyError(propertyModel.errors, property)\"></span>\n </p>\n</ng-template>\n\n<ng-template #inputSelect let-property>\n <div class=\"field mb-0\" [class.has-addons]=\"hasAddons(property)\">\n <div class=\"control is-expanded\">\n <div class=\"select is-small is-fullwidth\"\n [class.is-link]=\"errorMode && property.changed\"\n [class.is-danger]=\"(!property.changed && property.hasError) || isRequired(property)\"\n [class.is-warning]=\"!property.changed && property.hasWarning\"\n >\n <select\n [(ngModel)]=\"property.value\" #propertyModel=\"ngModel\"\n [id]=\"property.id\"\n name=\"randomname\"\n [disabled]=\"!editable || !property.editable || property.schema?.internal\"\n (change)=\"propertyChanged($event.target.value, property)\"\n >\n <option value=\"\">Select</option>\n <ng-container *bindOnce=\"property.suggestions\">\n <option *ngFor=\"let value of property.suggestions.values; trackBy: trackByIndex\" [value]=\"value\">{{value}}</option>\n </ng-container>\n </select>\n </div>\n </div>\n <ng-container *ngTemplateOutlet=\"inputAddons; context: {$implicit: property}\"></ng-container>\n </div>\n</ng-template>\n\n<ng-template #removeFieldAddon let-property>\n <div class=\"control\" *ngIf=\"!errorsEditable && !property.isRequired\">\n <a class=\"button is-small\" title=\"Remove field\"\n [class.is-outlined]=\"!property.changed && (property.hasError || property.hasWarning)\"\n [class.is-danger]=\"!property.changed && property.hasError\"\n [class.is-warning]=\"!property.changed && property.hasWarning\"\n (click)=\"$event.stopPropagation(); propertyChanged(null, property)\"\n >\n <fa-icon icon=\"times\"></fa-icon>\n </a>\n </div>\n</ng-template>\n\n<ng-template #inputAddons let-property>\n <he-popover-confirm class=\"control\"\n *ngIf=\"enableAddError(property)\"\n position=\"left\"\n [content]=\"popupErrorForm\"\n (confirmed)=\"addError(property, $event)\"\n >\n <span class=\"button is-small\">\n <fa-icon icon=\"comments\"></fa-icon>\n </span>\n </he-popover-confirm>\n\n <ng-container *ngIf=\"editable && property.editable\">\n <ng-container [ngSwitch]=\"property.schemaType\">\n <ng-container *ngSwitchCase=\"SchemaType.Actor\">\n <ng-container *ngTemplateOutlet=\"actorAddons; context: {$implicit: property}\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"SchemaType.Cycle\">\n <ng-container *ngTemplateOutlet=\"cycleAddons; context: {$implicit: property}\"></ng-container>\n </ng-container>\n </ng-container>\n <ng-container *bindOnce=\"property\">\n <div class=\"control\" *ngIf=\"mapDrawingModes(property).length\">\n <button class=\"button is-small\" title=\"Pick on Map\"\n (click)=\"mapDrawingProperty = property\"\n >\n <fa-icon icon=\"map-marked-alt\"></fa-icon>\n </button>\n </div>\n <div class=\"control\" *ngIf=\"bibliographiesSearchKey(property)\">\n <button class=\"button is-small\" title=\"Advanced Search\"\n (click)=\"bibliographiesSearchProperty = property\"\n >\n <fa-icon icon=\"search\"></fa-icon>\n </button>\n </div>\n </ng-container>\n\n <ng-container *ngTemplateOutlet=\"removeFieldAddon; context: {$implicit: property}\"></ng-container>\n </ng-container>\n <div class=\"control\" *ngIf=\"addPropertyEnabled(property)\">\n <a class=\"button is-small is-danger\" title=\"Add field\"\n (click)=\"$event.stopPropagation(); addMissingProperty(property)\"\n >\n <fa-icon icon=\"plus-circle\"></fa-icon>\n <span class=\"pl-2\">Add</span>\n </a>\n </div>\n <div class=\"control\" *ngIf=\"isRequired(property)\">\n <label class=\"button is-small is-danger\" [for]=\"property.id\"\n ngbTooltip=\"This field is required\" placement=\"top\"\n >\n <fa-icon icon=\"exclamation-triangle\"></fa-icon>\n </label>\n </div>\n <ng-container *ngIf=\"property.externalUrl?.url\">\n <div class=\"control\">\n <a class=\"button is-small\"\n [href]=\"property.externalUrl.url + (property.externalUrl.urlParamValue ? property.value : '')\"\n target=\"_blank\"\n [title]=\"property.externalUrl.title\"\n [ngClass]=\"{'is-dark is-outlined': property.key === 'type'}\"\n [attr.disabled]=\"property.externalUrl.urlParamValue && !property.value ? true : null\"\n >\n <fa-icon [icon]=\"property.externalUrl.icon || 'external-link-alt'\"></fa-icon>\n </a>\n </div>\n </ng-container>\n <ng-container *ngIf=\"unitConverterEnabled(property)\">\n <div class=\"control\">\n <button class=\"button is-small\" title=\"Open calculator\"\n [ngbPopover]=\"convertUnits\" autoClose=\"outside\"\n triggers=\"manual\" #p=\"ngbPopover\" placement=\"bottom\" container=\"body\"\n (click)=\"openUnitConverter(p, property)\"\n >\n <fa-icon icon=\"calculator\"></fa-icon>\n </button>\n </div>\n </ng-container>\n</ng-template>\n\n<ng-template #actorAddons let-property>\n <div class=\"control\" *ngIf=\"property.key === '@id'\">\n <button class=\"button is-small\" title=\"Add myself as Actor\"\n (click)=\"setUserActorId(property)\"\n >\n <fa-icon [icon]=\"['far', 'id-badge']\"></fa-icon>\n </button>\n </div>\n</ng-template>\n\n<ng-template #cycleAddons let-property>\n <div class=\"control\" *ngIf=\"property.key === 'cycleDuration'\">\n <button class=\"button is-small\" title=\"Calculate value from startDate and endDate\"\n (click)=\"calculateCycleDuration(property)\"\n [disabled]=\"!calculateCycleDurationEnabled(property)\"\n >\n <fa-icon icon=\"calculator\"></fa-icon>\n </button>\n </div>\n <div class=\"control\" *ngIf=\"property.key === 'startDate'\">\n <button class=\"button is-small\" title=\"Calculate value from endDate and cycleDuration\"\n (click)=\"calculateCycleStartDate(property)\"\n [disabled]=\"!calculateCycleStartDateEnabled(property)\"\n >\n <fa-icon icon=\"calculator\"></fa-icon>\n </button>\n </div>\n</ng-template>\n\n<ng-template #showNewProperty let-property>\n <header class=\"card-header\" *ngIf=\"editable && property.editable && (property.addPropertyEnabled || deepEditable); else padder\">\n <form class=\"py-3 px-4 is-flex-grow-1\" (submit)=\"addProperty(property)\" novalidate>\n <div class=\"field is-horizontal\">\n <div class=\"field-label is-small\">\n <label class=\"label\" [for]=\"property.id + '_new'\">\n <span>Add new field</span>\n </label>\n </div>\n <div class=\"field-body\">\n <div class=\"field has-addons\">\n <div class=\"control is-expanded\">\n <input class=\"input is-small\"\n [(ngModel)]=\"property.newProperty\"\n [id]=\"property.id + '_new'\"\n name=\"randomname\"\n placeholder=\"Search and select field from results\"\n\n [ngbTypeahead]=\"suggestNewProperty(property.fullKey)\"\n [resultTemplate]=\"suggestion\"\n [inputFormatter]=\"formatter\"\n [focusFirst]=\"false\"\n [editable]=\"false\"\n (focus)=\"typeaheadFocus($event)\"\n >\n </div>\n <div class=\"control\">\n <button class=\"button is-small\" type=\"submit\"\n [disabled]=\"!property.newProperty || !property.newProperty.name\"\n >\n <fa-icon icon=\"plus\"></fa-icon>\n <span class=\"pl-2\">Add</span>\n </button>\n </div>\n </div>\n </div>\n </div>\n </form>\n </header>\n</ng-template>\n\n<ng-template #propertyError let-property=\"property\" let-edit=\"edit\">\n <p class=\"help\"\n [class.is-danger]=\"property.hasError\"\n [class.is-warning]=\"property.hasWarning\"\n *ngIf=\"property.error\"\n >\n <span class=\"is-pre-wrap\" *bindOnce=\"property.error\" [innerHTML]=\"property.error.message\"></span>\n <a class=\"pl-2\"\n *ngIf=\"edit && errorsEditable && property.error.index >= 0\"\n (click)=\"editError(property)\"\n >\n <fa-icon class=\"pr-2\" icon=\"edit\"></fa-icon>\n <span>Edit</span>\n </a>\n <a class=\"pl-2\"\n *ngIf=\"(property.hasWarning || errorsEditable) && property.error.index >= 0\"\n (click)=\"resolveError(property)\"\n >\n <fa-icon class=\"pr-2\" icon=\"check\"></fa-icon>\n <span>Resolved</span>\n </a>\n </p>\n</ng-template>\n\n<ng-template #propertyMap let-property>\n <div class=\"panel is-default\" *ngIf=\"showMap\">\n <div class=\"open-group panel-heading py-0\"\n (click)=\"mapVisible = !mapVisible\" pointer\n [class.is-open]=\"mapVisible\"\n >\n <div class=\"columns is-mobile is-vcentered mb-0\">\n <span class=\"column is-narrow py-1 my-0\">\n <fa-icon icon=\"angle-down\" [class.is-hidden]=\"!mapVisible\"></fa-icon>\n <fa-icon icon=\"angle-right\" [class.is-hidden]=\"mapVisible\"></fa-icon>\n </span>\n <span class=\"column py-1 my-0\">\n <span class=\"is-size-6\">View on Map</span>\n </span>\n </div>\n </div>\n <div class=\"panel-block is-block p-0\" [class.is-hidden]=\"!mapVisible\">\n <he-sites-maps [sites]=\"[node]\" [showNotice]=\"false\"></he-sites-maps>\n </div>\n </div>\n</ng-template>\n\n<ng-template #nodeErrorForm let-property>\n <ng-container *ngIf=\"property.newError && property.editable\">\n <div class=\"field has-addons\">\n <div class=\"control\">\n <div class=\"select is-small\">\n <select [(ngModel)]=\"property.newError.level\">\n <option [value]=\"undefined\">Select Level</option>\n <option value=\"error\">Error</option>\n <option value=\"warning\">Warning</option>\n </select>\n </div>\n </div>\n <div class=\"control is-expanded\">\n <textarea class=\"textarea is-small\"\n [(ngModel)]=\"property.newError.message\"\n placeholder=\"Enter your message here\"\n rows=\"1\"\n ></textarea>\n </div>\n <div class=\"control\">\n <button class=\"button is-small\"\n [disabled]=\"!property.newError.level || !property.newError.message\"\n (click)=\"addError(property, property.newError)\"\n >\n <fa-icon icon=\"plus-circle\"></fa-icon>\n <span class=\"pl-2\">Add</span>\n </button>\n </div>\n </div>\n </ng-container>\n</ng-template>\n\n<ng-template #popupErrorForm let-data=\"data\">\n <div class=\"field has-addons\">\n <div class=\"control\">\n <div class=\"select\">\n <select [(ngModel)]=\"data.level\">\n <option [value]=\"undefined\">Select Level</option>\n <option value=\"error\">Error</option>\n <option value=\"warning\">Warning</option>\n </select>\n </div>\n </div>\n <div class=\"control\">\n <input class=\"input\"\n [(ngModel)]=\"data.message\"\n placeholder=\"Enter your message here\"\n >\n </div>\n </div>\n</ng-template>\n\n<ng-template #suggestion let-r=\"result\" let-t=\"term\">\n <ngb-highlight\n [title]=\"r.bibliography?.title || r.bibliography?.documentDOI || r.bibliography?.scopus || r.name\"\n [result]=\"r.bibliography?.title || r.bibliography?.documentDOI || r.bibliography?.scopus || r.name\"\n [term]=\"t\"\n ></ngb-highlight>\n</ng-template>\n\n<ng-template #padder>\n <div class=\"pt-1\"></div>\n</ng-template>\n\n<ng-template #convertUnits let-value=\"value\" let-term=\"term\" let-units=\"units\">\n <he-unit-converter [value]=\"value\" [term]=\"term\" [toUnits]=\"units\"></he-unit-converter>\n</ng-template>\n", styles: [".panel.is-default .panel-heading{background-color:#ededed;color:#363636}.card-toggle{left:0;position:absolute;top:0}@media screen and (max-width: 768px){.card-toggle{position:relative}}.card-toggle>fa-icon{display:inline-block;width:10px}.card{overflow:visible}.card .card{box-shadow:2px 2px #36363652,0 0 0 1px #36363652}.card .card>.card-header{box-shadow:0 2px 1px #36363652}.property-array-number{left:-4px;position:absolute;top:-12px}.property-array-number .tag.is-delete{border:1px solid rgba(54,54,54,.32)}.control>.button{height:100%}.is-danger-light{color:#f5758f}he-sites-maps{height:200px}\n"], components: [{ type: i1__namespace.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }, { type: NodeIconComponent, selector: "he-node-icon", inputs: ["type", "size"] }, { type: MapsDrawingConfirmComponent, selector: "he-maps-drawing-confirm", inputs: ["value", "modes", "center", "zoom"], outputs: ["closed"] }, { type: BibliographiesSearchConfirmComponent, selector: "he-bibliographies-search-confirm", inputs: ["search", "searchSources", "searchBibliographies", "searchBy"], outputs: ["closed"] }, { type: SchemaVersionLinkComponent, selector: "he-schema-version-link", inputs: ["node", "showExternalLink", "linkClass", "text"] }, { type: PopoverConfirmComponent, selector: "he-popover-confirm", inputs: ["message", "content", "position", "popoverClass"], outputs: ["confirmed"] }, { type: SitesMapsComponent, selector: "he-sites-maps", inputs: ["loadPolygons", "sites", "nodes", "center", "zoom", "showNotice"] }, { type: i10__namespace.NgbHighlight, selector: "ngb-highlight", inputs: ["highlightClass", "result", "term"] }, { type: UnitConverterComponent, selector: "he-unit-converter", inputs: ["term", "value", "fromUnits", "toUnits"] }], directives: [{ type: i3__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { 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: i3__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: BindOnceDirective, selector: "[bindOnce]", inputs: ["bindOnce"] }, { type: i10__namespace.NgbTooltip, selector: "[ngbTooltip]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disableTooltip", "tooltipClass", "openDelay", "closeDelay", "ngbTooltip"], outputs: ["shown", "hidden"], exportAs: ["ngbTooltip"] }, { type: i3__namespace.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i1__namespace$4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i10__namespace.NgbTypeahead, selector: "input[ngbTypeahead]", inputs: ["autocomplete", "placement", "container", "editable", "focusFirst", "showHint", "inputFormatter", "ngbTypeahead", "resultFormatter", "resultTemplate"], outputs: ["selectItem"], exportAs: ["ngbTypeahead"] }, { type: i1__namespace$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1__namespace$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: TagsInputDirective, selector: "[appTagsInput]", inputs: ["appTagsInput"] }, { type: i1__namespace$4.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { type: i1__namespace$4.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i1__namespace$4.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i1__namespace$4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1__namespace$4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i3__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1__namespace$4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1__namespace$4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1__namespace$4.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }], pipes: { "pluralize": PluralizePipe } });
|
|
6536
6453
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FilesFormComponent, decorators: [{
|
|
6537
6454
|
type: i0.Component,
|
|
6538
6455
|
args: [{
|
|
@@ -7283,7 +7200,7 @@
|
|
|
7283
7200
|
};
|
|
7284
7201
|
return ImpactAssessmentsProductsComponent;
|
|
7285
7202
|
}());
|
|
7286
|
-
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 });
|
|
7287
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 } });
|
|
7288
7205
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ImpactAssessmentsProductsComponent, decorators: [{
|
|
7289
7206
|
type: i0.Component,
|
|
@@ -7292,7 +7209,7 @@
|
|
|
7292
7209
|
templateUrl: './impact-assessments-products.component.html',
|
|
7293
7210
|
styleUrls: ['./impact-assessments-products.component.scss']
|
|
7294
7211
|
}]
|
|
7295
|
-
}], 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: [{
|
|
7296
7213
|
type: i0.Input
|
|
7297
7214
|
}], impactAssessments: [{
|
|
7298
7215
|
type: i0.Input
|
|
@@ -7433,6 +7350,7 @@
|
|
|
7433
7350
|
exports.HeSearchModule = HeSearchModule;
|
|
7434
7351
|
exports.HeSearchService = HeSearchService;
|
|
7435
7352
|
exports.HeSitesModule = HeSitesModule;
|
|
7353
|
+
exports.HeToastService = HeToastService;
|
|
7436
7354
|
exports.HeUsersService = HeUsersService;
|
|
7437
7355
|
exports.ImpactAssessmentsIndicatorBreakdownChartComponent = ImpactAssessmentsIndicatorBreakdownChartComponent;
|
|
7438
7356
|
exports.ImpactAssessmentsIndicatorsChartComponent = ImpactAssessmentsIndicatorsChartComponent;
|
|
@@ -7466,33 +7384,39 @@
|
|
|
7466
7384
|
exports.TagsInputDirective = TagsInputDirective;
|
|
7467
7385
|
exports.TimesPipe = TimesPipe;
|
|
7468
7386
|
exports.ToastComponent = ToastComponent;
|
|
7469
|
-
exports.ToastService = ToastService;
|
|
7470
7387
|
exports.UnitConverterComponent = UnitConverterComponent;
|
|
7388
|
+
exports.addPolygonToFeature = addPolygonToFeature;
|
|
7471
7389
|
exports.allCountriesQuery = allCountriesQuery;
|
|
7472
|
-
exports.animateCounter = animateCounter;
|
|
7473
7390
|
exports.arrayValue = arrayValue;
|
|
7474
7391
|
exports.availableProperties = availableProperties;
|
|
7475
7392
|
exports.baseUrl = baseUrl;
|
|
7476
7393
|
exports.bottom = bottom;
|
|
7394
|
+
exports.clustererImage = clustererImage;
|
|
7395
|
+
exports.coordinatesToPoint = coordinatesToPoint;
|
|
7477
7396
|
exports.countriesQuery = countriesQuery;
|
|
7397
|
+
exports.createMarker = createMarker;
|
|
7478
7398
|
exports.cropsQuery = cropsQuery;
|
|
7479
7399
|
exports.dataValue = dataValue;
|
|
7400
|
+
exports.defaultFeature = defaultFeature;
|
|
7480
7401
|
exports.defaultLabel = defaultLabel;
|
|
7481
7402
|
exports.definitionToSchemaType = definitionToSchemaType;
|
|
7482
7403
|
exports.delta = delta;
|
|
7483
7404
|
exports.deserializeSearchFilters = deserializeSearchFilters;
|
|
7484
7405
|
exports.ellipsis = ellipsis;
|
|
7406
|
+
exports.emptyValue = emptyValue;
|
|
7485
7407
|
exports.errorText = errorText;
|
|
7486
7408
|
exports.filenameWithoutExt = filenameWithoutExt;
|
|
7409
|
+
exports.fillColor = fillColor;
|
|
7410
|
+
exports.fillStyle = fillStyle;
|
|
7487
7411
|
exports.filterParams = filterParams;
|
|
7488
7412
|
exports.findPropertyById = findPropertyById;
|
|
7413
|
+
exports.gitBranch = gitBranch;
|
|
7489
7414
|
exports.gitHome = gitHome;
|
|
7490
7415
|
exports.gitRawBaseUrl = gitRawBaseUrl;
|
|
7491
7416
|
exports.groupNodesByTerm = groupNodesByTerm;
|
|
7492
7417
|
exports.grouppedKeys = grouppedKeys;
|
|
7493
7418
|
exports.grouppedValueKeys = grouppedValueKeys;
|
|
7494
7419
|
exports.handleAPIError = handleAPIError;
|
|
7495
|
-
exports.hoursBefore = hoursBefore;
|
|
7496
7420
|
exports.isChrome = isChrome;
|
|
7497
7421
|
exports.isExternal = isExternal;
|
|
7498
7422
|
exports.isSchemaIri = isSchemaIri;
|
|
@@ -7502,8 +7426,11 @@
|
|
|
7502
7426
|
exports.levels = levels;
|
|
7503
7427
|
exports.linkTypeEnabled = linkTypeEnabled;
|
|
7504
7428
|
exports.listColor = listColor;
|
|
7505
|
-
exports.
|
|
7429
|
+
exports.locationQuery = locationQuery;
|
|
7430
|
+
exports.lookupUrl = lookupUrl;
|
|
7506
7431
|
exports.mapsUrl = mapsUrl;
|
|
7432
|
+
exports.markerIcon = markerIcon;
|
|
7433
|
+
exports.markerPie = markerPie;
|
|
7507
7434
|
exports.matchAggregatedQuery = matchAggregatedQuery;
|
|
7508
7435
|
exports.matchBoolPrefixQuery = matchBoolPrefixQuery;
|
|
7509
7436
|
exports.matchCountry = matchCountry;
|
|
@@ -7520,20 +7447,25 @@
|
|
|
7520
7447
|
exports.matchType = matchType;
|
|
7521
7448
|
exports.maxAreaSize = maxAreaSize;
|
|
7522
7449
|
exports.measurementValue = measurementValue;
|
|
7523
|
-
exports.minutesBefore = minutesBefore;
|
|
7524
7450
|
exports.multiMatchQuery = multiMatchQuery;
|
|
7525
7451
|
exports.nestingEnabled = nestingEnabled;
|
|
7526
7452
|
exports.nestingTypeEnabled = nestingTypeEnabled;
|
|
7527
|
-
exports.
|
|
7453
|
+
exports.nodeLogsUrl = nodeLogsUrl;
|
|
7454
|
+
exports.nodeUrl = nodeUrl;
|
|
7528
7455
|
exports.numberGte = numberGte;
|
|
7529
7456
|
exports.parseData = parseData;
|
|
7530
7457
|
exports.parseLines = parseLines;
|
|
7531
7458
|
exports.parseMessage = parseMessage;
|
|
7532
|
-
exports.
|
|
7459
|
+
exports.pointToCoordinates = pointToCoordinates;
|
|
7460
|
+
exports.polygonBounds = polygonBounds;
|
|
7461
|
+
exports.polygonToCoordinates = polygonToCoordinates;
|
|
7462
|
+
exports.polygonsFromFeature = polygonsFromFeature;
|
|
7463
|
+
exports.primaryProduct = primaryProduct;
|
|
7533
7464
|
exports.propertyValue = propertyValue$1;
|
|
7534
7465
|
exports.refToSchemaType = refToSchemaType;
|
|
7535
7466
|
exports.regionsQuery = regionsQuery;
|
|
7536
7467
|
exports.repeat = repeat;
|
|
7468
|
+
exports.roundValue = roundValue;
|
|
7537
7469
|
exports.safeJSONParse = safeJSONParse;
|
|
7538
7470
|
exports.safeJSONStringify = safeJSONStringify;
|
|
7539
7471
|
exports.schemaRequiredProperties = schemaRequiredProperties;
|
|
@@ -7545,8 +7477,9 @@
|
|
|
7545
7477
|
exports.searchableTypes = searchableTypes;
|
|
7546
7478
|
exports.serializeSearchFilters = serializeSearchFilters;
|
|
7547
7479
|
exports.siteTooBig = siteTooBig;
|
|
7548
|
-
exports.sortByFn = sortByFn;
|
|
7549
7480
|
exports.sortOrder = sortOrder;
|
|
7481
|
+
exports.strokeColor = strokeColor;
|
|
7482
|
+
exports.strokeStyle = strokeStyle;
|
|
7550
7483
|
exports.suggestMatchQuery = suggestMatchQuery;
|
|
7551
7484
|
exports.suggestQuery = suggestQuery;
|
|
7552
7485
|
exports.termChildToParent = termChildToParent;
|
|
@@ -7555,10 +7488,9 @@
|
|
|
7555
7488
|
exports.termProperties = termProperties;
|
|
7556
7489
|
exports.termTypeGroups = termTypeGroups;
|
|
7557
7490
|
exports.termTypeLabel = termTypeLabel;
|
|
7491
|
+
exports.termTypeLookupUrl = termTypeLookupUrl;
|
|
7558
7492
|
exports.toCsv = toCsv$1;
|
|
7559
7493
|
exports.toDashCase = toDashCase;
|
|
7560
|
-
exports.toFormData = toFormData;
|
|
7561
|
-
exports.toSearchParams = toSearchParams;
|
|
7562
7494
|
exports.valueTypeToDefault = valueTypeToDefault;
|
|
7563
7495
|
exports.waitFor = waitFor;
|
|
7564
7496
|
exports.wildcardQuery = wildcardQuery;
|