@overmap-ai/core 1.0.60 → 1.0.62-store-clear-fixes.0
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 +36 -25
- package/dist/overmap-core.js.map +1 -1
- package/dist/overmap-core.umd.cjs +36 -25
- package/dist/overmap-core.umd.cjs.map +1 -1
- package/dist/store/slices/formSlice.d.ts +2 -2
- package/dist/store/slices/formSubmissionSlice.d.ts +13 -9
- package/dist/store/slices/licenseSlice.d.ts +2 -2
- package/dist/store/slices/projectAccessSlice.d.ts +2 -2
- package/dist/store/slices/teamSlice.d.ts +2 -2
- package/package.json +1 -1
package/dist/overmap-core.js
CHANGED
|
@@ -1768,12 +1768,12 @@ const licenseSlice = createSlice({
|
|
|
1768
1768
|
initialState: initialState$n,
|
|
1769
1769
|
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$n)),
|
|
1770
1770
|
reducers: {
|
|
1771
|
-
|
|
1771
|
+
initializeLicences: licenseAdapter.initialize,
|
|
1772
1772
|
addLicenses: licenseAdapter.addMany,
|
|
1773
1773
|
updateLicense: licenseAdapter.updateOne
|
|
1774
1774
|
}
|
|
1775
1775
|
});
|
|
1776
|
-
const {
|
|
1776
|
+
const { initializeLicences, addLicenses, updateLicense } = licenseSlice.actions;
|
|
1777
1777
|
const selectLicenses = (state) => {
|
|
1778
1778
|
return state.licenseReducer.instances;
|
|
1779
1779
|
};
|
|
@@ -1798,13 +1798,13 @@ const projectAccessSlice = createSlice({
|
|
|
1798
1798
|
initialState: initialState$m,
|
|
1799
1799
|
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$m)),
|
|
1800
1800
|
reducers: {
|
|
1801
|
-
|
|
1801
|
+
initializeProjectAccesses: projectAccessAdapter.initialize,
|
|
1802
1802
|
updateProjectAccess: projectAccessAdapter.updateOne,
|
|
1803
1803
|
deleteProjectAccess: projectAccessAdapter.deleteOne,
|
|
1804
1804
|
deleteProjectAccesses: projectAccessAdapter.deleteMany
|
|
1805
1805
|
}
|
|
1806
1806
|
});
|
|
1807
|
-
const {
|
|
1807
|
+
const { initializeProjectAccesses, updateProjectAccess, deleteProjectAccess, deleteProjectAccesses } = projectAccessSlice.actions;
|
|
1808
1808
|
const selectProjectAccessMapping = (state) => {
|
|
1809
1809
|
return state.projectAccessReducer.instances;
|
|
1810
1810
|
};
|
|
@@ -2335,10 +2335,17 @@ const _selectLatestFormRevision = (formRevisions, formId) => {
|
|
|
2335
2335
|
return ret;
|
|
2336
2336
|
};
|
|
2337
2337
|
const selectLatestFormRevisionOfForm = restructureCreateSelectorWithArgs(
|
|
2338
|
-
createSelector(
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2338
|
+
createSelector(
|
|
2339
|
+
[selectFormRevisionMapping, (_state, formId) => formId],
|
|
2340
|
+
(revisions, formId) => {
|
|
2341
|
+
const revisionsOfForm = Object.values(revisions).filter((revision) => revision.form === formId);
|
|
2342
|
+
if (revisionsOfForm.length === 0)
|
|
2343
|
+
return void 0;
|
|
2344
|
+
const sortedRevisions = revisionsOfForm.sort(formRevisionSortFn);
|
|
2345
|
+
const latestRevision = sortedRevisions[revisionsOfForm.length - 1];
|
|
2346
|
+
return revisions[latestRevision.offline_id];
|
|
2347
|
+
}
|
|
2348
|
+
)
|
|
2342
2349
|
);
|
|
2343
2350
|
const selectFormRevisionsOfForm = restructureCreateSelectorWithArgs(
|
|
2344
2351
|
createSelector(
|
|
@@ -2395,7 +2402,7 @@ const formSlice = createSlice({
|
|
|
2395
2402
|
initialState: initialState$d,
|
|
2396
2403
|
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$d)),
|
|
2397
2404
|
reducers: {
|
|
2398
|
-
|
|
2405
|
+
initializeForms: formAdapter.initialize,
|
|
2399
2406
|
setForm: formAdapter.setOne,
|
|
2400
2407
|
addForm: formAdapter.addOne,
|
|
2401
2408
|
addForms: formAdapter.addMany,
|
|
@@ -2403,7 +2410,7 @@ const formSlice = createSlice({
|
|
|
2403
2410
|
deleteForm: formAdapter.deleteOne
|
|
2404
2411
|
}
|
|
2405
2412
|
});
|
|
2406
|
-
const {
|
|
2413
|
+
const { initializeForms, setForm, addForm, addForms, updateForm, deleteForm } = formSlice.actions;
|
|
2407
2414
|
const selectFormsMapping = (state) => {
|
|
2408
2415
|
return state.formReducer.instances;
|
|
2409
2416
|
};
|
|
@@ -2479,6 +2486,7 @@ const formSubmissionSlice = createSlice({
|
|
|
2479
2486
|
initialState: initialState$c,
|
|
2480
2487
|
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$c)),
|
|
2481
2488
|
reducers: {
|
|
2489
|
+
initializeFormSubmissions: submissionAdapter.initialize,
|
|
2482
2490
|
setFormSubmission: submissionAdapter.setOne,
|
|
2483
2491
|
setFormSubmissions: submissionAdapter.setMany,
|
|
2484
2492
|
addFormSubmission: submissionAdapter.addOne,
|
|
@@ -2490,6 +2498,7 @@ const formSubmissionSlice = createSlice({
|
|
|
2490
2498
|
}
|
|
2491
2499
|
});
|
|
2492
2500
|
const {
|
|
2501
|
+
initializeFormSubmissions,
|
|
2493
2502
|
setFormSubmission,
|
|
2494
2503
|
setFormSubmissions,
|
|
2495
2504
|
addFormSubmission,
|
|
@@ -2976,13 +2985,13 @@ const teamSlice = createSlice({
|
|
|
2976
2985
|
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$6)),
|
|
2977
2986
|
reducers: {
|
|
2978
2987
|
setTeam: teamAdapter.setOne,
|
|
2979
|
-
|
|
2988
|
+
initializeTeams: teamAdapter.initialize,
|
|
2980
2989
|
addTeam: teamAdapter.addOne,
|
|
2981
2990
|
updateTeam: teamAdapter.updateOne,
|
|
2982
2991
|
deleteTeam: teamAdapter.deleteOne
|
|
2983
2992
|
}
|
|
2984
2993
|
});
|
|
2985
|
-
const { setTeam,
|
|
2994
|
+
const { setTeam, initializeTeams, addTeam, updateTeam, deleteTeam } = teamSlice.actions;
|
|
2986
2995
|
const selectTeamsMapping = (state) => state.teamReducer.instances;
|
|
2987
2996
|
const selectTeams = createSelector([selectTeamsMapping], (teams) => {
|
|
2988
2997
|
return Object.values(teams);
|
|
@@ -5138,7 +5147,7 @@ class ProjectAccessService extends BaseApiService {
|
|
|
5138
5147
|
async refreshStore(projectId) {
|
|
5139
5148
|
const promise = this.fetchAll(projectId);
|
|
5140
5149
|
const result = await promise;
|
|
5141
|
-
this.dispatch(
|
|
5150
|
+
this.dispatch(initializeProjectAccesses(result));
|
|
5142
5151
|
}
|
|
5143
5152
|
}
|
|
5144
5153
|
class ProjectFileService extends BaseApiService {
|
|
@@ -5150,6 +5159,7 @@ class ProjectFileService extends BaseApiService {
|
|
|
5150
5159
|
blockers: [],
|
|
5151
5160
|
blocks: []
|
|
5152
5161
|
});
|
|
5162
|
+
this.dispatch(addOrReplaceProjectFiles([]));
|
|
5153
5163
|
this.dispatch(addOrReplaceProjectFiles(result));
|
|
5154
5164
|
}
|
|
5155
5165
|
async saveExisting(file) {
|
|
@@ -5303,7 +5313,7 @@ class ProjectService extends BaseApiService {
|
|
|
5303
5313
|
return result;
|
|
5304
5314
|
}
|
|
5305
5315
|
async update(project) {
|
|
5306
|
-
if (!project.bounds
|
|
5316
|
+
if (!project.bounds && !project.canvas_bounds) {
|
|
5307
5317
|
throw new Error("Project must either have bounds or canvas_bounds set");
|
|
5308
5318
|
}
|
|
5309
5319
|
this.dispatch(updateOrCreateProject(project));
|
|
@@ -5350,7 +5360,7 @@ class ProjectService extends BaseApiService {
|
|
|
5350
5360
|
this.dispatch({ type: "rehydrated/setRehydrated", payload: true });
|
|
5351
5361
|
} catch (e) {
|
|
5352
5362
|
this.dispatch(setProjects(Object.values(projects)));
|
|
5353
|
-
this.dispatch(
|
|
5363
|
+
this.dispatch(initializeProjectAccesses(Object.values(projectAccesses)));
|
|
5354
5364
|
this.dispatch(addOrReplaceProjectFiles(filesToDelete));
|
|
5355
5365
|
this.dispatch(setProjectAttachments(attachmentsOfProject));
|
|
5356
5366
|
this.dispatch({ type: "rehydrated/setRehydrated", payload: true });
|
|
@@ -5718,9 +5728,9 @@ class FormService extends BaseApiService {
|
|
|
5718
5728
|
revisions.push(revision);
|
|
5719
5729
|
for (const attachment of issueTypeFormsResult.attachments)
|
|
5720
5730
|
attachments.push(attachment);
|
|
5721
|
-
this.dispatch(
|
|
5731
|
+
this.dispatch(initializeForms(forms));
|
|
5722
5732
|
this.dispatch(initializeFormRevisions(revisions));
|
|
5723
|
-
this.dispatch(
|
|
5733
|
+
this.dispatch(initializeFormRevisionAttachments(attachments));
|
|
5724
5734
|
}
|
|
5725
5735
|
}
|
|
5726
5736
|
const isArrayOfFiles = (value) => {
|
|
@@ -5983,7 +5993,7 @@ class FormSubmissionService extends BaseUploadService {
|
|
|
5983
5993
|
blockers: [],
|
|
5984
5994
|
blocks: []
|
|
5985
5995
|
});
|
|
5986
|
-
this.dispatch(
|
|
5996
|
+
this.dispatch(initializeFormSubmissions(submissions));
|
|
5987
5997
|
const attachments = await this.enqueueRequest({
|
|
5988
5998
|
description: "Fetch form attachments",
|
|
5989
5999
|
method: HttpMethod.GET,
|
|
@@ -5991,7 +6001,7 @@ class FormSubmissionService extends BaseUploadService {
|
|
|
5991
6001
|
blockers: [],
|
|
5992
6002
|
blocks: []
|
|
5993
6003
|
});
|
|
5994
|
-
this.dispatch(
|
|
6004
|
+
this.dispatch(initializeFormSubmissionAttachments(attachments));
|
|
5995
6005
|
}
|
|
5996
6006
|
}
|
|
5997
6007
|
class WorkspaceService extends BaseApiService {
|
|
@@ -6533,7 +6543,7 @@ class LicenseService extends BaseApiService {
|
|
|
6533
6543
|
for (const license of projectLicences) {
|
|
6534
6544
|
licencesRecord[license.offline_id] = license;
|
|
6535
6545
|
}
|
|
6536
|
-
this.dispatch(
|
|
6546
|
+
this.dispatch(initializeLicences(Object.values(licencesRecord)));
|
|
6537
6547
|
}
|
|
6538
6548
|
}
|
|
6539
6549
|
class DocumentService extends BaseApiService {
|
|
@@ -6927,7 +6937,7 @@ class TeamService extends BaseApiService {
|
|
|
6927
6937
|
blockers: [],
|
|
6928
6938
|
blocks: []
|
|
6929
6939
|
});
|
|
6930
|
-
this.dispatch(
|
|
6940
|
+
this.dispatch(initializeTeams(result));
|
|
6931
6941
|
}
|
|
6932
6942
|
}
|
|
6933
6943
|
class UserService extends BaseApiService {
|
|
@@ -7364,14 +7374,19 @@ export {
|
|
|
7364
7374
|
initializeFormRevisionAttachments,
|
|
7365
7375
|
initializeFormRevisions,
|
|
7366
7376
|
initializeFormSubmissionAttachments,
|
|
7377
|
+
initializeFormSubmissions,
|
|
7378
|
+
initializeForms,
|
|
7367
7379
|
initializeGeoImages,
|
|
7368
7380
|
initializeIssueAttachments,
|
|
7369
7381
|
initializeIssueTypes,
|
|
7370
7382
|
initializeIssueUpdates,
|
|
7371
7383
|
initializeIssues,
|
|
7384
|
+
initializeLicences,
|
|
7372
7385
|
initializeOrganizationAccesses,
|
|
7386
|
+
initializeProjectAccesses,
|
|
7373
7387
|
initializeProjectAttachments,
|
|
7374
7388
|
initializeStages,
|
|
7389
|
+
initializeTeams,
|
|
7375
7390
|
initializeWorkspaces,
|
|
7376
7391
|
isToday,
|
|
7377
7392
|
issueAttachmentReducer,
|
|
@@ -7627,7 +7642,6 @@ export {
|
|
|
7627
7642
|
setFormSubmissionAttachment,
|
|
7628
7643
|
setFormSubmissionAttachments,
|
|
7629
7644
|
setFormSubmissions,
|
|
7630
|
-
setForms,
|
|
7631
7645
|
setGeoImage,
|
|
7632
7646
|
setGeoImages,
|
|
7633
7647
|
setIsFetchingInitialData,
|
|
@@ -7638,11 +7652,9 @@ export {
|
|
|
7638
7652
|
setIssueComments,
|
|
7639
7653
|
setIssueType,
|
|
7640
7654
|
setIssueUpdate,
|
|
7641
|
-
setLicenses,
|
|
7642
7655
|
setLoggedIn,
|
|
7643
7656
|
setOrganizations,
|
|
7644
7657
|
setProfilePicture,
|
|
7645
|
-
setProjectAccesses,
|
|
7646
7658
|
setProjectAttachment,
|
|
7647
7659
|
setProjectAttachments,
|
|
7648
7660
|
setProjects,
|
|
@@ -7650,7 +7662,6 @@ export {
|
|
|
7650
7662
|
setStage,
|
|
7651
7663
|
setStageCompletions,
|
|
7652
7664
|
setTeam,
|
|
7653
|
-
setTeams,
|
|
7654
7665
|
setTokens,
|
|
7655
7666
|
setTourStep,
|
|
7656
7667
|
setUploadUrl,
|