@overmap-ai/core 1.0.71-fields.4 → 1.0.71-fields.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/dist/overmap-core.js +3 -62
- package/dist/overmap-core.js.map +1 -1
- package/dist/overmap-core.umd.cjs +3 -62
- package/dist/overmap-core.umd.cjs.map +1 -1
- package/dist/sdk/services/FormService.d.ts +2 -2
- package/dist/store/slices/formRevisionSlice.d.ts +1 -2
- package/dist/store/slices/formSlice.d.ts +1 -3
- package/dist/store/slices/formSubmissionSlice.d.ts +0 -2
- package/package.json +1 -1
package/dist/overmap-core.js
CHANGED
|
@@ -2104,17 +2104,6 @@ const selectFormRevisionsOfForm = restructureCreateSelectorWithArgs(
|
|
|
2104
2104
|
}
|
|
2105
2105
|
)
|
|
2106
2106
|
);
|
|
2107
|
-
const selectLatestFormRevisionByForm = createSelector([selectFormRevisionMapping], (revisions) => {
|
|
2108
|
-
const latestRevisions = {};
|
|
2109
|
-
for (const revision of Object.values(revisions)) {
|
|
2110
|
-
const formId = revision.form;
|
|
2111
|
-
const currentLatestRevision = latestRevisions[formId];
|
|
2112
|
-
if (!currentLatestRevision || currentLatestRevision.revision < revision.revision) {
|
|
2113
|
-
latestRevisions[formId] = revision;
|
|
2114
|
-
}
|
|
2115
|
-
}
|
|
2116
|
-
return latestRevisions;
|
|
2117
|
-
});
|
|
2118
2107
|
const formRevisionReducer = formRevisionsSlice.reducer;
|
|
2119
2108
|
const formAdapter = createModelAdapter((form) => form.offline_id);
|
|
2120
2109
|
const initialState$n = formAdapter.getInitialState({});
|
|
@@ -2139,6 +2128,9 @@ const selectFormMapping = (state) => {
|
|
|
2139
2128
|
const selectForms = createSelector([selectFormMapping], (formsMapping) => {
|
|
2140
2129
|
return Object.values(formsMapping);
|
|
2141
2130
|
});
|
|
2131
|
+
const selectFormById = (formId) => (state) => {
|
|
2132
|
+
return state.formReducer.instances[formId];
|
|
2133
|
+
};
|
|
2142
2134
|
const selectFilteredForms = restructureCreateSelectorWithArgs(
|
|
2143
2135
|
createSelector(
|
|
2144
2136
|
[
|
|
@@ -2164,15 +2156,6 @@ const selectFilteredForms = restructureCreateSelectorWithArgs(
|
|
|
2164
2156
|
{ memoizeOptions: { equalityCheck: shallowEqual } }
|
|
2165
2157
|
)
|
|
2166
2158
|
);
|
|
2167
|
-
const selectFormById = (formId) => (state) => {
|
|
2168
|
-
return state.formReducer.instances[formId];
|
|
2169
|
-
};
|
|
2170
|
-
const selectFormsCount = createSelector([selectFormMapping], (formsMapping) => {
|
|
2171
|
-
return Object.keys(formsMapping).length;
|
|
2172
|
-
});
|
|
2173
|
-
const selectGeneralFormCount = createSelector([selectFormMapping], (formsMapping) => {
|
|
2174
|
-
return Object.values(formsMapping).length;
|
|
2175
|
-
});
|
|
2176
2159
|
const submissionAdapter = createModelAdapter((submission) => submission.offline_id);
|
|
2177
2160
|
const initialState$m = submissionAdapter.getInitialState({});
|
|
2178
2161
|
const formSubmissionSlice = createSlice({
|
|
@@ -2234,43 +2217,6 @@ const selectFormSubmissionsOfForm = restructureCreateSelectorWithArgs(
|
|
|
2234
2217
|
}
|
|
2235
2218
|
)
|
|
2236
2219
|
);
|
|
2237
|
-
const selectFormSubmissionsByFormRevisions = createSelector([selectFormRevisionMapping, selectFormSubmissions], (revisions, submissions) => {
|
|
2238
|
-
var _a2;
|
|
2239
|
-
const submissionMapping = {};
|
|
2240
|
-
for (const revisionId in revisions) {
|
|
2241
|
-
submissionMapping[revisionId] = [];
|
|
2242
|
-
}
|
|
2243
|
-
for (const submission of submissions) {
|
|
2244
|
-
(_a2 = submissionMapping[submission.form_revision]) == null ? void 0 : _a2.push(submission);
|
|
2245
|
-
}
|
|
2246
|
-
return submissionMapping;
|
|
2247
|
-
});
|
|
2248
|
-
const selectSortedFormSubmissionsOfForm = restructureCreateSelectorWithArgs(
|
|
2249
|
-
createSelector(
|
|
2250
|
-
[
|
|
2251
|
-
selectFormRevisionMapping,
|
|
2252
|
-
selectFormSubmissionsByFormRevisions,
|
|
2253
|
-
(_state, formId) => formId
|
|
2254
|
-
],
|
|
2255
|
-
(revisionsMapping, submissionsByRevision, formId) => {
|
|
2256
|
-
const submissionsByFormRevisions = {};
|
|
2257
|
-
for (const revisionId in revisionsMapping) {
|
|
2258
|
-
const revision = revisionsMapping[revisionId];
|
|
2259
|
-
const submissionsOfRevision = submissionsByRevision[revisionId];
|
|
2260
|
-
if (revision && submissionsOfRevision && revision.form === formId) {
|
|
2261
|
-
submissionsByFormRevisions[revisionId] = submissionsOfRevision.sort(
|
|
2262
|
-
(a, b) => a.submitted_at < b.submitted_at ? -1 : 1
|
|
2263
|
-
);
|
|
2264
|
-
}
|
|
2265
|
-
}
|
|
2266
|
-
return Object.entries(submissionsByFormRevisions).sort((a, b) => {
|
|
2267
|
-
const aRevision = revisionsMapping[a[0]];
|
|
2268
|
-
const bRevision = revisionsMapping[b[0]];
|
|
2269
|
-
return formRevisionSortFn(aRevision, bRevision);
|
|
2270
|
-
}).map(([_revisionId, submissions]) => submissions).flat();
|
|
2271
|
-
}
|
|
2272
|
-
)
|
|
2273
|
-
);
|
|
2274
2220
|
const selectFormSubmissionsOfIssue = restructureCreateSelectorWithArgs(
|
|
2275
2221
|
createSelector(
|
|
2276
2222
|
[selectFormSubmissions, (_state, issueId) => issueId],
|
|
@@ -8629,14 +8575,11 @@ export {
|
|
|
8629
8575
|
selectFormSubmissionAttachmentsMapping,
|
|
8630
8576
|
selectFormSubmissionById,
|
|
8631
8577
|
selectFormSubmissions,
|
|
8632
|
-
selectFormSubmissionsByFormRevisions,
|
|
8633
8578
|
selectFormSubmissionsMapping,
|
|
8634
8579
|
selectFormSubmissionsOfAsset,
|
|
8635
8580
|
selectFormSubmissionsOfForm,
|
|
8636
8581
|
selectFormSubmissionsOfIssue,
|
|
8637
8582
|
selectForms,
|
|
8638
|
-
selectFormsCount,
|
|
8639
|
-
selectGeneralFormCount,
|
|
8640
8583
|
selectGeoImageById,
|
|
8641
8584
|
selectGeoImageMapping,
|
|
8642
8585
|
selectGeoImages,
|
|
@@ -8683,7 +8626,6 @@ export {
|
|
|
8683
8626
|
selectIssuesOfIssueType,
|
|
8684
8627
|
selectIssuesOfIssueTypeCount,
|
|
8685
8628
|
selectLatestAssetTypeFieldsOfAssetType,
|
|
8686
|
-
selectLatestFormRevisionByForm,
|
|
8687
8629
|
selectLatestFormRevisionOfForm,
|
|
8688
8630
|
selectLatestIssueTypeFieldsOfIssueType,
|
|
8689
8631
|
selectLatestRetryTime,
|
|
@@ -8722,7 +8664,6 @@ export {
|
|
|
8722
8664
|
selectProjectsOfOrganization,
|
|
8723
8665
|
selectRehydrated,
|
|
8724
8666
|
selectRootDocuments,
|
|
8725
|
-
selectSortedFormSubmissionsOfForm,
|
|
8726
8667
|
selectSortedOrganizationUsers,
|
|
8727
8668
|
selectSortedProjectUsers,
|
|
8728
8669
|
selectStageFormIdsFromStageIds,
|