@overmap-ai/core 1.0.63-minor-improvements.0 → 1.0.63-org-doc-improvements.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.
- package/dist/overmap-core.js +281 -130
- package/dist/overmap-core.js.map +1 -1
- package/dist/overmap-core.umd.cjs +281 -130
- package/dist/overmap-core.umd.cjs.map +1 -1
- package/dist/sdk/services/DocumentService.d.ts +1 -1
- package/dist/sdk/services/IssueAssociationService.d.ts +9 -0
- package/dist/sdk/services/index.d.ts +1 -0
- package/dist/store/slices/documentSlice.d.ts +3 -311
- package/dist/store/slices/index.d.ts +1 -0
- package/dist/store/slices/issueAssociationSlice.d.ts +49 -0
- package/dist/store/store.d.ts +3 -2
- package/dist/typings/models/base.d.ts +3 -3
- package/dist/typings/models/documents.d.ts +6 -16
- package/dist/typings/models/issues.d.ts +13 -9
- package/dist/typings/models/projects.d.ts +2 -2
- package/dist/typings/models/store.d.ts +2 -1
- package/package.json +1 -1
package/dist/overmap-core.js
CHANGED
|
@@ -379,15 +379,15 @@ const wrapMigration = (migrator) => (state) => {
|
|
|
379
379
|
};
|
|
380
380
|
const migrations = [initialVersioning, signOut, signOut, createOutboxState];
|
|
381
381
|
const manifest = Object.fromEntries(migrations.map((migration2, i) => [i, wrapMigration(migration2)]));
|
|
382
|
-
const initialState$
|
|
382
|
+
const initialState$C = {
|
|
383
383
|
accessToken: "",
|
|
384
384
|
refreshToken: "",
|
|
385
385
|
isLoggedIn: false
|
|
386
386
|
};
|
|
387
387
|
const authSlice = createSlice({
|
|
388
388
|
name: "auth",
|
|
389
|
-
initialState: initialState$
|
|
390
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
389
|
+
initialState: initialState$C,
|
|
390
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$C)),
|
|
391
391
|
reducers: {
|
|
392
392
|
setTokens: (state, action) => {
|
|
393
393
|
state.accessToken = action.payload.accessToken;
|
|
@@ -857,11 +857,11 @@ function createModelAdapter(computeModelId) {
|
|
|
857
857
|
};
|
|
858
858
|
}
|
|
859
859
|
const categoryAdapter = createModelAdapter((category) => category.offline_id);
|
|
860
|
-
const initialState$
|
|
860
|
+
const initialState$B = categoryAdapter.getInitialState({});
|
|
861
861
|
const categorySlice = createSlice({
|
|
862
862
|
name: "categories",
|
|
863
|
-
initialState: initialState$
|
|
864
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
863
|
+
initialState: initialState$B,
|
|
864
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$B)),
|
|
865
865
|
reducers: {
|
|
866
866
|
initializeCategories: categoryAdapter.initialize,
|
|
867
867
|
addCategory: categoryAdapter.addOne,
|
|
@@ -891,11 +891,11 @@ const selectIssueCountOfCategory = (categoryId) => (state) => {
|
|
|
891
891
|
};
|
|
892
892
|
const categoryReducer = categorySlice.reducer;
|
|
893
893
|
const assetTypeAdapter = createModelAdapter((assetType) => assetType.offline_id);
|
|
894
|
-
const initialState$
|
|
894
|
+
const initialState$A = assetTypeAdapter.getInitialState({});
|
|
895
895
|
const assetTypeSlice = createSlice({
|
|
896
896
|
name: "assetTypes",
|
|
897
|
-
initialState: initialState$
|
|
898
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
897
|
+
initialState: initialState$A,
|
|
898
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$A)),
|
|
899
899
|
reducers: {
|
|
900
900
|
initializeAssetTypes: assetTypeAdapter.initialize,
|
|
901
901
|
addAssetType: assetTypeAdapter.addOne,
|
|
@@ -940,11 +940,11 @@ const selectAssetTypesByName = restructureCreateSelectorWithArgs(
|
|
|
940
940
|
);
|
|
941
941
|
const assetTypeReducer = assetTypeSlice.reducer;
|
|
942
942
|
const assetAdapter = createModelAdapter((asset) => asset.offline_id);
|
|
943
|
-
const initialState$
|
|
943
|
+
const initialState$z = assetAdapter.getInitialState({});
|
|
944
944
|
const assetSlice = createSlice({
|
|
945
945
|
name: "assets",
|
|
946
|
-
initialState: initialState$
|
|
947
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
946
|
+
initialState: initialState$z,
|
|
947
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$z)),
|
|
948
948
|
reducers: {
|
|
949
949
|
initializeAssets: (state, action) => {
|
|
950
950
|
assetAdapter.initialize(state, action);
|
|
@@ -1047,11 +1047,11 @@ const selectAssetTypesFromIds = (assetTypeIds) => (state) => {
|
|
|
1047
1047
|
};
|
|
1048
1048
|
const assetReducer = assetSlice.reducer;
|
|
1049
1049
|
const assetAttachmentAdapter = createModelAdapter((attachment) => attachment.offline_id);
|
|
1050
|
-
const initialState$
|
|
1050
|
+
const initialState$y = assetAttachmentAdapter.getInitialState({});
|
|
1051
1051
|
const assetAttachmentSlice = createSlice({
|
|
1052
1052
|
name: "assetAttachments",
|
|
1053
|
-
initialState: initialState$
|
|
1054
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1053
|
+
initialState: initialState$y,
|
|
1054
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$y)),
|
|
1055
1055
|
reducers: {
|
|
1056
1056
|
initializeAssetAttachments: assetAttachmentAdapter.initialize,
|
|
1057
1057
|
addAssetAttachment: assetAttachmentAdapter.addOne,
|
|
@@ -1109,13 +1109,13 @@ const selectAttachmentsOfAssetByType = restructureCreateSelectorWithArgs(
|
|
|
1109
1109
|
)
|
|
1110
1110
|
);
|
|
1111
1111
|
const assetAttachmentReducer = assetAttachmentSlice.reducer;
|
|
1112
|
-
const initialState$
|
|
1112
|
+
const initialState$x = {
|
|
1113
1113
|
completionsByAssetId: {}
|
|
1114
1114
|
};
|
|
1115
1115
|
const assetStageCompletionSlice = createSlice({
|
|
1116
1116
|
name: "assetStageCompletions",
|
|
1117
|
-
initialState: initialState$
|
|
1118
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1117
|
+
initialState: initialState$x,
|
|
1118
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$x)),
|
|
1119
1119
|
reducers: {
|
|
1120
1120
|
addStageCompletion: (state, action) => {
|
|
1121
1121
|
let stageToCompletionDateMapping = state.completionsByAssetId[action.payload.asset];
|
|
@@ -1167,11 +1167,11 @@ const selectCompletedStageIdsForAsset = restructureCreateSelectorWithArgs(
|
|
|
1167
1167
|
);
|
|
1168
1168
|
const assetStageCompletionReducer = assetStageCompletionSlice.reducer;
|
|
1169
1169
|
const assetStageAdapter = createModelAdapter((assetStage) => assetStage.offline_id);
|
|
1170
|
-
const initialState$
|
|
1170
|
+
const initialState$w = assetStageAdapter.getInitialState({});
|
|
1171
1171
|
const assetStageSlice = createSlice({
|
|
1172
1172
|
name: "assetStages",
|
|
1173
|
-
initialState: initialState$
|
|
1174
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1173
|
+
initialState: initialState$w,
|
|
1174
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$w)),
|
|
1175
1175
|
reducers: {
|
|
1176
1176
|
initializeStages: assetStageAdapter.initialize,
|
|
1177
1177
|
setStage: assetStageAdapter.setOne,
|
|
@@ -1252,11 +1252,11 @@ const assetStageReducer = assetStageSlice.reducer;
|
|
|
1252
1252
|
const assetTypeAttachmentAdapter = createModelAdapter(
|
|
1253
1253
|
(attachment) => attachment.offline_id
|
|
1254
1254
|
);
|
|
1255
|
-
const initialState$
|
|
1255
|
+
const initialState$v = assetTypeAttachmentAdapter.getInitialState({});
|
|
1256
1256
|
const assetTypeAttachmentSlice = createSlice({
|
|
1257
1257
|
name: "assetTypeAttachments",
|
|
1258
|
-
initialState: initialState$
|
|
1259
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1258
|
+
initialState: initialState$v,
|
|
1259
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$v)),
|
|
1260
1260
|
reducers: {
|
|
1261
1261
|
initializeAssetTypeAttachments: assetTypeAttachmentAdapter.initialize,
|
|
1262
1262
|
addAssetTypeAttachment: assetTypeAttachmentAdapter.addOne,
|
|
@@ -1315,10 +1315,10 @@ const selectAttachmentsOfAssetTypeByType = restructureCreateSelectorWithArgs(
|
|
|
1315
1315
|
);
|
|
1316
1316
|
const assetTypeAttachmentReducer = assetTypeAttachmentSlice.reducer;
|
|
1317
1317
|
const workspaceAdapter = createModelAdapter((workspace) => workspace.offline_id);
|
|
1318
|
-
const initialState$
|
|
1318
|
+
const initialState$u = workspaceAdapter.getInitialState({});
|
|
1319
1319
|
const workspaceSlice = createSlice({
|
|
1320
1320
|
name: "workspace",
|
|
1321
|
-
initialState: initialState$
|
|
1321
|
+
initialState: initialState$u,
|
|
1322
1322
|
reducers: {
|
|
1323
1323
|
initializeWorkspaces: workspaceAdapter.initialize,
|
|
1324
1324
|
setWorkspaces: workspaceAdapter.setMany,
|
|
@@ -1350,14 +1350,14 @@ const selectPermittedWorkspaceIds = createSelector(
|
|
|
1350
1350
|
const workspaceReducer = workspaceSlice.reducer;
|
|
1351
1351
|
const maxRecentIssues = 10;
|
|
1352
1352
|
const issueAdapter = createModelAdapter((issue) => issue.offline_id);
|
|
1353
|
-
const initialState$
|
|
1353
|
+
const initialState$t = issueAdapter.getInitialState({
|
|
1354
1354
|
recentIssueIds: []
|
|
1355
1355
|
});
|
|
1356
1356
|
const issueSlice = createSlice({
|
|
1357
1357
|
name: "issues",
|
|
1358
|
-
initialState: initialState$
|
|
1358
|
+
initialState: initialState$t,
|
|
1359
1359
|
extraReducers: (builder) => builder.addCase("RESET", (state) => {
|
|
1360
|
-
Object.assign(state, initialState$
|
|
1360
|
+
Object.assign(state, initialState$t);
|
|
1361
1361
|
}),
|
|
1362
1362
|
reducers: {
|
|
1363
1363
|
initializeIssues: issueAdapter.initialize,
|
|
@@ -1501,12 +1501,12 @@ const selectRecentIssuesAsSearchResults = createSelector(
|
|
|
1501
1501
|
);
|
|
1502
1502
|
const issueReducer = issueSlice.reducer;
|
|
1503
1503
|
const issueTypeAdapter = createModelAdapter((issueType) => issueType.offline_id);
|
|
1504
|
-
const initialState$
|
|
1504
|
+
const initialState$s = issueTypeAdapter.getInitialState({});
|
|
1505
1505
|
const issueTypeSlice = createSlice({
|
|
1506
1506
|
name: "issueTypes",
|
|
1507
|
-
initialState: initialState$
|
|
1507
|
+
initialState: initialState$s,
|
|
1508
1508
|
extraReducers: (builder) => builder.addCase("RESET", (state) => {
|
|
1509
|
-
Object.assign(state, initialState$
|
|
1509
|
+
Object.assign(state, initialState$s);
|
|
1510
1510
|
}),
|
|
1511
1511
|
reducers: {
|
|
1512
1512
|
initializeIssueTypes: issueTypeAdapter.initialize,
|
|
@@ -1555,15 +1555,15 @@ const selectIssuesOfIssueTypeCount = (issueTypeId) => (state) => {
|
|
|
1555
1555
|
return ((_a2 = selectIssuesOfIssueType(issueTypeId)(state)) == null ? void 0 : _a2.length) ?? 0;
|
|
1556
1556
|
};
|
|
1557
1557
|
const issueTypeReducer = issueTypeSlice.reducer;
|
|
1558
|
-
const initialState$
|
|
1558
|
+
const initialState$r = {
|
|
1559
1559
|
s3Urls: {}
|
|
1560
1560
|
};
|
|
1561
1561
|
const msPerHour = 1e3 * 60 * 60;
|
|
1562
1562
|
const msPerWeek = msPerHour * 24 * 7;
|
|
1563
1563
|
const fileSlice = createSlice({
|
|
1564
1564
|
name: "file",
|
|
1565
|
-
initialState: initialState$
|
|
1566
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1565
|
+
initialState: initialState$r,
|
|
1566
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$r)),
|
|
1567
1567
|
reducers: {
|
|
1568
1568
|
setUploadUrl: (state, action) => {
|
|
1569
1569
|
const { url, fields, sha1 } = action.payload;
|
|
@@ -1644,7 +1644,7 @@ var LicenseStatus = /* @__PURE__ */ ((LicenseStatus2) => {
|
|
|
1644
1644
|
LicenseStatus2[LicenseStatus2["PAST_DUE"] = 8] = "PAST_DUE";
|
|
1645
1645
|
return LicenseStatus2;
|
|
1646
1646
|
})(LicenseStatus || {});
|
|
1647
|
-
const initialState$
|
|
1647
|
+
const initialState$q = {
|
|
1648
1648
|
users: {},
|
|
1649
1649
|
currentUser: {
|
|
1650
1650
|
id: 0,
|
|
@@ -1655,8 +1655,8 @@ const initialState$p = {
|
|
|
1655
1655
|
};
|
|
1656
1656
|
const userSlice = createSlice({
|
|
1657
1657
|
name: "users",
|
|
1658
|
-
initialState: initialState$
|
|
1659
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1658
|
+
initialState: initialState$q,
|
|
1659
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$q)),
|
|
1660
1660
|
reducers: {
|
|
1661
1661
|
setUsers: (state, action) => {
|
|
1662
1662
|
const usersMapping = {};
|
|
@@ -1721,11 +1721,11 @@ const userReducer = userSlice.reducer;
|
|
|
1721
1721
|
const organizationAccessAdapter = createModelAdapter(
|
|
1722
1722
|
(organizationAccess) => organizationAccess.offline_id
|
|
1723
1723
|
);
|
|
1724
|
-
const initialState$
|
|
1724
|
+
const initialState$p = organizationAccessAdapter.getInitialState({});
|
|
1725
1725
|
const organizationAccessSlice = createSlice({
|
|
1726
1726
|
name: "organizationAccess",
|
|
1727
|
-
initialState: initialState$
|
|
1728
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1727
|
+
initialState: initialState$p,
|
|
1728
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$p)),
|
|
1729
1729
|
reducers: {
|
|
1730
1730
|
initializeOrganizationAccesses: organizationAccessAdapter.initialize,
|
|
1731
1731
|
updateOrganizationAccess: organizationAccessAdapter.updateOne,
|
|
@@ -1762,11 +1762,11 @@ const selectOrganizationAccessUserMapping = (state) => {
|
|
|
1762
1762
|
};
|
|
1763
1763
|
const organizationAccessReducer = organizationAccessSlice.reducer;
|
|
1764
1764
|
const licenseAdapter = createModelAdapter((license) => license.offline_id);
|
|
1765
|
-
const initialState$
|
|
1765
|
+
const initialState$o = licenseAdapter.getInitialState({});
|
|
1766
1766
|
const licenseSlice = createSlice({
|
|
1767
1767
|
name: "license",
|
|
1768
|
-
initialState: initialState$
|
|
1769
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1768
|
+
initialState: initialState$o,
|
|
1769
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$o)),
|
|
1770
1770
|
reducers: {
|
|
1771
1771
|
initializeLicences: licenseAdapter.initialize,
|
|
1772
1772
|
addLicenses: licenseAdapter.addMany,
|
|
@@ -1792,11 +1792,11 @@ const selectLicensesForProjectsMapping = createSelector(
|
|
|
1792
1792
|
);
|
|
1793
1793
|
const licenseReducer = licenseSlice.reducer;
|
|
1794
1794
|
const projectAccessAdapter = createModelAdapter((projectAccess) => projectAccess.offline_id);
|
|
1795
|
-
const initialState$
|
|
1795
|
+
const initialState$n = projectAccessAdapter.getInitialState({});
|
|
1796
1796
|
const projectAccessSlice = createSlice({
|
|
1797
1797
|
name: "projectAccess",
|
|
1798
|
-
initialState: initialState$
|
|
1799
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1798
|
+
initialState: initialState$n,
|
|
1799
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$n)),
|
|
1800
1800
|
reducers: {
|
|
1801
1801
|
initializeProjectAccesses: projectAccessAdapter.initialize,
|
|
1802
1802
|
updateProjectAccess: projectAccessAdapter.updateOne,
|
|
@@ -1842,14 +1842,14 @@ const selectProjectAccessUserMapping = (state) => {
|
|
|
1842
1842
|
return projectAccesses;
|
|
1843
1843
|
};
|
|
1844
1844
|
const projectAccessReducer = projectAccessSlice.reducer;
|
|
1845
|
-
const initialState$
|
|
1845
|
+
const initialState$m = {
|
|
1846
1846
|
projects: {},
|
|
1847
1847
|
activeProjectId: null
|
|
1848
1848
|
};
|
|
1849
1849
|
const projectSlice = createSlice({
|
|
1850
1850
|
name: "projects",
|
|
1851
|
-
initialState: initialState$
|
|
1852
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1851
|
+
initialState: initialState$m,
|
|
1852
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$m)),
|
|
1853
1853
|
reducers: {
|
|
1854
1854
|
setProjects: (state, action) => {
|
|
1855
1855
|
const projectsMap = {};
|
|
@@ -1963,13 +1963,13 @@ const selectSortedProjectUsers = createSelector(
|
|
|
1963
1963
|
});
|
|
1964
1964
|
}
|
|
1965
1965
|
);
|
|
1966
|
-
const initialState$
|
|
1966
|
+
const initialState$l = {
|
|
1967
1967
|
organizations: {}
|
|
1968
1968
|
};
|
|
1969
1969
|
const organizationSlice = createSlice({
|
|
1970
1970
|
name: "organizations",
|
|
1971
|
-
initialState: initialState$
|
|
1972
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1971
|
+
initialState: initialState$l,
|
|
1972
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$l)),
|
|
1973
1973
|
reducers: {
|
|
1974
1974
|
setOrganizations: (state, action) => {
|
|
1975
1975
|
for (const org of action.payload) {
|
|
@@ -2052,14 +2052,14 @@ const createOfflineAction = (request2, baseUrl, serviceName) => {
|
|
|
2052
2052
|
}
|
|
2053
2053
|
};
|
|
2054
2054
|
};
|
|
2055
|
-
const initialState$
|
|
2055
|
+
const initialState$k = {
|
|
2056
2056
|
deletedRequests: [],
|
|
2057
2057
|
latestRetryTime: 0
|
|
2058
2058
|
};
|
|
2059
2059
|
const outboxSlice = createSlice({
|
|
2060
2060
|
name: "outbox",
|
|
2061
|
-
initialState: initialState$
|
|
2062
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2061
|
+
initialState: initialState$k,
|
|
2062
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$k)),
|
|
2063
2063
|
reducers: {
|
|
2064
2064
|
// enqueueActions is a reducer that does nothing but enqueue API request to the Redux Offline outbox
|
|
2065
2065
|
// Whenever an issue is being created, a reducer addIssue() is responsible for adding it to the offline store
|
|
@@ -2091,15 +2091,15 @@ const selectDeletedRequests = (state) => state.outboxReducer.deletedRequests;
|
|
|
2091
2091
|
const selectLatestRetryTime = (state) => state.outboxReducer.latestRetryTime;
|
|
2092
2092
|
const { enqueueRequest, markForDeletion, markAsDeleted, _setLatestRetryTime } = outboxSlice.actions;
|
|
2093
2093
|
const outboxReducer = outboxSlice.reducer;
|
|
2094
|
-
const initialState$
|
|
2094
|
+
const initialState$j = {
|
|
2095
2095
|
projectFiles: {},
|
|
2096
2096
|
activeProjectFileId: null,
|
|
2097
2097
|
isImportingProjectFile: false
|
|
2098
2098
|
};
|
|
2099
2099
|
const projectFileSlice = createSlice({
|
|
2100
2100
|
name: "projectFiles",
|
|
2101
|
-
initialState: initialState$
|
|
2102
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2101
|
+
initialState: initialState$j,
|
|
2102
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$j)),
|
|
2103
2103
|
reducers: {
|
|
2104
2104
|
addOrReplaceProjectFiles: (state, action) => {
|
|
2105
2105
|
for (let fileObj of action.payload) {
|
|
@@ -2184,11 +2184,11 @@ const selectProjectFileById = (id) => (state) => {
|
|
|
2184
2184
|
};
|
|
2185
2185
|
const projectFileReducer = projectFileSlice.reducer;
|
|
2186
2186
|
const projectAttachmentAdapter = createModelAdapter((attachment) => attachment.offline_id);
|
|
2187
|
-
const initialState$
|
|
2187
|
+
const initialState$i = projectAttachmentAdapter.getInitialState({});
|
|
2188
2188
|
const projectAttachmentSlice = createSlice({
|
|
2189
2189
|
name: "projectAttachments",
|
|
2190
|
-
initialState: initialState$
|
|
2191
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2190
|
+
initialState: initialState$i,
|
|
2191
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$i)),
|
|
2192
2192
|
reducers: {
|
|
2193
2193
|
initializeProjectAttachments: projectAttachmentAdapter.initialize,
|
|
2194
2194
|
addProjectAttachment: projectAttachmentAdapter.addOne,
|
|
@@ -2246,12 +2246,12 @@ const selectAttachmentsOfProjectByType = restructureCreateSelectorWithArgs(
|
|
|
2246
2246
|
)
|
|
2247
2247
|
);
|
|
2248
2248
|
const projectAttachmentReducer = projectAttachmentSlice.reducer;
|
|
2249
|
-
const initialState$
|
|
2249
|
+
const initialState$h = {
|
|
2250
2250
|
isRehydrated: false
|
|
2251
2251
|
};
|
|
2252
2252
|
const rehydratedSlice = createSlice({
|
|
2253
2253
|
name: "rehydrated",
|
|
2254
|
-
initialState: initialState$
|
|
2254
|
+
initialState: initialState$h,
|
|
2255
2255
|
// The `reducers` field lets us define reducers and generate associated actions
|
|
2256
2256
|
reducers: {
|
|
2257
2257
|
setRehydrated: (state, action) => {
|
|
@@ -2262,13 +2262,13 @@ const rehydratedSlice = createSlice({
|
|
|
2262
2262
|
const { setRehydrated } = rehydratedSlice.actions;
|
|
2263
2263
|
const selectRehydrated = (state) => state.rehydratedReducer.isRehydrated;
|
|
2264
2264
|
const rehydratedReducer = rehydratedSlice.reducer;
|
|
2265
|
-
const initialState$
|
|
2265
|
+
const initialState$g = {
|
|
2266
2266
|
isFetchingInitialData: false
|
|
2267
2267
|
};
|
|
2268
2268
|
const settingSlice = createSlice({
|
|
2269
2269
|
name: "settings",
|
|
2270
|
-
initialState: initialState$
|
|
2271
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2270
|
+
initialState: initialState$g,
|
|
2271
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$g)),
|
|
2272
2272
|
reducers: {
|
|
2273
2273
|
setIsFetchingInitialData: (state, action) => {
|
|
2274
2274
|
state.isFetchingInitialData = action.payload;
|
|
@@ -2292,11 +2292,11 @@ const formRevisionSortFn = (formRevisionA, formRevisionB) => {
|
|
|
2292
2292
|
}
|
|
2293
2293
|
};
|
|
2294
2294
|
const formRevisionAdapter = createModelAdapter((revision) => revision.offline_id);
|
|
2295
|
-
const initialState$
|
|
2295
|
+
const initialState$f = formRevisionAdapter.getInitialState({});
|
|
2296
2296
|
const formRevisionsSlice = createSlice({
|
|
2297
2297
|
name: "formRevisions",
|
|
2298
|
-
initialState: initialState$
|
|
2299
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2298
|
+
initialState: initialState$f,
|
|
2299
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$f)),
|
|
2300
2300
|
reducers: {
|
|
2301
2301
|
initializeFormRevisions: formRevisionAdapter.initialize,
|
|
2302
2302
|
setFormRevision: formRevisionAdapter.setOne,
|
|
@@ -2396,11 +2396,11 @@ const selectLatestFormRevisionByForm = createSelector([selectFormRevisionMapping
|
|
|
2396
2396
|
});
|
|
2397
2397
|
const formRevisionReducer = formRevisionsSlice.reducer;
|
|
2398
2398
|
const formAdapter = createModelAdapter((form) => form.offline_id);
|
|
2399
|
-
const initialState$
|
|
2399
|
+
const initialState$e = formAdapter.getInitialState({});
|
|
2400
2400
|
const formSlice = createSlice({
|
|
2401
2401
|
name: "forms",
|
|
2402
|
-
initialState: initialState$
|
|
2403
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2402
|
+
initialState: initialState$e,
|
|
2403
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$e)),
|
|
2404
2404
|
reducers: {
|
|
2405
2405
|
initializeForms: formAdapter.initialize,
|
|
2406
2406
|
setForm: formAdapter.setOne,
|
|
@@ -2480,11 +2480,11 @@ const selectGeneralFormCount = createSelector([selectFormMapping], (formsMapping
|
|
|
2480
2480
|
});
|
|
2481
2481
|
const formReducer = formSlice.reducer;
|
|
2482
2482
|
const submissionAdapter = createModelAdapter((submission) => submission.offline_id);
|
|
2483
|
-
const initialState$
|
|
2483
|
+
const initialState$d = submissionAdapter.getInitialState({});
|
|
2484
2484
|
const formSubmissionSlice = createSlice({
|
|
2485
2485
|
name: "formSubmissions",
|
|
2486
|
-
initialState: initialState$
|
|
2487
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2486
|
+
initialState: initialState$d,
|
|
2487
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$d)),
|
|
2488
2488
|
reducers: {
|
|
2489
2489
|
initializeFormSubmissions: submissionAdapter.initialize,
|
|
2490
2490
|
setFormSubmission: submissionAdapter.setOne,
|
|
@@ -2692,11 +2692,11 @@ const formSubmissionReducer = formSubmissionSlice.reducer;
|
|
|
2692
2692
|
const formSubmissionAttachmentAdapter = createModelAdapter(
|
|
2693
2693
|
(attachment) => attachment.offline_id
|
|
2694
2694
|
);
|
|
2695
|
-
const initialState$
|
|
2695
|
+
const initialState$c = formSubmissionAttachmentAdapter.getInitialState({});
|
|
2696
2696
|
const formSubmissionAttachmentSlice = createSlice({
|
|
2697
2697
|
name: "formSubmissionAttachments",
|
|
2698
|
-
initialState: initialState$
|
|
2699
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2698
|
+
initialState: initialState$c,
|
|
2699
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$c)),
|
|
2700
2700
|
reducers: {
|
|
2701
2701
|
initializeFormSubmissionAttachments: formSubmissionAttachmentAdapter.initialize,
|
|
2702
2702
|
addFormSubmissionAttachment: formSubmissionAttachmentAdapter.addOne,
|
|
@@ -2735,11 +2735,11 @@ const formSubmissionAttachmentReducer = formSubmissionAttachmentSlice.reducer;
|
|
|
2735
2735
|
const formRevisionAttachmentAdapter = createModelAdapter(
|
|
2736
2736
|
(attachment) => attachment.offline_id
|
|
2737
2737
|
);
|
|
2738
|
-
const initialState$
|
|
2738
|
+
const initialState$b = formRevisionAttachmentAdapter.getInitialState({});
|
|
2739
2739
|
const formRevisionAttachmentSlice = createSlice({
|
|
2740
2740
|
name: "formRevisionAttachments",
|
|
2741
|
-
initialState: initialState$
|
|
2742
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2741
|
+
initialState: initialState$b,
|
|
2742
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$b)),
|
|
2743
2743
|
reducers: {
|
|
2744
2744
|
initializeFormRevisionAttachments: formRevisionAttachmentAdapter.initialize,
|
|
2745
2745
|
addFormRevisionAttachment: formRevisionAttachmentAdapter.addOne,
|
|
@@ -2776,10 +2776,10 @@ const selectAttachmentsOfFormRevision = restructureCreateSelectorWithArgs(
|
|
|
2776
2776
|
);
|
|
2777
2777
|
const formRevisionAttachmentReducer = formRevisionAttachmentSlice.reducer;
|
|
2778
2778
|
const emailDomainAdapter = createModelAdapter((emailDomain) => emailDomain.offline_id);
|
|
2779
|
-
const initialState$
|
|
2779
|
+
const initialState$a = emailDomainAdapter.getInitialState({});
|
|
2780
2780
|
const emailDomainsSlice = createSlice({
|
|
2781
2781
|
name: "emailDomains",
|
|
2782
|
-
initialState: initialState$
|
|
2782
|
+
initialState: initialState$a,
|
|
2783
2783
|
reducers: {
|
|
2784
2784
|
initializeEmailDomains: emailDomainAdapter.initialize,
|
|
2785
2785
|
addEmailDomain: emailDomainAdapter.addOne,
|
|
@@ -2798,14 +2798,14 @@ const selectEmailDomainsOfOrganization = restructureCreateSelectorWithArgs(
|
|
|
2798
2798
|
)
|
|
2799
2799
|
);
|
|
2800
2800
|
const emailDomainsReducer = emailDomainsSlice.reducer;
|
|
2801
|
-
const initialState$
|
|
2801
|
+
const initialState$9 = {
|
|
2802
2802
|
documents: {}
|
|
2803
2803
|
};
|
|
2804
2804
|
const documentSlice = createSlice({
|
|
2805
2805
|
name: "documents",
|
|
2806
|
-
initialState: initialState$
|
|
2806
|
+
initialState: initialState$9,
|
|
2807
2807
|
extraReducers: (builder) => builder.addCase("RESET", (state) => {
|
|
2808
|
-
Object.assign(state, initialState$
|
|
2808
|
+
Object.assign(state, initialState$9);
|
|
2809
2809
|
}),
|
|
2810
2810
|
reducers: {
|
|
2811
2811
|
setDocuments: (state, action) => {
|
|
@@ -2980,11 +2980,11 @@ const selectRootDocuments = createSelector(
|
|
|
2980
2980
|
);
|
|
2981
2981
|
const documentsReducer = documentSlice.reducer;
|
|
2982
2982
|
const documentAttachmentAdapter = createModelAdapter((attachment) => attachment.offline_id);
|
|
2983
|
-
const initialState$
|
|
2983
|
+
const initialState$8 = documentAttachmentAdapter.getInitialState({});
|
|
2984
2984
|
const documentAttachmentSlice = createSlice({
|
|
2985
2985
|
name: "documentAttachments",
|
|
2986
|
-
initialState: initialState$
|
|
2987
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2986
|
+
initialState: initialState$8,
|
|
2987
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$8)),
|
|
2988
2988
|
reducers: {
|
|
2989
2989
|
initializeDocumentAttachments: documentAttachmentAdapter.initialize,
|
|
2990
2990
|
addDocumentAttachment: documentAttachmentAdapter.addOne,
|
|
@@ -3043,11 +3043,11 @@ const selectAttachmentsOfDocumentByType = restructureCreateSelectorWithArgs(
|
|
|
3043
3043
|
);
|
|
3044
3044
|
const documentAttachmentReducer = documentAttachmentSlice.reducer;
|
|
3045
3045
|
const teamAdapter = createModelAdapter((team) => team.offline_id);
|
|
3046
|
-
const initialState$
|
|
3046
|
+
const initialState$7 = teamAdapter.getInitialState({});
|
|
3047
3047
|
const teamSlice = createSlice({
|
|
3048
3048
|
name: "teams",
|
|
3049
|
-
initialState: initialState$
|
|
3050
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
3049
|
+
initialState: initialState$7,
|
|
3050
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$7)),
|
|
3051
3051
|
reducers: {
|
|
3052
3052
|
setTeam: teamAdapter.setOne,
|
|
3053
3053
|
initializeTeams: teamAdapter.initialize,
|
|
@@ -3081,11 +3081,11 @@ const teamReducer = teamSlice.reducer;
|
|
|
3081
3081
|
const agentUserConversationAdapter = createModelAdapter(
|
|
3082
3082
|
(conversation) => conversation.offline_id
|
|
3083
3083
|
);
|
|
3084
|
-
const initialState$
|
|
3084
|
+
const initialState$6 = agentUserConversationAdapter.getInitialState({});
|
|
3085
3085
|
const agentsSlice = createSlice({
|
|
3086
3086
|
name: "agents",
|
|
3087
|
-
initialState: initialState$
|
|
3088
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
3087
|
+
initialState: initialState$6,
|
|
3088
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$6)),
|
|
3089
3089
|
reducers: {
|
|
3090
3090
|
initializeConversations: agentUserConversationAdapter.initialize,
|
|
3091
3091
|
addConversation: agentUserConversationAdapter.addOne,
|
|
@@ -3107,11 +3107,11 @@ const selectConversation = restructureCreateSelectorWithArgs(
|
|
|
3107
3107
|
);
|
|
3108
3108
|
const agentsReducer = agentsSlice.reducer;
|
|
3109
3109
|
const issueCommentAdapter = createModelAdapter((comment) => comment.offline_id);
|
|
3110
|
-
const initialState$
|
|
3110
|
+
const initialState$5 = issueCommentAdapter.getInitialState({});
|
|
3111
3111
|
const issueCommentSlice = createSlice({
|
|
3112
3112
|
name: "issueComments",
|
|
3113
|
-
initialState: initialState$
|
|
3114
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
3113
|
+
initialState: initialState$5,
|
|
3114
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$5)),
|
|
3115
3115
|
reducers: {
|
|
3116
3116
|
addIssueComment: issueCommentAdapter.addOne,
|
|
3117
3117
|
addIssueComments: issueCommentAdapter.addMany,
|
|
@@ -3140,11 +3140,11 @@ const selectCommentsOfIssue = restructureCreateSelectorWithArgs(
|
|
|
3140
3140
|
);
|
|
3141
3141
|
const issueCommentReducer = issueCommentSlice.reducer;
|
|
3142
3142
|
const issueUpdateAdapter = createModelAdapter((issueUpdate) => issueUpdate.offline_id);
|
|
3143
|
-
const initialState$
|
|
3143
|
+
const initialState$4 = issueUpdateAdapter.getInitialState({});
|
|
3144
3144
|
const issueUpdateSlice = createSlice({
|
|
3145
3145
|
name: "issueUpdates",
|
|
3146
|
-
initialState: initialState$
|
|
3147
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
3146
|
+
initialState: initialState$4,
|
|
3147
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$4)),
|
|
3148
3148
|
reducers: {
|
|
3149
3149
|
initializeIssueUpdates: issueUpdateAdapter.setMany,
|
|
3150
3150
|
setIssueUpdate: issueUpdateAdapter.setOne,
|
|
@@ -3173,11 +3173,11 @@ const selectIssueUpdatesOfIssue = restructureCreateSelectorWithArgs(
|
|
|
3173
3173
|
);
|
|
3174
3174
|
const issueUpdateReducer = issueUpdateSlice.reducer;
|
|
3175
3175
|
const issueAttachmentAdapter = createModelAdapter((attachment) => attachment.offline_id);
|
|
3176
|
-
const initialState$
|
|
3176
|
+
const initialState$3 = issueAttachmentAdapter.getInitialState({});
|
|
3177
3177
|
const issueAttachmentSlice = createSlice({
|
|
3178
3178
|
name: "issueAttachments",
|
|
3179
|
-
initialState: initialState$
|
|
3180
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
3179
|
+
initialState: initialState$3,
|
|
3180
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$3)),
|
|
3181
3181
|
reducers: {
|
|
3182
3182
|
initializeIssueAttachments: issueAttachmentAdapter.initialize,
|
|
3183
3183
|
addIssueAttachment: issueAttachmentAdapter.addOne,
|
|
@@ -3235,23 +3235,23 @@ const selectAttachmentsOfIssueByType = restructureCreateSelectorWithArgs(
|
|
|
3235
3235
|
)
|
|
3236
3236
|
);
|
|
3237
3237
|
const issueAttachmentReducer = issueAttachmentSlice.reducer;
|
|
3238
|
-
const initialState$
|
|
3238
|
+
const initialState$2 = {
|
|
3239
3239
|
version: 0
|
|
3240
3240
|
};
|
|
3241
3241
|
const versioningSlice = createSlice({
|
|
3242
3242
|
name: "versioning",
|
|
3243
|
-
initialState: initialState$
|
|
3243
|
+
initialState: initialState$2,
|
|
3244
3244
|
reducers: {}
|
|
3245
3245
|
});
|
|
3246
3246
|
const versioningReducer = versioningSlice.reducer;
|
|
3247
3247
|
const geoImageAdapter = createModelAdapter((model) => model.offline_id);
|
|
3248
|
-
const initialState = geoImageAdapter.getInitialState({});
|
|
3248
|
+
const initialState$1 = geoImageAdapter.getInitialState({});
|
|
3249
3249
|
const geoImageSlice = createSlice({
|
|
3250
3250
|
name: "geoImages",
|
|
3251
|
-
initialState,
|
|
3251
|
+
initialState: initialState$1,
|
|
3252
3252
|
extraReducers: (builder) => {
|
|
3253
3253
|
builder.addCase("RESET", (state) => {
|
|
3254
|
-
Object.assign(state, initialState);
|
|
3254
|
+
Object.assign(state, initialState$1);
|
|
3255
3255
|
});
|
|
3256
3256
|
},
|
|
3257
3257
|
reducers: {
|
|
@@ -3288,6 +3288,64 @@ const selectGeoImagesOfProject = restructureCreateSelectorWithArgs(
|
|
|
3288
3288
|
})
|
|
3289
3289
|
);
|
|
3290
3290
|
const geoImageReducer = geoImageSlice.reducer;
|
|
3291
|
+
const issueAssociationAdapter = createModelAdapter((assoc) => assoc.offline_id);
|
|
3292
|
+
const initialState = issueAssociationAdapter.getInitialState({});
|
|
3293
|
+
const issueAssociationSlice = createSlice({
|
|
3294
|
+
name: "issueAssociations",
|
|
3295
|
+
initialState,
|
|
3296
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState)),
|
|
3297
|
+
reducers: {
|
|
3298
|
+
initializeIssueAssociations: issueAssociationAdapter.initialize,
|
|
3299
|
+
addIssueAssociation: issueAssociationAdapter.addOne,
|
|
3300
|
+
addIssueAssociations: issueAssociationAdapter.addMany,
|
|
3301
|
+
setIssueAssociation: issueAssociationAdapter.setOne,
|
|
3302
|
+
setIssueAssociations: issueAssociationAdapter.setMany,
|
|
3303
|
+
updateIssueAssociation: issueAssociationAdapter.updateOne,
|
|
3304
|
+
updateIssueAssociations: issueAssociationAdapter.updateMany,
|
|
3305
|
+
deleteIssueAssociation: issueAssociationAdapter.deleteOne,
|
|
3306
|
+
deleteIssueAssociations: issueAssociationAdapter.deleteMany
|
|
3307
|
+
}
|
|
3308
|
+
});
|
|
3309
|
+
const {
|
|
3310
|
+
initializeIssueAssociations,
|
|
3311
|
+
setIssueAssociations,
|
|
3312
|
+
setIssueAssociation,
|
|
3313
|
+
updateIssueAssociation,
|
|
3314
|
+
updateIssueAssociations,
|
|
3315
|
+
addIssueAssociation,
|
|
3316
|
+
addIssueAssociations,
|
|
3317
|
+
deleteIssueAssociation,
|
|
3318
|
+
deleteIssueAssociations
|
|
3319
|
+
} = issueAssociationSlice.actions;
|
|
3320
|
+
const selectIssueAssociationMapping = (state) => state.issueAssociationReducer.instances;
|
|
3321
|
+
const selectIssueAssociationById = (id) => (state) => {
|
|
3322
|
+
return state.issueAssociationReducer.instances[id];
|
|
3323
|
+
};
|
|
3324
|
+
const selectIssueAssociationsToIssue = restructureCreateSelectorWithArgs(
|
|
3325
|
+
createSelector(
|
|
3326
|
+
[selectIssueAssociationMapping, (_state, issueId) => issueId],
|
|
3327
|
+
(associationMapping, issueId) => {
|
|
3328
|
+
return Object.values(associationMapping).filter((assoc) => assoc.associated_issue === issueId);
|
|
3329
|
+
}
|
|
3330
|
+
)
|
|
3331
|
+
);
|
|
3332
|
+
const selectIssueAssociationsOfIssue = restructureCreateSelectorWithArgs(
|
|
3333
|
+
createSelector(
|
|
3334
|
+
[selectIssueAssociationMapping, (_state, issueId) => issueId],
|
|
3335
|
+
(associationMapping, issueId) => {
|
|
3336
|
+
return Object.values(associationMapping).filter((assoc) => assoc.issue === issueId);
|
|
3337
|
+
}
|
|
3338
|
+
)
|
|
3339
|
+
);
|
|
3340
|
+
const selectIssueAssociationsOfAsset = restructureCreateSelectorWithArgs(
|
|
3341
|
+
createSelector(
|
|
3342
|
+
[selectIssueAssociationMapping, (_state, assetId) => assetId],
|
|
3343
|
+
(associationMapping, assetId) => {
|
|
3344
|
+
return Object.values(associationMapping).filter((assoc) => assoc.asset === assetId);
|
|
3345
|
+
}
|
|
3346
|
+
)
|
|
3347
|
+
);
|
|
3348
|
+
const issueAssociationReducer = issueAssociationSlice.reducer;
|
|
3291
3349
|
const fullAssetMarkerSize = 45;
|
|
3292
3350
|
const DEFAULT_ISSUE_STATUS = IssueStatus.BACKLOG;
|
|
3293
3351
|
const DEFAULT_ISSUE_PRIORITY = IssuePriority.MEDIUM;
|
|
@@ -3360,7 +3418,8 @@ const overmapReducers = {
|
|
|
3360
3418
|
agentsReducer,
|
|
3361
3419
|
issueCommentReducer,
|
|
3362
3420
|
issueUpdateReducer,
|
|
3363
|
-
geoImageReducer
|
|
3421
|
+
geoImageReducer,
|
|
3422
|
+
issueAssociationReducer
|
|
3364
3423
|
};
|
|
3365
3424
|
const overmapReducer = combineReducers(overmapReducers);
|
|
3366
3425
|
const resetStore = "RESET";
|
|
@@ -4151,11 +4210,13 @@ class AssetService extends BaseApiService {
|
|
|
4151
4210
|
}
|
|
4152
4211
|
async remove(assetId) {
|
|
4153
4212
|
const { store } = this.client;
|
|
4154
|
-
const
|
|
4213
|
+
const state = store.getState();
|
|
4214
|
+
const assetToBeDeleted = selectAsset(assetId)(state);
|
|
4155
4215
|
if (!assetToBeDeleted)
|
|
4156
4216
|
throw new Error(`No asset with id ${assetId} found in the store`);
|
|
4157
|
-
const attachmentsOfAssets = selectAttachmentsOfAsset(assetId)(
|
|
4158
|
-
const formSubmissionsOfAssets = selectFormSubmissionsOfAsset(assetId)(
|
|
4217
|
+
const attachmentsOfAssets = selectAttachmentsOfAsset(assetId)(state);
|
|
4218
|
+
const formSubmissionsOfAssets = selectFormSubmissionsOfAsset(assetId)(state);
|
|
4219
|
+
const issueAssociations = selectIssueAssociationsOfAsset(assetId)(state);
|
|
4159
4220
|
this.dispatch(deleteAsset(assetId));
|
|
4160
4221
|
if (attachmentsOfAssets.length > 0) {
|
|
4161
4222
|
const attachmentsOfAssetIds = attachmentsOfAssets.map(({ offline_id }) => offline_id);
|
|
@@ -4165,6 +4226,10 @@ class AssetService extends BaseApiService {
|
|
|
4165
4226
|
const formSubmissionsOfAssetIds = formSubmissionsOfAssets.map(({ offline_id }) => offline_id);
|
|
4166
4227
|
this.dispatch(deleteFormSubmissions(formSubmissionsOfAssetIds));
|
|
4167
4228
|
}
|
|
4229
|
+
if (issueAssociations.length > 0) {
|
|
4230
|
+
const issueAssociationsIds = issueAssociations.map(({ offline_id }) => offline_id);
|
|
4231
|
+
this.dispatch(deleteIssueAssociations(issueAssociationsIds));
|
|
4232
|
+
}
|
|
4168
4233
|
return this.enqueueRequest({
|
|
4169
4234
|
description: "Delete asset",
|
|
4170
4235
|
method: HttpMethod.DELETE,
|
|
@@ -4175,6 +4240,7 @@ class AssetService extends BaseApiService {
|
|
|
4175
4240
|
this.dispatch(addAsset(assetToBeDeleted));
|
|
4176
4241
|
this.dispatch(addAssetAttachments(attachmentsOfAssets));
|
|
4177
4242
|
this.dispatch(addFormSubmissions(formSubmissionsOfAssets));
|
|
4243
|
+
this.dispatch(addIssueAssociations(issueAssociations));
|
|
4178
4244
|
throw err;
|
|
4179
4245
|
});
|
|
4180
4246
|
}
|
|
@@ -5050,6 +5116,12 @@ class IssueService extends BaseApiService {
|
|
|
5050
5116
|
const attachmentsOfIssue = selectAttachmentsOfIssue(id)(state);
|
|
5051
5117
|
const updatesOfIssue = selectIssueUpdatesOfIssue(id)(state);
|
|
5052
5118
|
const formSubmissionsOfIssue = selectFormSubmissionsOfIssue(id)(state);
|
|
5119
|
+
const issueAssociationsRecord = {};
|
|
5120
|
+
for (const issueAssociation of selectIssueAssociationsToIssue(id)(state))
|
|
5121
|
+
issueAssociationsRecord[issueAssociation.offline_id] = issueAssociation;
|
|
5122
|
+
for (const issueAssociation of selectIssueAssociationsOfIssue(id)(state))
|
|
5123
|
+
issueAssociationsRecord[issueAssociation.offline_id] = issueAssociation;
|
|
5124
|
+
const issueAssociations = Object.values(issueAssociationsRecord);
|
|
5053
5125
|
this.dispatch(deleteIssue(id));
|
|
5054
5126
|
this.dispatch(addActiveProjectIssuesCount(-1));
|
|
5055
5127
|
if (attachmentsOfIssue.length > 0)
|
|
@@ -5058,6 +5130,8 @@ class IssueService extends BaseApiService {
|
|
|
5058
5130
|
this.dispatch(deleteIssueUpdates(updatesOfIssue.map(({ offline_id }) => offline_id)));
|
|
5059
5131
|
if (formSubmissionsOfIssue.length > 0)
|
|
5060
5132
|
this.dispatch(deleteFormSubmissions(formSubmissionsOfIssue.map(({ offline_id }) => offline_id)));
|
|
5133
|
+
if (issueAssociations.length > 0)
|
|
5134
|
+
this.dispatch(deleteIssueAssociations(issueAssociations.map(({ offline_id }) => offline_id)));
|
|
5061
5135
|
try {
|
|
5062
5136
|
return await this.enqueueRequest({
|
|
5063
5137
|
description: "Delete issue",
|
|
@@ -5072,6 +5146,7 @@ class IssueService extends BaseApiService {
|
|
|
5072
5146
|
this.dispatch(addIssueUpdates(updatesOfIssue));
|
|
5073
5147
|
this.dispatch(addActiveProjectIssuesCount(1));
|
|
5074
5148
|
this.dispatch(addFormSubmissions(formSubmissionsOfIssue));
|
|
5149
|
+
this.dispatch(addIssueAssociations(issueAssociations));
|
|
5075
5150
|
throw e;
|
|
5076
5151
|
}
|
|
5077
5152
|
}
|
|
@@ -6653,27 +6728,20 @@ class LicenseService extends BaseApiService {
|
|
|
6653
6728
|
}
|
|
6654
6729
|
}
|
|
6655
6730
|
class DocumentService extends BaseApiService {
|
|
6656
|
-
|
|
6657
|
-
add(document2) {
|
|
6731
|
+
add(payload) {
|
|
6658
6732
|
const { store } = this.client;
|
|
6659
6733
|
const currentUserId = store.getState().userReducer.currentUser.id;
|
|
6660
|
-
const
|
|
6661
|
-
|
|
6662
|
-
|
|
6663
|
-
}
|
|
6664
|
-
const offlineDocument = offline(document2);
|
|
6665
|
-
const submittedDocument = {
|
|
6666
|
-
...offlineDocument,
|
|
6734
|
+
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
6735
|
+
const offlineDocument = offline({
|
|
6736
|
+
...payload,
|
|
6667
6737
|
created_by: currentUserId,
|
|
6668
|
-
|
|
6669
|
-
|
|
6670
|
-
|
|
6671
|
-
};
|
|
6672
|
-
this.dispatch(addDocuments([submittedDocument]));
|
|
6738
|
+
submitted_at: submittedAt
|
|
6739
|
+
});
|
|
6740
|
+
this.dispatch(addDocuments([offlineDocument]));
|
|
6673
6741
|
const promise = this.enqueueRequest({
|
|
6674
6742
|
description: "Create Document",
|
|
6675
6743
|
method: HttpMethod.POST,
|
|
6676
|
-
url:
|
|
6744
|
+
url: "/documents/",
|
|
6677
6745
|
payload: offlineDocument,
|
|
6678
6746
|
queryParams: {
|
|
6679
6747
|
parent_document: offlineDocument.parent_document ?? void 0
|
|
@@ -6685,7 +6753,7 @@ class DocumentService extends BaseApiService {
|
|
|
6685
6753
|
promise.catch(() => {
|
|
6686
6754
|
this.dispatch(removeDocuments([offlineDocument.offline_id]));
|
|
6687
6755
|
});
|
|
6688
|
-
return [
|
|
6756
|
+
return [offlineDocument, promise];
|
|
6689
6757
|
}
|
|
6690
6758
|
update(document2) {
|
|
6691
6759
|
const { store } = this.client;
|
|
@@ -7245,6 +7313,72 @@ class GeoImageService extends BaseUploadService {
|
|
|
7245
7313
|
store.dispatch(initializeGeoImages(result));
|
|
7246
7314
|
}
|
|
7247
7315
|
}
|
|
7316
|
+
class IssueAssociationService extends BaseUploadService {
|
|
7317
|
+
add(payload) {
|
|
7318
|
+
const { store } = this.client;
|
|
7319
|
+
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7320
|
+
const createdBy = store.getState().userReducer.currentUser.id;
|
|
7321
|
+
const offlineIssueAssociation = offline({
|
|
7322
|
+
...payload,
|
|
7323
|
+
submitted_at: submittedAt,
|
|
7324
|
+
created_by: createdBy
|
|
7325
|
+
});
|
|
7326
|
+
this.dispatch(addIssueAssociation(offlineIssueAssociation));
|
|
7327
|
+
const promise = this.enqueueRequest({
|
|
7328
|
+
description: "Add issue association",
|
|
7329
|
+
method: HttpMethod.POST,
|
|
7330
|
+
url: "/issues/associations/",
|
|
7331
|
+
payload: {
|
|
7332
|
+
offline_id: offlineIssueAssociation.offline_id,
|
|
7333
|
+
submitted_at: submittedAt,
|
|
7334
|
+
created_by: createdBy,
|
|
7335
|
+
...payload
|
|
7336
|
+
},
|
|
7337
|
+
blockers: [
|
|
7338
|
+
payload.associated_issue,
|
|
7339
|
+
...payload.issue ? [payload.issue] : [],
|
|
7340
|
+
...payload.asset ? [payload.asset] : []
|
|
7341
|
+
],
|
|
7342
|
+
blocks: [offlineIssueAssociation.offline_id]
|
|
7343
|
+
});
|
|
7344
|
+
promise.then((issueAssociation) => {
|
|
7345
|
+
this.dispatch(updateIssueAssociation(issueAssociation));
|
|
7346
|
+
}).catch(() => {
|
|
7347
|
+
this.dispatch(deleteIssueAssociation(offlineIssueAssociation.offline_id));
|
|
7348
|
+
});
|
|
7349
|
+
return [offlineIssueAssociation, promise];
|
|
7350
|
+
}
|
|
7351
|
+
async delete(id) {
|
|
7352
|
+
const { store } = this.client;
|
|
7353
|
+
const issueAssociation = selectIssueAssociationById(id)(store.getState());
|
|
7354
|
+
if (!issueAssociation) {
|
|
7355
|
+
throw new Error(`Issue association with id ${id} not found in store.`);
|
|
7356
|
+
}
|
|
7357
|
+
this.dispatch(deleteIssueAssociation(id));
|
|
7358
|
+
const promise = this.enqueueRequest({
|
|
7359
|
+
description: "Delete issue association",
|
|
7360
|
+
method: HttpMethod.DELETE,
|
|
7361
|
+
url: `/issues/associations/${id}/`,
|
|
7362
|
+
blockers: [id],
|
|
7363
|
+
blocks: []
|
|
7364
|
+
});
|
|
7365
|
+
promise.catch(() => {
|
|
7366
|
+
this.dispatch(addIssueAssociation(issueAssociation));
|
|
7367
|
+
});
|
|
7368
|
+
return promise;
|
|
7369
|
+
}
|
|
7370
|
+
async refreshStore(projectId) {
|
|
7371
|
+
const issueAssociations = await this.enqueueRequest({
|
|
7372
|
+
description: "Fetch issue associations",
|
|
7373
|
+
method: HttpMethod.GET,
|
|
7374
|
+
url: "/issues/associations/",
|
|
7375
|
+
queryParams: { project_id: projectId.toString() },
|
|
7376
|
+
blockers: [],
|
|
7377
|
+
blocks: []
|
|
7378
|
+
});
|
|
7379
|
+
this.dispatch(initializeIssueAssociations(issueAssociations));
|
|
7380
|
+
}
|
|
7381
|
+
}
|
|
7248
7382
|
export {
|
|
7249
7383
|
APIError,
|
|
7250
7384
|
AgentService,
|
|
@@ -7273,6 +7407,7 @@ export {
|
|
|
7273
7407
|
GREEN,
|
|
7274
7408
|
GeoImageService,
|
|
7275
7409
|
HttpMethod,
|
|
7410
|
+
IssueAssociationService,
|
|
7276
7411
|
IssueAttachmentService,
|
|
7277
7412
|
IssueCommentService,
|
|
7278
7413
|
IssuePriority,
|
|
@@ -7334,6 +7469,8 @@ export {
|
|
|
7334
7469
|
addGeoImage,
|
|
7335
7470
|
addGeoImages,
|
|
7336
7471
|
addIssue,
|
|
7472
|
+
addIssueAssociation,
|
|
7473
|
+
addIssueAssociations,
|
|
7337
7474
|
addIssueAttachment,
|
|
7338
7475
|
addIssueAttachments,
|
|
7339
7476
|
addIssueComment,
|
|
@@ -7411,6 +7548,8 @@ export {
|
|
|
7411
7548
|
deleteGeoImage,
|
|
7412
7549
|
deleteGeoImages,
|
|
7413
7550
|
deleteIssue,
|
|
7551
|
+
deleteIssueAssociation,
|
|
7552
|
+
deleteIssueAssociations,
|
|
7414
7553
|
deleteIssueAttachment,
|
|
7415
7554
|
deleteIssueAttachments,
|
|
7416
7555
|
deleteIssueComment,
|
|
@@ -7483,6 +7622,7 @@ export {
|
|
|
7483
7622
|
initializeFormSubmissions,
|
|
7484
7623
|
initializeForms,
|
|
7485
7624
|
initializeGeoImages,
|
|
7625
|
+
initializeIssueAssociations,
|
|
7486
7626
|
initializeIssueAttachments,
|
|
7487
7627
|
initializeIssueTypes,
|
|
7488
7628
|
initializeIssueUpdates,
|
|
@@ -7495,6 +7635,8 @@ export {
|
|
|
7495
7635
|
initializeTeams,
|
|
7496
7636
|
initializeWorkspaces,
|
|
7497
7637
|
isToday,
|
|
7638
|
+
issueAssociationReducer,
|
|
7639
|
+
issueAssociationSlice,
|
|
7498
7640
|
issueAttachmentReducer,
|
|
7499
7641
|
issueAttachmentSlice,
|
|
7500
7642
|
issueCommentReducer,
|
|
@@ -7650,6 +7792,11 @@ export {
|
|
|
7650
7792
|
selectIsImportingProjectFile,
|
|
7651
7793
|
selectIsLoggedIn,
|
|
7652
7794
|
selectIssue,
|
|
7795
|
+
selectIssueAssociationById,
|
|
7796
|
+
selectIssueAssociationMapping,
|
|
7797
|
+
selectIssueAssociationsOfAsset,
|
|
7798
|
+
selectIssueAssociationsOfIssue,
|
|
7799
|
+
selectIssueAssociationsToIssue,
|
|
7653
7800
|
selectIssueAttachment,
|
|
7654
7801
|
selectIssueAttachmentMapping,
|
|
7655
7802
|
selectIssueAttachments,
|
|
@@ -7754,6 +7901,8 @@ export {
|
|
|
7754
7901
|
setGeoImages,
|
|
7755
7902
|
setIsFetchingInitialData,
|
|
7756
7903
|
setIsImportingProjectFile,
|
|
7904
|
+
setIssueAssociation,
|
|
7905
|
+
setIssueAssociations,
|
|
7757
7906
|
setIssueAttachment,
|
|
7758
7907
|
setIssueAttachments,
|
|
7759
7908
|
setIssueComment,
|
|
@@ -7807,6 +7956,8 @@ export {
|
|
|
7807
7956
|
updateGeoImage,
|
|
7808
7957
|
updateGeoImages,
|
|
7809
7958
|
updateIssue,
|
|
7959
|
+
updateIssueAssociation,
|
|
7960
|
+
updateIssueAssociations,
|
|
7810
7961
|
updateIssueAttachment,
|
|
7811
7962
|
updateIssueAttachments,
|
|
7812
7963
|
updateIssueType,
|