@overmap-ai/core 1.0.63-selector-standardization.0 → 1.0.63-selector-standardization.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.
@@ -1011,7 +1011,7 @@ const selectAssetTypes = createSelector(
1011
1011
  [selectAssetTypesMapping],
1012
1012
  (mapping) => Object.values(mapping)
1013
1013
  );
1014
- const selectAssetTypeId = (id) => (state) => {
1014
+ const selectAssetTypeById = (id) => (state) => {
1015
1015
  return state.assetTypeReducer.instances[id];
1016
1016
  };
1017
1017
  const selectAssetTypesByIds = restructureCreateSelectorWithArgs(
@@ -1793,7 +1793,7 @@ const { initializeOrganizationAccesses, updateOrganizationAccess, deleteOrganiza
1793
1793
  const selectOrganizationAccesses = (state) => {
1794
1794
  return state.organizationAccessReducer.instances;
1795
1795
  };
1796
- const selectOrganizationAccess = (organizationAccessId) => (state) => {
1796
+ const selectOrganizationAccessById = (organizationAccessId) => (state) => {
1797
1797
  return state.organizationAccessReducer.instances[organizationAccessId];
1798
1798
  };
1799
1799
  const selectActiveOrganizationAccess = createSelector(
@@ -1967,7 +1967,7 @@ const {
1967
1967
  addActiveProjectFormSubmissionsCount
1968
1968
  } = projectSlice.actions;
1969
1969
  const projectReducer = projectSlice.reducer;
1970
- const selectProjects = (state) => state.projectReducer.projects;
1970
+ const selectProjectMapping = (state) => state.projectReducer.projects;
1971
1971
  const selectActiveProjectId = (state) => state.projectReducer.activeProjectId;
1972
1972
  const selectActiveProject = (state) => {
1973
1973
  const activeProjectId = selectActiveProjectId(state);
@@ -1988,7 +1988,7 @@ const selectProjectUsersAsMapping = createSelector(
1988
1988
  (projectUserIds, users) => projectUserIds.reduce((accum, userId) => ({ ...accum, [userId]: users[userId] }), {})
1989
1989
  );
1990
1990
  const selectProjectsWithAccess = createSelector(
1991
- [selectProjects],
1991
+ [selectProjectMapping],
1992
1992
  (projects) => Object.values(projects).filter((project) => !project.invited)
1993
1993
  );
1994
1994
  const selectSortedProjectUsers = createSelector(
@@ -2046,9 +2046,12 @@ const selectOrganizationUsersIds = createSelector(
2046
2046
  (organizationAccesses) => Object.values(organizationAccesses).map((organizationAccess) => organizationAccess.user)
2047
2047
  );
2048
2048
  const selectProjectsOfOrganization = restructureCreateSelectorWithArgs(
2049
- createSelector([selectProjects, (_, organizationId) => organizationId], (projects, organizationId) => {
2050
- return Object.values(projects).filter((project) => project.organization_owner === organizationId);
2051
- })
2049
+ createSelector(
2050
+ [selectProjectMapping, (_, organizationId) => organizationId],
2051
+ (projects, organizationId) => {
2052
+ return Object.values(projects).filter((project) => project.organization_owner === organizationId);
2053
+ }
2054
+ )
2052
2055
  );
2053
2056
  const selectLicensesOfOrganization = restructureCreateSelectorWithArgs(
2054
2057
  createSelector([selectLicenses, (_, organizationId) => organizationId], (licenses, organizationId) => {
@@ -2352,7 +2355,7 @@ const selectFormRevisions = createSelector(
2352
2355
  [selectFormRevisionMapping],
2353
2356
  (formRevisions) => Object.values(formRevisions)
2354
2357
  );
2355
- const selectFormRevisionId = (formRevisionId) => (state) => {
2358
+ const selectFormRevisionById = (formRevisionId) => (state) => {
2356
2359
  return state.formRevisionReducer.instances[formRevisionId];
2357
2360
  };
2358
2361
  const _selectLatestFormRevision = (formRevisions, formId) => {
@@ -4814,7 +4817,7 @@ class AssetTypeService extends BaseApiService {
4814
4817
  async delete(assetTypeId) {
4815
4818
  const { store } = this.client;
4816
4819
  const state = store.getState();
4817
- const assetType = selectAssetTypeId(assetTypeId)(state);
4820
+ const assetType = selectAssetTypeById(assetTypeId)(state);
4818
4821
  if (!assetType) {
4819
4822
  throw new Error(`Expected asset type with offline_id ${assetTypeId} to exist`);
4820
4823
  }
@@ -5534,7 +5537,7 @@ class ProjectService extends BaseApiService {
5534
5537
  async delete(projectId) {
5535
5538
  const { store } = this.client;
5536
5539
  const state = store.getState();
5537
- const projects = selectProjects(state);
5540
+ const projects = selectProjectMapping(state);
5538
5541
  const project = projects[projectId];
5539
5542
  if (!project) {
5540
5543
  throw new Error("Expected project to exist");
@@ -7864,7 +7867,7 @@ export {
7864
7867
  selectAssetTypeAttachment,
7865
7868
  selectAssetTypeAttachmentMapping,
7866
7869
  selectAssetTypeAttachments,
7867
- selectAssetTypeId,
7870
+ selectAssetTypeById,
7868
7871
  selectAssetTypeStagesMapping,
7869
7872
  selectAssetTypes,
7870
7873
  selectAssetTypesByIds,
@@ -7917,7 +7920,7 @@ export {
7917
7920
  selectFormOfAssetType,
7918
7921
  selectFormOfIssueType,
7919
7922
  selectFormRevisionAttachmentsMapping,
7920
- selectFormRevisionId,
7923
+ selectFormRevisionById,
7921
7924
  selectFormRevisionMapping,
7922
7925
  selectFormRevisions,
7923
7926
  selectFormRevisionsOfForm,
@@ -7976,7 +7979,7 @@ export {
7976
7979
  selectMainWorkspace,
7977
7980
  selectNumberOfAssetsOfAssetType,
7978
7981
  selectOrganization,
7979
- selectOrganizationAccess,
7982
+ selectOrganizationAccessById,
7980
7983
  selectOrganizationAccessForUser,
7981
7984
  selectOrganizationAccessUserMapping,
7982
7985
  selectOrganizationAccesses,
@@ -7998,9 +8001,9 @@ export {
7998
8001
  selectProjectFileById,
7999
8002
  selectProjectFileMapping,
8000
8003
  selectProjectFiles,
8004
+ selectProjectMapping,
8001
8005
  selectProjectUsersAsMapping,
8002
8006
  selectProjectUsersIds,
8003
- selectProjects,
8004
8007
  selectProjectsOfOrganization,
8005
8008
  selectProjectsWithAccess,
8006
8009
  selectRecentIssueIds,