@overmap-ai/core 1.0.70-depend-on-forms.0 → 1.0.71-fields.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 +1893 -1055
- package/dist/overmap-core.js.map +1 -1
- package/dist/overmap-core.umd.cjs +1891 -1053
- package/dist/overmap-core.umd.cjs.map +1 -1
- package/dist/sdk/services/AssetAttachmentService.d.ts +32 -8
- package/dist/sdk/services/AssetTypeAttachmentService.d.ts +32 -9
- package/dist/sdk/services/AssetTypeFieldValuesAttachmentService.d.ts +13 -0
- package/dist/sdk/services/AssetTypeFieldValuesService.d.ts +20 -0
- package/dist/sdk/services/AssetTypeFieldsAttachmentService.d.ts +12 -0
- package/dist/sdk/services/AssetTypeFieldsService.d.ts +8 -0
- package/dist/sdk/services/BaseAttachmentService.d.ts +18 -20
- package/dist/sdk/services/BaseUploadService.d.ts +2 -1
- package/dist/sdk/services/DocumentAttachmentService.d.ts +30 -8
- package/dist/sdk/services/FormRevisionAttachmentService.d.ts +12 -0
- package/dist/sdk/services/FormRevisionService.d.ts +8 -0
- package/dist/sdk/services/FormService.d.ts +12 -15
- package/dist/sdk/services/FormSubmissionAttachmentService.d.ts +13 -0
- package/dist/sdk/services/FormSubmissionService.d.ts +9 -29
- package/dist/sdk/services/GeoImageService.d.ts +1 -1
- package/dist/sdk/services/IssueAssociationService.d.ts +2 -2
- package/dist/sdk/services/IssueAttachmentService.d.ts +31 -8
- package/dist/sdk/services/IssueService.d.ts +0 -3
- package/dist/sdk/services/IssueTypeFieldValuesAttachmentService.d.ts +13 -0
- package/dist/sdk/services/IssueTypeFieldValuesService.d.ts +10 -0
- package/dist/sdk/services/IssueTypeFieldsAttachmentService.d.ts +12 -0
- package/dist/sdk/services/IssueTypeFieldsService.d.ts +8 -0
- package/dist/sdk/services/ProjectAttachmentService.d.ts +31 -8
- package/dist/sdk/services/TeamService.d.ts +1 -1
- package/dist/sdk/services/WorkspaceService.d.ts +1 -1
- package/dist/sdk/services/index.d.ts +10 -0
- package/dist/store/slices/assetTypeFieldValuesAttachmentSlice.d.ts +52 -0
- package/dist/store/slices/assetTypeFieldValuesSlice.d.ts +52 -0
- package/dist/store/slices/assetTypeFieldsAttachmentSlice.d.ts +52 -0
- package/dist/store/slices/assetTypeFieldsSlice.d.ts +52 -0
- package/dist/store/slices/formSlice.d.ts +0 -2
- package/dist/store/slices/formSubmissionSlice.d.ts +0 -4
- package/dist/store/slices/index.d.ts +8 -0
- package/dist/store/slices/issueTypeFieldValuesAttachmentSlice.d.ts +52 -0
- package/dist/store/slices/issueTypeFieldValuesSlice.d.ts +52 -0
- package/dist/store/slices/issueTypeFieldsAttachmentSlice.d.ts +52 -0
- package/dist/store/slices/issueTypeFieldsSlice.d.ts +52 -0
- package/dist/store/store.d.ts +9 -1
- package/dist/typings/files.d.ts +8 -4
- package/dist/typings/models/assets.d.ts +15 -0
- package/dist/typings/models/attachments.d.ts +1 -6
- package/dist/typings/models/base.d.ts +1 -2
- package/dist/typings/models/fields.d.ts +16 -0
- package/dist/typings/models/forms.d.ts +12 -27
- package/dist/typings/models/index.d.ts +1 -0
- package/dist/typings/models/issues.d.ts +15 -0
- package/dist/typings/models/license.d.ts +2 -2
- package/dist/typings/models/projects.d.ts +2 -4
- package/dist/typings/models/store.d.ts +9 -1
- package/dist/utils/file.d.ts +2 -2
- package/package.json +1 -1
|
@@ -747,15 +747,15 @@ var __publicField = (obj, key, value) => {
|
|
|
747
747
|
};
|
|
748
748
|
const migrations = [initialVersioning, signOut, signOut, createOutboxState];
|
|
749
749
|
const manifest = Object.fromEntries(migrations.map((migration2, i) => [i, wrapMigration(migration2)]));
|
|
750
|
-
const initialState$
|
|
750
|
+
const initialState$J = {
|
|
751
751
|
accessToken: "",
|
|
752
752
|
refreshToken: "",
|
|
753
753
|
isLoggedIn: false
|
|
754
754
|
};
|
|
755
755
|
const authSlice = toolkit.createSlice({
|
|
756
756
|
name: "auth",
|
|
757
|
-
initialState: initialState$
|
|
758
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
757
|
+
initialState: initialState$J,
|
|
758
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$J)),
|
|
759
759
|
reducers: {
|
|
760
760
|
setTokens: (state, action) => {
|
|
761
761
|
state.accessToken = action.payload.accessToken;
|
|
@@ -843,11 +843,11 @@ var __publicField = (obj, key, value) => {
|
|
|
843
843
|
};
|
|
844
844
|
}
|
|
845
845
|
const categoryAdapter = createModelAdapter((category) => category.offline_id);
|
|
846
|
-
const initialState$
|
|
846
|
+
const initialState$I = categoryAdapter.getInitialState({});
|
|
847
847
|
const categorySlice = toolkit.createSlice({
|
|
848
848
|
name: "categories",
|
|
849
|
-
initialState: initialState$
|
|
850
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
849
|
+
initialState: initialState$I,
|
|
850
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$I)),
|
|
851
851
|
reducers: {
|
|
852
852
|
initializeCategories: categoryAdapter.initialize,
|
|
853
853
|
addCategory: categoryAdapter.addOne,
|
|
@@ -891,11 +891,11 @@ var __publicField = (obj, key, value) => {
|
|
|
891
891
|
};
|
|
892
892
|
const categoryReducer = categorySlice.reducer;
|
|
893
893
|
const assetAdapter = createModelAdapter((asset) => asset.offline_id);
|
|
894
|
-
const initialState$
|
|
894
|
+
const initialState$H = assetAdapter.getInitialState({});
|
|
895
895
|
const assetSlice = toolkit.createSlice({
|
|
896
896
|
name: "assets",
|
|
897
|
-
initialState: initialState$
|
|
898
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
897
|
+
initialState: initialState$H,
|
|
898
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$H)),
|
|
899
899
|
reducers: {
|
|
900
900
|
initializeAssets: assetAdapter.initialize,
|
|
901
901
|
addAsset: assetAdapter.addOne,
|
|
@@ -947,11 +947,11 @@ var __publicField = (obj, key, value) => {
|
|
|
947
947
|
};
|
|
948
948
|
const assetReducer = assetSlice.reducer;
|
|
949
949
|
const assetAttachmentAdapter = createModelAdapter((attachment) => attachment.offline_id);
|
|
950
|
-
const initialState$
|
|
950
|
+
const initialState$G = assetAttachmentAdapter.getInitialState({});
|
|
951
951
|
const assetAttachmentSlice = toolkit.createSlice({
|
|
952
952
|
name: "assetAttachments",
|
|
953
|
-
initialState: initialState$
|
|
954
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
953
|
+
initialState: initialState$G,
|
|
954
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$G)),
|
|
955
955
|
reducers: {
|
|
956
956
|
initializeAssetAttachments: assetAttachmentAdapter.initialize,
|
|
957
957
|
addAssetAttachment: assetAttachmentAdapter.addOne,
|
|
@@ -1012,11 +1012,11 @@ var __publicField = (obj, key, value) => {
|
|
|
1012
1012
|
const assetStageCompletionAdapter = createModelAdapter(
|
|
1013
1013
|
(stageCompletion) => stageCompletion.offline_id
|
|
1014
1014
|
);
|
|
1015
|
-
const initialState$
|
|
1015
|
+
const initialState$F = assetStageCompletionAdapter.getInitialState({});
|
|
1016
1016
|
const assetStageCompletionSlice = toolkit.createSlice({
|
|
1017
1017
|
name: "assetStageCompletions",
|
|
1018
|
-
initialState: initialState$
|
|
1019
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1018
|
+
initialState: initialState$F,
|
|
1019
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$F)),
|
|
1020
1020
|
reducers: {
|
|
1021
1021
|
initializeAssetStageCompletions: assetStageCompletionAdapter.initialize,
|
|
1022
1022
|
addAssetStageCompletion: assetStageCompletionAdapter.addOne,
|
|
@@ -1078,11 +1078,11 @@ var __publicField = (obj, key, value) => {
|
|
|
1078
1078
|
);
|
|
1079
1079
|
const assetStageCompletionReducer = assetStageCompletionSlice.reducer;
|
|
1080
1080
|
const assetStageAdapter = createModelAdapter((assetStage) => assetStage.offline_id);
|
|
1081
|
-
const initialState$
|
|
1081
|
+
const initialState$E = assetStageAdapter.getInitialState({});
|
|
1082
1082
|
const assetStageSlice = toolkit.createSlice({
|
|
1083
1083
|
name: "assetStages",
|
|
1084
|
-
initialState: initialState$
|
|
1085
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1084
|
+
initialState: initialState$E,
|
|
1085
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$E)),
|
|
1086
1086
|
reducers: {
|
|
1087
1087
|
initializeAssetStages: assetStageAdapter.initialize,
|
|
1088
1088
|
setAssetStage: assetStageAdapter.setOne,
|
|
@@ -1162,11 +1162,11 @@ var __publicField = (obj, key, value) => {
|
|
|
1162
1162
|
})
|
|
1163
1163
|
);
|
|
1164
1164
|
const assetTypeAdapter = createModelAdapter((assetType) => assetType.offline_id);
|
|
1165
|
-
const initialState$
|
|
1165
|
+
const initialState$D = assetTypeAdapter.getInitialState({});
|
|
1166
1166
|
const assetTypeSlice = toolkit.createSlice({
|
|
1167
1167
|
name: "assetTypes",
|
|
1168
|
-
initialState: initialState$
|
|
1169
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1168
|
+
initialState: initialState$D,
|
|
1169
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$D)),
|
|
1170
1170
|
reducers: {
|
|
1171
1171
|
initializeAssetTypes: assetTypeAdapter.initialize,
|
|
1172
1172
|
setAssetType: assetTypeAdapter.setOne,
|
|
@@ -1219,11 +1219,11 @@ var __publicField = (obj, key, value) => {
|
|
|
1219
1219
|
const assetTypeAttachmentAdapter = createModelAdapter(
|
|
1220
1220
|
(attachment) => attachment.offline_id
|
|
1221
1221
|
);
|
|
1222
|
-
const initialState$
|
|
1222
|
+
const initialState$C = assetTypeAttachmentAdapter.getInitialState({});
|
|
1223
1223
|
const assetTypeAttachmentSlice = toolkit.createSlice({
|
|
1224
1224
|
name: "assetTypeAttachments",
|
|
1225
|
-
initialState: initialState$
|
|
1226
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1225
|
+
initialState: initialState$C,
|
|
1226
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$C)),
|
|
1227
1227
|
reducers: {
|
|
1228
1228
|
initializeAssetTypeAttachments: assetTypeAttachmentAdapter.initialize,
|
|
1229
1229
|
addAssetTypeAttachment: assetTypeAttachmentAdapter.addOne,
|
|
@@ -1282,12 +1282,12 @@ var __publicField = (obj, key, value) => {
|
|
|
1282
1282
|
);
|
|
1283
1283
|
const assetTypeAttachmentReducer = assetTypeAttachmentSlice.reducer;
|
|
1284
1284
|
const issueAdapter = createModelAdapter((issue) => issue.offline_id);
|
|
1285
|
-
const initialState$
|
|
1285
|
+
const initialState$B = issueAdapter.getInitialState({});
|
|
1286
1286
|
const issueSlice = toolkit.createSlice({
|
|
1287
1287
|
name: "issues",
|
|
1288
|
-
initialState: initialState$
|
|
1288
|
+
initialState: initialState$B,
|
|
1289
1289
|
extraReducers: (builder) => builder.addCase("RESET", (state) => {
|
|
1290
|
-
Object.assign(state, initialState$
|
|
1290
|
+
Object.assign(state, initialState$B);
|
|
1291
1291
|
}),
|
|
1292
1292
|
reducers: {
|
|
1293
1293
|
initializeIssues: issueAdapter.initialize,
|
|
@@ -1319,12 +1319,12 @@ var __publicField = (obj, key, value) => {
|
|
|
1319
1319
|
);
|
|
1320
1320
|
const issueReducer = issueSlice.reducer;
|
|
1321
1321
|
const issueTypeAdapter = createModelAdapter((issueType) => issueType.offline_id);
|
|
1322
|
-
const initialState$
|
|
1322
|
+
const initialState$A = issueTypeAdapter.getInitialState({});
|
|
1323
1323
|
const issueTypeSlice = toolkit.createSlice({
|
|
1324
1324
|
name: "issueTypes",
|
|
1325
|
-
initialState: initialState$
|
|
1325
|
+
initialState: initialState$A,
|
|
1326
1326
|
extraReducers: (builder) => builder.addCase("RESET", (state) => {
|
|
1327
|
-
Object.assign(state, initialState$
|
|
1327
|
+
Object.assign(state, initialState$A);
|
|
1328
1328
|
}),
|
|
1329
1329
|
reducers: {
|
|
1330
1330
|
initializeIssueTypes: issueTypeAdapter.initialize,
|
|
@@ -1381,15 +1381,15 @@ var __publicField = (obj, key, value) => {
|
|
|
1381
1381
|
return selectIssuesOfIssueType(issueTypeId)(state).length;
|
|
1382
1382
|
};
|
|
1383
1383
|
const issueTypeReducer = issueTypeSlice.reducer;
|
|
1384
|
-
const initialState$
|
|
1384
|
+
const initialState$z = {
|
|
1385
1385
|
s3Urls: {}
|
|
1386
1386
|
};
|
|
1387
1387
|
const msPerHour = 1e3 * 60 * 60;
|
|
1388
1388
|
const msPerWeek = msPerHour * 24 * 7;
|
|
1389
1389
|
const fileSlice = toolkit.createSlice({
|
|
1390
1390
|
name: "file",
|
|
1391
|
-
initialState: initialState$
|
|
1392
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1391
|
+
initialState: initialState$z,
|
|
1392
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$z)),
|
|
1393
1393
|
reducers: {
|
|
1394
1394
|
setUploadUrl: (state, action) => {
|
|
1395
1395
|
const { url, fields, sha1 } = action.payload;
|
|
@@ -1416,14 +1416,14 @@ var __publicField = (obj, key, value) => {
|
|
|
1416
1416
|
return url;
|
|
1417
1417
|
};
|
|
1418
1418
|
const fileReducer = fileSlice.reducer;
|
|
1419
|
-
const initialState$
|
|
1419
|
+
const initialState$y = {
|
|
1420
1420
|
users: {},
|
|
1421
1421
|
currentUser: null
|
|
1422
1422
|
};
|
|
1423
1423
|
const userSlice = toolkit.createSlice({
|
|
1424
1424
|
name: "users",
|
|
1425
|
-
initialState: initialState$
|
|
1426
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1425
|
+
initialState: initialState$y,
|
|
1426
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$y)),
|
|
1427
1427
|
reducers: {
|
|
1428
1428
|
setUsers: (state, action) => {
|
|
1429
1429
|
const usersMapping = {};
|
|
@@ -1481,11 +1481,11 @@ var __publicField = (obj, key, value) => {
|
|
|
1481
1481
|
const organizationAccessAdapter = createModelAdapter(
|
|
1482
1482
|
(organizationAccess) => organizationAccess.offline_id
|
|
1483
1483
|
);
|
|
1484
|
-
const initialState$
|
|
1484
|
+
const initialState$x = organizationAccessAdapter.getInitialState({});
|
|
1485
1485
|
const organizationAccessSlice = toolkit.createSlice({
|
|
1486
1486
|
name: "organizationAccess",
|
|
1487
|
-
initialState: initialState$
|
|
1488
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1487
|
+
initialState: initialState$x,
|
|
1488
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$x)),
|
|
1489
1489
|
reducers: {
|
|
1490
1490
|
initializeOrganizationAccesses: organizationAccessAdapter.initialize,
|
|
1491
1491
|
updateOrganizationAccess: organizationAccessAdapter.updateOne,
|
|
@@ -1522,11 +1522,11 @@ var __publicField = (obj, key, value) => {
|
|
|
1522
1522
|
};
|
|
1523
1523
|
const organizationAccessReducer = organizationAccessSlice.reducer;
|
|
1524
1524
|
const licenseAdapter = createModelAdapter((license) => license.offline_id);
|
|
1525
|
-
const initialState$
|
|
1525
|
+
const initialState$w = licenseAdapter.getInitialState({});
|
|
1526
1526
|
const licenseSlice = toolkit.createSlice({
|
|
1527
1527
|
name: "license",
|
|
1528
|
-
initialState: initialState$
|
|
1529
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1528
|
+
initialState: initialState$w,
|
|
1529
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$w)),
|
|
1530
1530
|
reducers: {
|
|
1531
1531
|
initializeLicences: licenseAdapter.initialize,
|
|
1532
1532
|
addLicenses: licenseAdapter.addMany,
|
|
@@ -1551,11 +1551,11 @@ var __publicField = (obj, key, value) => {
|
|
|
1551
1551
|
);
|
|
1552
1552
|
const licenseReducer = licenseSlice.reducer;
|
|
1553
1553
|
const projectAccessAdapter = createModelAdapter((projectAccess) => projectAccess.offline_id);
|
|
1554
|
-
const initialState$
|
|
1554
|
+
const initialState$v = projectAccessAdapter.getInitialState({});
|
|
1555
1555
|
const projectAccessSlice = toolkit.createSlice({
|
|
1556
1556
|
name: "projectAccess",
|
|
1557
|
-
initialState: initialState$
|
|
1558
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1557
|
+
initialState: initialState$v,
|
|
1558
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$v)),
|
|
1559
1559
|
reducers: {
|
|
1560
1560
|
initializeProjectAccesses: projectAccessAdapter.initialize,
|
|
1561
1561
|
updateProjectAccess: projectAccessAdapter.updateOne,
|
|
@@ -1596,14 +1596,14 @@ var __publicField = (obj, key, value) => {
|
|
|
1596
1596
|
return projectAccesses;
|
|
1597
1597
|
};
|
|
1598
1598
|
const projectAccessReducer = projectAccessSlice.reducer;
|
|
1599
|
-
const initialState$
|
|
1599
|
+
const initialState$u = {
|
|
1600
1600
|
projects: {},
|
|
1601
1601
|
activeProjectId: null
|
|
1602
1602
|
};
|
|
1603
1603
|
const projectSlice = toolkit.createSlice({
|
|
1604
1604
|
name: "projects",
|
|
1605
|
-
initialState: initialState$
|
|
1606
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1605
|
+
initialState: initialState$u,
|
|
1606
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$u)),
|
|
1607
1607
|
reducers: {
|
|
1608
1608
|
setProjects: (state, action) => {
|
|
1609
1609
|
const projectsMap = {};
|
|
@@ -1710,13 +1710,13 @@ var __publicField = (obj, key, value) => {
|
|
|
1710
1710
|
});
|
|
1711
1711
|
}
|
|
1712
1712
|
);
|
|
1713
|
-
const initialState$
|
|
1713
|
+
const initialState$t = {
|
|
1714
1714
|
organizations: {}
|
|
1715
1715
|
};
|
|
1716
1716
|
const organizationSlice = toolkit.createSlice({
|
|
1717
1717
|
name: "organizations",
|
|
1718
|
-
initialState: initialState$
|
|
1719
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1718
|
+
initialState: initialState$t,
|
|
1719
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$t)),
|
|
1720
1720
|
reducers: {
|
|
1721
1721
|
setOrganizations: (state, action) => {
|
|
1722
1722
|
for (const org of action.payload) {
|
|
@@ -1807,14 +1807,14 @@ var __publicField = (obj, key, value) => {
|
|
|
1807
1807
|
}
|
|
1808
1808
|
};
|
|
1809
1809
|
};
|
|
1810
|
-
const initialState$
|
|
1810
|
+
const initialState$s = {
|
|
1811
1811
|
deletedRequests: [],
|
|
1812
1812
|
latestRetryTime: 0
|
|
1813
1813
|
};
|
|
1814
1814
|
const outboxSlice = toolkit.createSlice({
|
|
1815
1815
|
name: "outbox",
|
|
1816
|
-
initialState: initialState$
|
|
1817
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1816
|
+
initialState: initialState$s,
|
|
1817
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$s)),
|
|
1818
1818
|
reducers: {
|
|
1819
1819
|
// enqueueActions is a reducer that does nothing but enqueue API request to the Redux Offline outbox
|
|
1820
1820
|
// Whenever an issue is being created, a reducer addIssue() is responsible for adding it to the offline store
|
|
@@ -1846,15 +1846,15 @@ var __publicField = (obj, key, value) => {
|
|
|
1846
1846
|
const selectLatestRetryTime = (state) => state.outboxReducer.latestRetryTime;
|
|
1847
1847
|
const { enqueueRequest, markForDeletion, markAsDeleted, _setLatestRetryTime } = outboxSlice.actions;
|
|
1848
1848
|
const outboxReducer = outboxSlice.reducer;
|
|
1849
|
-
const initialState$
|
|
1849
|
+
const initialState$r = {
|
|
1850
1850
|
projectFiles: {},
|
|
1851
1851
|
activeProjectFileId: null,
|
|
1852
1852
|
isImportingProjectFile: false
|
|
1853
1853
|
};
|
|
1854
1854
|
const projectFileSlice = toolkit.createSlice({
|
|
1855
1855
|
name: "projectFiles",
|
|
1856
|
-
initialState: initialState$
|
|
1857
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1856
|
+
initialState: initialState$r,
|
|
1857
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$r)),
|
|
1858
1858
|
reducers: {
|
|
1859
1859
|
addOrReplaceProjectFiles: (state, action) => {
|
|
1860
1860
|
for (let fileObj of action.payload) {
|
|
@@ -1941,11 +1941,11 @@ var __publicField = (obj, key, value) => {
|
|
|
1941
1941
|
};
|
|
1942
1942
|
const projectFileReducer = projectFileSlice.reducer;
|
|
1943
1943
|
const projectAttachmentAdapter = createModelAdapter((attachment) => attachment.offline_id);
|
|
1944
|
-
const initialState$
|
|
1944
|
+
const initialState$q = projectAttachmentAdapter.getInitialState({});
|
|
1945
1945
|
const projectAttachmentSlice = toolkit.createSlice({
|
|
1946
1946
|
name: "projectAttachments",
|
|
1947
|
-
initialState: initialState$
|
|
1948
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1947
|
+
initialState: initialState$q,
|
|
1948
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$q)),
|
|
1949
1949
|
reducers: {
|
|
1950
1950
|
initializeProjectAttachments: projectAttachmentAdapter.initialize,
|
|
1951
1951
|
addProjectAttachment: projectAttachmentAdapter.addOne,
|
|
@@ -2000,12 +2000,12 @@ var __publicField = (obj, key, value) => {
|
|
|
2000
2000
|
)
|
|
2001
2001
|
);
|
|
2002
2002
|
const projectAttachmentReducer = projectAttachmentSlice.reducer;
|
|
2003
|
-
const initialState$
|
|
2003
|
+
const initialState$p = {
|
|
2004
2004
|
isRehydrated: false
|
|
2005
2005
|
};
|
|
2006
2006
|
const rehydratedSlice = toolkit.createSlice({
|
|
2007
2007
|
name: "rehydrated",
|
|
2008
|
-
initialState: initialState$
|
|
2008
|
+
initialState: initialState$p,
|
|
2009
2009
|
// The `reducers` field lets us define reducers and generate associated actions
|
|
2010
2010
|
reducers: {
|
|
2011
2011
|
setRehydrated: (state, action) => {
|
|
@@ -2030,11 +2030,11 @@ var __publicField = (obj, key, value) => {
|
|
|
2030
2030
|
}
|
|
2031
2031
|
};
|
|
2032
2032
|
const formRevisionAdapter = createModelAdapter((revision) => revision.offline_id);
|
|
2033
|
-
const initialState$
|
|
2033
|
+
const initialState$o = formRevisionAdapter.getInitialState({});
|
|
2034
2034
|
const formRevisionsSlice = toolkit.createSlice({
|
|
2035
2035
|
name: "formRevisions",
|
|
2036
|
-
initialState: initialState$
|
|
2037
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2036
|
+
initialState: initialState$o,
|
|
2037
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$o)),
|
|
2038
2038
|
reducers: {
|
|
2039
2039
|
initializeFormRevisions: formRevisionAdapter.initialize,
|
|
2040
2040
|
setFormRevision: formRevisionAdapter.setOne,
|
|
@@ -2106,11 +2106,11 @@ var __publicField = (obj, key, value) => {
|
|
|
2106
2106
|
});
|
|
2107
2107
|
const formRevisionReducer = formRevisionsSlice.reducer;
|
|
2108
2108
|
const formAdapter = createModelAdapter((form) => form.offline_id);
|
|
2109
|
-
const initialState$
|
|
2109
|
+
const initialState$n = formAdapter.getInitialState({});
|
|
2110
2110
|
const formSlice = toolkit.createSlice({
|
|
2111
2111
|
name: "forms",
|
|
2112
|
-
initialState: initialState$
|
|
2113
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2112
|
+
initialState: initialState$n,
|
|
2113
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$n)),
|
|
2114
2114
|
reducers: {
|
|
2115
2115
|
initializeForms: formAdapter.initialize,
|
|
2116
2116
|
setForm: formAdapter.setOne,
|
|
@@ -2156,34 +2156,18 @@ var __publicField = (obj, key, value) => {
|
|
|
2156
2156
|
const selectFormById = (formId) => (state) => {
|
|
2157
2157
|
return state.formReducer.instances[formId];
|
|
2158
2158
|
};
|
|
2159
|
-
const selectFormOfAssetType = restructureCreateSelectorWithArgs(
|
|
2160
|
-
toolkit.createSelector(
|
|
2161
|
-
[selectFormMapping, (_state, assetTypeId) => assetTypeId],
|
|
2162
|
-
(formsMapping, assetTypeId) => {
|
|
2163
|
-
return Object.values(formsMapping).find((form) => form.asset_type === assetTypeId);
|
|
2164
|
-
}
|
|
2165
|
-
)
|
|
2166
|
-
);
|
|
2167
|
-
const selectFormOfIssueType = restructureCreateSelectorWithArgs(
|
|
2168
|
-
toolkit.createSelector(
|
|
2169
|
-
[selectFormMapping, (_state, issueTypeId) => issueTypeId],
|
|
2170
|
-
(formsMapping, issueTypeId) => {
|
|
2171
|
-
return Object.values(formsMapping).find((form) => form.issue_type === issueTypeId);
|
|
2172
|
-
}
|
|
2173
|
-
)
|
|
2174
|
-
);
|
|
2175
2159
|
const selectFormsCount = toolkit.createSelector([selectFormMapping], (formsMapping) => {
|
|
2176
2160
|
return Object.keys(formsMapping).length;
|
|
2177
2161
|
});
|
|
2178
2162
|
const selectGeneralFormCount = toolkit.createSelector([selectFormMapping], (formsMapping) => {
|
|
2179
|
-
return Object.values(formsMapping).
|
|
2163
|
+
return Object.values(formsMapping).length;
|
|
2180
2164
|
});
|
|
2181
2165
|
const submissionAdapter = createModelAdapter((submission) => submission.offline_id);
|
|
2182
|
-
const initialState$
|
|
2166
|
+
const initialState$m = submissionAdapter.getInitialState({});
|
|
2183
2167
|
const formSubmissionSlice = toolkit.createSlice({
|
|
2184
2168
|
name: "formSubmissions",
|
|
2185
|
-
initialState: initialState$
|
|
2186
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2169
|
+
initialState: initialState$m,
|
|
2170
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$m)),
|
|
2187
2171
|
reducers: {
|
|
2188
2172
|
initializeFormSubmissions: submissionAdapter.initialize,
|
|
2189
2173
|
setFormSubmission: submissionAdapter.setOne,
|
|
@@ -2286,54 +2270,6 @@ var __publicField = (obj, key, value) => {
|
|
|
2286
2270
|
}
|
|
2287
2271
|
)
|
|
2288
2272
|
);
|
|
2289
|
-
const selectAttachedFormSubmissionsOfIssue = restructureCreateSelectorWithArgs(
|
|
2290
|
-
toolkit.createSelector(
|
|
2291
|
-
[
|
|
2292
|
-
(state) => state.issueReducer.instances,
|
|
2293
|
-
(state) => state.formReducer.instances,
|
|
2294
|
-
(state) => state.formRevisionReducer.instances,
|
|
2295
|
-
(state) => state.formSubmissionReducer.instances,
|
|
2296
|
-
(_state, issueId) => issueId
|
|
2297
|
-
],
|
|
2298
|
-
(issues, forms, formRevisions, submissions, issueId) => {
|
|
2299
|
-
const issue = issues[issueId];
|
|
2300
|
-
if (!issue)
|
|
2301
|
-
return [];
|
|
2302
|
-
if (!issue.issue_type) {
|
|
2303
|
-
return Object.values(submissions).filter((submission) => submission.issue === issueId);
|
|
2304
|
-
}
|
|
2305
|
-
const issueTypeForms = new Set(
|
|
2306
|
-
Object.keys(forms).filter((formId) => forms[formId].issue_type === issue.issue_type)
|
|
2307
|
-
);
|
|
2308
|
-
const issueTypeFormRevisions = new Set(
|
|
2309
|
-
Object.keys(formRevisions).filter(
|
|
2310
|
-
(formRevisionId) => issueTypeForms.has(formRevisions[formRevisionId].form)
|
|
2311
|
-
)
|
|
2312
|
-
);
|
|
2313
|
-
return Object.values(submissions).filter(
|
|
2314
|
-
(submission) => submission.issue === issueId && !issueTypeFormRevisions.has(submission.form_revision)
|
|
2315
|
-
);
|
|
2316
|
-
}
|
|
2317
|
-
)
|
|
2318
|
-
);
|
|
2319
|
-
const selectFormSubmissionsByIssues = restructureCreateSelectorWithArgs(
|
|
2320
|
-
toolkit.createSelector(
|
|
2321
|
-
[selectFormSubmissions, (_state, issueIds) => issueIds],
|
|
2322
|
-
(submissions, issueIds) => {
|
|
2323
|
-
var _a2;
|
|
2324
|
-
const issueSubmissions = {};
|
|
2325
|
-
for (const issueId of issueIds) {
|
|
2326
|
-
issueSubmissions[issueId] = [];
|
|
2327
|
-
}
|
|
2328
|
-
for (const submission of submissions) {
|
|
2329
|
-
if (submission.issue && issueIds.includes(submission.issue)) {
|
|
2330
|
-
(_a2 = issueSubmissions[submission.issue]) == null ? void 0 : _a2.push(submission);
|
|
2331
|
-
}
|
|
2332
|
-
}
|
|
2333
|
-
return issueSubmissions;
|
|
2334
|
-
}
|
|
2335
|
-
)
|
|
2336
|
-
);
|
|
2337
2273
|
const selectFormSubmissionsOfAsset = restructureCreateSelectorWithArgs(
|
|
2338
2274
|
toolkit.createSelector(
|
|
2339
2275
|
[selectFormSubmissions, (_state, assetId) => assetId],
|
|
@@ -2344,62 +2280,15 @@ var __publicField = (obj, key, value) => {
|
|
|
2344
2280
|
}
|
|
2345
2281
|
)
|
|
2346
2282
|
);
|
|
2347
|
-
const selectAttachedFormSubmissionsOfAsset = restructureCreateSelectorWithArgs(
|
|
2348
|
-
toolkit.createSelector(
|
|
2349
|
-
[
|
|
2350
|
-
(state) => state.assetReducer.instances,
|
|
2351
|
-
(state) => state.formReducer.instances,
|
|
2352
|
-
(state) => state.formRevisionReducer.instances,
|
|
2353
|
-
(state) => state.formSubmissionReducer.instances,
|
|
2354
|
-
(_state, assetId) => assetId
|
|
2355
|
-
],
|
|
2356
|
-
(assets, forms, formRevisions, submissions, assetId) => {
|
|
2357
|
-
const asset = assets[assetId];
|
|
2358
|
-
if (!asset)
|
|
2359
|
-
return [];
|
|
2360
|
-
if (!asset.asset_type) {
|
|
2361
|
-
return Object.values(submissions).filter((submission) => submission.asset === assetId);
|
|
2362
|
-
}
|
|
2363
|
-
const issueTypeForms = new Set(
|
|
2364
|
-
Object.keys(forms).filter((formId) => forms[formId].asset_type === asset.asset_type)
|
|
2365
|
-
);
|
|
2366
|
-
const issueTypeFormRevisions = new Set(
|
|
2367
|
-
Object.keys(formRevisions).filter(
|
|
2368
|
-
(formRevisionId) => issueTypeForms.has(formRevisions[formRevisionId].form)
|
|
2369
|
-
)
|
|
2370
|
-
);
|
|
2371
|
-
return Object.values(submissions).filter(
|
|
2372
|
-
(submission) => submission.asset === assetId && !issueTypeFormRevisions.has(submission.form_revision)
|
|
2373
|
-
);
|
|
2374
|
-
}
|
|
2375
|
-
)
|
|
2376
|
-
);
|
|
2377
|
-
const selectFormSubmissionsByAssets = toolkit.createSelector(
|
|
2378
|
-
[selectFormSubmissionsMapping, selectAssetsMapping],
|
|
2379
|
-
(submissions, assets) => {
|
|
2380
|
-
var _a2;
|
|
2381
|
-
const assetSubmissionMapping = {};
|
|
2382
|
-
for (const assetId in assets) {
|
|
2383
|
-
assetSubmissionMapping[assetId] = [];
|
|
2384
|
-
}
|
|
2385
|
-
for (const submissionId in submissions) {
|
|
2386
|
-
const submission = submissions[submissionId];
|
|
2387
|
-
if (submission.asset) {
|
|
2388
|
-
(_a2 = assetSubmissionMapping[submission.asset]) == null ? void 0 : _a2.push(submission);
|
|
2389
|
-
}
|
|
2390
|
-
}
|
|
2391
|
-
return assetSubmissionMapping;
|
|
2392
|
-
}
|
|
2393
|
-
);
|
|
2394
2283
|
const formSubmissionReducer = formSubmissionSlice.reducer;
|
|
2395
2284
|
const formSubmissionAttachmentAdapter = createModelAdapter(
|
|
2396
2285
|
(attachment) => attachment.offline_id
|
|
2397
2286
|
);
|
|
2398
|
-
const initialState$
|
|
2287
|
+
const initialState$l = formSubmissionAttachmentAdapter.getInitialState({});
|
|
2399
2288
|
const formSubmissionAttachmentSlice = toolkit.createSlice({
|
|
2400
2289
|
name: "formSubmissionAttachments",
|
|
2401
|
-
initialState: initialState$
|
|
2402
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2290
|
+
initialState: initialState$l,
|
|
2291
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$l)),
|
|
2403
2292
|
reducers: {
|
|
2404
2293
|
initializeFormSubmissionAttachments: formSubmissionAttachmentAdapter.initialize,
|
|
2405
2294
|
addFormSubmissionAttachment: formSubmissionAttachmentAdapter.addOne,
|
|
@@ -2442,7 +2331,9 @@ var __publicField = (obj, key, value) => {
|
|
|
2442
2331
|
[selectFormSubmissionAttachmentsMapping, (_state, submissionId) => submissionId],
|
|
2443
2332
|
(attachmentsMapping, submissionId) => {
|
|
2444
2333
|
return fallbackToEmptyArray(
|
|
2445
|
-
Object.values(attachmentsMapping).filter(
|
|
2334
|
+
Object.values(attachmentsMapping).filter(
|
|
2335
|
+
(attachment) => attachment.form_submission === submissionId
|
|
2336
|
+
)
|
|
2446
2337
|
);
|
|
2447
2338
|
}
|
|
2448
2339
|
)
|
|
@@ -2451,11 +2342,11 @@ var __publicField = (obj, key, value) => {
|
|
|
2451
2342
|
const formRevisionAttachmentAdapter = createModelAdapter(
|
|
2452
2343
|
(attachment) => attachment.offline_id
|
|
2453
2344
|
);
|
|
2454
|
-
const initialState$
|
|
2345
|
+
const initialState$k = formRevisionAttachmentAdapter.getInitialState({});
|
|
2455
2346
|
const formRevisionAttachmentSlice = toolkit.createSlice({
|
|
2456
2347
|
name: "formRevisionAttachments",
|
|
2457
|
-
initialState: initialState$
|
|
2458
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2348
|
+
initialState: initialState$k,
|
|
2349
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$k)),
|
|
2459
2350
|
reducers: {
|
|
2460
2351
|
initializeFormRevisionAttachments: formRevisionAttachmentAdapter.initialize,
|
|
2461
2352
|
addFormRevisionAttachment: formRevisionAttachmentAdapter.addOne,
|
|
@@ -2487,17 +2378,17 @@ var __publicField = (obj, key, value) => {
|
|
|
2487
2378
|
[selectFormRevisionAttachmentsMapping, (_state, revisionId) => revisionId],
|
|
2488
2379
|
(attachments, revisionId) => {
|
|
2489
2380
|
return fallbackToEmptyArray(
|
|
2490
|
-
Object.values(attachments).filter((attachment) => attachment.
|
|
2381
|
+
Object.values(attachments).filter((attachment) => attachment.form_revision === revisionId)
|
|
2491
2382
|
);
|
|
2492
2383
|
}
|
|
2493
2384
|
)
|
|
2494
2385
|
);
|
|
2495
2386
|
const formRevisionAttachmentReducer = formRevisionAttachmentSlice.reducer;
|
|
2496
2387
|
const workspaceAdapter = createModelAdapter((workspace) => workspace.offline_id);
|
|
2497
|
-
const initialState$
|
|
2388
|
+
const initialState$j = workspaceAdapter.getInitialState({});
|
|
2498
2389
|
const workspaceSlice = toolkit.createSlice({
|
|
2499
2390
|
name: "workspace",
|
|
2500
|
-
initialState: initialState$
|
|
2391
|
+
initialState: initialState$j,
|
|
2501
2392
|
reducers: {
|
|
2502
2393
|
initializeWorkspaces: workspaceAdapter.initialize,
|
|
2503
2394
|
setWorkspaces: workspaceAdapter.setMany,
|
|
@@ -2528,10 +2419,10 @@ var __publicField = (obj, key, value) => {
|
|
|
2528
2419
|
);
|
|
2529
2420
|
const workspaceReducer = workspaceSlice.reducer;
|
|
2530
2421
|
const emailDomainAdapter = createModelAdapter((emailDomain) => emailDomain.offline_id);
|
|
2531
|
-
const initialState$
|
|
2422
|
+
const initialState$i = emailDomainAdapter.getInitialState({});
|
|
2532
2423
|
const emailDomainsSlice = toolkit.createSlice({
|
|
2533
2424
|
name: "emailDomains",
|
|
2534
|
-
initialState: initialState$
|
|
2425
|
+
initialState: initialState$i,
|
|
2535
2426
|
reducers: {
|
|
2536
2427
|
initializeEmailDomains: emailDomainAdapter.initialize,
|
|
2537
2428
|
addEmailDomain: emailDomainAdapter.addOne,
|
|
@@ -2552,14 +2443,14 @@ var __publicField = (obj, key, value) => {
|
|
|
2552
2443
|
)
|
|
2553
2444
|
);
|
|
2554
2445
|
const emailDomainsReducer = emailDomainsSlice.reducer;
|
|
2555
|
-
const initialState$
|
|
2446
|
+
const initialState$h = {
|
|
2556
2447
|
documents: {}
|
|
2557
2448
|
};
|
|
2558
2449
|
const documentSlice = toolkit.createSlice({
|
|
2559
2450
|
name: "documents",
|
|
2560
|
-
initialState: initialState$
|
|
2451
|
+
initialState: initialState$h,
|
|
2561
2452
|
extraReducers: (builder) => builder.addCase("RESET", (state) => {
|
|
2562
|
-
Object.assign(state, initialState$
|
|
2453
|
+
Object.assign(state, initialState$h);
|
|
2563
2454
|
}),
|
|
2564
2455
|
reducers: {
|
|
2565
2456
|
setDocuments: (state, action) => {
|
|
@@ -2748,11 +2639,11 @@ var __publicField = (obj, key, value) => {
|
|
|
2748
2639
|
);
|
|
2749
2640
|
const documentsReducer = documentSlice.reducer;
|
|
2750
2641
|
const documentAttachmentAdapter = createModelAdapter((attachment) => attachment.offline_id);
|
|
2751
|
-
const initialState$
|
|
2642
|
+
const initialState$g = documentAttachmentAdapter.getInitialState({});
|
|
2752
2643
|
const documentAttachmentSlice = toolkit.createSlice({
|
|
2753
2644
|
name: "documentAttachments",
|
|
2754
|
-
initialState: initialState$
|
|
2755
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2645
|
+
initialState: initialState$g,
|
|
2646
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$g)),
|
|
2756
2647
|
reducers: {
|
|
2757
2648
|
initializeDocumentAttachments: documentAttachmentAdapter.initialize,
|
|
2758
2649
|
addDocumentAttachment: documentAttachmentAdapter.addOne,
|
|
@@ -2811,11 +2702,11 @@ var __publicField = (obj, key, value) => {
|
|
|
2811
2702
|
);
|
|
2812
2703
|
const documentAttachmentReducer = documentAttachmentSlice.reducer;
|
|
2813
2704
|
const teamAdapter = createModelAdapter((team) => team.offline_id);
|
|
2814
|
-
const initialState$
|
|
2705
|
+
const initialState$f = teamAdapter.getInitialState({});
|
|
2815
2706
|
const teamSlice = toolkit.createSlice({
|
|
2816
2707
|
name: "teams",
|
|
2817
|
-
initialState: initialState$
|
|
2818
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2708
|
+
initialState: initialState$f,
|
|
2709
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$f)),
|
|
2819
2710
|
reducers: {
|
|
2820
2711
|
setTeam: teamAdapter.setOne,
|
|
2821
2712
|
initializeTeams: teamAdapter.initialize,
|
|
@@ -2866,11 +2757,11 @@ var __publicField = (obj, key, value) => {
|
|
|
2866
2757
|
const agentUserConversationAdapter = createModelAdapter(
|
|
2867
2758
|
(conversation) => conversation.offline_id
|
|
2868
2759
|
);
|
|
2869
|
-
const initialState$
|
|
2760
|
+
const initialState$e = agentUserConversationAdapter.getInitialState({});
|
|
2870
2761
|
const agentsSlice = toolkit.createSlice({
|
|
2871
2762
|
name: "agents",
|
|
2872
|
-
initialState: initialState$
|
|
2873
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2763
|
+
initialState: initialState$e,
|
|
2764
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$e)),
|
|
2874
2765
|
reducers: {
|
|
2875
2766
|
initializeConversations: agentUserConversationAdapter.initialize,
|
|
2876
2767
|
addConversation: agentUserConversationAdapter.addOne,
|
|
@@ -2892,11 +2783,11 @@ var __publicField = (obj, key, value) => {
|
|
|
2892
2783
|
);
|
|
2893
2784
|
const agentsReducer = agentsSlice.reducer;
|
|
2894
2785
|
const issueCommentAdapter = createModelAdapter((comment) => comment.offline_id);
|
|
2895
|
-
const initialState$
|
|
2786
|
+
const initialState$d = issueCommentAdapter.getInitialState({});
|
|
2896
2787
|
const issueCommentSlice = toolkit.createSlice({
|
|
2897
2788
|
name: "issueComments",
|
|
2898
|
-
initialState: initialState$
|
|
2899
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2789
|
+
initialState: initialState$d,
|
|
2790
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$d)),
|
|
2900
2791
|
reducers: {
|
|
2901
2792
|
addIssueComment: issueCommentAdapter.addOne,
|
|
2902
2793
|
addIssueComments: issueCommentAdapter.addMany,
|
|
@@ -2925,11 +2816,11 @@ var __publicField = (obj, key, value) => {
|
|
|
2925
2816
|
);
|
|
2926
2817
|
const issueCommentReducer = issueCommentSlice.reducer;
|
|
2927
2818
|
const issueUpdateAdapter = createModelAdapter((issueUpdate) => issueUpdate.offline_id);
|
|
2928
|
-
const initialState$
|
|
2819
|
+
const initialState$c = issueUpdateAdapter.getInitialState({});
|
|
2929
2820
|
const issueUpdateSlice = toolkit.createSlice({
|
|
2930
2821
|
name: "issueUpdates",
|
|
2931
|
-
initialState: initialState$
|
|
2932
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2822
|
+
initialState: initialState$c,
|
|
2823
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$c)),
|
|
2933
2824
|
reducers: {
|
|
2934
2825
|
initializeIssueUpdates: issueUpdateAdapter.setMany,
|
|
2935
2826
|
setIssueUpdate: issueUpdateAdapter.setOne,
|
|
@@ -2958,11 +2849,11 @@ var __publicField = (obj, key, value) => {
|
|
|
2958
2849
|
);
|
|
2959
2850
|
const issueUpdateReducer = issueUpdateSlice.reducer;
|
|
2960
2851
|
const issueAttachmentAdapter = createModelAdapter((attachment) => attachment.offline_id);
|
|
2961
|
-
const initialState$
|
|
2852
|
+
const initialState$b = issueAttachmentAdapter.getInitialState({});
|
|
2962
2853
|
const issueAttachmentSlice = toolkit.createSlice({
|
|
2963
2854
|
name: "issueAttachments",
|
|
2964
|
-
initialState: initialState$
|
|
2965
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2855
|
+
initialState: initialState$b,
|
|
2856
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$b)),
|
|
2966
2857
|
reducers: {
|
|
2967
2858
|
initializeIssueAttachments: issueAttachmentAdapter.initialize,
|
|
2968
2859
|
addIssueAttachment: issueAttachmentAdapter.addOne,
|
|
@@ -3020,23 +2911,23 @@ var __publicField = (obj, key, value) => {
|
|
|
3020
2911
|
)
|
|
3021
2912
|
);
|
|
3022
2913
|
const issueAttachmentReducer = issueAttachmentSlice.reducer;
|
|
3023
|
-
const initialState$
|
|
2914
|
+
const initialState$a = {
|
|
3024
2915
|
version: 0
|
|
3025
2916
|
};
|
|
3026
2917
|
const versioningSlice = toolkit.createSlice({
|
|
3027
2918
|
name: "versioning",
|
|
3028
|
-
initialState: initialState$
|
|
2919
|
+
initialState: initialState$a,
|
|
3029
2920
|
reducers: {}
|
|
3030
2921
|
});
|
|
3031
2922
|
const versioningReducer = versioningSlice.reducer;
|
|
3032
2923
|
const geoImageAdapter = createModelAdapter((model) => model.offline_id);
|
|
3033
|
-
const initialState$
|
|
2924
|
+
const initialState$9 = geoImageAdapter.getInitialState({});
|
|
3034
2925
|
const geoImageSlice = toolkit.createSlice({
|
|
3035
2926
|
name: "geoImages",
|
|
3036
|
-
initialState: initialState$
|
|
2927
|
+
initialState: initialState$9,
|
|
3037
2928
|
extraReducers: (builder) => {
|
|
3038
2929
|
builder.addCase("RESET", (state) => {
|
|
3039
|
-
Object.assign(state, initialState$
|
|
2930
|
+
Object.assign(state, initialState$9);
|
|
3040
2931
|
});
|
|
3041
2932
|
},
|
|
3042
2933
|
reducers: {
|
|
@@ -3074,11 +2965,11 @@ var __publicField = (obj, key, value) => {
|
|
|
3074
2965
|
);
|
|
3075
2966
|
const geoImageReducer = geoImageSlice.reducer;
|
|
3076
2967
|
const issueAssociationAdapter = createModelAdapter((assoc) => assoc.offline_id);
|
|
3077
|
-
const initialState = issueAssociationAdapter.getInitialState({});
|
|
2968
|
+
const initialState$8 = issueAssociationAdapter.getInitialState({});
|
|
3078
2969
|
const issueAssociationSlice = toolkit.createSlice({
|
|
3079
2970
|
name: "issueAssociations",
|
|
3080
|
-
initialState,
|
|
3081
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState)),
|
|
2971
|
+
initialState: initialState$8,
|
|
2972
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$8)),
|
|
3082
2973
|
reducers: {
|
|
3083
2974
|
initializeIssueAssociations: issueAssociationAdapter.initialize,
|
|
3084
2975
|
addIssueAssociation: issueAssociationAdapter.addOne,
|
|
@@ -3136,86 +3027,462 @@ var __publicField = (obj, key, value) => {
|
|
|
3136
3027
|
)
|
|
3137
3028
|
);
|
|
3138
3029
|
const issueAssociationReducer = issueAssociationSlice.reducer;
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
constructor(sdk) {
|
|
3156
|
-
__publicField(this, "client");
|
|
3157
|
-
CLASS_NAME_TO_SERVICE[this.constructor.name] = this;
|
|
3158
|
-
this.client = sdk;
|
|
3159
|
-
}
|
|
3160
|
-
async enqueueRequest(requestDetails) {
|
|
3161
|
-
return this.client.enqueueRequest(requestDetails, this.host, this.constructor.name);
|
|
3162
|
-
}
|
|
3163
|
-
dispatch(action) {
|
|
3164
|
-
this.client.store.dispatch(action);
|
|
3030
|
+
const issueTypeFieldsAdapter = createModelAdapter((fields) => fields.offline_id);
|
|
3031
|
+
const initialState$7 = issueTypeFieldsAdapter.getInitialState({});
|
|
3032
|
+
const issueTypeFieldsSlice = toolkit.createSlice({
|
|
3033
|
+
name: "issueTypeFields",
|
|
3034
|
+
initialState: initialState$7,
|
|
3035
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$7)),
|
|
3036
|
+
reducers: {
|
|
3037
|
+
initializeIssueTypeFields: issueTypeFieldsAdapter.initialize,
|
|
3038
|
+
addIssueTypeFields: issueTypeFieldsAdapter.addOne,
|
|
3039
|
+
addIssueTypeFieldsMany: issueTypeFieldsAdapter.addMany,
|
|
3040
|
+
setIssueTypeFields: issueTypeFieldsAdapter.setOne,
|
|
3041
|
+
setIssueTypeFieldsMany: issueTypeFieldsAdapter.setMany,
|
|
3042
|
+
updateIssueTypeFields: issueTypeFieldsAdapter.updateOne,
|
|
3043
|
+
updateIssueTypeFieldsMany: issueTypeFieldsAdapter.updateMany,
|
|
3044
|
+
deleteIssueTypeFields: issueTypeFieldsAdapter.deleteOne,
|
|
3045
|
+
deleteIssueTypeFieldsMany: issueTypeFieldsAdapter.deleteMany
|
|
3165
3046
|
}
|
|
3166
|
-
}
|
|
3167
|
-
const
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
projectFileReducer,
|
|
3190
|
-
rehydratedReducer,
|
|
3191
|
-
formReducer,
|
|
3192
|
-
formRevisionReducer,
|
|
3193
|
-
formRevisionAttachmentReducer,
|
|
3194
|
-
formSubmissionAttachmentReducer,
|
|
3195
|
-
formSubmissionReducer,
|
|
3196
|
-
userReducer,
|
|
3197
|
-
workspaceReducer,
|
|
3198
|
-
emailDomainsReducer,
|
|
3199
|
-
licenseReducer,
|
|
3200
|
-
documentsReducer,
|
|
3201
|
-
documentAttachmentReducer,
|
|
3202
|
-
teamReducer,
|
|
3203
|
-
agentsReducer,
|
|
3204
|
-
issueCommentReducer,
|
|
3205
|
-
issueUpdateReducer,
|
|
3206
|
-
geoImageReducer,
|
|
3207
|
-
issueAssociationReducer
|
|
3047
|
+
});
|
|
3048
|
+
const {
|
|
3049
|
+
initializeIssueTypeFields,
|
|
3050
|
+
addIssueTypeFields,
|
|
3051
|
+
addIssueTypeFieldsMany,
|
|
3052
|
+
setIssueTypeFields,
|
|
3053
|
+
setIssueTypeFieldsMany,
|
|
3054
|
+
updateIssueTypeFields,
|
|
3055
|
+
updateIssueTypeFieldsMany,
|
|
3056
|
+
deleteIssueTypeFields,
|
|
3057
|
+
deleteIssueTypeFieldsMany
|
|
3058
|
+
} = issueTypeFieldsSlice.actions;
|
|
3059
|
+
const selectIssueTypeFieldsMapping = (state) => state.issueTypeFieldsReducer.instances;
|
|
3060
|
+
const selectIssueTypeFields = toolkit.createSelector([selectIssueTypeFieldsMapping], (fieldsMapping) => {
|
|
3061
|
+
return Object.values(fieldsMapping);
|
|
3062
|
+
});
|
|
3063
|
+
const selectIssueTypeFieldsOfIssueType = restructureCreateSelectorWithArgs(
|
|
3064
|
+
toolkit.createSelector([selectIssueTypeFields, (_state, issueTypeId) => issueTypeId], (fields, issueTypeId) => {
|
|
3065
|
+
return fallbackToEmptyArray(fields.filter((field) => field.issue_type === issueTypeId));
|
|
3066
|
+
})
|
|
3067
|
+
);
|
|
3068
|
+
const selectIssueTypeFieldsById = (fieldsId) => (state) => {
|
|
3069
|
+
return state.issueTypeFieldsReducer.instances[fieldsId];
|
|
3208
3070
|
};
|
|
3209
|
-
const
|
|
3210
|
-
const
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3071
|
+
const issueTypeFieldsReducer = issueTypeFieldsSlice.reducer;
|
|
3072
|
+
const issueTypeFieldValuesAdapter = createModelAdapter(
|
|
3073
|
+
(fieldValues) => fieldValues.offline_id
|
|
3074
|
+
);
|
|
3075
|
+
const initialState$6 = issueTypeFieldValuesAdapter.getInitialState({});
|
|
3076
|
+
const issueTypeFieldValuesSlice = toolkit.createSlice({
|
|
3077
|
+
name: "issueTypeFieldValues",
|
|
3078
|
+
initialState: initialState$6,
|
|
3079
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$6)),
|
|
3080
|
+
reducers: {
|
|
3081
|
+
initializeIssueTypeFieldValues: issueTypeFieldValuesAdapter.initialize,
|
|
3082
|
+
addIssueTypeFieldValues: issueTypeFieldValuesAdapter.addOne,
|
|
3083
|
+
addIssueTypeFieldValuesMany: issueTypeFieldValuesAdapter.addMany,
|
|
3084
|
+
setIssueTypeFieldValues: issueTypeFieldValuesAdapter.setOne,
|
|
3085
|
+
setIssueTypeFieldValuesMany: issueTypeFieldValuesAdapter.setMany,
|
|
3086
|
+
updateIssueTypeFieldValues: issueTypeFieldValuesAdapter.updateOne,
|
|
3087
|
+
updateIssueTypeFieldValuesMany: issueTypeFieldValuesAdapter.updateMany,
|
|
3088
|
+
deleteIssueTypeFieldValues: issueTypeFieldValuesAdapter.deleteOne,
|
|
3089
|
+
deleteIssueTypeFieldValuesMany: issueTypeFieldValuesAdapter.deleteMany
|
|
3214
3090
|
}
|
|
3215
|
-
|
|
3091
|
+
});
|
|
3092
|
+
const {
|
|
3093
|
+
initializeIssueTypeFieldValues,
|
|
3094
|
+
addIssueTypeFieldValues,
|
|
3095
|
+
addIssueTypeFieldValuesMany,
|
|
3096
|
+
setIssueTypeFieldValues,
|
|
3097
|
+
setIssueTypeFieldValuesMany,
|
|
3098
|
+
updateIssueTypeFieldValues,
|
|
3099
|
+
updateIssueTypeFieldValuesMany,
|
|
3100
|
+
deleteIssueTypeFieldValues,
|
|
3101
|
+
deleteIssueTypeFieldValuesMany
|
|
3102
|
+
} = issueTypeFieldValuesSlice.actions;
|
|
3103
|
+
const selectIssueTypeFieldValuesMapping = (state) => state.issueTypeFieldValuesReducer.instances;
|
|
3104
|
+
const selectIssueTypeFieldValues = toolkit.createSelector([selectIssueTypeFieldValuesMapping], (fieldValuesMapping) => {
|
|
3105
|
+
return Object.values(fieldValuesMapping);
|
|
3106
|
+
});
|
|
3107
|
+
const selectIssueTypeFieldValuesOfIssue = restructureCreateSelectorWithArgs(
|
|
3108
|
+
toolkit.createSelector([selectIssueTypeFieldValues, (_state, issueId) => issueId], (fieldValues, issueId) => {
|
|
3109
|
+
return fallbackToEmptyArray(fieldValues.filter((fieldValue) => fieldValue.issue === issueId));
|
|
3110
|
+
})
|
|
3111
|
+
);
|
|
3112
|
+
const selectIssueTypeFieldValuesById = (fieldValuesId) => (state) => {
|
|
3113
|
+
return state.issueTypeFieldValuesReducer.instances[fieldValuesId];
|
|
3216
3114
|
};
|
|
3217
|
-
|
|
3218
|
-
|
|
3115
|
+
const issueTypeFieldValuesReducer = issueTypeFieldValuesSlice.reducer;
|
|
3116
|
+
const issueTypeFieldsAttachmentAdapter = createModelAdapter(
|
|
3117
|
+
(attachment) => attachment.offline_id
|
|
3118
|
+
);
|
|
3119
|
+
const initialState$5 = issueTypeFieldsAttachmentAdapter.getInitialState({});
|
|
3120
|
+
const issueTypeFieldsAttachmentSlice = toolkit.createSlice({
|
|
3121
|
+
name: "issueTypeFieldsAttachments",
|
|
3122
|
+
initialState: initialState$5,
|
|
3123
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$5)),
|
|
3124
|
+
reducers: {
|
|
3125
|
+
initializeIssueTypeFieldsAttachments: issueTypeFieldsAttachmentAdapter.initialize,
|
|
3126
|
+
addIssueTypeFieldsAttachment: issueTypeFieldsAttachmentAdapter.addOne,
|
|
3127
|
+
addIssueTypeFieldsAttachments: issueTypeFieldsAttachmentAdapter.addMany,
|
|
3128
|
+
setIssueTypeFieldsAttachment: issueTypeFieldsAttachmentAdapter.setOne,
|
|
3129
|
+
setIssueTypeFieldsAttachments: issueTypeFieldsAttachmentAdapter.setMany,
|
|
3130
|
+
updateIssueTypeFieldsAttachment: issueTypeFieldsAttachmentAdapter.updateOne,
|
|
3131
|
+
updateIssueTypeFieldsAttachments: issueTypeFieldsAttachmentAdapter.updateMany,
|
|
3132
|
+
deleteIssueTypeFieldsAttachment: issueTypeFieldsAttachmentAdapter.deleteOne,
|
|
3133
|
+
deleteIssueTypeFieldsAttachments: issueTypeFieldsAttachmentAdapter.deleteMany
|
|
3134
|
+
}
|
|
3135
|
+
});
|
|
3136
|
+
const {
|
|
3137
|
+
initializeIssueTypeFieldsAttachments,
|
|
3138
|
+
addIssueTypeFieldsAttachment,
|
|
3139
|
+
addIssueTypeFieldsAttachments,
|
|
3140
|
+
setIssueTypeFieldsAttachment,
|
|
3141
|
+
setIssueTypeFieldsAttachments,
|
|
3142
|
+
updateIssueTypeFieldsAttachment,
|
|
3143
|
+
updateIssueTypeFieldsAttachments,
|
|
3144
|
+
deleteIssueTypeFieldsAttachment,
|
|
3145
|
+
deleteIssueTypeFieldsAttachments
|
|
3146
|
+
} = issueTypeFieldsAttachmentSlice.actions;
|
|
3147
|
+
const selectIssueTypeFieldsAttachmentsMapping = (state) => state.issueTypeFieldsAttachmentReducer.instances;
|
|
3148
|
+
const selectIssueTypeFieldsAttachments = toolkit.createSelector(
|
|
3149
|
+
[selectIssueTypeFieldsAttachmentsMapping],
|
|
3150
|
+
(attachmentsMapping) => {
|
|
3151
|
+
return Object.values(attachmentsMapping);
|
|
3152
|
+
}
|
|
3153
|
+
);
|
|
3154
|
+
const selectAttachmentsOfIssueTypeFields = restructureCreateSelectorWithArgs(
|
|
3155
|
+
toolkit.createSelector(
|
|
3156
|
+
[selectIssueTypeFieldsAttachments, (_state, fieldsRevision) => fieldsRevision],
|
|
3157
|
+
(attachments, fieldsRevision) => {
|
|
3158
|
+
return fallbackToEmptyArray(
|
|
3159
|
+
attachments.filter((attachment) => attachment.fields_revision === fieldsRevision)
|
|
3160
|
+
);
|
|
3161
|
+
}
|
|
3162
|
+
)
|
|
3163
|
+
);
|
|
3164
|
+
const selectIssueTypeFieldsAttachmentById = (attachmentId) => (state) => {
|
|
3165
|
+
return state.issueTypeFieldsAttachmentReducer.instances[attachmentId];
|
|
3166
|
+
};
|
|
3167
|
+
const issueTypeFieldsAttachmentReducer = issueTypeFieldsAttachmentSlice.reducer;
|
|
3168
|
+
const issueTypeFieldValuesAttachmentAdapter = createModelAdapter(
|
|
3169
|
+
(attachment) => attachment.offline_id
|
|
3170
|
+
);
|
|
3171
|
+
const initialState$4 = issueTypeFieldValuesAttachmentAdapter.getInitialState({});
|
|
3172
|
+
const issueTypeFieldValuesAttachmentSlice = toolkit.createSlice({
|
|
3173
|
+
name: "issueTypeFieldValuesAttachments",
|
|
3174
|
+
initialState: initialState$4,
|
|
3175
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$4)),
|
|
3176
|
+
reducers: {
|
|
3177
|
+
initializeIssueTypeFieldValuesAttachments: issueTypeFieldValuesAttachmentAdapter.initialize,
|
|
3178
|
+
addIssueTypeFieldValuesAttachment: issueTypeFieldValuesAttachmentAdapter.addOne,
|
|
3179
|
+
addIssueTypeFieldValuesAttachments: issueTypeFieldValuesAttachmentAdapter.addMany,
|
|
3180
|
+
setIssueTypeFieldValuesAttachment: issueTypeFieldValuesAttachmentAdapter.setOne,
|
|
3181
|
+
setIssueTypeFieldValuesAttachments: issueTypeFieldValuesAttachmentAdapter.setMany,
|
|
3182
|
+
updateIssueTypeFieldValuesAttachment: issueTypeFieldValuesAttachmentAdapter.updateOne,
|
|
3183
|
+
updateIssueTypeFieldValuesAttachments: issueTypeFieldValuesAttachmentAdapter.updateMany,
|
|
3184
|
+
deleteIssueTypeFieldValuesAttachment: issueTypeFieldValuesAttachmentAdapter.deleteOne,
|
|
3185
|
+
deleteIssueTypeFieldValuesAttachments: issueTypeFieldValuesAttachmentAdapter.deleteMany
|
|
3186
|
+
}
|
|
3187
|
+
});
|
|
3188
|
+
const {
|
|
3189
|
+
initializeIssueTypeFieldValuesAttachments,
|
|
3190
|
+
addIssueTypeFieldValuesAttachment,
|
|
3191
|
+
addIssueTypeFieldValuesAttachments,
|
|
3192
|
+
setIssueTypeFieldValuesAttachment,
|
|
3193
|
+
setIssueTypeFieldValuesAttachments,
|
|
3194
|
+
updateIssueTypeFieldValuesAttachment,
|
|
3195
|
+
updateIssueTypeFieldValuesAttachments,
|
|
3196
|
+
deleteIssueTypeFieldValuesAttachment,
|
|
3197
|
+
deleteIssueTypeFieldValuesAttachments
|
|
3198
|
+
} = issueTypeFieldValuesAttachmentSlice.actions;
|
|
3199
|
+
const selectIssueTypeFieldValuesAttachmentsMapping = (state) => state.issueTypeFieldValuesAttachmentReducer.instances;
|
|
3200
|
+
const selectIssueTypeFieldValuesAttachments = toolkit.createSelector(
|
|
3201
|
+
[selectIssueTypeFieldValuesAttachmentsMapping],
|
|
3202
|
+
(attachmentsMapping) => {
|
|
3203
|
+
return Object.values(attachmentsMapping);
|
|
3204
|
+
}
|
|
3205
|
+
);
|
|
3206
|
+
const selectAttachmentsOfIssueTypeFieldValues = restructureCreateSelectorWithArgs(
|
|
3207
|
+
toolkit.createSelector(
|
|
3208
|
+
[selectIssueTypeFieldValuesAttachments, (_state, fieldValuesId) => fieldValuesId],
|
|
3209
|
+
(attachments, fieldValuesId) => {
|
|
3210
|
+
return fallbackToEmptyArray(attachments.filter((attachment) => attachment.field_values === fieldValuesId));
|
|
3211
|
+
}
|
|
3212
|
+
)
|
|
3213
|
+
);
|
|
3214
|
+
const selectIssueTypeFieldValuesAttachmentById = (attachmentId) => (state) => {
|
|
3215
|
+
return state.issueTypeFieldValuesAttachmentReducer.instances[attachmentId];
|
|
3216
|
+
};
|
|
3217
|
+
const issueTypeFieldValuesAttachmentReducer = issueTypeFieldValuesAttachmentSlice.reducer;
|
|
3218
|
+
const assetTypeFieldsAdapter = createModelAdapter((fields) => fields.offline_id);
|
|
3219
|
+
const initialState$3 = assetTypeFieldsAdapter.getInitialState({});
|
|
3220
|
+
const assetTypeFieldsSlice = toolkit.createSlice({
|
|
3221
|
+
name: "assetTypeFields",
|
|
3222
|
+
initialState: initialState$3,
|
|
3223
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$3)),
|
|
3224
|
+
reducers: {
|
|
3225
|
+
initializeAssetTypeFields: assetTypeFieldsAdapter.initialize,
|
|
3226
|
+
addAssetTypeFields: assetTypeFieldsAdapter.addOne,
|
|
3227
|
+
addAssetTypeFieldsMany: assetTypeFieldsAdapter.addMany,
|
|
3228
|
+
setAssetTypeFields: assetTypeFieldsAdapter.setOne,
|
|
3229
|
+
setAssetTypeFieldsMany: assetTypeFieldsAdapter.setMany,
|
|
3230
|
+
updateAssetTypeFields: assetTypeFieldsAdapter.updateOne,
|
|
3231
|
+
updateAssetTypeFieldsMany: assetTypeFieldsAdapter.updateMany,
|
|
3232
|
+
deleteAssetTypeFields: assetTypeFieldsAdapter.deleteOne,
|
|
3233
|
+
deleteAssetTypeFieldsMany: assetTypeFieldsAdapter.deleteMany
|
|
3234
|
+
}
|
|
3235
|
+
});
|
|
3236
|
+
const {
|
|
3237
|
+
initializeAssetTypeFields,
|
|
3238
|
+
addAssetTypeFields,
|
|
3239
|
+
addAssetTypeFieldsMany,
|
|
3240
|
+
setAssetTypeFields,
|
|
3241
|
+
setAssetTypeFieldsMany,
|
|
3242
|
+
updateAssetTypeFields,
|
|
3243
|
+
updateAssetTypeFieldsMany,
|
|
3244
|
+
deleteAssetTypeFields,
|
|
3245
|
+
deleteAssetTypeFieldsMany
|
|
3246
|
+
} = assetTypeFieldsSlice.actions;
|
|
3247
|
+
const selectAssetTypeFieldsMapping = (state) => state.assetTypeFieldsReducer.instances;
|
|
3248
|
+
const selectAssetTypeFields = toolkit.createSelector([selectAssetTypeFieldsMapping], (fieldsMapping) => {
|
|
3249
|
+
return Object.values(fieldsMapping);
|
|
3250
|
+
});
|
|
3251
|
+
const selectAssetTypeFieldsOfAssetType = restructureCreateSelectorWithArgs(
|
|
3252
|
+
toolkit.createSelector([selectAssetTypeFields, (_state, assetTypeId) => assetTypeId], (fields, assetTypeId) => {
|
|
3253
|
+
return fallbackToEmptyArray(fields.filter((field) => field.asset_type === assetTypeId));
|
|
3254
|
+
})
|
|
3255
|
+
);
|
|
3256
|
+
const selectAssetTypeFieldsById = (fieldsId) => (state) => {
|
|
3257
|
+
return state.assetTypeFieldsReducer.instances[fieldsId];
|
|
3258
|
+
};
|
|
3259
|
+
const assetTypeFieldsReducer = assetTypeFieldsSlice.reducer;
|
|
3260
|
+
const assetTypeFieldValuesAdapter = createModelAdapter(
|
|
3261
|
+
(fieldValues) => fieldValues.offline_id
|
|
3262
|
+
);
|
|
3263
|
+
const initialState$2 = assetTypeFieldValuesAdapter.getInitialState({});
|
|
3264
|
+
const assetTypeFieldValuesSlice = toolkit.createSlice({
|
|
3265
|
+
name: "assetTypeFieldValues",
|
|
3266
|
+
initialState: initialState$2,
|
|
3267
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$2)),
|
|
3268
|
+
reducers: {
|
|
3269
|
+
initializeAssetTypeFieldValues: assetTypeFieldValuesAdapter.initialize,
|
|
3270
|
+
addAssetTypeFieldValues: assetTypeFieldValuesAdapter.addOne,
|
|
3271
|
+
addAssetTypeFieldValuesMany: assetTypeFieldValuesAdapter.addMany,
|
|
3272
|
+
setAssetTypeFieldValues: assetTypeFieldValuesAdapter.setOne,
|
|
3273
|
+
setAssetTypeFieldValuesMany: assetTypeFieldValuesAdapter.setMany,
|
|
3274
|
+
updateAssetTypeFieldValues: assetTypeFieldValuesAdapter.updateOne,
|
|
3275
|
+
updateAssetTypeFieldValuesMany: assetTypeFieldValuesAdapter.updateMany,
|
|
3276
|
+
deleteAssetTypeFieldValues: assetTypeFieldValuesAdapter.deleteOne,
|
|
3277
|
+
deleteAssetTypeFieldValuesMany: assetTypeFieldValuesAdapter.deleteMany
|
|
3278
|
+
}
|
|
3279
|
+
});
|
|
3280
|
+
const {
|
|
3281
|
+
initializeAssetTypeFieldValues,
|
|
3282
|
+
addAssetTypeFieldValues,
|
|
3283
|
+
addAssetTypeFieldValuesMany,
|
|
3284
|
+
setAssetTypeFieldValues,
|
|
3285
|
+
setAssetTypeFieldValuesMany,
|
|
3286
|
+
updateAssetTypeFieldValues,
|
|
3287
|
+
updateAssetTypeFieldValuesMany,
|
|
3288
|
+
deleteAssetTypeFieldValues,
|
|
3289
|
+
deleteAssetTypeFieldValuesMany
|
|
3290
|
+
} = assetTypeFieldValuesSlice.actions;
|
|
3291
|
+
const selectAssetTypeFieldValuesMapping = (state) => state.assetTypeFieldValuesReducer.instances;
|
|
3292
|
+
const selectAssetTypeFieldValues = toolkit.createSelector([selectAssetTypeFieldValuesMapping], (fieldValuesMapping) => {
|
|
3293
|
+
return Object.values(fieldValuesMapping);
|
|
3294
|
+
});
|
|
3295
|
+
const selectAssetTypeFieldValuesOfAsset = restructureCreateSelectorWithArgs(
|
|
3296
|
+
toolkit.createSelector([selectAssetTypeFieldValues, (_state, assetId) => assetId], (fieldValues, assetId) => {
|
|
3297
|
+
return fallbackToEmptyArray(fieldValues.filter((fieldValue) => fieldValue.asset === assetId));
|
|
3298
|
+
})
|
|
3299
|
+
);
|
|
3300
|
+
const selectAssetTypeFieldValuesById = (fieldValuesId) => (state) => {
|
|
3301
|
+
return state.assetTypeFieldValuesReducer.instances[fieldValuesId];
|
|
3302
|
+
};
|
|
3303
|
+
const assetTypeFieldValuesReducer = assetTypeFieldValuesSlice.reducer;
|
|
3304
|
+
const assetTypeFieldsAttachmentAdapter = createModelAdapter(
|
|
3305
|
+
(attachment) => attachment.offline_id
|
|
3306
|
+
);
|
|
3307
|
+
const initialState$1 = assetTypeFieldsAttachmentAdapter.getInitialState({});
|
|
3308
|
+
const assetTypeFieldsAttachmentSlice = toolkit.createSlice({
|
|
3309
|
+
name: "assetTypeFieldsAttachments",
|
|
3310
|
+
initialState: initialState$1,
|
|
3311
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$1)),
|
|
3312
|
+
reducers: {
|
|
3313
|
+
initializeAssetTypeFieldsAttachments: assetTypeFieldsAttachmentAdapter.initialize,
|
|
3314
|
+
addAssetTypeFieldsAttachment: assetTypeFieldsAttachmentAdapter.addOne,
|
|
3315
|
+
addAssetTypeFieldsAttachments: assetTypeFieldsAttachmentAdapter.addMany,
|
|
3316
|
+
setAssetTypeFieldsAttachment: assetTypeFieldsAttachmentAdapter.setOne,
|
|
3317
|
+
setAssetTypeFieldsAttachments: assetTypeFieldsAttachmentAdapter.setMany,
|
|
3318
|
+
updateAssetTypeFieldsAttachment: assetTypeFieldsAttachmentAdapter.updateOne,
|
|
3319
|
+
updateAssetTypeFieldsAttachments: assetTypeFieldsAttachmentAdapter.updateMany,
|
|
3320
|
+
deleteAssetTypeFieldsAttachment: assetTypeFieldsAttachmentAdapter.deleteOne,
|
|
3321
|
+
deleteAssetTypeFieldsAttachments: assetTypeFieldsAttachmentAdapter.deleteMany
|
|
3322
|
+
}
|
|
3323
|
+
});
|
|
3324
|
+
const {
|
|
3325
|
+
initializeAssetTypeFieldsAttachments,
|
|
3326
|
+
addAssetTypeFieldsAttachment,
|
|
3327
|
+
addAssetTypeFieldsAttachments,
|
|
3328
|
+
setAssetTypeFieldsAttachment,
|
|
3329
|
+
setAssetTypeFieldsAttachments,
|
|
3330
|
+
updateAssetTypeFieldsAttachment,
|
|
3331
|
+
updateAssetTypeFieldsAttachments,
|
|
3332
|
+
deleteAssetTypeFieldsAttachment,
|
|
3333
|
+
deleteAssetTypeFieldsAttachments
|
|
3334
|
+
} = assetTypeFieldsAttachmentSlice.actions;
|
|
3335
|
+
const selectAssetTypeFieldsAttachmentsMapping = (state) => state.assetTypeFieldsAttachmentReducer.instances;
|
|
3336
|
+
const selectAssetTypeFieldsAttachments = toolkit.createSelector(
|
|
3337
|
+
[selectAssetTypeFieldsAttachmentsMapping],
|
|
3338
|
+
(attachmentsMapping) => {
|
|
3339
|
+
return Object.values(attachmentsMapping);
|
|
3340
|
+
}
|
|
3341
|
+
);
|
|
3342
|
+
const selectAttachmentsOfAssetTypeFields = restructureCreateSelectorWithArgs(
|
|
3343
|
+
toolkit.createSelector([selectAssetTypeFieldsAttachments, (_state, id) => id], (attachments, id) => {
|
|
3344
|
+
return fallbackToEmptyArray(attachments.filter((attachment) => attachment.fields_revision === id));
|
|
3345
|
+
})
|
|
3346
|
+
);
|
|
3347
|
+
const selectAssetTypeFieldsAttachmentById = (attachmentId) => (state) => {
|
|
3348
|
+
return state.assetTypeFieldsAttachmentReducer.instances[attachmentId];
|
|
3349
|
+
};
|
|
3350
|
+
const assetTypeFieldsAttachmentReducer = assetTypeFieldsAttachmentSlice.reducer;
|
|
3351
|
+
const assetTypeFieldValuesAttachmentAdapter = createModelAdapter(
|
|
3352
|
+
(attachment) => attachment.offline_id
|
|
3353
|
+
);
|
|
3354
|
+
const initialState = assetTypeFieldValuesAttachmentAdapter.getInitialState({});
|
|
3355
|
+
const assetTypeFieldValuesAttachmentSlice = toolkit.createSlice({
|
|
3356
|
+
name: "assetTypeFieldValuesAttachments",
|
|
3357
|
+
initialState,
|
|
3358
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState)),
|
|
3359
|
+
reducers: {
|
|
3360
|
+
initializeAssetTypeFieldValuesAttachments: assetTypeFieldValuesAttachmentAdapter.initialize,
|
|
3361
|
+
addAssetTypeFieldValuesAttachment: assetTypeFieldValuesAttachmentAdapter.addOne,
|
|
3362
|
+
addAssetTypeFieldValuesAttachments: assetTypeFieldValuesAttachmentAdapter.addMany,
|
|
3363
|
+
setAssetTypeFieldValuesAttachment: assetTypeFieldValuesAttachmentAdapter.setOne,
|
|
3364
|
+
setAssetTypeFieldValuesAttachments: assetTypeFieldValuesAttachmentAdapter.setMany,
|
|
3365
|
+
updateAssetTypeFieldValuesAttachment: assetTypeFieldValuesAttachmentAdapter.updateOne,
|
|
3366
|
+
updateAssetTypeFieldValuesAttachments: assetTypeFieldValuesAttachmentAdapter.updateMany,
|
|
3367
|
+
deleteAssetTypeFieldValuesAttachment: assetTypeFieldValuesAttachmentAdapter.deleteOne,
|
|
3368
|
+
deleteAssetTypeFieldValuesAttachments: assetTypeFieldValuesAttachmentAdapter.deleteMany
|
|
3369
|
+
}
|
|
3370
|
+
});
|
|
3371
|
+
const {
|
|
3372
|
+
initializeAssetTypeFieldValuesAttachments,
|
|
3373
|
+
addAssetTypeFieldValuesAttachment,
|
|
3374
|
+
addAssetTypeFieldValuesAttachments,
|
|
3375
|
+
setAssetTypeFieldValuesAttachment,
|
|
3376
|
+
setAssetTypeFieldValuesAttachments,
|
|
3377
|
+
updateAssetTypeFieldValuesAttachment,
|
|
3378
|
+
updateAssetTypeFieldValuesAttachments,
|
|
3379
|
+
deleteAssetTypeFieldValuesAttachment,
|
|
3380
|
+
deleteAssetTypeFieldValuesAttachments
|
|
3381
|
+
} = assetTypeFieldValuesAttachmentSlice.actions;
|
|
3382
|
+
const selectAssetTypeFieldValuesAttachmentsMapping = (state) => state.assetTypeFieldValuesAttachmentReducer.instances;
|
|
3383
|
+
const selectAssetTypeFieldValuesAttachments = toolkit.createSelector(
|
|
3384
|
+
[selectAssetTypeFieldValuesAttachmentsMapping],
|
|
3385
|
+
(attachmentsMapping) => {
|
|
3386
|
+
return Object.values(attachmentsMapping);
|
|
3387
|
+
}
|
|
3388
|
+
);
|
|
3389
|
+
const selectAttachmentsOfAssetTypeFieldValues = restructureCreateSelectorWithArgs(
|
|
3390
|
+
toolkit.createSelector([selectAssetTypeFieldValuesAttachments, (_state, id) => id], (attachments, id) => {
|
|
3391
|
+
return fallbackToEmptyArray(attachments.filter((attachment) => attachment.field_values === id));
|
|
3392
|
+
})
|
|
3393
|
+
);
|
|
3394
|
+
const selectAssetTypeFieldValuesAttachmentById = (attachmentId) => (state) => {
|
|
3395
|
+
return state.assetTypeFieldValuesAttachmentReducer.instances[attachmentId];
|
|
3396
|
+
};
|
|
3397
|
+
const assetTypeFieldValuesAttachmentReducer = assetTypeFieldValuesAttachmentSlice.reducer;
|
|
3398
|
+
let clientStore;
|
|
3399
|
+
function setClientStore(store) {
|
|
3400
|
+
clientStore = store;
|
|
3401
|
+
}
|
|
3402
|
+
function getClientStore() {
|
|
3403
|
+
return clientStore;
|
|
3404
|
+
}
|
|
3405
|
+
let clientSDK;
|
|
3406
|
+
function setClientSDK(sdkCtor) {
|
|
3407
|
+
clientSDK = sdkCtor;
|
|
3408
|
+
}
|
|
3409
|
+
function getClientSDK() {
|
|
3410
|
+
return clientSDK;
|
|
3411
|
+
}
|
|
3412
|
+
const CLASS_NAME_TO_SERVICE = {};
|
|
3413
|
+
class BaseService {
|
|
3414
|
+
constructor(sdk) {
|
|
3415
|
+
__publicField(this, "client");
|
|
3416
|
+
CLASS_NAME_TO_SERVICE[this.constructor.name] = this;
|
|
3417
|
+
this.client = sdk;
|
|
3418
|
+
}
|
|
3419
|
+
async enqueueRequest(requestDetails) {
|
|
3420
|
+
return this.client.enqueueRequest(requestDetails, this.host, this.constructor.name);
|
|
3421
|
+
}
|
|
3422
|
+
dispatch(action) {
|
|
3423
|
+
this.client.store.dispatch(action);
|
|
3424
|
+
}
|
|
3425
|
+
}
|
|
3426
|
+
const VERSION_REDUCER_KEY = "versioning";
|
|
3427
|
+
const overmapReducers = {
|
|
3428
|
+
// TODO: attachmentReducer,
|
|
3429
|
+
[VERSION_REDUCER_KEY]: versioningReducer,
|
|
3430
|
+
fileReducer,
|
|
3431
|
+
authReducer,
|
|
3432
|
+
categoryReducer,
|
|
3433
|
+
assetReducer,
|
|
3434
|
+
assetAttachmentReducer,
|
|
3435
|
+
assetStageCompletionReducer,
|
|
3436
|
+
assetStageReducer,
|
|
3437
|
+
assetTypeReducer,
|
|
3438
|
+
assetTypeAttachmentReducer,
|
|
3439
|
+
issueReducer,
|
|
3440
|
+
issueAttachmentReducer,
|
|
3441
|
+
issueTypeReducer,
|
|
3442
|
+
organizationReducer,
|
|
3443
|
+
outboxReducer,
|
|
3444
|
+
projectReducer,
|
|
3445
|
+
projectAttachmentReducer,
|
|
3446
|
+
projectAccessReducer,
|
|
3447
|
+
organizationAccessReducer,
|
|
3448
|
+
projectFileReducer,
|
|
3449
|
+
rehydratedReducer,
|
|
3450
|
+
formReducer,
|
|
3451
|
+
formRevisionReducer,
|
|
3452
|
+
formRevisionAttachmentReducer,
|
|
3453
|
+
formSubmissionAttachmentReducer,
|
|
3454
|
+
formSubmissionReducer,
|
|
3455
|
+
userReducer,
|
|
3456
|
+
workspaceReducer,
|
|
3457
|
+
emailDomainsReducer,
|
|
3458
|
+
licenseReducer,
|
|
3459
|
+
documentsReducer,
|
|
3460
|
+
documentAttachmentReducer,
|
|
3461
|
+
teamReducer,
|
|
3462
|
+
agentsReducer,
|
|
3463
|
+
issueCommentReducer,
|
|
3464
|
+
issueUpdateReducer,
|
|
3465
|
+
geoImageReducer,
|
|
3466
|
+
issueAssociationReducer,
|
|
3467
|
+
issueTypeFieldsReducer,
|
|
3468
|
+
issueTypeFieldValuesReducer,
|
|
3469
|
+
issueTypeFieldsAttachmentReducer,
|
|
3470
|
+
issueTypeFieldValuesAttachmentReducer,
|
|
3471
|
+
assetTypeFieldsReducer,
|
|
3472
|
+
assetTypeFieldValuesReducer,
|
|
3473
|
+
assetTypeFieldsAttachmentReducer,
|
|
3474
|
+
assetTypeFieldValuesAttachmentReducer
|
|
3475
|
+
};
|
|
3476
|
+
const overmapReducer = toolkit.combineReducers(overmapReducers);
|
|
3477
|
+
const resetStore = "RESET";
|
|
3478
|
+
const overmapRootReducer = (state, action) => {
|
|
3479
|
+
if (action.type === "auth/setLoggedIn" && !action.payload) {
|
|
3480
|
+
return overmapReducer(void 0, action);
|
|
3481
|
+
}
|
|
3482
|
+
return overmapReducer(state, action);
|
|
3483
|
+
};
|
|
3484
|
+
let __OUTBOX_COORDINATOR = null;
|
|
3485
|
+
function getOutboxCoordinator() {
|
|
3219
3486
|
const clientStore2 = getClientStore();
|
|
3220
3487
|
if (!clientStore2) {
|
|
3221
3488
|
console.warn("Client store not set; cannot get outbox coordinator yet.");
|
|
@@ -3846,9 +4113,6 @@ var __publicField = (obj, key, value) => {
|
|
|
3846
4113
|
description: "Create Category",
|
|
3847
4114
|
method: HttpMethod.POST,
|
|
3848
4115
|
url: "/categories/",
|
|
3849
|
-
queryParams: {
|
|
3850
|
-
workspace_id: payload.workspace.toString()
|
|
3851
|
-
},
|
|
3852
4116
|
payload: offlineCategory,
|
|
3853
4117
|
blockers: [payload.workspace],
|
|
3854
4118
|
blocks: [offlineCategory.offline_id]
|
|
@@ -4061,7 +4325,10 @@ var __publicField = (obj, key, value) => {
|
|
|
4061
4325
|
const result = await this.enqueueRequest({
|
|
4062
4326
|
description: "Get assets",
|
|
4063
4327
|
method: HttpMethod.GET,
|
|
4064
|
-
url:
|
|
4328
|
+
url: "/assets/",
|
|
4329
|
+
queryParams: {
|
|
4330
|
+
project: projectId.toString()
|
|
4331
|
+
},
|
|
4065
4332
|
blockers: [],
|
|
4066
4333
|
blocks: []
|
|
4067
4334
|
});
|
|
@@ -4082,7 +4349,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4082
4349
|
const promise = this.enqueueRequest({
|
|
4083
4350
|
description: "Add asset stage completion",
|
|
4084
4351
|
method: HttpMethod.POST,
|
|
4085
|
-
url: "/
|
|
4352
|
+
url: "/asset-stage-completions/",
|
|
4086
4353
|
payload: {
|
|
4087
4354
|
offline_id: offlineStageCompletion.offline_id,
|
|
4088
4355
|
submitted_at: submittedAt,
|
|
@@ -4109,7 +4376,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4109
4376
|
const promise = this.enqueueRequest({
|
|
4110
4377
|
description: "Delete asset stage completion",
|
|
4111
4378
|
method: HttpMethod.DELETE,
|
|
4112
|
-
url: `/
|
|
4379
|
+
url: `/asset-stage-completions/${id}/`,
|
|
4113
4380
|
blockers: [id],
|
|
4114
4381
|
blocks: []
|
|
4115
4382
|
});
|
|
@@ -4135,7 +4402,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4135
4402
|
const promise = this.enqueueRequest({
|
|
4136
4403
|
description: "Bulk create asset stage completions",
|
|
4137
4404
|
method: HttpMethod.POST,
|
|
4138
|
-
url: "/
|
|
4405
|
+
url: "/asset-stage-completions/bulk/",
|
|
4139
4406
|
payload: {
|
|
4140
4407
|
submitted_at: submittedAt,
|
|
4141
4408
|
completions: payload
|
|
@@ -4157,7 +4424,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4157
4424
|
const promise = this.enqueueRequest({
|
|
4158
4425
|
description: "Deleting asset stage completions",
|
|
4159
4426
|
method: HttpMethod.DELETE,
|
|
4160
|
-
url: "/
|
|
4427
|
+
url: "/asset-stage-completions/bulk/",
|
|
4161
4428
|
payload: {
|
|
4162
4429
|
completion_ids: ids
|
|
4163
4430
|
},
|
|
@@ -4173,7 +4440,10 @@ var __publicField = (obj, key, value) => {
|
|
|
4173
4440
|
const result = await this.enqueueRequest({
|
|
4174
4441
|
description: "Get asset stage completions",
|
|
4175
4442
|
method: HttpMethod.GET,
|
|
4176
|
-
url:
|
|
4443
|
+
url: "/asset-stage-completions/",
|
|
4444
|
+
queryParams: {
|
|
4445
|
+
project: projectId.toString()
|
|
4446
|
+
},
|
|
4177
4447
|
blockers: [],
|
|
4178
4448
|
blocks: []
|
|
4179
4449
|
});
|
|
@@ -4194,7 +4464,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4194
4464
|
const promise = this.enqueueRequest({
|
|
4195
4465
|
description: "Add asset stages",
|
|
4196
4466
|
method: HttpMethod.POST,
|
|
4197
|
-
url: "/
|
|
4467
|
+
url: "/asset-stages/bulk/",
|
|
4198
4468
|
payload: {
|
|
4199
4469
|
submitted_at: submittedAt,
|
|
4200
4470
|
asset_type: assetTypeId,
|
|
@@ -4218,7 +4488,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4218
4488
|
return this.enqueueRequest({
|
|
4219
4489
|
description: "Edit asset stages",
|
|
4220
4490
|
method: HttpMethod.PATCH,
|
|
4221
|
-
url: `/
|
|
4491
|
+
url: `/asset-types/${assetTypeId}/bulk-update-stages/`,
|
|
4222
4492
|
payload: {
|
|
4223
4493
|
stages: stagesToUpdate
|
|
4224
4494
|
},
|
|
@@ -4236,7 +4506,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4236
4506
|
const promise = this.enqueueRequest({
|
|
4237
4507
|
description: "Delete asset stages",
|
|
4238
4508
|
method: HttpMethod.DELETE,
|
|
4239
|
-
url: "/
|
|
4509
|
+
url: "/asset-stages/bulk/",
|
|
4240
4510
|
payload: {
|
|
4241
4511
|
stage_ids: idsToDelete
|
|
4242
4512
|
},
|
|
@@ -4261,7 +4531,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4261
4531
|
const promise = this.enqueueRequest({
|
|
4262
4532
|
description: "Update asset stage",
|
|
4263
4533
|
method: HttpMethod.PATCH,
|
|
4264
|
-
url: `/
|
|
4534
|
+
url: `/asset-stages/${assetStage.offline_id}/`,
|
|
4265
4535
|
payload: {
|
|
4266
4536
|
name: payload.name,
|
|
4267
4537
|
description: payload.description,
|
|
@@ -4289,7 +4559,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4289
4559
|
await this.enqueueRequest({
|
|
4290
4560
|
description: "Link asset stage to form",
|
|
4291
4561
|
method: HttpMethod.POST,
|
|
4292
|
-
url: `/
|
|
4562
|
+
url: `/asset-stages/${stageId}/associate-with-form/`,
|
|
4293
4563
|
payload: { form: formId },
|
|
4294
4564
|
blockers: [stageId, formId],
|
|
4295
4565
|
blocks: [stageId]
|
|
@@ -4310,7 +4580,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4310
4580
|
await this.enqueueRequest({
|
|
4311
4581
|
description: "Unlink asset stage from form",
|
|
4312
4582
|
method: HttpMethod.DELETE,
|
|
4313
|
-
url: `/
|
|
4583
|
+
url: `/asset-stages/${stageId}/associate-with-form/`,
|
|
4314
4584
|
blockers: [stageId, formId],
|
|
4315
4585
|
blocks: [stageId]
|
|
4316
4586
|
});
|
|
@@ -4323,7 +4593,10 @@ var __publicField = (obj, key, value) => {
|
|
|
4323
4593
|
const result = await this.enqueueRequest({
|
|
4324
4594
|
description: "Get asset stages",
|
|
4325
4595
|
method: HttpMethod.GET,
|
|
4326
|
-
url:
|
|
4596
|
+
url: "/asset-stages/",
|
|
4597
|
+
queryParams: {
|
|
4598
|
+
project: projectId.toString()
|
|
4599
|
+
},
|
|
4327
4600
|
blockers: [],
|
|
4328
4601
|
blocks: []
|
|
4329
4602
|
});
|
|
@@ -4340,7 +4613,12 @@ var __publicField = (obj, key, value) => {
|
|
|
4340
4613
|
projectAttachmentReducer: projectAttachmentReducer2,
|
|
4341
4614
|
formRevisionAttachmentReducer: formRevisionAttachmentReducer2,
|
|
4342
4615
|
formSubmissionAttachmentReducer: formSubmissionAttachmentReducer2,
|
|
4343
|
-
geoImageReducer: geoImageReducer2
|
|
4616
|
+
geoImageReducer: geoImageReducer2,
|
|
4617
|
+
// fields
|
|
4618
|
+
assetTypeFieldsAttachmentReducer: assetTypeFieldsAttachmentReducer2,
|
|
4619
|
+
assetTypeFieldValuesAttachmentReducer: assetTypeFieldValuesAttachmentReducer2,
|
|
4620
|
+
issueTypeFieldsAttachmentReducer: issueTypeFieldsAttachmentReducer2,
|
|
4621
|
+
issueTypeFieldValuesAttachmentReducer: issueTypeFieldValuesAttachmentReducer2
|
|
4344
4622
|
} = this.client.store.getState();
|
|
4345
4623
|
const objectsWithSha1 = [].concat(
|
|
4346
4624
|
Object.values(issueAttachmentReducer2.instances),
|
|
@@ -4350,7 +4628,11 @@ var __publicField = (obj, key, value) => {
|
|
|
4350
4628
|
Object.values(projectAttachmentReducer2.instances),
|
|
4351
4629
|
Object.values(formRevisionAttachmentReducer2.instances),
|
|
4352
4630
|
Object.values(formSubmissionAttachmentReducer2.instances),
|
|
4353
|
-
Object.values(geoImageReducer2.instances)
|
|
4631
|
+
Object.values(geoImageReducer2.instances),
|
|
4632
|
+
Object.values(assetTypeFieldsAttachmentReducer2.instances),
|
|
4633
|
+
Object.values(assetTypeFieldValuesAttachmentReducer2.instances),
|
|
4634
|
+
Object.values(issueTypeFieldsAttachmentReducer2.instances),
|
|
4635
|
+
Object.values(issueTypeFieldValuesAttachmentReducer2.instances)
|
|
4354
4636
|
);
|
|
4355
4637
|
return objectsWithSha1.filter((object) => object.file_sha1 === sha1).length;
|
|
4356
4638
|
}
|
|
@@ -4372,41 +4654,20 @@ var __publicField = (obj, key, value) => {
|
|
|
4372
4654
|
}
|
|
4373
4655
|
return promisesBySha1;
|
|
4374
4656
|
}
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
attachUrlPrefix: "/assets",
|
|
4386
|
-
deleteUrlPrefix: "/assets",
|
|
4387
|
-
fetchUrlPostfix: "/asset-attachments"
|
|
4388
|
-
},
|
|
4389
|
-
[AttachmentModel.AssetType]: {
|
|
4390
|
-
name: "asset type",
|
|
4391
|
-
attachUrlPrefix: "/assets/types",
|
|
4392
|
-
deleteUrlPrefix: "/assets/types",
|
|
4393
|
-
fetchUrlPostfix: "/asset-type-attachments"
|
|
4394
|
-
},
|
|
4395
|
-
[AttachmentModel.Project]: {
|
|
4396
|
-
name: "project",
|
|
4397
|
-
attachUrlPrefix: "/projects",
|
|
4398
|
-
deleteUrlPrefix: "/projects",
|
|
4399
|
-
fetchUrlPostfix: "/attachments"
|
|
4400
|
-
},
|
|
4401
|
-
[AttachmentModel.Document]: {
|
|
4402
|
-
name: "document",
|
|
4403
|
-
attachUrlPrefix: "/documents",
|
|
4404
|
-
deleteUrlPrefix: "/documents",
|
|
4405
|
-
fetchUrlPostfix: "/document-attachments"
|
|
4657
|
+
async getFilePayload(file) {
|
|
4658
|
+
const sha1 = await hashFile(file);
|
|
4659
|
+
const filePayload = {
|
|
4660
|
+
sha1,
|
|
4661
|
+
file_type: file.type,
|
|
4662
|
+
extension: file.name.split(".").pop(),
|
|
4663
|
+
size: file.size
|
|
4664
|
+
};
|
|
4665
|
+
await this.client.files.addCache(file, sha1);
|
|
4666
|
+
return filePayload;
|
|
4406
4667
|
}
|
|
4407
|
-
}
|
|
4668
|
+
}
|
|
4408
4669
|
class BaseAttachmentService extends BaseUploadService {
|
|
4409
|
-
async
|
|
4670
|
+
async _bulkAdd(payloads) {
|
|
4410
4671
|
var _a2;
|
|
4411
4672
|
const { store } = this.client;
|
|
4412
4673
|
const createdBy = (_a2 = store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
@@ -4414,39 +4675,36 @@ var __publicField = (obj, key, value) => {
|
|
|
4414
4675
|
const offlineAttachments = [];
|
|
4415
4676
|
const attachmentPayloads = [];
|
|
4416
4677
|
const filePayloads = {};
|
|
4417
|
-
for (const
|
|
4418
|
-
const
|
|
4419
|
-
|
|
4420
|
-
|
|
4421
|
-
|
|
4422
|
-
|
|
4423
|
-
extension: file.name.split(".").pop(),
|
|
4424
|
-
size: file.size
|
|
4425
|
-
};
|
|
4426
|
-
await this.client.files.addCache(file, sha1);
|
|
4427
|
-
}
|
|
4428
|
-
const offlineAttachment = buildOfflineAttachment({
|
|
4678
|
+
for (const payload of payloads) {
|
|
4679
|
+
const { modelId, file } = payload;
|
|
4680
|
+
const filePayload = await this.getFilePayload(file);
|
|
4681
|
+
if (!(filePayload.sha1 in filePayloads))
|
|
4682
|
+
filePayloads[filePayload.sha1] = filePayload;
|
|
4683
|
+
const offlineAttachment = this.buildOfflineAttachment({
|
|
4429
4684
|
file,
|
|
4430
|
-
sha1,
|
|
4431
|
-
submittedAt,
|
|
4432
|
-
createdBy,
|
|
4685
|
+
file_sha1: filePayload.sha1,
|
|
4686
|
+
submitted_at: submittedAt,
|
|
4687
|
+
created_by: createdBy,
|
|
4433
4688
|
description: "",
|
|
4434
4689
|
modelId
|
|
4435
4690
|
});
|
|
4436
4691
|
offlineAttachments.push(offlineAttachment);
|
|
4437
|
-
attachmentPayloads.push(
|
|
4438
|
-
|
|
4439
|
-
|
|
4440
|
-
|
|
4441
|
-
|
|
4442
|
-
|
|
4692
|
+
attachmentPayloads.push(
|
|
4693
|
+
this.buildAttachmentPayload({
|
|
4694
|
+
offline_id: offlineAttachment.offline_id,
|
|
4695
|
+
file_name: offlineAttachment.file_name,
|
|
4696
|
+
file_sha1: offlineAttachment.file_sha1,
|
|
4697
|
+
file_extension: filePayload.extension,
|
|
4698
|
+
description: offlineAttachment.description,
|
|
4699
|
+
modelId
|
|
4700
|
+
})
|
|
4701
|
+
);
|
|
4443
4702
|
}
|
|
4444
4703
|
this.dispatch(this.addAttachments(offlineAttachments));
|
|
4445
|
-
const meta = AttachmentModelMeta[this.attachmentModel];
|
|
4446
4704
|
const promise = this.enqueueRequest({
|
|
4447
|
-
description: `
|
|
4705
|
+
description: `Add ${this.name}`,
|
|
4448
4706
|
method: HttpMethod.POST,
|
|
4449
|
-
url: `${
|
|
4707
|
+
url: `${this.url}/bulk/`,
|
|
4450
4708
|
payload: {
|
|
4451
4709
|
submitted_at: submittedAt,
|
|
4452
4710
|
attachments: attachmentPayloads,
|
|
@@ -4463,7 +4721,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4463
4721
|
});
|
|
4464
4722
|
return [offlineAttachments, promise.then(({ attachments }) => attachments)];
|
|
4465
4723
|
}
|
|
4466
|
-
async
|
|
4724
|
+
async _delete(attachmendId) {
|
|
4467
4725
|
const { store } = this.client;
|
|
4468
4726
|
const attachment = this.selectAttachment(attachmendId)(store.getState());
|
|
4469
4727
|
if (!attachment) {
|
|
@@ -4472,11 +4730,10 @@ var __publicField = (obj, key, value) => {
|
|
|
4472
4730
|
);
|
|
4473
4731
|
}
|
|
4474
4732
|
this.dispatch(this.removeAttachment(attachment.offline_id));
|
|
4475
|
-
const meta = AttachmentModelMeta[this.attachmentModel];
|
|
4476
4733
|
const promise = this.enqueueRequest({
|
|
4477
|
-
description:
|
|
4734
|
+
description: `Delete ${this.name}`,
|
|
4478
4735
|
method: HttpMethod.DELETE,
|
|
4479
|
-
url: `${
|
|
4736
|
+
url: `${this.url}/${attachmendId}/`,
|
|
4480
4737
|
blockers: [attachmendId],
|
|
4481
4738
|
blocks: []
|
|
4482
4739
|
});
|
|
@@ -4489,24 +4746,12 @@ var __publicField = (obj, key, value) => {
|
|
|
4489
4746
|
});
|
|
4490
4747
|
return promise;
|
|
4491
4748
|
}
|
|
4492
|
-
// Note that currently the fetching of attachments for all models dependds on the active projectId. This may change in the future. And
|
|
4493
|
-
// so for some attachment model services, this method will have to be overridden.
|
|
4494
|
-
async refreshStore(projectId, _organizationId) {
|
|
4495
|
-
const meta = AttachmentModelMeta[this.attachmentModel];
|
|
4496
|
-
const result = await this.enqueueRequest({
|
|
4497
|
-
description: `Get ${meta.name} attachments`,
|
|
4498
|
-
method: HttpMethod.GET,
|
|
4499
|
-
url: `/projects/${projectId}${meta.fetchUrlPostfix}/`,
|
|
4500
|
-
blocks: [],
|
|
4501
|
-
blockers: []
|
|
4502
|
-
});
|
|
4503
|
-
this.dispatch(this.initializeAttachments(result));
|
|
4504
|
-
}
|
|
4505
4749
|
}
|
|
4506
4750
|
class AssetAttachmentService extends BaseAttachmentService {
|
|
4507
4751
|
constructor() {
|
|
4508
4752
|
super(...arguments);
|
|
4509
|
-
__publicField(this, "
|
|
4753
|
+
__publicField(this, "name", "Asset Attachment");
|
|
4754
|
+
__publicField(this, "url", "/asset-attachments");
|
|
4510
4755
|
__publicField(this, "initializeAttachments", initializeAssetAttachments);
|
|
4511
4756
|
__publicField(this, "addAttachments", addAssetAttachments);
|
|
4512
4757
|
__publicField(this, "updateAttachments", updateAssetAttachments);
|
|
@@ -4518,20 +4763,39 @@ var __publicField = (obj, key, value) => {
|
|
|
4518
4763
|
buildOfflineAttachment(data) {
|
|
4519
4764
|
return offline({
|
|
4520
4765
|
file: URL.createObjectURL(data.file),
|
|
4521
|
-
file_sha1: data.
|
|
4522
|
-
created_by: data.
|
|
4766
|
+
file_sha1: data.file_sha1,
|
|
4767
|
+
created_by: data.created_by,
|
|
4523
4768
|
file_name: data.file.name,
|
|
4524
4769
|
file_type: data.file.type,
|
|
4525
|
-
submitted_at: data.
|
|
4770
|
+
submitted_at: data.submitted_at,
|
|
4526
4771
|
description: data.description,
|
|
4527
4772
|
asset: data.modelId
|
|
4528
4773
|
});
|
|
4529
4774
|
}
|
|
4530
|
-
|
|
4531
|
-
return
|
|
4775
|
+
buildAttachmentPayload(data) {
|
|
4776
|
+
return {
|
|
4777
|
+
...data,
|
|
4778
|
+
asset: data.modelId
|
|
4779
|
+
};
|
|
4780
|
+
}
|
|
4781
|
+
async bulkAdd(payloads) {
|
|
4782
|
+
return this._bulkAdd(payloads.map((p) => ({ modelId: p.assetId, file: p.file })));
|
|
4783
|
+
}
|
|
4784
|
+
async delete(id) {
|
|
4785
|
+
return this._delete(id);
|
|
4532
4786
|
}
|
|
4533
|
-
async
|
|
4534
|
-
|
|
4787
|
+
async refreshStore(projectId) {
|
|
4788
|
+
const result = await this.enqueueRequest({
|
|
4789
|
+
description: "Get asset attachments",
|
|
4790
|
+
method: HttpMethod.GET,
|
|
4791
|
+
url: `${this.url}/`,
|
|
4792
|
+
queryParams: {
|
|
4793
|
+
project: projectId.toString()
|
|
4794
|
+
},
|
|
4795
|
+
blocks: [],
|
|
4796
|
+
blockers: []
|
|
4797
|
+
});
|
|
4798
|
+
this.dispatch(initializeAssetAttachments(result));
|
|
4535
4799
|
}
|
|
4536
4800
|
}
|
|
4537
4801
|
class AssetTypeService extends BaseApiService {
|
|
@@ -4548,7 +4812,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4548
4812
|
const promise = this.enqueueRequest({
|
|
4549
4813
|
description: "Create asset type",
|
|
4550
4814
|
method: HttpMethod.POST,
|
|
4551
|
-
url:
|
|
4815
|
+
url: "/asset-types/",
|
|
4552
4816
|
payload: { ...offlineAssetType },
|
|
4553
4817
|
blockers: [],
|
|
4554
4818
|
blocks: [offlineAssetType.offline_id]
|
|
@@ -4574,7 +4838,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4574
4838
|
const promise = this.enqueueRequest({
|
|
4575
4839
|
description: "Update asset type",
|
|
4576
4840
|
method: HttpMethod.PATCH,
|
|
4577
|
-
url: `/
|
|
4841
|
+
url: `/asset-types/${payload.offline_id}/`,
|
|
4578
4842
|
payload: {
|
|
4579
4843
|
icon: payload.icon,
|
|
4580
4844
|
color: payload.color,
|
|
@@ -4608,7 +4872,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4608
4872
|
return this.enqueueRequest({
|
|
4609
4873
|
description: "Delete asset type",
|
|
4610
4874
|
method: HttpMethod.DELETE,
|
|
4611
|
-
url: `/
|
|
4875
|
+
url: `/asset-types/${assetTypeId}/`,
|
|
4612
4876
|
blockers: [assetTypeId],
|
|
4613
4877
|
blocks: []
|
|
4614
4878
|
}).catch((e) => {
|
|
@@ -4623,7 +4887,10 @@ var __publicField = (obj, key, value) => {
|
|
|
4623
4887
|
const result = await this.enqueueRequest({
|
|
4624
4888
|
description: "Get asset types",
|
|
4625
4889
|
method: HttpMethod.GET,
|
|
4626
|
-
url:
|
|
4890
|
+
url: "/asset-types/",
|
|
4891
|
+
queryParams: {
|
|
4892
|
+
project: projectId.toString()
|
|
4893
|
+
},
|
|
4627
4894
|
blockers: [],
|
|
4628
4895
|
blocks: []
|
|
4629
4896
|
});
|
|
@@ -4633,8 +4900,8 @@ var __publicField = (obj, key, value) => {
|
|
|
4633
4900
|
class AssetTypeAttachmentService extends BaseAttachmentService {
|
|
4634
4901
|
constructor() {
|
|
4635
4902
|
super(...arguments);
|
|
4636
|
-
__publicField(this, "
|
|
4637
|
-
__publicField(this, "
|
|
4903
|
+
__publicField(this, "name", "Asset Type Attachment");
|
|
4904
|
+
__publicField(this, "url", "/asset-type-attachments");
|
|
4638
4905
|
__publicField(this, "addAttachments", addAssetTypeAttachments);
|
|
4639
4906
|
__publicField(this, "updateAttachments", updateAssetTypeAttachments);
|
|
4640
4907
|
__publicField(this, "removeAttachments", deleteAssetTypeAttachments);
|
|
@@ -4645,20 +4912,39 @@ var __publicField = (obj, key, value) => {
|
|
|
4645
4912
|
buildOfflineAttachment(data) {
|
|
4646
4913
|
return offline({
|
|
4647
4914
|
file: URL.createObjectURL(data.file),
|
|
4648
|
-
file_sha1: data.
|
|
4649
|
-
created_by: data.
|
|
4915
|
+
file_sha1: data.file_sha1,
|
|
4916
|
+
created_by: data.created_by,
|
|
4650
4917
|
file_name: data.file.name,
|
|
4651
4918
|
file_type: data.file.type,
|
|
4652
|
-
submitted_at: data.
|
|
4919
|
+
submitted_at: data.submitted_at,
|
|
4653
4920
|
description: data.description,
|
|
4654
4921
|
asset_type: data.modelId
|
|
4655
4922
|
});
|
|
4656
4923
|
}
|
|
4657
|
-
|
|
4658
|
-
return
|
|
4924
|
+
buildAttachmentPayload(data) {
|
|
4925
|
+
return {
|
|
4926
|
+
...data,
|
|
4927
|
+
asset_type: data.modelId
|
|
4928
|
+
};
|
|
4929
|
+
}
|
|
4930
|
+
async bulkAdd(payloads) {
|
|
4931
|
+
return this._bulkAdd(payloads.map((p) => ({ modelId: p.assetTypeId, file: p.file })));
|
|
4932
|
+
}
|
|
4933
|
+
async delete(attachmentId) {
|
|
4934
|
+
return this._delete(attachmentId);
|
|
4659
4935
|
}
|
|
4660
|
-
async
|
|
4661
|
-
|
|
4936
|
+
async refreshStore(projectId) {
|
|
4937
|
+
const result = await this.enqueueRequest({
|
|
4938
|
+
description: "Get asset type attachments",
|
|
4939
|
+
method: HttpMethod.GET,
|
|
4940
|
+
url: `${this.url}/`,
|
|
4941
|
+
queryParams: {
|
|
4942
|
+
project: projectId.toString()
|
|
4943
|
+
},
|
|
4944
|
+
blocks: [],
|
|
4945
|
+
blockers: []
|
|
4946
|
+
});
|
|
4947
|
+
this.dispatch(initializeAssetTypeAttachments(result));
|
|
4662
4948
|
}
|
|
4663
4949
|
}
|
|
4664
4950
|
class IssueCommentService extends BaseApiService {
|
|
@@ -4674,7 +4960,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4674
4960
|
const promise = this.enqueueRequest({
|
|
4675
4961
|
description: "Add issue comment",
|
|
4676
4962
|
method: HttpMethod.POST,
|
|
4677
|
-
url:
|
|
4963
|
+
url: "/issue-comments/",
|
|
4678
4964
|
payload: offlineComment,
|
|
4679
4965
|
blockers: [payload.issue],
|
|
4680
4966
|
blocks: [offlineComment.offline_id]
|
|
@@ -4698,7 +4984,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4698
4984
|
const promise = this.enqueueRequest({
|
|
4699
4985
|
description: "Edit issue comment",
|
|
4700
4986
|
method: HttpMethod.PATCH,
|
|
4701
|
-
url: `/
|
|
4987
|
+
url: `/issue-comments/${payload.offline_id}/`,
|
|
4702
4988
|
payload,
|
|
4703
4989
|
blockers: [payload.offline_id],
|
|
4704
4990
|
blocks: [payload.offline_id]
|
|
@@ -4717,7 +5003,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4717
5003
|
const promise = this.enqueueRequest({
|
|
4718
5004
|
description: "Delete comment",
|
|
4719
5005
|
method: HttpMethod.DELETE,
|
|
4720
|
-
url: `/
|
|
5006
|
+
url: `/issue-comments/${id}/`,
|
|
4721
5007
|
blockers: [id],
|
|
4722
5008
|
blocks: []
|
|
4723
5009
|
});
|
|
@@ -4730,7 +5016,10 @@ var __publicField = (obj, key, value) => {
|
|
|
4730
5016
|
const result = await this.enqueueRequest({
|
|
4731
5017
|
description: "Get comments",
|
|
4732
5018
|
method: HttpMethod.GET,
|
|
4733
|
-
url:
|
|
5019
|
+
url: "/issue-comments/",
|
|
5020
|
+
queryParams: {
|
|
5021
|
+
project: projectId.toString()
|
|
5022
|
+
},
|
|
4734
5023
|
blockers: [],
|
|
4735
5024
|
blocks: []
|
|
4736
5025
|
});
|
|
@@ -4742,27 +5031,21 @@ var __publicField = (obj, key, value) => {
|
|
|
4742
5031
|
const result = await this.enqueueRequest({
|
|
4743
5032
|
description: "Get issue updates",
|
|
4744
5033
|
method: HttpMethod.GET,
|
|
4745
|
-
url:
|
|
5034
|
+
url: "/issue-updates/",
|
|
5035
|
+
queryParams: {
|
|
5036
|
+
project: projectId.toString()
|
|
5037
|
+
},
|
|
4746
5038
|
blockers: [],
|
|
4747
5039
|
blocks: []
|
|
4748
5040
|
});
|
|
4749
|
-
|
|
4750
|
-
filteredResult = filteredResult.map((comment) => {
|
|
4751
|
-
return { ...comment };
|
|
4752
|
-
});
|
|
4753
|
-
if (result.length !== filteredResult.length) {
|
|
4754
|
-
console.error(
|
|
4755
|
-
`Received duplicate comments from the API (new length ${filteredResult.length}); filtered in browser.`
|
|
4756
|
-
);
|
|
4757
|
-
}
|
|
4758
|
-
this.dispatch(initializeIssueUpdates(filteredResult));
|
|
5041
|
+
this.dispatch(initializeIssueUpdates(result));
|
|
4759
5042
|
}
|
|
4760
5043
|
}
|
|
4761
5044
|
class IssueAttachmentService extends BaseAttachmentService {
|
|
4762
5045
|
constructor() {
|
|
4763
5046
|
super(...arguments);
|
|
4764
|
-
__publicField(this, "
|
|
4765
|
-
__publicField(this, "
|
|
5047
|
+
__publicField(this, "name", "Issue Attachment");
|
|
5048
|
+
__publicField(this, "url", "/issue-attachments");
|
|
4766
5049
|
__publicField(this, "addAttachments", addIssueAttachments);
|
|
4767
5050
|
__publicField(this, "updateAttachments", updateIssueAttachments);
|
|
4768
5051
|
__publicField(this, "removeAttachments", deleteIssueAttachments);
|
|
@@ -4773,24 +5056,42 @@ var __publicField = (obj, key, value) => {
|
|
|
4773
5056
|
buildOfflineAttachment(data) {
|
|
4774
5057
|
return offline({
|
|
4775
5058
|
file: URL.createObjectURL(data.file),
|
|
4776
|
-
file_sha1: data.
|
|
4777
|
-
created_by: data.
|
|
5059
|
+
file_sha1: data.file_sha1,
|
|
5060
|
+
created_by: data.created_by,
|
|
4778
5061
|
file_name: data.file.name,
|
|
4779
5062
|
file_type: data.file.type,
|
|
4780
|
-
submitted_at: data.
|
|
5063
|
+
submitted_at: data.submitted_at,
|
|
4781
5064
|
description: data.description,
|
|
4782
5065
|
issue: data.modelId
|
|
4783
5066
|
});
|
|
4784
5067
|
}
|
|
4785
|
-
|
|
4786
|
-
return
|
|
5068
|
+
buildAttachmentPayload(data) {
|
|
5069
|
+
return {
|
|
5070
|
+
...data,
|
|
5071
|
+
issue: data.modelId
|
|
5072
|
+
};
|
|
5073
|
+
}
|
|
5074
|
+
async bulkAdd(payloads) {
|
|
5075
|
+
return this._bulkAdd(payloads.map((p) => ({ modelId: p.issueId, file: p.file })));
|
|
5076
|
+
}
|
|
5077
|
+
async delete(id) {
|
|
5078
|
+
return this._delete(id);
|
|
4787
5079
|
}
|
|
4788
|
-
async
|
|
4789
|
-
|
|
5080
|
+
async refreshStore(projectId) {
|
|
5081
|
+
const result = await this.enqueueRequest({
|
|
5082
|
+
description: "Get issue attachments",
|
|
5083
|
+
method: HttpMethod.GET,
|
|
5084
|
+
url: `${this.url}/`,
|
|
5085
|
+
queryParams: {
|
|
5086
|
+
project: projectId.toString()
|
|
5087
|
+
},
|
|
5088
|
+
blocks: [],
|
|
5089
|
+
blockers: []
|
|
5090
|
+
});
|
|
5091
|
+
this.dispatch(initializeIssueAttachments(result));
|
|
4790
5092
|
}
|
|
4791
5093
|
}
|
|
4792
5094
|
class IssueService extends BaseApiService {
|
|
4793
|
-
// Basic CRUD functions
|
|
4794
5095
|
add(payload) {
|
|
4795
5096
|
var _a2;
|
|
4796
5097
|
const { store } = this.client;
|
|
@@ -4808,10 +5109,6 @@ var __publicField = (obj, key, value) => {
|
|
|
4808
5109
|
description: "Create issue",
|
|
4809
5110
|
method: HttpMethod.POST,
|
|
4810
5111
|
url: "/issues/",
|
|
4811
|
-
queryParams: {
|
|
4812
|
-
workspace_id: payload.index_workspace,
|
|
4813
|
-
...payload.issue_type ? { issue_type: payload.issue_type } : {}
|
|
4814
|
-
},
|
|
4815
5112
|
payload: offlineIssue,
|
|
4816
5113
|
blockers: ["add-issue", ...offlineIssue.index_workspace ? [offlineIssue.index_workspace] : []],
|
|
4817
5114
|
blocks: [offlineIssue.offline_id]
|
|
@@ -4967,7 +5264,10 @@ var __publicField = (obj, key, value) => {
|
|
|
4967
5264
|
const result = await this.enqueueRequest({
|
|
4968
5265
|
description: "Get issues",
|
|
4969
5266
|
method: HttpMethod.GET,
|
|
4970
|
-
url:
|
|
5267
|
+
url: "/issues/",
|
|
5268
|
+
queryParams: {
|
|
5269
|
+
project: projectId.toString()
|
|
5270
|
+
},
|
|
4971
5271
|
blockers: [],
|
|
4972
5272
|
blocks: []
|
|
4973
5273
|
});
|
|
@@ -4987,7 +5287,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4987
5287
|
this.dispatch(addIssueType(offlineIssueType));
|
|
4988
5288
|
const promise = this.enqueueRequest({
|
|
4989
5289
|
method: HttpMethod.POST,
|
|
4990
|
-
url:
|
|
5290
|
+
url: "/issue-types/",
|
|
4991
5291
|
// Sending only whats needed here
|
|
4992
5292
|
payload: {
|
|
4993
5293
|
offline_id: offlineIssueType.offline_id,
|
|
@@ -5021,7 +5321,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5021
5321
|
this.dispatch(updateIssueType(offlineUpdatedIssueType));
|
|
5022
5322
|
const promise = this.enqueueRequest({
|
|
5023
5323
|
method: HttpMethod.PATCH,
|
|
5024
|
-
url: `/
|
|
5324
|
+
url: `/issue-types/${payload.offline_id}/`,
|
|
5025
5325
|
payload,
|
|
5026
5326
|
blockers: [payload.offline_id],
|
|
5027
5327
|
blocks: [payload.offline_id]
|
|
@@ -5045,7 +5345,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5045
5345
|
this.dispatch(deleteIssues(issuesOfIssueType.map((issue) => issue.offline_id)));
|
|
5046
5346
|
const promise = this.enqueueRequest({
|
|
5047
5347
|
method: HttpMethod.DELETE,
|
|
5048
|
-
url: `/
|
|
5348
|
+
url: `/issue-types/${id}/`,
|
|
5049
5349
|
blockers: [id],
|
|
5050
5350
|
blocks: []
|
|
5051
5351
|
});
|
|
@@ -5058,7 +5358,10 @@ var __publicField = (obj, key, value) => {
|
|
|
5058
5358
|
async refreshStore(organizationId) {
|
|
5059
5359
|
const result = await this.enqueueRequest({
|
|
5060
5360
|
method: HttpMethod.GET,
|
|
5061
|
-
url:
|
|
5361
|
+
url: "/issue-types/",
|
|
5362
|
+
queryParams: {
|
|
5363
|
+
organization: organizationId.toString()
|
|
5364
|
+
},
|
|
5062
5365
|
blockers: [],
|
|
5063
5366
|
blocks: []
|
|
5064
5367
|
});
|
|
@@ -5202,8 +5505,8 @@ var __publicField = (obj, key, value) => {
|
|
|
5202
5505
|
class ProjectAttachmentService extends BaseAttachmentService {
|
|
5203
5506
|
constructor() {
|
|
5204
5507
|
super(...arguments);
|
|
5205
|
-
__publicField(this, "
|
|
5206
|
-
__publicField(this, "
|
|
5508
|
+
__publicField(this, "name", "Project Attachment");
|
|
5509
|
+
__publicField(this, "url", "/project-attachments");
|
|
5207
5510
|
__publicField(this, "addAttachments", addProjectAttachments);
|
|
5208
5511
|
__publicField(this, "updateAttachments", updateProjectAttachments);
|
|
5209
5512
|
__publicField(this, "removeAttachments", deleteProjectAttachments);
|
|
@@ -5214,41 +5517,54 @@ var __publicField = (obj, key, value) => {
|
|
|
5214
5517
|
buildOfflineAttachment(data) {
|
|
5215
5518
|
return offline({
|
|
5216
5519
|
file: URL.createObjectURL(data.file),
|
|
5217
|
-
file_sha1: data.
|
|
5218
|
-
created_by: data.
|
|
5520
|
+
file_sha1: data.file_sha1,
|
|
5521
|
+
created_by: data.created_by,
|
|
5219
5522
|
file_name: data.file.name,
|
|
5220
5523
|
file_type: data.file.type,
|
|
5221
|
-
submitted_at: data.
|
|
5524
|
+
submitted_at: data.submitted_at,
|
|
5222
5525
|
description: data.description,
|
|
5223
5526
|
project: data.modelId
|
|
5224
5527
|
});
|
|
5225
5528
|
}
|
|
5226
|
-
|
|
5227
|
-
return
|
|
5529
|
+
buildAttachmentPayload(data) {
|
|
5530
|
+
return {
|
|
5531
|
+
...data,
|
|
5532
|
+
project: data.modelId
|
|
5533
|
+
};
|
|
5228
5534
|
}
|
|
5229
|
-
async
|
|
5230
|
-
return this.
|
|
5535
|
+
async bulkAdd(payloads) {
|
|
5536
|
+
return this._bulkAdd(payloads.map((p) => ({ modelId: p.projectId, file: p.file })));
|
|
5537
|
+
}
|
|
5538
|
+
async delete(attachmentId) {
|
|
5539
|
+
return this._delete(attachmentId);
|
|
5540
|
+
}
|
|
5541
|
+
async refreshStore(projectId) {
|
|
5542
|
+
const result = await this.enqueueRequest({
|
|
5543
|
+
description: "Get project attachments",
|
|
5544
|
+
method: HttpMethod.GET,
|
|
5545
|
+
url: `${this.url}/`,
|
|
5546
|
+
queryParams: {
|
|
5547
|
+
project: projectId.toString()
|
|
5548
|
+
},
|
|
5549
|
+
blockers: [],
|
|
5550
|
+
blocks: []
|
|
5551
|
+
});
|
|
5552
|
+
this.dispatch(initializeProjectAttachments(result));
|
|
5231
5553
|
}
|
|
5232
5554
|
}
|
|
5233
5555
|
class ProjectService extends BaseApiService {
|
|
5234
5556
|
async add(payload) {
|
|
5235
|
-
if (!payload.organization_owner && !payload.user_owner) {
|
|
5236
|
-
throw new Error("Project type was not chosen when trying to create a project");
|
|
5237
|
-
}
|
|
5238
5557
|
if (!payload.bounds && !payload.canvas_bounds) {
|
|
5239
5558
|
throw new Error("Project must either have bounds or canvas_bounds set");
|
|
5240
5559
|
}
|
|
5241
|
-
const isOrganizationProject = !!payload.organization_owner;
|
|
5242
|
-
const url = isOrganizationProject ? `/organizations/${payload.organization_owner}/projects/` : "/projects/";
|
|
5243
|
-
const projectType = isOrganizationProject ? { organization_owner: payload.organization_owner } : { user_owner: payload.user_owner };
|
|
5244
5560
|
return await this.enqueueRequest({
|
|
5245
5561
|
description: "Create project",
|
|
5246
5562
|
method: HttpMethod.POST,
|
|
5247
|
-
url,
|
|
5563
|
+
url: "/projects/",
|
|
5248
5564
|
payload: {
|
|
5249
5565
|
name: payload.name,
|
|
5250
5566
|
bounds: payload.bounds,
|
|
5251
|
-
|
|
5567
|
+
organization_owner: payload.organization_owner
|
|
5252
5568
|
},
|
|
5253
5569
|
blockers: [],
|
|
5254
5570
|
blocks: []
|
|
@@ -5376,88 +5692,33 @@ var __publicField = (obj, key, value) => {
|
|
|
5376
5692
|
return { fields: newFields, images };
|
|
5377
5693
|
};
|
|
5378
5694
|
class FormService extends BaseUploadService {
|
|
5379
|
-
|
|
5695
|
+
add(payload, initialRevision) {
|
|
5380
5696
|
var _a2;
|
|
5697
|
+
const { store } = this.client;
|
|
5381
5698
|
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
5382
|
-
const createdBy = (_a2 =
|
|
5383
|
-
const
|
|
5384
|
-
|
|
5385
|
-
|
|
5386
|
-
|
|
5387
|
-
const sha1 = await hashFile(file);
|
|
5388
|
-
if (!(sha1 in filePayloads)) {
|
|
5389
|
-
filePayloads[sha1] = {
|
|
5390
|
-
sha1,
|
|
5391
|
-
file_type: file.type,
|
|
5392
|
-
extension: file.name.split(".").pop(),
|
|
5393
|
-
size: file.size
|
|
5394
|
-
};
|
|
5395
|
-
await this.client.files.addCache(file, sha1);
|
|
5396
|
-
}
|
|
5397
|
-
const offlineFormRevisionAttachment = offline({
|
|
5398
|
-
file: URL.createObjectURL(file),
|
|
5399
|
-
file_type: file.type,
|
|
5400
|
-
file_name: file.name,
|
|
5401
|
-
file_sha1: sha1,
|
|
5402
|
-
created_by: createdBy,
|
|
5403
|
-
revision: revisionId,
|
|
5404
|
-
submitted_at: submittedAt,
|
|
5405
|
-
field_identifier: fieldIdentifier
|
|
5406
|
-
});
|
|
5407
|
-
offlineFormRevisionAttachments.push(offlineFormRevisionAttachment);
|
|
5408
|
-
const attachmentPayload = {
|
|
5409
|
-
offline_id: offlineFormRevisionAttachment.offline_id,
|
|
5410
|
-
name: file.name,
|
|
5411
|
-
field_identifier: fieldIdentifier,
|
|
5412
|
-
sha1
|
|
5413
|
-
};
|
|
5414
|
-
attachmentPayloads.push(attachmentPayload);
|
|
5415
|
-
}
|
|
5416
|
-
this.dispatch(addFormRevisionAttachments(offlineFormRevisionAttachments));
|
|
5417
|
-
const promise = this.enqueueRequest({
|
|
5418
|
-
description: "Attach files to form revision",
|
|
5419
|
-
method: HttpMethod.POST,
|
|
5420
|
-
url: `/forms/revisions/${revisionId}/attachments/bulk/`,
|
|
5421
|
-
payload: {
|
|
5422
|
-
submitted_at: submittedAt,
|
|
5423
|
-
attachments: attachmentPayloads,
|
|
5424
|
-
files: Object.values(filePayloads)
|
|
5425
|
-
},
|
|
5426
|
-
blockers: [revisionId],
|
|
5427
|
-
blocks: offlineFormRevisionAttachments.map((attachment) => attachment.offline_id)
|
|
5428
|
-
});
|
|
5429
|
-
promise.then((result) => {
|
|
5430
|
-
this.processPresignedUrls(result.presigned_urls);
|
|
5431
|
-
this.dispatch(updateFormRevisionAttachments(result.attachments));
|
|
5432
|
-
}).catch(() => {
|
|
5433
|
-
this.dispatch(
|
|
5434
|
-
deleteFormRevisionAttachments(
|
|
5435
|
-
offlineFormRevisionAttachments.map((attachment) => attachment.offline_id)
|
|
5436
|
-
)
|
|
5437
|
-
);
|
|
5699
|
+
const createdBy = (_a2 = store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
5700
|
+
const offlineForm = offline({
|
|
5701
|
+
...payload,
|
|
5702
|
+
submitted_at: submittedAt,
|
|
5703
|
+
created_by: createdBy
|
|
5438
5704
|
});
|
|
5439
|
-
return [offlineFormRevisionAttachments, promise.then(({ attachments }) => attachments)];
|
|
5440
|
-
}
|
|
5441
|
-
async add(ownerId, form, initialRevision, urlPrefix) {
|
|
5442
|
-
const { fields, images } = await separateImageFromFields(initialRevision.fields);
|
|
5443
5705
|
const offlineFormRevision = offline({
|
|
5444
5706
|
...initialRevision,
|
|
5445
|
-
|
|
5446
|
-
|
|
5447
|
-
|
|
5448
|
-
|
|
5449
|
-
revision: "Pending"
|
|
5707
|
+
form: offlineForm.offline_id,
|
|
5708
|
+
revision: "Pending",
|
|
5709
|
+
submitted_at: submittedAt,
|
|
5710
|
+
created_by: createdBy
|
|
5450
5711
|
});
|
|
5451
|
-
this.dispatch(addForm(
|
|
5712
|
+
this.dispatch(addForm(offlineForm));
|
|
5452
5713
|
this.dispatch(addFormRevision(offlineFormRevision));
|
|
5453
5714
|
const formPromise = this.enqueueRequest({
|
|
5454
5715
|
description: "Create form",
|
|
5455
5716
|
method: HttpMethod.POST,
|
|
5456
|
-
url:
|
|
5717
|
+
url: "/forms/",
|
|
5457
5718
|
payload: {
|
|
5458
5719
|
// Sending exactly what is currently needed for the endpoint
|
|
5459
|
-
offline_id:
|
|
5460
|
-
submitted_at:
|
|
5720
|
+
offline_id: offlineForm.offline_id,
|
|
5721
|
+
submitted_at: offlineForm.submitted_at,
|
|
5461
5722
|
initial_revision: {
|
|
5462
5723
|
offline_id: offlineFormRevision.offline_id,
|
|
5463
5724
|
submitted_at: offlineFormRevision.submitted_at,
|
|
@@ -5466,134 +5727,41 @@ var __publicField = (obj, key, value) => {
|
|
|
5466
5727
|
fields: offlineFormRevision.fields
|
|
5467
5728
|
}
|
|
5468
5729
|
},
|
|
5469
|
-
blockers: [
|
|
5470
|
-
|
|
5730
|
+
blockers: [
|
|
5731
|
+
...payload.project ? [payload.project.toString()] : [],
|
|
5732
|
+
...payload.organization ? [payload.organization.toString()] : []
|
|
5733
|
+
],
|
|
5734
|
+
blocks: [offlineForm.offline_id, offlineFormRevision.offline_id]
|
|
5471
5735
|
});
|
|
5472
|
-
const [offlineFormRevisionAttachments, attachmentsPromise] = await this.bulkAddRevisionAttachments(
|
|
5473
|
-
offlineFormRevision.offline_id,
|
|
5474
|
-
images
|
|
5475
|
-
);
|
|
5476
5736
|
void formPromise.catch((e) => {
|
|
5477
|
-
this.dispatch(deleteForm(
|
|
5737
|
+
this.dispatch(deleteForm(offlineForm.offline_id));
|
|
5478
5738
|
this.dispatch(deleteFormRevision(offlineFormRevision.offline_id));
|
|
5479
5739
|
throw e;
|
|
5480
5740
|
});
|
|
5481
|
-
return [
|
|
5482
|
-
}
|
|
5483
|
-
addForOrganization(organizationId, initialRevision) {
|
|
5484
|
-
var _a2;
|
|
5485
|
-
const state = this.client.store.getState();
|
|
5486
|
-
const offlineForm = offline({
|
|
5487
|
-
favorite: false,
|
|
5488
|
-
created_by: (_a2 = state.userReducer.currentUser) == null ? void 0 : _a2.id,
|
|
5489
|
-
submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
5490
|
-
organization: organizationId
|
|
5491
|
-
});
|
|
5492
|
-
return this.add(
|
|
5493
|
-
organizationId.toString(),
|
|
5494
|
-
offlineForm,
|
|
5495
|
-
initialRevision,
|
|
5496
|
-
`/organizations/${organizationId}/create-form/`
|
|
5497
|
-
);
|
|
5498
|
-
}
|
|
5499
|
-
addForProject(projectId, initialRevision) {
|
|
5500
|
-
var _a2;
|
|
5501
|
-
const state = this.client.store.getState();
|
|
5502
|
-
const offlineForm = offline({
|
|
5503
|
-
favorite: false,
|
|
5504
|
-
created_by: (_a2 = state.userReducer.currentUser) == null ? void 0 : _a2.id,
|
|
5505
|
-
submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
5506
|
-
project: projectId
|
|
5507
|
-
});
|
|
5508
|
-
return this.add(projectId.toString(), offlineForm, initialRevision, `/projects/${projectId}/create-form/`);
|
|
5509
|
-
}
|
|
5510
|
-
addForIssueType(issueTypeId, initialRevision) {
|
|
5511
|
-
var _a2;
|
|
5512
|
-
const state = this.client.store.getState();
|
|
5513
|
-
const offlineForm = offline({
|
|
5514
|
-
favorite: false,
|
|
5515
|
-
created_by: (_a2 = state.userReducer.currentUser) == null ? void 0 : _a2.id,
|
|
5516
|
-
submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
5517
|
-
issue_type: issueTypeId
|
|
5518
|
-
});
|
|
5519
|
-
return this.add(issueTypeId, offlineForm, initialRevision, `/issues/types/${issueTypeId}/create-form/`);
|
|
5520
|
-
}
|
|
5521
|
-
addForAssetType(assetTypeId, initialRevision) {
|
|
5522
|
-
var _a2;
|
|
5523
|
-
const state = this.client.store.getState();
|
|
5524
|
-
const offlineForm = offline({
|
|
5525
|
-
favorite: false,
|
|
5526
|
-
created_by: (_a2 = state.userReducer.currentUser) == null ? void 0 : _a2.id,
|
|
5527
|
-
submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
5528
|
-
asset_type: assetTypeId
|
|
5529
|
-
});
|
|
5530
|
-
return this.add(assetTypeId, offlineForm, initialRevision, `/assets/types/${assetTypeId}/create-form/`);
|
|
5741
|
+
return [offlineForm, offlineFormRevision, formPromise];
|
|
5531
5742
|
}
|
|
5532
|
-
async
|
|
5533
|
-
var _a2;
|
|
5534
|
-
const offlineRevision = offline(revision);
|
|
5535
|
-
const { store } = this.client;
|
|
5536
|
-
const state = store.getState();
|
|
5537
|
-
const createdBy = (_a2 = state.userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
5538
|
-
const { fields, images } = await separateImageFromFields(offlineRevision.fields);
|
|
5539
|
-
const fullRevision = {
|
|
5540
|
-
...offlineRevision,
|
|
5541
|
-
fields,
|
|
5542
|
-
created_by: createdBy,
|
|
5543
|
-
revision: "Pending",
|
|
5544
|
-
form: formId,
|
|
5545
|
-
submitted_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
5546
|
-
};
|
|
5547
|
-
this.dispatch(addFormRevision(fullRevision));
|
|
5548
|
-
const promise = this.enqueueRequest({
|
|
5549
|
-
description: "Create form revision",
|
|
5550
|
-
method: HttpMethod.PATCH,
|
|
5551
|
-
url: `/forms/${formId}/`,
|
|
5552
|
-
payload: {
|
|
5553
|
-
initial_revision: {
|
|
5554
|
-
offline_id: fullRevision.offline_id,
|
|
5555
|
-
submitted_at: fullRevision.submitted_at,
|
|
5556
|
-
title: fullRevision.title,
|
|
5557
|
-
description: fullRevision.description,
|
|
5558
|
-
fields: fullRevision.fields
|
|
5559
|
-
}
|
|
5560
|
-
},
|
|
5561
|
-
blockers: [formId],
|
|
5562
|
-
blocks: [offlineRevision.offline_id]
|
|
5563
|
-
});
|
|
5564
|
-
const [offlineFormRevisionAttachments, attachmentsPromise] = await this.bulkAddRevisionAttachments(
|
|
5565
|
-
fullRevision.offline_id,
|
|
5566
|
-
images
|
|
5567
|
-
);
|
|
5568
|
-
void promise.then((result) => {
|
|
5569
|
-
this.dispatch(setFormRevision(result));
|
|
5570
|
-
}).catch(() => {
|
|
5571
|
-
this.dispatch(deleteFormRevision(fullRevision.offline_id));
|
|
5572
|
-
});
|
|
5573
|
-
return [fullRevision, offlineFormRevisionAttachments, promise, attachmentsPromise];
|
|
5574
|
-
}
|
|
5575
|
-
async delete(formId) {
|
|
5743
|
+
async delete(id) {
|
|
5576
5744
|
const { store } = this.client;
|
|
5577
5745
|
const state = store.getState();
|
|
5578
|
-
const form = selectFormById(
|
|
5746
|
+
const form = selectFormById(id)(state);
|
|
5579
5747
|
if (!form) {
|
|
5580
5748
|
throw new Error("Expected form to exist");
|
|
5581
5749
|
}
|
|
5582
|
-
const formSubmissions = selectFormSubmissionsOfForm(
|
|
5750
|
+
const formSubmissions = selectFormSubmissionsOfForm(id)(state);
|
|
5583
5751
|
if (formSubmissions.length > 0) {
|
|
5584
5752
|
this.dispatch(deleteFormSubmissions(formSubmissions.map(({ offline_id }) => offline_id)));
|
|
5585
5753
|
}
|
|
5586
|
-
const formRevisions = selectFormRevisionsOfForm(
|
|
5754
|
+
const formRevisions = selectFormRevisionsOfForm(id)(state);
|
|
5587
5755
|
if (formRevisions.length > 0) {
|
|
5588
5756
|
this.dispatch(deleteFormRevisions(formRevisions.map(({ offline_id }) => offline_id)));
|
|
5589
5757
|
}
|
|
5590
|
-
this.dispatch(deleteForm(
|
|
5758
|
+
this.dispatch(deleteForm(id));
|
|
5591
5759
|
try {
|
|
5592
5760
|
return await this.enqueueRequest({
|
|
5593
5761
|
description: "Delete form",
|
|
5594
5762
|
method: HttpMethod.DELETE,
|
|
5595
|
-
url: `/forms/${
|
|
5596
|
-
blockers: [
|
|
5763
|
+
url: `/forms/${id}/`,
|
|
5764
|
+
blockers: [id],
|
|
5597
5765
|
blocks: []
|
|
5598
5766
|
});
|
|
5599
5767
|
} catch (e) {
|
|
@@ -5607,65 +5775,31 @@ var __publicField = (obj, key, value) => {
|
|
|
5607
5775
|
throw e;
|
|
5608
5776
|
}
|
|
5609
5777
|
}
|
|
5610
|
-
async refreshStore(projectId) {
|
|
5611
|
-
|
|
5612
|
-
const
|
|
5613
|
-
const attachments = [];
|
|
5614
|
-
const projectFormsResult = await this.enqueueRequest({
|
|
5778
|
+
async refreshStore(projectId, organizationId) {
|
|
5779
|
+
let forms = [];
|
|
5780
|
+
const projectForms = await this.enqueueRequest({
|
|
5615
5781
|
description: "Fetch project forms",
|
|
5616
5782
|
method: HttpMethod.GET,
|
|
5617
|
-
url:
|
|
5783
|
+
url: "/forms/",
|
|
5784
|
+
queryParams: {
|
|
5785
|
+
project: projectId.toString()
|
|
5786
|
+
},
|
|
5618
5787
|
blockers: [projectId.toString()],
|
|
5619
5788
|
blocks: []
|
|
5620
5789
|
});
|
|
5621
|
-
|
|
5622
|
-
|
|
5623
|
-
for (const revision of projectFormsResult.revisions)
|
|
5624
|
-
revisions.push(revision);
|
|
5625
|
-
for (const attachment of projectFormsResult.attachments)
|
|
5626
|
-
attachments.push(attachment);
|
|
5627
|
-
const organizationFormsResult = await this.enqueueRequest({
|
|
5790
|
+
forms = forms.concat(projectForms);
|
|
5791
|
+
const organizationForms = await this.enqueueRequest({
|
|
5628
5792
|
description: "Fetch organization forms",
|
|
5629
5793
|
method: HttpMethod.GET,
|
|
5630
|
-
url:
|
|
5631
|
-
|
|
5632
|
-
|
|
5633
|
-
|
|
5634
|
-
|
|
5635
|
-
forms.push(form);
|
|
5636
|
-
for (const revision of organizationFormsResult.revisions)
|
|
5637
|
-
revisions.push(revision);
|
|
5638
|
-
for (const attachment of organizationFormsResult.attachments)
|
|
5639
|
-
attachments.push(attachment);
|
|
5640
|
-
const assetTypeFormsResult = await this.enqueueRequest({
|
|
5641
|
-
description: "Fetch asset type forms",
|
|
5642
|
-
method: HttpMethod.GET,
|
|
5643
|
-
url: `/projects/${projectId}/asset-types/forms/`,
|
|
5644
|
-
blockers: [projectId.toString()],
|
|
5645
|
-
blocks: []
|
|
5646
|
-
});
|
|
5647
|
-
for (const form of assetTypeFormsResult.forms)
|
|
5648
|
-
forms.push(form);
|
|
5649
|
-
for (const revision of assetTypeFormsResult.revisions)
|
|
5650
|
-
revisions.push(revision);
|
|
5651
|
-
for (const attachment of assetTypeFormsResult.attachments)
|
|
5652
|
-
attachments.push(attachment);
|
|
5653
|
-
const issueTypeFormsResult = await this.enqueueRequest({
|
|
5654
|
-
description: "Fetch issue type forms",
|
|
5655
|
-
method: HttpMethod.GET,
|
|
5656
|
-
url: `/projects/${projectId}/issue-types/forms/`,
|
|
5657
|
-
blockers: [projectId.toString()],
|
|
5794
|
+
url: "/forms/",
|
|
5795
|
+
queryParams: {
|
|
5796
|
+
organization: organizationId.toString()
|
|
5797
|
+
},
|
|
5798
|
+
blockers: [organizationId.toString()],
|
|
5658
5799
|
blocks: []
|
|
5659
5800
|
});
|
|
5660
|
-
|
|
5661
|
-
forms.push(form);
|
|
5662
|
-
for (const revision of issueTypeFormsResult.revisions)
|
|
5663
|
-
revisions.push(revision);
|
|
5664
|
-
for (const attachment of issueTypeFormsResult.attachments)
|
|
5665
|
-
attachments.push(attachment);
|
|
5801
|
+
forms = forms.concat(organizationForms);
|
|
5666
5802
|
this.dispatch(initializeForms(forms));
|
|
5667
|
-
this.dispatch(initializeFormRevisions(revisions));
|
|
5668
|
-
this.dispatch(initializeFormRevisionAttachments(attachments));
|
|
5669
5803
|
}
|
|
5670
5804
|
}
|
|
5671
5805
|
const isArrayOfFiles = (value) => {
|
|
@@ -5687,95 +5821,11 @@ var __publicField = (obj, key, value) => {
|
|
|
5687
5821
|
return { values: newValues, files };
|
|
5688
5822
|
};
|
|
5689
5823
|
class FormSubmissionService extends BaseUploadService {
|
|
5690
|
-
|
|
5691
|
-
var _a2;
|
|
5692
|
-
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
5693
|
-
const createdBy = (_a2 = this.client.store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
5694
|
-
const filePayloads = {};
|
|
5695
|
-
const offlineFormSubmissionAttachments = [];
|
|
5696
|
-
const attachmentPayloads = [];
|
|
5697
|
-
for (const [fieldIdentifier, filesArray] of Object.entries(files)) {
|
|
5698
|
-
for (const file of filesArray) {
|
|
5699
|
-
const sha1 = await hashFile(file);
|
|
5700
|
-
if (!(sha1 in filePayloads)) {
|
|
5701
|
-
filePayloads[sha1] = {
|
|
5702
|
-
sha1,
|
|
5703
|
-
file_type: file.type,
|
|
5704
|
-
extension: file.name.split(".").pop(),
|
|
5705
|
-
size: file.size
|
|
5706
|
-
};
|
|
5707
|
-
await this.client.files.addCache(file, sha1);
|
|
5708
|
-
}
|
|
5709
|
-
const offlineFormSubmissionAttachment = offline({
|
|
5710
|
-
file: URL.createObjectURL(file),
|
|
5711
|
-
file_type: file.type,
|
|
5712
|
-
file_name: file.name,
|
|
5713
|
-
file_sha1: sha1,
|
|
5714
|
-
created_by: createdBy,
|
|
5715
|
-
submission: submissionId,
|
|
5716
|
-
submitted_at: submittedAt,
|
|
5717
|
-
field_identifier: fieldIdentifier
|
|
5718
|
-
});
|
|
5719
|
-
offlineFormSubmissionAttachments.push(offlineFormSubmissionAttachment);
|
|
5720
|
-
const attachmentPayload = {
|
|
5721
|
-
offline_id: offlineFormSubmissionAttachment.offline_id,
|
|
5722
|
-
name: file.name,
|
|
5723
|
-
sha1,
|
|
5724
|
-
field_identifier: fieldIdentifier
|
|
5725
|
-
};
|
|
5726
|
-
attachmentPayloads.push(attachmentPayload);
|
|
5727
|
-
}
|
|
5728
|
-
}
|
|
5729
|
-
this.dispatch(addFormSubmissionAttachments(offlineFormSubmissionAttachments));
|
|
5730
|
-
const promise = this.enqueueRequest({
|
|
5731
|
-
description: "Attach files to form submission",
|
|
5732
|
-
method: HttpMethod.POST,
|
|
5733
|
-
url: `/forms/submissions/${submissionId}/attachments/bulk/`,
|
|
5734
|
-
payload: {
|
|
5735
|
-
submitted_at: submittedAt,
|
|
5736
|
-
attachments: attachmentPayloads,
|
|
5737
|
-
files: Object.values(filePayloads)
|
|
5738
|
-
},
|
|
5739
|
-
blockers: [submissionId],
|
|
5740
|
-
blocks: offlineFormSubmissionAttachments.map((attachment) => attachment.offline_id)
|
|
5741
|
-
});
|
|
5742
|
-
promise.then((result) => {
|
|
5743
|
-
this.processPresignedUrls(result.presigned_urls);
|
|
5744
|
-
this.dispatch(updateFormSubmissionAttachments(result.attachments));
|
|
5745
|
-
}).catch(() => {
|
|
5746
|
-
this.dispatch(
|
|
5747
|
-
deleteFormSubmissionAttachments(
|
|
5748
|
-
offlineFormSubmissionAttachments.map((attachment) => attachment.offline_id)
|
|
5749
|
-
)
|
|
5750
|
-
);
|
|
5751
|
-
});
|
|
5752
|
-
return [offlineFormSubmissionAttachments, promise.then(({ attachments }) => attachments)];
|
|
5753
|
-
}
|
|
5754
|
-
async bulkDeleteSubmissionAttachments(submissionId, attachmentsIds) {
|
|
5755
|
-
const { store } = this.client;
|
|
5756
|
-
const state = store.getState();
|
|
5757
|
-
const formSubmissionAttachments = selectFormSubmissionAttachemntsByIds(attachmentsIds)(state);
|
|
5758
|
-
this.dispatch(deleteFormSubmissionAttachments(attachmentsIds));
|
|
5759
|
-
try {
|
|
5760
|
-
await this.enqueueRequest({
|
|
5761
|
-
description: "Delete form submission attachments",
|
|
5762
|
-
method: HttpMethod.DELETE,
|
|
5763
|
-
url: `/forms/submissions/${submissionId}/attachments/bulk/`,
|
|
5764
|
-
payload: { attachments: attachmentsIds },
|
|
5765
|
-
blockers: [submissionId, ...attachmentsIds],
|
|
5766
|
-
blocks: []
|
|
5767
|
-
});
|
|
5768
|
-
} catch (e) {
|
|
5769
|
-
this.dispatch(addFormSubmissionAttachments(formSubmissionAttachments));
|
|
5770
|
-
throw e;
|
|
5771
|
-
}
|
|
5772
|
-
}
|
|
5773
|
-
// Outer promise is for hashing and caching files for submission attachments
|
|
5774
|
-
async add(payload) {
|
|
5824
|
+
add(payload) {
|
|
5775
5825
|
var _a2;
|
|
5776
5826
|
const { store } = this.client;
|
|
5777
5827
|
const state = store.getState();
|
|
5778
|
-
const { values
|
|
5828
|
+
const { values } = separateFilesFromValues(payload.values);
|
|
5779
5829
|
const offlineSubmission = offline({
|
|
5780
5830
|
...payload,
|
|
5781
5831
|
values,
|
|
@@ -5785,7 +5835,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5785
5835
|
const promise = this.enqueueRequest({
|
|
5786
5836
|
description: "Respond to form",
|
|
5787
5837
|
method: HttpMethod.POST,
|
|
5788
|
-
url:
|
|
5838
|
+
url: "/form-submissions/",
|
|
5789
5839
|
payload: offlineSubmission,
|
|
5790
5840
|
blockers: [payload.issue, payload.asset, payload.asset_stage, "add-form-entry"].filter(
|
|
5791
5841
|
(x) => x !== void 0
|
|
@@ -5793,10 +5843,6 @@ var __publicField = (obj, key, value) => {
|
|
|
5793
5843
|
blocks: [offlineSubmission.offline_id]
|
|
5794
5844
|
});
|
|
5795
5845
|
this.dispatch(addFormSubmission(offlineSubmission));
|
|
5796
|
-
const [offlineFormSubmissionAttachments, attachmentsPromise] = await this.bulkAddSubmissionAttachments(
|
|
5797
|
-
offlineSubmission.offline_id,
|
|
5798
|
-
files
|
|
5799
|
-
);
|
|
5800
5846
|
promise.then((result) => {
|
|
5801
5847
|
this.dispatch(addActiveProjectFormSubmissionsCount(1));
|
|
5802
5848
|
this.dispatch(setFormSubmission(result));
|
|
@@ -5805,115 +5851,16 @@ var __publicField = (obj, key, value) => {
|
|
|
5805
5851
|
this.dispatch(deleteFormSubmission(offlineSubmission.offline_id));
|
|
5806
5852
|
this.dispatch(addActiveProjectFormSubmissionsCount(-1));
|
|
5807
5853
|
});
|
|
5808
|
-
return [offlineSubmission,
|
|
5809
|
-
}
|
|
5810
|
-
// Note currently the bulkAdd method is specific to form submissions for assets
|
|
5811
|
-
// TODO: adapt the support bulk adding to any model type
|
|
5812
|
-
async bulkAdd(args, batchSize) {
|
|
5813
|
-
const { formRevision, commonFieldValues, fieldValuesByAsset } = args;
|
|
5814
|
-
const { values: fileSeperatedCommonFieldValues, files: commonFiles } = separateFilesFromValues(commonFieldValues);
|
|
5815
|
-
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
5816
|
-
const transactionId = uuid.v4();
|
|
5817
|
-
const assetIdBatches = chunkArray(Object.keys(fieldValuesByAsset), batchSize);
|
|
5818
|
-
const bulkAddBatches = await Promise.all(
|
|
5819
|
-
assetIdBatches.map(async (assetIdBatch) => {
|
|
5820
|
-
const batchId = uuid.v4();
|
|
5821
|
-
const submissionPayloads = [];
|
|
5822
|
-
const attachmentPayloads = [];
|
|
5823
|
-
const files = { ...commonFiles };
|
|
5824
|
-
for (const assetId of assetIdBatch) {
|
|
5825
|
-
const { values: fileSeperatedSubmissionSpecificValues, files: submissionSpecificFiles } = separateFilesFromValues(fieldValuesByAsset[assetId] ?? {});
|
|
5826
|
-
Object.assign(files, submissionSpecificFiles);
|
|
5827
|
-
const submissionPayload = offline({
|
|
5828
|
-
asset_id: assetId,
|
|
5829
|
-
form_data: fileSeperatedSubmissionSpecificValues
|
|
5830
|
-
});
|
|
5831
|
-
submissionPayloads.push(submissionPayload);
|
|
5832
|
-
for (const [fieldIdentifier, fileArray] of Object.entries(files)) {
|
|
5833
|
-
for (const file of fileArray) {
|
|
5834
|
-
const sha1 = await hashFile(file);
|
|
5835
|
-
await this.client.files.addCache(file, sha1);
|
|
5836
|
-
const attachmentPayload = offline({
|
|
5837
|
-
submission_id: submissionPayload.offline_id,
|
|
5838
|
-
sha1,
|
|
5839
|
-
name: file.name,
|
|
5840
|
-
field_identifier: fieldIdentifier
|
|
5841
|
-
});
|
|
5842
|
-
attachmentPayloads.push(attachmentPayload);
|
|
5843
|
-
}
|
|
5844
|
-
}
|
|
5845
|
-
}
|
|
5846
|
-
const filePaylods = [];
|
|
5847
|
-
for (const file of Object.values(files).flat()) {
|
|
5848
|
-
const sha1 = await hashFile(file);
|
|
5849
|
-
const filePayload = {
|
|
5850
|
-
sha1,
|
|
5851
|
-
extension: file.name.split(".").pop() || "",
|
|
5852
|
-
file_type: file.type,
|
|
5853
|
-
size: file.size
|
|
5854
|
-
};
|
|
5855
|
-
filePaylods.push(filePayload);
|
|
5856
|
-
}
|
|
5857
|
-
return {
|
|
5858
|
-
batchId,
|
|
5859
|
-
payload: {
|
|
5860
|
-
transaction_id: transactionId,
|
|
5861
|
-
form_data: fileSeperatedCommonFieldValues,
|
|
5862
|
-
submitted_at: submittedAt,
|
|
5863
|
-
submissions: submissionPayloads,
|
|
5864
|
-
attachments: attachmentPayloads,
|
|
5865
|
-
files: filePaylods
|
|
5866
|
-
}
|
|
5867
|
-
};
|
|
5868
|
-
})
|
|
5869
|
-
);
|
|
5870
|
-
const batchPromises = [];
|
|
5871
|
-
let prevBatchId = null;
|
|
5872
|
-
for (const batch of bulkAddBatches) {
|
|
5873
|
-
const { payload, batchId } = batch;
|
|
5874
|
-
const batchAssetIds = payload.submissions.map((x) => x.asset_id);
|
|
5875
|
-
const batchSubmissionOfflineIds = payload.submissions.map((x) => x.offline_id);
|
|
5876
|
-
const batchAttachmentsOfflineIds = payload.attachments.map((x) => x.offline_id);
|
|
5877
|
-
const blockers = batchAssetIds;
|
|
5878
|
-
if (prevBatchId)
|
|
5879
|
-
blockers.push(prevBatchId);
|
|
5880
|
-
const blocks2 = [...batchSubmissionOfflineIds, ...batchAttachmentsOfflineIds, batchId];
|
|
5881
|
-
const promise = this.enqueueRequest({
|
|
5882
|
-
description: "Bulk add form submissions",
|
|
5883
|
-
method: HttpMethod.POST,
|
|
5884
|
-
url: `/forms/revisions/${formRevision}/bulk-respond/`,
|
|
5885
|
-
payload,
|
|
5886
|
-
blockers,
|
|
5887
|
-
blocks: blocks2
|
|
5888
|
-
});
|
|
5889
|
-
void promise.then(({ presigned_urls }) => {
|
|
5890
|
-
this.processPresignedUrls(presigned_urls);
|
|
5891
|
-
});
|
|
5892
|
-
prevBatchId = batchId;
|
|
5893
|
-
batchPromises.push(promise);
|
|
5894
|
-
}
|
|
5895
|
-
void Promise.all(batchPromises).then((results) => {
|
|
5896
|
-
const createdSubmissions = [];
|
|
5897
|
-
const createdAttachments = [];
|
|
5898
|
-
for (const result of results) {
|
|
5899
|
-
for (const createdSubmission of result.submissions)
|
|
5900
|
-
createdSubmissions.push(createdSubmission);
|
|
5901
|
-
for (const createdAttachment of result.attachments)
|
|
5902
|
-
createdAttachments.push(createdAttachment);
|
|
5903
|
-
}
|
|
5904
|
-
this.dispatch(addFormSubmissions(createdSubmissions));
|
|
5905
|
-
this.dispatch(addFormSubmissionAttachments(createdAttachments));
|
|
5906
|
-
});
|
|
5907
|
-
return batchPromises;
|
|
5854
|
+
return [offlineSubmission, promise];
|
|
5908
5855
|
}
|
|
5909
|
-
|
|
5856
|
+
update(payload) {
|
|
5910
5857
|
const { store } = this.client;
|
|
5911
5858
|
const state = store.getState();
|
|
5912
5859
|
const submissionToBeUpdated = selectFormSubmissionById(payload.offline_id)(state);
|
|
5913
5860
|
if (!submissionToBeUpdated) {
|
|
5914
5861
|
throw new Error(`Expected submission with offline_id ${payload.offline_id} to exist`);
|
|
5915
5862
|
}
|
|
5916
|
-
const { values
|
|
5863
|
+
const { values } = separateFilesFromValues(payload.values ?? {});
|
|
5917
5864
|
const updatedSubmission = {
|
|
5918
5865
|
...submissionToBeUpdated,
|
|
5919
5866
|
...payload,
|
|
@@ -5927,57 +5874,36 @@ var __publicField = (obj, key, value) => {
|
|
|
5927
5874
|
const promise = this.enqueueRequest({
|
|
5928
5875
|
description: "Delete user form submissions",
|
|
5929
5876
|
method: HttpMethod.PATCH,
|
|
5930
|
-
url: `/
|
|
5877
|
+
url: `/form-submissions/${updatedSubmission.offline_id}/`,
|
|
5931
5878
|
// TODO: send just payload when FormSubmissionDeserializer is updated to handle partial updates
|
|
5932
5879
|
payload: updatedSubmission,
|
|
5933
5880
|
blockers: [updatedSubmission.offline_id],
|
|
5934
5881
|
blocks: [updatedSubmission.offline_id]
|
|
5935
5882
|
});
|
|
5936
|
-
const formSubmissionAttachments = selectAttachmentsOfFormSubmission(payload.offline_id)(state);
|
|
5937
|
-
const formSubmissionAttachmentIdsToBeDeleted = [];
|
|
5938
|
-
for (const attachment of formSubmissionAttachments) {
|
|
5939
|
-
if (attachment.field_identifier in files) {
|
|
5940
|
-
formSubmissionAttachmentIdsToBeDeleted.push(attachment.offline_id);
|
|
5941
|
-
}
|
|
5942
|
-
}
|
|
5943
|
-
const [offlineFormSubmissionAttachments, attachmentsPromise] = await this.bulkAddSubmissionAttachments(
|
|
5944
|
-
payload.offline_id,
|
|
5945
|
-
files
|
|
5946
|
-
);
|
|
5947
|
-
const deleteAttachmentsPromise = this.bulkDeleteSubmissionAttachments(
|
|
5948
|
-
payload.offline_id,
|
|
5949
|
-
formSubmissionAttachmentIdsToBeDeleted
|
|
5950
|
-
);
|
|
5951
5883
|
promise.then((result) => {
|
|
5952
5884
|
this.dispatch(setFormSubmission(result));
|
|
5953
5885
|
}).catch(() => {
|
|
5954
5886
|
this.dispatch(setFormSubmission(submissionToBeUpdated));
|
|
5955
5887
|
});
|
|
5956
|
-
return [
|
|
5957
|
-
updatedSubmission,
|
|
5958
|
-
offlineFormSubmissionAttachments,
|
|
5959
|
-
promise,
|
|
5960
|
-
attachmentsPromise,
|
|
5961
|
-
deleteAttachmentsPromise
|
|
5962
|
-
];
|
|
5888
|
+
return [updatedSubmission, promise];
|
|
5963
5889
|
}
|
|
5964
|
-
async delete(
|
|
5890
|
+
async delete(id) {
|
|
5965
5891
|
const { store } = this.client;
|
|
5966
5892
|
const state = store.getState();
|
|
5967
|
-
const submissionToBeDeleted = selectFormSubmissionById(
|
|
5893
|
+
const submissionToBeDeleted = selectFormSubmissionById(id)(state);
|
|
5968
5894
|
if (!submissionToBeDeleted) {
|
|
5969
|
-
throw new Error(`Expected submission with offline_id ${
|
|
5895
|
+
throw new Error(`Expected submission with offline_id ${id} to exist`);
|
|
5970
5896
|
}
|
|
5971
|
-
const submissionAttachments = selectAttachmentsOfFormSubmission(
|
|
5972
|
-
this.dispatch(deleteFormSubmission(
|
|
5897
|
+
const submissionAttachments = selectAttachmentsOfFormSubmission(id)(state);
|
|
5898
|
+
this.dispatch(deleteFormSubmission(id));
|
|
5973
5899
|
this.dispatch(addActiveProjectFormSubmissionsCount(-1));
|
|
5974
5900
|
this.dispatch(deleteFormSubmissionAttachments(submissionAttachments.map((x) => x.offline_id)));
|
|
5975
5901
|
try {
|
|
5976
5902
|
return await this.enqueueRequest({
|
|
5977
5903
|
description: "Delete user form submissions",
|
|
5978
5904
|
method: HttpMethod.DELETE,
|
|
5979
|
-
url: `/
|
|
5980
|
-
blockers: [
|
|
5905
|
+
url: `/form-submissions/${id}/`,
|
|
5906
|
+
blockers: [id],
|
|
5981
5907
|
blocks: []
|
|
5982
5908
|
});
|
|
5983
5909
|
} catch (e) {
|
|
@@ -5988,50 +5914,17 @@ var __publicField = (obj, key, value) => {
|
|
|
5988
5914
|
}
|
|
5989
5915
|
}
|
|
5990
5916
|
async refreshStore(projectId) {
|
|
5991
|
-
const
|
|
5992
|
-
|
|
5993
|
-
description: "Fetch model submissions",
|
|
5994
|
-
method: HttpMethod.GET,
|
|
5995
|
-
url: `/forms/in-project/${projectId}/submissions/model/latest/`,
|
|
5996
|
-
blockers: [],
|
|
5997
|
-
blocks: []
|
|
5998
|
-
});
|
|
5999
|
-
for (const modelSubmission of modelSubmissions) {
|
|
6000
|
-
formSubmissions[modelSubmission.offline_id] = modelSubmission;
|
|
6001
|
-
}
|
|
6002
|
-
const standaloneSubmissions = await this.enqueueRequest({
|
|
6003
|
-
description: "Fetch standalone submissions",
|
|
6004
|
-
method: HttpMethod.GET,
|
|
6005
|
-
url: `/forms/in-project/${projectId}/submissions/standalone/`,
|
|
6006
|
-
blockers: [],
|
|
6007
|
-
blocks: []
|
|
6008
|
-
});
|
|
6009
|
-
for (const standaloneSubmission of standaloneSubmissions) {
|
|
6010
|
-
formSubmissions[standaloneSubmission.offline_id] = standaloneSubmission;
|
|
6011
|
-
}
|
|
6012
|
-
this.dispatch(initializeFormSubmissions(Object.values(formSubmissions)));
|
|
6013
|
-
const attachments = {};
|
|
6014
|
-
const modelAttachments = await this.enqueueRequest({
|
|
6015
|
-
description: "Fetch model submission attachments",
|
|
6016
|
-
method: HttpMethod.GET,
|
|
6017
|
-
url: `/forms/in-project/${projectId}/attachments/model/latest/`,
|
|
6018
|
-
blockers: [],
|
|
6019
|
-
blocks: []
|
|
6020
|
-
});
|
|
6021
|
-
for (const modelAttachment of modelAttachments) {
|
|
6022
|
-
attachments[modelAttachment.offline_id] = modelAttachment;
|
|
6023
|
-
}
|
|
6024
|
-
const standaloneAttachments = await this.enqueueRequest({
|
|
6025
|
-
description: "Fetch standalone submission attachments",
|
|
5917
|
+
const result = await this.enqueueRequest({
|
|
5918
|
+
description: "Fetch form submissions",
|
|
6026
5919
|
method: HttpMethod.GET,
|
|
6027
|
-
url:
|
|
5920
|
+
url: "/form-submissions/",
|
|
5921
|
+
queryParams: {
|
|
5922
|
+
project: projectId.toString()
|
|
5923
|
+
},
|
|
6028
5924
|
blockers: [],
|
|
6029
5925
|
blocks: []
|
|
6030
5926
|
});
|
|
6031
|
-
|
|
6032
|
-
attachments[standaloneAttachent.offline_id] = standaloneAttachent;
|
|
6033
|
-
}
|
|
6034
|
-
this.dispatch(initializeFormSubmissionAttachments(Object.values(attachments)));
|
|
5927
|
+
this.dispatch(initializeFormSubmissions(result));
|
|
6035
5928
|
}
|
|
6036
5929
|
}
|
|
6037
5930
|
class WorkspaceService extends BaseApiService {
|
|
@@ -6083,22 +5976,22 @@ var __publicField = (obj, key, value) => {
|
|
|
6083
5976
|
});
|
|
6084
5977
|
return [workspace, promise];
|
|
6085
5978
|
}
|
|
6086
|
-
delete(
|
|
5979
|
+
delete(id) {
|
|
6087
5980
|
const { store } = this.client;
|
|
6088
|
-
const originalWorkspace = selectWorkspaceById(
|
|
6089
|
-
|
|
5981
|
+
const originalWorkspace = selectWorkspaceById(id)(store.getState());
|
|
5982
|
+
if (!originalWorkspace) {
|
|
5983
|
+
throw new Error(`Expected an existing workspace with id ${id}`);
|
|
5984
|
+
}
|
|
5985
|
+
this.dispatch(deleteWorkspace(id));
|
|
6090
5986
|
const promise = this.enqueueRequest({
|
|
6091
5987
|
description: "Delete Workspace",
|
|
6092
5988
|
method: HttpMethod.DELETE,
|
|
6093
|
-
url: `/workspaces/${
|
|
6094
|
-
blockers: [
|
|
5989
|
+
url: `/workspaces/${id}/`,
|
|
5990
|
+
blockers: [id],
|
|
6095
5991
|
blocks: []
|
|
6096
5992
|
});
|
|
6097
|
-
void promise.
|
|
6098
|
-
|
|
6099
|
-
if (originalWorkspace) {
|
|
6100
|
-
this.dispatch(addWorkspace(originalWorkspace));
|
|
6101
|
-
}
|
|
5993
|
+
void promise.catch((reason) => {
|
|
5994
|
+
this.dispatch(addWorkspace(originalWorkspace));
|
|
6102
5995
|
throw reason;
|
|
6103
5996
|
});
|
|
6104
5997
|
return promise;
|
|
@@ -6476,9 +6369,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6476
6369
|
method: HttpMethod.GET,
|
|
6477
6370
|
url: `/billing/${license.offline_id}/`,
|
|
6478
6371
|
isAuthNeeded: true,
|
|
6479
|
-
blockers: [
|
|
6480
|
-
license.organization_owner ? license.organization_owner.toString() : license.user_owner ? license.user_owner.toString() : ""
|
|
6481
|
-
],
|
|
6372
|
+
blockers: [license.organization_owner ? license.organization_owner.toString() : ""],
|
|
6482
6373
|
blocks: []
|
|
6483
6374
|
});
|
|
6484
6375
|
this.dispatch(updateLicense(result));
|
|
@@ -6490,9 +6381,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6490
6381
|
method: HttpMethod.DELETE,
|
|
6491
6382
|
url: `/billing/${license.offline_id}/suspend/`,
|
|
6492
6383
|
isAuthNeeded: true,
|
|
6493
|
-
blockers: [
|
|
6494
|
-
license.organization_owner ? license.organization_owner.toString() : license.user_owner ? license.user_owner.toString() : ""
|
|
6495
|
-
],
|
|
6384
|
+
blockers: [license.organization_owner ? license.organization_owner.toString() : ""],
|
|
6496
6385
|
blocks: []
|
|
6497
6386
|
});
|
|
6498
6387
|
this.dispatch(updateLicense(result));
|
|
@@ -6504,9 +6393,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6504
6393
|
method: HttpMethod.PATCH,
|
|
6505
6394
|
url: `/billing/${license.offline_id}/suspend/`,
|
|
6506
6395
|
isAuthNeeded: true,
|
|
6507
|
-
blockers: [
|
|
6508
|
-
license.organization_owner ? license.organization_owner.toString() : license.user_owner ? license.user_owner.toString() : ""
|
|
6509
|
-
],
|
|
6396
|
+
blockers: [license.organization_owner ? license.organization_owner.toString() : ""],
|
|
6510
6397
|
blocks: []
|
|
6511
6398
|
});
|
|
6512
6399
|
this.dispatch(updateLicense(result));
|
|
@@ -6518,9 +6405,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6518
6405
|
method: HttpMethod.DELETE,
|
|
6519
6406
|
url: `/billing/${license.offline_id}/`,
|
|
6520
6407
|
isAuthNeeded: true,
|
|
6521
|
-
blockers: [
|
|
6522
|
-
license.organization_owner ? license.organization_owner.toString() : license.user_owner ? license.user_owner.toString() : ""
|
|
6523
|
-
],
|
|
6408
|
+
blockers: [license.organization_owner ? license.organization_owner.toString() : ""],
|
|
6524
6409
|
blocks: []
|
|
6525
6410
|
});
|
|
6526
6411
|
this.dispatch(updateLicense(result));
|
|
@@ -6534,7 +6419,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6534
6419
|
isAuthNeeded: true,
|
|
6535
6420
|
payload: { project: project.id },
|
|
6536
6421
|
blockers: [
|
|
6537
|
-
license.organization_owner ? license.organization_owner.toString() :
|
|
6422
|
+
license.organization_owner ? license.organization_owner.toString() : "",
|
|
6538
6423
|
project.id ? project.id.toString() : ""
|
|
6539
6424
|
],
|
|
6540
6425
|
blocks: ["add-issue", "add-form-entry", "change-access-level", "add-workspace"]
|
|
@@ -6548,9 +6433,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6548
6433
|
method: HttpMethod.DELETE,
|
|
6549
6434
|
url: `/billing/${license.offline_id}/project/`,
|
|
6550
6435
|
isAuthNeeded: true,
|
|
6551
|
-
blockers: [
|
|
6552
|
-
license.organization_owner ? license.organization_owner.toString() : license.user_owner ? license.user_owner.toString() : ""
|
|
6553
|
-
],
|
|
6436
|
+
blockers: [license.organization_owner ? license.organization_owner.toString() : ""],
|
|
6554
6437
|
blocks: ["add-issue", "add-form-entry", "change-access-level", "add-workspace"]
|
|
6555
6438
|
});
|
|
6556
6439
|
this.dispatch(updateLicense(result));
|
|
@@ -6743,8 +6626,8 @@ var __publicField = (obj, key, value) => {
|
|
|
6743
6626
|
class DocumentAttachmentService extends BaseAttachmentService {
|
|
6744
6627
|
constructor() {
|
|
6745
6628
|
super(...arguments);
|
|
6746
|
-
__publicField(this, "
|
|
6747
|
-
__publicField(this, "
|
|
6629
|
+
__publicField(this, "name", "Document Attachment");
|
|
6630
|
+
__publicField(this, "url", "/document-attachments");
|
|
6748
6631
|
__publicField(this, "addAttachments", addDocumentAttachments);
|
|
6749
6632
|
__publicField(this, "updateAttachments", updateDocumentAttachments);
|
|
6750
6633
|
__publicField(this, "removeAttachments", deleteDocumentAttachments);
|
|
@@ -6755,17 +6638,23 @@ var __publicField = (obj, key, value) => {
|
|
|
6755
6638
|
buildOfflineAttachment(data) {
|
|
6756
6639
|
return offline({
|
|
6757
6640
|
file: URL.createObjectURL(data.file),
|
|
6758
|
-
file_sha1: data.
|
|
6759
|
-
created_by: data.
|
|
6641
|
+
file_sha1: data.file_sha1,
|
|
6642
|
+
created_by: data.created_by,
|
|
6760
6643
|
file_name: data.file.name,
|
|
6761
6644
|
file_type: data.file.type,
|
|
6762
|
-
submitted_at: data.
|
|
6645
|
+
submitted_at: data.submitted_at,
|
|
6763
6646
|
description: data.description,
|
|
6764
6647
|
document: data.modelId
|
|
6765
6648
|
});
|
|
6766
6649
|
}
|
|
6650
|
+
buildAttachmentPayload(data) {
|
|
6651
|
+
return {
|
|
6652
|
+
...data,
|
|
6653
|
+
document: data.modelId
|
|
6654
|
+
};
|
|
6655
|
+
}
|
|
6767
6656
|
// NOTE: overriding the method from BaseAttachmentService since document attachments get vectorized
|
|
6768
|
-
async
|
|
6657
|
+
async bulkAdd(payloads) {
|
|
6769
6658
|
var _a2;
|
|
6770
6659
|
const { store } = this.client;
|
|
6771
6660
|
const createdBy = (_a2 = store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
@@ -6774,40 +6663,36 @@ var __publicField = (obj, key, value) => {
|
|
|
6774
6663
|
const attachmentPayloads = [];
|
|
6775
6664
|
const filePayloads = {};
|
|
6776
6665
|
const sha1ToAttachmentIds = {};
|
|
6777
|
-
for (const
|
|
6778
|
-
const
|
|
6779
|
-
|
|
6780
|
-
|
|
6781
|
-
|
|
6782
|
-
|
|
6783
|
-
extension: file.name.split(".").pop(),
|
|
6784
|
-
size: file.size
|
|
6785
|
-
};
|
|
6786
|
-
sha1ToAttachmentIds[sha1] = [];
|
|
6787
|
-
await this.client.files.addCache(file, sha1);
|
|
6666
|
+
for (const payload of payloads) {
|
|
6667
|
+
const { documentId, file } = payload;
|
|
6668
|
+
const filePayload = await this.getFilePayload(file);
|
|
6669
|
+
if (!(filePayload.sha1 in filePayloads)) {
|
|
6670
|
+
filePayloads[filePayload.sha1] = filePayload;
|
|
6671
|
+
sha1ToAttachmentIds[filePayload.sha1] = [];
|
|
6788
6672
|
}
|
|
6789
6673
|
const offlineAttachment = this.buildOfflineAttachment({
|
|
6790
6674
|
file,
|
|
6791
|
-
sha1,
|
|
6792
|
-
submittedAt,
|
|
6793
|
-
createdBy,
|
|
6675
|
+
file_sha1: filePayload.sha1,
|
|
6676
|
+
submitted_at: submittedAt,
|
|
6677
|
+
created_by: createdBy,
|
|
6794
6678
|
description: "",
|
|
6795
6679
|
modelId: documentId
|
|
6796
6680
|
});
|
|
6797
6681
|
offlineAttachments.push(offlineAttachment);
|
|
6798
6682
|
attachmentPayloads.push({
|
|
6799
6683
|
offline_id: offlineAttachment.offline_id,
|
|
6800
|
-
|
|
6801
|
-
|
|
6684
|
+
file_name: offlineAttachment.file_name,
|
|
6685
|
+
file_sha1: offlineAttachment.file_sha1,
|
|
6686
|
+
file_extension: filePayload.extension,
|
|
6802
6687
|
description: offlineAttachment.description
|
|
6803
6688
|
});
|
|
6804
|
-
sha1ToAttachmentIds[sha1].push(offlineAttachment.offline_id);
|
|
6689
|
+
sha1ToAttachmentIds[filePayload.sha1].push(offlineAttachment.offline_id);
|
|
6805
6690
|
}
|
|
6806
6691
|
this.dispatch(this.addAttachments(offlineAttachments));
|
|
6807
6692
|
const promise = this.enqueueRequest({
|
|
6808
6693
|
description: "Attach files to document",
|
|
6809
6694
|
method: HttpMethod.POST,
|
|
6810
|
-
url:
|
|
6695
|
+
url: "/document-attachments/bulk/",
|
|
6811
6696
|
payload: {
|
|
6812
6697
|
submitted_at: submittedAt,
|
|
6813
6698
|
attachments: attachmentPayloads,
|
|
@@ -6832,14 +6717,14 @@ var __publicField = (obj, key, value) => {
|
|
|
6832
6717
|
});
|
|
6833
6718
|
return [offlineAttachments, promise.then(({ attachments }) => attachments)];
|
|
6834
6719
|
}
|
|
6835
|
-
async
|
|
6836
|
-
return this.
|
|
6720
|
+
async delete(id) {
|
|
6721
|
+
return this._delete(id);
|
|
6837
6722
|
}
|
|
6838
6723
|
makeReadable(attachmnentId) {
|
|
6839
6724
|
void this.enqueueRequest({
|
|
6840
6725
|
description: "Add attachment to AI assistant",
|
|
6841
6726
|
method: HttpMethod.PATCH,
|
|
6842
|
-
url: `/
|
|
6727
|
+
url: `/document-attachments/${attachmnentId}/`,
|
|
6843
6728
|
payload: {
|
|
6844
6729
|
readable_to_assistant: true
|
|
6845
6730
|
},
|
|
@@ -6856,7 +6741,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6856
6741
|
blocks: [],
|
|
6857
6742
|
blockers: []
|
|
6858
6743
|
});
|
|
6859
|
-
this.dispatch(
|
|
6744
|
+
this.dispatch(initializeDocumentAttachments(projectDocumentAttachments));
|
|
6860
6745
|
const organizationDocumentAttachments = await this.enqueueRequest({
|
|
6861
6746
|
description: "Get document attachments",
|
|
6862
6747
|
method: HttpMethod.GET,
|
|
@@ -6991,21 +6876,21 @@ var __publicField = (obj, key, value) => {
|
|
|
6991
6876
|
});
|
|
6992
6877
|
return [offlineUpdatedTeam, promise];
|
|
6993
6878
|
}
|
|
6994
|
-
async delete(
|
|
6879
|
+
async delete(id) {
|
|
6995
6880
|
const { store } = this.client;
|
|
6996
6881
|
const state = store.getState();
|
|
6997
|
-
const team = selectTeamById(
|
|
6882
|
+
const team = selectTeamById(id)(state);
|
|
6998
6883
|
if (!team) {
|
|
6999
|
-
throw new Error(`Expected team with id ${
|
|
6884
|
+
throw new Error(`Expected team with id ${id} to exist`);
|
|
7000
6885
|
}
|
|
7001
|
-
this.dispatch(deleteTeam(
|
|
6886
|
+
this.dispatch(deleteTeam(id));
|
|
7002
6887
|
try {
|
|
7003
6888
|
return await this.enqueueRequest({
|
|
7004
6889
|
description: "Delete team",
|
|
7005
6890
|
method: HttpMethod.DELETE,
|
|
7006
|
-
url: `/organizations/teams/${
|
|
7007
|
-
blockers: [
|
|
7008
|
-
blocks: [
|
|
6891
|
+
url: `/organizations/teams/${id}/`,
|
|
6892
|
+
blockers: [id],
|
|
6893
|
+
blocks: [id]
|
|
7009
6894
|
});
|
|
7010
6895
|
} catch (e) {
|
|
7011
6896
|
this.dispatch(setTeam(team));
|
|
@@ -7100,17 +6985,11 @@ var __publicField = (obj, key, value) => {
|
|
|
7100
6985
|
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7101
6986
|
const createdBy = (_a2 = store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
7102
6987
|
const projectId = payloadWithoutFile.project;
|
|
7103
|
-
const
|
|
7104
|
-
const filePayload = {
|
|
7105
|
-
sha1,
|
|
7106
|
-
file_type: file.type,
|
|
7107
|
-
extension: file.name.split(".").pop(),
|
|
7108
|
-
size: file.size
|
|
7109
|
-
};
|
|
6988
|
+
const filePayload = await this.getFilePayload(file);
|
|
7110
6989
|
const offlineMapImage = offline({
|
|
7111
6990
|
...payloadWithoutFile,
|
|
7112
6991
|
file_name: file.name,
|
|
7113
|
-
file_sha1: sha1,
|
|
6992
|
+
file_sha1: filePayload.sha1,
|
|
7114
6993
|
file: URL.createObjectURL(file),
|
|
7115
6994
|
submitted_at: submittedAt,
|
|
7116
6995
|
created_by: createdBy
|
|
@@ -7153,23 +7032,16 @@ var __publicField = (obj, key, value) => {
|
|
|
7153
7032
|
const offlineGeoImages = [];
|
|
7154
7033
|
const offlineIds = [];
|
|
7155
7034
|
const geoImagePayloads = [];
|
|
7156
|
-
const
|
|
7035
|
+
const filePayloads = {};
|
|
7157
7036
|
for (const payloadAndFile of payloads) {
|
|
7158
7037
|
const { file, ...payload } = payloadAndFile;
|
|
7159
|
-
const
|
|
7160
|
-
if (!(sha1 in
|
|
7161
|
-
|
|
7162
|
-
sha1,
|
|
7163
|
-
file_type: file.type,
|
|
7164
|
-
extension: file.name.split(".").pop(),
|
|
7165
|
-
size: file.size
|
|
7166
|
-
};
|
|
7167
|
-
await this.client.files.addCache(file, sha1);
|
|
7168
|
-
}
|
|
7038
|
+
const filePayload = await this.getFilePayload(file);
|
|
7039
|
+
if (!(filePayload.sha1 in filePayloads))
|
|
7040
|
+
filePayloads[filePayload.sha1] = filePayload;
|
|
7169
7041
|
const offlineMapImage = offline({
|
|
7170
7042
|
...payload,
|
|
7171
7043
|
file_name: file.name,
|
|
7172
|
-
file_sha1: sha1,
|
|
7044
|
+
file_sha1: filePayload.sha1,
|
|
7173
7045
|
file: URL.createObjectURL(file),
|
|
7174
7046
|
submitted_at: submittedAt,
|
|
7175
7047
|
created_by: createdBy,
|
|
@@ -7198,7 +7070,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7198
7070
|
submitted_at: submittedAt,
|
|
7199
7071
|
project: projectId,
|
|
7200
7072
|
geo_images: geoImagePayloads,
|
|
7201
|
-
files: Object.values(
|
|
7073
|
+
files: Object.values(filePayloads)
|
|
7202
7074
|
},
|
|
7203
7075
|
blocks: [projectId.toString()],
|
|
7204
7076
|
blockers: offlineIds
|
|
@@ -7235,20 +7107,20 @@ var __publicField = (obj, key, value) => {
|
|
|
7235
7107
|
});
|
|
7236
7108
|
return [updatedGeoImage, promise];
|
|
7237
7109
|
}
|
|
7238
|
-
async delete(
|
|
7110
|
+
async delete(id) {
|
|
7239
7111
|
const { store } = this.client;
|
|
7240
7112
|
const state = store.getState();
|
|
7241
|
-
const geoImageToDelete = selectGeoImageById(
|
|
7113
|
+
const geoImageToDelete = selectGeoImageById(id)(state);
|
|
7242
7114
|
if (!geoImageToDelete) {
|
|
7243
|
-
throw new Error(`Map image with offline_id ${
|
|
7115
|
+
throw new Error(`Map image with offline_id ${id} does not exist in the store`);
|
|
7244
7116
|
}
|
|
7245
|
-
this.dispatch(deleteGeoImage(
|
|
7117
|
+
this.dispatch(deleteGeoImage(id));
|
|
7246
7118
|
const promise = this.enqueueRequest({
|
|
7247
7119
|
description: "Delete geo image",
|
|
7248
7120
|
method: HttpMethod.DELETE,
|
|
7249
|
-
url: `/geo-images/${
|
|
7250
|
-
blocks: [
|
|
7251
|
-
blockers: [
|
|
7121
|
+
url: `/geo-images/${id}/`,
|
|
7122
|
+
blocks: [id],
|
|
7123
|
+
blockers: [id]
|
|
7252
7124
|
});
|
|
7253
7125
|
promise.catch(() => {
|
|
7254
7126
|
this.dispatch(setGeoImage(geoImageToDelete));
|
|
@@ -7266,7 +7138,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7266
7138
|
this.dispatch(initializeGeoImages(result));
|
|
7267
7139
|
}
|
|
7268
7140
|
}
|
|
7269
|
-
class IssueAssociationService extends
|
|
7141
|
+
class IssueAssociationService extends BaseApiService {
|
|
7270
7142
|
add(payload) {
|
|
7271
7143
|
var _a2;
|
|
7272
7144
|
const { store } = this.client;
|
|
@@ -7281,7 +7153,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7281
7153
|
const promise = this.enqueueRequest({
|
|
7282
7154
|
description: "Add issue association",
|
|
7283
7155
|
method: HttpMethod.POST,
|
|
7284
|
-
url: "/
|
|
7156
|
+
url: "/issue-associations/",
|
|
7285
7157
|
payload: {
|
|
7286
7158
|
offline_id: offlineIssueAssociation.offline_id,
|
|
7287
7159
|
submitted_at: submittedAt,
|
|
@@ -7311,7 +7183,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7311
7183
|
const promise = this.enqueueRequest({
|
|
7312
7184
|
description: "Delete issue association",
|
|
7313
7185
|
method: HttpMethod.DELETE,
|
|
7314
|
-
url: `/
|
|
7186
|
+
url: `/issue-associations/${id}/`,
|
|
7315
7187
|
blockers: [id],
|
|
7316
7188
|
blocks: []
|
|
7317
7189
|
});
|
|
@@ -7324,14 +7196,854 @@ var __publicField = (obj, key, value) => {
|
|
|
7324
7196
|
const issueAssociations = await this.enqueueRequest({
|
|
7325
7197
|
description: "Fetch issue associations",
|
|
7326
7198
|
method: HttpMethod.GET,
|
|
7327
|
-
url: "/
|
|
7328
|
-
queryParams: {
|
|
7199
|
+
url: "/issue-associations/",
|
|
7200
|
+
queryParams: { project: projectId.toString() },
|
|
7329
7201
|
blockers: [],
|
|
7330
7202
|
blocks: []
|
|
7331
7203
|
});
|
|
7332
7204
|
this.dispatch(initializeIssueAssociations(issueAssociations));
|
|
7333
7205
|
}
|
|
7334
7206
|
}
|
|
7207
|
+
class FormRevisionAttachmentService extends BaseUploadService {
|
|
7208
|
+
async bulkAdd(payloads) {
|
|
7209
|
+
var _a2;
|
|
7210
|
+
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7211
|
+
const createdBy = (_a2 = this.client.store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
7212
|
+
const filePayloads = {};
|
|
7213
|
+
const offlineFormRevisionAttachments = [];
|
|
7214
|
+
const attachmentPayloads = [];
|
|
7215
|
+
for (const payload of payloads) {
|
|
7216
|
+
const { revisionId, fieldIdentifier, file } = payload;
|
|
7217
|
+
const filePayload = await this.getFilePayload(file);
|
|
7218
|
+
if (!(filePayload.sha1 in filePayloads))
|
|
7219
|
+
filePayloads[filePayload.sha1] = filePayload;
|
|
7220
|
+
const offlineFormRevisionAttachment = offline({
|
|
7221
|
+
file: URL.createObjectURL(file),
|
|
7222
|
+
file_type: file.type,
|
|
7223
|
+
file_name: file.name,
|
|
7224
|
+
file_sha1: filePayload.sha1,
|
|
7225
|
+
created_by: createdBy,
|
|
7226
|
+
form_revision: revisionId,
|
|
7227
|
+
submitted_at: submittedAt,
|
|
7228
|
+
field_identifier: fieldIdentifier
|
|
7229
|
+
});
|
|
7230
|
+
offlineFormRevisionAttachments.push(offlineFormRevisionAttachment);
|
|
7231
|
+
const attachmentPayload = {
|
|
7232
|
+
offline_id: offlineFormRevisionAttachment.offline_id,
|
|
7233
|
+
file_name: file.name,
|
|
7234
|
+
field_identifier: fieldIdentifier,
|
|
7235
|
+
file_extension: filePayload.extension,
|
|
7236
|
+
file_sha1: filePayload.sha1,
|
|
7237
|
+
form_revision: revisionId
|
|
7238
|
+
};
|
|
7239
|
+
attachmentPayloads.push(attachmentPayload);
|
|
7240
|
+
}
|
|
7241
|
+
this.dispatch(addFormRevisionAttachments(offlineFormRevisionAttachments));
|
|
7242
|
+
const promise = this.enqueueRequest({
|
|
7243
|
+
description: "Attach files to form revision",
|
|
7244
|
+
method: HttpMethod.POST,
|
|
7245
|
+
url: "/form-revision-attachments/bulk/",
|
|
7246
|
+
payload: {
|
|
7247
|
+
submitted_at: submittedAt,
|
|
7248
|
+
attachments: attachmentPayloads,
|
|
7249
|
+
files: Object.values(filePayloads)
|
|
7250
|
+
},
|
|
7251
|
+
blockers: offlineFormRevisionAttachments.map((attachment) => attachment.form_revision),
|
|
7252
|
+
blocks: offlineFormRevisionAttachments.map((attachment) => attachment.offline_id)
|
|
7253
|
+
});
|
|
7254
|
+
promise.then((result) => {
|
|
7255
|
+
this.processPresignedUrls(result.presigned_urls);
|
|
7256
|
+
this.dispatch(updateFormRevisionAttachments(result.attachments));
|
|
7257
|
+
}).catch(() => {
|
|
7258
|
+
this.dispatch(
|
|
7259
|
+
deleteFormRevisionAttachments(
|
|
7260
|
+
offlineFormRevisionAttachments.map((attachment) => attachment.offline_id)
|
|
7261
|
+
)
|
|
7262
|
+
);
|
|
7263
|
+
});
|
|
7264
|
+
return [offlineFormRevisionAttachments, promise.then(({ attachments }) => attachments)];
|
|
7265
|
+
}
|
|
7266
|
+
async refreshStore(projectId, organizationId) {
|
|
7267
|
+
let attachments = [];
|
|
7268
|
+
const projectFormRevisions = await this.enqueueRequest({
|
|
7269
|
+
description: "Fetch project form revision attachments",
|
|
7270
|
+
method: HttpMethod.GET,
|
|
7271
|
+
url: "/form-revision-attachments/",
|
|
7272
|
+
queryParams: {
|
|
7273
|
+
project: projectId.toString()
|
|
7274
|
+
},
|
|
7275
|
+
blockers: [projectId.toString()],
|
|
7276
|
+
blocks: []
|
|
7277
|
+
});
|
|
7278
|
+
attachments = attachments.concat(projectFormRevisions);
|
|
7279
|
+
const organizationFormRevisions = await this.enqueueRequest({
|
|
7280
|
+
description: "Fetch organization form revision attachments",
|
|
7281
|
+
method: HttpMethod.GET,
|
|
7282
|
+
url: "/form-revision-attachments/",
|
|
7283
|
+
queryParams: {
|
|
7284
|
+
organization: organizationId.toString()
|
|
7285
|
+
},
|
|
7286
|
+
blockers: [organizationId.toString()],
|
|
7287
|
+
blocks: []
|
|
7288
|
+
});
|
|
7289
|
+
attachments = attachments.concat(organizationFormRevisions);
|
|
7290
|
+
this.dispatch(initializeFormRevisionAttachments(attachments));
|
|
7291
|
+
}
|
|
7292
|
+
}
|
|
7293
|
+
class FormSubmissionAttachmentService extends BaseUploadService {
|
|
7294
|
+
async bulkAdd(payloads) {
|
|
7295
|
+
var _a2;
|
|
7296
|
+
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7297
|
+
const createdBy = (_a2 = this.client.store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
7298
|
+
const filePayloads = {};
|
|
7299
|
+
const offlineFormSubmissionAttachments = [];
|
|
7300
|
+
const attachmentPayloads = [];
|
|
7301
|
+
for (const payload of payloads) {
|
|
7302
|
+
const { submissionId, fieldIdentifier, file } = payload;
|
|
7303
|
+
const filePayload = await this.getFilePayload(file);
|
|
7304
|
+
if (!(filePayload.sha1 in filePayloads))
|
|
7305
|
+
filePayloads[filePayload.sha1] = filePayload;
|
|
7306
|
+
const offlineFormSubmissionAttachment = offline({
|
|
7307
|
+
file: URL.createObjectURL(file),
|
|
7308
|
+
file_type: file.type,
|
|
7309
|
+
file_name: file.name,
|
|
7310
|
+
file_sha1: filePayload.sha1,
|
|
7311
|
+
created_by: createdBy,
|
|
7312
|
+
form_submission: submissionId,
|
|
7313
|
+
submitted_at: submittedAt,
|
|
7314
|
+
field_identifier: fieldIdentifier
|
|
7315
|
+
});
|
|
7316
|
+
offlineFormSubmissionAttachments.push(offlineFormSubmissionAttachment);
|
|
7317
|
+
const attachmentPayload = {
|
|
7318
|
+
offline_id: offlineFormSubmissionAttachment.offline_id,
|
|
7319
|
+
file_name: file.name,
|
|
7320
|
+
file_sha1: filePayload.sha1,
|
|
7321
|
+
file_extension: filePayload.extension,
|
|
7322
|
+
field_identifier: fieldIdentifier,
|
|
7323
|
+
form_submission: submissionId
|
|
7324
|
+
};
|
|
7325
|
+
attachmentPayloads.push(attachmentPayload);
|
|
7326
|
+
}
|
|
7327
|
+
this.dispatch(addFormSubmissionAttachments(offlineFormSubmissionAttachments));
|
|
7328
|
+
const promise = this.enqueueRequest({
|
|
7329
|
+
description: "Attach files to form submission",
|
|
7330
|
+
method: HttpMethod.POST,
|
|
7331
|
+
url: "/form-submission-attachments/bulk/",
|
|
7332
|
+
payload: {
|
|
7333
|
+
submitted_at: submittedAt,
|
|
7334
|
+
attachments: attachmentPayloads,
|
|
7335
|
+
files: Object.values(filePayloads)
|
|
7336
|
+
},
|
|
7337
|
+
blockers: offlineFormSubmissionAttachments.map((attachment) => attachment.form_submission),
|
|
7338
|
+
blocks: offlineFormSubmissionAttachments.map((attachment) => attachment.offline_id)
|
|
7339
|
+
});
|
|
7340
|
+
promise.then((result) => {
|
|
7341
|
+
this.processPresignedUrls(result.presigned_urls);
|
|
7342
|
+
this.dispatch(updateFormSubmissionAttachments(result.attachments));
|
|
7343
|
+
}).catch((error) => {
|
|
7344
|
+
this.dispatch(
|
|
7345
|
+
deleteFormSubmissionAttachments(
|
|
7346
|
+
offlineFormSubmissionAttachments.map((attachment) => attachment.offline_id)
|
|
7347
|
+
)
|
|
7348
|
+
);
|
|
7349
|
+
throw error;
|
|
7350
|
+
});
|
|
7351
|
+
return [offlineFormSubmissionAttachments, promise.then(({ attachments }) => attachments)];
|
|
7352
|
+
}
|
|
7353
|
+
async bulkDelete(attachmentsIds) {
|
|
7354
|
+
const { store } = this.client;
|
|
7355
|
+
const state = store.getState();
|
|
7356
|
+
const formSubmissionAttachments = selectFormSubmissionAttachemntsByIds(attachmentsIds)(state);
|
|
7357
|
+
this.dispatch(deleteFormSubmissionAttachments(attachmentsIds));
|
|
7358
|
+
try {
|
|
7359
|
+
await this.enqueueRequest({
|
|
7360
|
+
description: "Delete form submission attachments",
|
|
7361
|
+
method: HttpMethod.DELETE,
|
|
7362
|
+
url: "/form-submission-attachments/bulk/",
|
|
7363
|
+
payload: { attachment_ids: attachmentsIds },
|
|
7364
|
+
blockers: attachmentsIds,
|
|
7365
|
+
blocks: []
|
|
7366
|
+
});
|
|
7367
|
+
} catch (e) {
|
|
7368
|
+
this.dispatch(addFormSubmissionAttachments(formSubmissionAttachments));
|
|
7369
|
+
throw e;
|
|
7370
|
+
}
|
|
7371
|
+
}
|
|
7372
|
+
async refreshStore(projectId) {
|
|
7373
|
+
const result = await this.enqueueRequest({
|
|
7374
|
+
description: "Get form submission attachments",
|
|
7375
|
+
method: HttpMethod.GET,
|
|
7376
|
+
url: "/form-submission-attachments/",
|
|
7377
|
+
queryParams: {
|
|
7378
|
+
project: projectId.toString()
|
|
7379
|
+
},
|
|
7380
|
+
blockers: [],
|
|
7381
|
+
blocks: []
|
|
7382
|
+
});
|
|
7383
|
+
this.dispatch(initializeFormSubmissionAttachments(result));
|
|
7384
|
+
}
|
|
7385
|
+
}
|
|
7386
|
+
class AssetTypeFieldsAttachmentService extends BaseUploadService {
|
|
7387
|
+
async bulkAdd(payloads) {
|
|
7388
|
+
var _a2;
|
|
7389
|
+
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7390
|
+
const createdBy = (_a2 = this.client.store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
7391
|
+
const filePayloads = {};
|
|
7392
|
+
const offlineAssetTypeFieldsAttachments = [];
|
|
7393
|
+
const attachmentPayloads = [];
|
|
7394
|
+
for (const payload of payloads) {
|
|
7395
|
+
const { fieldsRevisionId, fieldIdentifier, file } = payload;
|
|
7396
|
+
const filePayload = await this.getFilePayload(file);
|
|
7397
|
+
if (!(filePayload.sha1 in filePayloads))
|
|
7398
|
+
filePayloads[filePayload.sha1] = filePayload;
|
|
7399
|
+
const offlineAssetTypeFieldsAttachment = offline({
|
|
7400
|
+
file: URL.createObjectURL(file),
|
|
7401
|
+
file_type: file.type,
|
|
7402
|
+
file_name: file.name,
|
|
7403
|
+
file_sha1: filePayload.sha1,
|
|
7404
|
+
created_by: createdBy,
|
|
7405
|
+
fields_revision: fieldsRevisionId,
|
|
7406
|
+
submitted_at: submittedAt,
|
|
7407
|
+
field_identifier: fieldIdentifier
|
|
7408
|
+
});
|
|
7409
|
+
offlineAssetTypeFieldsAttachments.push(offlineAssetTypeFieldsAttachment);
|
|
7410
|
+
const attachmentPayload = {
|
|
7411
|
+
offline_id: offlineAssetTypeFieldsAttachment.offline_id,
|
|
7412
|
+
file_name: file.name,
|
|
7413
|
+
field_identifier: fieldIdentifier,
|
|
7414
|
+
file_extension: filePayload.extension,
|
|
7415
|
+
file_sha1: filePayload.sha1,
|
|
7416
|
+
fields_revision: fieldsRevisionId
|
|
7417
|
+
};
|
|
7418
|
+
attachmentPayloads.push(attachmentPayload);
|
|
7419
|
+
}
|
|
7420
|
+
this.dispatch(addAssetTypeFieldsAttachments(offlineAssetTypeFieldsAttachments));
|
|
7421
|
+
const promise = this.enqueueRequest({
|
|
7422
|
+
description: "Add asset type fields attachments",
|
|
7423
|
+
method: HttpMethod.POST,
|
|
7424
|
+
url: "/asset-type-fields-attachments/bulk/",
|
|
7425
|
+
payload: {
|
|
7426
|
+
submitted_at: submittedAt,
|
|
7427
|
+
attachments: attachmentPayloads,
|
|
7428
|
+
files: Object.values(filePayloads)
|
|
7429
|
+
},
|
|
7430
|
+
blockers: offlineAssetTypeFieldsAttachments.map((attachment) => attachment.fields_revision),
|
|
7431
|
+
blocks: offlineAssetTypeFieldsAttachments.map((attachment) => attachment.offline_id)
|
|
7432
|
+
});
|
|
7433
|
+
promise.then((result) => {
|
|
7434
|
+
this.processPresignedUrls(result.presigned_urls);
|
|
7435
|
+
this.dispatch(updateAssetTypeFieldsAttachments(result.attachments));
|
|
7436
|
+
}).catch(() => {
|
|
7437
|
+
this.dispatch(
|
|
7438
|
+
deleteAssetTypeFieldsAttachments(
|
|
7439
|
+
offlineAssetTypeFieldsAttachments.map((attachment) => attachment.offline_id)
|
|
7440
|
+
)
|
|
7441
|
+
);
|
|
7442
|
+
});
|
|
7443
|
+
return [offlineAssetTypeFieldsAttachments, promise.then(({ attachments }) => attachments)];
|
|
7444
|
+
}
|
|
7445
|
+
async refreshStore(projectId) {
|
|
7446
|
+
const result = await this.enqueueRequest({
|
|
7447
|
+
description: "get asset type fields attachments",
|
|
7448
|
+
method: HttpMethod.GET,
|
|
7449
|
+
url: "/asset-type-fields-attachments/",
|
|
7450
|
+
queryParams: {
|
|
7451
|
+
project: projectId.toString()
|
|
7452
|
+
},
|
|
7453
|
+
blockers: [projectId.toString()],
|
|
7454
|
+
blocks: []
|
|
7455
|
+
});
|
|
7456
|
+
this.dispatch(initializeAssetTypeFieldsAttachments(result));
|
|
7457
|
+
}
|
|
7458
|
+
}
|
|
7459
|
+
class AssetTypeFieldsService extends BaseApiService {
|
|
7460
|
+
add(payload) {
|
|
7461
|
+
var _a2;
|
|
7462
|
+
const { store } = this.client;
|
|
7463
|
+
const createdBy = (_a2 = store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
7464
|
+
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7465
|
+
const offlineAssetTypeFields = offline({
|
|
7466
|
+
...payload,
|
|
7467
|
+
created_by: createdBy,
|
|
7468
|
+
submitted_at: submittedAt
|
|
7469
|
+
});
|
|
7470
|
+
this.dispatch(addAssetTypeFields(offlineAssetTypeFields));
|
|
7471
|
+
const promise = this.enqueueRequest({
|
|
7472
|
+
description: "Add Asset Type Fields",
|
|
7473
|
+
method: HttpMethod.POST,
|
|
7474
|
+
url: "/asset-type-fields/",
|
|
7475
|
+
payload: offlineAssetTypeFields,
|
|
7476
|
+
blockers: [offlineAssetTypeFields.asset_type],
|
|
7477
|
+
blocks: [offlineAssetTypeFields.offline_id]
|
|
7478
|
+
});
|
|
7479
|
+
promise.then((response) => {
|
|
7480
|
+
this.dispatch(updateAssetTypeFields(response));
|
|
7481
|
+
}).catch((error) => {
|
|
7482
|
+
this.dispatch(deleteAssetTypeFields(offlineAssetTypeFields.offline_id));
|
|
7483
|
+
throw error;
|
|
7484
|
+
});
|
|
7485
|
+
return [offlineAssetTypeFields, promise];
|
|
7486
|
+
}
|
|
7487
|
+
async refreshStore(projectId) {
|
|
7488
|
+
const result = await this.enqueueRequest({
|
|
7489
|
+
description: "Get Asset Type Fields",
|
|
7490
|
+
method: HttpMethod.GET,
|
|
7491
|
+
url: "/asset-type-fields/",
|
|
7492
|
+
queryParams: {
|
|
7493
|
+
project: projectId.toString()
|
|
7494
|
+
},
|
|
7495
|
+
blockers: [],
|
|
7496
|
+
blocks: []
|
|
7497
|
+
});
|
|
7498
|
+
this.dispatch(initializeAssetTypeFields(result));
|
|
7499
|
+
}
|
|
7500
|
+
}
|
|
7501
|
+
class AssetTypeFieldValuesService extends BaseApiService {
|
|
7502
|
+
add(payload) {
|
|
7503
|
+
var _a2;
|
|
7504
|
+
const { store } = this.client;
|
|
7505
|
+
const state = store.getState();
|
|
7506
|
+
const { values } = separateFilesFromValues(payload.values);
|
|
7507
|
+
const offlineAssetTypeFieldValues = offline({
|
|
7508
|
+
...payload,
|
|
7509
|
+
values,
|
|
7510
|
+
created_by: (_a2 = state.userReducer.currentUser) == null ? void 0 : _a2.id,
|
|
7511
|
+
submitted_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
7512
|
+
});
|
|
7513
|
+
const promise = this.enqueueRequest({
|
|
7514
|
+
description: "Add asset type field values",
|
|
7515
|
+
method: HttpMethod.POST,
|
|
7516
|
+
url: "/asset-type-field-values/",
|
|
7517
|
+
payload: offlineAssetTypeFieldValues,
|
|
7518
|
+
blockers: [payload.asset, payload.fields_revision],
|
|
7519
|
+
blocks: [offlineAssetTypeFieldValues.offline_id]
|
|
7520
|
+
});
|
|
7521
|
+
this.dispatch(addAssetTypeFieldValues(offlineAssetTypeFieldValues));
|
|
7522
|
+
promise.then((result) => {
|
|
7523
|
+
this.dispatch(updateAssetTypeFieldValues(result));
|
|
7524
|
+
return result;
|
|
7525
|
+
}).catch(() => {
|
|
7526
|
+
this.dispatch(deleteAssetTypeFieldValues(offlineAssetTypeFieldValues.offline_id));
|
|
7527
|
+
});
|
|
7528
|
+
return [offlineAssetTypeFieldValues, promise];
|
|
7529
|
+
}
|
|
7530
|
+
bulkAdd(payload, batchSize) {
|
|
7531
|
+
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7532
|
+
const { values } = separateFilesFromValues(payload.values);
|
|
7533
|
+
const payloadsBatches = chunkArray(payload.payloads, batchSize);
|
|
7534
|
+
const bulkAddPayloads = payloadsBatches.map((batch) => {
|
|
7535
|
+
return {
|
|
7536
|
+
submitted_at: submittedAt,
|
|
7537
|
+
values,
|
|
7538
|
+
field_values: batch.map((payload2) => {
|
|
7539
|
+
const { values: values2 } = separateFilesFromValues(payload2.values);
|
|
7540
|
+
return offline({
|
|
7541
|
+
...payload2,
|
|
7542
|
+
values: values2
|
|
7543
|
+
});
|
|
7544
|
+
})
|
|
7545
|
+
};
|
|
7546
|
+
});
|
|
7547
|
+
const promises = [];
|
|
7548
|
+
for (const payload2 of bulkAddPayloads) {
|
|
7549
|
+
const assetIds = payload2.field_values.map((x) => x.asset);
|
|
7550
|
+
const assetTypeFieldsIds = payload2.field_values.map((x) => x.fields_revision);
|
|
7551
|
+
const assetTypeFieldValuesIds = payload2.field_values.map((x) => x.offline_id);
|
|
7552
|
+
const promise = this.enqueueRequest({
|
|
7553
|
+
description: "Bulk add asset type field values",
|
|
7554
|
+
method: HttpMethod.POST,
|
|
7555
|
+
url: "/asset-type-field-values/bulk/",
|
|
7556
|
+
payload: payload2,
|
|
7557
|
+
blockers: [...assetIds, ...assetTypeFieldsIds],
|
|
7558
|
+
blocks: assetTypeFieldValuesIds
|
|
7559
|
+
});
|
|
7560
|
+
promises.push(promise);
|
|
7561
|
+
}
|
|
7562
|
+
void Promise.all(promises).then((results) => {
|
|
7563
|
+
this.dispatch(addAssetTypeFieldValuesMany(results.flat()));
|
|
7564
|
+
});
|
|
7565
|
+
return promises;
|
|
7566
|
+
}
|
|
7567
|
+
update(payload) {
|
|
7568
|
+
const { store } = this.client;
|
|
7569
|
+
const state = store.getState();
|
|
7570
|
+
const assetTypeFieldValues = selectAssetTypeFieldValuesById(payload.offline_id)(state);
|
|
7571
|
+
if (!assetTypeFieldValues) {
|
|
7572
|
+
throw new Error(`Expected AssetTypeFieldValues with offline_id ${payload.offline_id} to exist`);
|
|
7573
|
+
}
|
|
7574
|
+
const { values } = separateFilesFromValues(payload.values ?? {});
|
|
7575
|
+
const updatedAssetTypeFieldValues = {
|
|
7576
|
+
...assetTypeFieldValues,
|
|
7577
|
+
...payload,
|
|
7578
|
+
// values could also have a partial update
|
|
7579
|
+
values: {
|
|
7580
|
+
...assetTypeFieldValues.values,
|
|
7581
|
+
...values
|
|
7582
|
+
}
|
|
7583
|
+
};
|
|
7584
|
+
this.dispatch(updateAssetTypeFieldValues(updatedAssetTypeFieldValues));
|
|
7585
|
+
const promise = this.enqueueRequest({
|
|
7586
|
+
description: "Delete asset type field values",
|
|
7587
|
+
method: HttpMethod.PATCH,
|
|
7588
|
+
url: `/asset-type-field-values/${payload.offline_id}/`,
|
|
7589
|
+
payload,
|
|
7590
|
+
blockers: [
|
|
7591
|
+
updatedAssetTypeFieldValues.offline_id,
|
|
7592
|
+
updatedAssetTypeFieldValues.fields_revision,
|
|
7593
|
+
updatedAssetTypeFieldValues.asset
|
|
7594
|
+
],
|
|
7595
|
+
blocks: [updatedAssetTypeFieldValues.offline_id]
|
|
7596
|
+
});
|
|
7597
|
+
promise.then((result) => {
|
|
7598
|
+
this.dispatch(updateAssetTypeFieldValues(result));
|
|
7599
|
+
}).catch(() => {
|
|
7600
|
+
this.dispatch(updateAssetTypeFieldValues(assetTypeFieldValues));
|
|
7601
|
+
});
|
|
7602
|
+
return [updatedAssetTypeFieldValues, promise];
|
|
7603
|
+
}
|
|
7604
|
+
async delete(id) {
|
|
7605
|
+
const { store } = this.client;
|
|
7606
|
+
const state = store.getState();
|
|
7607
|
+
const assetTypeFieldValues = selectAssetTypeFieldValuesById(id)(state);
|
|
7608
|
+
if (!assetTypeFieldValues) {
|
|
7609
|
+
throw new Error(`Expected submission with offline_id ${id} to exist`);
|
|
7610
|
+
}
|
|
7611
|
+
const assetTypeFieldValuesAttachments = selectAttachmentsOfAssetTypeFieldValues(id)(state);
|
|
7612
|
+
this.dispatch(deleteAssetTypeFieldValues(id));
|
|
7613
|
+
this.dispatch(deleteAssetTypeFieldValuesAttachments(assetTypeFieldValuesAttachments.map((x) => x.offline_id)));
|
|
7614
|
+
try {
|
|
7615
|
+
await this.enqueueRequest({
|
|
7616
|
+
description: "Delete asset type field values",
|
|
7617
|
+
method: HttpMethod.DELETE,
|
|
7618
|
+
url: `/asset-type-field-values/${id}/`,
|
|
7619
|
+
blockers: [id],
|
|
7620
|
+
blocks: []
|
|
7621
|
+
});
|
|
7622
|
+
} catch (e) {
|
|
7623
|
+
this.dispatch(addAssetTypeFieldValues(assetTypeFieldValues));
|
|
7624
|
+
this.dispatch(addAssetTypeFieldValuesAttachments(assetTypeFieldValuesAttachments));
|
|
7625
|
+
throw e;
|
|
7626
|
+
}
|
|
7627
|
+
}
|
|
7628
|
+
async refreshStore(projectId) {
|
|
7629
|
+
const result = await this.enqueueRequest({
|
|
7630
|
+
description: "Get asset type field values",
|
|
7631
|
+
method: HttpMethod.GET,
|
|
7632
|
+
url: "/asset-type-field-values/",
|
|
7633
|
+
queryParams: {
|
|
7634
|
+
project: projectId.toString()
|
|
7635
|
+
},
|
|
7636
|
+
blockers: [],
|
|
7637
|
+
blocks: []
|
|
7638
|
+
});
|
|
7639
|
+
this.dispatch(initializeAssetTypeFieldValues(result));
|
|
7640
|
+
}
|
|
7641
|
+
}
|
|
7642
|
+
class AssetTypeFieldValuesAttachmentService extends BaseUploadService {
|
|
7643
|
+
async bulkAdd(payloads) {
|
|
7644
|
+
var _a2;
|
|
7645
|
+
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7646
|
+
const createdBy = (_a2 = this.client.store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
7647
|
+
const filePayloads = {};
|
|
7648
|
+
const offlineAssetTypeFieldValuesAttachments = [];
|
|
7649
|
+
const attachmentPayloads = [];
|
|
7650
|
+
for (const payload of payloads) {
|
|
7651
|
+
const { fieldValuesId, fieldIdentifier, file } = payload;
|
|
7652
|
+
const filePayload = await this.getFilePayload(file);
|
|
7653
|
+
if (!(filePayload.sha1 in filePayloads))
|
|
7654
|
+
filePayloads[filePayload.sha1] = filePayload;
|
|
7655
|
+
const offlineAssetTypeFieldValuesAttachment = offline({
|
|
7656
|
+
file: URL.createObjectURL(file),
|
|
7657
|
+
file_type: file.type,
|
|
7658
|
+
file_name: file.name,
|
|
7659
|
+
file_sha1: filePayload.sha1,
|
|
7660
|
+
created_by: createdBy,
|
|
7661
|
+
field_values: fieldValuesId,
|
|
7662
|
+
submitted_at: submittedAt,
|
|
7663
|
+
field_identifier: fieldIdentifier
|
|
7664
|
+
});
|
|
7665
|
+
offlineAssetTypeFieldValuesAttachments.push(offlineAssetTypeFieldValuesAttachment);
|
|
7666
|
+
const attachmentPayload = {
|
|
7667
|
+
offline_id: offlineAssetTypeFieldValuesAttachment.offline_id,
|
|
7668
|
+
file_name: file.name,
|
|
7669
|
+
file_sha1: filePayload.sha1,
|
|
7670
|
+
file_extension: filePayload.extension,
|
|
7671
|
+
field_identifier: fieldIdentifier,
|
|
7672
|
+
field_values: fieldValuesId
|
|
7673
|
+
};
|
|
7674
|
+
attachmentPayloads.push(attachmentPayload);
|
|
7675
|
+
}
|
|
7676
|
+
this.dispatch(addAssetTypeFieldValuesAttachments(offlineAssetTypeFieldValuesAttachments));
|
|
7677
|
+
const promise = this.enqueueRequest({
|
|
7678
|
+
description: "Add asset type field values attachments",
|
|
7679
|
+
method: HttpMethod.POST,
|
|
7680
|
+
url: "/asset-type-field-values-attachments/bulk/",
|
|
7681
|
+
payload: {
|
|
7682
|
+
submitted_at: submittedAt,
|
|
7683
|
+
attachments: attachmentPayloads,
|
|
7684
|
+
files: Object.values(filePayloads)
|
|
7685
|
+
},
|
|
7686
|
+
blockers: offlineAssetTypeFieldValuesAttachments.map((attachment) => attachment.field_values),
|
|
7687
|
+
blocks: offlineAssetTypeFieldValuesAttachments.map((attachment) => attachment.offline_id)
|
|
7688
|
+
});
|
|
7689
|
+
promise.then(({ presigned_urls, attachments }) => {
|
|
7690
|
+
this.processPresignedUrls(presigned_urls);
|
|
7691
|
+
this.dispatch(updateAssetTypeFieldValuesAttachments(attachments));
|
|
7692
|
+
}).catch((error) => {
|
|
7693
|
+
this.dispatch(
|
|
7694
|
+
deleteAssetTypeFieldValuesAttachments(
|
|
7695
|
+
offlineAssetTypeFieldValuesAttachments.map((attachment) => attachment.offline_id)
|
|
7696
|
+
)
|
|
7697
|
+
);
|
|
7698
|
+
throw error;
|
|
7699
|
+
});
|
|
7700
|
+
return [offlineAssetTypeFieldValuesAttachments, promise.then(({ attachments }) => attachments)];
|
|
7701
|
+
}
|
|
7702
|
+
async bulkDelete(ids) {
|
|
7703
|
+
const { store } = this.client;
|
|
7704
|
+
const state = store.getState();
|
|
7705
|
+
const formSubmissionAttachments = selectFormSubmissionAttachemntsByIds(ids)(state);
|
|
7706
|
+
this.dispatch(deleteFormSubmissionAttachments(ids));
|
|
7707
|
+
try {
|
|
7708
|
+
await this.enqueueRequest({
|
|
7709
|
+
description: "Delete asset type field values attachments",
|
|
7710
|
+
method: HttpMethod.DELETE,
|
|
7711
|
+
url: "/asset-type-field-values-attachments/bulk/",
|
|
7712
|
+
payload: { attachment_ids: ids },
|
|
7713
|
+
blockers: ids,
|
|
7714
|
+
blocks: []
|
|
7715
|
+
});
|
|
7716
|
+
} catch (e) {
|
|
7717
|
+
this.dispatch(addFormSubmissionAttachments(formSubmissionAttachments));
|
|
7718
|
+
throw e;
|
|
7719
|
+
}
|
|
7720
|
+
}
|
|
7721
|
+
async refreshStore(projectId) {
|
|
7722
|
+
const result = await this.enqueueRequest({
|
|
7723
|
+
description: "Gfet asset type field values attachments",
|
|
7724
|
+
method: HttpMethod.GET,
|
|
7725
|
+
url: "/asset-type-field-values-attachments/",
|
|
7726
|
+
queryParams: {
|
|
7727
|
+
project: projectId.toString()
|
|
7728
|
+
},
|
|
7729
|
+
blockers: [],
|
|
7730
|
+
blocks: []
|
|
7731
|
+
});
|
|
7732
|
+
this.dispatch(initializeAssetTypeFieldValuesAttachments(result));
|
|
7733
|
+
}
|
|
7734
|
+
}
|
|
7735
|
+
class IssueTypeFieldsAttachmentService extends BaseUploadService {
|
|
7736
|
+
async bulkAdd(payloads) {
|
|
7737
|
+
var _a2;
|
|
7738
|
+
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7739
|
+
const createdBy = (_a2 = this.client.store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
7740
|
+
const filePayloads = {};
|
|
7741
|
+
const offlineIssueTypeFieldsAttachments = [];
|
|
7742
|
+
const attachmentPayloads = [];
|
|
7743
|
+
for (const payload of payloads) {
|
|
7744
|
+
const { fieldsRevisionId, fieldIdentifier, file } = payload;
|
|
7745
|
+
const filePayload = await this.getFilePayload(file);
|
|
7746
|
+
if (!(filePayload.sha1 in filePayloads))
|
|
7747
|
+
filePayloads[filePayload.sha1] = filePayload;
|
|
7748
|
+
const offlineIssueTypeFieldsAttachment = offline({
|
|
7749
|
+
file: URL.createObjectURL(file),
|
|
7750
|
+
file_type: file.type,
|
|
7751
|
+
file_name: file.name,
|
|
7752
|
+
file_sha1: filePayload.sha1,
|
|
7753
|
+
created_by: createdBy,
|
|
7754
|
+
fields_revision: fieldsRevisionId,
|
|
7755
|
+
submitted_at: submittedAt,
|
|
7756
|
+
field_identifier: fieldIdentifier
|
|
7757
|
+
});
|
|
7758
|
+
offlineIssueTypeFieldsAttachments.push(offlineIssueTypeFieldsAttachment);
|
|
7759
|
+
const attachmentPayload = {
|
|
7760
|
+
offline_id: offlineIssueTypeFieldsAttachment.offline_id,
|
|
7761
|
+
file_name: file.name,
|
|
7762
|
+
file_extension: filePayload.extension,
|
|
7763
|
+
field_identifier: fieldIdentifier,
|
|
7764
|
+
file_sha1: filePayload.sha1,
|
|
7765
|
+
fields_revision: fieldsRevisionId
|
|
7766
|
+
};
|
|
7767
|
+
attachmentPayloads.push(attachmentPayload);
|
|
7768
|
+
}
|
|
7769
|
+
this.dispatch(addIssueTypeFieldsAttachments(offlineIssueTypeFieldsAttachments));
|
|
7770
|
+
const promise = this.enqueueRequest({
|
|
7771
|
+
description: "Add issue type fields attachments",
|
|
7772
|
+
method: HttpMethod.POST,
|
|
7773
|
+
url: "/issue-type-fields-attachments/bulk/",
|
|
7774
|
+
payload: {
|
|
7775
|
+
submitted_at: submittedAt,
|
|
7776
|
+
attachments: attachmentPayloads,
|
|
7777
|
+
files: Object.values(filePayloads)
|
|
7778
|
+
},
|
|
7779
|
+
blockers: offlineIssueTypeFieldsAttachments.map((attachment) => attachment.fields_revision),
|
|
7780
|
+
blocks: offlineIssueTypeFieldsAttachments.map((attachment) => attachment.offline_id)
|
|
7781
|
+
});
|
|
7782
|
+
promise.then((result) => {
|
|
7783
|
+
this.processPresignedUrls(result.presigned_urls);
|
|
7784
|
+
this.dispatch(updateIssueTypeFieldsAttachments(result.attachments));
|
|
7785
|
+
}).catch(() => {
|
|
7786
|
+
this.dispatch(
|
|
7787
|
+
deleteIssueTypeFieldsAttachments(
|
|
7788
|
+
offlineIssueTypeFieldsAttachments.map((attachment) => attachment.offline_id)
|
|
7789
|
+
)
|
|
7790
|
+
);
|
|
7791
|
+
});
|
|
7792
|
+
return [offlineIssueTypeFieldsAttachments, promise.then(({ attachments }) => attachments)];
|
|
7793
|
+
}
|
|
7794
|
+
async refreshStore(organizationId) {
|
|
7795
|
+
const result = await this.enqueueRequest({
|
|
7796
|
+
description: "get issue type fields attachments",
|
|
7797
|
+
method: HttpMethod.GET,
|
|
7798
|
+
url: "/issue-type-fields-attachments/",
|
|
7799
|
+
queryParams: {
|
|
7800
|
+
organization: organizationId.toString()
|
|
7801
|
+
},
|
|
7802
|
+
blockers: [organizationId.toString()],
|
|
7803
|
+
blocks: []
|
|
7804
|
+
});
|
|
7805
|
+
this.dispatch(initializeIssueTypeFieldsAttachments(result));
|
|
7806
|
+
}
|
|
7807
|
+
}
|
|
7808
|
+
class IssueTypeFieldsService extends BaseApiService {
|
|
7809
|
+
add(payload) {
|
|
7810
|
+
var _a2;
|
|
7811
|
+
const { store } = this.client;
|
|
7812
|
+
const createdBy = (_a2 = store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
7813
|
+
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7814
|
+
const offlineIssueTypeFields = offline({
|
|
7815
|
+
...payload,
|
|
7816
|
+
created_by: createdBy,
|
|
7817
|
+
submitted_at: submittedAt
|
|
7818
|
+
});
|
|
7819
|
+
this.dispatch(addIssueTypeFields(offlineIssueTypeFields));
|
|
7820
|
+
const promise = this.enqueueRequest({
|
|
7821
|
+
description: "Add Issue Type Fields",
|
|
7822
|
+
method: HttpMethod.POST,
|
|
7823
|
+
url: "/issue-type-fields/",
|
|
7824
|
+
payload: offlineIssueTypeFields,
|
|
7825
|
+
blockers: [offlineIssueTypeFields.issue_type],
|
|
7826
|
+
blocks: [offlineIssueTypeFields.offline_id]
|
|
7827
|
+
});
|
|
7828
|
+
promise.then((response) => {
|
|
7829
|
+
this.dispatch(updateIssueTypeFields(response));
|
|
7830
|
+
}).catch((error) => {
|
|
7831
|
+
this.dispatch(deleteIssueTypeFields(offlineIssueTypeFields.offline_id));
|
|
7832
|
+
throw error;
|
|
7833
|
+
});
|
|
7834
|
+
return [offlineIssueTypeFields, promise];
|
|
7835
|
+
}
|
|
7836
|
+
async refreshStore(organizationId) {
|
|
7837
|
+
const result = await this.enqueueRequest({
|
|
7838
|
+
description: "Get Issue Type Fields",
|
|
7839
|
+
method: HttpMethod.GET,
|
|
7840
|
+
url: "/issue-type-fields/",
|
|
7841
|
+
queryParams: {
|
|
7842
|
+
organization: organizationId.toString()
|
|
7843
|
+
},
|
|
7844
|
+
blockers: [],
|
|
7845
|
+
blocks: []
|
|
7846
|
+
});
|
|
7847
|
+
this.dispatch(initializeIssueTypeFields(result));
|
|
7848
|
+
}
|
|
7849
|
+
}
|
|
7850
|
+
class IssueTypeFieldValuesAttachmentService extends BaseUploadService {
|
|
7851
|
+
async bulkAdd(payloads) {
|
|
7852
|
+
var _a2;
|
|
7853
|
+
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7854
|
+
const createdBy = (_a2 = this.client.store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
7855
|
+
const filePayloads = {};
|
|
7856
|
+
const offlineIssueTypeFieldValuesAttachments = [];
|
|
7857
|
+
const attachmentPayloads = [];
|
|
7858
|
+
for (const payload of payloads) {
|
|
7859
|
+
const { fieldValuesId, fieldIdentifier, file } = payload;
|
|
7860
|
+
const filePayload = await this.getFilePayload(file);
|
|
7861
|
+
if (!(filePayload.sha1 in filePayloads))
|
|
7862
|
+
filePayloads[filePayload.sha1] = filePayload;
|
|
7863
|
+
const offlineIssueTypeFieldValuesAttachment = offline({
|
|
7864
|
+
file: URL.createObjectURL(file),
|
|
7865
|
+
file_type: file.type,
|
|
7866
|
+
file_name: file.name,
|
|
7867
|
+
file_sha1: filePayload.sha1,
|
|
7868
|
+
created_by: createdBy,
|
|
7869
|
+
field_values: fieldValuesId,
|
|
7870
|
+
submitted_at: submittedAt,
|
|
7871
|
+
field_identifier: fieldIdentifier
|
|
7872
|
+
});
|
|
7873
|
+
offlineIssueTypeFieldValuesAttachments.push(offlineIssueTypeFieldValuesAttachment);
|
|
7874
|
+
const attachmentPayload = {
|
|
7875
|
+
offline_id: offlineIssueTypeFieldValuesAttachment.offline_id,
|
|
7876
|
+
file_name: file.name,
|
|
7877
|
+
file_sha1: filePayload.sha1,
|
|
7878
|
+
file_extension: filePayload.extension,
|
|
7879
|
+
field_identifier: fieldIdentifier,
|
|
7880
|
+
field_values: fieldValuesId
|
|
7881
|
+
};
|
|
7882
|
+
attachmentPayloads.push(attachmentPayload);
|
|
7883
|
+
}
|
|
7884
|
+
this.dispatch(addIssueTypeFieldValuesAttachments(offlineIssueTypeFieldValuesAttachments));
|
|
7885
|
+
const promise = this.enqueueRequest({
|
|
7886
|
+
description: "Add issue type field values attachments",
|
|
7887
|
+
method: HttpMethod.POST,
|
|
7888
|
+
url: "/issue-type-field-values-attachments/bulk/",
|
|
7889
|
+
payload: {
|
|
7890
|
+
submitted_at: submittedAt,
|
|
7891
|
+
attachments: attachmentPayloads,
|
|
7892
|
+
files: Object.values(filePayloads)
|
|
7893
|
+
},
|
|
7894
|
+
blockers: offlineIssueTypeFieldValuesAttachments.map((attachment) => attachment.field_values),
|
|
7895
|
+
blocks: offlineIssueTypeFieldValuesAttachments.map((attachment) => attachment.offline_id)
|
|
7896
|
+
});
|
|
7897
|
+
promise.then(({ presigned_urls, attachments }) => {
|
|
7898
|
+
this.processPresignedUrls(presigned_urls);
|
|
7899
|
+
this.dispatch(updateIssueTypeFieldValuesAttachments(attachments));
|
|
7900
|
+
}).catch((error) => {
|
|
7901
|
+
this.dispatch(
|
|
7902
|
+
deleteIssueTypeFieldValuesAttachments(
|
|
7903
|
+
offlineIssueTypeFieldValuesAttachments.map((attachment) => attachment.offline_id)
|
|
7904
|
+
)
|
|
7905
|
+
);
|
|
7906
|
+
throw error;
|
|
7907
|
+
});
|
|
7908
|
+
return [offlineIssueTypeFieldValuesAttachments, promise.then(({ attachments }) => attachments)];
|
|
7909
|
+
}
|
|
7910
|
+
async bulkDelete(attachmentsIds) {
|
|
7911
|
+
const { store } = this.client;
|
|
7912
|
+
const state = store.getState();
|
|
7913
|
+
const formSubmissionAttachments = selectFormSubmissionAttachemntsByIds(attachmentsIds)(state);
|
|
7914
|
+
this.dispatch(deleteFormSubmissionAttachments(attachmentsIds));
|
|
7915
|
+
try {
|
|
7916
|
+
await this.enqueueRequest({
|
|
7917
|
+
description: "Delete issue type field values attachments",
|
|
7918
|
+
method: HttpMethod.DELETE,
|
|
7919
|
+
url: "/issue-type-field-values-attachments/bulk/",
|
|
7920
|
+
payload: { attachment_ids: attachmentsIds },
|
|
7921
|
+
blockers: attachmentsIds,
|
|
7922
|
+
blocks: []
|
|
7923
|
+
});
|
|
7924
|
+
} catch (e) {
|
|
7925
|
+
this.dispatch(addFormSubmissionAttachments(formSubmissionAttachments));
|
|
7926
|
+
throw e;
|
|
7927
|
+
}
|
|
7928
|
+
}
|
|
7929
|
+
async refreshStore(projectId) {
|
|
7930
|
+
const result = await this.enqueueRequest({
|
|
7931
|
+
description: "Get issue type field values attachments",
|
|
7932
|
+
method: HttpMethod.GET,
|
|
7933
|
+
url: "/issue-type-field-values-attachments/",
|
|
7934
|
+
queryParams: {
|
|
7935
|
+
project: projectId.toString()
|
|
7936
|
+
},
|
|
7937
|
+
blockers: [],
|
|
7938
|
+
blocks: []
|
|
7939
|
+
});
|
|
7940
|
+
this.dispatch(initializeIssueTypeFieldValuesAttachments(result));
|
|
7941
|
+
}
|
|
7942
|
+
}
|
|
7943
|
+
class IssueTypeFieldValuesService extends BaseApiService {
|
|
7944
|
+
add(payload) {
|
|
7945
|
+
var _a2;
|
|
7946
|
+
const { store } = this.client;
|
|
7947
|
+
const state = store.getState();
|
|
7948
|
+
const { values } = separateFilesFromValues(payload.values);
|
|
7949
|
+
const offlineIssueTypeFieldValues = offline({
|
|
7950
|
+
...payload,
|
|
7951
|
+
values,
|
|
7952
|
+
created_by: (_a2 = state.userReducer.currentUser) == null ? void 0 : _a2.id,
|
|
7953
|
+
submitted_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
7954
|
+
});
|
|
7955
|
+
const promise = this.enqueueRequest({
|
|
7956
|
+
description: "Add issue type field values",
|
|
7957
|
+
method: HttpMethod.POST,
|
|
7958
|
+
url: "/issue-type-field-values/",
|
|
7959
|
+
payload: offlineIssueTypeFieldValues,
|
|
7960
|
+
blockers: [payload.issue, payload.fields_revision],
|
|
7961
|
+
blocks: [offlineIssueTypeFieldValues.offline_id]
|
|
7962
|
+
});
|
|
7963
|
+
this.dispatch(addIssueTypeFieldValues(offlineIssueTypeFieldValues));
|
|
7964
|
+
promise.then((result) => {
|
|
7965
|
+
this.dispatch(updateIssueTypeFieldValues(result));
|
|
7966
|
+
return result;
|
|
7967
|
+
}).catch(() => {
|
|
7968
|
+
this.dispatch(deleteIssueTypeFieldValues(offlineIssueTypeFieldValues.offline_id));
|
|
7969
|
+
});
|
|
7970
|
+
return [offlineIssueTypeFieldValues, promise];
|
|
7971
|
+
}
|
|
7972
|
+
update(payload) {
|
|
7973
|
+
const { store } = this.client;
|
|
7974
|
+
const state = store.getState();
|
|
7975
|
+
const issueTypeFieldValues = selectIssueTypeFieldValuesById(payload.offline_id)(state);
|
|
7976
|
+
if (!issueTypeFieldValues) {
|
|
7977
|
+
throw new Error(`Expected IssueTypeFieldValues with offline_id ${payload.offline_id} to exist`);
|
|
7978
|
+
}
|
|
7979
|
+
const { values } = separateFilesFromValues(payload.values ?? {});
|
|
7980
|
+
const updatedIssueTypeFieldValues = {
|
|
7981
|
+
...issueTypeFieldValues,
|
|
7982
|
+
...payload,
|
|
7983
|
+
// values could also have a partial update
|
|
7984
|
+
values: {
|
|
7985
|
+
...issueTypeFieldValues.values,
|
|
7986
|
+
...values
|
|
7987
|
+
}
|
|
7988
|
+
};
|
|
7989
|
+
this.dispatch(updateIssueTypeFieldValues(updatedIssueTypeFieldValues));
|
|
7990
|
+
const promise = this.enqueueRequest({
|
|
7991
|
+
description: "Update issue type field values",
|
|
7992
|
+
method: HttpMethod.PATCH,
|
|
7993
|
+
url: `/issue-type-field-values/${payload.offline_id}/`,
|
|
7994
|
+
payload,
|
|
7995
|
+
blockers: [
|
|
7996
|
+
updatedIssueTypeFieldValues.offline_id,
|
|
7997
|
+
updatedIssueTypeFieldValues.fields_revision,
|
|
7998
|
+
updatedIssueTypeFieldValues.issue
|
|
7999
|
+
],
|
|
8000
|
+
blocks: [updatedIssueTypeFieldValues.offline_id]
|
|
8001
|
+
});
|
|
8002
|
+
promise.then((result) => {
|
|
8003
|
+
this.dispatch(updateIssueTypeFieldValues(result));
|
|
8004
|
+
}).catch(() => {
|
|
8005
|
+
this.dispatch(updateIssueTypeFieldValues(issueTypeFieldValues));
|
|
8006
|
+
});
|
|
8007
|
+
return [updatedIssueTypeFieldValues, promise];
|
|
8008
|
+
}
|
|
8009
|
+
async delete(id) {
|
|
8010
|
+
const { store } = this.client;
|
|
8011
|
+
const state = store.getState();
|
|
8012
|
+
const issueTypeFieldValues = selectIssueTypeFieldValuesById(id)(state);
|
|
8013
|
+
if (!issueTypeFieldValues) {
|
|
8014
|
+
throw new Error(`Expected submission with offline_id ${id} to exist`);
|
|
8015
|
+
}
|
|
8016
|
+
const issueTypeFieldValuesAttachments = selectAttachmentsOfIssueTypeFieldValues(id)(state);
|
|
8017
|
+
this.dispatch(deleteIssueTypeFieldValues(id));
|
|
8018
|
+
this.dispatch(deleteIssueTypeFieldValuesAttachments(issueTypeFieldValuesAttachments.map((x) => x.offline_id)));
|
|
8019
|
+
try {
|
|
8020
|
+
await this.enqueueRequest({
|
|
8021
|
+
description: "Delete issue type field values",
|
|
8022
|
+
method: HttpMethod.DELETE,
|
|
8023
|
+
url: `/issue-type-field-values/${id}/`,
|
|
8024
|
+
blockers: [id],
|
|
8025
|
+
blocks: []
|
|
8026
|
+
});
|
|
8027
|
+
} catch (e) {
|
|
8028
|
+
this.dispatch(addIssueTypeFieldValues(issueTypeFieldValues));
|
|
8029
|
+
this.dispatch(addIssueTypeFieldValuesAttachments(issueTypeFieldValuesAttachments));
|
|
8030
|
+
throw e;
|
|
8031
|
+
}
|
|
8032
|
+
}
|
|
8033
|
+
async refreshStore(projectId) {
|
|
8034
|
+
const result = await this.enqueueRequest({
|
|
8035
|
+
description: "Get issue type field values",
|
|
8036
|
+
method: HttpMethod.GET,
|
|
8037
|
+
url: "/issue-type-field-values/",
|
|
8038
|
+
queryParams: {
|
|
8039
|
+
project: projectId.toString()
|
|
8040
|
+
},
|
|
8041
|
+
blockers: [],
|
|
8042
|
+
blocks: []
|
|
8043
|
+
});
|
|
8044
|
+
this.dispatch(initializeIssueTypeFieldValues(result));
|
|
8045
|
+
}
|
|
8046
|
+
}
|
|
7335
8047
|
var VerificationCodeType = /* @__PURE__ */ ((VerificationCodeType2) => {
|
|
7336
8048
|
VerificationCodeType2[VerificationCodeType2["USER_REGISTRATION"] = 0] = "USER_REGISTRATION";
|
|
7337
8049
|
VerificationCodeType2[VerificationCodeType2["APPLICATION_INVITE"] = 2] = "APPLICATION_INVITE";
|
|
@@ -7348,6 +8060,10 @@ var __publicField = (obj, key, value) => {
|
|
|
7348
8060
|
exports2.AssetStageCompletionService = AssetStageCompletionService;
|
|
7349
8061
|
exports2.AssetStageService = AssetStageService;
|
|
7350
8062
|
exports2.AssetTypeAttachmentService = AssetTypeAttachmentService;
|
|
8063
|
+
exports2.AssetTypeFieldValuesAttachmentService = AssetTypeFieldValuesAttachmentService;
|
|
8064
|
+
exports2.AssetTypeFieldValuesService = AssetTypeFieldValuesService;
|
|
8065
|
+
exports2.AssetTypeFieldsAttachmentService = AssetTypeFieldsAttachmentService;
|
|
8066
|
+
exports2.AssetTypeFieldsService = AssetTypeFieldsService;
|
|
7351
8067
|
exports2.AssetTypeService = AssetTypeService;
|
|
7352
8068
|
exports2.AttachmentModel = AttachmentModel;
|
|
7353
8069
|
exports2.BaseApiService = BaseApiService;
|
|
@@ -7363,7 +8079,9 @@ var __publicField = (obj, key, value) => {
|
|
|
7363
8079
|
exports2.EmailDomainsService = EmailDomainsService;
|
|
7364
8080
|
exports2.EmailVerificationService = EmailVerificationService;
|
|
7365
8081
|
exports2.FileService = FileService;
|
|
8082
|
+
exports2.FormRevisionAttachmentService = FormRevisionAttachmentService;
|
|
7366
8083
|
exports2.FormService = FormService;
|
|
8084
|
+
exports2.FormSubmissionAttachmentService = FormSubmissionAttachmentService;
|
|
7367
8085
|
exports2.FormSubmissionService = FormSubmissionService;
|
|
7368
8086
|
exports2.GREEN = GREEN;
|
|
7369
8087
|
exports2.GeoImageService = GeoImageService;
|
|
@@ -7374,6 +8092,10 @@ var __publicField = (obj, key, value) => {
|
|
|
7374
8092
|
exports2.IssuePriority = IssuePriority;
|
|
7375
8093
|
exports2.IssueService = IssueService;
|
|
7376
8094
|
exports2.IssueStatus = IssueStatus;
|
|
8095
|
+
exports2.IssueTypeFieldValuesAttachmentService = IssueTypeFieldValuesAttachmentService;
|
|
8096
|
+
exports2.IssueTypeFieldValuesService = IssueTypeFieldValuesService;
|
|
8097
|
+
exports2.IssueTypeFieldsAttachmentService = IssueTypeFieldsAttachmentService;
|
|
8098
|
+
exports2.IssueTypeFieldsService = IssueTypeFieldsService;
|
|
7377
8099
|
exports2.IssueTypeService = IssueTypeService;
|
|
7378
8100
|
exports2.IssueUpdateChange = IssueUpdateChange;
|
|
7379
8101
|
exports2.IssueUpdateService = IssueUpdateService;
|
|
@@ -7413,6 +8135,14 @@ var __publicField = (obj, key, value) => {
|
|
|
7413
8135
|
exports2.addAssetType = addAssetType;
|
|
7414
8136
|
exports2.addAssetTypeAttachment = addAssetTypeAttachment;
|
|
7415
8137
|
exports2.addAssetTypeAttachments = addAssetTypeAttachments;
|
|
8138
|
+
exports2.addAssetTypeFieldValues = addAssetTypeFieldValues;
|
|
8139
|
+
exports2.addAssetTypeFieldValuesAttachment = addAssetTypeFieldValuesAttachment;
|
|
8140
|
+
exports2.addAssetTypeFieldValuesAttachments = addAssetTypeFieldValuesAttachments;
|
|
8141
|
+
exports2.addAssetTypeFieldValuesMany = addAssetTypeFieldValuesMany;
|
|
8142
|
+
exports2.addAssetTypeFields = addAssetTypeFields;
|
|
8143
|
+
exports2.addAssetTypeFieldsAttachment = addAssetTypeFieldsAttachment;
|
|
8144
|
+
exports2.addAssetTypeFieldsAttachments = addAssetTypeFieldsAttachments;
|
|
8145
|
+
exports2.addAssetTypeFieldsMany = addAssetTypeFieldsMany;
|
|
7416
8146
|
exports2.addAssetTypes = addAssetTypes;
|
|
7417
8147
|
exports2.addAssets = addAssets;
|
|
7418
8148
|
exports2.addCategory = addCategory;
|
|
@@ -7441,6 +8171,14 @@ var __publicField = (obj, key, value) => {
|
|
|
7441
8171
|
exports2.addIssueComment = addIssueComment;
|
|
7442
8172
|
exports2.addIssueComments = addIssueComments;
|
|
7443
8173
|
exports2.addIssueType = addIssueType;
|
|
8174
|
+
exports2.addIssueTypeFieldValues = addIssueTypeFieldValues;
|
|
8175
|
+
exports2.addIssueTypeFieldValuesAttachment = addIssueTypeFieldValuesAttachment;
|
|
8176
|
+
exports2.addIssueTypeFieldValuesAttachments = addIssueTypeFieldValuesAttachments;
|
|
8177
|
+
exports2.addIssueTypeFieldValuesMany = addIssueTypeFieldValuesMany;
|
|
8178
|
+
exports2.addIssueTypeFields = addIssueTypeFields;
|
|
8179
|
+
exports2.addIssueTypeFieldsAttachment = addIssueTypeFieldsAttachment;
|
|
8180
|
+
exports2.addIssueTypeFieldsAttachments = addIssueTypeFieldsAttachments;
|
|
8181
|
+
exports2.addIssueTypeFieldsMany = addIssueTypeFieldsMany;
|
|
7444
8182
|
exports2.addIssueUpdate = addIssueUpdate;
|
|
7445
8183
|
exports2.addIssueUpdates = addIssueUpdates;
|
|
7446
8184
|
exports2.addIssues = addIssues;
|
|
@@ -7466,6 +8204,14 @@ var __publicField = (obj, key, value) => {
|
|
|
7466
8204
|
exports2.assetStageSlice = assetStageSlice;
|
|
7467
8205
|
exports2.assetTypeAttachmentReducer = assetTypeAttachmentReducer;
|
|
7468
8206
|
exports2.assetTypeAttachmentSlice = assetTypeAttachmentSlice;
|
|
8207
|
+
exports2.assetTypeFieldValuesAttachmentReducer = assetTypeFieldValuesAttachmentReducer;
|
|
8208
|
+
exports2.assetTypeFieldValuesAttachmentSlice = assetTypeFieldValuesAttachmentSlice;
|
|
8209
|
+
exports2.assetTypeFieldValuesReducer = assetTypeFieldValuesReducer;
|
|
8210
|
+
exports2.assetTypeFieldValuesSlice = assetTypeFieldValuesSlice;
|
|
8211
|
+
exports2.assetTypeFieldsAttachmentReducer = assetTypeFieldsAttachmentReducer;
|
|
8212
|
+
exports2.assetTypeFieldsAttachmentSlice = assetTypeFieldsAttachmentSlice;
|
|
8213
|
+
exports2.assetTypeFieldsReducer = assetTypeFieldsReducer;
|
|
8214
|
+
exports2.assetTypeFieldsSlice = assetTypeFieldsSlice;
|
|
7469
8215
|
exports2.assetTypeReducer = assetTypeReducer;
|
|
7470
8216
|
exports2.assetTypeSlice = assetTypeSlice;
|
|
7471
8217
|
exports2.authReducer = authReducer;
|
|
@@ -7494,6 +8240,14 @@ var __publicField = (obj, key, value) => {
|
|
|
7494
8240
|
exports2.deleteAssetType = deleteAssetType;
|
|
7495
8241
|
exports2.deleteAssetTypeAttachment = deleteAssetTypeAttachment;
|
|
7496
8242
|
exports2.deleteAssetTypeAttachments = deleteAssetTypeAttachments;
|
|
8243
|
+
exports2.deleteAssetTypeFieldValues = deleteAssetTypeFieldValues;
|
|
8244
|
+
exports2.deleteAssetTypeFieldValuesAttachment = deleteAssetTypeFieldValuesAttachment;
|
|
8245
|
+
exports2.deleteAssetTypeFieldValuesAttachments = deleteAssetTypeFieldValuesAttachments;
|
|
8246
|
+
exports2.deleteAssetTypeFieldValuesMany = deleteAssetTypeFieldValuesMany;
|
|
8247
|
+
exports2.deleteAssetTypeFields = deleteAssetTypeFields;
|
|
8248
|
+
exports2.deleteAssetTypeFieldsAttachment = deleteAssetTypeFieldsAttachment;
|
|
8249
|
+
exports2.deleteAssetTypeFieldsAttachments = deleteAssetTypeFieldsAttachments;
|
|
8250
|
+
exports2.deleteAssetTypeFieldsMany = deleteAssetTypeFieldsMany;
|
|
7497
8251
|
exports2.deleteAssetTypes = deleteAssetTypes;
|
|
7498
8252
|
exports2.deleteAssets = deleteAssets;
|
|
7499
8253
|
exports2.deleteCategory = deleteCategory;
|
|
@@ -7518,6 +8272,14 @@ var __publicField = (obj, key, value) => {
|
|
|
7518
8272
|
exports2.deleteIssueAttachments = deleteIssueAttachments;
|
|
7519
8273
|
exports2.deleteIssueComment = deleteIssueComment;
|
|
7520
8274
|
exports2.deleteIssueComments = deleteIssueComments;
|
|
8275
|
+
exports2.deleteIssueTypeFieldValues = deleteIssueTypeFieldValues;
|
|
8276
|
+
exports2.deleteIssueTypeFieldValuesAttachment = deleteIssueTypeFieldValuesAttachment;
|
|
8277
|
+
exports2.deleteIssueTypeFieldValuesAttachments = deleteIssueTypeFieldValuesAttachments;
|
|
8278
|
+
exports2.deleteIssueTypeFieldValuesMany = deleteIssueTypeFieldValuesMany;
|
|
8279
|
+
exports2.deleteIssueTypeFields = deleteIssueTypeFields;
|
|
8280
|
+
exports2.deleteIssueTypeFieldsAttachment = deleteIssueTypeFieldsAttachment;
|
|
8281
|
+
exports2.deleteIssueTypeFieldsAttachments = deleteIssueTypeFieldsAttachments;
|
|
8282
|
+
exports2.deleteIssueTypeFieldsMany = deleteIssueTypeFieldsMany;
|
|
7521
8283
|
exports2.deleteIssueUpdate = deleteIssueUpdate;
|
|
7522
8284
|
exports2.deleteIssueUpdates = deleteIssueUpdates;
|
|
7523
8285
|
exports2.deleteIssues = deleteIssues;
|
|
@@ -7574,6 +8336,10 @@ var __publicField = (obj, key, value) => {
|
|
|
7574
8336
|
exports2.initializeAssetStageCompletions = initializeAssetStageCompletions;
|
|
7575
8337
|
exports2.initializeAssetStages = initializeAssetStages;
|
|
7576
8338
|
exports2.initializeAssetTypeAttachments = initializeAssetTypeAttachments;
|
|
8339
|
+
exports2.initializeAssetTypeFieldValues = initializeAssetTypeFieldValues;
|
|
8340
|
+
exports2.initializeAssetTypeFieldValuesAttachments = initializeAssetTypeFieldValuesAttachments;
|
|
8341
|
+
exports2.initializeAssetTypeFields = initializeAssetTypeFields;
|
|
8342
|
+
exports2.initializeAssetTypeFieldsAttachments = initializeAssetTypeFieldsAttachments;
|
|
7577
8343
|
exports2.initializeAssetTypes = initializeAssetTypes;
|
|
7578
8344
|
exports2.initializeAssets = initializeAssets;
|
|
7579
8345
|
exports2.initializeCategories = initializeCategories;
|
|
@@ -7588,6 +8354,10 @@ var __publicField = (obj, key, value) => {
|
|
|
7588
8354
|
exports2.initializeGeoImages = initializeGeoImages;
|
|
7589
8355
|
exports2.initializeIssueAssociations = initializeIssueAssociations;
|
|
7590
8356
|
exports2.initializeIssueAttachments = initializeIssueAttachments;
|
|
8357
|
+
exports2.initializeIssueTypeFieldValues = initializeIssueTypeFieldValues;
|
|
8358
|
+
exports2.initializeIssueTypeFieldValuesAttachments = initializeIssueTypeFieldValuesAttachments;
|
|
8359
|
+
exports2.initializeIssueTypeFields = initializeIssueTypeFields;
|
|
8360
|
+
exports2.initializeIssueTypeFieldsAttachments = initializeIssueTypeFieldsAttachments;
|
|
7591
8361
|
exports2.initializeIssueTypes = initializeIssueTypes;
|
|
7592
8362
|
exports2.initializeIssueUpdates = initializeIssueUpdates;
|
|
7593
8363
|
exports2.initializeIssues = initializeIssues;
|
|
@@ -7606,6 +8376,14 @@ var __publicField = (obj, key, value) => {
|
|
|
7606
8376
|
exports2.issueCommentSlice = issueCommentSlice;
|
|
7607
8377
|
exports2.issueReducer = issueReducer;
|
|
7608
8378
|
exports2.issueSlice = issueSlice;
|
|
8379
|
+
exports2.issueTypeFieldValuesAttachmentReducer = issueTypeFieldValuesAttachmentReducer;
|
|
8380
|
+
exports2.issueTypeFieldValuesAttachmentSlice = issueTypeFieldValuesAttachmentSlice;
|
|
8381
|
+
exports2.issueTypeFieldValuesReducer = issueTypeFieldValuesReducer;
|
|
8382
|
+
exports2.issueTypeFieldValuesSlice = issueTypeFieldValuesSlice;
|
|
8383
|
+
exports2.issueTypeFieldsAttachmentReducer = issueTypeFieldsAttachmentReducer;
|
|
8384
|
+
exports2.issueTypeFieldsAttachmentSlice = issueTypeFieldsAttachmentSlice;
|
|
8385
|
+
exports2.issueTypeFieldsReducer = issueTypeFieldsReducer;
|
|
8386
|
+
exports2.issueTypeFieldsSlice = issueTypeFieldsSlice;
|
|
7609
8387
|
exports2.issueTypeReducer = issueTypeReducer;
|
|
7610
8388
|
exports2.issueTypeSlice = issueTypeSlice;
|
|
7611
8389
|
exports2.issueUpdateReducer = issueUpdateReducer;
|
|
@@ -7678,6 +8456,20 @@ var __publicField = (obj, key, value) => {
|
|
|
7678
8456
|
exports2.selectAssetTypeAttachmentMapping = selectAssetTypeAttachmentMapping;
|
|
7679
8457
|
exports2.selectAssetTypeAttachments = selectAssetTypeAttachments;
|
|
7680
8458
|
exports2.selectAssetTypeById = selectAssetTypeById;
|
|
8459
|
+
exports2.selectAssetTypeFieldValues = selectAssetTypeFieldValues;
|
|
8460
|
+
exports2.selectAssetTypeFieldValuesAttachmentById = selectAssetTypeFieldValuesAttachmentById;
|
|
8461
|
+
exports2.selectAssetTypeFieldValuesAttachments = selectAssetTypeFieldValuesAttachments;
|
|
8462
|
+
exports2.selectAssetTypeFieldValuesAttachmentsMapping = selectAssetTypeFieldValuesAttachmentsMapping;
|
|
8463
|
+
exports2.selectAssetTypeFieldValuesById = selectAssetTypeFieldValuesById;
|
|
8464
|
+
exports2.selectAssetTypeFieldValuesMapping = selectAssetTypeFieldValuesMapping;
|
|
8465
|
+
exports2.selectAssetTypeFieldValuesOfAsset = selectAssetTypeFieldValuesOfAsset;
|
|
8466
|
+
exports2.selectAssetTypeFields = selectAssetTypeFields;
|
|
8467
|
+
exports2.selectAssetTypeFieldsAttachmentById = selectAssetTypeFieldsAttachmentById;
|
|
8468
|
+
exports2.selectAssetTypeFieldsAttachments = selectAssetTypeFieldsAttachments;
|
|
8469
|
+
exports2.selectAssetTypeFieldsAttachmentsMapping = selectAssetTypeFieldsAttachmentsMapping;
|
|
8470
|
+
exports2.selectAssetTypeFieldsById = selectAssetTypeFieldsById;
|
|
8471
|
+
exports2.selectAssetTypeFieldsMapping = selectAssetTypeFieldsMapping;
|
|
8472
|
+
exports2.selectAssetTypeFieldsOfAssetType = selectAssetTypeFieldsOfAssetType;
|
|
7681
8473
|
exports2.selectAssetTypeStagesMapping = selectAssetTypeStagesMapping;
|
|
7682
8474
|
exports2.selectAssetTypes = selectAssetTypes;
|
|
7683
8475
|
exports2.selectAssetTypesByIds = selectAssetTypesByIds;
|
|
@@ -7686,18 +8478,20 @@ var __publicField = (obj, key, value) => {
|
|
|
7686
8478
|
exports2.selectAssetsByIds = selectAssetsByIds;
|
|
7687
8479
|
exports2.selectAssetsMapping = selectAssetsMapping;
|
|
7688
8480
|
exports2.selectAssetsOfAssetType = selectAssetsOfAssetType;
|
|
7689
|
-
exports2.selectAttachedFormSubmissionsOfAsset = selectAttachedFormSubmissionsOfAsset;
|
|
7690
|
-
exports2.selectAttachedFormSubmissionsOfIssue = selectAttachedFormSubmissionsOfIssue;
|
|
7691
8481
|
exports2.selectAttachmentsOfAsset = selectAttachmentsOfAsset;
|
|
7692
8482
|
exports2.selectAttachmentsOfAssetByType = selectAttachmentsOfAssetByType;
|
|
7693
8483
|
exports2.selectAttachmentsOfAssetType = selectAttachmentsOfAssetType;
|
|
7694
8484
|
exports2.selectAttachmentsOfAssetTypeByType = selectAttachmentsOfAssetTypeByType;
|
|
8485
|
+
exports2.selectAttachmentsOfAssetTypeFieldValues = selectAttachmentsOfAssetTypeFieldValues;
|
|
8486
|
+
exports2.selectAttachmentsOfAssetTypeFields = selectAttachmentsOfAssetTypeFields;
|
|
7695
8487
|
exports2.selectAttachmentsOfDocument = selectAttachmentsOfDocument;
|
|
7696
8488
|
exports2.selectAttachmentsOfDocumentByType = selectAttachmentsOfDocumentByType;
|
|
7697
8489
|
exports2.selectAttachmentsOfFormRevision = selectAttachmentsOfFormRevision;
|
|
7698
8490
|
exports2.selectAttachmentsOfFormSubmission = selectAttachmentsOfFormSubmission;
|
|
7699
8491
|
exports2.selectAttachmentsOfIssue = selectAttachmentsOfIssue;
|
|
7700
8492
|
exports2.selectAttachmentsOfIssueByType = selectAttachmentsOfIssueByType;
|
|
8493
|
+
exports2.selectAttachmentsOfIssueTypeFieldValues = selectAttachmentsOfIssueTypeFieldValues;
|
|
8494
|
+
exports2.selectAttachmentsOfIssueTypeFields = selectAttachmentsOfIssueTypeFields;
|
|
7701
8495
|
exports2.selectAttachmentsOfProject = selectAttachmentsOfProject;
|
|
7702
8496
|
exports2.selectAttachmentsOfProjectByType = selectAttachmentsOfProjectByType;
|
|
7703
8497
|
exports2.selectCategories = selectCategories;
|
|
@@ -7725,8 +8519,6 @@ var __publicField = (obj, key, value) => {
|
|
|
7725
8519
|
exports2.selectFilteredForms = selectFilteredForms;
|
|
7726
8520
|
exports2.selectFormById = selectFormById;
|
|
7727
8521
|
exports2.selectFormMapping = selectFormMapping;
|
|
7728
|
-
exports2.selectFormOfAssetType = selectFormOfAssetType;
|
|
7729
|
-
exports2.selectFormOfIssueType = selectFormOfIssueType;
|
|
7730
8522
|
exports2.selectFormRevisionAttachmentsMapping = selectFormRevisionAttachmentsMapping;
|
|
7731
8523
|
exports2.selectFormRevisionById = selectFormRevisionById;
|
|
7732
8524
|
exports2.selectFormRevisionMapping = selectFormRevisionMapping;
|
|
@@ -7736,9 +8528,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7736
8528
|
exports2.selectFormSubmissionAttachmentsMapping = selectFormSubmissionAttachmentsMapping;
|
|
7737
8529
|
exports2.selectFormSubmissionById = selectFormSubmissionById;
|
|
7738
8530
|
exports2.selectFormSubmissions = selectFormSubmissions;
|
|
7739
|
-
exports2.selectFormSubmissionsByAssets = selectFormSubmissionsByAssets;
|
|
7740
8531
|
exports2.selectFormSubmissionsByFormRevisions = selectFormSubmissionsByFormRevisions;
|
|
7741
|
-
exports2.selectFormSubmissionsByIssues = selectFormSubmissionsByIssues;
|
|
7742
8532
|
exports2.selectFormSubmissionsMapping = selectFormSubmissionsMapping;
|
|
7743
8533
|
exports2.selectFormSubmissionsOfAsset = selectFormSubmissionsOfAsset;
|
|
7744
8534
|
exports2.selectFormSubmissionsOfForm = selectFormSubmissionsOfForm;
|
|
@@ -7767,6 +8557,20 @@ var __publicField = (obj, key, value) => {
|
|
|
7767
8557
|
exports2.selectIssueCountOfCategory = selectIssueCountOfCategory;
|
|
7768
8558
|
exports2.selectIssueMapping = selectIssueMapping;
|
|
7769
8559
|
exports2.selectIssueTypeById = selectIssueTypeById;
|
|
8560
|
+
exports2.selectIssueTypeFieldValues = selectIssueTypeFieldValues;
|
|
8561
|
+
exports2.selectIssueTypeFieldValuesAttachmentById = selectIssueTypeFieldValuesAttachmentById;
|
|
8562
|
+
exports2.selectIssueTypeFieldValuesAttachments = selectIssueTypeFieldValuesAttachments;
|
|
8563
|
+
exports2.selectIssueTypeFieldValuesAttachmentsMapping = selectIssueTypeFieldValuesAttachmentsMapping;
|
|
8564
|
+
exports2.selectIssueTypeFieldValuesById = selectIssueTypeFieldValuesById;
|
|
8565
|
+
exports2.selectIssueTypeFieldValuesMapping = selectIssueTypeFieldValuesMapping;
|
|
8566
|
+
exports2.selectIssueTypeFieldValuesOfIssue = selectIssueTypeFieldValuesOfIssue;
|
|
8567
|
+
exports2.selectIssueTypeFields = selectIssueTypeFields;
|
|
8568
|
+
exports2.selectIssueTypeFieldsAttachmentById = selectIssueTypeFieldsAttachmentById;
|
|
8569
|
+
exports2.selectIssueTypeFieldsAttachments = selectIssueTypeFieldsAttachments;
|
|
8570
|
+
exports2.selectIssueTypeFieldsAttachmentsMapping = selectIssueTypeFieldsAttachmentsMapping;
|
|
8571
|
+
exports2.selectIssueTypeFieldsById = selectIssueTypeFieldsById;
|
|
8572
|
+
exports2.selectIssueTypeFieldsMapping = selectIssueTypeFieldsMapping;
|
|
8573
|
+
exports2.selectIssueTypeFieldsOfIssueType = selectIssueTypeFieldsOfIssueType;
|
|
7770
8574
|
exports2.selectIssueTypeMapping = selectIssueTypeMapping;
|
|
7771
8575
|
exports2.selectIssueTypes = selectIssueTypes;
|
|
7772
8576
|
exports2.selectIssueTypesByIds = selectIssueTypesByIds;
|
|
@@ -7833,6 +8637,8 @@ var __publicField = (obj, key, value) => {
|
|
|
7833
8637
|
exports2.selectWorkspaceById = selectWorkspaceById;
|
|
7834
8638
|
exports2.selectWorkspaceMapping = selectWorkspaceMapping;
|
|
7835
8639
|
exports2.selectWorkspaces = selectWorkspaces;
|
|
8640
|
+
exports2.separateFilesFromValues = separateFilesFromValues;
|
|
8641
|
+
exports2.separateImageFromFields = separateImageFromFields;
|
|
7836
8642
|
exports2.setActiveProjectFileId = setActiveProjectFileId;
|
|
7837
8643
|
exports2.setActiveProjectId = setActiveProjectId;
|
|
7838
8644
|
exports2.setAsset = setAsset;
|
|
@@ -7843,6 +8649,14 @@ var __publicField = (obj, key, value) => {
|
|
|
7843
8649
|
exports2.setAssetType = setAssetType;
|
|
7844
8650
|
exports2.setAssetTypeAttachment = setAssetTypeAttachment;
|
|
7845
8651
|
exports2.setAssetTypeAttachments = setAssetTypeAttachments;
|
|
8652
|
+
exports2.setAssetTypeFieldValues = setAssetTypeFieldValues;
|
|
8653
|
+
exports2.setAssetTypeFieldValuesAttachment = setAssetTypeFieldValuesAttachment;
|
|
8654
|
+
exports2.setAssetTypeFieldValuesAttachments = setAssetTypeFieldValuesAttachments;
|
|
8655
|
+
exports2.setAssetTypeFieldValuesMany = setAssetTypeFieldValuesMany;
|
|
8656
|
+
exports2.setAssetTypeFields = setAssetTypeFields;
|
|
8657
|
+
exports2.setAssetTypeFieldsAttachment = setAssetTypeFieldsAttachment;
|
|
8658
|
+
exports2.setAssetTypeFieldsAttachments = setAssetTypeFieldsAttachments;
|
|
8659
|
+
exports2.setAssetTypeFieldsMany = setAssetTypeFieldsMany;
|
|
7846
8660
|
exports2.setAssetTypes = setAssetTypes;
|
|
7847
8661
|
exports2.setAssets = setAssets;
|
|
7848
8662
|
exports2.setConversation = setConversation;
|
|
@@ -7868,6 +8682,14 @@ var __publicField = (obj, key, value) => {
|
|
|
7868
8682
|
exports2.setIssueComment = setIssueComment;
|
|
7869
8683
|
exports2.setIssueComments = setIssueComments;
|
|
7870
8684
|
exports2.setIssueType = setIssueType;
|
|
8685
|
+
exports2.setIssueTypeFieldValues = setIssueTypeFieldValues;
|
|
8686
|
+
exports2.setIssueTypeFieldValuesAttachment = setIssueTypeFieldValuesAttachment;
|
|
8687
|
+
exports2.setIssueTypeFieldValuesAttachments = setIssueTypeFieldValuesAttachments;
|
|
8688
|
+
exports2.setIssueTypeFieldValuesMany = setIssueTypeFieldValuesMany;
|
|
8689
|
+
exports2.setIssueTypeFields = setIssueTypeFields;
|
|
8690
|
+
exports2.setIssueTypeFieldsAttachment = setIssueTypeFieldsAttachment;
|
|
8691
|
+
exports2.setIssueTypeFieldsAttachments = setIssueTypeFieldsAttachments;
|
|
8692
|
+
exports2.setIssueTypeFieldsMany = setIssueTypeFieldsMany;
|
|
7871
8693
|
exports2.setIssueUpdate = setIssueUpdate;
|
|
7872
8694
|
exports2.setLoggedIn = setLoggedIn;
|
|
7873
8695
|
exports2.setOrganizations = setOrganizations;
|
|
@@ -7900,6 +8722,14 @@ var __publicField = (obj, key, value) => {
|
|
|
7900
8722
|
exports2.updateAssetType = updateAssetType;
|
|
7901
8723
|
exports2.updateAssetTypeAttachment = updateAssetTypeAttachment;
|
|
7902
8724
|
exports2.updateAssetTypeAttachments = updateAssetTypeAttachments;
|
|
8725
|
+
exports2.updateAssetTypeFieldValues = updateAssetTypeFieldValues;
|
|
8726
|
+
exports2.updateAssetTypeFieldValuesAttachment = updateAssetTypeFieldValuesAttachment;
|
|
8727
|
+
exports2.updateAssetTypeFieldValuesAttachments = updateAssetTypeFieldValuesAttachments;
|
|
8728
|
+
exports2.updateAssetTypeFieldValuesMany = updateAssetTypeFieldValuesMany;
|
|
8729
|
+
exports2.updateAssetTypeFields = updateAssetTypeFields;
|
|
8730
|
+
exports2.updateAssetTypeFieldsAttachment = updateAssetTypeFieldsAttachment;
|
|
8731
|
+
exports2.updateAssetTypeFieldsAttachments = updateAssetTypeFieldsAttachments;
|
|
8732
|
+
exports2.updateAssetTypeFieldsMany = updateAssetTypeFieldsMany;
|
|
7903
8733
|
exports2.updateAssetTypes = updateAssetTypes;
|
|
7904
8734
|
exports2.updateAssets = updateAssets;
|
|
7905
8735
|
exports2.updateCategory = updateCategory;
|
|
@@ -7922,6 +8752,14 @@ var __publicField = (obj, key, value) => {
|
|
|
7922
8752
|
exports2.updateIssueAttachment = updateIssueAttachment;
|
|
7923
8753
|
exports2.updateIssueAttachments = updateIssueAttachments;
|
|
7924
8754
|
exports2.updateIssueType = updateIssueType;
|
|
8755
|
+
exports2.updateIssueTypeFieldValues = updateIssueTypeFieldValues;
|
|
8756
|
+
exports2.updateIssueTypeFieldValuesAttachment = updateIssueTypeFieldValuesAttachment;
|
|
8757
|
+
exports2.updateIssueTypeFieldValuesAttachments = updateIssueTypeFieldValuesAttachments;
|
|
8758
|
+
exports2.updateIssueTypeFieldValuesMany = updateIssueTypeFieldValuesMany;
|
|
8759
|
+
exports2.updateIssueTypeFields = updateIssueTypeFields;
|
|
8760
|
+
exports2.updateIssueTypeFieldsAttachment = updateIssueTypeFieldsAttachment;
|
|
8761
|
+
exports2.updateIssueTypeFieldsAttachments = updateIssueTypeFieldsAttachments;
|
|
8762
|
+
exports2.updateIssueTypeFieldsMany = updateIssueTypeFieldsMany;
|
|
7925
8763
|
exports2.updateLicense = updateLicense;
|
|
7926
8764
|
exports2.updateOrCreateProject = updateOrCreateProject;
|
|
7927
8765
|
exports2.updateOrganizationAccess = updateOrganizationAccess;
|