@overmap-ai/core 1.0.65-filters.0 → 1.0.65-filters.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/constants/array.d.ts +1 -0
- package/dist/constants/index.d.ts +1 -0
- package/dist/overmap-core.js +97 -60
- package/dist/overmap-core.js.map +1 -1
- package/dist/overmap-core.umd.cjs +97 -60
- package/dist/overmap-core.umd.cjs.map +1 -1
- package/dist/store/slices/formRevisionAttachmentSlice.d.ts +1 -1
- package/dist/store/slices/projectSlice.d.ts +0 -1
- package/dist/store/slices/teamSlice.d.ts +2 -1
- package/dist/utils/optimization.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const EMPTY_ARRAY: any[];
|
package/dist/overmap-core.js
CHANGED
|
@@ -654,6 +654,11 @@ function boundsContainPoint(bounds, coordinates) {
|
|
|
654
654
|
return bounds[0][0] > coordinates[0] && bounds[1][0] < coordinates[0] && bounds[0][1] > coordinates[1] && bounds[1][1] < coordinates[1];
|
|
655
655
|
}
|
|
656
656
|
const emailRegex = /^.+@.+\..+$/;
|
|
657
|
+
const fullAssetMarkerSize = 45;
|
|
658
|
+
const DEFAULT_ISSUE_STATUS = IssueStatus.BACKLOG;
|
|
659
|
+
const DEFAULT_ISSUE_PRIORITY = IssuePriority.MEDIUM;
|
|
660
|
+
const OUTBOX_RETRY_DELAY = 5e3;
|
|
661
|
+
const EMPTY_ARRAY = Object.freeze([]);
|
|
657
662
|
let debug = false;
|
|
658
663
|
const REACT_APP_DEBUG_MEMOIZATION = {}.REACT_APP_DEBUG_MEMOIZATION || "";
|
|
659
664
|
if (["true", "1"].includes(REACT_APP_DEBUG_MEMOIZATION.toLowerCase())) {
|
|
@@ -716,6 +721,9 @@ function areArraysEqual(first, second) {
|
|
|
716
721
|
return true;
|
|
717
722
|
}
|
|
718
723
|
const genericMemo = React.memo;
|
|
724
|
+
const fallbackToEmptyArray = (array) => {
|
|
725
|
+
return array.length === 0 ? EMPTY_ARRAY : array;
|
|
726
|
+
};
|
|
719
727
|
const primaryColor = "#2D55E2";
|
|
720
728
|
const successColor = "#349C55";
|
|
721
729
|
const warningColor = "#FFA620";
|
|
@@ -890,7 +898,7 @@ const selectCategoriesByIds = restructureCreateSelectorWithArgs(
|
|
|
890
898
|
console.warn("selectCategoryByIds: No category exists with the id", categoryId);
|
|
891
899
|
}
|
|
892
900
|
}
|
|
893
|
-
return categories;
|
|
901
|
+
return fallbackToEmptyArray(categories);
|
|
894
902
|
}
|
|
895
903
|
)
|
|
896
904
|
);
|
|
@@ -938,8 +946,8 @@ const selectAssets = createSelector([selectAssetsMapping], (assetsMapping) => {
|
|
|
938
946
|
return Object.values(assetsMapping);
|
|
939
947
|
});
|
|
940
948
|
const selectAssetsOfAssetType = restructureCreateSelectorWithArgs(
|
|
941
|
-
createSelector([selectAssets, (_state, assetTypeId) => assetTypeId], (
|
|
942
|
-
return
|
|
949
|
+
createSelector([selectAssets, (_state, assetTypeId) => assetTypeId], (assets, assetTypeId) => {
|
|
950
|
+
return fallbackToEmptyArray(assets.filter((asset) => asset.asset_type === assetTypeId));
|
|
943
951
|
})
|
|
944
952
|
);
|
|
945
953
|
const selectAssetById = (assetId) => (state) => {
|
|
@@ -953,7 +961,7 @@ const selectAssetsByIds = restructureCreateSelectorWithArgs(
|
|
|
953
961
|
if (asset)
|
|
954
962
|
assets.push(asset);
|
|
955
963
|
}
|
|
956
|
-
return assets;
|
|
964
|
+
return fallbackToEmptyArray(assets);
|
|
957
965
|
})
|
|
958
966
|
);
|
|
959
967
|
const selectNumberOfAssetsOfAssetType = (assetTypeId) => (state) => {
|
|
@@ -1001,7 +1009,7 @@ const selectAttachmentsOfAsset = restructureCreateSelectorWithArgs(
|
|
|
1001
1009
|
createSelector(
|
|
1002
1010
|
[selectAssetAttachments, (_state, assetId) => assetId],
|
|
1003
1011
|
(attachments, assetId) => {
|
|
1004
|
-
return attachments.filter(({ asset }) => assetId === asset);
|
|
1012
|
+
return fallbackToEmptyArray(attachments.filter(({ asset }) => assetId === asset));
|
|
1005
1013
|
}
|
|
1006
1014
|
)
|
|
1007
1015
|
);
|
|
@@ -1096,11 +1104,9 @@ const assetStageSlice = createSlice({
|
|
|
1096
1104
|
}
|
|
1097
1105
|
});
|
|
1098
1106
|
const selectStageMapping = (state) => state.assetStageReducer.instances;
|
|
1099
|
-
const selectAssetStageById =
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
})
|
|
1103
|
-
);
|
|
1107
|
+
const selectAssetStageById = (id) => (state) => {
|
|
1108
|
+
return state.assetStageReducer.instances[id];
|
|
1109
|
+
};
|
|
1104
1110
|
const selectAssetStages = createSelector([selectStageMapping], (stageMapping) => {
|
|
1105
1111
|
return Object.values(stageMapping);
|
|
1106
1112
|
});
|
|
@@ -1135,7 +1141,9 @@ const selectAssetTypeStagesMapping = restructureCreateSelectorWithArgs(
|
|
|
1135
1141
|
);
|
|
1136
1142
|
const selectStagesOfAssetType = restructureCreateSelectorWithArgs(
|
|
1137
1143
|
createSelector([selectAssetStages, (_state, assetTypeId) => assetTypeId], (stages, assetTypeId) => {
|
|
1138
|
-
return
|
|
1144
|
+
return fallbackToEmptyArray(
|
|
1145
|
+
stages.filter((stage) => stage.asset_type === assetTypeId).sort((a, b) => a.priority - b.priority)
|
|
1146
|
+
);
|
|
1139
1147
|
})
|
|
1140
1148
|
);
|
|
1141
1149
|
const selectAssetStagesByIds = restructureCreateSelectorWithArgs(
|
|
@@ -1149,7 +1157,7 @@ const selectAssetStagesByIds = restructureCreateSelectorWithArgs(
|
|
|
1149
1157
|
console.warn("selectStagesFromStageIds: No stage exists with the id", stageId);
|
|
1150
1158
|
}
|
|
1151
1159
|
}
|
|
1152
|
-
return assetStages;
|
|
1160
|
+
return fallbackToEmptyArray(assetStages);
|
|
1153
1161
|
})
|
|
1154
1162
|
);
|
|
1155
1163
|
const selectStageFormIdsFromStageIds = restructureCreateSelectorWithArgs(
|
|
@@ -1203,7 +1211,7 @@ const selectAssetTypesByIds = restructureCreateSelectorWithArgs(
|
|
|
1203
1211
|
console.warn("selectAssetTypesByIds: No assetType exists with the id", assetTypeId);
|
|
1204
1212
|
}
|
|
1205
1213
|
}
|
|
1206
|
-
return assetTypes;
|
|
1214
|
+
return fallbackToEmptyArray(assetTypes);
|
|
1207
1215
|
}
|
|
1208
1216
|
)
|
|
1209
1217
|
);
|
|
@@ -1251,7 +1259,7 @@ const selectAttachmentsOfAssetType = restructureCreateSelectorWithArgs(
|
|
|
1251
1259
|
createSelector(
|
|
1252
1260
|
[selectAssetTypeAttachments, (_state, assetTypeId) => assetTypeId],
|
|
1253
1261
|
(attachments, assetTypeId) => {
|
|
1254
|
-
return attachments.filter(({ asset_type }) => assetTypeId === asset_type);
|
|
1262
|
+
return fallbackToEmptyArray(attachments.filter(({ asset_type }) => assetTypeId === asset_type));
|
|
1255
1263
|
}
|
|
1256
1264
|
)
|
|
1257
1265
|
);
|
|
@@ -1433,7 +1441,7 @@ const selectIssuesByIds = restructureCreateSelectorWithArgs(
|
|
|
1433
1441
|
console.warn("selectIssuesByIds: No issue exists with the id", issueId);
|
|
1434
1442
|
}
|
|
1435
1443
|
}
|
|
1436
|
-
return issues;
|
|
1444
|
+
return fallbackToEmptyArray(issues);
|
|
1437
1445
|
})
|
|
1438
1446
|
);
|
|
1439
1447
|
const selectRecentIssuesAsSearchResults = createSelector(
|
|
@@ -1516,7 +1524,7 @@ const selectIssueTypesOfOrganization = restructureCreateSelectorWithArgs(
|
|
|
1516
1524
|
createSelector(
|
|
1517
1525
|
[selectIssueTypes, (_, organizationId) => organizationId],
|
|
1518
1526
|
(issueTypes, organizationId) => {
|
|
1519
|
-
return issueTypes.filter((issueType) => issueType.organization === organizationId);
|
|
1527
|
+
return fallbackToEmptyArray(issueTypes.filter((issueType) => issueType.organization === organizationId));
|
|
1520
1528
|
}
|
|
1521
1529
|
)
|
|
1522
1530
|
);
|
|
@@ -1524,7 +1532,9 @@ const selectIssuesOfIssueType = restructureCreateSelectorWithArgs(
|
|
|
1524
1532
|
createSelector(
|
|
1525
1533
|
[(state) => state.issueReducer.instances, (_, issueTypeId) => issueTypeId],
|
|
1526
1534
|
(issuesMapping, issueTypeId) => {
|
|
1527
|
-
return
|
|
1535
|
+
return fallbackToEmptyArray(
|
|
1536
|
+
Object.values(issuesMapping).filter((issue) => issue.issue_type === issueTypeId)
|
|
1537
|
+
);
|
|
1528
1538
|
}
|
|
1529
1539
|
)
|
|
1530
1540
|
);
|
|
@@ -1703,7 +1713,7 @@ const selectUsersByIds = restructureCreateSelectorWithArgs(
|
|
|
1703
1713
|
console.warn("selectUsersByIds: No user exists with the id", userId);
|
|
1704
1714
|
}
|
|
1705
1715
|
}
|
|
1706
|
-
return users;
|
|
1716
|
+
return fallbackToEmptyArray(users);
|
|
1707
1717
|
})
|
|
1708
1718
|
);
|
|
1709
1719
|
const selectFavouriteProjects = (state) => state.userReducer.currentUser.profile.favourite_project_ids;
|
|
@@ -1770,7 +1780,9 @@ const selectLicense = (id) => (state) => state.licenseReducer.instances[id];
|
|
|
1770
1780
|
const selectLicenseForProject = (projectId) => (state) => Object.values(state.licenseReducer.instances).find((license) => license.project === projectId);
|
|
1771
1781
|
const selectActiveStatusLicenses = createSelector(
|
|
1772
1782
|
[selectLicenses],
|
|
1773
|
-
(licenses) =>
|
|
1783
|
+
(licenses) => {
|
|
1784
|
+
return fallbackToEmptyArray(Object.values(licenses).filter((license) => license.is_active));
|
|
1785
|
+
}
|
|
1774
1786
|
);
|
|
1775
1787
|
const selectLicensesForProjectsMapping = createSelector(
|
|
1776
1788
|
[selectLicenses],
|
|
@@ -1916,10 +1928,6 @@ const selectProjectUsersAsMapping = createSelector(
|
|
|
1916
1928
|
[selectProjectUsersIds, selectUsersMapping],
|
|
1917
1929
|
(projectUserIds, users) => projectUserIds.reduce((accum, userId) => ({ ...accum, [userId]: users[userId] }), {})
|
|
1918
1930
|
);
|
|
1919
|
-
const selectProjectsWithAccess = createSelector(
|
|
1920
|
-
[selectProjectMapping],
|
|
1921
|
-
(projects) => Object.values(projects).filter((project) => !project.invited)
|
|
1922
|
-
);
|
|
1923
1931
|
const selectSortedProjectUsers = createSelector(
|
|
1924
1932
|
[selectCurrentUser, selectProjectUsersAsMapping, selectProjectAccessUserMapping],
|
|
1925
1933
|
(currentUser, userMapping, projectAccessMapping) => {
|
|
@@ -1968,7 +1976,11 @@ const selectOrganizationById = (id) => (state) => {
|
|
|
1968
1976
|
};
|
|
1969
1977
|
const selectOrganizationsWithAccess = createSelector(
|
|
1970
1978
|
[selectOrganizations],
|
|
1971
|
-
(organizations) =>
|
|
1979
|
+
(organizations) => {
|
|
1980
|
+
return fallbackToEmptyArray(
|
|
1981
|
+
Object.values(organizations).filter((organization) => organization.has_access)
|
|
1982
|
+
);
|
|
1983
|
+
}
|
|
1972
1984
|
);
|
|
1973
1985
|
const selectOrganizationUsersIds = createSelector(
|
|
1974
1986
|
[selectOrganizationAccesses],
|
|
@@ -1978,13 +1990,17 @@ const selectProjectsOfOrganization = restructureCreateSelectorWithArgs(
|
|
|
1978
1990
|
createSelector(
|
|
1979
1991
|
[selectProjectMapping, (_, organizationId) => organizationId],
|
|
1980
1992
|
(projects, organizationId) => {
|
|
1981
|
-
return
|
|
1993
|
+
return fallbackToEmptyArray(
|
|
1994
|
+
Object.values(projects).filter((project) => project.organization_owner === organizationId)
|
|
1995
|
+
);
|
|
1982
1996
|
}
|
|
1983
1997
|
)
|
|
1984
1998
|
);
|
|
1985
1999
|
const selectLicensesOfOrganization = restructureCreateSelectorWithArgs(
|
|
1986
2000
|
createSelector([selectLicenses, (_, organizationId) => organizationId], (licenses, organizationId) => {
|
|
1987
|
-
return
|
|
2001
|
+
return fallbackToEmptyArray(
|
|
2002
|
+
Object.values(licenses).filter((license) => license.organization_owner === organizationId)
|
|
2003
|
+
);
|
|
1988
2004
|
})
|
|
1989
2005
|
);
|
|
1990
2006
|
const selectOrganizationUsersAsMapping = createSelector(
|
|
@@ -2152,7 +2168,9 @@ const selectProjectFileMapping = (state) => state.projectFileReducer.projectFile
|
|
|
2152
2168
|
const selectProjectFiles = createSelector(
|
|
2153
2169
|
[selectProjectFileMapping, selectActiveProjectId],
|
|
2154
2170
|
(mapping, activeProjectId) => {
|
|
2155
|
-
return
|
|
2171
|
+
return fallbackToEmptyArray(
|
|
2172
|
+
Object.values(mapping).filter((file) => file.project === activeProjectId).sort((a, b) => a.z_index - b.z_index)
|
|
2173
|
+
);
|
|
2156
2174
|
}
|
|
2157
2175
|
);
|
|
2158
2176
|
const selectActiveProjectFileId = (state) => state.projectFileReducer.activeProjectFileId;
|
|
@@ -2200,7 +2218,7 @@ const selectProjectAttachmentById = (id) => (state) => {
|
|
|
2200
2218
|
};
|
|
2201
2219
|
const selectAttachmentsOfProject = restructureCreateSelectorWithArgs(
|
|
2202
2220
|
createSelector([selectAllProjectAttachments, (_, projectId) => projectId], (attachments, projectId) => {
|
|
2203
|
-
return attachments.filter(({ project }) => projectId === project);
|
|
2221
|
+
return fallbackToEmptyArray(attachments.filter(({ project }) => projectId === project));
|
|
2204
2222
|
})
|
|
2205
2223
|
);
|
|
2206
2224
|
const selectAttachmentsOfProjectByType = restructureCreateSelectorWithArgs(
|
|
@@ -2310,9 +2328,7 @@ const selectFormRevisionsOfForm = restructureCreateSelectorWithArgs(
|
|
|
2310
2328
|
createSelector(
|
|
2311
2329
|
[selectFormRevisions, (_state, formId) => formId],
|
|
2312
2330
|
(revisions, formId) => {
|
|
2313
|
-
return revisions.filter((revision) =>
|
|
2314
|
-
return revision.form === formId;
|
|
2315
|
-
});
|
|
2331
|
+
return fallbackToEmptyArray(revisions.filter((revision) => revision.form === formId));
|
|
2316
2332
|
}
|
|
2317
2333
|
)
|
|
2318
2334
|
);
|
|
@@ -2467,13 +2483,9 @@ const selectFormSubmissionsOfForm = restructureCreateSelectorWithArgs(
|
|
|
2467
2483
|
continue;
|
|
2468
2484
|
revisionIds.add(revision.offline_id);
|
|
2469
2485
|
}
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
continue;
|
|
2474
|
-
submissions.push(submission);
|
|
2475
|
-
}
|
|
2476
|
-
return submissions;
|
|
2486
|
+
return Object.values(submissionsMapping).filter(
|
|
2487
|
+
(submission) => revisionIds.has(submission.form_revision)
|
|
2488
|
+
);
|
|
2477
2489
|
}
|
|
2478
2490
|
)
|
|
2479
2491
|
);
|
|
@@ -2669,7 +2681,9 @@ const selectFormSubmissionAttachemntsByIds = restructureCreateSelectorWithArgs(
|
|
|
2669
2681
|
[selectFormSubmissionAttachmentsMapping, (_, attachmentIds) => attachmentIds],
|
|
2670
2682
|
(mapping, attachmentIds) => {
|
|
2671
2683
|
const attachmentIdsSet = new Set(attachmentIds);
|
|
2672
|
-
return
|
|
2684
|
+
return fallbackToEmptyArray(
|
|
2685
|
+
Object.values(mapping).filter((attachment) => attachmentIdsSet.has(attachment.offline_id))
|
|
2686
|
+
);
|
|
2673
2687
|
}
|
|
2674
2688
|
)
|
|
2675
2689
|
);
|
|
@@ -2677,7 +2691,9 @@ const selectAttachmentsOfFormSubmission = restructureCreateSelectorWithArgs(
|
|
|
2677
2691
|
createSelector(
|
|
2678
2692
|
[selectFormSubmissionAttachmentsMapping, (_state, submissionId) => submissionId],
|
|
2679
2693
|
(attachmentsMapping, submissionId) => {
|
|
2680
|
-
return
|
|
2694
|
+
return fallbackToEmptyArray(
|
|
2695
|
+
Object.values(attachmentsMapping).filter((attachment) => attachment.submission === submissionId)
|
|
2696
|
+
);
|
|
2681
2697
|
}
|
|
2682
2698
|
)
|
|
2683
2699
|
);
|
|
@@ -2720,7 +2736,9 @@ const selectAttachmentsOfFormRevision = restructureCreateSelectorWithArgs(
|
|
|
2720
2736
|
createSelector(
|
|
2721
2737
|
[selectFormRevisionAttachmentsMapping, (_state, revisionId) => revisionId],
|
|
2722
2738
|
(attachments, revisionId) => {
|
|
2723
|
-
return
|
|
2739
|
+
return fallbackToEmptyArray(
|
|
2740
|
+
Object.values(attachments).filter((attachment) => attachment.revision === revisionId)
|
|
2741
|
+
);
|
|
2724
2742
|
}
|
|
2725
2743
|
)
|
|
2726
2744
|
);
|
|
@@ -2743,7 +2761,9 @@ const selectEmailDomainsOfOrganization = restructureCreateSelectorWithArgs(
|
|
|
2743
2761
|
createSelector(
|
|
2744
2762
|
[selectEmailDomains, (_, organizationId) => organizationId],
|
|
2745
2763
|
(emailDomains, organizationId) => {
|
|
2746
|
-
return
|
|
2764
|
+
return fallbackToEmptyArray(
|
|
2765
|
+
emailDomains.filter((emailDomain) => emailDomain.organization === organizationId)
|
|
2766
|
+
);
|
|
2747
2767
|
}
|
|
2748
2768
|
)
|
|
2749
2769
|
);
|
|
@@ -2920,7 +2940,7 @@ const selectDocumentsByIds = restructureCreateSelectorWithArgs(
|
|
|
2920
2940
|
console.warn("selectDocumentByIds: No document exists with the id", documentId);
|
|
2921
2941
|
}
|
|
2922
2942
|
}
|
|
2923
|
-
return documents;
|
|
2943
|
+
return fallbackToEmptyArray(documents);
|
|
2924
2944
|
}
|
|
2925
2945
|
)
|
|
2926
2946
|
);
|
|
@@ -2935,12 +2955,12 @@ const selectAncestorIdsOfDocument = restructureCreateSelectorWithArgs(
|
|
|
2935
2955
|
listOfAncestors.push(currentAncestor.offline_id);
|
|
2936
2956
|
currentAncestor = mapping[currentAncestor.parent_document ?? ""];
|
|
2937
2957
|
}
|
|
2938
|
-
return listOfAncestors;
|
|
2958
|
+
return fallbackToEmptyArray(listOfAncestors);
|
|
2939
2959
|
})
|
|
2940
2960
|
);
|
|
2941
2961
|
const selectRootDocuments = createSelector(
|
|
2942
2962
|
[selectDocuments],
|
|
2943
|
-
(documents) => documents.filter((document2) => !document2.parent_document)
|
|
2963
|
+
(documents) => fallbackToEmptyArray(documents.filter((document2) => !document2.parent_document))
|
|
2944
2964
|
);
|
|
2945
2965
|
const documentsReducer = documentSlice.reducer;
|
|
2946
2966
|
const documentAttachmentAdapter = createModelAdapter((attachment) => attachment.offline_id);
|
|
@@ -2984,7 +3004,7 @@ const selectAttachmentsOfDocument = restructureCreateSelectorWithArgs(
|
|
|
2984
3004
|
createSelector(
|
|
2985
3005
|
[selectAllDocumentAttachments, (_state, documentId) => documentId],
|
|
2986
3006
|
(attachments, documentId) => {
|
|
2987
|
-
return attachments.filter(({ document: document2 }) => documentId === document2);
|
|
3007
|
+
return fallbackToEmptyArray(attachments.filter(({ document: document2 }) => documentId === document2));
|
|
2988
3008
|
}
|
|
2989
3009
|
)
|
|
2990
3010
|
);
|
|
@@ -3028,17 +3048,34 @@ const selectTeams = createSelector([selectTeamsMapping], (teams) => {
|
|
|
3028
3048
|
const selectTeamById = (id) => (state) => {
|
|
3029
3049
|
return state.teamReducer.instances[id];
|
|
3030
3050
|
};
|
|
3051
|
+
const selectTeamsByIds = restructureCreateSelectorWithArgs(
|
|
3052
|
+
createSelector(
|
|
3053
|
+
[selectTeamsMapping, (_state, teamIds) => teamIds],
|
|
3054
|
+
(mapping, teamIds) => {
|
|
3055
|
+
const teams = [];
|
|
3056
|
+
for (const teamId of teamIds) {
|
|
3057
|
+
const team = mapping[teamId];
|
|
3058
|
+
if (team) {
|
|
3059
|
+
teams.push(team);
|
|
3060
|
+
} else {
|
|
3061
|
+
console.warn("selectTeamsByIds: No team exists with the id", teamId);
|
|
3062
|
+
}
|
|
3063
|
+
}
|
|
3064
|
+
return fallbackToEmptyArray(teams);
|
|
3065
|
+
}
|
|
3066
|
+
)
|
|
3067
|
+
);
|
|
3031
3068
|
const selectTeamsOfOrganization = restructureCreateSelectorWithArgs(
|
|
3032
3069
|
createSelector(
|
|
3033
3070
|
[selectTeams, (_state, organizationId) => organizationId],
|
|
3034
3071
|
(teams, organizationId) => {
|
|
3035
|
-
return teams.filter((team) => team.organization === organizationId);
|
|
3072
|
+
return fallbackToEmptyArray(teams.filter((team) => team.organization === organizationId));
|
|
3036
3073
|
}
|
|
3037
3074
|
)
|
|
3038
3075
|
);
|
|
3039
3076
|
const selectTeamsOfUser = restructureCreateSelectorWithArgs(
|
|
3040
3077
|
createSelector([selectTeams, (_state, userId) => userId], (teams, userId) => {
|
|
3041
|
-
return teams.filter((team) => team.members.includes(userId));
|
|
3078
|
+
return fallbackToEmptyArray(teams.filter((team) => team.members.includes(userId)));
|
|
3042
3079
|
})
|
|
3043
3080
|
);
|
|
3044
3081
|
const teamReducer = teamSlice.reducer;
|
|
@@ -3098,7 +3135,7 @@ const selectCommentsOfIssue = restructureCreateSelectorWithArgs(
|
|
|
3098
3135
|
createSelector(
|
|
3099
3136
|
[selectIssueCommentMapping, (_state, issueId) => issueId],
|
|
3100
3137
|
(commentMapping, issueId) => {
|
|
3101
|
-
return Object.values(commentMapping).filter((comment) => comment.issue === issueId);
|
|
3138
|
+
return fallbackToEmptyArray(Object.values(commentMapping).filter((comment) => comment.issue === issueId));
|
|
3102
3139
|
}
|
|
3103
3140
|
)
|
|
3104
3141
|
);
|
|
@@ -3131,7 +3168,7 @@ const selectIssueUpdatesOfIssue = restructureCreateSelectorWithArgs(
|
|
|
3131
3168
|
createSelector(
|
|
3132
3169
|
[selectIssueUpdateMapping, (_state, issueId) => issueId],
|
|
3133
3170
|
(updates, issueId) => {
|
|
3134
|
-
return Object.values(updates).filter((update) => update.issue === issueId);
|
|
3171
|
+
return fallbackToEmptyArray(Object.values(updates).filter((update) => update.issue === issueId));
|
|
3135
3172
|
}
|
|
3136
3173
|
)
|
|
3137
3174
|
);
|
|
@@ -3174,7 +3211,7 @@ const selectAttachmentsOfIssue = restructureCreateSelectorWithArgs(
|
|
|
3174
3211
|
createSelector(
|
|
3175
3212
|
[selectIssueAttachments, (_state, issueId) => issueId],
|
|
3176
3213
|
(attachments, issueId) => {
|
|
3177
|
-
return attachments.filter(({ issue }) => issueId === issue);
|
|
3214
|
+
return fallbackToEmptyArray(attachments.filter(({ issue }) => issueId === issue));
|
|
3178
3215
|
}
|
|
3179
3216
|
)
|
|
3180
3217
|
);
|
|
@@ -3248,7 +3285,7 @@ const selectGeoImageById = (id) => (state) => {
|
|
|
3248
3285
|
};
|
|
3249
3286
|
const selectGeoImagesOfProject = restructureCreateSelectorWithArgs(
|
|
3250
3287
|
createSelector([selectGeoImages, (_, projectId) => projectId], (mapImages, projectId) => {
|
|
3251
|
-
return mapImages.filter((mapImage) => mapImage.project === projectId);
|
|
3288
|
+
return fallbackToEmptyArray(mapImages.filter((mapImage) => mapImage.project === projectId));
|
|
3252
3289
|
})
|
|
3253
3290
|
);
|
|
3254
3291
|
const geoImageReducer = geoImageSlice.reducer;
|
|
@@ -3292,7 +3329,9 @@ const selectIssueAssociationsToIssue = restructureCreateSelectorWithArgs(
|
|
|
3292
3329
|
createSelector(
|
|
3293
3330
|
[selectIssueAssociationMapping, (_state, issueId) => issueId],
|
|
3294
3331
|
(associationMapping, issueId) => {
|
|
3295
|
-
return
|
|
3332
|
+
return fallbackToEmptyArray(
|
|
3333
|
+
Object.values(associationMapping).filter((assoc) => assoc.associated_issue === issueId)
|
|
3334
|
+
);
|
|
3296
3335
|
}
|
|
3297
3336
|
)
|
|
3298
3337
|
);
|
|
@@ -3300,7 +3339,7 @@ const selectIssueAssociationsOfIssue = restructureCreateSelectorWithArgs(
|
|
|
3300
3339
|
createSelector(
|
|
3301
3340
|
[selectIssueAssociationMapping, (_state, issueId) => issueId],
|
|
3302
3341
|
(associationMapping, issueId) => {
|
|
3303
|
-
return Object.values(associationMapping).filter((assoc) => assoc.issue === issueId);
|
|
3342
|
+
return fallbackToEmptyArray(Object.values(associationMapping).filter((assoc) => assoc.issue === issueId));
|
|
3304
3343
|
}
|
|
3305
3344
|
)
|
|
3306
3345
|
);
|
|
@@ -3308,15 +3347,11 @@ const selectIssueAssociationsOfAsset = restructureCreateSelectorWithArgs(
|
|
|
3308
3347
|
createSelector(
|
|
3309
3348
|
[selectIssueAssociationMapping, (_state, assetId) => assetId],
|
|
3310
3349
|
(associationMapping, assetId) => {
|
|
3311
|
-
return Object.values(associationMapping).filter((assoc) => assoc.asset === assetId);
|
|
3350
|
+
return fallbackToEmptyArray(Object.values(associationMapping).filter((assoc) => assoc.asset === assetId));
|
|
3312
3351
|
}
|
|
3313
3352
|
)
|
|
3314
3353
|
);
|
|
3315
3354
|
const issueAssociationReducer = issueAssociationSlice.reducer;
|
|
3316
|
-
const fullAssetMarkerSize = 45;
|
|
3317
|
-
const DEFAULT_ISSUE_STATUS = IssueStatus.BACKLOG;
|
|
3318
|
-
const DEFAULT_ISSUE_PRIORITY = IssuePriority.MEDIUM;
|
|
3319
|
-
const OUTBOX_RETRY_DELAY = 5e3;
|
|
3320
3355
|
let clientStore;
|
|
3321
3356
|
function setClientStore(store) {
|
|
3322
3357
|
clientStore = store;
|
|
@@ -7516,6 +7551,7 @@ export {
|
|
|
7516
7551
|
DeferredPromise,
|
|
7517
7552
|
DocumentAttachmentService,
|
|
7518
7553
|
DocumentService,
|
|
7554
|
+
EMPTY_ARRAY,
|
|
7519
7555
|
EmailDomainsService,
|
|
7520
7556
|
EmailVerificationService,
|
|
7521
7557
|
FileService,
|
|
@@ -7696,6 +7732,7 @@ export {
|
|
|
7696
7732
|
enqueue,
|
|
7697
7733
|
enqueueRequest,
|
|
7698
7734
|
errorColor,
|
|
7735
|
+
fallbackToEmptyArray,
|
|
7699
7736
|
fileReducer,
|
|
7700
7737
|
fileSlice,
|
|
7701
7738
|
fileToBlob,
|
|
@@ -7970,7 +8007,6 @@ export {
|
|
|
7970
8007
|
selectProjectUsersAsMapping,
|
|
7971
8008
|
selectProjectUsersIds,
|
|
7972
8009
|
selectProjectsOfOrganization,
|
|
7973
|
-
selectProjectsWithAccess,
|
|
7974
8010
|
selectRecentIssueIds,
|
|
7975
8011
|
selectRecentIssuesAsSearchResults,
|
|
7976
8012
|
selectRehydrated,
|
|
@@ -7984,6 +8020,7 @@ export {
|
|
|
7984
8020
|
selectStagesOfAssetType,
|
|
7985
8021
|
selectTeamById,
|
|
7986
8022
|
selectTeams,
|
|
8023
|
+
selectTeamsByIds,
|
|
7987
8024
|
selectTeamsMapping,
|
|
7988
8025
|
selectTeamsOfOrganization,
|
|
7989
8026
|
selectTeamsOfUser,
|