@overmap-ai/core 1.0.63-org-projs-only.1 → 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 +450 -247
- package/dist/overmap-core.js.map +1 -1
- package/dist/overmap-core.umd.cjs +450 -247
- package/dist/overmap-core.umd.cjs.map +1 -1
- package/dist/sdk/services/DocumentService.d.ts +1 -1
- package/dist/sdk/services/FormService.d.ts +15 -11
- package/dist/sdk/services/FormSubmissionService.d.ts +8 -5
- 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/attachments.d.ts +5 -8
- package/dist/typings/models/base.d.ts +5 -4
- package/dist/typings/models/documents.d.ts +6 -16
- package/dist/typings/models/forms.d.ts +3 -3
- package/dist/typings/models/issues.d.ts +13 -9
- package/dist/typings/models/license.d.ts +2 -2
- package/dist/typings/models/projects.d.ts +4 -2
- package/dist/typings/models/store.d.ts +2 -1
- package/package.json +1 -1
|
@@ -367,15 +367,15 @@ var __publicField = (obj, key, value) => {
|
|
|
367
367
|
};
|
|
368
368
|
const migrations = [initialVersioning, signOut, signOut, createOutboxState];
|
|
369
369
|
const manifest = Object.fromEntries(migrations.map((migration2, i) => [i, wrapMigration(migration2)]));
|
|
370
|
-
const initialState$
|
|
370
|
+
const initialState$C = {
|
|
371
371
|
accessToken: "",
|
|
372
372
|
refreshToken: "",
|
|
373
373
|
isLoggedIn: false
|
|
374
374
|
};
|
|
375
375
|
const authSlice = toolkit.createSlice({
|
|
376
376
|
name: "auth",
|
|
377
|
-
initialState: initialState$
|
|
378
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
377
|
+
initialState: initialState$C,
|
|
378
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$C)),
|
|
379
379
|
reducers: {
|
|
380
380
|
setTokens: (state, action) => {
|
|
381
381
|
state.accessToken = action.payload.accessToken;
|
|
@@ -845,11 +845,11 @@ var __publicField = (obj, key, value) => {
|
|
|
845
845
|
};
|
|
846
846
|
}
|
|
847
847
|
const categoryAdapter = createModelAdapter((category) => category.offline_id);
|
|
848
|
-
const initialState$
|
|
848
|
+
const initialState$B = categoryAdapter.getInitialState({});
|
|
849
849
|
const categorySlice = toolkit.createSlice({
|
|
850
850
|
name: "categories",
|
|
851
|
-
initialState: initialState$
|
|
852
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
851
|
+
initialState: initialState$B,
|
|
852
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$B)),
|
|
853
853
|
reducers: {
|
|
854
854
|
initializeCategories: categoryAdapter.initialize,
|
|
855
855
|
addCategory: categoryAdapter.addOne,
|
|
@@ -879,11 +879,11 @@ var __publicField = (obj, key, value) => {
|
|
|
879
879
|
};
|
|
880
880
|
const categoryReducer = categorySlice.reducer;
|
|
881
881
|
const assetTypeAdapter = createModelAdapter((assetType) => assetType.offline_id);
|
|
882
|
-
const initialState$
|
|
882
|
+
const initialState$A = assetTypeAdapter.getInitialState({});
|
|
883
883
|
const assetTypeSlice = toolkit.createSlice({
|
|
884
884
|
name: "assetTypes",
|
|
885
|
-
initialState: initialState$
|
|
886
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
885
|
+
initialState: initialState$A,
|
|
886
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$A)),
|
|
887
887
|
reducers: {
|
|
888
888
|
initializeAssetTypes: assetTypeAdapter.initialize,
|
|
889
889
|
addAssetType: assetTypeAdapter.addOne,
|
|
@@ -928,11 +928,11 @@ var __publicField = (obj, key, value) => {
|
|
|
928
928
|
);
|
|
929
929
|
const assetTypeReducer = assetTypeSlice.reducer;
|
|
930
930
|
const assetAdapter = createModelAdapter((asset) => asset.offline_id);
|
|
931
|
-
const initialState$
|
|
931
|
+
const initialState$z = assetAdapter.getInitialState({});
|
|
932
932
|
const assetSlice = toolkit.createSlice({
|
|
933
933
|
name: "assets",
|
|
934
|
-
initialState: initialState$
|
|
935
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
934
|
+
initialState: initialState$z,
|
|
935
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$z)),
|
|
936
936
|
reducers: {
|
|
937
937
|
initializeAssets: (state, action) => {
|
|
938
938
|
assetAdapter.initialize(state, action);
|
|
@@ -1035,11 +1035,11 @@ var __publicField = (obj, key, value) => {
|
|
|
1035
1035
|
};
|
|
1036
1036
|
const assetReducer = assetSlice.reducer;
|
|
1037
1037
|
const assetAttachmentAdapter = createModelAdapter((attachment) => attachment.offline_id);
|
|
1038
|
-
const initialState$
|
|
1038
|
+
const initialState$y = assetAttachmentAdapter.getInitialState({});
|
|
1039
1039
|
const assetAttachmentSlice = toolkit.createSlice({
|
|
1040
1040
|
name: "assetAttachments",
|
|
1041
|
-
initialState: initialState$
|
|
1042
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1041
|
+
initialState: initialState$y,
|
|
1042
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$y)),
|
|
1043
1043
|
reducers: {
|
|
1044
1044
|
initializeAssetAttachments: assetAttachmentAdapter.initialize,
|
|
1045
1045
|
addAssetAttachment: assetAttachmentAdapter.addOne,
|
|
@@ -1097,13 +1097,13 @@ var __publicField = (obj, key, value) => {
|
|
|
1097
1097
|
)
|
|
1098
1098
|
);
|
|
1099
1099
|
const assetAttachmentReducer = assetAttachmentSlice.reducer;
|
|
1100
|
-
const initialState$
|
|
1100
|
+
const initialState$x = {
|
|
1101
1101
|
completionsByAssetId: {}
|
|
1102
1102
|
};
|
|
1103
1103
|
const assetStageCompletionSlice = toolkit.createSlice({
|
|
1104
1104
|
name: "assetStageCompletions",
|
|
1105
|
-
initialState: initialState$
|
|
1106
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1105
|
+
initialState: initialState$x,
|
|
1106
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$x)),
|
|
1107
1107
|
reducers: {
|
|
1108
1108
|
addStageCompletion: (state, action) => {
|
|
1109
1109
|
let stageToCompletionDateMapping = state.completionsByAssetId[action.payload.asset];
|
|
@@ -1155,11 +1155,11 @@ var __publicField = (obj, key, value) => {
|
|
|
1155
1155
|
);
|
|
1156
1156
|
const assetStageCompletionReducer = assetStageCompletionSlice.reducer;
|
|
1157
1157
|
const assetStageAdapter = createModelAdapter((assetStage) => assetStage.offline_id);
|
|
1158
|
-
const initialState$
|
|
1158
|
+
const initialState$w = assetStageAdapter.getInitialState({});
|
|
1159
1159
|
const assetStageSlice = toolkit.createSlice({
|
|
1160
1160
|
name: "assetStages",
|
|
1161
|
-
initialState: initialState$
|
|
1162
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1161
|
+
initialState: initialState$w,
|
|
1162
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$w)),
|
|
1163
1163
|
reducers: {
|
|
1164
1164
|
initializeStages: assetStageAdapter.initialize,
|
|
1165
1165
|
setStage: assetStageAdapter.setOne,
|
|
@@ -1240,11 +1240,11 @@ var __publicField = (obj, key, value) => {
|
|
|
1240
1240
|
const assetTypeAttachmentAdapter = createModelAdapter(
|
|
1241
1241
|
(attachment) => attachment.offline_id
|
|
1242
1242
|
);
|
|
1243
|
-
const initialState$
|
|
1243
|
+
const initialState$v = assetTypeAttachmentAdapter.getInitialState({});
|
|
1244
1244
|
const assetTypeAttachmentSlice = toolkit.createSlice({
|
|
1245
1245
|
name: "assetTypeAttachments",
|
|
1246
|
-
initialState: initialState$
|
|
1247
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1246
|
+
initialState: initialState$v,
|
|
1247
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$v)),
|
|
1248
1248
|
reducers: {
|
|
1249
1249
|
initializeAssetTypeAttachments: assetTypeAttachmentAdapter.initialize,
|
|
1250
1250
|
addAssetTypeAttachment: assetTypeAttachmentAdapter.addOne,
|
|
@@ -1303,10 +1303,10 @@ var __publicField = (obj, key, value) => {
|
|
|
1303
1303
|
);
|
|
1304
1304
|
const assetTypeAttachmentReducer = assetTypeAttachmentSlice.reducer;
|
|
1305
1305
|
const workspaceAdapter = createModelAdapter((workspace) => workspace.offline_id);
|
|
1306
|
-
const initialState$
|
|
1306
|
+
const initialState$u = workspaceAdapter.getInitialState({});
|
|
1307
1307
|
const workspaceSlice = toolkit.createSlice({
|
|
1308
1308
|
name: "workspace",
|
|
1309
|
-
initialState: initialState$
|
|
1309
|
+
initialState: initialState$u,
|
|
1310
1310
|
reducers: {
|
|
1311
1311
|
initializeWorkspaces: workspaceAdapter.initialize,
|
|
1312
1312
|
setWorkspaces: workspaceAdapter.setMany,
|
|
@@ -1338,14 +1338,14 @@ var __publicField = (obj, key, value) => {
|
|
|
1338
1338
|
const workspaceReducer = workspaceSlice.reducer;
|
|
1339
1339
|
const maxRecentIssues = 10;
|
|
1340
1340
|
const issueAdapter = createModelAdapter((issue) => issue.offline_id);
|
|
1341
|
-
const initialState$
|
|
1341
|
+
const initialState$t = issueAdapter.getInitialState({
|
|
1342
1342
|
recentIssueIds: []
|
|
1343
1343
|
});
|
|
1344
1344
|
const issueSlice = toolkit.createSlice({
|
|
1345
1345
|
name: "issues",
|
|
1346
|
-
initialState: initialState$
|
|
1346
|
+
initialState: initialState$t,
|
|
1347
1347
|
extraReducers: (builder) => builder.addCase("RESET", (state) => {
|
|
1348
|
-
Object.assign(state, initialState$
|
|
1348
|
+
Object.assign(state, initialState$t);
|
|
1349
1349
|
}),
|
|
1350
1350
|
reducers: {
|
|
1351
1351
|
initializeIssues: issueAdapter.initialize,
|
|
@@ -1489,12 +1489,12 @@ var __publicField = (obj, key, value) => {
|
|
|
1489
1489
|
);
|
|
1490
1490
|
const issueReducer = issueSlice.reducer;
|
|
1491
1491
|
const issueTypeAdapter = createModelAdapter((issueType) => issueType.offline_id);
|
|
1492
|
-
const initialState$
|
|
1492
|
+
const initialState$s = issueTypeAdapter.getInitialState({});
|
|
1493
1493
|
const issueTypeSlice = toolkit.createSlice({
|
|
1494
1494
|
name: "issueTypes",
|
|
1495
|
-
initialState: initialState$
|
|
1495
|
+
initialState: initialState$s,
|
|
1496
1496
|
extraReducers: (builder) => builder.addCase("RESET", (state) => {
|
|
1497
|
-
Object.assign(state, initialState$
|
|
1497
|
+
Object.assign(state, initialState$s);
|
|
1498
1498
|
}),
|
|
1499
1499
|
reducers: {
|
|
1500
1500
|
initializeIssueTypes: issueTypeAdapter.initialize,
|
|
@@ -1543,15 +1543,15 @@ var __publicField = (obj, key, value) => {
|
|
|
1543
1543
|
return ((_a2 = selectIssuesOfIssueType(issueTypeId)(state)) == null ? void 0 : _a2.length) ?? 0;
|
|
1544
1544
|
};
|
|
1545
1545
|
const issueTypeReducer = issueTypeSlice.reducer;
|
|
1546
|
-
const initialState$
|
|
1546
|
+
const initialState$r = {
|
|
1547
1547
|
s3Urls: {}
|
|
1548
1548
|
};
|
|
1549
1549
|
const msPerHour = 1e3 * 60 * 60;
|
|
1550
1550
|
const msPerWeek = msPerHour * 24 * 7;
|
|
1551
1551
|
const fileSlice = toolkit.createSlice({
|
|
1552
1552
|
name: "file",
|
|
1553
|
-
initialState: initialState$
|
|
1554
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1553
|
+
initialState: initialState$r,
|
|
1554
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$r)),
|
|
1555
1555
|
reducers: {
|
|
1556
1556
|
setUploadUrl: (state, action) => {
|
|
1557
1557
|
const { url, fields, sha1 } = action.payload;
|
|
@@ -1632,7 +1632,7 @@ var __publicField = (obj, key, value) => {
|
|
|
1632
1632
|
LicenseStatus2[LicenseStatus2["PAST_DUE"] = 8] = "PAST_DUE";
|
|
1633
1633
|
return LicenseStatus2;
|
|
1634
1634
|
})(LicenseStatus || {});
|
|
1635
|
-
const initialState$
|
|
1635
|
+
const initialState$q = {
|
|
1636
1636
|
users: {},
|
|
1637
1637
|
currentUser: {
|
|
1638
1638
|
id: 0,
|
|
@@ -1643,8 +1643,8 @@ var __publicField = (obj, key, value) => {
|
|
|
1643
1643
|
};
|
|
1644
1644
|
const userSlice = toolkit.createSlice({
|
|
1645
1645
|
name: "users",
|
|
1646
|
-
initialState: initialState$
|
|
1647
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1646
|
+
initialState: initialState$q,
|
|
1647
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$q)),
|
|
1648
1648
|
reducers: {
|
|
1649
1649
|
setUsers: (state, action) => {
|
|
1650
1650
|
const usersMapping = {};
|
|
@@ -1709,11 +1709,11 @@ var __publicField = (obj, key, value) => {
|
|
|
1709
1709
|
const organizationAccessAdapter = createModelAdapter(
|
|
1710
1710
|
(organizationAccess) => organizationAccess.offline_id
|
|
1711
1711
|
);
|
|
1712
|
-
const initialState$
|
|
1712
|
+
const initialState$p = organizationAccessAdapter.getInitialState({});
|
|
1713
1713
|
const organizationAccessSlice = toolkit.createSlice({
|
|
1714
1714
|
name: "organizationAccess",
|
|
1715
|
-
initialState: initialState$
|
|
1716
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1715
|
+
initialState: initialState$p,
|
|
1716
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$p)),
|
|
1717
1717
|
reducers: {
|
|
1718
1718
|
initializeOrganizationAccesses: organizationAccessAdapter.initialize,
|
|
1719
1719
|
updateOrganizationAccess: organizationAccessAdapter.updateOne,
|
|
@@ -1750,11 +1750,11 @@ var __publicField = (obj, key, value) => {
|
|
|
1750
1750
|
};
|
|
1751
1751
|
const organizationAccessReducer = organizationAccessSlice.reducer;
|
|
1752
1752
|
const licenseAdapter = createModelAdapter((license) => license.offline_id);
|
|
1753
|
-
const initialState$
|
|
1753
|
+
const initialState$o = licenseAdapter.getInitialState({});
|
|
1754
1754
|
const licenseSlice = toolkit.createSlice({
|
|
1755
1755
|
name: "license",
|
|
1756
|
-
initialState: initialState$
|
|
1757
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1756
|
+
initialState: initialState$o,
|
|
1757
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$o)),
|
|
1758
1758
|
reducers: {
|
|
1759
1759
|
initializeLicences: licenseAdapter.initialize,
|
|
1760
1760
|
addLicenses: licenseAdapter.addMany,
|
|
@@ -1780,11 +1780,11 @@ var __publicField = (obj, key, value) => {
|
|
|
1780
1780
|
);
|
|
1781
1781
|
const licenseReducer = licenseSlice.reducer;
|
|
1782
1782
|
const projectAccessAdapter = createModelAdapter((projectAccess) => projectAccess.offline_id);
|
|
1783
|
-
const initialState$
|
|
1783
|
+
const initialState$n = projectAccessAdapter.getInitialState({});
|
|
1784
1784
|
const projectAccessSlice = toolkit.createSlice({
|
|
1785
1785
|
name: "projectAccess",
|
|
1786
|
-
initialState: initialState$
|
|
1787
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1786
|
+
initialState: initialState$n,
|
|
1787
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$n)),
|
|
1788
1788
|
reducers: {
|
|
1789
1789
|
initializeProjectAccesses: projectAccessAdapter.initialize,
|
|
1790
1790
|
updateProjectAccess: projectAccessAdapter.updateOne,
|
|
@@ -1830,14 +1830,14 @@ var __publicField = (obj, key, value) => {
|
|
|
1830
1830
|
return projectAccesses;
|
|
1831
1831
|
};
|
|
1832
1832
|
const projectAccessReducer = projectAccessSlice.reducer;
|
|
1833
|
-
const initialState$
|
|
1833
|
+
const initialState$m = {
|
|
1834
1834
|
projects: {},
|
|
1835
1835
|
activeProjectId: null
|
|
1836
1836
|
};
|
|
1837
1837
|
const projectSlice = toolkit.createSlice({
|
|
1838
1838
|
name: "projects",
|
|
1839
|
-
initialState: initialState$
|
|
1840
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1839
|
+
initialState: initialState$m,
|
|
1840
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$m)),
|
|
1841
1841
|
reducers: {
|
|
1842
1842
|
setProjects: (state, action) => {
|
|
1843
1843
|
const projectsMap = {};
|
|
@@ -1951,13 +1951,13 @@ var __publicField = (obj, key, value) => {
|
|
|
1951
1951
|
});
|
|
1952
1952
|
}
|
|
1953
1953
|
);
|
|
1954
|
-
const initialState$
|
|
1954
|
+
const initialState$l = {
|
|
1955
1955
|
organizations: {}
|
|
1956
1956
|
};
|
|
1957
1957
|
const organizationSlice = toolkit.createSlice({
|
|
1958
1958
|
name: "organizations",
|
|
1959
|
-
initialState: initialState$
|
|
1960
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1959
|
+
initialState: initialState$l,
|
|
1960
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$l)),
|
|
1961
1961
|
reducers: {
|
|
1962
1962
|
setOrganizations: (state, action) => {
|
|
1963
1963
|
for (const org of action.payload) {
|
|
@@ -2040,14 +2040,14 @@ var __publicField = (obj, key, value) => {
|
|
|
2040
2040
|
}
|
|
2041
2041
|
};
|
|
2042
2042
|
};
|
|
2043
|
-
const initialState$
|
|
2043
|
+
const initialState$k = {
|
|
2044
2044
|
deletedRequests: [],
|
|
2045
2045
|
latestRetryTime: 0
|
|
2046
2046
|
};
|
|
2047
2047
|
const outboxSlice = toolkit.createSlice({
|
|
2048
2048
|
name: "outbox",
|
|
2049
|
-
initialState: initialState$
|
|
2050
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2049
|
+
initialState: initialState$k,
|
|
2050
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$k)),
|
|
2051
2051
|
reducers: {
|
|
2052
2052
|
// enqueueActions is a reducer that does nothing but enqueue API request to the Redux Offline outbox
|
|
2053
2053
|
// Whenever an issue is being created, a reducer addIssue() is responsible for adding it to the offline store
|
|
@@ -2079,15 +2079,15 @@ var __publicField = (obj, key, value) => {
|
|
|
2079
2079
|
const selectLatestRetryTime = (state) => state.outboxReducer.latestRetryTime;
|
|
2080
2080
|
const { enqueueRequest, markForDeletion, markAsDeleted, _setLatestRetryTime } = outboxSlice.actions;
|
|
2081
2081
|
const outboxReducer = outboxSlice.reducer;
|
|
2082
|
-
const initialState$
|
|
2082
|
+
const initialState$j = {
|
|
2083
2083
|
projectFiles: {},
|
|
2084
2084
|
activeProjectFileId: null,
|
|
2085
2085
|
isImportingProjectFile: false
|
|
2086
2086
|
};
|
|
2087
2087
|
const projectFileSlice = toolkit.createSlice({
|
|
2088
2088
|
name: "projectFiles",
|
|
2089
|
-
initialState: initialState$
|
|
2090
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2089
|
+
initialState: initialState$j,
|
|
2090
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$j)),
|
|
2091
2091
|
reducers: {
|
|
2092
2092
|
addOrReplaceProjectFiles: (state, action) => {
|
|
2093
2093
|
for (let fileObj of action.payload) {
|
|
@@ -2172,11 +2172,11 @@ var __publicField = (obj, key, value) => {
|
|
|
2172
2172
|
};
|
|
2173
2173
|
const projectFileReducer = projectFileSlice.reducer;
|
|
2174
2174
|
const projectAttachmentAdapter = createModelAdapter((attachment) => attachment.offline_id);
|
|
2175
|
-
const initialState$
|
|
2175
|
+
const initialState$i = projectAttachmentAdapter.getInitialState({});
|
|
2176
2176
|
const projectAttachmentSlice = toolkit.createSlice({
|
|
2177
2177
|
name: "projectAttachments",
|
|
2178
|
-
initialState: initialState$
|
|
2179
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2178
|
+
initialState: initialState$i,
|
|
2179
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$i)),
|
|
2180
2180
|
reducers: {
|
|
2181
2181
|
initializeProjectAttachments: projectAttachmentAdapter.initialize,
|
|
2182
2182
|
addProjectAttachment: projectAttachmentAdapter.addOne,
|
|
@@ -2234,12 +2234,12 @@ var __publicField = (obj, key, value) => {
|
|
|
2234
2234
|
)
|
|
2235
2235
|
);
|
|
2236
2236
|
const projectAttachmentReducer = projectAttachmentSlice.reducer;
|
|
2237
|
-
const initialState$
|
|
2237
|
+
const initialState$h = {
|
|
2238
2238
|
isRehydrated: false
|
|
2239
2239
|
};
|
|
2240
2240
|
const rehydratedSlice = toolkit.createSlice({
|
|
2241
2241
|
name: "rehydrated",
|
|
2242
|
-
initialState: initialState$
|
|
2242
|
+
initialState: initialState$h,
|
|
2243
2243
|
// The `reducers` field lets us define reducers and generate associated actions
|
|
2244
2244
|
reducers: {
|
|
2245
2245
|
setRehydrated: (state, action) => {
|
|
@@ -2250,13 +2250,13 @@ var __publicField = (obj, key, value) => {
|
|
|
2250
2250
|
const { setRehydrated } = rehydratedSlice.actions;
|
|
2251
2251
|
const selectRehydrated = (state) => state.rehydratedReducer.isRehydrated;
|
|
2252
2252
|
const rehydratedReducer = rehydratedSlice.reducer;
|
|
2253
|
-
const initialState$
|
|
2253
|
+
const initialState$g = {
|
|
2254
2254
|
isFetchingInitialData: false
|
|
2255
2255
|
};
|
|
2256
2256
|
const settingSlice = toolkit.createSlice({
|
|
2257
2257
|
name: "settings",
|
|
2258
|
-
initialState: initialState$
|
|
2259
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2258
|
+
initialState: initialState$g,
|
|
2259
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$g)),
|
|
2260
2260
|
reducers: {
|
|
2261
2261
|
setIsFetchingInitialData: (state, action) => {
|
|
2262
2262
|
state.isFetchingInitialData = action.payload;
|
|
@@ -2280,11 +2280,11 @@ var __publicField = (obj, key, value) => {
|
|
|
2280
2280
|
}
|
|
2281
2281
|
};
|
|
2282
2282
|
const formRevisionAdapter = createModelAdapter((revision) => revision.offline_id);
|
|
2283
|
-
const initialState$
|
|
2283
|
+
const initialState$f = formRevisionAdapter.getInitialState({});
|
|
2284
2284
|
const formRevisionsSlice = toolkit.createSlice({
|
|
2285
2285
|
name: "formRevisions",
|
|
2286
|
-
initialState: initialState$
|
|
2287
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2286
|
+
initialState: initialState$f,
|
|
2287
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$f)),
|
|
2288
2288
|
reducers: {
|
|
2289
2289
|
initializeFormRevisions: formRevisionAdapter.initialize,
|
|
2290
2290
|
setFormRevision: formRevisionAdapter.setOne,
|
|
@@ -2384,11 +2384,11 @@ var __publicField = (obj, key, value) => {
|
|
|
2384
2384
|
});
|
|
2385
2385
|
const formRevisionReducer = formRevisionsSlice.reducer;
|
|
2386
2386
|
const formAdapter = createModelAdapter((form) => form.offline_id);
|
|
2387
|
-
const initialState$
|
|
2387
|
+
const initialState$e = formAdapter.getInitialState({});
|
|
2388
2388
|
const formSlice = toolkit.createSlice({
|
|
2389
2389
|
name: "forms",
|
|
2390
|
-
initialState: initialState$
|
|
2391
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2390
|
+
initialState: initialState$e,
|
|
2391
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$e)),
|
|
2392
2392
|
reducers: {
|
|
2393
2393
|
initializeForms: formAdapter.initialize,
|
|
2394
2394
|
setForm: formAdapter.setOne,
|
|
@@ -2468,11 +2468,11 @@ var __publicField = (obj, key, value) => {
|
|
|
2468
2468
|
});
|
|
2469
2469
|
const formReducer = formSlice.reducer;
|
|
2470
2470
|
const submissionAdapter = createModelAdapter((submission) => submission.offline_id);
|
|
2471
|
-
const initialState$
|
|
2471
|
+
const initialState$d = submissionAdapter.getInitialState({});
|
|
2472
2472
|
const formSubmissionSlice = toolkit.createSlice({
|
|
2473
2473
|
name: "formSubmissions",
|
|
2474
|
-
initialState: initialState$
|
|
2475
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2474
|
+
initialState: initialState$d,
|
|
2475
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$d)),
|
|
2476
2476
|
reducers: {
|
|
2477
2477
|
initializeFormSubmissions: submissionAdapter.initialize,
|
|
2478
2478
|
setFormSubmission: submissionAdapter.setOne,
|
|
@@ -2582,8 +2582,10 @@ var __publicField = (obj, key, value) => {
|
|
|
2582
2582
|
],
|
|
2583
2583
|
(issues, forms, formRevisions, submissions, issueId) => {
|
|
2584
2584
|
const issue = issues[issueId];
|
|
2585
|
-
if (!issue
|
|
2585
|
+
if (!issue)
|
|
2586
2586
|
return [];
|
|
2587
|
+
if (!issue.issue_type) {
|
|
2588
|
+
return Object.values(submissions).filter((submission) => submission.issue === issueId);
|
|
2587
2589
|
}
|
|
2588
2590
|
const issueTypeForms = new Set(
|
|
2589
2591
|
Object.keys(forms).filter((formId) => forms[formId].issue_type === issue.issue_type)
|
|
@@ -2638,8 +2640,10 @@ var __publicField = (obj, key, value) => {
|
|
|
2638
2640
|
],
|
|
2639
2641
|
(assets, forms, formRevisions, submissions, assetId) => {
|
|
2640
2642
|
const asset = assets[assetId];
|
|
2641
|
-
if (!asset
|
|
2643
|
+
if (!asset)
|
|
2642
2644
|
return [];
|
|
2645
|
+
if (!asset.asset_type) {
|
|
2646
|
+
return Object.values(submissions).filter((submission) => submission.asset === assetId);
|
|
2643
2647
|
}
|
|
2644
2648
|
const issueTypeForms = new Set(
|
|
2645
2649
|
Object.keys(forms).filter((formId) => forms[formId].asset_type === asset.asset_type)
|
|
@@ -2676,11 +2680,11 @@ var __publicField = (obj, key, value) => {
|
|
|
2676
2680
|
const formSubmissionAttachmentAdapter = createModelAdapter(
|
|
2677
2681
|
(attachment) => attachment.offline_id
|
|
2678
2682
|
);
|
|
2679
|
-
const initialState$
|
|
2683
|
+
const initialState$c = formSubmissionAttachmentAdapter.getInitialState({});
|
|
2680
2684
|
const formSubmissionAttachmentSlice = toolkit.createSlice({
|
|
2681
2685
|
name: "formSubmissionAttachments",
|
|
2682
|
-
initialState: initialState$
|
|
2683
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2686
|
+
initialState: initialState$c,
|
|
2687
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$c)),
|
|
2684
2688
|
reducers: {
|
|
2685
2689
|
initializeFormSubmissionAttachments: formSubmissionAttachmentAdapter.initialize,
|
|
2686
2690
|
addFormSubmissionAttachment: formSubmissionAttachmentAdapter.addOne,
|
|
@@ -2719,11 +2723,11 @@ var __publicField = (obj, key, value) => {
|
|
|
2719
2723
|
const formRevisionAttachmentAdapter = createModelAdapter(
|
|
2720
2724
|
(attachment) => attachment.offline_id
|
|
2721
2725
|
);
|
|
2722
|
-
const initialState$
|
|
2726
|
+
const initialState$b = formRevisionAttachmentAdapter.getInitialState({});
|
|
2723
2727
|
const formRevisionAttachmentSlice = toolkit.createSlice({
|
|
2724
2728
|
name: "formRevisionAttachments",
|
|
2725
|
-
initialState: initialState$
|
|
2726
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2729
|
+
initialState: initialState$b,
|
|
2730
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$b)),
|
|
2727
2731
|
reducers: {
|
|
2728
2732
|
initializeFormRevisionAttachments: formRevisionAttachmentAdapter.initialize,
|
|
2729
2733
|
addFormRevisionAttachment: formRevisionAttachmentAdapter.addOne,
|
|
@@ -2760,10 +2764,10 @@ var __publicField = (obj, key, value) => {
|
|
|
2760
2764
|
);
|
|
2761
2765
|
const formRevisionAttachmentReducer = formRevisionAttachmentSlice.reducer;
|
|
2762
2766
|
const emailDomainAdapter = createModelAdapter((emailDomain) => emailDomain.offline_id);
|
|
2763
|
-
const initialState$
|
|
2767
|
+
const initialState$a = emailDomainAdapter.getInitialState({});
|
|
2764
2768
|
const emailDomainsSlice = toolkit.createSlice({
|
|
2765
2769
|
name: "emailDomains",
|
|
2766
|
-
initialState: initialState$
|
|
2770
|
+
initialState: initialState$a,
|
|
2767
2771
|
reducers: {
|
|
2768
2772
|
initializeEmailDomains: emailDomainAdapter.initialize,
|
|
2769
2773
|
addEmailDomain: emailDomainAdapter.addOne,
|
|
@@ -2782,14 +2786,14 @@ var __publicField = (obj, key, value) => {
|
|
|
2782
2786
|
)
|
|
2783
2787
|
);
|
|
2784
2788
|
const emailDomainsReducer = emailDomainsSlice.reducer;
|
|
2785
|
-
const initialState$
|
|
2789
|
+
const initialState$9 = {
|
|
2786
2790
|
documents: {}
|
|
2787
2791
|
};
|
|
2788
2792
|
const documentSlice = toolkit.createSlice({
|
|
2789
2793
|
name: "documents",
|
|
2790
|
-
initialState: initialState$
|
|
2794
|
+
initialState: initialState$9,
|
|
2791
2795
|
extraReducers: (builder) => builder.addCase("RESET", (state) => {
|
|
2792
|
-
Object.assign(state, initialState$
|
|
2796
|
+
Object.assign(state, initialState$9);
|
|
2793
2797
|
}),
|
|
2794
2798
|
reducers: {
|
|
2795
2799
|
setDocuments: (state, action) => {
|
|
@@ -2964,11 +2968,11 @@ var __publicField = (obj, key, value) => {
|
|
|
2964
2968
|
);
|
|
2965
2969
|
const documentsReducer = documentSlice.reducer;
|
|
2966
2970
|
const documentAttachmentAdapter = createModelAdapter((attachment) => attachment.offline_id);
|
|
2967
|
-
const initialState$
|
|
2971
|
+
const initialState$8 = documentAttachmentAdapter.getInitialState({});
|
|
2968
2972
|
const documentAttachmentSlice = toolkit.createSlice({
|
|
2969
2973
|
name: "documentAttachments",
|
|
2970
|
-
initialState: initialState$
|
|
2971
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2974
|
+
initialState: initialState$8,
|
|
2975
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$8)),
|
|
2972
2976
|
reducers: {
|
|
2973
2977
|
initializeDocumentAttachments: documentAttachmentAdapter.initialize,
|
|
2974
2978
|
addDocumentAttachment: documentAttachmentAdapter.addOne,
|
|
@@ -3027,11 +3031,11 @@ var __publicField = (obj, key, value) => {
|
|
|
3027
3031
|
);
|
|
3028
3032
|
const documentAttachmentReducer = documentAttachmentSlice.reducer;
|
|
3029
3033
|
const teamAdapter = createModelAdapter((team) => team.offline_id);
|
|
3030
|
-
const initialState$
|
|
3034
|
+
const initialState$7 = teamAdapter.getInitialState({});
|
|
3031
3035
|
const teamSlice = toolkit.createSlice({
|
|
3032
3036
|
name: "teams",
|
|
3033
|
-
initialState: initialState$
|
|
3034
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
3037
|
+
initialState: initialState$7,
|
|
3038
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$7)),
|
|
3035
3039
|
reducers: {
|
|
3036
3040
|
setTeam: teamAdapter.setOne,
|
|
3037
3041
|
initializeTeams: teamAdapter.initialize,
|
|
@@ -3065,11 +3069,11 @@ var __publicField = (obj, key, value) => {
|
|
|
3065
3069
|
const agentUserConversationAdapter = createModelAdapter(
|
|
3066
3070
|
(conversation) => conversation.offline_id
|
|
3067
3071
|
);
|
|
3068
|
-
const initialState$
|
|
3072
|
+
const initialState$6 = agentUserConversationAdapter.getInitialState({});
|
|
3069
3073
|
const agentsSlice = toolkit.createSlice({
|
|
3070
3074
|
name: "agents",
|
|
3071
|
-
initialState: initialState$
|
|
3072
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
3075
|
+
initialState: initialState$6,
|
|
3076
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$6)),
|
|
3073
3077
|
reducers: {
|
|
3074
3078
|
initializeConversations: agentUserConversationAdapter.initialize,
|
|
3075
3079
|
addConversation: agentUserConversationAdapter.addOne,
|
|
@@ -3091,11 +3095,11 @@ var __publicField = (obj, key, value) => {
|
|
|
3091
3095
|
);
|
|
3092
3096
|
const agentsReducer = agentsSlice.reducer;
|
|
3093
3097
|
const issueCommentAdapter = createModelAdapter((comment) => comment.offline_id);
|
|
3094
|
-
const initialState$
|
|
3098
|
+
const initialState$5 = issueCommentAdapter.getInitialState({});
|
|
3095
3099
|
const issueCommentSlice = toolkit.createSlice({
|
|
3096
3100
|
name: "issueComments",
|
|
3097
|
-
initialState: initialState$
|
|
3098
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
3101
|
+
initialState: initialState$5,
|
|
3102
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$5)),
|
|
3099
3103
|
reducers: {
|
|
3100
3104
|
addIssueComment: issueCommentAdapter.addOne,
|
|
3101
3105
|
addIssueComments: issueCommentAdapter.addMany,
|
|
@@ -3124,11 +3128,11 @@ var __publicField = (obj, key, value) => {
|
|
|
3124
3128
|
);
|
|
3125
3129
|
const issueCommentReducer = issueCommentSlice.reducer;
|
|
3126
3130
|
const issueUpdateAdapter = createModelAdapter((issueUpdate) => issueUpdate.offline_id);
|
|
3127
|
-
const initialState$
|
|
3131
|
+
const initialState$4 = issueUpdateAdapter.getInitialState({});
|
|
3128
3132
|
const issueUpdateSlice = toolkit.createSlice({
|
|
3129
3133
|
name: "issueUpdates",
|
|
3130
|
-
initialState: initialState$
|
|
3131
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
3134
|
+
initialState: initialState$4,
|
|
3135
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$4)),
|
|
3132
3136
|
reducers: {
|
|
3133
3137
|
initializeIssueUpdates: issueUpdateAdapter.setMany,
|
|
3134
3138
|
setIssueUpdate: issueUpdateAdapter.setOne,
|
|
@@ -3157,11 +3161,11 @@ var __publicField = (obj, key, value) => {
|
|
|
3157
3161
|
);
|
|
3158
3162
|
const issueUpdateReducer = issueUpdateSlice.reducer;
|
|
3159
3163
|
const issueAttachmentAdapter = createModelAdapter((attachment) => attachment.offline_id);
|
|
3160
|
-
const initialState$
|
|
3164
|
+
const initialState$3 = issueAttachmentAdapter.getInitialState({});
|
|
3161
3165
|
const issueAttachmentSlice = toolkit.createSlice({
|
|
3162
3166
|
name: "issueAttachments",
|
|
3163
|
-
initialState: initialState$
|
|
3164
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
3167
|
+
initialState: initialState$3,
|
|
3168
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$3)),
|
|
3165
3169
|
reducers: {
|
|
3166
3170
|
initializeIssueAttachments: issueAttachmentAdapter.initialize,
|
|
3167
3171
|
addIssueAttachment: issueAttachmentAdapter.addOne,
|
|
@@ -3219,23 +3223,23 @@ var __publicField = (obj, key, value) => {
|
|
|
3219
3223
|
)
|
|
3220
3224
|
);
|
|
3221
3225
|
const issueAttachmentReducer = issueAttachmentSlice.reducer;
|
|
3222
|
-
const initialState$
|
|
3226
|
+
const initialState$2 = {
|
|
3223
3227
|
version: 0
|
|
3224
3228
|
};
|
|
3225
3229
|
const versioningSlice = toolkit.createSlice({
|
|
3226
3230
|
name: "versioning",
|
|
3227
|
-
initialState: initialState$
|
|
3231
|
+
initialState: initialState$2,
|
|
3228
3232
|
reducers: {}
|
|
3229
3233
|
});
|
|
3230
3234
|
const versioningReducer = versioningSlice.reducer;
|
|
3231
3235
|
const geoImageAdapter = createModelAdapter((model) => model.offline_id);
|
|
3232
|
-
const initialState = geoImageAdapter.getInitialState({});
|
|
3236
|
+
const initialState$1 = geoImageAdapter.getInitialState({});
|
|
3233
3237
|
const geoImageSlice = toolkit.createSlice({
|
|
3234
3238
|
name: "geoImages",
|
|
3235
|
-
initialState,
|
|
3239
|
+
initialState: initialState$1,
|
|
3236
3240
|
extraReducers: (builder) => {
|
|
3237
3241
|
builder.addCase("RESET", (state) => {
|
|
3238
|
-
Object.assign(state, initialState);
|
|
3242
|
+
Object.assign(state, initialState$1);
|
|
3239
3243
|
});
|
|
3240
3244
|
},
|
|
3241
3245
|
reducers: {
|
|
@@ -3272,6 +3276,64 @@ var __publicField = (obj, key, value) => {
|
|
|
3272
3276
|
})
|
|
3273
3277
|
);
|
|
3274
3278
|
const geoImageReducer = geoImageSlice.reducer;
|
|
3279
|
+
const issueAssociationAdapter = createModelAdapter((assoc) => assoc.offline_id);
|
|
3280
|
+
const initialState = issueAssociationAdapter.getInitialState({});
|
|
3281
|
+
const issueAssociationSlice = toolkit.createSlice({
|
|
3282
|
+
name: "issueAssociations",
|
|
3283
|
+
initialState,
|
|
3284
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState)),
|
|
3285
|
+
reducers: {
|
|
3286
|
+
initializeIssueAssociations: issueAssociationAdapter.initialize,
|
|
3287
|
+
addIssueAssociation: issueAssociationAdapter.addOne,
|
|
3288
|
+
addIssueAssociations: issueAssociationAdapter.addMany,
|
|
3289
|
+
setIssueAssociation: issueAssociationAdapter.setOne,
|
|
3290
|
+
setIssueAssociations: issueAssociationAdapter.setMany,
|
|
3291
|
+
updateIssueAssociation: issueAssociationAdapter.updateOne,
|
|
3292
|
+
updateIssueAssociations: issueAssociationAdapter.updateMany,
|
|
3293
|
+
deleteIssueAssociation: issueAssociationAdapter.deleteOne,
|
|
3294
|
+
deleteIssueAssociations: issueAssociationAdapter.deleteMany
|
|
3295
|
+
}
|
|
3296
|
+
});
|
|
3297
|
+
const {
|
|
3298
|
+
initializeIssueAssociations,
|
|
3299
|
+
setIssueAssociations,
|
|
3300
|
+
setIssueAssociation,
|
|
3301
|
+
updateIssueAssociation,
|
|
3302
|
+
updateIssueAssociations,
|
|
3303
|
+
addIssueAssociation,
|
|
3304
|
+
addIssueAssociations,
|
|
3305
|
+
deleteIssueAssociation,
|
|
3306
|
+
deleteIssueAssociations
|
|
3307
|
+
} = issueAssociationSlice.actions;
|
|
3308
|
+
const selectIssueAssociationMapping = (state) => state.issueAssociationReducer.instances;
|
|
3309
|
+
const selectIssueAssociationById = (id) => (state) => {
|
|
3310
|
+
return state.issueAssociationReducer.instances[id];
|
|
3311
|
+
};
|
|
3312
|
+
const selectIssueAssociationsToIssue = restructureCreateSelectorWithArgs(
|
|
3313
|
+
toolkit.createSelector(
|
|
3314
|
+
[selectIssueAssociationMapping, (_state, issueId) => issueId],
|
|
3315
|
+
(associationMapping, issueId) => {
|
|
3316
|
+
return Object.values(associationMapping).filter((assoc) => assoc.associated_issue === issueId);
|
|
3317
|
+
}
|
|
3318
|
+
)
|
|
3319
|
+
);
|
|
3320
|
+
const selectIssueAssociationsOfIssue = restructureCreateSelectorWithArgs(
|
|
3321
|
+
toolkit.createSelector(
|
|
3322
|
+
[selectIssueAssociationMapping, (_state, issueId) => issueId],
|
|
3323
|
+
(associationMapping, issueId) => {
|
|
3324
|
+
return Object.values(associationMapping).filter((assoc) => assoc.issue === issueId);
|
|
3325
|
+
}
|
|
3326
|
+
)
|
|
3327
|
+
);
|
|
3328
|
+
const selectIssueAssociationsOfAsset = restructureCreateSelectorWithArgs(
|
|
3329
|
+
toolkit.createSelector(
|
|
3330
|
+
[selectIssueAssociationMapping, (_state, assetId) => assetId],
|
|
3331
|
+
(associationMapping, assetId) => {
|
|
3332
|
+
return Object.values(associationMapping).filter((assoc) => assoc.asset === assetId);
|
|
3333
|
+
}
|
|
3334
|
+
)
|
|
3335
|
+
);
|
|
3336
|
+
const issueAssociationReducer = issueAssociationSlice.reducer;
|
|
3275
3337
|
const fullAssetMarkerSize = 45;
|
|
3276
3338
|
const DEFAULT_ISSUE_STATUS = IssueStatus.BACKLOG;
|
|
3277
3339
|
const DEFAULT_ISSUE_PRIORITY = IssuePriority.MEDIUM;
|
|
@@ -3344,7 +3406,8 @@ var __publicField = (obj, key, value) => {
|
|
|
3344
3406
|
agentsReducer,
|
|
3345
3407
|
issueCommentReducer,
|
|
3346
3408
|
issueUpdateReducer,
|
|
3347
|
-
geoImageReducer
|
|
3409
|
+
geoImageReducer,
|
|
3410
|
+
issueAssociationReducer
|
|
3348
3411
|
};
|
|
3349
3412
|
const overmapReducer = toolkit.combineReducers(overmapReducers);
|
|
3350
3413
|
const resetStore = "RESET";
|
|
@@ -4135,11 +4198,13 @@ var __publicField = (obj, key, value) => {
|
|
|
4135
4198
|
}
|
|
4136
4199
|
async remove(assetId) {
|
|
4137
4200
|
const { store } = this.client;
|
|
4138
|
-
const
|
|
4201
|
+
const state = store.getState();
|
|
4202
|
+
const assetToBeDeleted = selectAsset(assetId)(state);
|
|
4139
4203
|
if (!assetToBeDeleted)
|
|
4140
4204
|
throw new Error(`No asset with id ${assetId} found in the store`);
|
|
4141
|
-
const attachmentsOfAssets = selectAttachmentsOfAsset(assetId)(
|
|
4142
|
-
const formSubmissionsOfAssets = selectFormSubmissionsOfAsset(assetId)(
|
|
4205
|
+
const attachmentsOfAssets = selectAttachmentsOfAsset(assetId)(state);
|
|
4206
|
+
const formSubmissionsOfAssets = selectFormSubmissionsOfAsset(assetId)(state);
|
|
4207
|
+
const issueAssociations = selectIssueAssociationsOfAsset(assetId)(state);
|
|
4143
4208
|
this.dispatch(deleteAsset(assetId));
|
|
4144
4209
|
if (attachmentsOfAssets.length > 0) {
|
|
4145
4210
|
const attachmentsOfAssetIds = attachmentsOfAssets.map(({ offline_id }) => offline_id);
|
|
@@ -4149,6 +4214,10 @@ var __publicField = (obj, key, value) => {
|
|
|
4149
4214
|
const formSubmissionsOfAssetIds = formSubmissionsOfAssets.map(({ offline_id }) => offline_id);
|
|
4150
4215
|
this.dispatch(deleteFormSubmissions(formSubmissionsOfAssetIds));
|
|
4151
4216
|
}
|
|
4217
|
+
if (issueAssociations.length > 0) {
|
|
4218
|
+
const issueAssociationsIds = issueAssociations.map(({ offline_id }) => offline_id);
|
|
4219
|
+
this.dispatch(deleteIssueAssociations(issueAssociationsIds));
|
|
4220
|
+
}
|
|
4152
4221
|
return this.enqueueRequest({
|
|
4153
4222
|
description: "Delete asset",
|
|
4154
4223
|
method: HttpMethod.DELETE,
|
|
@@ -4159,6 +4228,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4159
4228
|
this.dispatch(addAsset(assetToBeDeleted));
|
|
4160
4229
|
this.dispatch(addAssetAttachments(attachmentsOfAssets));
|
|
4161
4230
|
this.dispatch(addFormSubmissions(formSubmissionsOfAssets));
|
|
4231
|
+
this.dispatch(addIssueAssociations(issueAssociations));
|
|
4162
4232
|
throw err;
|
|
4163
4233
|
});
|
|
4164
4234
|
}
|
|
@@ -5034,6 +5104,12 @@ var __publicField = (obj, key, value) => {
|
|
|
5034
5104
|
const attachmentsOfIssue = selectAttachmentsOfIssue(id)(state);
|
|
5035
5105
|
const updatesOfIssue = selectIssueUpdatesOfIssue(id)(state);
|
|
5036
5106
|
const formSubmissionsOfIssue = selectFormSubmissionsOfIssue(id)(state);
|
|
5107
|
+
const issueAssociationsRecord = {};
|
|
5108
|
+
for (const issueAssociation of selectIssueAssociationsToIssue(id)(state))
|
|
5109
|
+
issueAssociationsRecord[issueAssociation.offline_id] = issueAssociation;
|
|
5110
|
+
for (const issueAssociation of selectIssueAssociationsOfIssue(id)(state))
|
|
5111
|
+
issueAssociationsRecord[issueAssociation.offline_id] = issueAssociation;
|
|
5112
|
+
const issueAssociations = Object.values(issueAssociationsRecord);
|
|
5037
5113
|
this.dispatch(deleteIssue(id));
|
|
5038
5114
|
this.dispatch(addActiveProjectIssuesCount(-1));
|
|
5039
5115
|
if (attachmentsOfIssue.length > 0)
|
|
@@ -5042,6 +5118,8 @@ var __publicField = (obj, key, value) => {
|
|
|
5042
5118
|
this.dispatch(deleteIssueUpdates(updatesOfIssue.map(({ offline_id }) => offline_id)));
|
|
5043
5119
|
if (formSubmissionsOfIssue.length > 0)
|
|
5044
5120
|
this.dispatch(deleteFormSubmissions(formSubmissionsOfIssue.map(({ offline_id }) => offline_id)));
|
|
5121
|
+
if (issueAssociations.length > 0)
|
|
5122
|
+
this.dispatch(deleteIssueAssociations(issueAssociations.map(({ offline_id }) => offline_id)));
|
|
5045
5123
|
try {
|
|
5046
5124
|
return await this.enqueueRequest({
|
|
5047
5125
|
description: "Delete issue",
|
|
@@ -5056,6 +5134,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5056
5134
|
this.dispatch(addIssueUpdates(updatesOfIssue));
|
|
5057
5135
|
this.dispatch(addActiveProjectIssuesCount(1));
|
|
5058
5136
|
this.dispatch(addFormSubmissions(formSubmissionsOfIssue));
|
|
5137
|
+
this.dispatch(addIssueAssociations(issueAssociations));
|
|
5059
5138
|
throw e;
|
|
5060
5139
|
}
|
|
5061
5140
|
}
|
|
@@ -5348,17 +5427,23 @@ var __publicField = (obj, key, value) => {
|
|
|
5348
5427
|
* @throws An APIError if the server returns an error, or any other error that may occur.
|
|
5349
5428
|
*/
|
|
5350
5429
|
async add(project) {
|
|
5430
|
+
if (!project.organization_owner && !project.user_owner) {
|
|
5431
|
+
throw new Error("Project type was not chosen when trying to create a project");
|
|
5432
|
+
}
|
|
5351
5433
|
if (!project.bounds && !project.canvas_bounds) {
|
|
5352
5434
|
throw new Error("Project must either have bounds or canvas_bounds set");
|
|
5353
5435
|
}
|
|
5436
|
+
const isOrganizationProject = !!project.organization_owner;
|
|
5437
|
+
const url = isOrganizationProject ? `/organizations/${project.organization_owner}/projects/` : "/projects/";
|
|
5438
|
+
const projectType = isOrganizationProject ? { organization_owner: project.organization_owner } : { user_owner: project.user_owner };
|
|
5354
5439
|
return await this.enqueueRequest({
|
|
5355
5440
|
description: "Create project",
|
|
5356
5441
|
method: HttpMethod.POST,
|
|
5357
|
-
url
|
|
5442
|
+
url,
|
|
5358
5443
|
payload: {
|
|
5359
5444
|
name: project.name,
|
|
5360
5445
|
bounds: project.bounds,
|
|
5361
|
-
|
|
5446
|
+
...projectType
|
|
5362
5447
|
},
|
|
5363
5448
|
blockers: [],
|
|
5364
5449
|
blocks: []
|
|
@@ -5485,36 +5570,67 @@ var __publicField = (obj, key, value) => {
|
|
|
5485
5570
|
}
|
|
5486
5571
|
return { fields: newFields, images };
|
|
5487
5572
|
};
|
|
5488
|
-
class FormService extends
|
|
5489
|
-
|
|
5490
|
-
|
|
5491
|
-
|
|
5492
|
-
|
|
5493
|
-
|
|
5494
|
-
|
|
5495
|
-
|
|
5496
|
-
|
|
5497
|
-
|
|
5498
|
-
|
|
5499
|
-
|
|
5500
|
-
|
|
5501
|
-
|
|
5502
|
-
|
|
5503
|
-
description: "Attach image to form revision field",
|
|
5504
|
-
method: HttpMethod.POST,
|
|
5505
|
-
url: `/forms/revisions/${offlineRevisionId}/attachments/`,
|
|
5506
|
-
payload: revisionAttachmentPayload,
|
|
5507
|
-
blockers: [revisionAttachmentPayload.revision],
|
|
5508
|
-
blocks: [revisionAttachmentPayload.offline_id]
|
|
5509
|
-
});
|
|
5510
|
-
const offlinePayload = {
|
|
5511
|
-
...revisionAttachmentPayload,
|
|
5512
|
-
file: URL.createObjectURL(image)
|
|
5573
|
+
class FormService extends BaseUploadService {
|
|
5574
|
+
async bulkAddRevisionAttachments(revisionId, files) {
|
|
5575
|
+
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
5576
|
+
const createdBy = this.client.store.getState().userReducer.currentUser.id;
|
|
5577
|
+
const filePayloads = {};
|
|
5578
|
+
const offlineFormRevisionAttachments = [];
|
|
5579
|
+
const attachmentPayloads = [];
|
|
5580
|
+
for (const [fieldIdentifier, file] of Object.entries(files)) {
|
|
5581
|
+
const sha1 = await hashFile(file);
|
|
5582
|
+
if (!(sha1 in filePayloads)) {
|
|
5583
|
+
filePayloads[sha1] = {
|
|
5584
|
+
sha1,
|
|
5585
|
+
file_type: file.type,
|
|
5586
|
+
extension: file.name.split(".").pop(),
|
|
5587
|
+
size: file.size
|
|
5513
5588
|
};
|
|
5514
|
-
this.
|
|
5515
|
-
|
|
5589
|
+
await this.client.files.addCache(file, sha1);
|
|
5590
|
+
}
|
|
5591
|
+
const offlineFormRevisionAttachment = offline({
|
|
5592
|
+
file: URL.createObjectURL(file),
|
|
5593
|
+
file_type: file.type,
|
|
5594
|
+
file_name: file.name,
|
|
5595
|
+
file_sha1: sha1,
|
|
5596
|
+
created_by: createdBy,
|
|
5597
|
+
revision: revisionId,
|
|
5598
|
+
submitted_at: submittedAt,
|
|
5599
|
+
field_identifier: fieldIdentifier
|
|
5516
5600
|
});
|
|
5601
|
+
offlineFormRevisionAttachments.push(offlineFormRevisionAttachment);
|
|
5602
|
+
const attachmentPayload = {
|
|
5603
|
+
offline_id: offlineFormRevisionAttachment.offline_id,
|
|
5604
|
+
name: file.name,
|
|
5605
|
+
field_identifier: fieldIdentifier,
|
|
5606
|
+
sha1
|
|
5607
|
+
};
|
|
5608
|
+
attachmentPayloads.push(attachmentPayload);
|
|
5609
|
+
}
|
|
5610
|
+
this.dispatch(addFormRevisionAttachments(offlineFormRevisionAttachments));
|
|
5611
|
+
const promise = this.enqueueRequest({
|
|
5612
|
+
description: "Attach files to form revision",
|
|
5613
|
+
method: HttpMethod.POST,
|
|
5614
|
+
url: `/forms/revisions/${revisionId}/attachments/bulk/`,
|
|
5615
|
+
payload: {
|
|
5616
|
+
submitted_at: submittedAt,
|
|
5617
|
+
attachments: attachmentPayloads,
|
|
5618
|
+
files: Object.values(filePayloads)
|
|
5619
|
+
},
|
|
5620
|
+
blockers: [revisionId],
|
|
5621
|
+
blocks: offlineFormRevisionAttachments.map((attachment) => attachment.offline_id)
|
|
5517
5622
|
});
|
|
5623
|
+
promise.then((result) => {
|
|
5624
|
+
this.processPresignedUrls(result.presigned_urls);
|
|
5625
|
+
this.dispatch(updateFormRevisionAttachments(result.attachments));
|
|
5626
|
+
}).catch(() => {
|
|
5627
|
+
this.dispatch(
|
|
5628
|
+
deleteFormRevisionAttachments(
|
|
5629
|
+
offlineFormRevisionAttachments.map((attachment) => attachment.offline_id)
|
|
5630
|
+
)
|
|
5631
|
+
);
|
|
5632
|
+
});
|
|
5633
|
+
return [offlineFormRevisionAttachments, promise.then(({ attachments }) => attachments)];
|
|
5518
5634
|
}
|
|
5519
5635
|
async add(ownerId, form, initialRevision, urlPrefix) {
|
|
5520
5636
|
const { fields, images } = await separateImageFromFields(initialRevision.fields);
|
|
@@ -5547,14 +5663,16 @@ var __publicField = (obj, key, value) => {
|
|
|
5547
5663
|
blockers: [ownerId],
|
|
5548
5664
|
blocks: [form.offline_id, offlineFormRevision.offline_id]
|
|
5549
5665
|
});
|
|
5550
|
-
const
|
|
5666
|
+
const [offlineFormRevisionAttachments, attachmentsPromise] = await this.bulkAddRevisionAttachments(
|
|
5667
|
+
offlineFormRevision.offline_id,
|
|
5668
|
+
images
|
|
5669
|
+
);
|
|
5551
5670
|
void formPromise.catch((e) => {
|
|
5552
5671
|
this.dispatch(deleteForm(form.offline_id));
|
|
5553
5672
|
this.dispatch(deleteFormRevision(offlineFormRevision.offline_id));
|
|
5554
5673
|
throw e;
|
|
5555
5674
|
});
|
|
5556
|
-
|
|
5557
|
-
return [form, offlineFormRevision, formPromise, settledPromise];
|
|
5675
|
+
return [form, offlineFormRevision, offlineFormRevisionAttachments, formPromise, attachmentsPromise];
|
|
5558
5676
|
}
|
|
5559
5677
|
addForOrganization(organizationId, initialRevision) {
|
|
5560
5678
|
const state = this.client.store.getState();
|
|
@@ -5636,14 +5754,16 @@ var __publicField = (obj, key, value) => {
|
|
|
5636
5754
|
blockers: [formId],
|
|
5637
5755
|
blocks: [offlineRevision.offline_id]
|
|
5638
5756
|
});
|
|
5639
|
-
const
|
|
5757
|
+
const [offlineFormRevisionAttachments, attachmentsPromise] = await this.bulkAddRevisionAttachments(
|
|
5758
|
+
fullRevision.offline_id,
|
|
5759
|
+
images
|
|
5760
|
+
);
|
|
5640
5761
|
void promise.then((result) => {
|
|
5641
5762
|
this.dispatch(setFormRevision(result));
|
|
5642
5763
|
}).catch(() => {
|
|
5643
5764
|
this.dispatch(deleteFormRevision(fullRevision.offline_id));
|
|
5644
5765
|
});
|
|
5645
|
-
|
|
5646
|
-
return [fullRevision, settledPromise];
|
|
5766
|
+
return [fullRevision, offlineFormRevisionAttachments, promise, attachmentsPromise];
|
|
5647
5767
|
}
|
|
5648
5768
|
async favorite(formId) {
|
|
5649
5769
|
const { store } = this.client;
|
|
@@ -5806,46 +5926,71 @@ var __publicField = (obj, key, value) => {
|
|
|
5806
5926
|
return { values: newValues, files };
|
|
5807
5927
|
};
|
|
5808
5928
|
class FormSubmissionService extends BaseUploadService {
|
|
5809
|
-
|
|
5810
|
-
|
|
5811
|
-
|
|
5812
|
-
|
|
5813
|
-
|
|
5814
|
-
|
|
5815
|
-
|
|
5816
|
-
|
|
5817
|
-
|
|
5818
|
-
|
|
5819
|
-
|
|
5820
|
-
|
|
5821
|
-
|
|
5822
|
-
|
|
5823
|
-
|
|
5824
|
-
const attach = await this.enqueueRequest({
|
|
5825
|
-
description: "Attach file to form submission",
|
|
5826
|
-
method: HttpMethod.POST,
|
|
5827
|
-
url: `/forms/submission/${submission.offline_id}/attachments/`,
|
|
5828
|
-
payload: submissionAttachmentPayload,
|
|
5829
|
-
blockers: [
|
|
5830
|
-
submission.asset,
|
|
5831
|
-
submission.asset_stage,
|
|
5832
|
-
submission.issue,
|
|
5833
|
-
submission.form_revision
|
|
5834
|
-
].filter((x) => x !== void 0),
|
|
5835
|
-
blocks: [submissionAttachmentPayload.offline_id]
|
|
5836
|
-
});
|
|
5837
|
-
const offlinePayload = {
|
|
5838
|
-
...submissionAttachmentPayload,
|
|
5839
|
-
file: URL.createObjectURL(file)
|
|
5929
|
+
async bulkAddSubmissionAttachments(submissionId, files) {
|
|
5930
|
+
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
5931
|
+
const createdBy = this.client.store.getState().userReducer.currentUser.id;
|
|
5932
|
+
const filePayloads = {};
|
|
5933
|
+
const offlineFormSubmissionAttachments = [];
|
|
5934
|
+
const attachmentPayloads = [];
|
|
5935
|
+
for (const [fieldIdentifier, filesArray] of Object.entries(files)) {
|
|
5936
|
+
for (const file of filesArray) {
|
|
5937
|
+
const sha1 = await hashFile(file);
|
|
5938
|
+
if (!(sha1 in filePayloads)) {
|
|
5939
|
+
filePayloads[sha1] = {
|
|
5940
|
+
sha1,
|
|
5941
|
+
file_type: file.type,
|
|
5942
|
+
extension: file.name.split(".").pop(),
|
|
5943
|
+
size: file.size
|
|
5840
5944
|
};
|
|
5841
|
-
this.
|
|
5842
|
-
attachResults.push(attach);
|
|
5945
|
+
await this.client.files.addCache(file, sha1);
|
|
5843
5946
|
}
|
|
5844
|
-
|
|
5845
|
-
|
|
5947
|
+
const offlineFormSubmissionAttachment = offline({
|
|
5948
|
+
file: URL.createObjectURL(file),
|
|
5949
|
+
file_type: file.type,
|
|
5950
|
+
file_name: file.name,
|
|
5951
|
+
file_sha1: sha1,
|
|
5952
|
+
created_by: createdBy,
|
|
5953
|
+
submission: submissionId,
|
|
5954
|
+
submitted_at: submittedAt,
|
|
5955
|
+
field_identifier: fieldIdentifier
|
|
5956
|
+
});
|
|
5957
|
+
offlineFormSubmissionAttachments.push(offlineFormSubmissionAttachment);
|
|
5958
|
+
const attachmentPayload = {
|
|
5959
|
+
offline_id: offlineFormSubmissionAttachment.offline_id,
|
|
5960
|
+
name: file.name,
|
|
5961
|
+
sha1,
|
|
5962
|
+
field_identifier: fieldIdentifier
|
|
5963
|
+
};
|
|
5964
|
+
attachmentPayloads.push(attachmentPayload);
|
|
5965
|
+
}
|
|
5966
|
+
}
|
|
5967
|
+
this.dispatch(addFormSubmissionAttachments(offlineFormSubmissionAttachments));
|
|
5968
|
+
const promise = this.enqueueRequest({
|
|
5969
|
+
description: "Attach files to form submission",
|
|
5970
|
+
method: HttpMethod.POST,
|
|
5971
|
+
url: `/forms/submissions/${submissionId}/attachments/bulk/`,
|
|
5972
|
+
payload: {
|
|
5973
|
+
submitted_at: submittedAt,
|
|
5974
|
+
attachments: attachmentPayloads,
|
|
5975
|
+
files: Object.values(filePayloads)
|
|
5976
|
+
},
|
|
5977
|
+
blockers: [submissionId],
|
|
5978
|
+
blocks: offlineFormSubmissionAttachments.map((attachment) => attachment.offline_id)
|
|
5846
5979
|
});
|
|
5980
|
+
promise.then((result) => {
|
|
5981
|
+
this.processPresignedUrls(result.presigned_urls);
|
|
5982
|
+
this.dispatch(updateFormSubmissionAttachments(result.attachments));
|
|
5983
|
+
}).catch(() => {
|
|
5984
|
+
this.dispatch(
|
|
5985
|
+
deleteFormSubmissionAttachments(
|
|
5986
|
+
offlineFormSubmissionAttachments.map((attachment) => attachment.offline_id)
|
|
5987
|
+
)
|
|
5988
|
+
);
|
|
5989
|
+
});
|
|
5990
|
+
return [offlineFormSubmissionAttachments, promise.then(({ attachments }) => attachments)];
|
|
5847
5991
|
}
|
|
5848
|
-
|
|
5992
|
+
// Outer promise is for hashing and caching files for submission attachments
|
|
5993
|
+
async add(payload) {
|
|
5849
5994
|
const { store } = this.client;
|
|
5850
5995
|
const state = store.getState();
|
|
5851
5996
|
const activeProjectId = state.projectReducer.activeProjectId;
|
|
@@ -5853,12 +5998,12 @@ var __publicField = (obj, key, value) => {
|
|
|
5853
5998
|
throw new Error("Expected an active project");
|
|
5854
5999
|
}
|
|
5855
6000
|
const { values, files } = separateFilesFromValues(payload.values);
|
|
5856
|
-
const offlineSubmission = {
|
|
6001
|
+
const offlineSubmission = offline({
|
|
5857
6002
|
...payload,
|
|
5858
6003
|
values,
|
|
5859
6004
|
created_by: state.userReducer.currentUser.id,
|
|
5860
6005
|
submitted_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
5861
|
-
};
|
|
6006
|
+
});
|
|
5862
6007
|
const promise = this.enqueueRequest({
|
|
5863
6008
|
description: "Respond to form",
|
|
5864
6009
|
method: HttpMethod.POST,
|
|
@@ -5867,20 +6012,22 @@ var __publicField = (obj, key, value) => {
|
|
|
5867
6012
|
blockers: [payload.issue, payload.asset, payload.asset_stage, "add-form-entry"].filter(
|
|
5868
6013
|
(x) => x !== void 0
|
|
5869
6014
|
),
|
|
5870
|
-
blocks: [
|
|
6015
|
+
blocks: [offlineSubmission.offline_id]
|
|
5871
6016
|
});
|
|
5872
|
-
const attachFilesPromises = this.getAttachFilesPromises(files, offlineSubmission);
|
|
5873
6017
|
this.dispatch(addFormSubmission(offlineSubmission));
|
|
5874
|
-
|
|
6018
|
+
const [offlineFormSubmissionAttachments, attachmentsPromise] = await this.bulkAddSubmissionAttachments(
|
|
6019
|
+
offlineSubmission.offline_id,
|
|
6020
|
+
files
|
|
6021
|
+
);
|
|
6022
|
+
promise.then((result) => {
|
|
5875
6023
|
this.dispatch(addActiveProjectFormSubmissionsCount(1));
|
|
5876
6024
|
this.dispatch(setFormSubmission(result));
|
|
5877
6025
|
return result;
|
|
5878
6026
|
}).catch(() => {
|
|
5879
|
-
this.dispatch(deleteFormSubmission(
|
|
6027
|
+
this.dispatch(deleteFormSubmission(offlineSubmission.offline_id));
|
|
5880
6028
|
this.dispatch(addActiveProjectFormSubmissionsCount(-1));
|
|
5881
6029
|
});
|
|
5882
|
-
|
|
5883
|
-
return [offlineSubmission, settledPromise];
|
|
6030
|
+
return [offlineSubmission, offlineFormSubmissionAttachments, promise, attachmentsPromise];
|
|
5884
6031
|
}
|
|
5885
6032
|
// Note currently the bulkAdd method is specific to form submissions for assets
|
|
5886
6033
|
// TODO: adapt the support bulk adding to any model type
|
|
@@ -5981,36 +6128,6 @@ var __publicField = (obj, key, value) => {
|
|
|
5981
6128
|
});
|
|
5982
6129
|
return batchPromises;
|
|
5983
6130
|
}
|
|
5984
|
-
update(submission) {
|
|
5985
|
-
const { store } = this.client;
|
|
5986
|
-
const { values, files } = separateFilesFromValues(submission.values);
|
|
5987
|
-
const attachFilesPromises = this.getAttachFilesPromises(files, submission);
|
|
5988
|
-
const offlineSubmission = {
|
|
5989
|
-
...submission,
|
|
5990
|
-
values
|
|
5991
|
-
};
|
|
5992
|
-
const submissionToBeUpdated = selectFormSubmission(submission.offline_id)(store.getState());
|
|
5993
|
-
if (!submissionToBeUpdated) {
|
|
5994
|
-
throw new Error(`Expected submission with offline_id ${submission.offline_id} to exist`);
|
|
5995
|
-
}
|
|
5996
|
-
this.dispatch(updateFormSubmission(offlineSubmission));
|
|
5997
|
-
const promise = this.enqueueRequest({
|
|
5998
|
-
description: "Patch form submission",
|
|
5999
|
-
method: HttpMethod.PATCH,
|
|
6000
|
-
url: `/forms/submissions/${submission.offline_id}/`,
|
|
6001
|
-
payload: offlineSubmission,
|
|
6002
|
-
blockers: [offlineSubmission.issue, offlineSubmission.asset, offlineSubmission.asset_stage].filter(
|
|
6003
|
-
(x) => x !== void 0
|
|
6004
|
-
),
|
|
6005
|
-
blocks: [offlineSubmission.offline_id]
|
|
6006
|
-
});
|
|
6007
|
-
promise.then((createdSubmission) => {
|
|
6008
|
-
this.dispatch(setFormSubmission(createdSubmission));
|
|
6009
|
-
}).catch(() => {
|
|
6010
|
-
this.dispatch(setFormSubmission(submissionToBeUpdated));
|
|
6011
|
-
});
|
|
6012
|
-
return [offlineSubmission, Promise.all([promise, ...attachFilesPromises]).then(() => promise)];
|
|
6013
|
-
}
|
|
6014
6131
|
async delete(submissionId) {
|
|
6015
6132
|
const { store } = this.client;
|
|
6016
6133
|
const state = store.getState();
|
|
@@ -6481,7 +6598,9 @@ var __publicField = (obj, key, value) => {
|
|
|
6481
6598
|
method: HttpMethod.GET,
|
|
6482
6599
|
url: `/billing/${license.offline_id}/`,
|
|
6483
6600
|
isAuthNeeded: true,
|
|
6484
|
-
blockers: [
|
|
6601
|
+
blockers: [
|
|
6602
|
+
license.organization_owner ? license.organization_owner.toString() : license.user_owner ? license.user_owner.toString() : ""
|
|
6603
|
+
],
|
|
6485
6604
|
blocks: []
|
|
6486
6605
|
});
|
|
6487
6606
|
this.dispatch(updateLicense(result));
|
|
@@ -6493,7 +6612,9 @@ var __publicField = (obj, key, value) => {
|
|
|
6493
6612
|
method: HttpMethod.DELETE,
|
|
6494
6613
|
url: `/billing/${license.offline_id}/suspend/`,
|
|
6495
6614
|
isAuthNeeded: true,
|
|
6496
|
-
blockers: [
|
|
6615
|
+
blockers: [
|
|
6616
|
+
license.organization_owner ? license.organization_owner.toString() : license.user_owner ? license.user_owner.toString() : ""
|
|
6617
|
+
],
|
|
6497
6618
|
blocks: []
|
|
6498
6619
|
});
|
|
6499
6620
|
this.dispatch(updateLicense(result));
|
|
@@ -6505,7 +6626,9 @@ var __publicField = (obj, key, value) => {
|
|
|
6505
6626
|
method: HttpMethod.PATCH,
|
|
6506
6627
|
url: `/billing/${license.offline_id}/suspend/`,
|
|
6507
6628
|
isAuthNeeded: true,
|
|
6508
|
-
blockers: [
|
|
6629
|
+
blockers: [
|
|
6630
|
+
license.organization_owner ? license.organization_owner.toString() : license.user_owner ? license.user_owner.toString() : ""
|
|
6631
|
+
],
|
|
6509
6632
|
blocks: []
|
|
6510
6633
|
});
|
|
6511
6634
|
this.dispatch(updateLicense(result));
|
|
@@ -6517,7 +6640,9 @@ var __publicField = (obj, key, value) => {
|
|
|
6517
6640
|
method: HttpMethod.DELETE,
|
|
6518
6641
|
url: `/billing/${license.offline_id}/`,
|
|
6519
6642
|
isAuthNeeded: true,
|
|
6520
|
-
blockers: [
|
|
6643
|
+
blockers: [
|
|
6644
|
+
license.organization_owner ? license.organization_owner.toString() : license.user_owner ? license.user_owner.toString() : ""
|
|
6645
|
+
],
|
|
6521
6646
|
blocks: []
|
|
6522
6647
|
});
|
|
6523
6648
|
this.dispatch(updateLicense(result));
|
|
@@ -6531,7 +6656,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6531
6656
|
isAuthNeeded: true,
|
|
6532
6657
|
payload: { project: project.id },
|
|
6533
6658
|
blockers: [
|
|
6534
|
-
license.organization_owner ? license.organization_owner.toString() : "",
|
|
6659
|
+
license.organization_owner ? license.organization_owner.toString() : license.user_owner ? license.user_owner.toString() : "",
|
|
6535
6660
|
project.id ? project.id.toString() : ""
|
|
6536
6661
|
],
|
|
6537
6662
|
blocks: ["add-issue", "add-form-entry", "change-access-level", "add-workspace"]
|
|
@@ -6545,7 +6670,9 @@ var __publicField = (obj, key, value) => {
|
|
|
6545
6670
|
method: HttpMethod.DELETE,
|
|
6546
6671
|
url: `/billing/${license.offline_id}/project/`,
|
|
6547
6672
|
isAuthNeeded: true,
|
|
6548
|
-
blockers: [
|
|
6673
|
+
blockers: [
|
|
6674
|
+
license.organization_owner ? license.organization_owner.toString() : license.user_owner ? license.user_owner.toString() : ""
|
|
6675
|
+
],
|
|
6549
6676
|
blocks: ["add-issue", "add-form-entry", "change-access-level", "add-workspace"]
|
|
6550
6677
|
});
|
|
6551
6678
|
this.dispatch(updateLicense(result));
|
|
@@ -6589,27 +6716,20 @@ var __publicField = (obj, key, value) => {
|
|
|
6589
6716
|
}
|
|
6590
6717
|
}
|
|
6591
6718
|
class DocumentService extends BaseApiService {
|
|
6592
|
-
|
|
6593
|
-
add(document2) {
|
|
6719
|
+
add(payload) {
|
|
6594
6720
|
const { store } = this.client;
|
|
6595
6721
|
const currentUserId = store.getState().userReducer.currentUser.id;
|
|
6596
|
-
const
|
|
6597
|
-
|
|
6598
|
-
|
|
6599
|
-
}
|
|
6600
|
-
const offlineDocument = offline(document2);
|
|
6601
|
-
const submittedDocument = {
|
|
6602
|
-
...offlineDocument,
|
|
6722
|
+
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
6723
|
+
const offlineDocument = offline({
|
|
6724
|
+
...payload,
|
|
6603
6725
|
created_by: currentUserId,
|
|
6604
|
-
|
|
6605
|
-
|
|
6606
|
-
|
|
6607
|
-
};
|
|
6608
|
-
this.dispatch(addDocuments([submittedDocument]));
|
|
6726
|
+
submitted_at: submittedAt
|
|
6727
|
+
});
|
|
6728
|
+
this.dispatch(addDocuments([offlineDocument]));
|
|
6609
6729
|
const promise = this.enqueueRequest({
|
|
6610
6730
|
description: "Create Document",
|
|
6611
6731
|
method: HttpMethod.POST,
|
|
6612
|
-
url:
|
|
6732
|
+
url: "/documents/",
|
|
6613
6733
|
payload: offlineDocument,
|
|
6614
6734
|
queryParams: {
|
|
6615
6735
|
parent_document: offlineDocument.parent_document ?? void 0
|
|
@@ -6621,7 +6741,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6621
6741
|
promise.catch(() => {
|
|
6622
6742
|
this.dispatch(removeDocuments([offlineDocument.offline_id]));
|
|
6623
6743
|
});
|
|
6624
|
-
return [
|
|
6744
|
+
return [offlineDocument, promise];
|
|
6625
6745
|
}
|
|
6626
6746
|
update(document2) {
|
|
6627
6747
|
const { store } = this.client;
|
|
@@ -7181,6 +7301,72 @@ var __publicField = (obj, key, value) => {
|
|
|
7181
7301
|
store.dispatch(initializeGeoImages(result));
|
|
7182
7302
|
}
|
|
7183
7303
|
}
|
|
7304
|
+
class IssueAssociationService extends BaseUploadService {
|
|
7305
|
+
add(payload) {
|
|
7306
|
+
const { store } = this.client;
|
|
7307
|
+
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7308
|
+
const createdBy = store.getState().userReducer.currentUser.id;
|
|
7309
|
+
const offlineIssueAssociation = offline({
|
|
7310
|
+
...payload,
|
|
7311
|
+
submitted_at: submittedAt,
|
|
7312
|
+
created_by: createdBy
|
|
7313
|
+
});
|
|
7314
|
+
this.dispatch(addIssueAssociation(offlineIssueAssociation));
|
|
7315
|
+
const promise = this.enqueueRequest({
|
|
7316
|
+
description: "Add issue association",
|
|
7317
|
+
method: HttpMethod.POST,
|
|
7318
|
+
url: "/issues/associations/",
|
|
7319
|
+
payload: {
|
|
7320
|
+
offline_id: offlineIssueAssociation.offline_id,
|
|
7321
|
+
submitted_at: submittedAt,
|
|
7322
|
+
created_by: createdBy,
|
|
7323
|
+
...payload
|
|
7324
|
+
},
|
|
7325
|
+
blockers: [
|
|
7326
|
+
payload.associated_issue,
|
|
7327
|
+
...payload.issue ? [payload.issue] : [],
|
|
7328
|
+
...payload.asset ? [payload.asset] : []
|
|
7329
|
+
],
|
|
7330
|
+
blocks: [offlineIssueAssociation.offline_id]
|
|
7331
|
+
});
|
|
7332
|
+
promise.then((issueAssociation) => {
|
|
7333
|
+
this.dispatch(updateIssueAssociation(issueAssociation));
|
|
7334
|
+
}).catch(() => {
|
|
7335
|
+
this.dispatch(deleteIssueAssociation(offlineIssueAssociation.offline_id));
|
|
7336
|
+
});
|
|
7337
|
+
return [offlineIssueAssociation, promise];
|
|
7338
|
+
}
|
|
7339
|
+
async delete(id) {
|
|
7340
|
+
const { store } = this.client;
|
|
7341
|
+
const issueAssociation = selectIssueAssociationById(id)(store.getState());
|
|
7342
|
+
if (!issueAssociation) {
|
|
7343
|
+
throw new Error(`Issue association with id ${id} not found in store.`);
|
|
7344
|
+
}
|
|
7345
|
+
this.dispatch(deleteIssueAssociation(id));
|
|
7346
|
+
const promise = this.enqueueRequest({
|
|
7347
|
+
description: "Delete issue association",
|
|
7348
|
+
method: HttpMethod.DELETE,
|
|
7349
|
+
url: `/issues/associations/${id}/`,
|
|
7350
|
+
blockers: [id],
|
|
7351
|
+
blocks: []
|
|
7352
|
+
});
|
|
7353
|
+
promise.catch(() => {
|
|
7354
|
+
this.dispatch(addIssueAssociation(issueAssociation));
|
|
7355
|
+
});
|
|
7356
|
+
return promise;
|
|
7357
|
+
}
|
|
7358
|
+
async refreshStore(projectId) {
|
|
7359
|
+
const issueAssociations = await this.enqueueRequest({
|
|
7360
|
+
description: "Fetch issue associations",
|
|
7361
|
+
method: HttpMethod.GET,
|
|
7362
|
+
url: "/issues/associations/",
|
|
7363
|
+
queryParams: { project_id: projectId.toString() },
|
|
7364
|
+
blockers: [],
|
|
7365
|
+
blocks: []
|
|
7366
|
+
});
|
|
7367
|
+
this.dispatch(initializeIssueAssociations(issueAssociations));
|
|
7368
|
+
}
|
|
7369
|
+
}
|
|
7184
7370
|
exports2.APIError = APIError;
|
|
7185
7371
|
exports2.AgentService = AgentService;
|
|
7186
7372
|
exports2.AssetAttachmentService = AssetAttachmentService;
|
|
@@ -7208,6 +7394,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7208
7394
|
exports2.GREEN = GREEN;
|
|
7209
7395
|
exports2.GeoImageService = GeoImageService;
|
|
7210
7396
|
exports2.HttpMethod = HttpMethod;
|
|
7397
|
+
exports2.IssueAssociationService = IssueAssociationService;
|
|
7211
7398
|
exports2.IssueAttachmentService = IssueAttachmentService;
|
|
7212
7399
|
exports2.IssueCommentService = IssueCommentService;
|
|
7213
7400
|
exports2.IssuePriority = IssuePriority;
|
|
@@ -7269,6 +7456,8 @@ var __publicField = (obj, key, value) => {
|
|
|
7269
7456
|
exports2.addGeoImage = addGeoImage;
|
|
7270
7457
|
exports2.addGeoImages = addGeoImages;
|
|
7271
7458
|
exports2.addIssue = addIssue;
|
|
7459
|
+
exports2.addIssueAssociation = addIssueAssociation;
|
|
7460
|
+
exports2.addIssueAssociations = addIssueAssociations;
|
|
7272
7461
|
exports2.addIssueAttachment = addIssueAttachment;
|
|
7273
7462
|
exports2.addIssueAttachments = addIssueAttachments;
|
|
7274
7463
|
exports2.addIssueComment = addIssueComment;
|
|
@@ -7346,6 +7535,8 @@ var __publicField = (obj, key, value) => {
|
|
|
7346
7535
|
exports2.deleteGeoImage = deleteGeoImage;
|
|
7347
7536
|
exports2.deleteGeoImages = deleteGeoImages;
|
|
7348
7537
|
exports2.deleteIssue = deleteIssue;
|
|
7538
|
+
exports2.deleteIssueAssociation = deleteIssueAssociation;
|
|
7539
|
+
exports2.deleteIssueAssociations = deleteIssueAssociations;
|
|
7349
7540
|
exports2.deleteIssueAttachment = deleteIssueAttachment;
|
|
7350
7541
|
exports2.deleteIssueAttachments = deleteIssueAttachments;
|
|
7351
7542
|
exports2.deleteIssueComment = deleteIssueComment;
|
|
@@ -7418,6 +7609,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7418
7609
|
exports2.initializeFormSubmissions = initializeFormSubmissions;
|
|
7419
7610
|
exports2.initializeForms = initializeForms;
|
|
7420
7611
|
exports2.initializeGeoImages = initializeGeoImages;
|
|
7612
|
+
exports2.initializeIssueAssociations = initializeIssueAssociations;
|
|
7421
7613
|
exports2.initializeIssueAttachments = initializeIssueAttachments;
|
|
7422
7614
|
exports2.initializeIssueTypes = initializeIssueTypes;
|
|
7423
7615
|
exports2.initializeIssueUpdates = initializeIssueUpdates;
|
|
@@ -7430,6 +7622,8 @@ var __publicField = (obj, key, value) => {
|
|
|
7430
7622
|
exports2.initializeTeams = initializeTeams;
|
|
7431
7623
|
exports2.initializeWorkspaces = initializeWorkspaces;
|
|
7432
7624
|
exports2.isToday = isToday;
|
|
7625
|
+
exports2.issueAssociationReducer = issueAssociationReducer;
|
|
7626
|
+
exports2.issueAssociationSlice = issueAssociationSlice;
|
|
7433
7627
|
exports2.issueAttachmentReducer = issueAttachmentReducer;
|
|
7434
7628
|
exports2.issueAttachmentSlice = issueAttachmentSlice;
|
|
7435
7629
|
exports2.issueCommentReducer = issueCommentReducer;
|
|
@@ -7585,6 +7779,11 @@ var __publicField = (obj, key, value) => {
|
|
|
7585
7779
|
exports2.selectIsImportingProjectFile = selectIsImportingProjectFile;
|
|
7586
7780
|
exports2.selectIsLoggedIn = selectIsLoggedIn;
|
|
7587
7781
|
exports2.selectIssue = selectIssue;
|
|
7782
|
+
exports2.selectIssueAssociationById = selectIssueAssociationById;
|
|
7783
|
+
exports2.selectIssueAssociationMapping = selectIssueAssociationMapping;
|
|
7784
|
+
exports2.selectIssueAssociationsOfAsset = selectIssueAssociationsOfAsset;
|
|
7785
|
+
exports2.selectIssueAssociationsOfIssue = selectIssueAssociationsOfIssue;
|
|
7786
|
+
exports2.selectIssueAssociationsToIssue = selectIssueAssociationsToIssue;
|
|
7588
7787
|
exports2.selectIssueAttachment = selectIssueAttachment;
|
|
7589
7788
|
exports2.selectIssueAttachmentMapping = selectIssueAttachmentMapping;
|
|
7590
7789
|
exports2.selectIssueAttachments = selectIssueAttachments;
|
|
@@ -7689,6 +7888,8 @@ var __publicField = (obj, key, value) => {
|
|
|
7689
7888
|
exports2.setGeoImages = setGeoImages;
|
|
7690
7889
|
exports2.setIsFetchingInitialData = setIsFetchingInitialData;
|
|
7691
7890
|
exports2.setIsImportingProjectFile = setIsImportingProjectFile;
|
|
7891
|
+
exports2.setIssueAssociation = setIssueAssociation;
|
|
7892
|
+
exports2.setIssueAssociations = setIssueAssociations;
|
|
7692
7893
|
exports2.setIssueAttachment = setIssueAttachment;
|
|
7693
7894
|
exports2.setIssueAttachments = setIssueAttachments;
|
|
7694
7895
|
exports2.setIssueComment = setIssueComment;
|
|
@@ -7742,6 +7943,8 @@ var __publicField = (obj, key, value) => {
|
|
|
7742
7943
|
exports2.updateGeoImage = updateGeoImage;
|
|
7743
7944
|
exports2.updateGeoImages = updateGeoImages;
|
|
7744
7945
|
exports2.updateIssue = updateIssue;
|
|
7946
|
+
exports2.updateIssueAssociation = updateIssueAssociation;
|
|
7947
|
+
exports2.updateIssueAssociations = updateIssueAssociations;
|
|
7745
7948
|
exports2.updateIssueAttachment = updateIssueAttachment;
|
|
7746
7949
|
exports2.updateIssueAttachments = updateIssueAttachments;
|
|
7747
7950
|
exports2.updateIssueType = updateIssueType;
|