@overmap-ai/core 1.0.28 → 1.0.29-org-switcher-and-bug-fixes.1
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 +11 -2
- package/dist/overmap-core.js.map +1 -1
- package/dist/overmap-core.umd.cjs +11 -2
- package/dist/overmap-core.umd.cjs.map +1 -1
- package/dist/sdk/services/MainService.d.ts +1 -0
- package/dist/store/slices/organizationSlice.d.ts +1 -0
- package/dist/typings/models/organizations.d.ts +1 -0
- package/package.json +1 -1
|
@@ -2446,6 +2446,11 @@ var __publicField = (obj, key, value) => {
|
|
|
2446
2446
|
const selectOrganizations = (state) => {
|
|
2447
2447
|
return Object.values(state.organizationReducer.organizations);
|
|
2448
2448
|
};
|
|
2449
|
+
const selectOrganizationsWithAccess = (state) => {
|
|
2450
|
+
return Object.values(state.organizationReducer.organizations).filter(
|
|
2451
|
+
(organization) => organization.has_access
|
|
2452
|
+
);
|
|
2453
|
+
};
|
|
2449
2454
|
const selectActiveOrganization = (state) => {
|
|
2450
2455
|
const id = selectActiveOrganizationId(state);
|
|
2451
2456
|
if (!id) {
|
|
@@ -4860,13 +4865,16 @@ var __publicField = (obj, key, value) => {
|
|
|
4860
4865
|
}
|
|
4861
4866
|
}
|
|
4862
4867
|
store.dispatch(setCurrentUser(data.user));
|
|
4868
|
+
store.dispatch(addUsers(data.project_owners));
|
|
4863
4869
|
const organizationsData = data.organizations;
|
|
4864
4870
|
store.dispatch(setOrganizations(organizationsData));
|
|
4865
4871
|
const activeOrganizationId = store.getState().organizationReducer.activeOrganizationId;
|
|
4866
|
-
const firstOrg = organizationsData
|
|
4872
|
+
const firstOrg = organizationsData.find((organization) => organization.has_access);
|
|
4867
4873
|
const currProjObj = projects.find((project) => project.id === currentProjectId);
|
|
4868
4874
|
const isOrgProject = !!(currProjObj == null ? void 0 : currProjObj.owner_organization);
|
|
4869
|
-
const userIsInProjectOrg = isOrgProject && organizationsData.some(
|
|
4875
|
+
const userIsInProjectOrg = isOrgProject && organizationsData.some(
|
|
4876
|
+
(organization) => organization.has_access && organization.id === currProjObj.owner_organization
|
|
4877
|
+
);
|
|
4870
4878
|
let currentOrgId = null;
|
|
4871
4879
|
if (activeOrganizationId) {
|
|
4872
4880
|
currentOrgId = activeOrganizationId;
|
|
@@ -6278,6 +6286,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6278
6286
|
exports2.selectOrganizationUsersAsMapping = selectOrganizationUsersAsMapping;
|
|
6279
6287
|
exports2.selectOrganizationUsersIds = selectOrganizationUsersIds;
|
|
6280
6288
|
exports2.selectOrganizations = selectOrganizations;
|
|
6289
|
+
exports2.selectOrganizationsWithAccess = selectOrganizationsWithAccess;
|
|
6281
6290
|
exports2.selectPermittedWorkspaceIds = selectPermittedWorkspaceIds;
|
|
6282
6291
|
exports2.selectPhotoAttachmentsOfIssue = selectPhotoAttachmentsOfIssue;
|
|
6283
6292
|
exports2.selectProjectAccess = selectProjectAccess;
|