@overmap-ai/core 1.0.65-asset-models-improvements.3 → 1.0.65-asset-models-improvements.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
CHANGED
|
@@ -1630,12 +1630,7 @@ const selectUploadUrl = (sha1) => (state) => {
|
|
|
1630
1630
|
const fileReducer = fileSlice.reducer;
|
|
1631
1631
|
const initialState$p = {
|
|
1632
1632
|
users: {},
|
|
1633
|
-
currentUser:
|
|
1634
|
-
id: 0,
|
|
1635
|
-
username: "",
|
|
1636
|
-
email: "",
|
|
1637
|
-
profile: { file: null, file_sha1: null, favourite_project_ids: [], tour_step: -1 }
|
|
1638
|
-
}
|
|
1633
|
+
currentUser: null
|
|
1639
1634
|
};
|
|
1640
1635
|
const userSlice = createSlice({
|
|
1641
1636
|
name: "users",
|
|
@@ -1658,6 +1653,8 @@ const userSlice = createSlice({
|
|
|
1658
1653
|
state.currentUser = action.payload;
|
|
1659
1654
|
},
|
|
1660
1655
|
setProfilePicture: (state, action) => {
|
|
1656
|
+
if (!state.currentUser)
|
|
1657
|
+
return;
|
|
1661
1658
|
state.currentUser.profile.file = action.payload.file ?? null;
|
|
1662
1659
|
state.currentUser.profile.file_sha1 = action.payload.file_sha1 ?? null;
|
|
1663
1660
|
const currentUser = state.users[state.currentUser.id];
|
|
@@ -1667,32 +1664,12 @@ const userSlice = createSlice({
|
|
|
1667
1664
|
currentUser.profile.file = action.payload.file ?? null;
|
|
1668
1665
|
currentUser.profile.file_sha1 = action.payload.file_sha1 ?? null;
|
|
1669
1666
|
},
|
|
1670
|
-
addFavouriteProjectId: (state, action) => {
|
|
1671
|
-
state.currentUser.profile.favourite_project_ids.push(action.payload);
|
|
1672
|
-
},
|
|
1673
|
-
removeFavouriteProjectId: (state, action) => {
|
|
1674
|
-
state.currentUser.profile.favourite_project_ids = state.currentUser.profile.favourite_project_ids.filter(
|
|
1675
|
-
(id) => id !== action.payload
|
|
1676
|
-
);
|
|
1677
|
-
},
|
|
1678
|
-
setTourStep: (state, action) => {
|
|
1679
|
-
state.currentUser.profile.tour_step = action.payload;
|
|
1680
|
-
},
|
|
1681
1667
|
removeUser: (state, action) => {
|
|
1682
1668
|
delete state.users[action.payload];
|
|
1683
1669
|
}
|
|
1684
1670
|
}
|
|
1685
1671
|
});
|
|
1686
|
-
const {
|
|
1687
|
-
setCurrentUser,
|
|
1688
|
-
setProfilePicture,
|
|
1689
|
-
setUsers,
|
|
1690
|
-
addUsers,
|
|
1691
|
-
addFavouriteProjectId,
|
|
1692
|
-
removeFavouriteProjectId,
|
|
1693
|
-
setTourStep,
|
|
1694
|
-
removeUser
|
|
1695
|
-
} = userSlice.actions;
|
|
1672
|
+
const { setCurrentUser, setProfilePicture, setUsers, addUsers, removeUser } = userSlice.actions;
|
|
1696
1673
|
const userReducer = userSlice.reducer;
|
|
1697
1674
|
const selectCurrentUser = (state) => state.userReducer.currentUser;
|
|
1698
1675
|
const selectUsersMapping = (state) => state.userReducer.users;
|
|
@@ -1713,7 +1690,6 @@ const selectUsersByIds = restructureCreateSelectorWithArgs(
|
|
|
1713
1690
|
return fallbackToEmptyArray(users);
|
|
1714
1691
|
})
|
|
1715
1692
|
);
|
|
1716
|
-
const selectFavouriteProjects = (state) => state.userReducer.currentUser.profile.favourite_project_ids;
|
|
1717
1693
|
const organizationAccessAdapter = createModelAdapter(
|
|
1718
1694
|
(organizationAccess) => organizationAccess.offline_id
|
|
1719
1695
|
);
|
|
@@ -1739,7 +1715,7 @@ const selectActiveOrganizationAccess = createSelector(
|
|
|
1739
1715
|
[selectCurrentUser, selectOrganizationAccesses],
|
|
1740
1716
|
(currentUser, organizationAccesses) => {
|
|
1741
1717
|
const activeOrganizationAccess = Object.values(organizationAccesses).find(
|
|
1742
|
-
(organizationAccess) => organizationAccess.user === currentUser.id
|
|
1718
|
+
(organizationAccess) => organizationAccess.user === (currentUser == null ? void 0 : currentUser.id)
|
|
1743
1719
|
);
|
|
1744
1720
|
return activeOrganizationAccess ?? null;
|
|
1745
1721
|
}
|
|
@@ -1929,9 +1905,9 @@ const selectSortedProjectUsers = createSelector(
|
|
|
1929
1905
|
[selectCurrentUser, selectProjectUsersAsMapping, selectProjectAccessUserMapping],
|
|
1930
1906
|
(currentUser, userMapping, projectAccessMapping) => {
|
|
1931
1907
|
return Object.values(userMapping).sort((userA, userB) => {
|
|
1932
|
-
if (userA.id === currentUser.id) {
|
|
1908
|
+
if (userA.id === (currentUser == null ? void 0 : currentUser.id)) {
|
|
1933
1909
|
return -1;
|
|
1934
|
-
} else if (userB.id === currentUser.id) {
|
|
1910
|
+
} else if (userB.id === (currentUser == null ? void 0 : currentUser.id)) {
|
|
1935
1911
|
return 1;
|
|
1936
1912
|
}
|
|
1937
1913
|
const projectAccessesA = projectAccessMapping[userA.id];
|
|
@@ -2008,9 +1984,9 @@ const selectSortedOrganizationUsers = createSelector(
|
|
|
2008
1984
|
[selectCurrentUser, selectOrganizationUsersAsMapping, selectOrganizationAccessUserMapping],
|
|
2009
1985
|
(currentUser, userMapping, organizationAccessMapping) => {
|
|
2010
1986
|
return Object.values(userMapping).sort((userA, userB) => {
|
|
2011
|
-
if (userA.id === currentUser.id) {
|
|
1987
|
+
if (userA.id === (currentUser == null ? void 0 : currentUser.id)) {
|
|
2012
1988
|
return -1;
|
|
2013
|
-
} else if (userB.id === currentUser.id) {
|
|
1989
|
+
} else if (userB.id === (currentUser == null ? void 0 : currentUser.id)) {
|
|
2014
1990
|
return 1;
|
|
2015
1991
|
}
|
|
2016
1992
|
const organizationAccessesA = organizationAccessMapping[userA.id];
|
|
@@ -7727,7 +7703,6 @@ export {
|
|
|
7727
7703
|
addDocumentAttachments,
|
|
7728
7704
|
addDocuments,
|
|
7729
7705
|
addEmailDomain,
|
|
7730
|
-
addFavouriteProjectId,
|
|
7731
7706
|
addForm,
|
|
7732
7707
|
addFormRevision,
|
|
7733
7708
|
addFormRevisionAttachment,
|
|
@@ -7959,7 +7934,6 @@ export {
|
|
|
7959
7934
|
rehydratedReducer,
|
|
7960
7935
|
rehydratedSlice,
|
|
7961
7936
|
removeDocuments,
|
|
7962
|
-
removeFavouriteProjectId,
|
|
7963
7937
|
removeIssueType,
|
|
7964
7938
|
removeProjectFile,
|
|
7965
7939
|
removeProjectFilesOfProject,
|
|
@@ -8039,7 +8013,6 @@ export {
|
|
|
8039
8013
|
selectEmailDomains,
|
|
8040
8014
|
selectEmailDomainsAsMapping,
|
|
8041
8015
|
selectEmailDomainsOfOrganization,
|
|
8042
|
-
selectFavouriteProjects,
|
|
8043
8016
|
selectFilteredForms,
|
|
8044
8017
|
selectFormById,
|
|
8045
8018
|
selectFormMapping,
|
|
@@ -8197,7 +8170,6 @@ export {
|
|
|
8197
8170
|
setRehydrated,
|
|
8198
8171
|
setTeam,
|
|
8199
8172
|
setTokens,
|
|
8200
|
-
setTourStep,
|
|
8201
8173
|
setUploadUrl,
|
|
8202
8174
|
setUsers,
|
|
8203
8175
|
setWorkspaces,
|