@luomus/laji-form 15.1.96 → 15.1.97
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.
|
@@ -99,30 +99,27 @@ let TaxonSetPopulatorField = class TaxonSetPopulatorField extends React.Componen
|
|
|
99
99
|
return this.unitTaxonSets[unit.identifications[0].taxonID]
|
|
100
100
|
&& this.unitTaxonSets[unit.identifications[0].taxonID].includes(deletedTaxonSetId);
|
|
101
101
|
});
|
|
102
|
-
deletedTaxonSetUnits.
|
|
102
|
+
observationsExist = deletedTaxonSetUnits.some((unit) => {
|
|
103
103
|
var _a, _b, _c, _d;
|
|
104
|
-
|
|
104
|
+
return unit.maleIndividualCount ||
|
|
105
105
|
unit.femaleIndividualCount ||
|
|
106
106
|
unit.nestCount ||
|
|
107
107
|
((_a = unit.unitFact) === null || _a === void 0 ? void 0 : _a.destroyedNestCount) ||
|
|
108
108
|
((_b = unit.unitFact) === null || _b === void 0 ? void 0 : _b.broodCount) ||
|
|
109
109
|
((_c = unit.unitFact) === null || _c === void 0 ? void 0 : _c.femalesWithBroodsCount) ||
|
|
110
|
-
((_d = unit.unitFact) === null || _d === void 0 ? void 0 : _d.juvenileCount)
|
|
111
|
-
window.alert(translations === null || translations === void 0 ? void 0 : translations.TaxonSetDeletionFailed);
|
|
112
|
-
observationsExist = true;
|
|
113
|
-
const updatedFormData = Object.assign(Object.assign({}, formData), { taxonCensus: [
|
|
114
|
-
...formData.taxonCensus,
|
|
115
|
-
{
|
|
116
|
-
censusTaxonSetID: deletedTaxonSetId,
|
|
117
|
-
taxonCensusType: "MY.taxonCensusTypeCounted"
|
|
118
|
-
}
|
|
119
|
-
] });
|
|
120
|
-
this.selectedTaxonSets = [...this.selectedTaxonSets, deletedTaxonSetId];
|
|
121
|
-
this.props.onChange(updatedFormData);
|
|
122
|
-
return;
|
|
123
|
-
}
|
|
110
|
+
((_d = unit.unitFact) === null || _d === void 0 ? void 0 : _d.juvenileCount);
|
|
124
111
|
});
|
|
125
112
|
if (observationsExist) {
|
|
113
|
+
window.alert(translations === null || translations === void 0 ? void 0 : translations.TaxonSetDeletionFailed);
|
|
114
|
+
const restoredFormData = Object.assign(Object.assign({}, formData), { taxonCensus: [
|
|
115
|
+
...formData.taxonCensus,
|
|
116
|
+
{
|
|
117
|
+
censusTaxonSetID: deletedTaxonSetId,
|
|
118
|
+
taxonCensusType: "MY.taxonCensusTypeCounted"
|
|
119
|
+
}
|
|
120
|
+
] });
|
|
121
|
+
this.selectedTaxonSets = [...this.selectedTaxonSets, deletedTaxonSetId];
|
|
122
|
+
this.props.onChange(restoredFormData);
|
|
126
123
|
return;
|
|
127
124
|
}
|
|
128
125
|
const updatedUnits = currentUnits.filter((unit) => {
|