@overmap-ai/core 1.0.65-bulk-form-submit.0 → 1.0.65-current-user-cleaup.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const OUTBOX_RETRY_DELAY =
|
|
1
|
+
export declare const OUTBOX_RETRY_DELAY = 60000;
|
package/dist/overmap-core.js
CHANGED
|
@@ -657,7 +657,7 @@ const emailRegex = /^.+@.+\..+$/;
|
|
|
657
657
|
const fullAssetMarkerSize = 45;
|
|
658
658
|
const DEFAULT_ISSUE_STATUS = IssueStatus.BACKLOG;
|
|
659
659
|
const DEFAULT_ISSUE_PRIORITY = IssuePriority.MEDIUM;
|
|
660
|
-
const OUTBOX_RETRY_DELAY =
|
|
660
|
+
const OUTBOX_RETRY_DELAY = 6e4;
|
|
661
661
|
const EMPTY_ARRAY = Object.freeze([]);
|
|
662
662
|
let debug = false;
|
|
663
663
|
const REACT_APP_DEBUG_MEMOIZATION = {}.REACT_APP_DEBUG_MEMOIZATION || "";
|
|
@@ -1633,12 +1633,7 @@ var LicenseStatus = /* @__PURE__ */ ((LicenseStatus2) => {
|
|
|
1633
1633
|
})(LicenseStatus || {});
|
|
1634
1634
|
const initialState$p = {
|
|
1635
1635
|
users: {},
|
|
1636
|
-
currentUser:
|
|
1637
|
-
id: 0,
|
|
1638
|
-
username: "",
|
|
1639
|
-
email: "",
|
|
1640
|
-
profile: { file: null, file_sha1: null, favourite_project_ids: [], tour_step: -1 }
|
|
1641
|
-
}
|
|
1636
|
+
currentUser: null
|
|
1642
1637
|
};
|
|
1643
1638
|
const userSlice = createSlice({
|
|
1644
1639
|
name: "users",
|
|
@@ -1661,6 +1656,8 @@ const userSlice = createSlice({
|
|
|
1661
1656
|
state.currentUser = action.payload;
|
|
1662
1657
|
},
|
|
1663
1658
|
setProfilePicture: (state, action) => {
|
|
1659
|
+
if (!state.currentUser)
|
|
1660
|
+
return;
|
|
1664
1661
|
state.currentUser.profile.file = action.payload.file ?? null;
|
|
1665
1662
|
state.currentUser.profile.file_sha1 = action.payload.file_sha1 ?? null;
|
|
1666
1663
|
const currentUser = state.users[state.currentUser.id];
|
|
@@ -1670,32 +1667,12 @@ const userSlice = createSlice({
|
|
|
1670
1667
|
currentUser.profile.file = action.payload.file ?? null;
|
|
1671
1668
|
currentUser.profile.file_sha1 = action.payload.file_sha1 ?? null;
|
|
1672
1669
|
},
|
|
1673
|
-
addFavouriteProjectId: (state, action) => {
|
|
1674
|
-
state.currentUser.profile.favourite_project_ids.push(action.payload);
|
|
1675
|
-
},
|
|
1676
|
-
removeFavouriteProjectId: (state, action) => {
|
|
1677
|
-
state.currentUser.profile.favourite_project_ids = state.currentUser.profile.favourite_project_ids.filter(
|
|
1678
|
-
(id) => id !== action.payload
|
|
1679
|
-
);
|
|
1680
|
-
},
|
|
1681
|
-
setTourStep: (state, action) => {
|
|
1682
|
-
state.currentUser.profile.tour_step = action.payload;
|
|
1683
|
-
},
|
|
1684
1670
|
removeUser: (state, action) => {
|
|
1685
1671
|
delete state.users[action.payload];
|
|
1686
1672
|
}
|
|
1687
1673
|
}
|
|
1688
1674
|
});
|
|
1689
|
-
const {
|
|
1690
|
-
setCurrentUser,
|
|
1691
|
-
setProfilePicture,
|
|
1692
|
-
setUsers,
|
|
1693
|
-
addUsers,
|
|
1694
|
-
addFavouriteProjectId,
|
|
1695
|
-
removeFavouriteProjectId,
|
|
1696
|
-
setTourStep,
|
|
1697
|
-
removeUser
|
|
1698
|
-
} = userSlice.actions;
|
|
1675
|
+
const { setCurrentUser, setProfilePicture, setUsers, addUsers, removeUser } = userSlice.actions;
|
|
1699
1676
|
const userReducer = userSlice.reducer;
|
|
1700
1677
|
const selectCurrentUser = (state) => state.userReducer.currentUser;
|
|
1701
1678
|
const selectUsersMapping = (state) => state.userReducer.users;
|
|
@@ -1716,7 +1693,6 @@ const selectUsersByIds = restructureCreateSelectorWithArgs(
|
|
|
1716
1693
|
return fallbackToEmptyArray(users);
|
|
1717
1694
|
})
|
|
1718
1695
|
);
|
|
1719
|
-
const selectFavouriteProjects = (state) => state.userReducer.currentUser.profile.favourite_project_ids;
|
|
1720
1696
|
const organizationAccessAdapter = createModelAdapter(
|
|
1721
1697
|
(organizationAccess) => organizationAccess.offline_id
|
|
1722
1698
|
);
|
|
@@ -1742,7 +1718,7 @@ const selectActiveOrganizationAccess = createSelector(
|
|
|
1742
1718
|
[selectCurrentUser, selectOrganizationAccesses],
|
|
1743
1719
|
(currentUser, organizationAccesses) => {
|
|
1744
1720
|
const activeOrganizationAccess = Object.values(organizationAccesses).find(
|
|
1745
|
-
(organizationAccess) => organizationAccess.user === currentUser.id
|
|
1721
|
+
(organizationAccess) => organizationAccess.user === (currentUser == null ? void 0 : currentUser.id)
|
|
1746
1722
|
);
|
|
1747
1723
|
return activeOrganizationAccess ?? null;
|
|
1748
1724
|
}
|
|
@@ -1932,9 +1908,9 @@ const selectSortedProjectUsers = createSelector(
|
|
|
1932
1908
|
[selectCurrentUser, selectProjectUsersAsMapping, selectProjectAccessUserMapping],
|
|
1933
1909
|
(currentUser, userMapping, projectAccessMapping) => {
|
|
1934
1910
|
return Object.values(userMapping).sort((userA, userB) => {
|
|
1935
|
-
if (userA.id === currentUser.id) {
|
|
1911
|
+
if (userA.id === (currentUser == null ? void 0 : currentUser.id)) {
|
|
1936
1912
|
return -1;
|
|
1937
|
-
} else if (userB.id === currentUser.id) {
|
|
1913
|
+
} else if (userB.id === (currentUser == null ? void 0 : currentUser.id)) {
|
|
1938
1914
|
return 1;
|
|
1939
1915
|
}
|
|
1940
1916
|
const projectAccessesA = projectAccessMapping[userA.id];
|
|
@@ -2011,9 +1987,9 @@ const selectSortedOrganizationUsers = createSelector(
|
|
|
2011
1987
|
[selectCurrentUser, selectOrganizationUsersAsMapping, selectOrganizationAccessUserMapping],
|
|
2012
1988
|
(currentUser, userMapping, organizationAccessMapping) => {
|
|
2013
1989
|
return Object.values(userMapping).sort((userA, userB) => {
|
|
2014
|
-
if (userA.id === currentUser.id) {
|
|
1990
|
+
if (userA.id === (currentUser == null ? void 0 : currentUser.id)) {
|
|
2015
1991
|
return -1;
|
|
2016
|
-
} else if (userB.id === currentUser.id) {
|
|
1992
|
+
} else if (userB.id === (currentUser == null ? void 0 : currentUser.id)) {
|
|
2017
1993
|
return 1;
|
|
2018
1994
|
}
|
|
2019
1995
|
const organizationAccessesA = organizationAccessMapping[userA.id];
|
|
@@ -6223,22 +6199,50 @@ class FormSubmissionService extends BaseUploadService {
|
|
|
6223
6199
|
}
|
|
6224
6200
|
}
|
|
6225
6201
|
async refreshStore(projectId) {
|
|
6226
|
-
const
|
|
6227
|
-
|
|
6202
|
+
const formSubmissions = {};
|
|
6203
|
+
const modelSubmissions = await this.enqueueRequest({
|
|
6204
|
+
description: "Fetch model submissions",
|
|
6228
6205
|
method: HttpMethod.GET,
|
|
6229
|
-
url: `/forms/in-project/${projectId}/submissions/`,
|
|
6206
|
+
url: `/forms/in-project/${projectId}/submissions/model/latest/`,
|
|
6230
6207
|
blockers: [],
|
|
6231
6208
|
blocks: []
|
|
6232
6209
|
});
|
|
6233
|
-
|
|
6234
|
-
|
|
6235
|
-
|
|
6210
|
+
for (const modelSubmission of modelSubmissions) {
|
|
6211
|
+
formSubmissions[modelSubmission.offline_id] = modelSubmission;
|
|
6212
|
+
}
|
|
6213
|
+
const standaloneSubmissions = await this.enqueueRequest({
|
|
6214
|
+
description: "Fetch standalone submissions",
|
|
6236
6215
|
method: HttpMethod.GET,
|
|
6237
|
-
url: `/forms/in-project/${projectId}/
|
|
6216
|
+
url: `/forms/in-project/${projectId}/submissions/standalone/`,
|
|
6238
6217
|
blockers: [],
|
|
6239
6218
|
blocks: []
|
|
6240
6219
|
});
|
|
6241
|
-
|
|
6220
|
+
for (const standaloneSubmission of standaloneSubmissions) {
|
|
6221
|
+
formSubmissions[standaloneSubmission.offline_id] = standaloneSubmission;
|
|
6222
|
+
}
|
|
6223
|
+
this.dispatch(initializeFormSubmissions(Object.values(formSubmissions)));
|
|
6224
|
+
const attachments = {};
|
|
6225
|
+
const modelAttachments = await this.enqueueRequest({
|
|
6226
|
+
description: "Fetch model submission attachments",
|
|
6227
|
+
method: HttpMethod.GET,
|
|
6228
|
+
url: `/forms/in-project/${projectId}/attachments/model/latest/`,
|
|
6229
|
+
blockers: [],
|
|
6230
|
+
blocks: []
|
|
6231
|
+
});
|
|
6232
|
+
for (const modelAttachment of modelAttachments) {
|
|
6233
|
+
attachments[modelAttachment.offline_id] = modelAttachment;
|
|
6234
|
+
}
|
|
6235
|
+
const standaloneAttachments = await this.enqueueRequest({
|
|
6236
|
+
description: "Fetch standalone submission attachments",
|
|
6237
|
+
method: HttpMethod.GET,
|
|
6238
|
+
url: `/forms/in-project/${projectId}/attachments/standalone/`,
|
|
6239
|
+
blockers: [],
|
|
6240
|
+
blocks: []
|
|
6241
|
+
});
|
|
6242
|
+
for (const standaloneAttachent of standaloneAttachments) {
|
|
6243
|
+
attachments[standaloneAttachent.offline_id] = standaloneAttachent;
|
|
6244
|
+
}
|
|
6245
|
+
this.dispatch(initializeFormSubmissionAttachments(Object.values(attachments)));
|
|
6242
6246
|
}
|
|
6243
6247
|
}
|
|
6244
6248
|
class WorkspaceService extends BaseApiService {
|
|
@@ -7606,7 +7610,6 @@ export {
|
|
|
7606
7610
|
addDocumentAttachments,
|
|
7607
7611
|
addDocuments,
|
|
7608
7612
|
addEmailDomain,
|
|
7609
|
-
addFavouriteProjectId,
|
|
7610
7613
|
addForm,
|
|
7611
7614
|
addFormRevision,
|
|
7612
7615
|
addFormRevisionAttachment,
|
|
@@ -7836,7 +7839,6 @@ export {
|
|
|
7836
7839
|
rehydratedReducer,
|
|
7837
7840
|
rehydratedSlice,
|
|
7838
7841
|
removeDocuments,
|
|
7839
|
-
removeFavouriteProjectId,
|
|
7840
7842
|
removeIssueType,
|
|
7841
7843
|
removeProjectFile,
|
|
7842
7844
|
removeProjectFilesOfProject,
|
|
@@ -7915,7 +7917,6 @@ export {
|
|
|
7915
7917
|
selectEmailDomains,
|
|
7916
7918
|
selectEmailDomainsAsMapping,
|
|
7917
7919
|
selectEmailDomainsOfOrganization,
|
|
7918
|
-
selectFavouriteProjects,
|
|
7919
7920
|
selectFilteredForms,
|
|
7920
7921
|
selectFormById,
|
|
7921
7922
|
selectFormMapping,
|
|
@@ -8072,7 +8073,6 @@ export {
|
|
|
8072
8073
|
setStageCompletions,
|
|
8073
8074
|
setTeam,
|
|
8074
8075
|
setTokens,
|
|
8075
|
-
setTourStep,
|
|
8076
8076
|
setUploadUrl,
|
|
8077
8077
|
setUsers,
|
|
8078
8078
|
setWorkspaces,
|