@overmap-ai/core 1.0.71-mapbox.6 → 1.0.71-mapbox.7
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 +1927 -1079
- package/dist/overmap-core.js.map +1 -1
- package/dist/overmap-core.umd.cjs +1927 -1079
- package/dist/overmap-core.umd.cjs.map +1 -1
- package/dist/sdk/services/AssetAttachmentService.d.ts +29 -7
- package/dist/sdk/services/AssetService.d.ts +1 -1
- package/dist/sdk/services/AssetStageService.d.ts +1 -3
- package/dist/sdk/services/AssetTypeAttachmentService.d.ts +29 -8
- package/dist/sdk/services/AssetTypeFieldValuesAttachmentService.d.ts +13 -0
- package/dist/sdk/services/AssetTypeFieldValuesService.d.ts +21 -0
- package/dist/sdk/services/AssetTypeFieldsAttachmentService.d.ts +13 -0
- package/dist/sdk/services/AssetTypeFieldsService.d.ts +9 -0
- package/dist/sdk/services/AssetTypeService.d.ts +1 -1
- package/dist/sdk/services/BaseAttachmentService.d.ts +17 -19
- package/dist/sdk/services/BaseUploadService.d.ts +2 -1
- package/dist/sdk/services/DocumentAttachmentService.d.ts +27 -7
- package/dist/sdk/services/FormRevisionAttachmentService.d.ts +13 -0
- package/dist/sdk/services/FormRevisionService.d.ts +9 -0
- package/dist/sdk/services/FormService.d.ts +11 -14
- package/dist/sdk/services/FormSubmissionAttachmentService.d.ts +14 -0
- package/dist/sdk/services/FormSubmissionService.d.ts +8 -28
- package/dist/sdk/services/IssueAssociationService.d.ts +2 -2
- package/dist/sdk/services/IssueAttachmentService.d.ts +28 -7
- package/dist/sdk/services/IssueService.d.ts +0 -3
- package/dist/sdk/services/IssueTypeFieldValuesAttachmentService.d.ts +14 -0
- package/dist/sdk/services/IssueTypeFieldValuesService.d.ts +11 -0
- package/dist/sdk/services/IssueTypeFieldsAttachmentService.d.ts +13 -0
- package/dist/sdk/services/IssueTypeFieldsService.d.ts +9 -0
- package/dist/sdk/services/ProjectAttachmentService.d.ts +28 -7
- package/dist/sdk/services/index.d.ts +11 -0
- package/dist/store/slices/assetStageSlice.d.ts +0 -1
- package/dist/store/slices/assetTypeFieldValuesAttachmentSlice.d.ts +64 -0
- package/dist/store/slices/assetTypeFieldValuesSlice.d.ts +64 -0
- package/dist/store/slices/assetTypeFieldsAttachmentSlice.d.ts +63 -0
- package/dist/store/slices/assetTypeFieldsSlice.d.ts +64 -0
- package/dist/store/slices/formRevisionSlice.d.ts +1 -2
- package/dist/store/slices/formSlice.d.ts +1 -5
- package/dist/store/slices/formSubmissionSlice.d.ts +0 -6
- package/dist/store/slices/index.d.ts +8 -0
- package/dist/store/slices/issueTypeFieldValuesAttachmentSlice.d.ts +64 -0
- package/dist/store/slices/issueTypeFieldValuesSlice.d.ts +63 -0
- package/dist/store/slices/issueTypeFieldsAttachmentSlice.d.ts +63 -0
- package/dist/store/slices/issueTypeFieldsSlice.d.ts +65 -0
- package/dist/store/store.d.ts +9 -1
- package/dist/typings/files.d.ts +8 -4
- package/dist/typings/models/assets.d.ts +17 -2
- package/dist/typings/models/attachments.d.ts +1 -6
- package/dist/typings/models/fields.d.ts +17 -0
- package/dist/typings/models/forms.d.ts +12 -29
- package/dist/typings/models/index.d.ts +1 -0
- package/dist/typings/models/issues.d.ts +15 -0
- package/dist/typings/models/store.d.ts +9 -1
- package/dist/utils/file.d.ts +2 -2
- package/package.json +1 -1
|
@@ -652,15 +652,15 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
652
652
|
};
|
|
653
653
|
const migrations = [initialVersioning, signOut, signOut, createOutboxState];
|
|
654
654
|
const manifest = Object.fromEntries(migrations.map((migration2, i) => [i, wrapMigration(migration2)]));
|
|
655
|
-
const initialState$
|
|
655
|
+
const initialState$J = {
|
|
656
656
|
accessToken: "",
|
|
657
657
|
refreshToken: "",
|
|
658
658
|
isLoggedIn: false
|
|
659
659
|
};
|
|
660
660
|
const authSlice = toolkit.createSlice({
|
|
661
661
|
name: "auth",
|
|
662
|
-
initialState: initialState$
|
|
663
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
662
|
+
initialState: initialState$J,
|
|
663
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$J)),
|
|
664
664
|
reducers: {
|
|
665
665
|
setTokens: (state, action) => {
|
|
666
666
|
state.accessToken = action.payload.accessToken;
|
|
@@ -748,11 +748,11 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
748
748
|
};
|
|
749
749
|
}
|
|
750
750
|
const categoryAdapter = createModelAdapter((category) => category.offline_id);
|
|
751
|
-
const initialState$
|
|
751
|
+
const initialState$I = categoryAdapter.getInitialState({});
|
|
752
752
|
const categorySlice = toolkit.createSlice({
|
|
753
753
|
name: "categories",
|
|
754
|
-
initialState: initialState$
|
|
755
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
754
|
+
initialState: initialState$I,
|
|
755
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$I)),
|
|
756
756
|
reducers: {
|
|
757
757
|
initializeCategories: categoryAdapter.initialize,
|
|
758
758
|
addCategory: categoryAdapter.addOne,
|
|
@@ -790,11 +790,11 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
790
790
|
};
|
|
791
791
|
const categoryReducer = categorySlice.reducer;
|
|
792
792
|
const assetAdapter = createModelAdapter((asset) => asset.offline_id);
|
|
793
|
-
const initialState$
|
|
793
|
+
const initialState$H = assetAdapter.getInitialState({});
|
|
794
794
|
const assetSlice = toolkit.createSlice({
|
|
795
795
|
name: "assets",
|
|
796
|
-
initialState: initialState$
|
|
797
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
796
|
+
initialState: initialState$H,
|
|
797
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$H)),
|
|
798
798
|
reducers: {
|
|
799
799
|
initializeAssets: assetAdapter.initialize,
|
|
800
800
|
addAsset: assetAdapter.addOne,
|
|
@@ -845,11 +845,11 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
845
845
|
};
|
|
846
846
|
const assetReducer = assetSlice.reducer;
|
|
847
847
|
const assetAttachmentAdapter = createModelAdapter((attachment) => attachment.offline_id);
|
|
848
|
-
const initialState$
|
|
848
|
+
const initialState$G = assetAttachmentAdapter.getInitialState({});
|
|
849
849
|
const assetAttachmentSlice = toolkit.createSlice({
|
|
850
850
|
name: "assetAttachments",
|
|
851
|
-
initialState: initialState$
|
|
852
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
851
|
+
initialState: initialState$G,
|
|
852
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$G)),
|
|
853
853
|
reducers: {
|
|
854
854
|
initializeAssetAttachments: assetAttachmentAdapter.initialize,
|
|
855
855
|
addAssetAttachment: assetAttachmentAdapter.addOne,
|
|
@@ -910,11 +910,11 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
910
910
|
const assetStageCompletionAdapter = createModelAdapter(
|
|
911
911
|
(stageCompletion) => stageCompletion.offline_id
|
|
912
912
|
);
|
|
913
|
-
const initialState$
|
|
913
|
+
const initialState$F = assetStageCompletionAdapter.getInitialState({});
|
|
914
914
|
const assetStageCompletionSlice = toolkit.createSlice({
|
|
915
915
|
name: "assetStageCompletions",
|
|
916
|
-
initialState: initialState$
|
|
917
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
916
|
+
initialState: initialState$F,
|
|
917
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$F)),
|
|
918
918
|
reducers: {
|
|
919
919
|
initializeAssetStageCompletions: assetStageCompletionAdapter.initialize,
|
|
920
920
|
addAssetStageCompletion: assetStageCompletionAdapter.addOne,
|
|
@@ -967,11 +967,11 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
967
967
|
);
|
|
968
968
|
const assetStageCompletionReducer = assetStageCompletionSlice.reducer;
|
|
969
969
|
const assetStageAdapter = createModelAdapter((assetStage) => assetStage.offline_id);
|
|
970
|
-
const initialState$
|
|
970
|
+
const initialState$E = assetStageAdapter.getInitialState({});
|
|
971
971
|
const assetStageSlice = toolkit.createSlice({
|
|
972
972
|
name: "assetStages",
|
|
973
|
-
initialState: initialState$
|
|
974
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
973
|
+
initialState: initialState$E,
|
|
974
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$E)),
|
|
975
975
|
reducers: {
|
|
976
976
|
initializeAssetStages: assetStageAdapter.initialize,
|
|
977
977
|
setAssetStage: assetStageAdapter.setOne,
|
|
@@ -1035,27 +1035,12 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1035
1035
|
return fallbackToEmptyArray(assetStages);
|
|
1036
1036
|
})
|
|
1037
1037
|
);
|
|
1038
|
-
const selectStageFormIdsFromStageIds = restructureCreateSelectorWithArgs(
|
|
1039
|
-
toolkit.createSelector([selectStageMapping, (_state, stageIds) => stageIds], (stageMapping, stageIds) => {
|
|
1040
|
-
const ret = {};
|
|
1041
|
-
for (const stageId of stageIds) {
|
|
1042
|
-
const stage = stageMapping[stageId];
|
|
1043
|
-
if (!stage) {
|
|
1044
|
-
throw new Error("No stage exists with the id " + stageId);
|
|
1045
|
-
}
|
|
1046
|
-
if (stage.form) {
|
|
1047
|
-
ret[stageId] = stage.form;
|
|
1048
|
-
}
|
|
1049
|
-
}
|
|
1050
|
-
return ret;
|
|
1051
|
-
})
|
|
1052
|
-
);
|
|
1053
1038
|
const assetTypeAdapter = createModelAdapter((assetType) => assetType.offline_id);
|
|
1054
|
-
const initialState$
|
|
1039
|
+
const initialState$D = assetTypeAdapter.getInitialState({});
|
|
1055
1040
|
const assetTypeSlice = toolkit.createSlice({
|
|
1056
1041
|
name: "assetTypes",
|
|
1057
|
-
initialState: initialState$
|
|
1058
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1042
|
+
initialState: initialState$D,
|
|
1043
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$D)),
|
|
1059
1044
|
reducers: {
|
|
1060
1045
|
initializeAssetTypes: assetTypeAdapter.initialize,
|
|
1061
1046
|
setAssetType: assetTypeAdapter.setOne,
|
|
@@ -1108,11 +1093,11 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1108
1093
|
const assetTypeAttachmentAdapter = createModelAdapter(
|
|
1109
1094
|
(attachment) => attachment.offline_id
|
|
1110
1095
|
);
|
|
1111
|
-
const initialState$
|
|
1096
|
+
const initialState$C = assetTypeAttachmentAdapter.getInitialState({});
|
|
1112
1097
|
const assetTypeAttachmentSlice = toolkit.createSlice({
|
|
1113
1098
|
name: "assetTypeAttachments",
|
|
1114
|
-
initialState: initialState$
|
|
1115
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1099
|
+
initialState: initialState$C,
|
|
1100
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$C)),
|
|
1116
1101
|
reducers: {
|
|
1117
1102
|
initializeAssetTypeAttachments: assetTypeAttachmentAdapter.initialize,
|
|
1118
1103
|
addAssetTypeAttachment: assetTypeAttachmentAdapter.addOne,
|
|
@@ -1171,12 +1156,12 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1171
1156
|
);
|
|
1172
1157
|
const assetTypeAttachmentReducer = assetTypeAttachmentSlice.reducer;
|
|
1173
1158
|
const issueAdapter = createModelAdapter((issue) => issue.offline_id);
|
|
1174
|
-
const initialState$
|
|
1159
|
+
const initialState$B = issueAdapter.getInitialState({});
|
|
1175
1160
|
const issueSlice = toolkit.createSlice({
|
|
1176
1161
|
name: "issues",
|
|
1177
|
-
initialState: initialState$
|
|
1162
|
+
initialState: initialState$B,
|
|
1178
1163
|
extraReducers: (builder) => builder.addCase("RESET", (state) => {
|
|
1179
|
-
Object.assign(state, initialState$
|
|
1164
|
+
Object.assign(state, initialState$B);
|
|
1180
1165
|
}),
|
|
1181
1166
|
reducers: {
|
|
1182
1167
|
initializeIssues: issueAdapter.initialize,
|
|
@@ -1208,12 +1193,12 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1208
1193
|
);
|
|
1209
1194
|
const issueReducer = issueSlice.reducer;
|
|
1210
1195
|
const issueTypeAdapter = createModelAdapter((issueType) => issueType.offline_id);
|
|
1211
|
-
const initialState$
|
|
1196
|
+
const initialState$A = issueTypeAdapter.getInitialState({});
|
|
1212
1197
|
const issueTypeSlice = toolkit.createSlice({
|
|
1213
1198
|
name: "issueTypes",
|
|
1214
|
-
initialState: initialState$
|
|
1199
|
+
initialState: initialState$A,
|
|
1215
1200
|
extraReducers: (builder) => builder.addCase("RESET", (state) => {
|
|
1216
|
-
Object.assign(state, initialState$
|
|
1201
|
+
Object.assign(state, initialState$A);
|
|
1217
1202
|
}),
|
|
1218
1203
|
reducers: {
|
|
1219
1204
|
initializeIssueTypes: issueTypeAdapter.initialize,
|
|
@@ -1270,15 +1255,15 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1270
1255
|
return selectIssuesOfIssueType(issueTypeId)(state).length;
|
|
1271
1256
|
};
|
|
1272
1257
|
const issueTypeReducer = issueTypeSlice.reducer;
|
|
1273
|
-
const initialState$
|
|
1258
|
+
const initialState$z = {
|
|
1274
1259
|
s3Urls: {}
|
|
1275
1260
|
};
|
|
1276
1261
|
const msPerHour = 1e3 * 60 * 60;
|
|
1277
1262
|
const msPerWeek = msPerHour * 24 * 7;
|
|
1278
1263
|
const fileSlice = toolkit.createSlice({
|
|
1279
1264
|
name: "file",
|
|
1280
|
-
initialState: initialState$
|
|
1281
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1265
|
+
initialState: initialState$z,
|
|
1266
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$z)),
|
|
1282
1267
|
reducers: {
|
|
1283
1268
|
setUploadUrl: (state, action) => {
|
|
1284
1269
|
const { url, fields, sha1 } = action.payload;
|
|
@@ -1304,14 +1289,14 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1304
1289
|
return url;
|
|
1305
1290
|
};
|
|
1306
1291
|
const fileReducer = fileSlice.reducer;
|
|
1307
|
-
const initialState$
|
|
1292
|
+
const initialState$y = {
|
|
1308
1293
|
users: {},
|
|
1309
1294
|
currentUser: null
|
|
1310
1295
|
};
|
|
1311
1296
|
const userSlice = toolkit.createSlice({
|
|
1312
1297
|
name: "users",
|
|
1313
|
-
initialState: initialState$
|
|
1314
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1298
|
+
initialState: initialState$y,
|
|
1299
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$y)),
|
|
1315
1300
|
reducers: {
|
|
1316
1301
|
setUsers: (state, action) => {
|
|
1317
1302
|
const usersMapping = {};
|
|
@@ -1368,11 +1353,11 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1368
1353
|
const organizationAccessAdapter = createModelAdapter(
|
|
1369
1354
|
(organizationAccess) => organizationAccess.offline_id
|
|
1370
1355
|
);
|
|
1371
|
-
const initialState$
|
|
1356
|
+
const initialState$x = organizationAccessAdapter.getInitialState({});
|
|
1372
1357
|
const organizationAccessSlice = toolkit.createSlice({
|
|
1373
1358
|
name: "organizationAccess",
|
|
1374
|
-
initialState: initialState$
|
|
1375
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1359
|
+
initialState: initialState$x,
|
|
1360
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$x)),
|
|
1376
1361
|
reducers: {
|
|
1377
1362
|
initializeOrganizationAccesses: organizationAccessAdapter.initialize,
|
|
1378
1363
|
updateOrganizationAccess: organizationAccessAdapter.updateOne,
|
|
@@ -1409,11 +1394,11 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1409
1394
|
};
|
|
1410
1395
|
const organizationAccessReducer = organizationAccessSlice.reducer;
|
|
1411
1396
|
const licenseAdapter = createModelAdapter((license) => license.offline_id);
|
|
1412
|
-
const initialState$
|
|
1397
|
+
const initialState$w = licenseAdapter.getInitialState({});
|
|
1413
1398
|
const licenseSlice = toolkit.createSlice({
|
|
1414
1399
|
name: "license",
|
|
1415
|
-
initialState: initialState$
|
|
1416
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1400
|
+
initialState: initialState$w,
|
|
1401
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$w)),
|
|
1417
1402
|
reducers: {
|
|
1418
1403
|
initializeLicences: licenseAdapter.initialize,
|
|
1419
1404
|
addLicenses: licenseAdapter.addMany,
|
|
@@ -1440,11 +1425,11 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1440
1425
|
);
|
|
1441
1426
|
const licenseReducer = licenseSlice.reducer;
|
|
1442
1427
|
const projectAccessAdapter = createModelAdapter((projectAccess) => projectAccess.offline_id);
|
|
1443
|
-
const initialState$
|
|
1428
|
+
const initialState$v = projectAccessAdapter.getInitialState({});
|
|
1444
1429
|
const projectAccessSlice = toolkit.createSlice({
|
|
1445
1430
|
name: "projectAccess",
|
|
1446
|
-
initialState: initialState$
|
|
1447
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1431
|
+
initialState: initialState$v,
|
|
1432
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$v)),
|
|
1448
1433
|
reducers: {
|
|
1449
1434
|
initializeProjectAccesses: projectAccessAdapter.initialize,
|
|
1450
1435
|
updateProjectAccess: projectAccessAdapter.updateOne,
|
|
@@ -1478,13 +1463,13 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1478
1463
|
return fallbackToEmptyObject(projectAccesses);
|
|
1479
1464
|
};
|
|
1480
1465
|
const projectAccessReducer = projectAccessSlice.reducer;
|
|
1481
|
-
const initialState$
|
|
1466
|
+
const initialState$u = {
|
|
1482
1467
|
projects: {}
|
|
1483
1468
|
};
|
|
1484
1469
|
const projectSlice = toolkit.createSlice({
|
|
1485
1470
|
name: "projects",
|
|
1486
|
-
initialState: initialState$
|
|
1487
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1471
|
+
initialState: initialState$u,
|
|
1472
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$u)),
|
|
1488
1473
|
reducers: {
|
|
1489
1474
|
setProjects: (state, action) => {
|
|
1490
1475
|
const projectsMap = {};
|
|
@@ -1545,13 +1530,13 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1545
1530
|
);
|
|
1546
1531
|
}
|
|
1547
1532
|
);
|
|
1548
|
-
const initialState$
|
|
1533
|
+
const initialState$t = {
|
|
1549
1534
|
organizations: {}
|
|
1550
1535
|
};
|
|
1551
1536
|
const organizationSlice = toolkit.createSlice({
|
|
1552
1537
|
name: "organizations",
|
|
1553
|
-
initialState: initialState$
|
|
1554
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1538
|
+
initialState: initialState$t,
|
|
1539
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$t)),
|
|
1555
1540
|
reducers: {
|
|
1556
1541
|
setOrganizations: (state, action) => {
|
|
1557
1542
|
for (const org of action.payload) {
|
|
@@ -1646,14 +1631,14 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1646
1631
|
}
|
|
1647
1632
|
};
|
|
1648
1633
|
};
|
|
1649
|
-
const initialState$
|
|
1634
|
+
const initialState$s = {
|
|
1650
1635
|
deletedRequests: [],
|
|
1651
1636
|
latestRetryTime: 0
|
|
1652
1637
|
};
|
|
1653
1638
|
const outboxSlice = toolkit.createSlice({
|
|
1654
1639
|
name: "outbox",
|
|
1655
|
-
initialState: initialState$
|
|
1656
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1640
|
+
initialState: initialState$s,
|
|
1641
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$s)),
|
|
1657
1642
|
reducers: {
|
|
1658
1643
|
// enqueueActions is a reducer that does nothing but enqueue API request to the Redux Offline outbox
|
|
1659
1644
|
// Whenever an issue is being created, a reducer addIssue() is responsible for adding it to the offline store
|
|
@@ -1685,14 +1670,14 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1685
1670
|
const { enqueueRequest, markForDeletion, markAsDeleted, _setLatestRetryTime } = outboxSlice.actions;
|
|
1686
1671
|
const outboxReducer = outboxSlice.reducer;
|
|
1687
1672
|
const projectFileModelAdapter = createModelAdapter((projectFile) => projectFile.offline_id);
|
|
1688
|
-
const initialState$
|
|
1673
|
+
const initialState$r = projectFileModelAdapter.getInitialState({
|
|
1689
1674
|
activeProjectFileId: null,
|
|
1690
1675
|
isImportingProjectFile: false
|
|
1691
1676
|
});
|
|
1692
1677
|
const projectFileSlice = toolkit.createSlice({
|
|
1693
1678
|
name: "projectFiles",
|
|
1694
|
-
initialState: initialState$
|
|
1695
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1679
|
+
initialState: initialState$r,
|
|
1680
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$r)),
|
|
1696
1681
|
reducers: {
|
|
1697
1682
|
initializeProjectFiles: projectFileModelAdapter.initialize,
|
|
1698
1683
|
setProjectFile: projectFileModelAdapter.setOne,
|
|
@@ -1757,11 +1742,11 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1757
1742
|
const selectIsImportingProjectFile = (state) => state.projectFileReducer.isImportingProjectFile;
|
|
1758
1743
|
const projectFileReducer = projectFileSlice.reducer;
|
|
1759
1744
|
const projectAttachmentAdapter = createModelAdapter((attachment) => attachment.offline_id);
|
|
1760
|
-
const initialState$
|
|
1745
|
+
const initialState$q = projectAttachmentAdapter.getInitialState({});
|
|
1761
1746
|
const projectAttachmentSlice = toolkit.createSlice({
|
|
1762
1747
|
name: "projectAttachments",
|
|
1763
|
-
initialState: initialState$
|
|
1764
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1748
|
+
initialState: initialState$q,
|
|
1749
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$q)),
|
|
1765
1750
|
reducers: {
|
|
1766
1751
|
initializeProjectAttachments: projectAttachmentAdapter.initialize,
|
|
1767
1752
|
addProjectAttachment: projectAttachmentAdapter.addOne,
|
|
@@ -1816,12 +1801,12 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1816
1801
|
)
|
|
1817
1802
|
);
|
|
1818
1803
|
const projectAttachmentReducer = projectAttachmentSlice.reducer;
|
|
1819
|
-
const initialState$
|
|
1804
|
+
const initialState$p = {
|
|
1820
1805
|
isRehydrated: false
|
|
1821
1806
|
};
|
|
1822
1807
|
const rehydratedSlice = toolkit.createSlice({
|
|
1823
1808
|
name: "rehydrated",
|
|
1824
|
-
initialState: initialState$
|
|
1809
|
+
initialState: initialState$p,
|
|
1825
1810
|
// The `reducers` field lets us define reducers and generate associated actions
|
|
1826
1811
|
reducers: {
|
|
1827
1812
|
setRehydrated: (state, action) => {
|
|
@@ -1846,11 +1831,11 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1846
1831
|
}
|
|
1847
1832
|
};
|
|
1848
1833
|
const formRevisionAdapter = createModelAdapter((revision) => revision.offline_id);
|
|
1849
|
-
const initialState$
|
|
1834
|
+
const initialState$o = formRevisionAdapter.getInitialState({});
|
|
1850
1835
|
const formRevisionsSlice = toolkit.createSlice({
|
|
1851
1836
|
name: "formRevisions",
|
|
1852
|
-
initialState: initialState$
|
|
1853
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1837
|
+
initialState: initialState$o,
|
|
1838
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$o)),
|
|
1854
1839
|
reducers: {
|
|
1855
1840
|
initializeFormRevisions: formRevisionAdapter.initialize,
|
|
1856
1841
|
setFormRevision: formRevisionAdapter.setOne,
|
|
@@ -1908,24 +1893,13 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1908
1893
|
}
|
|
1909
1894
|
)
|
|
1910
1895
|
);
|
|
1911
|
-
const selectLatestFormRevisionByForm = toolkit.createSelector([selectFormRevisionMapping], (revisions) => {
|
|
1912
|
-
const latestRevisions = {};
|
|
1913
|
-
for (const revision of Object.values(revisions)) {
|
|
1914
|
-
const formId = revision.form;
|
|
1915
|
-
const currentLatestRevision = latestRevisions[formId];
|
|
1916
|
-
if (!currentLatestRevision || currentLatestRevision.revision < revision.revision) {
|
|
1917
|
-
latestRevisions[formId] = revision;
|
|
1918
|
-
}
|
|
1919
|
-
}
|
|
1920
|
-
return latestRevisions;
|
|
1921
|
-
});
|
|
1922
1896
|
const formRevisionReducer = formRevisionsSlice.reducer;
|
|
1923
1897
|
const formAdapter = createModelAdapter((form) => form.offline_id);
|
|
1924
|
-
const initialState$
|
|
1898
|
+
const initialState$n = formAdapter.getInitialState({});
|
|
1925
1899
|
const formSlice = toolkit.createSlice({
|
|
1926
1900
|
name: "forms",
|
|
1927
|
-
initialState: initialState$
|
|
1928
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1901
|
+
initialState: initialState$n,
|
|
1902
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$n)),
|
|
1929
1903
|
reducers: {
|
|
1930
1904
|
initializeForms: formAdapter.initialize,
|
|
1931
1905
|
setForm: formAdapter.setOne,
|
|
@@ -1943,6 +1917,9 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1943
1917
|
const selectForms = toolkit.createSelector([selectFormMapping], (formsMapping) => {
|
|
1944
1918
|
return Object.values(formsMapping);
|
|
1945
1919
|
});
|
|
1920
|
+
const selectFormById = (formId) => (state) => {
|
|
1921
|
+
return state.formReducer.instances[formId];
|
|
1922
|
+
};
|
|
1946
1923
|
const selectFilteredForms = restructureCreateSelectorWithArgs(
|
|
1947
1924
|
toolkit.createSelector(
|
|
1948
1925
|
[
|
|
@@ -1968,37 +1945,12 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1968
1945
|
{ memoizeOptions: { resultEqualityCheck: shallowEqual } }
|
|
1969
1946
|
)
|
|
1970
1947
|
);
|
|
1971
|
-
const selectFormById = (formId) => (state) => {
|
|
1972
|
-
return state.formReducer.instances[formId];
|
|
1973
|
-
};
|
|
1974
|
-
const selectFormOfAssetType = restructureCreateSelectorWithArgs(
|
|
1975
|
-
toolkit.createSelector(
|
|
1976
|
-
[selectFormMapping, (_state, assetTypeId) => assetTypeId],
|
|
1977
|
-
(formsMapping, assetTypeId) => {
|
|
1978
|
-
return Object.values(formsMapping).find((form) => form.asset_type === assetTypeId);
|
|
1979
|
-
}
|
|
1980
|
-
)
|
|
1981
|
-
);
|
|
1982
|
-
const selectFormOfIssueType = restructureCreateSelectorWithArgs(
|
|
1983
|
-
toolkit.createSelector(
|
|
1984
|
-
[selectFormMapping, (_state, issueTypeId) => issueTypeId],
|
|
1985
|
-
(formsMapping, issueTypeId) => {
|
|
1986
|
-
return Object.values(formsMapping).find((form) => form.issue_type === issueTypeId);
|
|
1987
|
-
}
|
|
1988
|
-
)
|
|
1989
|
-
);
|
|
1990
|
-
const selectFormsCount = toolkit.createSelector([selectFormMapping], (formsMapping) => {
|
|
1991
|
-
return Object.keys(formsMapping).length;
|
|
1992
|
-
});
|
|
1993
|
-
const selectGeneralFormCount = toolkit.createSelector([selectFormMapping], (formsMapping) => {
|
|
1994
|
-
return Object.values(formsMapping).filter((form) => !form.asset_type).length;
|
|
1995
|
-
});
|
|
1996
1948
|
const submissionAdapter = createModelAdapter((submission) => submission.offline_id);
|
|
1997
|
-
const initialState$
|
|
1949
|
+
const initialState$m = submissionAdapter.getInitialState({});
|
|
1998
1950
|
const formSubmissionSlice = toolkit.createSlice({
|
|
1999
1951
|
name: "formSubmissions",
|
|
2000
|
-
initialState: initialState$
|
|
2001
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1952
|
+
initialState: initialState$m,
|
|
1953
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$m)),
|
|
2002
1954
|
reducers: {
|
|
2003
1955
|
initializeFormSubmissions: submissionAdapter.initialize,
|
|
2004
1956
|
setFormSubmission: submissionAdapter.setOne,
|
|
@@ -2053,43 +2005,6 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
2053
2005
|
}
|
|
2054
2006
|
)
|
|
2055
2007
|
);
|
|
2056
|
-
const selectFormSubmissionsByFormRevisions = toolkit.createSelector([selectFormRevisionMapping, selectFormSubmissions], (revisions, submissions) => {
|
|
2057
|
-
var _a2;
|
|
2058
|
-
const submissionMapping = {};
|
|
2059
|
-
for (const revisionId in revisions) {
|
|
2060
|
-
submissionMapping[revisionId] = [];
|
|
2061
|
-
}
|
|
2062
|
-
for (const submission of submissions) {
|
|
2063
|
-
(_a2 = submissionMapping[submission.form_revision]) == null ? void 0 : _a2.push(submission);
|
|
2064
|
-
}
|
|
2065
|
-
return submissionMapping;
|
|
2066
|
-
});
|
|
2067
|
-
const selectSortedFormSubmissionsOfForm = restructureCreateSelectorWithArgs(
|
|
2068
|
-
toolkit.createSelector(
|
|
2069
|
-
[
|
|
2070
|
-
selectFormRevisionMapping,
|
|
2071
|
-
selectFormSubmissionsByFormRevisions,
|
|
2072
|
-
(_state, formId) => formId
|
|
2073
|
-
],
|
|
2074
|
-
(revisionsMapping, submissionsByRevision, formId) => {
|
|
2075
|
-
const submissionsByFormRevisions = {};
|
|
2076
|
-
for (const revisionId in revisionsMapping) {
|
|
2077
|
-
const revision = revisionsMapping[revisionId];
|
|
2078
|
-
const submissionsOfRevision = submissionsByRevision[revisionId];
|
|
2079
|
-
if (revision && submissionsOfRevision && revision.form === formId) {
|
|
2080
|
-
submissionsByFormRevisions[revisionId] = submissionsOfRevision.sort(
|
|
2081
|
-
(a, b) => a.submitted_at < b.submitted_at ? -1 : 1
|
|
2082
|
-
);
|
|
2083
|
-
}
|
|
2084
|
-
}
|
|
2085
|
-
return Object.entries(submissionsByFormRevisions).sort((a, b) => {
|
|
2086
|
-
const aRevision = revisionsMapping[a[0]];
|
|
2087
|
-
const bRevision = revisionsMapping[b[0]];
|
|
2088
|
-
return formRevisionSortFn(aRevision, bRevision);
|
|
2089
|
-
}).map(([_revisionId, submissions]) => submissions).flat();
|
|
2090
|
-
}
|
|
2091
|
-
)
|
|
2092
|
-
);
|
|
2093
2008
|
const selectFormSubmissionsOfIssue = restructureCreateSelectorWithArgs(
|
|
2094
2009
|
toolkit.createSelector(
|
|
2095
2010
|
[selectFormSubmissions, (_state, issueId) => issueId],
|
|
@@ -2100,53 +2015,6 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
2100
2015
|
}
|
|
2101
2016
|
)
|
|
2102
2017
|
);
|
|
2103
|
-
const selectAttachedFormSubmissionsOfIssue = restructureCreateSelectorWithArgs(
|
|
2104
|
-
toolkit.createSelector(
|
|
2105
|
-
[
|
|
2106
|
-
(state) => state.issueReducer.instances,
|
|
2107
|
-
(state) => state.formReducer.instances,
|
|
2108
|
-
(state) => state.formRevisionReducer.instances,
|
|
2109
|
-
(state) => state.formSubmissionReducer.instances,
|
|
2110
|
-
(_state, issueId) => issueId
|
|
2111
|
-
],
|
|
2112
|
-
(issues, forms, formRevisions, submissions, issueId) => {
|
|
2113
|
-
const issue = issues[issueId];
|
|
2114
|
-
if (!issue) return [];
|
|
2115
|
-
if (!issue.issue_type) {
|
|
2116
|
-
return Object.values(submissions).filter((submission) => submission.issue === issueId);
|
|
2117
|
-
}
|
|
2118
|
-
const issueTypeForms = new Set(
|
|
2119
|
-
Object.keys(forms).filter((formId) => forms[formId].issue_type === issue.issue_type)
|
|
2120
|
-
);
|
|
2121
|
-
const issueTypeFormRevisions = new Set(
|
|
2122
|
-
Object.keys(formRevisions).filter(
|
|
2123
|
-
(formRevisionId) => issueTypeForms.has(formRevisions[formRevisionId].form)
|
|
2124
|
-
)
|
|
2125
|
-
);
|
|
2126
|
-
return Object.values(submissions).filter(
|
|
2127
|
-
(submission) => submission.issue === issueId && !issueTypeFormRevisions.has(submission.form_revision)
|
|
2128
|
-
);
|
|
2129
|
-
}
|
|
2130
|
-
)
|
|
2131
|
-
);
|
|
2132
|
-
const selectFormSubmissionsByIssues = restructureCreateSelectorWithArgs(
|
|
2133
|
-
toolkit.createSelector(
|
|
2134
|
-
[selectFormSubmissions, (_state, issueIds) => issueIds],
|
|
2135
|
-
(submissions, issueIds) => {
|
|
2136
|
-
var _a2;
|
|
2137
|
-
const issueSubmissions = {};
|
|
2138
|
-
for (const issueId of issueIds) {
|
|
2139
|
-
issueSubmissions[issueId] = [];
|
|
2140
|
-
}
|
|
2141
|
-
for (const submission of submissions) {
|
|
2142
|
-
if (submission.issue && issueIds.includes(submission.issue)) {
|
|
2143
|
-
(_a2 = issueSubmissions[submission.issue]) == null ? void 0 : _a2.push(submission);
|
|
2144
|
-
}
|
|
2145
|
-
}
|
|
2146
|
-
return issueSubmissions;
|
|
2147
|
-
}
|
|
2148
|
-
)
|
|
2149
|
-
);
|
|
2150
2018
|
const selectFormSubmissionsOfAsset = restructureCreateSelectorWithArgs(
|
|
2151
2019
|
toolkit.createSelector(
|
|
2152
2020
|
[selectFormSubmissions, (_state, assetId) => assetId],
|
|
@@ -2157,61 +2025,15 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
2157
2025
|
}
|
|
2158
2026
|
)
|
|
2159
2027
|
);
|
|
2160
|
-
const selectAttachedFormSubmissionsOfAsset = restructureCreateSelectorWithArgs(
|
|
2161
|
-
toolkit.createSelector(
|
|
2162
|
-
[
|
|
2163
|
-
(state) => state.assetReducer.instances,
|
|
2164
|
-
(state) => state.formReducer.instances,
|
|
2165
|
-
(state) => state.formRevisionReducer.instances,
|
|
2166
|
-
(state) => state.formSubmissionReducer.instances,
|
|
2167
|
-
(_state, assetId) => assetId
|
|
2168
|
-
],
|
|
2169
|
-
(assets, forms, formRevisions, submissions, assetId) => {
|
|
2170
|
-
const asset = assets[assetId];
|
|
2171
|
-
if (!asset) return [];
|
|
2172
|
-
if (!asset.asset_type) {
|
|
2173
|
-
return Object.values(submissions).filter((submission) => submission.asset === assetId);
|
|
2174
|
-
}
|
|
2175
|
-
const issueTypeForms = new Set(
|
|
2176
|
-
Object.keys(forms).filter((formId) => forms[formId].asset_type === asset.asset_type)
|
|
2177
|
-
);
|
|
2178
|
-
const issueTypeFormRevisions = new Set(
|
|
2179
|
-
Object.keys(formRevisions).filter(
|
|
2180
|
-
(formRevisionId) => issueTypeForms.has(formRevisions[formRevisionId].form)
|
|
2181
|
-
)
|
|
2182
|
-
);
|
|
2183
|
-
return Object.values(submissions).filter(
|
|
2184
|
-
(submission) => submission.asset === assetId && !issueTypeFormRevisions.has(submission.form_revision)
|
|
2185
|
-
);
|
|
2186
|
-
}
|
|
2187
|
-
)
|
|
2188
|
-
);
|
|
2189
|
-
const selectFormSubmissionsByAssets = toolkit.createSelector(
|
|
2190
|
-
[selectFormSubmissionsMapping, selectAssetsMapping],
|
|
2191
|
-
(submissions, assets) => {
|
|
2192
|
-
var _a2;
|
|
2193
|
-
const assetSubmissionMapping = {};
|
|
2194
|
-
for (const assetId in assets) {
|
|
2195
|
-
assetSubmissionMapping[assetId] = [];
|
|
2196
|
-
}
|
|
2197
|
-
for (const submissionId in submissions) {
|
|
2198
|
-
const submission = submissions[submissionId];
|
|
2199
|
-
if (submission.asset) {
|
|
2200
|
-
(_a2 = assetSubmissionMapping[submission.asset]) == null ? void 0 : _a2.push(submission);
|
|
2201
|
-
}
|
|
2202
|
-
}
|
|
2203
|
-
return assetSubmissionMapping;
|
|
2204
|
-
}
|
|
2205
|
-
);
|
|
2206
2028
|
const formSubmissionReducer = formSubmissionSlice.reducer;
|
|
2207
2029
|
const formSubmissionAttachmentAdapter = createModelAdapter(
|
|
2208
2030
|
(attachment) => attachment.offline_id
|
|
2209
2031
|
);
|
|
2210
|
-
const initialState$
|
|
2032
|
+
const initialState$l = formSubmissionAttachmentAdapter.getInitialState({});
|
|
2211
2033
|
const formSubmissionAttachmentSlice = toolkit.createSlice({
|
|
2212
2034
|
name: "formSubmissionAttachments",
|
|
2213
|
-
initialState: initialState$
|
|
2214
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2035
|
+
initialState: initialState$l,
|
|
2036
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$l)),
|
|
2215
2037
|
reducers: {
|
|
2216
2038
|
initializeFormSubmissionAttachments: formSubmissionAttachmentAdapter.initialize,
|
|
2217
2039
|
addFormSubmissionAttachment: formSubmissionAttachmentAdapter.addOne,
|
|
@@ -2254,7 +2076,9 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
2254
2076
|
[selectFormSubmissionAttachmentsMapping, (_state, submissionId) => submissionId],
|
|
2255
2077
|
(attachmentsMapping, submissionId) => {
|
|
2256
2078
|
return fallbackToEmptyArray(
|
|
2257
|
-
Object.values(attachmentsMapping).filter(
|
|
2079
|
+
Object.values(attachmentsMapping).filter(
|
|
2080
|
+
(attachment) => attachment.form_submission === submissionId
|
|
2081
|
+
)
|
|
2258
2082
|
);
|
|
2259
2083
|
}
|
|
2260
2084
|
)
|
|
@@ -2263,11 +2087,11 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
2263
2087
|
const formRevisionAttachmentAdapter = createModelAdapter(
|
|
2264
2088
|
(attachment) => attachment.offline_id
|
|
2265
2089
|
);
|
|
2266
|
-
const initialState$
|
|
2090
|
+
const initialState$k = formRevisionAttachmentAdapter.getInitialState({});
|
|
2267
2091
|
const formRevisionAttachmentSlice = toolkit.createSlice({
|
|
2268
2092
|
name: "formRevisionAttachments",
|
|
2269
|
-
initialState: initialState$
|
|
2270
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2093
|
+
initialState: initialState$k,
|
|
2094
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$k)),
|
|
2271
2095
|
reducers: {
|
|
2272
2096
|
initializeFormRevisionAttachments: formRevisionAttachmentAdapter.initialize,
|
|
2273
2097
|
addFormRevisionAttachment: formRevisionAttachmentAdapter.addOne,
|
|
@@ -2299,17 +2123,17 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
2299
2123
|
[selectFormRevisionAttachmentsMapping, (_state, revisionId) => revisionId],
|
|
2300
2124
|
(attachments, revisionId) => {
|
|
2301
2125
|
return fallbackToEmptyArray(
|
|
2302
|
-
Object.values(attachments).filter((attachment) => attachment.
|
|
2126
|
+
Object.values(attachments).filter((attachment) => attachment.form_revision === revisionId)
|
|
2303
2127
|
);
|
|
2304
2128
|
}
|
|
2305
2129
|
)
|
|
2306
2130
|
);
|
|
2307
2131
|
const formRevisionAttachmentReducer = formRevisionAttachmentSlice.reducer;
|
|
2308
2132
|
const workspaceAdapter = createModelAdapter((workspace) => workspace.offline_id);
|
|
2309
|
-
const initialState$
|
|
2133
|
+
const initialState$j = workspaceAdapter.getInitialState({});
|
|
2310
2134
|
const workspaceSlice = toolkit.createSlice({
|
|
2311
2135
|
name: "workspace",
|
|
2312
|
-
initialState: initialState$
|
|
2136
|
+
initialState: initialState$j,
|
|
2313
2137
|
reducers: {
|
|
2314
2138
|
initializeWorkspaces: workspaceAdapter.initialize,
|
|
2315
2139
|
setWorkspaces: workspaceAdapter.setMany,
|
|
@@ -2340,10 +2164,10 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
2340
2164
|
);
|
|
2341
2165
|
const workspaceReducer = workspaceSlice.reducer;
|
|
2342
2166
|
const emailDomainAdapter = createModelAdapter((emailDomain) => emailDomain.offline_id);
|
|
2343
|
-
const initialState$
|
|
2167
|
+
const initialState$i = emailDomainAdapter.getInitialState({});
|
|
2344
2168
|
const emailDomainsSlice = toolkit.createSlice({
|
|
2345
2169
|
name: "emailDomains",
|
|
2346
|
-
initialState: initialState$
|
|
2170
|
+
initialState: initialState$i,
|
|
2347
2171
|
reducers: {
|
|
2348
2172
|
initializeEmailDomains: emailDomainAdapter.initialize,
|
|
2349
2173
|
addEmailDomain: emailDomainAdapter.addOne,
|
|
@@ -2364,14 +2188,14 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
2364
2188
|
)
|
|
2365
2189
|
);
|
|
2366
2190
|
const emailDomainsReducer = emailDomainsSlice.reducer;
|
|
2367
|
-
const initialState$
|
|
2191
|
+
const initialState$h = {
|
|
2368
2192
|
documents: {}
|
|
2369
2193
|
};
|
|
2370
2194
|
const documentSlice = toolkit.createSlice({
|
|
2371
2195
|
name: "documents",
|
|
2372
|
-
initialState: initialState$
|
|
2196
|
+
initialState: initialState$h,
|
|
2373
2197
|
extraReducers: (builder) => builder.addCase("RESET", (state) => {
|
|
2374
|
-
Object.assign(state, initialState$
|
|
2198
|
+
Object.assign(state, initialState$h);
|
|
2375
2199
|
}),
|
|
2376
2200
|
reducers: {
|
|
2377
2201
|
setDocuments: (state, action) => {
|
|
@@ -2559,11 +2383,11 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
2559
2383
|
);
|
|
2560
2384
|
const documentsReducer = documentSlice.reducer;
|
|
2561
2385
|
const documentAttachmentAdapter = createModelAdapter((attachment) => attachment.offline_id);
|
|
2562
|
-
const initialState$
|
|
2386
|
+
const initialState$g = documentAttachmentAdapter.getInitialState({});
|
|
2563
2387
|
const documentAttachmentSlice = toolkit.createSlice({
|
|
2564
2388
|
name: "documentAttachments",
|
|
2565
|
-
initialState: initialState$
|
|
2566
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2389
|
+
initialState: initialState$g,
|
|
2390
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$g)),
|
|
2567
2391
|
reducers: {
|
|
2568
2392
|
initializeDocumentAttachments: documentAttachmentAdapter.initialize,
|
|
2569
2393
|
addDocumentAttachment: documentAttachmentAdapter.addOne,
|
|
@@ -2622,11 +2446,11 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
2622
2446
|
);
|
|
2623
2447
|
const documentAttachmentReducer = documentAttachmentSlice.reducer;
|
|
2624
2448
|
const teamAdapter = createModelAdapter((team) => team.offline_id);
|
|
2625
|
-
const initialState$
|
|
2449
|
+
const initialState$f = teamAdapter.getInitialState({});
|
|
2626
2450
|
const teamSlice = toolkit.createSlice({
|
|
2627
2451
|
name: "teams",
|
|
2628
|
-
initialState: initialState$
|
|
2629
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2452
|
+
initialState: initialState$f,
|
|
2453
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$f)),
|
|
2630
2454
|
reducers: {
|
|
2631
2455
|
setTeam: teamAdapter.setOne,
|
|
2632
2456
|
initializeTeams: teamAdapter.initialize,
|
|
@@ -2677,11 +2501,11 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
2677
2501
|
const agentUserConversationAdapter = createModelAdapter(
|
|
2678
2502
|
(conversation) => conversation.offline_id
|
|
2679
2503
|
);
|
|
2680
|
-
const initialState$
|
|
2504
|
+
const initialState$e = agentUserConversationAdapter.getInitialState({});
|
|
2681
2505
|
const agentsSlice = toolkit.createSlice({
|
|
2682
2506
|
name: "agents",
|
|
2683
|
-
initialState: initialState$
|
|
2684
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2507
|
+
initialState: initialState$e,
|
|
2508
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$e)),
|
|
2685
2509
|
reducers: {
|
|
2686
2510
|
initializeConversations: agentUserConversationAdapter.initialize,
|
|
2687
2511
|
addConversation: agentUserConversationAdapter.addOne,
|
|
@@ -2703,11 +2527,11 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
2703
2527
|
);
|
|
2704
2528
|
const agentsReducer = agentsSlice.reducer;
|
|
2705
2529
|
const issueCommentAdapter = createModelAdapter((comment) => comment.offline_id);
|
|
2706
|
-
const initialState$
|
|
2530
|
+
const initialState$d = issueCommentAdapter.getInitialState({});
|
|
2707
2531
|
const issueCommentSlice = toolkit.createSlice({
|
|
2708
2532
|
name: "issueComments",
|
|
2709
|
-
initialState: initialState$
|
|
2710
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2533
|
+
initialState: initialState$d,
|
|
2534
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$d)),
|
|
2711
2535
|
reducers: {
|
|
2712
2536
|
addIssueComment: issueCommentAdapter.addOne,
|
|
2713
2537
|
addIssueComments: issueCommentAdapter.addMany,
|
|
@@ -2736,11 +2560,11 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
2736
2560
|
);
|
|
2737
2561
|
const issueCommentReducer = issueCommentSlice.reducer;
|
|
2738
2562
|
const issueUpdateAdapter = createModelAdapter((issueUpdate) => issueUpdate.offline_id);
|
|
2739
|
-
const initialState$
|
|
2563
|
+
const initialState$c = issueUpdateAdapter.getInitialState({});
|
|
2740
2564
|
const issueUpdateSlice = toolkit.createSlice({
|
|
2741
2565
|
name: "issueUpdates",
|
|
2742
|
-
initialState: initialState$
|
|
2743
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2566
|
+
initialState: initialState$c,
|
|
2567
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$c)),
|
|
2744
2568
|
reducers: {
|
|
2745
2569
|
initializeIssueUpdates: issueUpdateAdapter.setMany,
|
|
2746
2570
|
setIssueUpdate: issueUpdateAdapter.setOne,
|
|
@@ -2769,11 +2593,11 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
2769
2593
|
);
|
|
2770
2594
|
const issueUpdateReducer = issueUpdateSlice.reducer;
|
|
2771
2595
|
const issueAttachmentAdapter = createModelAdapter((attachment) => attachment.offline_id);
|
|
2772
|
-
const initialState$
|
|
2596
|
+
const initialState$b = issueAttachmentAdapter.getInitialState({});
|
|
2773
2597
|
const issueAttachmentSlice = toolkit.createSlice({
|
|
2774
2598
|
name: "issueAttachments",
|
|
2775
|
-
initialState: initialState$
|
|
2776
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2599
|
+
initialState: initialState$b,
|
|
2600
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$b)),
|
|
2777
2601
|
reducers: {
|
|
2778
2602
|
initializeIssueAttachments: issueAttachmentAdapter.initialize,
|
|
2779
2603
|
addIssueAttachment: issueAttachmentAdapter.addOne,
|
|
@@ -2831,23 +2655,23 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
2831
2655
|
)
|
|
2832
2656
|
);
|
|
2833
2657
|
const issueAttachmentReducer = issueAttachmentSlice.reducer;
|
|
2834
|
-
const initialState$
|
|
2658
|
+
const initialState$a = {
|
|
2835
2659
|
version: 0
|
|
2836
2660
|
};
|
|
2837
2661
|
const versioningSlice = toolkit.createSlice({
|
|
2838
2662
|
name: "versioning",
|
|
2839
|
-
initialState: initialState$
|
|
2663
|
+
initialState: initialState$a,
|
|
2840
2664
|
reducers: {}
|
|
2841
2665
|
});
|
|
2842
2666
|
const versioningReducer = versioningSlice.reducer;
|
|
2843
2667
|
const geoImageAdapter = createModelAdapter((model) => model.offline_id);
|
|
2844
|
-
const initialState$
|
|
2668
|
+
const initialState$9 = geoImageAdapter.getInitialState({});
|
|
2845
2669
|
const geoImageSlice = toolkit.createSlice({
|
|
2846
2670
|
name: "geoImages",
|
|
2847
|
-
initialState: initialState$
|
|
2671
|
+
initialState: initialState$9,
|
|
2848
2672
|
extraReducers: (builder) => {
|
|
2849
2673
|
builder.addCase("RESET", (state) => {
|
|
2850
|
-
Object.assign(state, initialState$
|
|
2674
|
+
Object.assign(state, initialState$9);
|
|
2851
2675
|
});
|
|
2852
2676
|
},
|
|
2853
2677
|
reducers: {
|
|
@@ -2887,11 +2711,11 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
2887
2711
|
);
|
|
2888
2712
|
const geoImageReducer = geoImageSlice.reducer;
|
|
2889
2713
|
const issueAssociationAdapter = createModelAdapter((assoc) => assoc.offline_id);
|
|
2890
|
-
const initialState = issueAssociationAdapter.getInitialState({});
|
|
2714
|
+
const initialState$8 = issueAssociationAdapter.getInitialState({});
|
|
2891
2715
|
const issueAssociationSlice = toolkit.createSlice({
|
|
2892
2716
|
name: "issueAssociations",
|
|
2893
|
-
initialState,
|
|
2894
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState)),
|
|
2717
|
+
initialState: initialState$8,
|
|
2718
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$8)),
|
|
2895
2719
|
reducers: {
|
|
2896
2720
|
initializeIssueAssociations: issueAssociationAdapter.initialize,
|
|
2897
2721
|
addIssueAssociation: issueAssociationAdapter.addOne,
|
|
@@ -2949,37 +2773,459 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
2949
2773
|
)
|
|
2950
2774
|
);
|
|
2951
2775
|
const issueAssociationReducer = issueAssociationSlice.reducer;
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
}
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
CLASS_NAME_TO_SERVICE[this.constructor.name] = this;
|
|
2971
|
-
this.client = sdk;
|
|
2776
|
+
const issueTypeFieldValuesAdapter = createModelAdapter(
|
|
2777
|
+
(fieldValues) => fieldValues.offline_id
|
|
2778
|
+
);
|
|
2779
|
+
const initialState$7 = issueTypeFieldValuesAdapter.getInitialState({});
|
|
2780
|
+
const issueTypeFieldValuesSlice = toolkit.createSlice({
|
|
2781
|
+
name: "issueTypeFieldValues",
|
|
2782
|
+
initialState: initialState$7,
|
|
2783
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$7)),
|
|
2784
|
+
reducers: {
|
|
2785
|
+
initializeIssueTypeFieldValues: issueTypeFieldValuesAdapter.initialize,
|
|
2786
|
+
addIssueTypeFieldValues: issueTypeFieldValuesAdapter.addOne,
|
|
2787
|
+
addIssueTypeFieldValuesMany: issueTypeFieldValuesAdapter.addMany,
|
|
2788
|
+
setIssueTypeFieldValues: issueTypeFieldValuesAdapter.setOne,
|
|
2789
|
+
setIssueTypeFieldValuesMany: issueTypeFieldValuesAdapter.setMany,
|
|
2790
|
+
updateIssueTypeFieldValues: issueTypeFieldValuesAdapter.updateOne,
|
|
2791
|
+
updateIssueTypeFieldValuesMany: issueTypeFieldValuesAdapter.updateMany,
|
|
2792
|
+
deleteIssueTypeFieldValues: issueTypeFieldValuesAdapter.deleteOne,
|
|
2793
|
+
deleteIssueTypeFieldValuesMany: issueTypeFieldValuesAdapter.deleteMany
|
|
2972
2794
|
}
|
|
2973
|
-
|
|
2974
|
-
|
|
2795
|
+
});
|
|
2796
|
+
const {
|
|
2797
|
+
initializeIssueTypeFieldValues,
|
|
2798
|
+
addIssueTypeFieldValues,
|
|
2799
|
+
addIssueTypeFieldValuesMany,
|
|
2800
|
+
setIssueTypeFieldValues,
|
|
2801
|
+
setIssueTypeFieldValuesMany,
|
|
2802
|
+
updateIssueTypeFieldValues,
|
|
2803
|
+
updateIssueTypeFieldValuesMany,
|
|
2804
|
+
deleteIssueTypeFieldValues,
|
|
2805
|
+
deleteIssueTypeFieldValuesMany
|
|
2806
|
+
} = issueTypeFieldValuesSlice.actions;
|
|
2807
|
+
const selectIssueTypeFieldValuesMapping = (state) => state.issueTypeFieldValuesReducer.instances;
|
|
2808
|
+
const selectIssueTypeFieldValues = toolkit.createSelector([selectIssueTypeFieldValuesMapping], (fieldValuesMapping) => {
|
|
2809
|
+
return Object.values(fieldValuesMapping);
|
|
2810
|
+
});
|
|
2811
|
+
const selectIssueTypeFieldValuesOfIssue = restructureCreateSelectorWithArgs(
|
|
2812
|
+
toolkit.createSelector([selectIssueTypeFieldValues, (_state, issueId) => issueId], (fieldValues, issueId) => {
|
|
2813
|
+
return fallbackToEmptyArray(fieldValues.filter((fieldValue) => fieldValue.issue === issueId));
|
|
2814
|
+
})
|
|
2815
|
+
);
|
|
2816
|
+
const selectIssueTypeFieldValuesById = (fieldValuesId) => (state) => {
|
|
2817
|
+
return state.issueTypeFieldValuesReducer.instances[fieldValuesId];
|
|
2818
|
+
};
|
|
2819
|
+
const issueTypeFieldValuesReducer = issueTypeFieldValuesSlice.reducer;
|
|
2820
|
+
const issueTypeFieldsAdapter = createModelAdapter((fields) => fields.offline_id);
|
|
2821
|
+
const initialState$6 = issueTypeFieldsAdapter.getInitialState({});
|
|
2822
|
+
const issueTypeFieldsSlice = toolkit.createSlice({
|
|
2823
|
+
name: "issueTypeFields",
|
|
2824
|
+
initialState: initialState$6,
|
|
2825
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$6)),
|
|
2826
|
+
reducers: {
|
|
2827
|
+
initializeIssueTypeFields: issueTypeFieldsAdapter.initialize,
|
|
2828
|
+
addIssueTypeFields: issueTypeFieldsAdapter.addOne,
|
|
2829
|
+
addIssueTypeFieldsMany: issueTypeFieldsAdapter.addMany,
|
|
2830
|
+
setIssueTypeFields: issueTypeFieldsAdapter.setOne,
|
|
2831
|
+
setIssueTypeFieldsMany: issueTypeFieldsAdapter.setMany,
|
|
2832
|
+
updateIssueTypeFields: issueTypeFieldsAdapter.updateOne,
|
|
2833
|
+
updateIssueTypeFieldsMany: issueTypeFieldsAdapter.updateMany,
|
|
2834
|
+
deleteIssueTypeFields: issueTypeFieldsAdapter.deleteOne,
|
|
2835
|
+
deleteIssueTypeFieldsMany: issueTypeFieldsAdapter.deleteMany
|
|
2975
2836
|
}
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2837
|
+
});
|
|
2838
|
+
const {
|
|
2839
|
+
initializeIssueTypeFields,
|
|
2840
|
+
addIssueTypeFields,
|
|
2841
|
+
addIssueTypeFieldsMany,
|
|
2842
|
+
setIssueTypeFields,
|
|
2843
|
+
setIssueTypeFieldsMany,
|
|
2844
|
+
updateIssueTypeFields,
|
|
2845
|
+
updateIssueTypeFieldsMany,
|
|
2846
|
+
deleteIssueTypeFields,
|
|
2847
|
+
deleteIssueTypeFieldsMany
|
|
2848
|
+
} = issueTypeFieldsSlice.actions;
|
|
2849
|
+
const selectIssueTypeFieldsMapping = (state) => state.issueTypeFieldsReducer.instances;
|
|
2850
|
+
const selectIssueTypeFields = toolkit.createSelector([selectIssueTypeFieldsMapping], (fieldsMapping) => {
|
|
2851
|
+
return Object.values(fieldsMapping);
|
|
2852
|
+
});
|
|
2853
|
+
const selectIssueTypeFieldsOfIssueType = restructureCreateSelectorWithArgs(
|
|
2854
|
+
toolkit.createSelector([selectIssueTypeFields, (_state, issueTypeId) => issueTypeId], (fields, issueTypeId) => {
|
|
2855
|
+
return fallbackToEmptyArray(fields.filter((field) => field.issue_type === issueTypeId));
|
|
2856
|
+
})
|
|
2857
|
+
);
|
|
2858
|
+
const selectLatestIssueTypeFieldsOfIssueType = restructureCreateSelectorWithArgs(
|
|
2859
|
+
toolkit.createSelector([selectIssueTypeFields, (_state, id) => id], (fields, id) => {
|
|
2860
|
+
return fields.filter((field) => field.issue_type === id).sort((a, b) => a.submitted_at > b.submitted_at ? -1 : 1)[0];
|
|
2861
|
+
})
|
|
2862
|
+
);
|
|
2863
|
+
const selectIssueTypeValuesOfIssueType = restructureCreateSelectorWithArgs(
|
|
2864
|
+
toolkit.createSelector(
|
|
2865
|
+
[selectIssueTypeFields, selectIssueTypeFieldValues, (_state, id) => id],
|
|
2866
|
+
(fields, fieldValues, id) => {
|
|
2867
|
+
const fieldsIds = new Set(
|
|
2868
|
+
fields.filter((field) => field.issue_type === id).map((field) => field.offline_id)
|
|
2869
|
+
);
|
|
2870
|
+
return fallbackToEmptyArray(fieldValues.filter((values) => fieldsIds.has(values.fields_revision)));
|
|
2871
|
+
}
|
|
2872
|
+
)
|
|
2873
|
+
);
|
|
2874
|
+
const selectIssueTypeFieldsById = (fieldsId) => (state) => {
|
|
2875
|
+
return state.issueTypeFieldsReducer.instances[fieldsId];
|
|
2876
|
+
};
|
|
2877
|
+
const issueTypeFieldsReducer = issueTypeFieldsSlice.reducer;
|
|
2878
|
+
const issueTypeFieldsAttachmentAdapter = createModelAdapter(
|
|
2879
|
+
(attachment) => attachment.offline_id
|
|
2880
|
+
);
|
|
2881
|
+
const initialState$5 = issueTypeFieldsAttachmentAdapter.getInitialState({});
|
|
2882
|
+
const issueTypeFieldsAttachmentSlice = toolkit.createSlice({
|
|
2883
|
+
name: "issueTypeFieldsAttachments",
|
|
2884
|
+
initialState: initialState$5,
|
|
2885
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$5)),
|
|
2886
|
+
reducers: {
|
|
2887
|
+
initializeIssueTypeFieldsAttachments: issueTypeFieldsAttachmentAdapter.initialize,
|
|
2888
|
+
addIssueTypeFieldsAttachment: issueTypeFieldsAttachmentAdapter.addOne,
|
|
2889
|
+
addIssueTypeFieldsAttachments: issueTypeFieldsAttachmentAdapter.addMany,
|
|
2890
|
+
setIssueTypeFieldsAttachment: issueTypeFieldsAttachmentAdapter.setOne,
|
|
2891
|
+
setIssueTypeFieldsAttachments: issueTypeFieldsAttachmentAdapter.setMany,
|
|
2892
|
+
updateIssueTypeFieldsAttachment: issueTypeFieldsAttachmentAdapter.updateOne,
|
|
2893
|
+
updateIssueTypeFieldsAttachments: issueTypeFieldsAttachmentAdapter.updateMany,
|
|
2894
|
+
deleteIssueTypeFieldsAttachment: issueTypeFieldsAttachmentAdapter.deleteOne,
|
|
2895
|
+
deleteIssueTypeFieldsAttachments: issueTypeFieldsAttachmentAdapter.deleteMany
|
|
2979
2896
|
}
|
|
2980
|
-
}
|
|
2981
|
-
const
|
|
2982
|
-
|
|
2897
|
+
});
|
|
2898
|
+
const {
|
|
2899
|
+
initializeIssueTypeFieldsAttachments,
|
|
2900
|
+
addIssueTypeFieldsAttachment,
|
|
2901
|
+
addIssueTypeFieldsAttachments,
|
|
2902
|
+
setIssueTypeFieldsAttachment,
|
|
2903
|
+
setIssueTypeFieldsAttachments,
|
|
2904
|
+
updateIssueTypeFieldsAttachment,
|
|
2905
|
+
updateIssueTypeFieldsAttachments,
|
|
2906
|
+
deleteIssueTypeFieldsAttachment,
|
|
2907
|
+
deleteIssueTypeFieldsAttachments
|
|
2908
|
+
} = issueTypeFieldsAttachmentSlice.actions;
|
|
2909
|
+
const selectIssueTypeFieldsAttachmentsMapping = (state) => state.issueTypeFieldsAttachmentReducer.instances;
|
|
2910
|
+
const selectIssueTypeFieldsAttachments = toolkit.createSelector(
|
|
2911
|
+
[selectIssueTypeFieldsAttachmentsMapping],
|
|
2912
|
+
(attachmentsMapping) => {
|
|
2913
|
+
return Object.values(attachmentsMapping);
|
|
2914
|
+
}
|
|
2915
|
+
);
|
|
2916
|
+
const selectAttachmentsOfIssueTypeFields = restructureCreateSelectorWithArgs(
|
|
2917
|
+
toolkit.createSelector(
|
|
2918
|
+
[selectIssueTypeFieldsAttachments, (_state, fieldsRevision) => fieldsRevision],
|
|
2919
|
+
(attachments, fieldsRevision) => {
|
|
2920
|
+
return fallbackToEmptyArray(
|
|
2921
|
+
attachments.filter((attachment) => attachment.fields_revision === fieldsRevision)
|
|
2922
|
+
);
|
|
2923
|
+
}
|
|
2924
|
+
)
|
|
2925
|
+
);
|
|
2926
|
+
const selectIssueTypeFieldsAttachmentById = (attachmentId) => (state) => {
|
|
2927
|
+
return state.issueTypeFieldsAttachmentReducer.instances[attachmentId];
|
|
2928
|
+
};
|
|
2929
|
+
const issueTypeFieldsAttachmentReducer = issueTypeFieldsAttachmentSlice.reducer;
|
|
2930
|
+
const issueTypeFieldValuesAttachmentAdapter = createModelAdapter(
|
|
2931
|
+
(attachment) => attachment.offline_id
|
|
2932
|
+
);
|
|
2933
|
+
const initialState$4 = issueTypeFieldValuesAttachmentAdapter.getInitialState({});
|
|
2934
|
+
const issueTypeFieldValuesAttachmentSlice = toolkit.createSlice({
|
|
2935
|
+
name: "issueTypeFieldValuesAttachments",
|
|
2936
|
+
initialState: initialState$4,
|
|
2937
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$4)),
|
|
2938
|
+
reducers: {
|
|
2939
|
+
initializeIssueTypeFieldValuesAttachments: issueTypeFieldValuesAttachmentAdapter.initialize,
|
|
2940
|
+
addIssueTypeFieldValuesAttachment: issueTypeFieldValuesAttachmentAdapter.addOne,
|
|
2941
|
+
addIssueTypeFieldValuesAttachments: issueTypeFieldValuesAttachmentAdapter.addMany,
|
|
2942
|
+
setIssueTypeFieldValuesAttachment: issueTypeFieldValuesAttachmentAdapter.setOne,
|
|
2943
|
+
setIssueTypeFieldValuesAttachments: issueTypeFieldValuesAttachmentAdapter.setMany,
|
|
2944
|
+
updateIssueTypeFieldValuesAttachment: issueTypeFieldValuesAttachmentAdapter.updateOne,
|
|
2945
|
+
updateIssueTypeFieldValuesAttachments: issueTypeFieldValuesAttachmentAdapter.updateMany,
|
|
2946
|
+
deleteIssueTypeFieldValuesAttachment: issueTypeFieldValuesAttachmentAdapter.deleteOne,
|
|
2947
|
+
deleteIssueTypeFieldValuesAttachments: issueTypeFieldValuesAttachmentAdapter.deleteMany
|
|
2948
|
+
}
|
|
2949
|
+
});
|
|
2950
|
+
const {
|
|
2951
|
+
initializeIssueTypeFieldValuesAttachments,
|
|
2952
|
+
addIssueTypeFieldValuesAttachment,
|
|
2953
|
+
addIssueTypeFieldValuesAttachments,
|
|
2954
|
+
setIssueTypeFieldValuesAttachment,
|
|
2955
|
+
setIssueTypeFieldValuesAttachments,
|
|
2956
|
+
updateIssueTypeFieldValuesAttachment,
|
|
2957
|
+
updateIssueTypeFieldValuesAttachments,
|
|
2958
|
+
deleteIssueTypeFieldValuesAttachment,
|
|
2959
|
+
deleteIssueTypeFieldValuesAttachments
|
|
2960
|
+
} = issueTypeFieldValuesAttachmentSlice.actions;
|
|
2961
|
+
const selectIssueTypeFieldValuesAttachmentsMapping = (state) => state.issueTypeFieldValuesAttachmentReducer.instances;
|
|
2962
|
+
const selectIssueTypeFieldValuesAttachments = toolkit.createSelector(
|
|
2963
|
+
[selectIssueTypeFieldValuesAttachmentsMapping],
|
|
2964
|
+
(attachmentsMapping) => {
|
|
2965
|
+
return Object.values(attachmentsMapping);
|
|
2966
|
+
}
|
|
2967
|
+
);
|
|
2968
|
+
const selectIssueTypeFieldValuesAttachmentById = (attachmentId) => (state) => {
|
|
2969
|
+
return state.issueTypeFieldValuesAttachmentReducer.instances[attachmentId];
|
|
2970
|
+
};
|
|
2971
|
+
const selectIssueTypeFieldValuesAttachmentsByIds = restructureCreateSelectorWithArgs(
|
|
2972
|
+
toolkit.createSelector(
|
|
2973
|
+
[selectIssueTypeFieldValuesAttachmentsMapping, (_, attachmentIds) => attachmentIds],
|
|
2974
|
+
(mapping, attachmentIds) => {
|
|
2975
|
+
const attachmentIdsSet = new Set(attachmentIds);
|
|
2976
|
+
return fallbackToEmptyArray(
|
|
2977
|
+
Object.values(mapping).filter((attachment) => attachmentIdsSet.has(attachment.offline_id))
|
|
2978
|
+
);
|
|
2979
|
+
}
|
|
2980
|
+
)
|
|
2981
|
+
);
|
|
2982
|
+
const selectAttachmentsOfIssueTypeFieldValues = restructureCreateSelectorWithArgs(
|
|
2983
|
+
toolkit.createSelector(
|
|
2984
|
+
[selectIssueTypeFieldValuesAttachments, (_state, fieldValuesId) => fieldValuesId],
|
|
2985
|
+
(attachments, fieldValuesId) => {
|
|
2986
|
+
return fallbackToEmptyArray(attachments.filter((attachment) => attachment.field_values === fieldValuesId));
|
|
2987
|
+
}
|
|
2988
|
+
)
|
|
2989
|
+
);
|
|
2990
|
+
const issueTypeFieldValuesAttachmentReducer = issueTypeFieldValuesAttachmentSlice.reducer;
|
|
2991
|
+
const assetTypeFieldsAdapter = createModelAdapter((fields) => fields.offline_id);
|
|
2992
|
+
const initialState$3 = assetTypeFieldsAdapter.getInitialState({});
|
|
2993
|
+
const assetTypeFieldsSlice = toolkit.createSlice({
|
|
2994
|
+
name: "assetTypeFields",
|
|
2995
|
+
initialState: initialState$3,
|
|
2996
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$3)),
|
|
2997
|
+
reducers: {
|
|
2998
|
+
initializeAssetTypeFields: assetTypeFieldsAdapter.initialize,
|
|
2999
|
+
addAssetTypeFields: assetTypeFieldsAdapter.addOne,
|
|
3000
|
+
addAssetTypeFieldsMany: assetTypeFieldsAdapter.addMany,
|
|
3001
|
+
setAssetTypeFields: assetTypeFieldsAdapter.setOne,
|
|
3002
|
+
setAssetTypeFieldsMany: assetTypeFieldsAdapter.setMany,
|
|
3003
|
+
updateAssetTypeFields: assetTypeFieldsAdapter.updateOne,
|
|
3004
|
+
updateAssetTypeFieldsMany: assetTypeFieldsAdapter.updateMany,
|
|
3005
|
+
deleteAssetTypeFields: assetTypeFieldsAdapter.deleteOne,
|
|
3006
|
+
deleteAssetTypeFieldsMany: assetTypeFieldsAdapter.deleteMany
|
|
3007
|
+
}
|
|
3008
|
+
});
|
|
3009
|
+
const {
|
|
3010
|
+
initializeAssetTypeFields,
|
|
3011
|
+
addAssetTypeFields,
|
|
3012
|
+
addAssetTypeFieldsMany,
|
|
3013
|
+
setAssetTypeFields,
|
|
3014
|
+
setAssetTypeFieldsMany,
|
|
3015
|
+
updateAssetTypeFields,
|
|
3016
|
+
updateAssetTypeFieldsMany,
|
|
3017
|
+
deleteAssetTypeFields,
|
|
3018
|
+
deleteAssetTypeFieldsMany
|
|
3019
|
+
} = assetTypeFieldsSlice.actions;
|
|
3020
|
+
const selectAssetTypeFieldsMapping = (state) => state.assetTypeFieldsReducer.instances;
|
|
3021
|
+
const selectAssetTypeFields = toolkit.createSelector([selectAssetTypeFieldsMapping], (fieldsMapping) => {
|
|
3022
|
+
return Object.values(fieldsMapping);
|
|
3023
|
+
});
|
|
3024
|
+
const selectAssetTypeFieldsOfAssetType = restructureCreateSelectorWithArgs(
|
|
3025
|
+
toolkit.createSelector([selectAssetTypeFields, (_state, assetTypeId) => assetTypeId], (fields, assetTypeId) => {
|
|
3026
|
+
return fallbackToEmptyArray(fields.filter((field) => field.asset_type === assetTypeId));
|
|
3027
|
+
})
|
|
3028
|
+
);
|
|
3029
|
+
const selectLatestAssetTypeFieldsOfAssetType = restructureCreateSelectorWithArgs(
|
|
3030
|
+
toolkit.createSelector([selectAssetTypeFields, (_state, id) => id], (fields, id) => {
|
|
3031
|
+
return fields.filter((field) => field.asset_type === id).sort((a, b) => a.submitted_at > b.submitted_at ? -1 : 1)[0];
|
|
3032
|
+
})
|
|
3033
|
+
);
|
|
3034
|
+
const selectAssetTypeFieldsById = (fieldsId) => (state) => {
|
|
3035
|
+
return state.assetTypeFieldsReducer.instances[fieldsId];
|
|
3036
|
+
};
|
|
3037
|
+
const assetTypeFieldsReducer = assetTypeFieldsSlice.reducer;
|
|
3038
|
+
const assetTypeFieldValuesAdapter = createModelAdapter(
|
|
3039
|
+
(fieldValues) => fieldValues.offline_id
|
|
3040
|
+
);
|
|
3041
|
+
const initialState$2 = assetTypeFieldValuesAdapter.getInitialState({});
|
|
3042
|
+
const assetTypeFieldValuesSlice = toolkit.createSlice({
|
|
3043
|
+
name: "assetTypeFieldValues",
|
|
3044
|
+
initialState: initialState$2,
|
|
3045
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$2)),
|
|
3046
|
+
reducers: {
|
|
3047
|
+
initializeAssetTypeFieldValues: assetTypeFieldValuesAdapter.initialize,
|
|
3048
|
+
addAssetTypeFieldValues: assetTypeFieldValuesAdapter.addOne,
|
|
3049
|
+
addAssetTypeFieldValuesMany: assetTypeFieldValuesAdapter.addMany,
|
|
3050
|
+
setAssetTypeFieldValues: assetTypeFieldValuesAdapter.setOne,
|
|
3051
|
+
setAssetTypeFieldValuesMany: assetTypeFieldValuesAdapter.setMany,
|
|
3052
|
+
updateAssetTypeFieldValues: assetTypeFieldValuesAdapter.updateOne,
|
|
3053
|
+
updateAssetTypeFieldValuesMany: assetTypeFieldValuesAdapter.updateMany,
|
|
3054
|
+
deleteAssetTypeFieldValues: assetTypeFieldValuesAdapter.deleteOne,
|
|
3055
|
+
deleteAssetTypeFieldValuesMany: assetTypeFieldValuesAdapter.deleteMany
|
|
3056
|
+
}
|
|
3057
|
+
});
|
|
3058
|
+
const {
|
|
3059
|
+
initializeAssetTypeFieldValues,
|
|
3060
|
+
addAssetTypeFieldValues,
|
|
3061
|
+
addAssetTypeFieldValuesMany,
|
|
3062
|
+
setAssetTypeFieldValues,
|
|
3063
|
+
setAssetTypeFieldValuesMany,
|
|
3064
|
+
updateAssetTypeFieldValues,
|
|
3065
|
+
updateAssetTypeFieldValuesMany,
|
|
3066
|
+
deleteAssetTypeFieldValues,
|
|
3067
|
+
deleteAssetTypeFieldValuesMany
|
|
3068
|
+
} = assetTypeFieldValuesSlice.actions;
|
|
3069
|
+
const selectAssetTypeFieldValuesMapping = (state) => state.assetTypeFieldValuesReducer.instances;
|
|
3070
|
+
const selectAssetTypeFieldValues = toolkit.createSelector([selectAssetTypeFieldValuesMapping], (fieldValuesMapping) => {
|
|
3071
|
+
return Object.values(fieldValuesMapping);
|
|
3072
|
+
});
|
|
3073
|
+
const selectAssetTypeFieldValuesOfAsset = restructureCreateSelectorWithArgs(
|
|
3074
|
+
toolkit.createSelector([selectAssetTypeFieldValues, (_state, assetId) => assetId], (fieldValues, assetId) => {
|
|
3075
|
+
return fallbackToEmptyArray(fieldValues.filter((fieldValue) => fieldValue.asset === assetId));
|
|
3076
|
+
})
|
|
3077
|
+
);
|
|
3078
|
+
const selectAssetTypeValuesOfAssetType = restructureCreateSelectorWithArgs(
|
|
3079
|
+
toolkit.createSelector(
|
|
3080
|
+
[selectAssetTypeFields, selectAssetTypeFieldValues, (_state, id) => id],
|
|
3081
|
+
(fields, fieldValues, id) => {
|
|
3082
|
+
const fieldsIds = new Set(
|
|
3083
|
+
fields.filter((field) => field.asset_type === id).map((field) => field.offline_id)
|
|
3084
|
+
);
|
|
3085
|
+
return fallbackToEmptyArray(fieldValues.filter((values) => fieldsIds.has(values.fields_revision)));
|
|
3086
|
+
}
|
|
3087
|
+
)
|
|
3088
|
+
);
|
|
3089
|
+
const selectAssetTypeFieldValuesById = (fieldValuesId) => (state) => {
|
|
3090
|
+
return state.assetTypeFieldValuesReducer.instances[fieldValuesId];
|
|
3091
|
+
};
|
|
3092
|
+
const assetTypeFieldValuesReducer = assetTypeFieldValuesSlice.reducer;
|
|
3093
|
+
const assetTypeFieldsAttachmentAdapter = createModelAdapter(
|
|
3094
|
+
(attachment) => attachment.offline_id
|
|
3095
|
+
);
|
|
3096
|
+
const initialState$1 = assetTypeFieldsAttachmentAdapter.getInitialState({});
|
|
3097
|
+
const assetTypeFieldsAttachmentSlice = toolkit.createSlice({
|
|
3098
|
+
name: "assetTypeFieldsAttachments",
|
|
3099
|
+
initialState: initialState$1,
|
|
3100
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$1)),
|
|
3101
|
+
reducers: {
|
|
3102
|
+
initializeAssetTypeFieldsAttachments: assetTypeFieldsAttachmentAdapter.initialize,
|
|
3103
|
+
addAssetTypeFieldsAttachment: assetTypeFieldsAttachmentAdapter.addOne,
|
|
3104
|
+
addAssetTypeFieldsAttachments: assetTypeFieldsAttachmentAdapter.addMany,
|
|
3105
|
+
setAssetTypeFieldsAttachment: assetTypeFieldsAttachmentAdapter.setOne,
|
|
3106
|
+
setAssetTypeFieldsAttachments: assetTypeFieldsAttachmentAdapter.setMany,
|
|
3107
|
+
updateAssetTypeFieldsAttachment: assetTypeFieldsAttachmentAdapter.updateOne,
|
|
3108
|
+
updateAssetTypeFieldsAttachments: assetTypeFieldsAttachmentAdapter.updateMany,
|
|
3109
|
+
deleteAssetTypeFieldsAttachment: assetTypeFieldsAttachmentAdapter.deleteOne,
|
|
3110
|
+
deleteAssetTypeFieldsAttachments: assetTypeFieldsAttachmentAdapter.deleteMany
|
|
3111
|
+
}
|
|
3112
|
+
});
|
|
3113
|
+
const {
|
|
3114
|
+
initializeAssetTypeFieldsAttachments,
|
|
3115
|
+
addAssetTypeFieldsAttachment,
|
|
3116
|
+
addAssetTypeFieldsAttachments,
|
|
3117
|
+
setAssetTypeFieldsAttachment,
|
|
3118
|
+
setAssetTypeFieldsAttachments,
|
|
3119
|
+
updateAssetTypeFieldsAttachment,
|
|
3120
|
+
updateAssetTypeFieldsAttachments,
|
|
3121
|
+
deleteAssetTypeFieldsAttachment,
|
|
3122
|
+
deleteAssetTypeFieldsAttachments
|
|
3123
|
+
} = assetTypeFieldsAttachmentSlice.actions;
|
|
3124
|
+
const selectAssetTypeFieldsAttachmentsMapping = (state) => state.assetTypeFieldsAttachmentReducer.instances;
|
|
3125
|
+
const selectAssetTypeFieldsAttachments = toolkit.createSelector(
|
|
3126
|
+
[selectAssetTypeFieldsAttachmentsMapping],
|
|
3127
|
+
(attachmentsMapping) => {
|
|
3128
|
+
return Object.values(attachmentsMapping);
|
|
3129
|
+
}
|
|
3130
|
+
);
|
|
3131
|
+
const selectAttachmentsOfAssetTypeFields = restructureCreateSelectorWithArgs(
|
|
3132
|
+
toolkit.createSelector([selectAssetTypeFieldsAttachments, (_state, id) => id], (attachments, id) => {
|
|
3133
|
+
return fallbackToEmptyArray(attachments.filter((attachment) => attachment.fields_revision === id));
|
|
3134
|
+
})
|
|
3135
|
+
);
|
|
3136
|
+
const selectAssetTypeFieldsAttachmentById = (attachmentId) => (state) => {
|
|
3137
|
+
return state.assetTypeFieldsAttachmentReducer.instances[attachmentId];
|
|
3138
|
+
};
|
|
3139
|
+
const assetTypeFieldsAttachmentReducer = assetTypeFieldsAttachmentSlice.reducer;
|
|
3140
|
+
const assetTypeFieldValuesAttachmentAdapter = createModelAdapter(
|
|
3141
|
+
(attachment) => attachment.offline_id
|
|
3142
|
+
);
|
|
3143
|
+
const initialState = assetTypeFieldValuesAttachmentAdapter.getInitialState({});
|
|
3144
|
+
const assetTypeFieldValuesAttachmentSlice = toolkit.createSlice({
|
|
3145
|
+
name: "assetTypeFieldValuesAttachments",
|
|
3146
|
+
initialState,
|
|
3147
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState)),
|
|
3148
|
+
reducers: {
|
|
3149
|
+
initializeAssetTypeFieldValuesAttachments: assetTypeFieldValuesAttachmentAdapter.initialize,
|
|
3150
|
+
addAssetTypeFieldValuesAttachment: assetTypeFieldValuesAttachmentAdapter.addOne,
|
|
3151
|
+
addAssetTypeFieldValuesAttachments: assetTypeFieldValuesAttachmentAdapter.addMany,
|
|
3152
|
+
setAssetTypeFieldValuesAttachment: assetTypeFieldValuesAttachmentAdapter.setOne,
|
|
3153
|
+
setAssetTypeFieldValuesAttachments: assetTypeFieldValuesAttachmentAdapter.setMany,
|
|
3154
|
+
updateAssetTypeFieldValuesAttachment: assetTypeFieldValuesAttachmentAdapter.updateOne,
|
|
3155
|
+
updateAssetTypeFieldValuesAttachments: assetTypeFieldValuesAttachmentAdapter.updateMany,
|
|
3156
|
+
deleteAssetTypeFieldValuesAttachment: assetTypeFieldValuesAttachmentAdapter.deleteOne,
|
|
3157
|
+
deleteAssetTypeFieldValuesAttachments: assetTypeFieldValuesAttachmentAdapter.deleteMany
|
|
3158
|
+
}
|
|
3159
|
+
});
|
|
3160
|
+
const {
|
|
3161
|
+
initializeAssetTypeFieldValuesAttachments,
|
|
3162
|
+
addAssetTypeFieldValuesAttachment,
|
|
3163
|
+
addAssetTypeFieldValuesAttachments,
|
|
3164
|
+
setAssetTypeFieldValuesAttachment,
|
|
3165
|
+
setAssetTypeFieldValuesAttachments,
|
|
3166
|
+
updateAssetTypeFieldValuesAttachment,
|
|
3167
|
+
updateAssetTypeFieldValuesAttachments,
|
|
3168
|
+
deleteAssetTypeFieldValuesAttachment,
|
|
3169
|
+
deleteAssetTypeFieldValuesAttachments
|
|
3170
|
+
} = assetTypeFieldValuesAttachmentSlice.actions;
|
|
3171
|
+
const selectAssetTypeFieldValuesAttachmentsMapping = (state) => state.assetTypeFieldValuesAttachmentReducer.instances;
|
|
3172
|
+
const selectAssetTypeFieldValuesAttachments = toolkit.createSelector(
|
|
3173
|
+
[selectAssetTypeFieldValuesAttachmentsMapping],
|
|
3174
|
+
(attachmentsMapping) => {
|
|
3175
|
+
return Object.values(attachmentsMapping);
|
|
3176
|
+
}
|
|
3177
|
+
);
|
|
3178
|
+
const selectAssetTypeFieldValuesAttachmentById = (attachmentId) => (state) => {
|
|
3179
|
+
return state.assetTypeFieldValuesAttachmentReducer.instances[attachmentId];
|
|
3180
|
+
};
|
|
3181
|
+
const selectAssetTypeFieldValuesAttachmentsByIds = restructureCreateSelectorWithArgs(
|
|
3182
|
+
toolkit.createSelector(
|
|
3183
|
+
[selectAssetTypeFieldValuesAttachmentsMapping, (_, attachmentIds) => attachmentIds],
|
|
3184
|
+
(mapping, attachmentIds) => {
|
|
3185
|
+
const attachmentIdsSet = new Set(attachmentIds);
|
|
3186
|
+
return fallbackToEmptyArray(
|
|
3187
|
+
Object.values(mapping).filter((attachment) => attachmentIdsSet.has(attachment.offline_id))
|
|
3188
|
+
);
|
|
3189
|
+
}
|
|
3190
|
+
)
|
|
3191
|
+
);
|
|
3192
|
+
const selectAttachmentsOfAssetTypeFieldValues = restructureCreateSelectorWithArgs(
|
|
3193
|
+
toolkit.createSelector([selectAssetTypeFieldValuesAttachments, (_state, id) => id], (attachments, id) => {
|
|
3194
|
+
return fallbackToEmptyArray(attachments.filter((attachment) => attachment.field_values === id));
|
|
3195
|
+
})
|
|
3196
|
+
);
|
|
3197
|
+
const assetTypeFieldValuesAttachmentReducer = assetTypeFieldValuesAttachmentSlice.reducer;
|
|
3198
|
+
let clientStore;
|
|
3199
|
+
function setClientStore(store) {
|
|
3200
|
+
clientStore = store;
|
|
3201
|
+
}
|
|
3202
|
+
function getClientStore() {
|
|
3203
|
+
return clientStore;
|
|
3204
|
+
}
|
|
3205
|
+
let clientSDK;
|
|
3206
|
+
function setClientSDK(sdkCtor) {
|
|
3207
|
+
clientSDK = sdkCtor;
|
|
3208
|
+
}
|
|
3209
|
+
function getClientSDK() {
|
|
3210
|
+
return clientSDK;
|
|
3211
|
+
}
|
|
3212
|
+
const CLASS_NAME_TO_SERVICE = {};
|
|
3213
|
+
class BaseService {
|
|
3214
|
+
constructor(sdk) {
|
|
3215
|
+
__publicField(this, "client");
|
|
3216
|
+
CLASS_NAME_TO_SERVICE[this.constructor.name] = this;
|
|
3217
|
+
this.client = sdk;
|
|
3218
|
+
}
|
|
3219
|
+
async enqueueRequest(requestDetails) {
|
|
3220
|
+
return this.client.enqueueRequest(requestDetails, this.host, this.constructor.name);
|
|
3221
|
+
}
|
|
3222
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3223
|
+
dispatch(action) {
|
|
3224
|
+
this.client.store.dispatch(action);
|
|
3225
|
+
}
|
|
3226
|
+
}
|
|
3227
|
+
const VERSION_REDUCER_KEY = "versioning";
|
|
3228
|
+
const overmapReducers = {
|
|
2983
3229
|
// TODO: attachmentReducer,
|
|
2984
3230
|
[VERSION_REDUCER_KEY]: versioningReducer,
|
|
2985
3231
|
fileReducer,
|
|
@@ -3018,7 +3264,15 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
3018
3264
|
issueCommentReducer,
|
|
3019
3265
|
issueUpdateReducer,
|
|
3020
3266
|
geoImageReducer,
|
|
3021
|
-
issueAssociationReducer
|
|
3267
|
+
issueAssociationReducer,
|
|
3268
|
+
issueTypeFieldsReducer,
|
|
3269
|
+
issueTypeFieldValuesReducer,
|
|
3270
|
+
issueTypeFieldsAttachmentReducer,
|
|
3271
|
+
issueTypeFieldValuesAttachmentReducer,
|
|
3272
|
+
assetTypeFieldsReducer,
|
|
3273
|
+
assetTypeFieldValuesReducer,
|
|
3274
|
+
assetTypeFieldsAttachmentReducer,
|
|
3275
|
+
assetTypeFieldValuesAttachmentReducer
|
|
3022
3276
|
};
|
|
3023
3277
|
const overmapReducer = toolkit.combineReducers(overmapReducers);
|
|
3024
3278
|
const resetStore = "RESET";
|
|
@@ -3619,9 +3873,6 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
3619
3873
|
description: "Create Category",
|
|
3620
3874
|
method: HttpMethod.POST,
|
|
3621
3875
|
url: "/categories/",
|
|
3622
|
-
queryParams: {
|
|
3623
|
-
workspace_id: payload.workspace.toString()
|
|
3624
|
-
},
|
|
3625
3876
|
payload: offlineCategory,
|
|
3626
3877
|
blockers: [payload.workspace],
|
|
3627
3878
|
blocks: [offlineCategory.offline_id]
|
|
@@ -3704,15 +3955,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
3704
3955
|
description: "Create asset",
|
|
3705
3956
|
method: HttpMethod.POST,
|
|
3706
3957
|
url: "/assets/",
|
|
3707
|
-
payload:
|
|
3708
|
-
offline_id: offlineAsset.offline_id,
|
|
3709
|
-
submitted_at: offlineAsset.submitted_at,
|
|
3710
|
-
geo_marker: offlineAsset.geo_marker,
|
|
3711
|
-
canvas_marker: offlineAsset.canvas_marker,
|
|
3712
|
-
label: offlineAsset.label,
|
|
3713
|
-
description: offlineAsset.description,
|
|
3714
|
-
asset_type: offlineAsset.asset_type
|
|
3715
|
-
},
|
|
3958
|
+
payload: offlineAsset,
|
|
3716
3959
|
blockers: [offlineAsset.asset_type],
|
|
3717
3960
|
blocks: [offlineAsset.offline_id]
|
|
3718
3961
|
});
|
|
@@ -3787,7 +4030,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
3787
4030
|
throw e;
|
|
3788
4031
|
});
|
|
3789
4032
|
}
|
|
3790
|
-
bulkAdd(payloads, assetTypeId, batchSize) {
|
|
4033
|
+
bulkAdd(payloads, assetTypeId, projectId, batchSize) {
|
|
3791
4034
|
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
3792
4035
|
const transactionId = uuid.v4();
|
|
3793
4036
|
const assetBatches = chunkArray(payloads, batchSize).map((assetBatch) => {
|
|
@@ -3798,6 +4041,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
3798
4041
|
transaction_id: transactionId,
|
|
3799
4042
|
submitted_at: submittedAt,
|
|
3800
4043
|
asset_type: assetTypeId,
|
|
4044
|
+
project: projectId,
|
|
3801
4045
|
assets: assetPayloads
|
|
3802
4046
|
}
|
|
3803
4047
|
};
|
|
@@ -3832,7 +4076,10 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
3832
4076
|
const result = await this.enqueueRequest({
|
|
3833
4077
|
description: "Get assets",
|
|
3834
4078
|
method: HttpMethod.GET,
|
|
3835
|
-
url:
|
|
4079
|
+
url: "/assets/",
|
|
4080
|
+
queryParams: {
|
|
4081
|
+
project: projectId.toString()
|
|
4082
|
+
},
|
|
3836
4083
|
blockers: [],
|
|
3837
4084
|
blocks: []
|
|
3838
4085
|
});
|
|
@@ -3853,7 +4100,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
3853
4100
|
const promise = this.enqueueRequest({
|
|
3854
4101
|
description: "Add asset stage completion",
|
|
3855
4102
|
method: HttpMethod.POST,
|
|
3856
|
-
url: "/
|
|
4103
|
+
url: "/asset-stage-completions/",
|
|
3857
4104
|
payload: {
|
|
3858
4105
|
offline_id: offlineStageCompletion.offline_id,
|
|
3859
4106
|
submitted_at: submittedAt,
|
|
@@ -3880,7 +4127,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
3880
4127
|
const promise = this.enqueueRequest({
|
|
3881
4128
|
description: "Delete asset stage completion",
|
|
3882
4129
|
method: HttpMethod.DELETE,
|
|
3883
|
-
url: `/
|
|
4130
|
+
url: `/asset-stage-completions/${id}/`,
|
|
3884
4131
|
blockers: [id],
|
|
3885
4132
|
blocks: []
|
|
3886
4133
|
});
|
|
@@ -3906,7 +4153,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
3906
4153
|
const promise = this.enqueueRequest({
|
|
3907
4154
|
description: "Bulk create asset stage completions",
|
|
3908
4155
|
method: HttpMethod.POST,
|
|
3909
|
-
url: "/
|
|
4156
|
+
url: "/asset-stage-completions/bulk/",
|
|
3910
4157
|
payload: {
|
|
3911
4158
|
submitted_at: submittedAt,
|
|
3912
4159
|
completions: payload
|
|
@@ -3928,7 +4175,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
3928
4175
|
const promise = this.enqueueRequest({
|
|
3929
4176
|
description: "Deleting asset stage completions",
|
|
3930
4177
|
method: HttpMethod.DELETE,
|
|
3931
|
-
url: "/
|
|
4178
|
+
url: "/asset-stage-completions/bulk/",
|
|
3932
4179
|
payload: {
|
|
3933
4180
|
completion_ids: ids
|
|
3934
4181
|
},
|
|
@@ -3944,7 +4191,10 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
3944
4191
|
const result = await this.enqueueRequest({
|
|
3945
4192
|
description: "Get asset stage completions",
|
|
3946
4193
|
method: HttpMethod.GET,
|
|
3947
|
-
url:
|
|
4194
|
+
url: "/asset-stage-completions/",
|
|
4195
|
+
queryParams: {
|
|
4196
|
+
project: projectId.toString()
|
|
4197
|
+
},
|
|
3948
4198
|
blockers: [],
|
|
3949
4199
|
blocks: []
|
|
3950
4200
|
});
|
|
@@ -3965,7 +4215,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
3965
4215
|
const promise = this.enqueueRequest({
|
|
3966
4216
|
description: "Add asset stages",
|
|
3967
4217
|
method: HttpMethod.POST,
|
|
3968
|
-
url: "/
|
|
4218
|
+
url: "/asset-stages/bulk/",
|
|
3969
4219
|
payload: {
|
|
3970
4220
|
submitted_at: submittedAt,
|
|
3971
4221
|
asset_type: assetTypeId,
|
|
@@ -3989,7 +4239,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
3989
4239
|
return this.enqueueRequest({
|
|
3990
4240
|
description: "Edit asset stages",
|
|
3991
4241
|
method: HttpMethod.PATCH,
|
|
3992
|
-
url: `/
|
|
4242
|
+
url: `/asset-types/${assetTypeId}/bulk-update-stages/`,
|
|
3993
4243
|
payload: {
|
|
3994
4244
|
stages: stagesToUpdate
|
|
3995
4245
|
},
|
|
@@ -4007,7 +4257,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
4007
4257
|
const promise = this.enqueueRequest({
|
|
4008
4258
|
description: "Delete asset stages",
|
|
4009
4259
|
method: HttpMethod.DELETE,
|
|
4010
|
-
url: "/
|
|
4260
|
+
url: "/asset-stages/bulk/",
|
|
4011
4261
|
payload: {
|
|
4012
4262
|
stage_ids: idsToDelete
|
|
4013
4263
|
},
|
|
@@ -4031,7 +4281,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
4031
4281
|
const promise = this.enqueueRequest({
|
|
4032
4282
|
description: "Update asset stage",
|
|
4033
4283
|
method: HttpMethod.PATCH,
|
|
4034
|
-
url: `/
|
|
4284
|
+
url: `/asset-stages/${assetStage.offline_id}/`,
|
|
4035
4285
|
payload: {
|
|
4036
4286
|
name: payload.name,
|
|
4037
4287
|
description: payload.description,
|
|
@@ -4048,52 +4298,14 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
4048
4298
|
});
|
|
4049
4299
|
return [updatedAssetStage, promise];
|
|
4050
4300
|
}
|
|
4051
|
-
async
|
|
4052
|
-
const { store } = this.client;
|
|
4053
|
-
const stage = store.getState().assetStageReducer.instances[stageId];
|
|
4054
|
-
if (!stage) {
|
|
4055
|
-
throw new Error(`No asset stage with id ${stageId} found in the store`);
|
|
4056
|
-
}
|
|
4057
|
-
this.dispatch(updateAssetStage({ ...stage, form: formId }));
|
|
4058
|
-
try {
|
|
4059
|
-
await this.enqueueRequest({
|
|
4060
|
-
description: "Link asset stage to form",
|
|
4061
|
-
method: HttpMethod.POST,
|
|
4062
|
-
url: `/assets/stages/${stageId}/associate-with-form/`,
|
|
4063
|
-
payload: { form: formId },
|
|
4064
|
-
blockers: [stageId, formId],
|
|
4065
|
-
blocks: [stageId]
|
|
4066
|
-
});
|
|
4067
|
-
} catch (e) {
|
|
4068
|
-
this.dispatch(setAssetStage(stage));
|
|
4069
|
-
throw e;
|
|
4070
|
-
}
|
|
4071
|
-
}
|
|
4072
|
-
async unlinkForm(stageId, formId) {
|
|
4073
|
-
const { store } = this.client;
|
|
4074
|
-
const stage = store.getState().assetStageReducer.instances[stageId];
|
|
4075
|
-
if (!stage) {
|
|
4076
|
-
throw new Error(`No asset stage with id ${stageId} found in the store`);
|
|
4077
|
-
}
|
|
4078
|
-
this.dispatch(updateAssetStage({ ...stage, form: void 0 }));
|
|
4079
|
-
try {
|
|
4080
|
-
await this.enqueueRequest({
|
|
4081
|
-
description: "Unlink asset stage from form",
|
|
4082
|
-
method: HttpMethod.DELETE,
|
|
4083
|
-
url: `/assets/stages/${stageId}/associate-with-form/`,
|
|
4084
|
-
blockers: [stageId, formId],
|
|
4085
|
-
blocks: [stageId]
|
|
4086
|
-
});
|
|
4087
|
-
} catch (e) {
|
|
4088
|
-
this.dispatch(setAssetStage(stage));
|
|
4089
|
-
throw e;
|
|
4090
|
-
}
|
|
4091
|
-
}
|
|
4092
|
-
async refreshStore(projectId) {
|
|
4301
|
+
async refreshStore(organizationId) {
|
|
4093
4302
|
const result = await this.enqueueRequest({
|
|
4094
4303
|
description: "Get asset stages",
|
|
4095
4304
|
method: HttpMethod.GET,
|
|
4096
|
-
url:
|
|
4305
|
+
url: "/asset-stages/",
|
|
4306
|
+
queryParams: {
|
|
4307
|
+
organization: organizationId.toString()
|
|
4308
|
+
},
|
|
4097
4309
|
blockers: [],
|
|
4098
4310
|
blocks: []
|
|
4099
4311
|
});
|
|
@@ -4110,7 +4322,12 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
4110
4322
|
projectAttachmentReducer: projectAttachmentReducer2,
|
|
4111
4323
|
formRevisionAttachmentReducer: formRevisionAttachmentReducer2,
|
|
4112
4324
|
formSubmissionAttachmentReducer: formSubmissionAttachmentReducer2,
|
|
4113
|
-
geoImageReducer: geoImageReducer2
|
|
4325
|
+
geoImageReducer: geoImageReducer2,
|
|
4326
|
+
// fields
|
|
4327
|
+
assetTypeFieldsAttachmentReducer: assetTypeFieldsAttachmentReducer2,
|
|
4328
|
+
assetTypeFieldValuesAttachmentReducer: assetTypeFieldValuesAttachmentReducer2,
|
|
4329
|
+
issueTypeFieldsAttachmentReducer: issueTypeFieldsAttachmentReducer2,
|
|
4330
|
+
issueTypeFieldValuesAttachmentReducer: issueTypeFieldValuesAttachmentReducer2
|
|
4114
4331
|
} = this.client.store.getState();
|
|
4115
4332
|
const objectsWithSha1 = [].concat(
|
|
4116
4333
|
Object.values(issueAttachmentReducer2.instances),
|
|
@@ -4120,7 +4337,11 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
4120
4337
|
Object.values(projectAttachmentReducer2.instances),
|
|
4121
4338
|
Object.values(formRevisionAttachmentReducer2.instances),
|
|
4122
4339
|
Object.values(formSubmissionAttachmentReducer2.instances),
|
|
4123
|
-
Object.values(geoImageReducer2.instances)
|
|
4340
|
+
Object.values(geoImageReducer2.instances),
|
|
4341
|
+
Object.values(assetTypeFieldsAttachmentReducer2.instances),
|
|
4342
|
+
Object.values(assetTypeFieldValuesAttachmentReducer2.instances),
|
|
4343
|
+
Object.values(issueTypeFieldsAttachmentReducer2.instances),
|
|
4344
|
+
Object.values(issueTypeFieldValuesAttachmentReducer2.instances)
|
|
4124
4345
|
);
|
|
4125
4346
|
return objectsWithSha1.filter((object) => object.file_sha1 === sha1).length;
|
|
4126
4347
|
}
|
|
@@ -4142,41 +4363,20 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
4142
4363
|
}
|
|
4143
4364
|
return promisesBySha1;
|
|
4144
4365
|
}
|
|
4145
|
-
|
|
4146
|
-
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
attachUrlPrefix: "/assets",
|
|
4156
|
-
deleteUrlPrefix: "/assets",
|
|
4157
|
-
fetchUrlPostfix: "/asset-attachments"
|
|
4158
|
-
},
|
|
4159
|
-
[AttachmentModel.AssetType]: {
|
|
4160
|
-
name: "asset type",
|
|
4161
|
-
attachUrlPrefix: "/assets/types",
|
|
4162
|
-
deleteUrlPrefix: "/assets/types",
|
|
4163
|
-
fetchUrlPostfix: "/asset-type-attachments"
|
|
4164
|
-
},
|
|
4165
|
-
[AttachmentModel.Project]: {
|
|
4166
|
-
name: "project",
|
|
4167
|
-
attachUrlPrefix: "/projects",
|
|
4168
|
-
deleteUrlPrefix: "/projects",
|
|
4169
|
-
fetchUrlPostfix: "/attachments"
|
|
4170
|
-
},
|
|
4171
|
-
[AttachmentModel.Document]: {
|
|
4172
|
-
name: "document",
|
|
4173
|
-
attachUrlPrefix: "/documents",
|
|
4174
|
-
deleteUrlPrefix: "/documents",
|
|
4175
|
-
fetchUrlPostfix: "/document-attachments"
|
|
4366
|
+
async getFilePayload(file) {
|
|
4367
|
+
const sha1 = await hashFile(file);
|
|
4368
|
+
const filePayload = {
|
|
4369
|
+
sha1,
|
|
4370
|
+
file_type: file.type,
|
|
4371
|
+
extension: file.name.split(".").pop(),
|
|
4372
|
+
size: file.size
|
|
4373
|
+
};
|
|
4374
|
+
await this.client.files.addCache(file, sha1);
|
|
4375
|
+
return filePayload;
|
|
4176
4376
|
}
|
|
4177
|
-
}
|
|
4377
|
+
}
|
|
4178
4378
|
class BaseAttachmentService extends BaseUploadService {
|
|
4179
|
-
async
|
|
4379
|
+
async _bulkAdd(payloads) {
|
|
4180
4380
|
var _a2;
|
|
4181
4381
|
const { store } = this.client;
|
|
4182
4382
|
const createdBy = (_a2 = store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
@@ -4184,39 +4384,35 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
4184
4384
|
const offlineAttachments = [];
|
|
4185
4385
|
const attachmentPayloads = [];
|
|
4186
4386
|
const filePayloads = {};
|
|
4187
|
-
for (const
|
|
4188
|
-
const
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
file_type: file.type,
|
|
4193
|
-
extension: file.name.split(".").pop(),
|
|
4194
|
-
size: file.size
|
|
4195
|
-
};
|
|
4196
|
-
await this.client.files.addCache(file, sha1);
|
|
4197
|
-
}
|
|
4198
|
-
const offlineAttachment = buildOfflineAttachment({
|
|
4387
|
+
for (const payload of payloads) {
|
|
4388
|
+
const { modelId, file } = payload;
|
|
4389
|
+
const filePayload = await this.getFilePayload(file);
|
|
4390
|
+
if (!(filePayload.sha1 in filePayloads)) filePayloads[filePayload.sha1] = filePayload;
|
|
4391
|
+
const offlineAttachment = this.buildOfflineAttachment({
|
|
4199
4392
|
file,
|
|
4200
|
-
sha1,
|
|
4201
|
-
submittedAt,
|
|
4202
|
-
createdBy,
|
|
4393
|
+
file_sha1: filePayload.sha1,
|
|
4394
|
+
submitted_at: submittedAt,
|
|
4395
|
+
created_by: createdBy,
|
|
4203
4396
|
description: "",
|
|
4204
4397
|
modelId
|
|
4205
4398
|
});
|
|
4206
4399
|
offlineAttachments.push(offlineAttachment);
|
|
4207
|
-
attachmentPayloads.push(
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
|
|
4212
|
-
|
|
4400
|
+
attachmentPayloads.push(
|
|
4401
|
+
this.buildAttachmentPayload({
|
|
4402
|
+
offline_id: offlineAttachment.offline_id,
|
|
4403
|
+
file_name: offlineAttachment.file_name,
|
|
4404
|
+
file_sha1: offlineAttachment.file_sha1,
|
|
4405
|
+
file_extension: filePayload.extension,
|
|
4406
|
+
description: offlineAttachment.description,
|
|
4407
|
+
modelId
|
|
4408
|
+
})
|
|
4409
|
+
);
|
|
4213
4410
|
}
|
|
4214
4411
|
this.dispatch(this.addAttachments(offlineAttachments));
|
|
4215
|
-
const meta = AttachmentModelMeta[this.attachmentModel];
|
|
4216
4412
|
const promise = this.enqueueRequest({
|
|
4217
|
-
description: `
|
|
4413
|
+
description: `Add ${this.name}`,
|
|
4218
4414
|
method: HttpMethod.POST,
|
|
4219
|
-
url: `${
|
|
4415
|
+
url: `${this.url}/bulk/`,
|
|
4220
4416
|
payload: {
|
|
4221
4417
|
submitted_at: submittedAt,
|
|
4222
4418
|
attachments: attachmentPayloads,
|
|
@@ -4233,7 +4429,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
4233
4429
|
});
|
|
4234
4430
|
return [offlineAttachments, promise.then(({ attachments }) => attachments)];
|
|
4235
4431
|
}
|
|
4236
|
-
async
|
|
4432
|
+
async _delete(attachmendId) {
|
|
4237
4433
|
const { store } = this.client;
|
|
4238
4434
|
const attachment = this.selectAttachment(attachmendId)(store.getState());
|
|
4239
4435
|
if (!attachment) {
|
|
@@ -4242,11 +4438,10 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
4242
4438
|
);
|
|
4243
4439
|
}
|
|
4244
4440
|
this.dispatch(this.removeAttachment(attachment.offline_id));
|
|
4245
|
-
const meta = AttachmentModelMeta[this.attachmentModel];
|
|
4246
4441
|
const promise = this.enqueueRequest({
|
|
4247
|
-
description:
|
|
4442
|
+
description: `Delete ${this.name}`,
|
|
4248
4443
|
method: HttpMethod.DELETE,
|
|
4249
|
-
url: `${
|
|
4444
|
+
url: `${this.url}/${attachmendId}/`,
|
|
4250
4445
|
blockers: [attachmendId],
|
|
4251
4446
|
blocks: []
|
|
4252
4447
|
});
|
|
@@ -4259,24 +4454,12 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
4259
4454
|
});
|
|
4260
4455
|
return promise;
|
|
4261
4456
|
}
|
|
4262
|
-
// Note that currently the fetching of attachments for all models dependds on the active projectId. This may change in the future. And
|
|
4263
|
-
// so for some attachment model services, this method will have to be overridden.
|
|
4264
|
-
async refreshStore(projectId, _organizationId) {
|
|
4265
|
-
const meta = AttachmentModelMeta[this.attachmentModel];
|
|
4266
|
-
const result = await this.enqueueRequest({
|
|
4267
|
-
description: `Get ${meta.name} attachments`,
|
|
4268
|
-
method: HttpMethod.GET,
|
|
4269
|
-
url: `/projects/${projectId}${meta.fetchUrlPostfix}/`,
|
|
4270
|
-
blocks: [],
|
|
4271
|
-
blockers: []
|
|
4272
|
-
});
|
|
4273
|
-
this.dispatch(this.initializeAttachments(result));
|
|
4274
|
-
}
|
|
4275
4457
|
}
|
|
4276
4458
|
class AssetAttachmentService extends BaseAttachmentService {
|
|
4277
4459
|
constructor() {
|
|
4278
4460
|
super(...arguments);
|
|
4279
|
-
__publicField(this, "
|
|
4461
|
+
__publicField(this, "name", "Asset Attachment");
|
|
4462
|
+
__publicField(this, "url", "/asset-attachments");
|
|
4280
4463
|
__publicField(this, "initializeAttachments", initializeAssetAttachments);
|
|
4281
4464
|
__publicField(this, "addAttachments", addAssetAttachments);
|
|
4282
4465
|
__publicField(this, "updateAttachments", updateAssetAttachments);
|
|
@@ -4288,20 +4471,39 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
4288
4471
|
buildOfflineAttachment(data) {
|
|
4289
4472
|
return offline({
|
|
4290
4473
|
file: URL.createObjectURL(data.file),
|
|
4291
|
-
file_sha1: data.
|
|
4292
|
-
created_by: data.
|
|
4474
|
+
file_sha1: data.file_sha1,
|
|
4475
|
+
created_by: data.created_by,
|
|
4293
4476
|
file_name: data.file.name,
|
|
4294
4477
|
file_type: data.file.type,
|
|
4295
|
-
submitted_at: data.
|
|
4478
|
+
submitted_at: data.submitted_at,
|
|
4296
4479
|
description: data.description,
|
|
4297
4480
|
asset: data.modelId
|
|
4298
4481
|
});
|
|
4299
4482
|
}
|
|
4300
|
-
|
|
4301
|
-
return
|
|
4483
|
+
buildAttachmentPayload(data) {
|
|
4484
|
+
return {
|
|
4485
|
+
...data,
|
|
4486
|
+
asset: data.modelId
|
|
4487
|
+
};
|
|
4488
|
+
}
|
|
4489
|
+
async bulkAdd(payloads) {
|
|
4490
|
+
return this._bulkAdd(payloads.map((p) => ({ modelId: p.assetId, file: p.file })));
|
|
4491
|
+
}
|
|
4492
|
+
async delete(id) {
|
|
4493
|
+
return this._delete(id);
|
|
4302
4494
|
}
|
|
4303
|
-
async
|
|
4304
|
-
|
|
4495
|
+
async refreshStore(projectId) {
|
|
4496
|
+
const result = await this.enqueueRequest({
|
|
4497
|
+
description: "Get asset attachments",
|
|
4498
|
+
method: HttpMethod.GET,
|
|
4499
|
+
url: `${this.url}/`,
|
|
4500
|
+
queryParams: {
|
|
4501
|
+
project: projectId.toString()
|
|
4502
|
+
},
|
|
4503
|
+
blocks: [],
|
|
4504
|
+
blockers: []
|
|
4505
|
+
});
|
|
4506
|
+
this.dispatch(initializeAssetAttachments(result));
|
|
4305
4507
|
}
|
|
4306
4508
|
}
|
|
4307
4509
|
class AssetTypeService extends BaseApiService {
|
|
@@ -4318,8 +4520,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
4318
4520
|
const promise = this.enqueueRequest({
|
|
4319
4521
|
description: "Create asset type",
|
|
4320
4522
|
method: HttpMethod.POST,
|
|
4321
|
-
url:
|
|
4322
|
-
payload:
|
|
4523
|
+
url: "/asset-types/",
|
|
4524
|
+
payload: offlineAssetType,
|
|
4323
4525
|
blockers: [],
|
|
4324
4526
|
blocks: [offlineAssetType.offline_id]
|
|
4325
4527
|
});
|
|
@@ -4344,7 +4546,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
4344
4546
|
const promise = this.enqueueRequest({
|
|
4345
4547
|
description: "Update asset type",
|
|
4346
4548
|
method: HttpMethod.PATCH,
|
|
4347
|
-
url: `/
|
|
4549
|
+
url: `/asset-types/${payload.offline_id}/`,
|
|
4348
4550
|
payload: {
|
|
4349
4551
|
icon: payload.icon,
|
|
4350
4552
|
color: payload.color,
|
|
@@ -4378,7 +4580,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
4378
4580
|
return this.enqueueRequest({
|
|
4379
4581
|
description: "Delete asset type",
|
|
4380
4582
|
method: HttpMethod.DELETE,
|
|
4381
|
-
url: `/
|
|
4583
|
+
url: `/asset-types/${assetTypeId}/`,
|
|
4382
4584
|
blockers: [assetTypeId],
|
|
4383
4585
|
blocks: []
|
|
4384
4586
|
}).catch((e) => {
|
|
@@ -4389,11 +4591,14 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
4389
4591
|
throw e;
|
|
4390
4592
|
});
|
|
4391
4593
|
}
|
|
4392
|
-
async refreshStore(
|
|
4594
|
+
async refreshStore(organizationId) {
|
|
4393
4595
|
const result = await this.enqueueRequest({
|
|
4394
4596
|
description: "Get asset types",
|
|
4395
4597
|
method: HttpMethod.GET,
|
|
4396
|
-
url:
|
|
4598
|
+
url: "/asset-types/",
|
|
4599
|
+
queryParams: {
|
|
4600
|
+
organization: organizationId.toString()
|
|
4601
|
+
},
|
|
4397
4602
|
blockers: [],
|
|
4398
4603
|
blocks: []
|
|
4399
4604
|
});
|
|
@@ -4403,8 +4608,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
4403
4608
|
class AssetTypeAttachmentService extends BaseAttachmentService {
|
|
4404
4609
|
constructor() {
|
|
4405
4610
|
super(...arguments);
|
|
4406
|
-
__publicField(this, "
|
|
4407
|
-
__publicField(this, "
|
|
4611
|
+
__publicField(this, "name", "Asset Type Attachment");
|
|
4612
|
+
__publicField(this, "url", "/asset-type-attachments");
|
|
4408
4613
|
__publicField(this, "addAttachments", addAssetTypeAttachments);
|
|
4409
4614
|
__publicField(this, "updateAttachments", updateAssetTypeAttachments);
|
|
4410
4615
|
__publicField(this, "removeAttachments", deleteAssetTypeAttachments);
|
|
@@ -4415,20 +4620,39 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
4415
4620
|
buildOfflineAttachment(data) {
|
|
4416
4621
|
return offline({
|
|
4417
4622
|
file: URL.createObjectURL(data.file),
|
|
4418
|
-
file_sha1: data.
|
|
4419
|
-
created_by: data.
|
|
4623
|
+
file_sha1: data.file_sha1,
|
|
4624
|
+
created_by: data.created_by,
|
|
4420
4625
|
file_name: data.file.name,
|
|
4421
4626
|
file_type: data.file.type,
|
|
4422
|
-
submitted_at: data.
|
|
4627
|
+
submitted_at: data.submitted_at,
|
|
4423
4628
|
description: data.description,
|
|
4424
4629
|
asset_type: data.modelId
|
|
4425
4630
|
});
|
|
4426
4631
|
}
|
|
4427
|
-
|
|
4428
|
-
return
|
|
4632
|
+
buildAttachmentPayload(data) {
|
|
4633
|
+
return {
|
|
4634
|
+
...data,
|
|
4635
|
+
asset_type: data.modelId
|
|
4636
|
+
};
|
|
4637
|
+
}
|
|
4638
|
+
async bulkAdd(payloads) {
|
|
4639
|
+
return this._bulkAdd(payloads.map((p) => ({ modelId: p.assetTypeId, file: p.file })));
|
|
4429
4640
|
}
|
|
4430
|
-
async
|
|
4431
|
-
return this.
|
|
4641
|
+
async delete(attachmentId) {
|
|
4642
|
+
return this._delete(attachmentId);
|
|
4643
|
+
}
|
|
4644
|
+
async refreshStore(organizationId) {
|
|
4645
|
+
const result = await this.enqueueRequest({
|
|
4646
|
+
description: "Get asset type attachments",
|
|
4647
|
+
method: HttpMethod.GET,
|
|
4648
|
+
url: `${this.url}/`,
|
|
4649
|
+
queryParams: {
|
|
4650
|
+
organization: organizationId.toString()
|
|
4651
|
+
},
|
|
4652
|
+
blocks: [],
|
|
4653
|
+
blockers: []
|
|
4654
|
+
});
|
|
4655
|
+
this.dispatch(initializeAssetTypeAttachments(result));
|
|
4432
4656
|
}
|
|
4433
4657
|
}
|
|
4434
4658
|
class IssueCommentService extends BaseApiService {
|
|
@@ -4444,7 +4668,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
4444
4668
|
const promise = this.enqueueRequest({
|
|
4445
4669
|
description: "Add issue comment",
|
|
4446
4670
|
method: HttpMethod.POST,
|
|
4447
|
-
url:
|
|
4671
|
+
url: "/issue-comments/",
|
|
4448
4672
|
payload: offlineComment,
|
|
4449
4673
|
blockers: [payload.issue],
|
|
4450
4674
|
blocks: [offlineComment.offline_id]
|
|
@@ -4468,7 +4692,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
4468
4692
|
const promise = this.enqueueRequest({
|
|
4469
4693
|
description: "Edit issue comment",
|
|
4470
4694
|
method: HttpMethod.PATCH,
|
|
4471
|
-
url: `/
|
|
4695
|
+
url: `/issue-comments/${payload.offline_id}/`,
|
|
4472
4696
|
payload,
|
|
4473
4697
|
blockers: [payload.offline_id],
|
|
4474
4698
|
blocks: [payload.offline_id]
|
|
@@ -4487,7 +4711,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
4487
4711
|
const promise = this.enqueueRequest({
|
|
4488
4712
|
description: "Delete comment",
|
|
4489
4713
|
method: HttpMethod.DELETE,
|
|
4490
|
-
url: `/
|
|
4714
|
+
url: `/issue-comments/${id}/`,
|
|
4491
4715
|
blockers: [id],
|
|
4492
4716
|
blocks: []
|
|
4493
4717
|
});
|
|
@@ -4500,7 +4724,10 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
4500
4724
|
const result = await this.enqueueRequest({
|
|
4501
4725
|
description: "Get comments",
|
|
4502
4726
|
method: HttpMethod.GET,
|
|
4503
|
-
url:
|
|
4727
|
+
url: "/issue-comments/",
|
|
4728
|
+
queryParams: {
|
|
4729
|
+
project: projectId.toString()
|
|
4730
|
+
},
|
|
4504
4731
|
blockers: [],
|
|
4505
4732
|
blocks: []
|
|
4506
4733
|
});
|
|
@@ -4512,27 +4739,21 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
4512
4739
|
const result = await this.enqueueRequest({
|
|
4513
4740
|
description: "Get issue updates",
|
|
4514
4741
|
method: HttpMethod.GET,
|
|
4515
|
-
url:
|
|
4742
|
+
url: "/issue-updates/",
|
|
4743
|
+
queryParams: {
|
|
4744
|
+
project: projectId.toString()
|
|
4745
|
+
},
|
|
4516
4746
|
blockers: [],
|
|
4517
4747
|
blocks: []
|
|
4518
4748
|
});
|
|
4519
|
-
|
|
4520
|
-
filteredResult = filteredResult.map((comment) => {
|
|
4521
|
-
return { ...comment };
|
|
4522
|
-
});
|
|
4523
|
-
if (result.length !== filteredResult.length) {
|
|
4524
|
-
console.error(
|
|
4525
|
-
`Received duplicate comments from the API (new length ${filteredResult.length}); filtered in browser.`
|
|
4526
|
-
);
|
|
4527
|
-
}
|
|
4528
|
-
this.dispatch(initializeIssueUpdates(filteredResult));
|
|
4749
|
+
this.dispatch(initializeIssueUpdates(result));
|
|
4529
4750
|
}
|
|
4530
4751
|
}
|
|
4531
4752
|
class IssueAttachmentService extends BaseAttachmentService {
|
|
4532
4753
|
constructor() {
|
|
4533
4754
|
super(...arguments);
|
|
4534
|
-
__publicField(this, "
|
|
4535
|
-
__publicField(this, "
|
|
4755
|
+
__publicField(this, "name", "Issue Attachment");
|
|
4756
|
+
__publicField(this, "url", "/issue-attachments");
|
|
4536
4757
|
__publicField(this, "addAttachments", addIssueAttachments);
|
|
4537
4758
|
__publicField(this, "updateAttachments", updateIssueAttachments);
|
|
4538
4759
|
__publicField(this, "removeAttachments", deleteIssueAttachments);
|
|
@@ -4543,24 +4764,42 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
4543
4764
|
buildOfflineAttachment(data) {
|
|
4544
4765
|
return offline({
|
|
4545
4766
|
file: URL.createObjectURL(data.file),
|
|
4546
|
-
file_sha1: data.
|
|
4547
|
-
created_by: data.
|
|
4767
|
+
file_sha1: data.file_sha1,
|
|
4768
|
+
created_by: data.created_by,
|
|
4548
4769
|
file_name: data.file.name,
|
|
4549
4770
|
file_type: data.file.type,
|
|
4550
|
-
submitted_at: data.
|
|
4771
|
+
submitted_at: data.submitted_at,
|
|
4551
4772
|
description: data.description,
|
|
4552
4773
|
issue: data.modelId
|
|
4553
4774
|
});
|
|
4554
4775
|
}
|
|
4555
|
-
|
|
4556
|
-
return
|
|
4776
|
+
buildAttachmentPayload(data) {
|
|
4777
|
+
return {
|
|
4778
|
+
...data,
|
|
4779
|
+
issue: data.modelId
|
|
4780
|
+
};
|
|
4781
|
+
}
|
|
4782
|
+
async bulkAdd(payloads) {
|
|
4783
|
+
return this._bulkAdd(payloads.map((p) => ({ modelId: p.issueId, file: p.file })));
|
|
4557
4784
|
}
|
|
4558
|
-
async
|
|
4559
|
-
return this.
|
|
4785
|
+
async delete(id) {
|
|
4786
|
+
return this._delete(id);
|
|
4787
|
+
}
|
|
4788
|
+
async refreshStore(projectId) {
|
|
4789
|
+
const result = await this.enqueueRequest({
|
|
4790
|
+
description: "Get issue attachments",
|
|
4791
|
+
method: HttpMethod.GET,
|
|
4792
|
+
url: `${this.url}/`,
|
|
4793
|
+
queryParams: {
|
|
4794
|
+
project: projectId.toString()
|
|
4795
|
+
},
|
|
4796
|
+
blocks: [],
|
|
4797
|
+
blockers: []
|
|
4798
|
+
});
|
|
4799
|
+
this.dispatch(initializeIssueAttachments(result));
|
|
4560
4800
|
}
|
|
4561
4801
|
}
|
|
4562
4802
|
class IssueService extends BaseApiService {
|
|
4563
|
-
// Basic CRUD functions
|
|
4564
4803
|
add(payload) {
|
|
4565
4804
|
var _a2;
|
|
4566
4805
|
const { store } = this.client;
|
|
@@ -4577,10 +4816,6 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
4577
4816
|
description: "Create issue",
|
|
4578
4817
|
method: HttpMethod.POST,
|
|
4579
4818
|
url: "/issues/",
|
|
4580
|
-
queryParams: {
|
|
4581
|
-
workspace_id: payload.index_workspace,
|
|
4582
|
-
...payload.issue_type ? { issue_type: payload.issue_type } : {}
|
|
4583
|
-
},
|
|
4584
4819
|
payload: offlineIssue,
|
|
4585
4820
|
blockers: ["add-issue", ...offlineIssue.index_workspace ? [offlineIssue.index_workspace] : []],
|
|
4586
4821
|
blocks: [offlineIssue.offline_id]
|
|
@@ -4730,7 +4965,10 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
4730
4965
|
const result = await this.enqueueRequest({
|
|
4731
4966
|
description: "Get issues",
|
|
4732
4967
|
method: HttpMethod.GET,
|
|
4733
|
-
url:
|
|
4968
|
+
url: "/issues/",
|
|
4969
|
+
queryParams: {
|
|
4970
|
+
project: projectId.toString()
|
|
4971
|
+
},
|
|
4734
4972
|
blockers: [],
|
|
4735
4973
|
blocks: []
|
|
4736
4974
|
});
|
|
@@ -4750,16 +4988,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
4750
4988
|
this.dispatch(addIssueType(offlineIssueType));
|
|
4751
4989
|
const promise = this.enqueueRequest({
|
|
4752
4990
|
method: HttpMethod.POST,
|
|
4753
|
-
url:
|
|
4754
|
-
|
|
4755
|
-
payload: {
|
|
4756
|
-
offline_id: offlineIssueType.offline_id,
|
|
4757
|
-
submitted_at: offlineIssueType.submitted_at,
|
|
4758
|
-
icon: offlineIssueType.icon,
|
|
4759
|
-
color: offlineIssueType.color,
|
|
4760
|
-
name: offlineIssueType.name,
|
|
4761
|
-
description: offlineIssueType.description
|
|
4762
|
-
},
|
|
4991
|
+
url: "/issue-types/",
|
|
4992
|
+
payload: offlineIssueType,
|
|
4763
4993
|
blockers: [],
|
|
4764
4994
|
blocks: [offlineIssueType.offline_id]
|
|
4765
4995
|
});
|
|
@@ -4784,7 +5014,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
4784
5014
|
this.dispatch(updateIssueType(offlineUpdatedIssueType));
|
|
4785
5015
|
const promise = this.enqueueRequest({
|
|
4786
5016
|
method: HttpMethod.PATCH,
|
|
4787
|
-
url: `/
|
|
5017
|
+
url: `/issue-types/${payload.offline_id}/`,
|
|
4788
5018
|
payload,
|
|
4789
5019
|
blockers: [payload.offline_id],
|
|
4790
5020
|
blocks: [payload.offline_id]
|
|
@@ -4808,7 +5038,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
4808
5038
|
this.dispatch(deleteIssues(issuesOfIssueType.map((issue) => issue.offline_id)));
|
|
4809
5039
|
const promise = this.enqueueRequest({
|
|
4810
5040
|
method: HttpMethod.DELETE,
|
|
4811
|
-
url: `/
|
|
5041
|
+
url: `/issue-types/${id}/`,
|
|
4812
5042
|
blockers: [id],
|
|
4813
5043
|
blocks: []
|
|
4814
5044
|
});
|
|
@@ -4821,7 +5051,10 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
4821
5051
|
async refreshStore(organizationId) {
|
|
4822
5052
|
const result = await this.enqueueRequest({
|
|
4823
5053
|
method: HttpMethod.GET,
|
|
4824
|
-
url:
|
|
5054
|
+
url: "/issue-types/",
|
|
5055
|
+
queryParams: {
|
|
5056
|
+
organization: organizationId.toString()
|
|
5057
|
+
},
|
|
4825
5058
|
blockers: [],
|
|
4826
5059
|
blocks: []
|
|
4827
5060
|
});
|
|
@@ -4960,8 +5193,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
4960
5193
|
class ProjectAttachmentService extends BaseAttachmentService {
|
|
4961
5194
|
constructor() {
|
|
4962
5195
|
super(...arguments);
|
|
4963
|
-
__publicField(this, "
|
|
4964
|
-
__publicField(this, "
|
|
5196
|
+
__publicField(this, "name", "Project Attachment");
|
|
5197
|
+
__publicField(this, "url", "/project-attachments");
|
|
4965
5198
|
__publicField(this, "addAttachments", addProjectAttachments);
|
|
4966
5199
|
__publicField(this, "updateAttachments", updateProjectAttachments);
|
|
4967
5200
|
__publicField(this, "removeAttachments", deleteProjectAttachments);
|
|
@@ -4972,22 +5205,41 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
4972
5205
|
buildOfflineAttachment(data) {
|
|
4973
5206
|
return offline({
|
|
4974
5207
|
file: URL.createObjectURL(data.file),
|
|
4975
|
-
file_sha1: data.
|
|
4976
|
-
created_by: data.
|
|
5208
|
+
file_sha1: data.file_sha1,
|
|
5209
|
+
created_by: data.created_by,
|
|
4977
5210
|
file_name: data.file.name,
|
|
4978
5211
|
file_type: data.file.type,
|
|
4979
|
-
submitted_at: data.
|
|
5212
|
+
submitted_at: data.submitted_at,
|
|
4980
5213
|
description: data.description,
|
|
4981
5214
|
project: data.modelId
|
|
4982
5215
|
});
|
|
4983
5216
|
}
|
|
4984
|
-
|
|
4985
|
-
return
|
|
5217
|
+
buildAttachmentPayload(data) {
|
|
5218
|
+
return {
|
|
5219
|
+
...data,
|
|
5220
|
+
project: data.modelId
|
|
5221
|
+
};
|
|
4986
5222
|
}
|
|
4987
|
-
async
|
|
4988
|
-
return this.
|
|
5223
|
+
async bulkAdd(payloads) {
|
|
5224
|
+
return this._bulkAdd(payloads.map((p) => ({ modelId: p.projectId, file: p.file })));
|
|
4989
5225
|
}
|
|
4990
|
-
|
|
5226
|
+
async delete(attachmentId) {
|
|
5227
|
+
return this._delete(attachmentId);
|
|
5228
|
+
}
|
|
5229
|
+
async refreshStore(projectId) {
|
|
5230
|
+
const result = await this.enqueueRequest({
|
|
5231
|
+
description: "Get project attachments",
|
|
5232
|
+
method: HttpMethod.GET,
|
|
5233
|
+
url: `${this.url}/`,
|
|
5234
|
+
queryParams: {
|
|
5235
|
+
project: projectId.toString()
|
|
5236
|
+
},
|
|
5237
|
+
blockers: [],
|
|
5238
|
+
blocks: []
|
|
5239
|
+
});
|
|
5240
|
+
this.dispatch(initializeProjectAttachments(result));
|
|
5241
|
+
}
|
|
5242
|
+
}
|
|
4991
5243
|
class ProjectService extends BaseApiService {
|
|
4992
5244
|
async add(payload) {
|
|
4993
5245
|
if (!payload.bounds && !payload.canvas_bounds) {
|
|
@@ -5128,88 +5380,31 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
5128
5380
|
return { fields: newFields, images };
|
|
5129
5381
|
};
|
|
5130
5382
|
class FormService extends BaseUploadService {
|
|
5131
|
-
|
|
5383
|
+
add(payload, initialRevision) {
|
|
5132
5384
|
var _a2;
|
|
5385
|
+
const { store } = this.client;
|
|
5133
5386
|
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
5134
|
-
const createdBy = (_a2 =
|
|
5135
|
-
const
|
|
5136
|
-
|
|
5137
|
-
|
|
5138
|
-
|
|
5139
|
-
const sha1 = await hashFile(file);
|
|
5140
|
-
if (!(sha1 in filePayloads)) {
|
|
5141
|
-
filePayloads[sha1] = {
|
|
5142
|
-
sha1,
|
|
5143
|
-
file_type: file.type,
|
|
5144
|
-
extension: file.name.split(".").pop(),
|
|
5145
|
-
size: file.size
|
|
5146
|
-
};
|
|
5147
|
-
await this.client.files.addCache(file, sha1);
|
|
5148
|
-
}
|
|
5149
|
-
const offlineFormRevisionAttachment = offline({
|
|
5150
|
-
file: URL.createObjectURL(file),
|
|
5151
|
-
file_type: file.type,
|
|
5152
|
-
file_name: file.name,
|
|
5153
|
-
file_sha1: sha1,
|
|
5154
|
-
created_by: createdBy,
|
|
5155
|
-
revision: revisionId,
|
|
5156
|
-
submitted_at: submittedAt,
|
|
5157
|
-
field_identifier: fieldIdentifier
|
|
5158
|
-
});
|
|
5159
|
-
offlineFormRevisionAttachments.push(offlineFormRevisionAttachment);
|
|
5160
|
-
const attachmentPayload = {
|
|
5161
|
-
offline_id: offlineFormRevisionAttachment.offline_id,
|
|
5162
|
-
name: file.name,
|
|
5163
|
-
field_identifier: fieldIdentifier,
|
|
5164
|
-
sha1
|
|
5165
|
-
};
|
|
5166
|
-
attachmentPayloads.push(attachmentPayload);
|
|
5167
|
-
}
|
|
5168
|
-
this.dispatch(addFormRevisionAttachments(offlineFormRevisionAttachments));
|
|
5169
|
-
const promise = this.enqueueRequest({
|
|
5170
|
-
description: "Attach files to form revision",
|
|
5171
|
-
method: HttpMethod.POST,
|
|
5172
|
-
url: `/forms/revisions/${revisionId}/attachments/bulk/`,
|
|
5173
|
-
payload: {
|
|
5174
|
-
submitted_at: submittedAt,
|
|
5175
|
-
attachments: attachmentPayloads,
|
|
5176
|
-
files: Object.values(filePayloads)
|
|
5177
|
-
},
|
|
5178
|
-
blockers: [revisionId],
|
|
5179
|
-
blocks: offlineFormRevisionAttachments.map((attachment) => attachment.offline_id)
|
|
5180
|
-
});
|
|
5181
|
-
promise.then((result) => {
|
|
5182
|
-
this.processPresignedUrls(result.presigned_urls);
|
|
5183
|
-
this.dispatch(updateFormRevisionAttachments(result.attachments));
|
|
5184
|
-
}).catch(() => {
|
|
5185
|
-
this.dispatch(
|
|
5186
|
-
deleteFormRevisionAttachments(
|
|
5187
|
-
offlineFormRevisionAttachments.map((attachment) => attachment.offline_id)
|
|
5188
|
-
)
|
|
5189
|
-
);
|
|
5387
|
+
const createdBy = (_a2 = store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
5388
|
+
const offlineForm = offline({
|
|
5389
|
+
...payload,
|
|
5390
|
+
submitted_at: submittedAt,
|
|
5391
|
+
created_by: createdBy
|
|
5190
5392
|
});
|
|
5191
|
-
return [offlineFormRevisionAttachments, promise.then(({ attachments }) => attachments)];
|
|
5192
|
-
}
|
|
5193
|
-
async add(ownerId, form, initialRevision, urlPrefix) {
|
|
5194
|
-
const { fields, images } = await separateImageFromFields(initialRevision.fields);
|
|
5195
5393
|
const offlineFormRevision = offline({
|
|
5196
5394
|
...initialRevision,
|
|
5197
|
-
|
|
5198
|
-
|
|
5199
|
-
|
|
5200
|
-
|
|
5201
|
-
revision: "Pending"
|
|
5395
|
+
form: offlineForm.offline_id,
|
|
5396
|
+
revision: "Pending",
|
|
5397
|
+
submitted_at: submittedAt,
|
|
5398
|
+
created_by: createdBy
|
|
5202
5399
|
});
|
|
5203
|
-
this.dispatch(addForm(
|
|
5400
|
+
this.dispatch(addForm(offlineForm));
|
|
5204
5401
|
this.dispatch(addFormRevision(offlineFormRevision));
|
|
5205
5402
|
const formPromise = this.enqueueRequest({
|
|
5206
5403
|
description: "Create form",
|
|
5207
5404
|
method: HttpMethod.POST,
|
|
5208
|
-
url:
|
|
5405
|
+
url: "/forms/",
|
|
5209
5406
|
payload: {
|
|
5210
|
-
|
|
5211
|
-
offline_id: form.offline_id,
|
|
5212
|
-
submitted_at: form.submitted_at,
|
|
5407
|
+
...offlineForm,
|
|
5213
5408
|
initial_revision: {
|
|
5214
5409
|
offline_id: offlineFormRevision.offline_id,
|
|
5215
5410
|
submitted_at: offlineFormRevision.submitted_at,
|
|
@@ -5218,111 +5413,15 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
5218
5413
|
fields: offlineFormRevision.fields
|
|
5219
5414
|
}
|
|
5220
5415
|
},
|
|
5221
|
-
blockers: [
|
|
5222
|
-
blocks: [
|
|
5416
|
+
blockers: [],
|
|
5417
|
+
blocks: [offlineForm.offline_id, offlineFormRevision.offline_id]
|
|
5223
5418
|
});
|
|
5224
|
-
const [offlineFormRevisionAttachments, attachmentsPromise] = await this.bulkAddRevisionAttachments(
|
|
5225
|
-
offlineFormRevision.offline_id,
|
|
5226
|
-
images
|
|
5227
|
-
);
|
|
5228
5419
|
void formPromise.catch((e) => {
|
|
5229
|
-
this.dispatch(deleteForm(
|
|
5420
|
+
this.dispatch(deleteForm(offlineForm.offline_id));
|
|
5230
5421
|
this.dispatch(deleteFormRevision(offlineFormRevision.offline_id));
|
|
5231
5422
|
throw e;
|
|
5232
5423
|
});
|
|
5233
|
-
return [
|
|
5234
|
-
}
|
|
5235
|
-
addForOrganization(organizationId, initialRevision) {
|
|
5236
|
-
var _a2;
|
|
5237
|
-
const state = this.client.store.getState();
|
|
5238
|
-
const offlineForm = offline({
|
|
5239
|
-
favorite: false,
|
|
5240
|
-
created_by: (_a2 = state.userReducer.currentUser) == null ? void 0 : _a2.id,
|
|
5241
|
-
submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
5242
|
-
organization: organizationId
|
|
5243
|
-
});
|
|
5244
|
-
return this.add(
|
|
5245
|
-
organizationId.toString(),
|
|
5246
|
-
offlineForm,
|
|
5247
|
-
initialRevision,
|
|
5248
|
-
`/organizations/${organizationId}/create-form/`
|
|
5249
|
-
);
|
|
5250
|
-
}
|
|
5251
|
-
addForProject(projectId, initialRevision) {
|
|
5252
|
-
var _a2;
|
|
5253
|
-
const state = this.client.store.getState();
|
|
5254
|
-
const offlineForm = offline({
|
|
5255
|
-
favorite: false,
|
|
5256
|
-
created_by: (_a2 = state.userReducer.currentUser) == null ? void 0 : _a2.id,
|
|
5257
|
-
submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
5258
|
-
project: projectId
|
|
5259
|
-
});
|
|
5260
|
-
return this.add(projectId.toString(), offlineForm, initialRevision, `/projects/${projectId}/create-form/`);
|
|
5261
|
-
}
|
|
5262
|
-
addForIssueType(issueTypeId, initialRevision) {
|
|
5263
|
-
var _a2;
|
|
5264
|
-
const state = this.client.store.getState();
|
|
5265
|
-
const offlineForm = offline({
|
|
5266
|
-
favorite: false,
|
|
5267
|
-
created_by: (_a2 = state.userReducer.currentUser) == null ? void 0 : _a2.id,
|
|
5268
|
-
submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
5269
|
-
issue_type: issueTypeId
|
|
5270
|
-
});
|
|
5271
|
-
return this.add(issueTypeId, offlineForm, initialRevision, `/issues/types/${issueTypeId}/create-form/`);
|
|
5272
|
-
}
|
|
5273
|
-
addForAssetType(assetTypeId, initialRevision) {
|
|
5274
|
-
var _a2;
|
|
5275
|
-
const state = this.client.store.getState();
|
|
5276
|
-
const offlineForm = offline({
|
|
5277
|
-
favorite: false,
|
|
5278
|
-
created_by: (_a2 = state.userReducer.currentUser) == null ? void 0 : _a2.id,
|
|
5279
|
-
submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
5280
|
-
asset_type: assetTypeId
|
|
5281
|
-
});
|
|
5282
|
-
return this.add(assetTypeId, offlineForm, initialRevision, `/assets/types/${assetTypeId}/create-form/`);
|
|
5283
|
-
}
|
|
5284
|
-
async createRevision(formId, revision) {
|
|
5285
|
-
var _a2;
|
|
5286
|
-
const offlineRevision = offline(revision);
|
|
5287
|
-
const { store } = this.client;
|
|
5288
|
-
const state = store.getState();
|
|
5289
|
-
const createdBy = (_a2 = state.userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
5290
|
-
const { fields, images } = await separateImageFromFields(offlineRevision.fields);
|
|
5291
|
-
const fullRevision = {
|
|
5292
|
-
...offlineRevision,
|
|
5293
|
-
fields,
|
|
5294
|
-
created_by: createdBy,
|
|
5295
|
-
revision: "Pending",
|
|
5296
|
-
form: formId,
|
|
5297
|
-
submitted_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
5298
|
-
};
|
|
5299
|
-
this.dispatch(addFormRevision(fullRevision));
|
|
5300
|
-
const promise = this.enqueueRequest({
|
|
5301
|
-
description: "Create form revision",
|
|
5302
|
-
method: HttpMethod.PATCH,
|
|
5303
|
-
url: `/forms/${formId}/`,
|
|
5304
|
-
payload: {
|
|
5305
|
-
initial_revision: {
|
|
5306
|
-
offline_id: fullRevision.offline_id,
|
|
5307
|
-
submitted_at: fullRevision.submitted_at,
|
|
5308
|
-
title: fullRevision.title,
|
|
5309
|
-
description: fullRevision.description,
|
|
5310
|
-
fields: fullRevision.fields
|
|
5311
|
-
}
|
|
5312
|
-
},
|
|
5313
|
-
blockers: [formId],
|
|
5314
|
-
blocks: [offlineRevision.offline_id]
|
|
5315
|
-
});
|
|
5316
|
-
const [offlineFormRevisionAttachments, attachmentsPromise] = await this.bulkAddRevisionAttachments(
|
|
5317
|
-
fullRevision.offline_id,
|
|
5318
|
-
images
|
|
5319
|
-
);
|
|
5320
|
-
void promise.then((result) => {
|
|
5321
|
-
this.dispatch(setFormRevision(result));
|
|
5322
|
-
}).catch(() => {
|
|
5323
|
-
this.dispatch(deleteFormRevision(fullRevision.offline_id));
|
|
5324
|
-
});
|
|
5325
|
-
return [fullRevision, offlineFormRevisionAttachments, promise, attachmentsPromise];
|
|
5424
|
+
return [offlineForm, offlineFormRevision, formPromise];
|
|
5326
5425
|
}
|
|
5327
5426
|
async delete(id) {
|
|
5328
5427
|
const { store } = this.client;
|
|
@@ -5359,53 +5458,18 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
5359
5458
|
throw e;
|
|
5360
5459
|
}
|
|
5361
5460
|
}
|
|
5362
|
-
async refreshStore(
|
|
5363
|
-
const forms =
|
|
5364
|
-
const revisions = [];
|
|
5365
|
-
const attachments = [];
|
|
5366
|
-
const projectFormsResult = await this.enqueueRequest({
|
|
5367
|
-
description: "Fetch project forms",
|
|
5368
|
-
method: HttpMethod.GET,
|
|
5369
|
-
url: `/projects/${projectId}/forms/`,
|
|
5370
|
-
blockers: [projectId.toString()],
|
|
5371
|
-
blocks: []
|
|
5372
|
-
});
|
|
5373
|
-
for (const form of projectFormsResult.forms) forms.push(form);
|
|
5374
|
-
for (const revision of projectFormsResult.revisions) revisions.push(revision);
|
|
5375
|
-
for (const attachment of projectFormsResult.attachments) attachments.push(attachment);
|
|
5376
|
-
const organizationFormsResult = await this.enqueueRequest({
|
|
5461
|
+
async refreshStore(organizationId) {
|
|
5462
|
+
const forms = await this.enqueueRequest({
|
|
5377
5463
|
description: "Fetch organization forms",
|
|
5378
5464
|
method: HttpMethod.GET,
|
|
5379
|
-
url:
|
|
5380
|
-
|
|
5381
|
-
|
|
5382
|
-
|
|
5383
|
-
|
|
5384
|
-
for (const revision of organizationFormsResult.revisions) revisions.push(revision);
|
|
5385
|
-
for (const attachment of organizationFormsResult.attachments) attachments.push(attachment);
|
|
5386
|
-
const assetTypeFormsResult = await this.enqueueRequest({
|
|
5387
|
-
description: "Fetch asset type forms",
|
|
5388
|
-
method: HttpMethod.GET,
|
|
5389
|
-
url: `/projects/${projectId}/asset-types/forms/`,
|
|
5390
|
-
blockers: [projectId.toString()],
|
|
5391
|
-
blocks: []
|
|
5392
|
-
});
|
|
5393
|
-
for (const form of assetTypeFormsResult.forms) forms.push(form);
|
|
5394
|
-
for (const revision of assetTypeFormsResult.revisions) revisions.push(revision);
|
|
5395
|
-
for (const attachment of assetTypeFormsResult.attachments) attachments.push(attachment);
|
|
5396
|
-
const issueTypeFormsResult = await this.enqueueRequest({
|
|
5397
|
-
description: "Fetch issue type forms",
|
|
5398
|
-
method: HttpMethod.GET,
|
|
5399
|
-
url: `/projects/${projectId}/issue-types/forms/`,
|
|
5400
|
-
blockers: [projectId.toString()],
|
|
5465
|
+
url: "/forms/",
|
|
5466
|
+
queryParams: {
|
|
5467
|
+
organization: organizationId.toString()
|
|
5468
|
+
},
|
|
5469
|
+
blockers: [organizationId.toString()],
|
|
5401
5470
|
blocks: []
|
|
5402
5471
|
});
|
|
5403
|
-
for (const form of issueTypeFormsResult.forms) forms.push(form);
|
|
5404
|
-
for (const revision of issueTypeFormsResult.revisions) revisions.push(revision);
|
|
5405
|
-
for (const attachment of issueTypeFormsResult.attachments) attachments.push(attachment);
|
|
5406
5472
|
this.dispatch(initializeForms(forms));
|
|
5407
|
-
this.dispatch(initializeFormRevisions(revisions));
|
|
5408
|
-
this.dispatch(initializeFormRevisionAttachments(attachments));
|
|
5409
5473
|
}
|
|
5410
5474
|
}
|
|
5411
5475
|
const isArrayOfFiles = (value) => {
|
|
@@ -5427,95 +5491,11 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
5427
5491
|
return { values: newValues, files };
|
|
5428
5492
|
};
|
|
5429
5493
|
class FormSubmissionService extends BaseUploadService {
|
|
5430
|
-
|
|
5431
|
-
var _a2;
|
|
5432
|
-
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
5433
|
-
const createdBy = (_a2 = this.client.store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
5434
|
-
const filePayloads = {};
|
|
5435
|
-
const offlineFormSubmissionAttachments = [];
|
|
5436
|
-
const attachmentPayloads = [];
|
|
5437
|
-
for (const [fieldIdentifier, filesArray] of Object.entries(files)) {
|
|
5438
|
-
for (const file of filesArray) {
|
|
5439
|
-
const sha1 = await hashFile(file);
|
|
5440
|
-
if (!(sha1 in filePayloads)) {
|
|
5441
|
-
filePayloads[sha1] = {
|
|
5442
|
-
sha1,
|
|
5443
|
-
file_type: file.type,
|
|
5444
|
-
extension: file.name.split(".").pop(),
|
|
5445
|
-
size: file.size
|
|
5446
|
-
};
|
|
5447
|
-
await this.client.files.addCache(file, sha1);
|
|
5448
|
-
}
|
|
5449
|
-
const offlineFormSubmissionAttachment = offline({
|
|
5450
|
-
file: URL.createObjectURL(file),
|
|
5451
|
-
file_type: file.type,
|
|
5452
|
-
file_name: file.name,
|
|
5453
|
-
file_sha1: sha1,
|
|
5454
|
-
created_by: createdBy,
|
|
5455
|
-
submission: submissionId,
|
|
5456
|
-
submitted_at: submittedAt,
|
|
5457
|
-
field_identifier: fieldIdentifier
|
|
5458
|
-
});
|
|
5459
|
-
offlineFormSubmissionAttachments.push(offlineFormSubmissionAttachment);
|
|
5460
|
-
const attachmentPayload = {
|
|
5461
|
-
offline_id: offlineFormSubmissionAttachment.offline_id,
|
|
5462
|
-
name: file.name,
|
|
5463
|
-
sha1,
|
|
5464
|
-
field_identifier: fieldIdentifier
|
|
5465
|
-
};
|
|
5466
|
-
attachmentPayloads.push(attachmentPayload);
|
|
5467
|
-
}
|
|
5468
|
-
}
|
|
5469
|
-
this.dispatch(addFormSubmissionAttachments(offlineFormSubmissionAttachments));
|
|
5470
|
-
const promise = this.enqueueRequest({
|
|
5471
|
-
description: "Attach files to form submission",
|
|
5472
|
-
method: HttpMethod.POST,
|
|
5473
|
-
url: `/forms/submissions/${submissionId}/attachments/bulk/`,
|
|
5474
|
-
payload: {
|
|
5475
|
-
submitted_at: submittedAt,
|
|
5476
|
-
attachments: attachmentPayloads,
|
|
5477
|
-
files: Object.values(filePayloads)
|
|
5478
|
-
},
|
|
5479
|
-
blockers: [submissionId],
|
|
5480
|
-
blocks: offlineFormSubmissionAttachments.map((attachment) => attachment.offline_id)
|
|
5481
|
-
});
|
|
5482
|
-
promise.then((result) => {
|
|
5483
|
-
this.processPresignedUrls(result.presigned_urls);
|
|
5484
|
-
this.dispatch(updateFormSubmissionAttachments(result.attachments));
|
|
5485
|
-
}).catch(() => {
|
|
5486
|
-
this.dispatch(
|
|
5487
|
-
deleteFormSubmissionAttachments(
|
|
5488
|
-
offlineFormSubmissionAttachments.map((attachment) => attachment.offline_id)
|
|
5489
|
-
)
|
|
5490
|
-
);
|
|
5491
|
-
});
|
|
5492
|
-
return [offlineFormSubmissionAttachments, promise.then(({ attachments }) => attachments)];
|
|
5493
|
-
}
|
|
5494
|
-
async bulkDeleteSubmissionAttachments(submissionId, attachmentsIds) {
|
|
5495
|
-
const { store } = this.client;
|
|
5496
|
-
const state = store.getState();
|
|
5497
|
-
const formSubmissionAttachments = selectFormSubmissionAttachemntsByIds(attachmentsIds)(state);
|
|
5498
|
-
this.dispatch(deleteFormSubmissionAttachments(attachmentsIds));
|
|
5499
|
-
try {
|
|
5500
|
-
await this.enqueueRequest({
|
|
5501
|
-
description: "Delete form submission attachments",
|
|
5502
|
-
method: HttpMethod.DELETE,
|
|
5503
|
-
url: `/forms/submissions/${submissionId}/attachments/bulk/`,
|
|
5504
|
-
payload: { attachments: attachmentsIds },
|
|
5505
|
-
blockers: [submissionId, ...attachmentsIds],
|
|
5506
|
-
blocks: []
|
|
5507
|
-
});
|
|
5508
|
-
} catch (e) {
|
|
5509
|
-
this.dispatch(addFormSubmissionAttachments(formSubmissionAttachments));
|
|
5510
|
-
throw e;
|
|
5511
|
-
}
|
|
5512
|
-
}
|
|
5513
|
-
// Outer promise is for hashing and caching files for submission attachments
|
|
5514
|
-
async add(payload) {
|
|
5494
|
+
add(payload) {
|
|
5515
5495
|
var _a2;
|
|
5516
5496
|
const { store } = this.client;
|
|
5517
5497
|
const state = store.getState();
|
|
5518
|
-
const { values
|
|
5498
|
+
const { values } = separateFilesFromValues(payload.values);
|
|
5519
5499
|
const offlineSubmission = offline({
|
|
5520
5500
|
...payload,
|
|
5521
5501
|
values,
|
|
@@ -5523,132 +5503,35 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
5523
5503
|
submitted_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
5524
5504
|
});
|
|
5525
5505
|
const promise = this.enqueueRequest({
|
|
5526
|
-
description: "
|
|
5506
|
+
description: "Add form submission",
|
|
5527
5507
|
method: HttpMethod.POST,
|
|
5528
|
-
url:
|
|
5508
|
+
url: "/form-submissions/",
|
|
5529
5509
|
payload: offlineSubmission,
|
|
5530
|
-
blockers: [
|
|
5531
|
-
|
|
5532
|
-
|
|
5510
|
+
blockers: [
|
|
5511
|
+
"add-form-entry",
|
|
5512
|
+
payload.form_revision,
|
|
5513
|
+
...payload.issue ? [payload.issue] : [],
|
|
5514
|
+
...payload.asset ? [payload.asset] : []
|
|
5515
|
+
],
|
|
5533
5516
|
blocks: [offlineSubmission.offline_id]
|
|
5534
5517
|
});
|
|
5535
5518
|
this.dispatch(addFormSubmission(offlineSubmission));
|
|
5536
|
-
const [offlineFormSubmissionAttachments, attachmentsPromise] = await this.bulkAddSubmissionAttachments(
|
|
5537
|
-
offlineSubmission.offline_id,
|
|
5538
|
-
files
|
|
5539
|
-
);
|
|
5540
5519
|
promise.then((result) => {
|
|
5541
5520
|
this.dispatch(setFormSubmission(result));
|
|
5542
5521
|
return result;
|
|
5543
5522
|
}).catch(() => {
|
|
5544
5523
|
this.dispatch(deleteFormSubmission(offlineSubmission.offline_id));
|
|
5545
5524
|
});
|
|
5546
|
-
return [offlineSubmission,
|
|
5547
|
-
}
|
|
5548
|
-
// Note currently the bulkAdd method is specific to form submissions for assets
|
|
5549
|
-
// TODO: adapt the support bulk adding to any model type
|
|
5550
|
-
async bulkAdd(args, batchSize) {
|
|
5551
|
-
const { formRevision, commonFieldValues, fieldValuesByAsset } = args;
|
|
5552
|
-
const { values: fileSeperatedCommonFieldValues, files: commonFiles } = separateFilesFromValues(commonFieldValues);
|
|
5553
|
-
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
5554
|
-
const transactionId = uuid.v4();
|
|
5555
|
-
const assetIdBatches = chunkArray(Object.keys(fieldValuesByAsset), batchSize);
|
|
5556
|
-
const bulkAddBatches = await Promise.all(
|
|
5557
|
-
assetIdBatches.map(async (assetIdBatch) => {
|
|
5558
|
-
const batchId = uuid.v4();
|
|
5559
|
-
const submissionPayloads = [];
|
|
5560
|
-
const attachmentPayloads = [];
|
|
5561
|
-
const files = { ...commonFiles };
|
|
5562
|
-
for (const assetId of assetIdBatch) {
|
|
5563
|
-
const { values: fileSeperatedSubmissionSpecificValues, files: submissionSpecificFiles } = separateFilesFromValues(fieldValuesByAsset[assetId] ?? {});
|
|
5564
|
-
Object.assign(files, submissionSpecificFiles);
|
|
5565
|
-
const submissionPayload = offline({
|
|
5566
|
-
asset_id: assetId,
|
|
5567
|
-
form_data: fileSeperatedSubmissionSpecificValues
|
|
5568
|
-
});
|
|
5569
|
-
submissionPayloads.push(submissionPayload);
|
|
5570
|
-
for (const [fieldIdentifier, fileArray] of Object.entries(files)) {
|
|
5571
|
-
for (const file of fileArray) {
|
|
5572
|
-
const sha1 = await hashFile(file);
|
|
5573
|
-
await this.client.files.addCache(file, sha1);
|
|
5574
|
-
const attachmentPayload = offline({
|
|
5575
|
-
submission_id: submissionPayload.offline_id,
|
|
5576
|
-
sha1,
|
|
5577
|
-
name: file.name,
|
|
5578
|
-
field_identifier: fieldIdentifier
|
|
5579
|
-
});
|
|
5580
|
-
attachmentPayloads.push(attachmentPayload);
|
|
5581
|
-
}
|
|
5582
|
-
}
|
|
5583
|
-
}
|
|
5584
|
-
const filePaylods = [];
|
|
5585
|
-
for (const file of Object.values(files).flat()) {
|
|
5586
|
-
const sha1 = await hashFile(file);
|
|
5587
|
-
const filePayload = {
|
|
5588
|
-
sha1,
|
|
5589
|
-
extension: file.name.split(".").pop() || "",
|
|
5590
|
-
file_type: file.type,
|
|
5591
|
-
size: file.size
|
|
5592
|
-
};
|
|
5593
|
-
filePaylods.push(filePayload);
|
|
5594
|
-
}
|
|
5595
|
-
return {
|
|
5596
|
-
batchId,
|
|
5597
|
-
payload: {
|
|
5598
|
-
transaction_id: transactionId,
|
|
5599
|
-
form_data: fileSeperatedCommonFieldValues,
|
|
5600
|
-
submitted_at: submittedAt,
|
|
5601
|
-
submissions: submissionPayloads,
|
|
5602
|
-
attachments: attachmentPayloads,
|
|
5603
|
-
files: filePaylods
|
|
5604
|
-
}
|
|
5605
|
-
};
|
|
5606
|
-
})
|
|
5607
|
-
);
|
|
5608
|
-
const batchPromises = [];
|
|
5609
|
-
let prevBatchId = null;
|
|
5610
|
-
for (const batch of bulkAddBatches) {
|
|
5611
|
-
const { payload, batchId } = batch;
|
|
5612
|
-
const batchAssetIds = payload.submissions.map((x) => x.asset_id);
|
|
5613
|
-
const batchSubmissionOfflineIds = payload.submissions.map((x) => x.offline_id);
|
|
5614
|
-
const batchAttachmentsOfflineIds = payload.attachments.map((x) => x.offline_id);
|
|
5615
|
-
const blockers = batchAssetIds;
|
|
5616
|
-
if (prevBatchId) blockers.push(prevBatchId);
|
|
5617
|
-
const blocks = [...batchSubmissionOfflineIds, ...batchAttachmentsOfflineIds, batchId];
|
|
5618
|
-
const promise = this.enqueueRequest({
|
|
5619
|
-
description: "Bulk add form submissions",
|
|
5620
|
-
method: HttpMethod.POST,
|
|
5621
|
-
url: `/forms/revisions/${formRevision}/bulk-respond/`,
|
|
5622
|
-
payload,
|
|
5623
|
-
blockers,
|
|
5624
|
-
blocks
|
|
5625
|
-
});
|
|
5626
|
-
void promise.then(({ presigned_urls }) => {
|
|
5627
|
-
this.processPresignedUrls(presigned_urls);
|
|
5628
|
-
});
|
|
5629
|
-
prevBatchId = batchId;
|
|
5630
|
-
batchPromises.push(promise);
|
|
5631
|
-
}
|
|
5632
|
-
void Promise.all(batchPromises).then((results) => {
|
|
5633
|
-
const createdSubmissions = [];
|
|
5634
|
-
const createdAttachments = [];
|
|
5635
|
-
for (const result of results) {
|
|
5636
|
-
for (const createdSubmission of result.submissions) createdSubmissions.push(createdSubmission);
|
|
5637
|
-
for (const createdAttachment of result.attachments) createdAttachments.push(createdAttachment);
|
|
5638
|
-
}
|
|
5639
|
-
this.dispatch(addFormSubmissions(createdSubmissions));
|
|
5640
|
-
this.dispatch(addFormSubmissionAttachments(createdAttachments));
|
|
5641
|
-
});
|
|
5642
|
-
return batchPromises;
|
|
5525
|
+
return [offlineSubmission, promise];
|
|
5643
5526
|
}
|
|
5644
|
-
|
|
5527
|
+
update(payload) {
|
|
5645
5528
|
const { store } = this.client;
|
|
5646
5529
|
const state = store.getState();
|
|
5647
5530
|
const submissionToBeUpdated = selectFormSubmissionById(payload.offline_id)(state);
|
|
5648
5531
|
if (!submissionToBeUpdated) {
|
|
5649
5532
|
throw new Error(`Expected submission with offline_id ${payload.offline_id} to exist`);
|
|
5650
5533
|
}
|
|
5651
|
-
const { values
|
|
5534
|
+
const { values } = separateFilesFromValues(payload.values ?? {});
|
|
5652
5535
|
const updatedSubmission = {
|
|
5653
5536
|
...submissionToBeUpdated,
|
|
5654
5537
|
...payload,
|
|
@@ -5662,39 +5545,18 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
5662
5545
|
const promise = this.enqueueRequest({
|
|
5663
5546
|
description: "Delete user form submissions",
|
|
5664
5547
|
method: HttpMethod.PATCH,
|
|
5665
|
-
url: `/
|
|
5548
|
+
url: `/form-submissions/${updatedSubmission.offline_id}/`,
|
|
5666
5549
|
// TODO: send just payload when FormSubmissionDeserializer is updated to handle partial updates
|
|
5667
5550
|
payload: updatedSubmission,
|
|
5668
5551
|
blockers: [updatedSubmission.offline_id],
|
|
5669
5552
|
blocks: [updatedSubmission.offline_id]
|
|
5670
5553
|
});
|
|
5671
|
-
const formSubmissionAttachments = selectAttachmentsOfFormSubmission(payload.offline_id)(state);
|
|
5672
|
-
const formSubmissionAttachmentIdsToBeDeleted = [];
|
|
5673
|
-
for (const attachment of formSubmissionAttachments) {
|
|
5674
|
-
if (attachment.field_identifier in files) {
|
|
5675
|
-
formSubmissionAttachmentIdsToBeDeleted.push(attachment.offline_id);
|
|
5676
|
-
}
|
|
5677
|
-
}
|
|
5678
|
-
const [offlineFormSubmissionAttachments, attachmentsPromise] = await this.bulkAddSubmissionAttachments(
|
|
5679
|
-
payload.offline_id,
|
|
5680
|
-
files
|
|
5681
|
-
);
|
|
5682
|
-
const deleteAttachmentsPromise = this.bulkDeleteSubmissionAttachments(
|
|
5683
|
-
payload.offline_id,
|
|
5684
|
-
formSubmissionAttachmentIdsToBeDeleted
|
|
5685
|
-
);
|
|
5686
5554
|
promise.then((result) => {
|
|
5687
5555
|
this.dispatch(setFormSubmission(result));
|
|
5688
5556
|
}).catch(() => {
|
|
5689
5557
|
this.dispatch(setFormSubmission(submissionToBeUpdated));
|
|
5690
5558
|
});
|
|
5691
|
-
return [
|
|
5692
|
-
updatedSubmission,
|
|
5693
|
-
offlineFormSubmissionAttachments,
|
|
5694
|
-
promise,
|
|
5695
|
-
attachmentsPromise,
|
|
5696
|
-
deleteAttachmentsPromise
|
|
5697
|
-
];
|
|
5559
|
+
return [updatedSubmission, promise];
|
|
5698
5560
|
}
|
|
5699
5561
|
async delete(id) {
|
|
5700
5562
|
const { store } = this.client;
|
|
@@ -5710,7 +5572,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
5710
5572
|
return await this.enqueueRequest({
|
|
5711
5573
|
description: "Delete user form submissions",
|
|
5712
5574
|
method: HttpMethod.DELETE,
|
|
5713
|
-
url: `/
|
|
5575
|
+
url: `/form-submissions/${id}/`,
|
|
5714
5576
|
blockers: [id],
|
|
5715
5577
|
blocks: []
|
|
5716
5578
|
});
|
|
@@ -5721,50 +5583,17 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
5721
5583
|
}
|
|
5722
5584
|
}
|
|
5723
5585
|
async refreshStore(projectId) {
|
|
5724
|
-
const
|
|
5725
|
-
|
|
5726
|
-
description: "Fetch model submissions",
|
|
5727
|
-
method: HttpMethod.GET,
|
|
5728
|
-
url: `/forms/in-project/${projectId}/submissions/model/latest/`,
|
|
5729
|
-
blockers: [],
|
|
5730
|
-
blocks: []
|
|
5731
|
-
});
|
|
5732
|
-
for (const modelSubmission of modelSubmissions) {
|
|
5733
|
-
formSubmissions[modelSubmission.offline_id] = modelSubmission;
|
|
5734
|
-
}
|
|
5735
|
-
const standaloneSubmissions = await this.enqueueRequest({
|
|
5736
|
-
description: "Fetch standalone submissions",
|
|
5737
|
-
method: HttpMethod.GET,
|
|
5738
|
-
url: `/forms/in-project/${projectId}/submissions/standalone/`,
|
|
5739
|
-
blockers: [],
|
|
5740
|
-
blocks: []
|
|
5741
|
-
});
|
|
5742
|
-
for (const standaloneSubmission of standaloneSubmissions) {
|
|
5743
|
-
formSubmissions[standaloneSubmission.offline_id] = standaloneSubmission;
|
|
5744
|
-
}
|
|
5745
|
-
this.dispatch(initializeFormSubmissions(Object.values(formSubmissions)));
|
|
5746
|
-
const attachments = {};
|
|
5747
|
-
const modelAttachments = await this.enqueueRequest({
|
|
5748
|
-
description: "Fetch model submission attachments",
|
|
5749
|
-
method: HttpMethod.GET,
|
|
5750
|
-
url: `/forms/in-project/${projectId}/attachments/model/latest/`,
|
|
5751
|
-
blockers: [],
|
|
5752
|
-
blocks: []
|
|
5753
|
-
});
|
|
5754
|
-
for (const modelAttachment of modelAttachments) {
|
|
5755
|
-
attachments[modelAttachment.offline_id] = modelAttachment;
|
|
5756
|
-
}
|
|
5757
|
-
const standaloneAttachments = await this.enqueueRequest({
|
|
5758
|
-
description: "Fetch standalone submission attachments",
|
|
5586
|
+
const result = await this.enqueueRequest({
|
|
5587
|
+
description: "Fetch form submissions",
|
|
5759
5588
|
method: HttpMethod.GET,
|
|
5760
|
-
url:
|
|
5589
|
+
url: "/form-submissions/",
|
|
5590
|
+
queryParams: {
|
|
5591
|
+
project: projectId.toString()
|
|
5592
|
+
},
|
|
5761
5593
|
blockers: [],
|
|
5762
5594
|
blocks: []
|
|
5763
5595
|
});
|
|
5764
|
-
|
|
5765
|
-
attachments[standaloneAttachent.offline_id] = standaloneAttachent;
|
|
5766
|
-
}
|
|
5767
|
-
this.dispatch(initializeFormSubmissionAttachments(Object.values(attachments)));
|
|
5596
|
+
this.dispatch(initializeFormSubmissions(result));
|
|
5768
5597
|
}
|
|
5769
5598
|
}
|
|
5770
5599
|
class WorkspaceService extends BaseApiService {
|
|
@@ -6464,8 +6293,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
6464
6293
|
class DocumentAttachmentService extends BaseAttachmentService {
|
|
6465
6294
|
constructor() {
|
|
6466
6295
|
super(...arguments);
|
|
6467
|
-
__publicField(this, "
|
|
6468
|
-
__publicField(this, "
|
|
6296
|
+
__publicField(this, "name", "Document Attachment");
|
|
6297
|
+
__publicField(this, "url", "/document-attachments");
|
|
6469
6298
|
__publicField(this, "addAttachments", addDocumentAttachments);
|
|
6470
6299
|
__publicField(this, "updateAttachments", updateDocumentAttachments);
|
|
6471
6300
|
__publicField(this, "removeAttachments", deleteDocumentAttachments);
|
|
@@ -6476,17 +6305,23 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
6476
6305
|
buildOfflineAttachment(data) {
|
|
6477
6306
|
return offline({
|
|
6478
6307
|
file: URL.createObjectURL(data.file),
|
|
6479
|
-
file_sha1: data.
|
|
6480
|
-
created_by: data.
|
|
6308
|
+
file_sha1: data.file_sha1,
|
|
6309
|
+
created_by: data.created_by,
|
|
6481
6310
|
file_name: data.file.name,
|
|
6482
6311
|
file_type: data.file.type,
|
|
6483
|
-
submitted_at: data.
|
|
6312
|
+
submitted_at: data.submitted_at,
|
|
6484
6313
|
description: data.description,
|
|
6485
6314
|
document: data.modelId
|
|
6486
6315
|
});
|
|
6487
6316
|
}
|
|
6488
|
-
|
|
6489
|
-
|
|
6317
|
+
buildAttachmentPayload(data) {
|
|
6318
|
+
return {
|
|
6319
|
+
...data,
|
|
6320
|
+
document: data.modelId
|
|
6321
|
+
};
|
|
6322
|
+
}
|
|
6323
|
+
// NOTE: overriding the method from BaseAttachmentService since document attachments get vectorized
|
|
6324
|
+
async bulkAdd(payloads) {
|
|
6490
6325
|
var _a2;
|
|
6491
6326
|
const { store } = this.client;
|
|
6492
6327
|
const createdBy = (_a2 = store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
@@ -6495,40 +6330,37 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
6495
6330
|
const attachmentPayloads = [];
|
|
6496
6331
|
const filePayloads = {};
|
|
6497
6332
|
const sha1ToAttachmentIds = {};
|
|
6498
|
-
for (const
|
|
6499
|
-
const
|
|
6500
|
-
|
|
6501
|
-
|
|
6502
|
-
|
|
6503
|
-
|
|
6504
|
-
extension: file.name.split(".").pop(),
|
|
6505
|
-
size: file.size
|
|
6506
|
-
};
|
|
6507
|
-
sha1ToAttachmentIds[sha1] = [];
|
|
6508
|
-
await this.client.files.addCache(file, sha1);
|
|
6333
|
+
for (const payload of payloads) {
|
|
6334
|
+
const { documentId, file } = payload;
|
|
6335
|
+
const filePayload = await this.getFilePayload(file);
|
|
6336
|
+
if (!(filePayload.sha1 in filePayloads)) {
|
|
6337
|
+
filePayloads[filePayload.sha1] = filePayload;
|
|
6338
|
+
sha1ToAttachmentIds[filePayload.sha1] = [];
|
|
6509
6339
|
}
|
|
6510
6340
|
const offlineAttachment = this.buildOfflineAttachment({
|
|
6511
6341
|
file,
|
|
6512
|
-
sha1,
|
|
6513
|
-
submittedAt,
|
|
6514
|
-
createdBy,
|
|
6342
|
+
file_sha1: filePayload.sha1,
|
|
6343
|
+
submitted_at: submittedAt,
|
|
6344
|
+
created_by: createdBy,
|
|
6515
6345
|
description: "",
|
|
6516
6346
|
modelId: documentId
|
|
6517
6347
|
});
|
|
6518
6348
|
offlineAttachments.push(offlineAttachment);
|
|
6519
6349
|
attachmentPayloads.push({
|
|
6520
6350
|
offline_id: offlineAttachment.offline_id,
|
|
6521
|
-
|
|
6522
|
-
|
|
6523
|
-
|
|
6351
|
+
file_name: offlineAttachment.file_name,
|
|
6352
|
+
file_sha1: offlineAttachment.file_sha1,
|
|
6353
|
+
file_extension: filePayload.extension,
|
|
6354
|
+
description: offlineAttachment.description,
|
|
6355
|
+
document: documentId
|
|
6524
6356
|
});
|
|
6525
|
-
sha1ToAttachmentIds[sha1].push(offlineAttachment.offline_id);
|
|
6357
|
+
sha1ToAttachmentIds[filePayload.sha1].push(offlineAttachment.offline_id);
|
|
6526
6358
|
}
|
|
6527
6359
|
this.dispatch(this.addAttachments(offlineAttachments));
|
|
6528
6360
|
const promise = this.enqueueRequest({
|
|
6529
6361
|
description: "Attach files to document",
|
|
6530
6362
|
method: HttpMethod.POST,
|
|
6531
|
-
url:
|
|
6363
|
+
url: "/document-attachments/bulk/",
|
|
6532
6364
|
payload: {
|
|
6533
6365
|
submitted_at: submittedAt,
|
|
6534
6366
|
attachments: attachmentPayloads,
|
|
@@ -6553,14 +6385,14 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
6553
6385
|
});
|
|
6554
6386
|
return [offlineAttachments, promise.then(({ attachments }) => attachments)];
|
|
6555
6387
|
}
|
|
6556
|
-
async
|
|
6557
|
-
return this.
|
|
6388
|
+
async delete(id) {
|
|
6389
|
+
return this._delete(id);
|
|
6558
6390
|
}
|
|
6559
6391
|
makeReadable(attachmnentId) {
|
|
6560
6392
|
void this.enqueueRequest({
|
|
6561
6393
|
description: "Add attachment to AI assistant",
|
|
6562
6394
|
method: HttpMethod.PATCH,
|
|
6563
|
-
url: `/
|
|
6395
|
+
url: `/document-attachments/${attachmnentId}/`,
|
|
6564
6396
|
payload: {
|
|
6565
6397
|
readable_to_assistant: true
|
|
6566
6398
|
},
|
|
@@ -6577,7 +6409,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
6577
6409
|
blocks: [],
|
|
6578
6410
|
blockers: []
|
|
6579
6411
|
});
|
|
6580
|
-
this.dispatch(
|
|
6412
|
+
this.dispatch(initializeDocumentAttachments(projectDocumentAttachments));
|
|
6581
6413
|
const organizationDocumentAttachments = await this.enqueueRequest({
|
|
6582
6414
|
description: "Get document attachments",
|
|
6583
6415
|
method: HttpMethod.GET,
|
|
@@ -6813,17 +6645,11 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
6813
6645
|
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
6814
6646
|
const createdBy = (_a2 = store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
6815
6647
|
const projectId = payloadWithoutFile.project;
|
|
6816
|
-
const
|
|
6817
|
-
const filePayload = {
|
|
6818
|
-
sha1,
|
|
6819
|
-
file_type: file.type,
|
|
6820
|
-
extension: file.name.split(".").pop(),
|
|
6821
|
-
size: file.size
|
|
6822
|
-
};
|
|
6648
|
+
const filePayload = await this.getFilePayload(file);
|
|
6823
6649
|
const offlineMapImage = offline({
|
|
6824
6650
|
...payloadWithoutFile,
|
|
6825
6651
|
file_name: file.name,
|
|
6826
|
-
file_sha1: sha1,
|
|
6652
|
+
file_sha1: filePayload.sha1,
|
|
6827
6653
|
file: URL.createObjectURL(file),
|
|
6828
6654
|
submitted_at: submittedAt,
|
|
6829
6655
|
created_by: createdBy
|
|
@@ -6866,23 +6692,15 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
6866
6692
|
const offlineGeoImages = [];
|
|
6867
6693
|
const offlineIds = [];
|
|
6868
6694
|
const geoImagePayloads = [];
|
|
6869
|
-
const
|
|
6695
|
+
const filePayloads = {};
|
|
6870
6696
|
for (const payloadAndFile of payloads) {
|
|
6871
6697
|
const { file, ...payload } = payloadAndFile;
|
|
6872
|
-
const
|
|
6873
|
-
if (!(sha1 in
|
|
6874
|
-
filePayloadRecord[sha1] = {
|
|
6875
|
-
sha1,
|
|
6876
|
-
file_type: file.type,
|
|
6877
|
-
extension: file.name.split(".").pop(),
|
|
6878
|
-
size: file.size
|
|
6879
|
-
};
|
|
6880
|
-
await this.client.files.addCache(file, sha1);
|
|
6881
|
-
}
|
|
6698
|
+
const filePayload = await this.getFilePayload(file);
|
|
6699
|
+
if (!(filePayload.sha1 in filePayloads)) filePayloads[filePayload.sha1] = filePayload;
|
|
6882
6700
|
const offlineMapImage = offline({
|
|
6883
6701
|
...payload,
|
|
6884
6702
|
file_name: file.name,
|
|
6885
|
-
file_sha1: sha1,
|
|
6703
|
+
file_sha1: filePayload.sha1,
|
|
6886
6704
|
file: URL.createObjectURL(file),
|
|
6887
6705
|
submitted_at: submittedAt,
|
|
6888
6706
|
created_by: createdBy,
|
|
@@ -6911,7 +6729,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
6911
6729
|
submitted_at: submittedAt,
|
|
6912
6730
|
project: projectId,
|
|
6913
6731
|
geo_images: geoImagePayloads,
|
|
6914
|
-
files: Object.values(
|
|
6732
|
+
files: Object.values(filePayloads)
|
|
6915
6733
|
},
|
|
6916
6734
|
blocks: [projectId.toString()],
|
|
6917
6735
|
blockers: offlineIds
|
|
@@ -6979,7 +6797,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
6979
6797
|
this.dispatch(initializeGeoImages(result));
|
|
6980
6798
|
}
|
|
6981
6799
|
}
|
|
6982
|
-
class IssueAssociationService extends
|
|
6800
|
+
class IssueAssociationService extends BaseApiService {
|
|
6983
6801
|
add(payload) {
|
|
6984
6802
|
var _a2;
|
|
6985
6803
|
const { store } = this.client;
|
|
@@ -6994,7 +6812,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
6994
6812
|
const promise = this.enqueueRequest({
|
|
6995
6813
|
description: "Add issue association",
|
|
6996
6814
|
method: HttpMethod.POST,
|
|
6997
|
-
url: "/
|
|
6815
|
+
url: "/issue-associations/",
|
|
6998
6816
|
payload: {
|
|
6999
6817
|
offline_id: offlineIssueAssociation.offline_id,
|
|
7000
6818
|
submitted_at: submittedAt,
|
|
@@ -7024,7 +6842,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
7024
6842
|
const promise = this.enqueueRequest({
|
|
7025
6843
|
description: "Delete issue association",
|
|
7026
6844
|
method: HttpMethod.DELETE,
|
|
7027
|
-
url: `/
|
|
6845
|
+
url: `/issue-associations/${id}/`,
|
|
7028
6846
|
blockers: [id],
|
|
7029
6847
|
blocks: []
|
|
7030
6848
|
});
|
|
@@ -7037,14 +6855,917 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
7037
6855
|
const issueAssociations = await this.enqueueRequest({
|
|
7038
6856
|
description: "Fetch issue associations",
|
|
7039
6857
|
method: HttpMethod.GET,
|
|
7040
|
-
url: "/
|
|
7041
|
-
queryParams: {
|
|
6858
|
+
url: "/issue-associations/",
|
|
6859
|
+
queryParams: { project: projectId.toString() },
|
|
7042
6860
|
blockers: [],
|
|
7043
6861
|
blocks: []
|
|
7044
6862
|
});
|
|
7045
6863
|
this.dispatch(initializeIssueAssociations(issueAssociations));
|
|
7046
6864
|
}
|
|
7047
6865
|
}
|
|
6866
|
+
class FormRevisionAttachmentService extends BaseUploadService {
|
|
6867
|
+
async bulkAdd(payloads) {
|
|
6868
|
+
var _a2;
|
|
6869
|
+
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
6870
|
+
const createdBy = (_a2 = this.client.store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
6871
|
+
const filePayloads = {};
|
|
6872
|
+
const offlineFormRevisionAttachments = [];
|
|
6873
|
+
const attachmentPayloads = [];
|
|
6874
|
+
for (const payload of payloads) {
|
|
6875
|
+
const { revisionId, fieldIdentifier, file } = payload;
|
|
6876
|
+
const filePayload = await this.getFilePayload(file);
|
|
6877
|
+
if (!(filePayload.sha1 in filePayloads)) filePayloads[filePayload.sha1] = filePayload;
|
|
6878
|
+
const offlineFormRevisionAttachment = offline({
|
|
6879
|
+
file: URL.createObjectURL(file),
|
|
6880
|
+
file_type: file.type,
|
|
6881
|
+
file_name: file.name,
|
|
6882
|
+
file_sha1: filePayload.sha1,
|
|
6883
|
+
created_by: createdBy,
|
|
6884
|
+
form_revision: revisionId,
|
|
6885
|
+
submitted_at: submittedAt,
|
|
6886
|
+
field_identifier: fieldIdentifier
|
|
6887
|
+
});
|
|
6888
|
+
offlineFormRevisionAttachments.push(offlineFormRevisionAttachment);
|
|
6889
|
+
const attachmentPayload = {
|
|
6890
|
+
offline_id: offlineFormRevisionAttachment.offline_id,
|
|
6891
|
+
file_name: file.name,
|
|
6892
|
+
field_identifier: fieldIdentifier,
|
|
6893
|
+
file_extension: filePayload.extension,
|
|
6894
|
+
file_sha1: filePayload.sha1,
|
|
6895
|
+
form_revision: revisionId
|
|
6896
|
+
};
|
|
6897
|
+
attachmentPayloads.push(attachmentPayload);
|
|
6898
|
+
}
|
|
6899
|
+
this.dispatch(addFormRevisionAttachments(offlineFormRevisionAttachments));
|
|
6900
|
+
const promise = this.enqueueRequest({
|
|
6901
|
+
description: "Attach files to form revision",
|
|
6902
|
+
method: HttpMethod.POST,
|
|
6903
|
+
url: "/form-revision-attachments/bulk/",
|
|
6904
|
+
payload: {
|
|
6905
|
+
submitted_at: submittedAt,
|
|
6906
|
+
attachments: attachmentPayloads,
|
|
6907
|
+
files: Object.values(filePayloads)
|
|
6908
|
+
},
|
|
6909
|
+
blockers: offlineFormRevisionAttachments.map((attachment) => attachment.form_revision),
|
|
6910
|
+
blocks: offlineFormRevisionAttachments.map((attachment) => attachment.offline_id)
|
|
6911
|
+
});
|
|
6912
|
+
promise.then((result) => {
|
|
6913
|
+
this.processPresignedUrls(result.presigned_urls);
|
|
6914
|
+
this.dispatch(updateFormRevisionAttachments(result.attachments));
|
|
6915
|
+
}).catch(() => {
|
|
6916
|
+
this.dispatch(
|
|
6917
|
+
deleteFormRevisionAttachments(
|
|
6918
|
+
offlineFormRevisionAttachments.map((attachment) => attachment.offline_id)
|
|
6919
|
+
)
|
|
6920
|
+
);
|
|
6921
|
+
});
|
|
6922
|
+
return [offlineFormRevisionAttachments, promise.then(({ attachments }) => attachments)];
|
|
6923
|
+
}
|
|
6924
|
+
async refreshStore(organizationId) {
|
|
6925
|
+
const formRevisions = await this.enqueueRequest({
|
|
6926
|
+
description: "Fetch organization form revision attachments",
|
|
6927
|
+
method: HttpMethod.GET,
|
|
6928
|
+
url: "/form-revision-attachments/",
|
|
6929
|
+
queryParams: {
|
|
6930
|
+
organization: organizationId.toString()
|
|
6931
|
+
},
|
|
6932
|
+
blockers: [organizationId.toString()],
|
|
6933
|
+
blocks: []
|
|
6934
|
+
});
|
|
6935
|
+
this.dispatch(initializeFormRevisionAttachments(formRevisions));
|
|
6936
|
+
}
|
|
6937
|
+
}
|
|
6938
|
+
class FormSubmissionAttachmentService extends BaseUploadService {
|
|
6939
|
+
async bulkAdd(payloads) {
|
|
6940
|
+
var _a2;
|
|
6941
|
+
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
6942
|
+
const createdBy = (_a2 = this.client.store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
6943
|
+
const filePayloads = {};
|
|
6944
|
+
const offlineFormSubmissionAttachments = [];
|
|
6945
|
+
const attachmentPayloads = [];
|
|
6946
|
+
for (const payload of payloads) {
|
|
6947
|
+
const { submissionId, fieldIdentifier, file } = payload;
|
|
6948
|
+
const filePayload = await this.getFilePayload(file);
|
|
6949
|
+
if (!(filePayload.sha1 in filePayloads)) filePayloads[filePayload.sha1] = filePayload;
|
|
6950
|
+
const offlineFormSubmissionAttachment = offline({
|
|
6951
|
+
file: URL.createObjectURL(file),
|
|
6952
|
+
file_type: file.type,
|
|
6953
|
+
file_name: file.name,
|
|
6954
|
+
file_sha1: filePayload.sha1,
|
|
6955
|
+
created_by: createdBy,
|
|
6956
|
+
form_submission: submissionId,
|
|
6957
|
+
submitted_at: submittedAt,
|
|
6958
|
+
field_identifier: fieldIdentifier
|
|
6959
|
+
});
|
|
6960
|
+
offlineFormSubmissionAttachments.push(offlineFormSubmissionAttachment);
|
|
6961
|
+
const attachmentPayload = {
|
|
6962
|
+
offline_id: offlineFormSubmissionAttachment.offline_id,
|
|
6963
|
+
file_name: file.name,
|
|
6964
|
+
file_sha1: filePayload.sha1,
|
|
6965
|
+
file_extension: filePayload.extension,
|
|
6966
|
+
field_identifier: fieldIdentifier,
|
|
6967
|
+
form_submission: submissionId
|
|
6968
|
+
};
|
|
6969
|
+
attachmentPayloads.push(attachmentPayload);
|
|
6970
|
+
}
|
|
6971
|
+
this.dispatch(addFormSubmissionAttachments(offlineFormSubmissionAttachments));
|
|
6972
|
+
const promise = this.enqueueRequest({
|
|
6973
|
+
description: "Attach files to form submission",
|
|
6974
|
+
method: HttpMethod.POST,
|
|
6975
|
+
url: "/form-submission-attachments/bulk/",
|
|
6976
|
+
payload: {
|
|
6977
|
+
submitted_at: submittedAt,
|
|
6978
|
+
attachments: attachmentPayloads,
|
|
6979
|
+
files: Object.values(filePayloads)
|
|
6980
|
+
},
|
|
6981
|
+
blockers: offlineFormSubmissionAttachments.map((attachment) => attachment.form_submission),
|
|
6982
|
+
blocks: offlineFormSubmissionAttachments.map((attachment) => attachment.offline_id)
|
|
6983
|
+
});
|
|
6984
|
+
promise.then((result) => {
|
|
6985
|
+
this.processPresignedUrls(result.presigned_urls);
|
|
6986
|
+
this.dispatch(updateFormSubmissionAttachments(result.attachments));
|
|
6987
|
+
}).catch((error) => {
|
|
6988
|
+
this.dispatch(
|
|
6989
|
+
deleteFormSubmissionAttachments(
|
|
6990
|
+
offlineFormSubmissionAttachments.map((attachment) => attachment.offline_id)
|
|
6991
|
+
)
|
|
6992
|
+
);
|
|
6993
|
+
throw error;
|
|
6994
|
+
});
|
|
6995
|
+
return [offlineFormSubmissionAttachments, promise.then(({ attachments }) => attachments)];
|
|
6996
|
+
}
|
|
6997
|
+
async bulkDelete(attachmentsIds) {
|
|
6998
|
+
const { store } = this.client;
|
|
6999
|
+
const state = store.getState();
|
|
7000
|
+
const formSubmissionAttachments = selectFormSubmissionAttachemntsByIds(attachmentsIds)(state);
|
|
7001
|
+
this.dispatch(deleteFormSubmissionAttachments(attachmentsIds));
|
|
7002
|
+
try {
|
|
7003
|
+
await this.enqueueRequest({
|
|
7004
|
+
description: "Delete form submission attachments",
|
|
7005
|
+
method: HttpMethod.DELETE,
|
|
7006
|
+
url: "/form-submission-attachments/bulk/",
|
|
7007
|
+
payload: { attachment_ids: attachmentsIds },
|
|
7008
|
+
blockers: attachmentsIds,
|
|
7009
|
+
blocks: []
|
|
7010
|
+
});
|
|
7011
|
+
} catch (e) {
|
|
7012
|
+
this.dispatch(addFormSubmissionAttachments(formSubmissionAttachments));
|
|
7013
|
+
throw e;
|
|
7014
|
+
}
|
|
7015
|
+
}
|
|
7016
|
+
async refreshStore(projectId) {
|
|
7017
|
+
const result = await this.enqueueRequest({
|
|
7018
|
+
description: "Get form submission attachments",
|
|
7019
|
+
method: HttpMethod.GET,
|
|
7020
|
+
url: "/form-submission-attachments/",
|
|
7021
|
+
queryParams: {
|
|
7022
|
+
project: projectId.toString()
|
|
7023
|
+
},
|
|
7024
|
+
blockers: [],
|
|
7025
|
+
blocks: []
|
|
7026
|
+
});
|
|
7027
|
+
this.dispatch(initializeFormSubmissionAttachments(result));
|
|
7028
|
+
}
|
|
7029
|
+
}
|
|
7030
|
+
class FormRevisionService extends BaseUploadService {
|
|
7031
|
+
add(payload) {
|
|
7032
|
+
var _a2;
|
|
7033
|
+
const { store } = this.client;
|
|
7034
|
+
const state = store.getState();
|
|
7035
|
+
const createdBy = (_a2 = state.userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
7036
|
+
const offlineFormRevision = offline({
|
|
7037
|
+
...payload,
|
|
7038
|
+
created_by: createdBy,
|
|
7039
|
+
revision: "Pending",
|
|
7040
|
+
submitted_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
7041
|
+
});
|
|
7042
|
+
this.dispatch(addFormRevision(offlineFormRevision));
|
|
7043
|
+
const promise = this.enqueueRequest({
|
|
7044
|
+
description: "Create form revision",
|
|
7045
|
+
method: HttpMethod.POST,
|
|
7046
|
+
url: "/form-revisions/",
|
|
7047
|
+
payload: offlineFormRevision,
|
|
7048
|
+
blockers: [payload.form],
|
|
7049
|
+
blocks: [offlineFormRevision.offline_id]
|
|
7050
|
+
});
|
|
7051
|
+
void promise.then((result) => {
|
|
7052
|
+
this.dispatch(setFormRevision(result));
|
|
7053
|
+
}).catch(() => {
|
|
7054
|
+
this.dispatch(deleteFormRevision(offlineFormRevision.offline_id));
|
|
7055
|
+
});
|
|
7056
|
+
return [offlineFormRevision, promise];
|
|
7057
|
+
}
|
|
7058
|
+
async refreshStore(organizationId) {
|
|
7059
|
+
const formRevisions = await this.enqueueRequest({
|
|
7060
|
+
description: "Get organization form revisions",
|
|
7061
|
+
method: HttpMethod.GET,
|
|
7062
|
+
url: "/form-revisions/",
|
|
7063
|
+
queryParams: {
|
|
7064
|
+
organization: organizationId.toString()
|
|
7065
|
+
},
|
|
7066
|
+
blockers: [organizationId.toString()],
|
|
7067
|
+
blocks: []
|
|
7068
|
+
});
|
|
7069
|
+
this.dispatch(initializeFormRevisions(formRevisions));
|
|
7070
|
+
}
|
|
7071
|
+
}
|
|
7072
|
+
class AssetTypeFieldsAttachmentService extends BaseUploadService {
|
|
7073
|
+
async bulkAdd(payloads) {
|
|
7074
|
+
var _a2;
|
|
7075
|
+
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7076
|
+
const createdBy = (_a2 = this.client.store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
7077
|
+
const filePayloads = {};
|
|
7078
|
+
const offlineAssetTypeFieldsAttachments = [];
|
|
7079
|
+
const attachmentPayloads = [];
|
|
7080
|
+
for (const payload of payloads) {
|
|
7081
|
+
const { fieldsRevisionId, fieldIdentifier, file } = payload;
|
|
7082
|
+
const filePayload = await this.getFilePayload(file);
|
|
7083
|
+
if (!(filePayload.sha1 in filePayloads)) filePayloads[filePayload.sha1] = filePayload;
|
|
7084
|
+
const offlineAssetTypeFieldsAttachment = offline({
|
|
7085
|
+
file: URL.createObjectURL(file),
|
|
7086
|
+
file_type: file.type,
|
|
7087
|
+
file_name: file.name,
|
|
7088
|
+
file_sha1: filePayload.sha1,
|
|
7089
|
+
created_by: createdBy,
|
|
7090
|
+
fields_revision: fieldsRevisionId,
|
|
7091
|
+
submitted_at: submittedAt,
|
|
7092
|
+
field_identifier: fieldIdentifier
|
|
7093
|
+
});
|
|
7094
|
+
offlineAssetTypeFieldsAttachments.push(offlineAssetTypeFieldsAttachment);
|
|
7095
|
+
const attachmentPayload = {
|
|
7096
|
+
offline_id: offlineAssetTypeFieldsAttachment.offline_id,
|
|
7097
|
+
file_name: file.name,
|
|
7098
|
+
field_identifier: fieldIdentifier,
|
|
7099
|
+
file_extension: filePayload.extension,
|
|
7100
|
+
file_sha1: filePayload.sha1,
|
|
7101
|
+
fields_revision: fieldsRevisionId
|
|
7102
|
+
};
|
|
7103
|
+
attachmentPayloads.push(attachmentPayload);
|
|
7104
|
+
}
|
|
7105
|
+
this.dispatch(addAssetTypeFieldsAttachments(offlineAssetTypeFieldsAttachments));
|
|
7106
|
+
const promise = this.enqueueRequest({
|
|
7107
|
+
description: "Add asset type fields attachments",
|
|
7108
|
+
method: HttpMethod.POST,
|
|
7109
|
+
url: "/asset-type-fields-attachments/bulk/",
|
|
7110
|
+
payload: {
|
|
7111
|
+
submitted_at: submittedAt,
|
|
7112
|
+
attachments: attachmentPayloads,
|
|
7113
|
+
files: Object.values(filePayloads)
|
|
7114
|
+
},
|
|
7115
|
+
blockers: offlineAssetTypeFieldsAttachments.map((attachment) => attachment.fields_revision),
|
|
7116
|
+
blocks: offlineAssetTypeFieldsAttachments.map((attachment) => attachment.offline_id)
|
|
7117
|
+
});
|
|
7118
|
+
promise.then((result) => {
|
|
7119
|
+
this.processPresignedUrls(result.presigned_urls);
|
|
7120
|
+
this.dispatch(updateAssetTypeFieldsAttachments(result.attachments));
|
|
7121
|
+
}).catch(() => {
|
|
7122
|
+
this.dispatch(
|
|
7123
|
+
deleteAssetTypeFieldsAttachments(
|
|
7124
|
+
offlineAssetTypeFieldsAttachments.map((attachment) => attachment.offline_id)
|
|
7125
|
+
)
|
|
7126
|
+
);
|
|
7127
|
+
});
|
|
7128
|
+
return [offlineAssetTypeFieldsAttachments, promise.then(({ attachments }) => attachments)];
|
|
7129
|
+
}
|
|
7130
|
+
async refreshStore(organization) {
|
|
7131
|
+
const result = await this.enqueueRequest({
|
|
7132
|
+
description: "Get asset type fields attachments",
|
|
7133
|
+
method: HttpMethod.GET,
|
|
7134
|
+
url: "/asset-type-fields-attachments/",
|
|
7135
|
+
queryParams: {
|
|
7136
|
+
organization: organization.toString()
|
|
7137
|
+
},
|
|
7138
|
+
blockers: [organization.toString()],
|
|
7139
|
+
blocks: []
|
|
7140
|
+
});
|
|
7141
|
+
this.dispatch(initializeAssetTypeFieldsAttachments(result));
|
|
7142
|
+
}
|
|
7143
|
+
}
|
|
7144
|
+
class AssetTypeFieldsService extends BaseApiService {
|
|
7145
|
+
add(payload) {
|
|
7146
|
+
var _a2;
|
|
7147
|
+
const { store } = this.client;
|
|
7148
|
+
const createdBy = (_a2 = store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
7149
|
+
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7150
|
+
const offlineAssetTypeFields = offline({
|
|
7151
|
+
...payload,
|
|
7152
|
+
created_by: createdBy,
|
|
7153
|
+
submitted_at: submittedAt
|
|
7154
|
+
});
|
|
7155
|
+
this.dispatch(addAssetTypeFields(offlineAssetTypeFields));
|
|
7156
|
+
const promise = this.enqueueRequest({
|
|
7157
|
+
description: "Add Asset Type Fields",
|
|
7158
|
+
method: HttpMethod.POST,
|
|
7159
|
+
url: "/asset-type-fields/",
|
|
7160
|
+
payload: offlineAssetTypeFields,
|
|
7161
|
+
blockers: [offlineAssetTypeFields.asset_type],
|
|
7162
|
+
blocks: [offlineAssetTypeFields.offline_id]
|
|
7163
|
+
});
|
|
7164
|
+
promise.then((response) => {
|
|
7165
|
+
this.dispatch(updateAssetTypeFields(response));
|
|
7166
|
+
}).catch((error) => {
|
|
7167
|
+
this.dispatch(deleteAssetTypeFields(offlineAssetTypeFields.offline_id));
|
|
7168
|
+
throw error;
|
|
7169
|
+
});
|
|
7170
|
+
return [offlineAssetTypeFields, promise];
|
|
7171
|
+
}
|
|
7172
|
+
async refreshStore(organizationId) {
|
|
7173
|
+
const result = await this.enqueueRequest({
|
|
7174
|
+
description: "Get Asset Type Fields",
|
|
7175
|
+
method: HttpMethod.GET,
|
|
7176
|
+
url: "/asset-type-fields/",
|
|
7177
|
+
queryParams: {
|
|
7178
|
+
organization: organizationId.toString()
|
|
7179
|
+
},
|
|
7180
|
+
blockers: [],
|
|
7181
|
+
blocks: []
|
|
7182
|
+
});
|
|
7183
|
+
this.dispatch(initializeAssetTypeFields(result));
|
|
7184
|
+
}
|
|
7185
|
+
}
|
|
7186
|
+
class AssetTypeFieldValuesService extends BaseApiService {
|
|
7187
|
+
add(payload) {
|
|
7188
|
+
var _a2;
|
|
7189
|
+
const { store } = this.client;
|
|
7190
|
+
const state = store.getState();
|
|
7191
|
+
const { values } = separateFilesFromValues(payload.values);
|
|
7192
|
+
const offlineAssetTypeFieldValues = offline({
|
|
7193
|
+
...payload,
|
|
7194
|
+
values,
|
|
7195
|
+
created_by: (_a2 = state.userReducer.currentUser) == null ? void 0 : _a2.id,
|
|
7196
|
+
submitted_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
7197
|
+
});
|
|
7198
|
+
const promise = this.enqueueRequest({
|
|
7199
|
+
description: "Add asset type field values",
|
|
7200
|
+
method: HttpMethod.POST,
|
|
7201
|
+
url: "/asset-type-field-values/",
|
|
7202
|
+
payload: offlineAssetTypeFieldValues,
|
|
7203
|
+
blockers: [payload.asset, payload.fields_revision],
|
|
7204
|
+
blocks: [offlineAssetTypeFieldValues.offline_id]
|
|
7205
|
+
});
|
|
7206
|
+
this.dispatch(addAssetTypeFieldValues(offlineAssetTypeFieldValues));
|
|
7207
|
+
promise.then((result) => {
|
|
7208
|
+
this.dispatch(updateAssetTypeFieldValues(result));
|
|
7209
|
+
return result;
|
|
7210
|
+
}).catch(() => {
|
|
7211
|
+
this.dispatch(deleteAssetTypeFieldValues(offlineAssetTypeFieldValues.offline_id));
|
|
7212
|
+
});
|
|
7213
|
+
return [offlineAssetTypeFieldValues, promise];
|
|
7214
|
+
}
|
|
7215
|
+
bulkAdd(payload, batchSize) {
|
|
7216
|
+
var _a2;
|
|
7217
|
+
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7218
|
+
const { values } = separateFilesFromValues(payload.values);
|
|
7219
|
+
const offlineAssetTypeFieldValuesMany = [];
|
|
7220
|
+
const batches = chunkArray(payload.payloads, batchSize ?? payload.payloads.length);
|
|
7221
|
+
const batchPayloads = [];
|
|
7222
|
+
for (const batch of batches) {
|
|
7223
|
+
const assetTypeFieldValuesPayloads = [];
|
|
7224
|
+
for (const payload2 of batch) {
|
|
7225
|
+
const offlineAssetTypeFieldValues = offline({
|
|
7226
|
+
...payload2,
|
|
7227
|
+
values: separateFilesFromValues(payload2.values).values,
|
|
7228
|
+
created_by: (_a2 = this.client.store.getState().userReducer.currentUser) == null ? void 0 : _a2.id,
|
|
7229
|
+
submitted_at: submittedAt
|
|
7230
|
+
});
|
|
7231
|
+
offlineAssetTypeFieldValuesMany.push(offlineAssetTypeFieldValues);
|
|
7232
|
+
assetTypeFieldValuesPayloads.push({
|
|
7233
|
+
offline_id: offlineAssetTypeFieldValues.offline_id,
|
|
7234
|
+
asset: payload2.asset,
|
|
7235
|
+
fields_revision: payload2.fields_revision,
|
|
7236
|
+
published_at: payload2.published_at,
|
|
7237
|
+
values: offlineAssetTypeFieldValues.values
|
|
7238
|
+
});
|
|
7239
|
+
}
|
|
7240
|
+
batchPayloads.push({
|
|
7241
|
+
submitted_at: submittedAt,
|
|
7242
|
+
values,
|
|
7243
|
+
field_values: assetTypeFieldValuesPayloads
|
|
7244
|
+
});
|
|
7245
|
+
}
|
|
7246
|
+
this.dispatch(addAssetTypeFieldValuesMany(offlineAssetTypeFieldValuesMany));
|
|
7247
|
+
const promises = [];
|
|
7248
|
+
for (const payload2 of batchPayloads) {
|
|
7249
|
+
const assetIds = payload2.field_values.map((x) => x.asset);
|
|
7250
|
+
const assetTypeFieldsIds = payload2.field_values.map((x) => x.fields_revision);
|
|
7251
|
+
const assetTypeFieldValuesIds = payload2.field_values.map((x) => x.offline_id);
|
|
7252
|
+
const promise = this.enqueueRequest({
|
|
7253
|
+
description: "Bulk add asset type field values",
|
|
7254
|
+
method: HttpMethod.POST,
|
|
7255
|
+
url: "/asset-type-field-values/bulk/",
|
|
7256
|
+
payload: payload2,
|
|
7257
|
+
blockers: [...assetIds, ...assetTypeFieldsIds],
|
|
7258
|
+
blocks: assetTypeFieldValuesIds
|
|
7259
|
+
});
|
|
7260
|
+
promises.push(promise);
|
|
7261
|
+
}
|
|
7262
|
+
void Promise.all(promises).then((results) => {
|
|
7263
|
+
this.dispatch(updateAssetTypeFieldValuesMany(results.flat()));
|
|
7264
|
+
}).catch(() => {
|
|
7265
|
+
this.dispatch(deleteAssetTypeFieldValuesMany(offlineAssetTypeFieldValuesMany.map((x) => x.offline_id)));
|
|
7266
|
+
});
|
|
7267
|
+
return [offlineAssetTypeFieldValuesMany, promises];
|
|
7268
|
+
}
|
|
7269
|
+
update(payload) {
|
|
7270
|
+
const { store } = this.client;
|
|
7271
|
+
const state = store.getState();
|
|
7272
|
+
const assetTypeFieldValues = selectAssetTypeFieldValuesById(payload.offline_id)(state);
|
|
7273
|
+
if (!assetTypeFieldValues) {
|
|
7274
|
+
throw new Error(`Expected AssetTypeFieldValues with offline_id ${payload.offline_id} to exist`);
|
|
7275
|
+
}
|
|
7276
|
+
const { values } = separateFilesFromValues(payload.values ?? {});
|
|
7277
|
+
const updatedAssetTypeFieldValues = {
|
|
7278
|
+
...assetTypeFieldValues,
|
|
7279
|
+
...payload,
|
|
7280
|
+
// values could also have a partial update
|
|
7281
|
+
values: {
|
|
7282
|
+
...assetTypeFieldValues.values,
|
|
7283
|
+
...values
|
|
7284
|
+
}
|
|
7285
|
+
};
|
|
7286
|
+
this.dispatch(updateAssetTypeFieldValues(updatedAssetTypeFieldValues));
|
|
7287
|
+
const promise = this.enqueueRequest({
|
|
7288
|
+
description: "Delete asset type field values",
|
|
7289
|
+
method: HttpMethod.PATCH,
|
|
7290
|
+
url: `/asset-type-field-values/${payload.offline_id}/`,
|
|
7291
|
+
payload: {
|
|
7292
|
+
...payload,
|
|
7293
|
+
values: {
|
|
7294
|
+
...assetTypeFieldValues.values,
|
|
7295
|
+
...values
|
|
7296
|
+
}
|
|
7297
|
+
},
|
|
7298
|
+
blockers: [
|
|
7299
|
+
updatedAssetTypeFieldValues.offline_id,
|
|
7300
|
+
updatedAssetTypeFieldValues.fields_revision,
|
|
7301
|
+
updatedAssetTypeFieldValues.asset
|
|
7302
|
+
],
|
|
7303
|
+
blocks: [updatedAssetTypeFieldValues.offline_id]
|
|
7304
|
+
});
|
|
7305
|
+
promise.then((result) => {
|
|
7306
|
+
this.dispatch(updateAssetTypeFieldValues(result));
|
|
7307
|
+
}).catch(() => {
|
|
7308
|
+
this.dispatch(updateAssetTypeFieldValues(assetTypeFieldValues));
|
|
7309
|
+
});
|
|
7310
|
+
return [updatedAssetTypeFieldValues, promise];
|
|
7311
|
+
}
|
|
7312
|
+
async delete(id) {
|
|
7313
|
+
const { store } = this.client;
|
|
7314
|
+
const state = store.getState();
|
|
7315
|
+
const assetTypeFieldValues = selectAssetTypeFieldValuesById(id)(state);
|
|
7316
|
+
if (!assetTypeFieldValues) {
|
|
7317
|
+
throw new Error(`Expected submission with offline_id ${id} to exist`);
|
|
7318
|
+
}
|
|
7319
|
+
const assetTypeFieldValuesAttachments = selectAttachmentsOfAssetTypeFieldValues(id)(state);
|
|
7320
|
+
this.dispatch(deleteAssetTypeFieldValues(id));
|
|
7321
|
+
this.dispatch(deleteAssetTypeFieldValuesAttachments(assetTypeFieldValuesAttachments.map((x) => x.offline_id)));
|
|
7322
|
+
try {
|
|
7323
|
+
await this.enqueueRequest({
|
|
7324
|
+
description: "Delete asset type field values",
|
|
7325
|
+
method: HttpMethod.DELETE,
|
|
7326
|
+
url: `/asset-type-field-values/${id}/`,
|
|
7327
|
+
blockers: [id],
|
|
7328
|
+
blocks: []
|
|
7329
|
+
});
|
|
7330
|
+
} catch (e) {
|
|
7331
|
+
this.dispatch(addAssetTypeFieldValues(assetTypeFieldValues));
|
|
7332
|
+
this.dispatch(addAssetTypeFieldValuesAttachments(assetTypeFieldValuesAttachments));
|
|
7333
|
+
throw e;
|
|
7334
|
+
}
|
|
7335
|
+
}
|
|
7336
|
+
async refreshStore(projectId) {
|
|
7337
|
+
const result = await this.enqueueRequest({
|
|
7338
|
+
description: "Get asset type field values",
|
|
7339
|
+
method: HttpMethod.GET,
|
|
7340
|
+
url: "/asset-type-field-values/",
|
|
7341
|
+
queryParams: {
|
|
7342
|
+
project: projectId.toString()
|
|
7343
|
+
},
|
|
7344
|
+
blockers: [],
|
|
7345
|
+
blocks: []
|
|
7346
|
+
});
|
|
7347
|
+
this.dispatch(initializeAssetTypeFieldValues(result));
|
|
7348
|
+
}
|
|
7349
|
+
}
|
|
7350
|
+
class AssetTypeFieldValuesAttachmentService extends BaseUploadService {
|
|
7351
|
+
async bulkAdd(payloads, batchSize) {
|
|
7352
|
+
var _a2;
|
|
7353
|
+
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7354
|
+
const createdBy = (_a2 = this.client.store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
7355
|
+
const batches = chunkArray(payloads, batchSize ?? payloads.length);
|
|
7356
|
+
const offlineAssetTypeFieldValuesAttachments = [];
|
|
7357
|
+
const batchPayloads = [];
|
|
7358
|
+
for (const batch of batches) {
|
|
7359
|
+
const filePayloads = {};
|
|
7360
|
+
const attachmentPayloads = [];
|
|
7361
|
+
for (const payload of batch) {
|
|
7362
|
+
const { fieldValuesId, fieldIdentifier, file } = payload;
|
|
7363
|
+
const filePayload = await this.getFilePayload(file);
|
|
7364
|
+
if (!(filePayload.sha1 in filePayloads)) filePayloads[filePayload.sha1] = filePayload;
|
|
7365
|
+
const offlineAssetTypeFieldValuesAttachment = offline({
|
|
7366
|
+
file: URL.createObjectURL(file),
|
|
7367
|
+
file_type: file.type,
|
|
7368
|
+
file_name: file.name,
|
|
7369
|
+
file_sha1: filePayload.sha1,
|
|
7370
|
+
created_by: createdBy,
|
|
7371
|
+
field_values: fieldValuesId,
|
|
7372
|
+
submitted_at: submittedAt,
|
|
7373
|
+
field_identifier: fieldIdentifier
|
|
7374
|
+
});
|
|
7375
|
+
offlineAssetTypeFieldValuesAttachments.push(offlineAssetTypeFieldValuesAttachment);
|
|
7376
|
+
const attachmentPayload = {
|
|
7377
|
+
offline_id: offlineAssetTypeFieldValuesAttachment.offline_id,
|
|
7378
|
+
file_name: file.name,
|
|
7379
|
+
file_sha1: filePayload.sha1,
|
|
7380
|
+
file_extension: filePayload.extension,
|
|
7381
|
+
field_identifier: fieldIdentifier,
|
|
7382
|
+
field_values: fieldValuesId
|
|
7383
|
+
};
|
|
7384
|
+
attachmentPayloads.push(attachmentPayload);
|
|
7385
|
+
}
|
|
7386
|
+
batchPayloads.push({
|
|
7387
|
+
submitted_at: submittedAt,
|
|
7388
|
+
attachments: attachmentPayloads,
|
|
7389
|
+
files: Object.values(filePayloads)
|
|
7390
|
+
});
|
|
7391
|
+
}
|
|
7392
|
+
this.dispatch(addAssetTypeFieldValuesAttachments(offlineAssetTypeFieldValuesAttachments));
|
|
7393
|
+
const promises = batchPayloads.map((payload) => {
|
|
7394
|
+
return this.enqueueRequest({
|
|
7395
|
+
description: "Add asset type field values attachments",
|
|
7396
|
+
method: HttpMethod.POST,
|
|
7397
|
+
url: "/asset-type-field-values-attachments/bulk/",
|
|
7398
|
+
payload,
|
|
7399
|
+
blockers: payload.attachments.map((payload2) => payload2.field_values),
|
|
7400
|
+
blocks: payload.attachments.map((payload2) => payload2.offline_id)
|
|
7401
|
+
});
|
|
7402
|
+
});
|
|
7403
|
+
Promise.all(promises).then((result) => {
|
|
7404
|
+
for (const res of result) this.processPresignedUrls(res.presigned_urls);
|
|
7405
|
+
const attachments = result.flatMap((res) => res.attachments);
|
|
7406
|
+
this.dispatch(updateAssetTypeFieldValuesAttachments(attachments));
|
|
7407
|
+
}).catch((error) => {
|
|
7408
|
+
this.dispatch(
|
|
7409
|
+
deleteAssetTypeFieldValuesAttachments(
|
|
7410
|
+
offlineAssetTypeFieldValuesAttachments.map((attachment) => attachment.offline_id)
|
|
7411
|
+
)
|
|
7412
|
+
);
|
|
7413
|
+
throw error;
|
|
7414
|
+
});
|
|
7415
|
+
return [
|
|
7416
|
+
offlineAssetTypeFieldValuesAttachments,
|
|
7417
|
+
promises.map((promise) => promise.then(({ attachments }) => attachments))
|
|
7418
|
+
];
|
|
7419
|
+
}
|
|
7420
|
+
async bulkDelete(ids) {
|
|
7421
|
+
const { store } = this.client;
|
|
7422
|
+
const state = store.getState();
|
|
7423
|
+
const attachments = selectAssetTypeFieldValuesAttachmentsByIds(ids)(state);
|
|
7424
|
+
this.dispatch(deleteAssetTypeFieldValuesAttachments(ids));
|
|
7425
|
+
try {
|
|
7426
|
+
await this.enqueueRequest({
|
|
7427
|
+
description: "Delete asset type field values attachments",
|
|
7428
|
+
method: HttpMethod.DELETE,
|
|
7429
|
+
url: "/asset-type-field-values-attachments/bulk/",
|
|
7430
|
+
payload: { attachment_ids: ids },
|
|
7431
|
+
blockers: ids,
|
|
7432
|
+
blocks: []
|
|
7433
|
+
});
|
|
7434
|
+
} catch (e) {
|
|
7435
|
+
this.dispatch(addAssetTypeFieldValuesAttachments(attachments));
|
|
7436
|
+
throw e;
|
|
7437
|
+
}
|
|
7438
|
+
}
|
|
7439
|
+
async refreshStore(projectId) {
|
|
7440
|
+
const result = await this.enqueueRequest({
|
|
7441
|
+
description: "Get asset type field values attachments",
|
|
7442
|
+
method: HttpMethod.GET,
|
|
7443
|
+
url: "/asset-type-field-values-attachments/",
|
|
7444
|
+
queryParams: {
|
|
7445
|
+
project: projectId.toString()
|
|
7446
|
+
},
|
|
7447
|
+
blockers: [],
|
|
7448
|
+
blocks: []
|
|
7449
|
+
});
|
|
7450
|
+
this.dispatch(initializeAssetTypeFieldValuesAttachments(result));
|
|
7451
|
+
}
|
|
7452
|
+
}
|
|
7453
|
+
class IssueTypeFieldsAttachmentService extends BaseUploadService {
|
|
7454
|
+
async bulkAdd(payloads) {
|
|
7455
|
+
var _a2;
|
|
7456
|
+
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7457
|
+
const createdBy = (_a2 = this.client.store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
7458
|
+
const filePayloads = {};
|
|
7459
|
+
const offlineIssueTypeFieldsAttachments = [];
|
|
7460
|
+
const attachmentPayloads = [];
|
|
7461
|
+
for (const payload of payloads) {
|
|
7462
|
+
const { fieldsRevisionId, fieldIdentifier, file } = payload;
|
|
7463
|
+
const filePayload = await this.getFilePayload(file);
|
|
7464
|
+
if (!(filePayload.sha1 in filePayloads)) filePayloads[filePayload.sha1] = filePayload;
|
|
7465
|
+
const offlineIssueTypeFieldsAttachment = offline({
|
|
7466
|
+
file: URL.createObjectURL(file),
|
|
7467
|
+
file_type: file.type,
|
|
7468
|
+
file_name: file.name,
|
|
7469
|
+
file_sha1: filePayload.sha1,
|
|
7470
|
+
created_by: createdBy,
|
|
7471
|
+
fields_revision: fieldsRevisionId,
|
|
7472
|
+
submitted_at: submittedAt,
|
|
7473
|
+
field_identifier: fieldIdentifier
|
|
7474
|
+
});
|
|
7475
|
+
offlineIssueTypeFieldsAttachments.push(offlineIssueTypeFieldsAttachment);
|
|
7476
|
+
const attachmentPayload = {
|
|
7477
|
+
offline_id: offlineIssueTypeFieldsAttachment.offline_id,
|
|
7478
|
+
file_name: file.name,
|
|
7479
|
+
file_extension: filePayload.extension,
|
|
7480
|
+
field_identifier: fieldIdentifier,
|
|
7481
|
+
file_sha1: filePayload.sha1,
|
|
7482
|
+
fields_revision: fieldsRevisionId
|
|
7483
|
+
};
|
|
7484
|
+
attachmentPayloads.push(attachmentPayload);
|
|
7485
|
+
}
|
|
7486
|
+
this.dispatch(addIssueTypeFieldsAttachments(offlineIssueTypeFieldsAttachments));
|
|
7487
|
+
const promise = this.enqueueRequest({
|
|
7488
|
+
description: "Add issue type fields attachments",
|
|
7489
|
+
method: HttpMethod.POST,
|
|
7490
|
+
url: "/issue-type-fields-attachments/bulk/",
|
|
7491
|
+
payload: {
|
|
7492
|
+
submitted_at: submittedAt,
|
|
7493
|
+
attachments: attachmentPayloads,
|
|
7494
|
+
files: Object.values(filePayloads)
|
|
7495
|
+
},
|
|
7496
|
+
blockers: offlineIssueTypeFieldsAttachments.map((attachment) => attachment.fields_revision),
|
|
7497
|
+
blocks: offlineIssueTypeFieldsAttachments.map((attachment) => attachment.offline_id)
|
|
7498
|
+
});
|
|
7499
|
+
promise.then((result) => {
|
|
7500
|
+
this.processPresignedUrls(result.presigned_urls);
|
|
7501
|
+
this.dispatch(updateIssueTypeFieldsAttachments(result.attachments));
|
|
7502
|
+
}).catch(() => {
|
|
7503
|
+
this.dispatch(
|
|
7504
|
+
deleteIssueTypeFieldsAttachments(
|
|
7505
|
+
offlineIssueTypeFieldsAttachments.map((attachment) => attachment.offline_id)
|
|
7506
|
+
)
|
|
7507
|
+
);
|
|
7508
|
+
});
|
|
7509
|
+
return [offlineIssueTypeFieldsAttachments, promise.then(({ attachments }) => attachments)];
|
|
7510
|
+
}
|
|
7511
|
+
async refreshStore(organizationId) {
|
|
7512
|
+
const result = await this.enqueueRequest({
|
|
7513
|
+
description: "get issue type fields attachments",
|
|
7514
|
+
method: HttpMethod.GET,
|
|
7515
|
+
url: "/issue-type-fields-attachments/",
|
|
7516
|
+
queryParams: {
|
|
7517
|
+
organization: organizationId.toString()
|
|
7518
|
+
},
|
|
7519
|
+
blockers: [organizationId.toString()],
|
|
7520
|
+
blocks: []
|
|
7521
|
+
});
|
|
7522
|
+
this.dispatch(initializeIssueTypeFieldsAttachments(result));
|
|
7523
|
+
}
|
|
7524
|
+
}
|
|
7525
|
+
class IssueTypeFieldsService extends BaseApiService {
|
|
7526
|
+
add(payload) {
|
|
7527
|
+
var _a2;
|
|
7528
|
+
const { store } = this.client;
|
|
7529
|
+
const createdBy = (_a2 = store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
7530
|
+
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7531
|
+
const offlineIssueTypeFields = offline({
|
|
7532
|
+
...payload,
|
|
7533
|
+
created_by: createdBy,
|
|
7534
|
+
submitted_at: submittedAt
|
|
7535
|
+
});
|
|
7536
|
+
this.dispatch(addIssueTypeFields(offlineIssueTypeFields));
|
|
7537
|
+
const promise = this.enqueueRequest({
|
|
7538
|
+
description: "Add Issue Type Fields",
|
|
7539
|
+
method: HttpMethod.POST,
|
|
7540
|
+
url: "/issue-type-fields/",
|
|
7541
|
+
payload: offlineIssueTypeFields,
|
|
7542
|
+
blockers: [offlineIssueTypeFields.issue_type],
|
|
7543
|
+
blocks: [offlineIssueTypeFields.offline_id]
|
|
7544
|
+
});
|
|
7545
|
+
promise.then((response) => {
|
|
7546
|
+
this.dispatch(updateIssueTypeFields(response));
|
|
7547
|
+
}).catch((error) => {
|
|
7548
|
+
this.dispatch(deleteIssueTypeFields(offlineIssueTypeFields.offline_id));
|
|
7549
|
+
throw error;
|
|
7550
|
+
});
|
|
7551
|
+
return [offlineIssueTypeFields, promise];
|
|
7552
|
+
}
|
|
7553
|
+
async refreshStore(organizationId) {
|
|
7554
|
+
const result = await this.enqueueRequest({
|
|
7555
|
+
description: "Get Issue Type Fields",
|
|
7556
|
+
method: HttpMethod.GET,
|
|
7557
|
+
url: "/issue-type-fields/",
|
|
7558
|
+
queryParams: {
|
|
7559
|
+
organization: organizationId.toString()
|
|
7560
|
+
},
|
|
7561
|
+
blockers: [],
|
|
7562
|
+
blocks: []
|
|
7563
|
+
});
|
|
7564
|
+
this.dispatch(initializeIssueTypeFields(result));
|
|
7565
|
+
}
|
|
7566
|
+
}
|
|
7567
|
+
class IssueTypeFieldValuesAttachmentService extends BaseUploadService {
|
|
7568
|
+
async bulkAdd(payloads) {
|
|
7569
|
+
var _a2;
|
|
7570
|
+
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7571
|
+
const createdBy = (_a2 = this.client.store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
7572
|
+
const filePayloads = {};
|
|
7573
|
+
const offlineIssueTypeFieldValuesAttachments = [];
|
|
7574
|
+
const attachmentPayloads = [];
|
|
7575
|
+
for (const payload of payloads) {
|
|
7576
|
+
const { fieldValuesId, fieldIdentifier, file } = payload;
|
|
7577
|
+
const filePayload = await this.getFilePayload(file);
|
|
7578
|
+
if (!(filePayload.sha1 in filePayloads)) filePayloads[filePayload.sha1] = filePayload;
|
|
7579
|
+
const offlineIssueTypeFieldValuesAttachment = offline({
|
|
7580
|
+
file: URL.createObjectURL(file),
|
|
7581
|
+
file_type: file.type,
|
|
7582
|
+
file_name: file.name,
|
|
7583
|
+
file_sha1: filePayload.sha1,
|
|
7584
|
+
created_by: createdBy,
|
|
7585
|
+
field_values: fieldValuesId,
|
|
7586
|
+
submitted_at: submittedAt,
|
|
7587
|
+
field_identifier: fieldIdentifier
|
|
7588
|
+
});
|
|
7589
|
+
offlineIssueTypeFieldValuesAttachments.push(offlineIssueTypeFieldValuesAttachment);
|
|
7590
|
+
const attachmentPayload = {
|
|
7591
|
+
offline_id: offlineIssueTypeFieldValuesAttachment.offline_id,
|
|
7592
|
+
file_name: file.name,
|
|
7593
|
+
file_sha1: filePayload.sha1,
|
|
7594
|
+
file_extension: filePayload.extension,
|
|
7595
|
+
field_identifier: fieldIdentifier,
|
|
7596
|
+
field_values: fieldValuesId
|
|
7597
|
+
};
|
|
7598
|
+
attachmentPayloads.push(attachmentPayload);
|
|
7599
|
+
}
|
|
7600
|
+
this.dispatch(addIssueTypeFieldValuesAttachments(offlineIssueTypeFieldValuesAttachments));
|
|
7601
|
+
const promise = this.enqueueRequest({
|
|
7602
|
+
description: "Add issue type field values attachments",
|
|
7603
|
+
method: HttpMethod.POST,
|
|
7604
|
+
url: "/issue-type-field-values-attachments/bulk/",
|
|
7605
|
+
payload: {
|
|
7606
|
+
submitted_at: submittedAt,
|
|
7607
|
+
attachments: attachmentPayloads,
|
|
7608
|
+
files: Object.values(filePayloads)
|
|
7609
|
+
},
|
|
7610
|
+
blockers: offlineIssueTypeFieldValuesAttachments.map((attachment) => attachment.field_values),
|
|
7611
|
+
blocks: offlineIssueTypeFieldValuesAttachments.map((attachment) => attachment.offline_id)
|
|
7612
|
+
});
|
|
7613
|
+
promise.then(({ presigned_urls, attachments }) => {
|
|
7614
|
+
this.processPresignedUrls(presigned_urls);
|
|
7615
|
+
this.dispatch(updateIssueTypeFieldValuesAttachments(attachments));
|
|
7616
|
+
}).catch((error) => {
|
|
7617
|
+
this.dispatch(
|
|
7618
|
+
deleteIssueTypeFieldValuesAttachments(
|
|
7619
|
+
offlineIssueTypeFieldValuesAttachments.map((attachment) => attachment.offline_id)
|
|
7620
|
+
)
|
|
7621
|
+
);
|
|
7622
|
+
throw error;
|
|
7623
|
+
});
|
|
7624
|
+
return [offlineIssueTypeFieldValuesAttachments, promise.then(({ attachments }) => attachments)];
|
|
7625
|
+
}
|
|
7626
|
+
async bulkDelete(attachmentsIds) {
|
|
7627
|
+
const { store } = this.client;
|
|
7628
|
+
const state = store.getState();
|
|
7629
|
+
const attachments = selectIssueTypeFieldValuesAttachmentsByIds(attachmentsIds)(state);
|
|
7630
|
+
this.dispatch(deleteIssueTypeFieldValuesAttachments(attachmentsIds));
|
|
7631
|
+
try {
|
|
7632
|
+
await this.enqueueRequest({
|
|
7633
|
+
description: "Delete issue type field values attachments",
|
|
7634
|
+
method: HttpMethod.DELETE,
|
|
7635
|
+
url: "/issue-type-field-values-attachments/bulk/",
|
|
7636
|
+
payload: { attachment_ids: attachmentsIds },
|
|
7637
|
+
blockers: attachmentsIds,
|
|
7638
|
+
blocks: []
|
|
7639
|
+
});
|
|
7640
|
+
} catch (e) {
|
|
7641
|
+
this.dispatch(addIssueTypeFieldValuesAttachments(attachments));
|
|
7642
|
+
throw e;
|
|
7643
|
+
}
|
|
7644
|
+
}
|
|
7645
|
+
async refreshStore(projectId) {
|
|
7646
|
+
const result = await this.enqueueRequest({
|
|
7647
|
+
description: "Get issue type field values attachments",
|
|
7648
|
+
method: HttpMethod.GET,
|
|
7649
|
+
url: "/issue-type-field-values-attachments/",
|
|
7650
|
+
queryParams: {
|
|
7651
|
+
project: projectId.toString()
|
|
7652
|
+
},
|
|
7653
|
+
blockers: [],
|
|
7654
|
+
blocks: []
|
|
7655
|
+
});
|
|
7656
|
+
this.dispatch(initializeIssueTypeFieldValuesAttachments(result));
|
|
7657
|
+
}
|
|
7658
|
+
}
|
|
7659
|
+
class IssueTypeFieldValuesService extends BaseApiService {
|
|
7660
|
+
add(payload) {
|
|
7661
|
+
var _a2;
|
|
7662
|
+
const { store } = this.client;
|
|
7663
|
+
const state = store.getState();
|
|
7664
|
+
const { values } = separateFilesFromValues(payload.values);
|
|
7665
|
+
const offlineIssueTypeFieldValues = offline({
|
|
7666
|
+
...payload,
|
|
7667
|
+
values,
|
|
7668
|
+
created_by: (_a2 = state.userReducer.currentUser) == null ? void 0 : _a2.id,
|
|
7669
|
+
submitted_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
7670
|
+
});
|
|
7671
|
+
const promise = this.enqueueRequest({
|
|
7672
|
+
description: "Add issue type field values",
|
|
7673
|
+
method: HttpMethod.POST,
|
|
7674
|
+
url: "/issue-type-field-values/",
|
|
7675
|
+
payload: offlineIssueTypeFieldValues,
|
|
7676
|
+
blockers: [payload.issue, payload.fields_revision],
|
|
7677
|
+
blocks: [offlineIssueTypeFieldValues.offline_id]
|
|
7678
|
+
});
|
|
7679
|
+
this.dispatch(addIssueTypeFieldValues(offlineIssueTypeFieldValues));
|
|
7680
|
+
promise.then((result) => {
|
|
7681
|
+
this.dispatch(updateIssueTypeFieldValues(result));
|
|
7682
|
+
return result;
|
|
7683
|
+
}).catch(() => {
|
|
7684
|
+
this.dispatch(deleteIssueTypeFieldValues(offlineIssueTypeFieldValues.offline_id));
|
|
7685
|
+
});
|
|
7686
|
+
return [offlineIssueTypeFieldValues, promise];
|
|
7687
|
+
}
|
|
7688
|
+
update(payload) {
|
|
7689
|
+
const { store } = this.client;
|
|
7690
|
+
const state = store.getState();
|
|
7691
|
+
const issueTypeFieldValues = selectIssueTypeFieldValuesById(payload.offline_id)(state);
|
|
7692
|
+
if (!issueTypeFieldValues) {
|
|
7693
|
+
throw new Error(`Expected IssueTypeFieldValues with offline_id ${payload.offline_id} to exist`);
|
|
7694
|
+
}
|
|
7695
|
+
const { values } = separateFilesFromValues(payload.values ?? {});
|
|
7696
|
+
const updatedIssueTypeFieldValues = {
|
|
7697
|
+
...issueTypeFieldValues,
|
|
7698
|
+
...payload,
|
|
7699
|
+
// values could also have a partial update
|
|
7700
|
+
values: {
|
|
7701
|
+
...issueTypeFieldValues.values,
|
|
7702
|
+
...values
|
|
7703
|
+
}
|
|
7704
|
+
};
|
|
7705
|
+
this.dispatch(updateIssueTypeFieldValues(updatedIssueTypeFieldValues));
|
|
7706
|
+
const promise = this.enqueueRequest({
|
|
7707
|
+
description: "Update issue type field values",
|
|
7708
|
+
method: HttpMethod.PATCH,
|
|
7709
|
+
url: `/issue-type-field-values/${payload.offline_id}/`,
|
|
7710
|
+
payload: {
|
|
7711
|
+
...payload,
|
|
7712
|
+
values: {
|
|
7713
|
+
...issueTypeFieldValues.values,
|
|
7714
|
+
...values
|
|
7715
|
+
}
|
|
7716
|
+
},
|
|
7717
|
+
blockers: [
|
|
7718
|
+
updatedIssueTypeFieldValues.offline_id,
|
|
7719
|
+
updatedIssueTypeFieldValues.fields_revision,
|
|
7720
|
+
updatedIssueTypeFieldValues.issue
|
|
7721
|
+
],
|
|
7722
|
+
blocks: [updatedIssueTypeFieldValues.offline_id]
|
|
7723
|
+
});
|
|
7724
|
+
promise.then((result) => {
|
|
7725
|
+
this.dispatch(updateIssueTypeFieldValues(result));
|
|
7726
|
+
}).catch(() => {
|
|
7727
|
+
this.dispatch(updateIssueTypeFieldValues(issueTypeFieldValues));
|
|
7728
|
+
});
|
|
7729
|
+
return [updatedIssueTypeFieldValues, promise];
|
|
7730
|
+
}
|
|
7731
|
+
async delete(id) {
|
|
7732
|
+
const { store } = this.client;
|
|
7733
|
+
const state = store.getState();
|
|
7734
|
+
const issueTypeFieldValues = selectIssueTypeFieldValuesById(id)(state);
|
|
7735
|
+
if (!issueTypeFieldValues) {
|
|
7736
|
+
throw new Error(`Expected submission with offline_id ${id} to exist`);
|
|
7737
|
+
}
|
|
7738
|
+
const issueTypeFieldValuesAttachments = selectAttachmentsOfIssueTypeFieldValues(id)(state);
|
|
7739
|
+
this.dispatch(deleteIssueTypeFieldValues(id));
|
|
7740
|
+
this.dispatch(deleteIssueTypeFieldValuesAttachments(issueTypeFieldValuesAttachments.map((x) => x.offline_id)));
|
|
7741
|
+
try {
|
|
7742
|
+
await this.enqueueRequest({
|
|
7743
|
+
description: "Delete issue type field values",
|
|
7744
|
+
method: HttpMethod.DELETE,
|
|
7745
|
+
url: `/issue-type-field-values/${id}/`,
|
|
7746
|
+
blockers: [id],
|
|
7747
|
+
blocks: []
|
|
7748
|
+
});
|
|
7749
|
+
} catch (e) {
|
|
7750
|
+
this.dispatch(addIssueTypeFieldValues(issueTypeFieldValues));
|
|
7751
|
+
this.dispatch(addIssueTypeFieldValuesAttachments(issueTypeFieldValuesAttachments));
|
|
7752
|
+
throw e;
|
|
7753
|
+
}
|
|
7754
|
+
}
|
|
7755
|
+
async refreshStore(projectId) {
|
|
7756
|
+
const result = await this.enqueueRequest({
|
|
7757
|
+
description: "Get issue type field values",
|
|
7758
|
+
method: HttpMethod.GET,
|
|
7759
|
+
url: "/issue-type-field-values/",
|
|
7760
|
+
queryParams: {
|
|
7761
|
+
project: projectId.toString()
|
|
7762
|
+
},
|
|
7763
|
+
blockers: [],
|
|
7764
|
+
blocks: []
|
|
7765
|
+
});
|
|
7766
|
+
this.dispatch(initializeIssueTypeFieldValues(result));
|
|
7767
|
+
}
|
|
7768
|
+
}
|
|
7048
7769
|
var VerificationCodeType = /* @__PURE__ */ ((VerificationCodeType2) => {
|
|
7049
7770
|
VerificationCodeType2[VerificationCodeType2["USER_REGISTRATION"] = 0] = "USER_REGISTRATION";
|
|
7050
7771
|
VerificationCodeType2[VerificationCodeType2["APPLICATION_INVITE"] = 2] = "APPLICATION_INVITE";
|
|
@@ -7061,6 +7782,10 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
7061
7782
|
exports2.AssetStageCompletionService = AssetStageCompletionService;
|
|
7062
7783
|
exports2.AssetStageService = AssetStageService;
|
|
7063
7784
|
exports2.AssetTypeAttachmentService = AssetTypeAttachmentService;
|
|
7785
|
+
exports2.AssetTypeFieldValuesAttachmentService = AssetTypeFieldValuesAttachmentService;
|
|
7786
|
+
exports2.AssetTypeFieldValuesService = AssetTypeFieldValuesService;
|
|
7787
|
+
exports2.AssetTypeFieldsAttachmentService = AssetTypeFieldsAttachmentService;
|
|
7788
|
+
exports2.AssetTypeFieldsService = AssetTypeFieldsService;
|
|
7064
7789
|
exports2.AssetTypeService = AssetTypeService;
|
|
7065
7790
|
exports2.AttachmentModel = AttachmentModel;
|
|
7066
7791
|
exports2.BaseApiService = BaseApiService;
|
|
@@ -7077,7 +7802,10 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
7077
7802
|
exports2.EmailDomainsService = EmailDomainsService;
|
|
7078
7803
|
exports2.EmailVerificationService = EmailVerificationService;
|
|
7079
7804
|
exports2.FileService = FileService;
|
|
7805
|
+
exports2.FormRevisionAttachmentService = FormRevisionAttachmentService;
|
|
7806
|
+
exports2.FormRevisionService = FormRevisionService;
|
|
7080
7807
|
exports2.FormService = FormService;
|
|
7808
|
+
exports2.FormSubmissionAttachmentService = FormSubmissionAttachmentService;
|
|
7081
7809
|
exports2.FormSubmissionService = FormSubmissionService;
|
|
7082
7810
|
exports2.GREEN = GREEN;
|
|
7083
7811
|
exports2.GeoImageService = GeoImageService;
|
|
@@ -7088,6 +7816,10 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
7088
7816
|
exports2.IssuePriority = IssuePriority;
|
|
7089
7817
|
exports2.IssueService = IssueService;
|
|
7090
7818
|
exports2.IssueStatus = IssueStatus;
|
|
7819
|
+
exports2.IssueTypeFieldValuesAttachmentService = IssueTypeFieldValuesAttachmentService;
|
|
7820
|
+
exports2.IssueTypeFieldValuesService = IssueTypeFieldValuesService;
|
|
7821
|
+
exports2.IssueTypeFieldsAttachmentService = IssueTypeFieldsAttachmentService;
|
|
7822
|
+
exports2.IssueTypeFieldsService = IssueTypeFieldsService;
|
|
7091
7823
|
exports2.IssueTypeService = IssueTypeService;
|
|
7092
7824
|
exports2.IssueUpdateChange = IssueUpdateChange;
|
|
7093
7825
|
exports2.IssueUpdateService = IssueUpdateService;
|
|
@@ -7126,6 +7858,14 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
7126
7858
|
exports2.addAssetType = addAssetType;
|
|
7127
7859
|
exports2.addAssetTypeAttachment = addAssetTypeAttachment;
|
|
7128
7860
|
exports2.addAssetTypeAttachments = addAssetTypeAttachments;
|
|
7861
|
+
exports2.addAssetTypeFieldValues = addAssetTypeFieldValues;
|
|
7862
|
+
exports2.addAssetTypeFieldValuesAttachment = addAssetTypeFieldValuesAttachment;
|
|
7863
|
+
exports2.addAssetTypeFieldValuesAttachments = addAssetTypeFieldValuesAttachments;
|
|
7864
|
+
exports2.addAssetTypeFieldValuesMany = addAssetTypeFieldValuesMany;
|
|
7865
|
+
exports2.addAssetTypeFields = addAssetTypeFields;
|
|
7866
|
+
exports2.addAssetTypeFieldsAttachment = addAssetTypeFieldsAttachment;
|
|
7867
|
+
exports2.addAssetTypeFieldsAttachments = addAssetTypeFieldsAttachments;
|
|
7868
|
+
exports2.addAssetTypeFieldsMany = addAssetTypeFieldsMany;
|
|
7129
7869
|
exports2.addAssetTypes = addAssetTypes;
|
|
7130
7870
|
exports2.addAssets = addAssets;
|
|
7131
7871
|
exports2.addCategory = addCategory;
|
|
@@ -7154,6 +7894,14 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
7154
7894
|
exports2.addIssueComment = addIssueComment;
|
|
7155
7895
|
exports2.addIssueComments = addIssueComments;
|
|
7156
7896
|
exports2.addIssueType = addIssueType;
|
|
7897
|
+
exports2.addIssueTypeFieldValues = addIssueTypeFieldValues;
|
|
7898
|
+
exports2.addIssueTypeFieldValuesAttachment = addIssueTypeFieldValuesAttachment;
|
|
7899
|
+
exports2.addIssueTypeFieldValuesAttachments = addIssueTypeFieldValuesAttachments;
|
|
7900
|
+
exports2.addIssueTypeFieldValuesMany = addIssueTypeFieldValuesMany;
|
|
7901
|
+
exports2.addIssueTypeFields = addIssueTypeFields;
|
|
7902
|
+
exports2.addIssueTypeFieldsAttachment = addIssueTypeFieldsAttachment;
|
|
7903
|
+
exports2.addIssueTypeFieldsAttachments = addIssueTypeFieldsAttachments;
|
|
7904
|
+
exports2.addIssueTypeFieldsMany = addIssueTypeFieldsMany;
|
|
7157
7905
|
exports2.addIssueUpdate = addIssueUpdate;
|
|
7158
7906
|
exports2.addIssueUpdates = addIssueUpdates;
|
|
7159
7907
|
exports2.addIssues = addIssues;
|
|
@@ -7178,6 +7926,14 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
7178
7926
|
exports2.assetStageSlice = assetStageSlice;
|
|
7179
7927
|
exports2.assetTypeAttachmentReducer = assetTypeAttachmentReducer;
|
|
7180
7928
|
exports2.assetTypeAttachmentSlice = assetTypeAttachmentSlice;
|
|
7929
|
+
exports2.assetTypeFieldValuesAttachmentReducer = assetTypeFieldValuesAttachmentReducer;
|
|
7930
|
+
exports2.assetTypeFieldValuesAttachmentSlice = assetTypeFieldValuesAttachmentSlice;
|
|
7931
|
+
exports2.assetTypeFieldValuesReducer = assetTypeFieldValuesReducer;
|
|
7932
|
+
exports2.assetTypeFieldValuesSlice = assetTypeFieldValuesSlice;
|
|
7933
|
+
exports2.assetTypeFieldsAttachmentReducer = assetTypeFieldsAttachmentReducer;
|
|
7934
|
+
exports2.assetTypeFieldsAttachmentSlice = assetTypeFieldsAttachmentSlice;
|
|
7935
|
+
exports2.assetTypeFieldsReducer = assetTypeFieldsReducer;
|
|
7936
|
+
exports2.assetTypeFieldsSlice = assetTypeFieldsSlice;
|
|
7181
7937
|
exports2.assetTypeReducer = assetTypeReducer;
|
|
7182
7938
|
exports2.assetTypeSlice = assetTypeSlice;
|
|
7183
7939
|
exports2.authReducer = authReducer;
|
|
@@ -7202,6 +7958,14 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
7202
7958
|
exports2.deleteAssetType = deleteAssetType;
|
|
7203
7959
|
exports2.deleteAssetTypeAttachment = deleteAssetTypeAttachment;
|
|
7204
7960
|
exports2.deleteAssetTypeAttachments = deleteAssetTypeAttachments;
|
|
7961
|
+
exports2.deleteAssetTypeFieldValues = deleteAssetTypeFieldValues;
|
|
7962
|
+
exports2.deleteAssetTypeFieldValuesAttachment = deleteAssetTypeFieldValuesAttachment;
|
|
7963
|
+
exports2.deleteAssetTypeFieldValuesAttachments = deleteAssetTypeFieldValuesAttachments;
|
|
7964
|
+
exports2.deleteAssetTypeFieldValuesMany = deleteAssetTypeFieldValuesMany;
|
|
7965
|
+
exports2.deleteAssetTypeFields = deleteAssetTypeFields;
|
|
7966
|
+
exports2.deleteAssetTypeFieldsAttachment = deleteAssetTypeFieldsAttachment;
|
|
7967
|
+
exports2.deleteAssetTypeFieldsAttachments = deleteAssetTypeFieldsAttachments;
|
|
7968
|
+
exports2.deleteAssetTypeFieldsMany = deleteAssetTypeFieldsMany;
|
|
7205
7969
|
exports2.deleteAssetTypes = deleteAssetTypes;
|
|
7206
7970
|
exports2.deleteAssets = deleteAssets;
|
|
7207
7971
|
exports2.deleteCategory = deleteCategory;
|
|
@@ -7226,6 +7990,14 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
7226
7990
|
exports2.deleteIssueAttachments = deleteIssueAttachments;
|
|
7227
7991
|
exports2.deleteIssueComment = deleteIssueComment;
|
|
7228
7992
|
exports2.deleteIssueComments = deleteIssueComments;
|
|
7993
|
+
exports2.deleteIssueTypeFieldValues = deleteIssueTypeFieldValues;
|
|
7994
|
+
exports2.deleteIssueTypeFieldValuesAttachment = deleteIssueTypeFieldValuesAttachment;
|
|
7995
|
+
exports2.deleteIssueTypeFieldValuesAttachments = deleteIssueTypeFieldValuesAttachments;
|
|
7996
|
+
exports2.deleteIssueTypeFieldValuesMany = deleteIssueTypeFieldValuesMany;
|
|
7997
|
+
exports2.deleteIssueTypeFields = deleteIssueTypeFields;
|
|
7998
|
+
exports2.deleteIssueTypeFieldsAttachment = deleteIssueTypeFieldsAttachment;
|
|
7999
|
+
exports2.deleteIssueTypeFieldsAttachments = deleteIssueTypeFieldsAttachments;
|
|
8000
|
+
exports2.deleteIssueTypeFieldsMany = deleteIssueTypeFieldsMany;
|
|
7229
8001
|
exports2.deleteIssueUpdate = deleteIssueUpdate;
|
|
7230
8002
|
exports2.deleteIssueUpdates = deleteIssueUpdates;
|
|
7231
8003
|
exports2.deleteIssues = deleteIssues;
|
|
@@ -7283,6 +8055,10 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
7283
8055
|
exports2.initializeAssetStageCompletions = initializeAssetStageCompletions;
|
|
7284
8056
|
exports2.initializeAssetStages = initializeAssetStages;
|
|
7285
8057
|
exports2.initializeAssetTypeAttachments = initializeAssetTypeAttachments;
|
|
8058
|
+
exports2.initializeAssetTypeFieldValues = initializeAssetTypeFieldValues;
|
|
8059
|
+
exports2.initializeAssetTypeFieldValuesAttachments = initializeAssetTypeFieldValuesAttachments;
|
|
8060
|
+
exports2.initializeAssetTypeFields = initializeAssetTypeFields;
|
|
8061
|
+
exports2.initializeAssetTypeFieldsAttachments = initializeAssetTypeFieldsAttachments;
|
|
7286
8062
|
exports2.initializeAssetTypes = initializeAssetTypes;
|
|
7287
8063
|
exports2.initializeAssets = initializeAssets;
|
|
7288
8064
|
exports2.initializeCategories = initializeCategories;
|
|
@@ -7297,6 +8073,10 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
7297
8073
|
exports2.initializeGeoImages = initializeGeoImages;
|
|
7298
8074
|
exports2.initializeIssueAssociations = initializeIssueAssociations;
|
|
7299
8075
|
exports2.initializeIssueAttachments = initializeIssueAttachments;
|
|
8076
|
+
exports2.initializeIssueTypeFieldValues = initializeIssueTypeFieldValues;
|
|
8077
|
+
exports2.initializeIssueTypeFieldValuesAttachments = initializeIssueTypeFieldValuesAttachments;
|
|
8078
|
+
exports2.initializeIssueTypeFields = initializeIssueTypeFields;
|
|
8079
|
+
exports2.initializeIssueTypeFieldsAttachments = initializeIssueTypeFieldsAttachments;
|
|
7300
8080
|
exports2.initializeIssueTypes = initializeIssueTypes;
|
|
7301
8081
|
exports2.initializeIssueUpdates = initializeIssueUpdates;
|
|
7302
8082
|
exports2.initializeIssues = initializeIssues;
|
|
@@ -7316,6 +8096,14 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
7316
8096
|
exports2.issueCommentSlice = issueCommentSlice;
|
|
7317
8097
|
exports2.issueReducer = issueReducer;
|
|
7318
8098
|
exports2.issueSlice = issueSlice;
|
|
8099
|
+
exports2.issueTypeFieldValuesAttachmentReducer = issueTypeFieldValuesAttachmentReducer;
|
|
8100
|
+
exports2.issueTypeFieldValuesAttachmentSlice = issueTypeFieldValuesAttachmentSlice;
|
|
8101
|
+
exports2.issueTypeFieldValuesReducer = issueTypeFieldValuesReducer;
|
|
8102
|
+
exports2.issueTypeFieldValuesSlice = issueTypeFieldValuesSlice;
|
|
8103
|
+
exports2.issueTypeFieldsAttachmentReducer = issueTypeFieldsAttachmentReducer;
|
|
8104
|
+
exports2.issueTypeFieldsAttachmentSlice = issueTypeFieldsAttachmentSlice;
|
|
8105
|
+
exports2.issueTypeFieldsReducer = issueTypeFieldsReducer;
|
|
8106
|
+
exports2.issueTypeFieldsSlice = issueTypeFieldsSlice;
|
|
7319
8107
|
exports2.issueTypeReducer = issueTypeReducer;
|
|
7320
8108
|
exports2.issueTypeSlice = issueTypeSlice;
|
|
7321
8109
|
exports2.issueUpdateReducer = issueUpdateReducer;
|
|
@@ -7379,7 +8167,23 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
7379
8167
|
exports2.selectAssetTypeAttachmentMapping = selectAssetTypeAttachmentMapping;
|
|
7380
8168
|
exports2.selectAssetTypeAttachments = selectAssetTypeAttachments;
|
|
7381
8169
|
exports2.selectAssetTypeById = selectAssetTypeById;
|
|
8170
|
+
exports2.selectAssetTypeFieldValues = selectAssetTypeFieldValues;
|
|
8171
|
+
exports2.selectAssetTypeFieldValuesAttachmentById = selectAssetTypeFieldValuesAttachmentById;
|
|
8172
|
+
exports2.selectAssetTypeFieldValuesAttachments = selectAssetTypeFieldValuesAttachments;
|
|
8173
|
+
exports2.selectAssetTypeFieldValuesAttachmentsByIds = selectAssetTypeFieldValuesAttachmentsByIds;
|
|
8174
|
+
exports2.selectAssetTypeFieldValuesAttachmentsMapping = selectAssetTypeFieldValuesAttachmentsMapping;
|
|
8175
|
+
exports2.selectAssetTypeFieldValuesById = selectAssetTypeFieldValuesById;
|
|
8176
|
+
exports2.selectAssetTypeFieldValuesMapping = selectAssetTypeFieldValuesMapping;
|
|
8177
|
+
exports2.selectAssetTypeFieldValuesOfAsset = selectAssetTypeFieldValuesOfAsset;
|
|
8178
|
+
exports2.selectAssetTypeFields = selectAssetTypeFields;
|
|
8179
|
+
exports2.selectAssetTypeFieldsAttachmentById = selectAssetTypeFieldsAttachmentById;
|
|
8180
|
+
exports2.selectAssetTypeFieldsAttachments = selectAssetTypeFieldsAttachments;
|
|
8181
|
+
exports2.selectAssetTypeFieldsAttachmentsMapping = selectAssetTypeFieldsAttachmentsMapping;
|
|
8182
|
+
exports2.selectAssetTypeFieldsById = selectAssetTypeFieldsById;
|
|
8183
|
+
exports2.selectAssetTypeFieldsMapping = selectAssetTypeFieldsMapping;
|
|
8184
|
+
exports2.selectAssetTypeFieldsOfAssetType = selectAssetTypeFieldsOfAssetType;
|
|
7382
8185
|
exports2.selectAssetTypeStagesMapping = selectAssetTypeStagesMapping;
|
|
8186
|
+
exports2.selectAssetTypeValuesOfAssetType = selectAssetTypeValuesOfAssetType;
|
|
7383
8187
|
exports2.selectAssetTypes = selectAssetTypes;
|
|
7384
8188
|
exports2.selectAssetTypesByIds = selectAssetTypesByIds;
|
|
7385
8189
|
exports2.selectAssetTypesMapping = selectAssetTypesMapping;
|
|
@@ -7387,18 +8191,20 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
7387
8191
|
exports2.selectAssetsByIds = selectAssetsByIds;
|
|
7388
8192
|
exports2.selectAssetsMapping = selectAssetsMapping;
|
|
7389
8193
|
exports2.selectAssetsOfAssetType = selectAssetsOfAssetType;
|
|
7390
|
-
exports2.selectAttachedFormSubmissionsOfAsset = selectAttachedFormSubmissionsOfAsset;
|
|
7391
|
-
exports2.selectAttachedFormSubmissionsOfIssue = selectAttachedFormSubmissionsOfIssue;
|
|
7392
8194
|
exports2.selectAttachmentsOfAsset = selectAttachmentsOfAsset;
|
|
7393
8195
|
exports2.selectAttachmentsOfAssetByType = selectAttachmentsOfAssetByType;
|
|
7394
8196
|
exports2.selectAttachmentsOfAssetType = selectAttachmentsOfAssetType;
|
|
7395
8197
|
exports2.selectAttachmentsOfAssetTypeByType = selectAttachmentsOfAssetTypeByType;
|
|
8198
|
+
exports2.selectAttachmentsOfAssetTypeFieldValues = selectAttachmentsOfAssetTypeFieldValues;
|
|
8199
|
+
exports2.selectAttachmentsOfAssetTypeFields = selectAttachmentsOfAssetTypeFields;
|
|
7396
8200
|
exports2.selectAttachmentsOfDocument = selectAttachmentsOfDocument;
|
|
7397
8201
|
exports2.selectAttachmentsOfDocumentByType = selectAttachmentsOfDocumentByType;
|
|
7398
8202
|
exports2.selectAttachmentsOfFormRevision = selectAttachmentsOfFormRevision;
|
|
7399
8203
|
exports2.selectAttachmentsOfFormSubmission = selectAttachmentsOfFormSubmission;
|
|
7400
8204
|
exports2.selectAttachmentsOfIssue = selectAttachmentsOfIssue;
|
|
7401
8205
|
exports2.selectAttachmentsOfIssueByType = selectAttachmentsOfIssueByType;
|
|
8206
|
+
exports2.selectAttachmentsOfIssueTypeFieldValues = selectAttachmentsOfIssueTypeFieldValues;
|
|
8207
|
+
exports2.selectAttachmentsOfIssueTypeFields = selectAttachmentsOfIssueTypeFields;
|
|
7402
8208
|
exports2.selectAttachmentsOfProject = selectAttachmentsOfProject;
|
|
7403
8209
|
exports2.selectAttachmentsOfProjectByType = selectAttachmentsOfProjectByType;
|
|
7404
8210
|
exports2.selectCategories = selectCategories;
|
|
@@ -7424,8 +8230,6 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
7424
8230
|
exports2.selectFilteredForms = selectFilteredForms;
|
|
7425
8231
|
exports2.selectFormById = selectFormById;
|
|
7426
8232
|
exports2.selectFormMapping = selectFormMapping;
|
|
7427
|
-
exports2.selectFormOfAssetType = selectFormOfAssetType;
|
|
7428
|
-
exports2.selectFormOfIssueType = selectFormOfIssueType;
|
|
7429
8233
|
exports2.selectFormRevisionAttachmentsMapping = selectFormRevisionAttachmentsMapping;
|
|
7430
8234
|
exports2.selectFormRevisionById = selectFormRevisionById;
|
|
7431
8235
|
exports2.selectFormRevisionMapping = selectFormRevisionMapping;
|
|
@@ -7435,16 +8239,11 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
7435
8239
|
exports2.selectFormSubmissionAttachmentsMapping = selectFormSubmissionAttachmentsMapping;
|
|
7436
8240
|
exports2.selectFormSubmissionById = selectFormSubmissionById;
|
|
7437
8241
|
exports2.selectFormSubmissions = selectFormSubmissions;
|
|
7438
|
-
exports2.selectFormSubmissionsByAssets = selectFormSubmissionsByAssets;
|
|
7439
|
-
exports2.selectFormSubmissionsByFormRevisions = selectFormSubmissionsByFormRevisions;
|
|
7440
|
-
exports2.selectFormSubmissionsByIssues = selectFormSubmissionsByIssues;
|
|
7441
8242
|
exports2.selectFormSubmissionsMapping = selectFormSubmissionsMapping;
|
|
7442
8243
|
exports2.selectFormSubmissionsOfAsset = selectFormSubmissionsOfAsset;
|
|
7443
8244
|
exports2.selectFormSubmissionsOfForm = selectFormSubmissionsOfForm;
|
|
7444
8245
|
exports2.selectFormSubmissionsOfIssue = selectFormSubmissionsOfIssue;
|
|
7445
8246
|
exports2.selectForms = selectForms;
|
|
7446
|
-
exports2.selectFormsCount = selectFormsCount;
|
|
7447
|
-
exports2.selectGeneralFormCount = selectGeneralFormCount;
|
|
7448
8247
|
exports2.selectGeoImageById = selectGeoImageById;
|
|
7449
8248
|
exports2.selectGeoImageMapping = selectGeoImageMapping;
|
|
7450
8249
|
exports2.selectGeoImages = selectGeoImages;
|
|
@@ -7466,7 +8265,23 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
7466
8265
|
exports2.selectIssueCountOfCategory = selectIssueCountOfCategory;
|
|
7467
8266
|
exports2.selectIssueMapping = selectIssueMapping;
|
|
7468
8267
|
exports2.selectIssueTypeById = selectIssueTypeById;
|
|
8268
|
+
exports2.selectIssueTypeFieldValues = selectIssueTypeFieldValues;
|
|
8269
|
+
exports2.selectIssueTypeFieldValuesAttachmentById = selectIssueTypeFieldValuesAttachmentById;
|
|
8270
|
+
exports2.selectIssueTypeFieldValuesAttachments = selectIssueTypeFieldValuesAttachments;
|
|
8271
|
+
exports2.selectIssueTypeFieldValuesAttachmentsByIds = selectIssueTypeFieldValuesAttachmentsByIds;
|
|
8272
|
+
exports2.selectIssueTypeFieldValuesAttachmentsMapping = selectIssueTypeFieldValuesAttachmentsMapping;
|
|
8273
|
+
exports2.selectIssueTypeFieldValuesById = selectIssueTypeFieldValuesById;
|
|
8274
|
+
exports2.selectIssueTypeFieldValuesMapping = selectIssueTypeFieldValuesMapping;
|
|
8275
|
+
exports2.selectIssueTypeFieldValuesOfIssue = selectIssueTypeFieldValuesOfIssue;
|
|
8276
|
+
exports2.selectIssueTypeFields = selectIssueTypeFields;
|
|
8277
|
+
exports2.selectIssueTypeFieldsAttachmentById = selectIssueTypeFieldsAttachmentById;
|
|
8278
|
+
exports2.selectIssueTypeFieldsAttachments = selectIssueTypeFieldsAttachments;
|
|
8279
|
+
exports2.selectIssueTypeFieldsAttachmentsMapping = selectIssueTypeFieldsAttachmentsMapping;
|
|
8280
|
+
exports2.selectIssueTypeFieldsById = selectIssueTypeFieldsById;
|
|
8281
|
+
exports2.selectIssueTypeFieldsMapping = selectIssueTypeFieldsMapping;
|
|
8282
|
+
exports2.selectIssueTypeFieldsOfIssueType = selectIssueTypeFieldsOfIssueType;
|
|
7469
8283
|
exports2.selectIssueTypeMapping = selectIssueTypeMapping;
|
|
8284
|
+
exports2.selectIssueTypeValuesOfIssueType = selectIssueTypeValuesOfIssueType;
|
|
7470
8285
|
exports2.selectIssueTypes = selectIssueTypes;
|
|
7471
8286
|
exports2.selectIssueTypesByIds = selectIssueTypesByIds;
|
|
7472
8287
|
exports2.selectIssueTypesOfOrganization = selectIssueTypesOfOrganization;
|
|
@@ -7475,8 +8290,9 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
7475
8290
|
exports2.selectIssuesByIds = selectIssuesByIds;
|
|
7476
8291
|
exports2.selectIssuesOfIssueType = selectIssuesOfIssueType;
|
|
7477
8292
|
exports2.selectIssuesOfIssueTypeCount = selectIssuesOfIssueTypeCount;
|
|
7478
|
-
exports2.
|
|
8293
|
+
exports2.selectLatestAssetTypeFieldsOfAssetType = selectLatestAssetTypeFieldsOfAssetType;
|
|
7479
8294
|
exports2.selectLatestFormRevisionOfForm = selectLatestFormRevisionOfForm;
|
|
8295
|
+
exports2.selectLatestIssueTypeFieldsOfIssueType = selectLatestIssueTypeFieldsOfIssueType;
|
|
7480
8296
|
exports2.selectLatestRetryTime = selectLatestRetryTime;
|
|
7481
8297
|
exports2.selectLicense = selectLicense;
|
|
7482
8298
|
exports2.selectLicenseForProject = selectLicenseForProject;
|
|
@@ -7513,10 +8329,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
7513
8329
|
exports2.selectProjectsOfOrganization = selectProjectsOfOrganization;
|
|
7514
8330
|
exports2.selectRehydrated = selectRehydrated;
|
|
7515
8331
|
exports2.selectRootDocuments = selectRootDocuments;
|
|
7516
|
-
exports2.selectSortedFormSubmissionsOfForm = selectSortedFormSubmissionsOfForm;
|
|
7517
8332
|
exports2.selectSortedOrganizationUsers = selectSortedOrganizationUsers;
|
|
7518
8333
|
exports2.selectSortedProjectUsers = selectSortedProjectUsers;
|
|
7519
|
-
exports2.selectStageFormIdsFromStageIds = selectStageFormIdsFromStageIds;
|
|
7520
8334
|
exports2.selectStageMapping = selectStageMapping;
|
|
7521
8335
|
exports2.selectStagesOfAssetType = selectStagesOfAssetType;
|
|
7522
8336
|
exports2.selectTeamById = selectTeamById;
|
|
@@ -7532,6 +8346,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
7532
8346
|
exports2.selectWorkspaceById = selectWorkspaceById;
|
|
7533
8347
|
exports2.selectWorkspaceMapping = selectWorkspaceMapping;
|
|
7534
8348
|
exports2.selectWorkspaces = selectWorkspaces;
|
|
8349
|
+
exports2.separateFilesFromValues = separateFilesFromValues;
|
|
8350
|
+
exports2.separateImageFromFields = separateImageFromFields;
|
|
7535
8351
|
exports2.setActiveProjectFileId = setActiveProjectFileId;
|
|
7536
8352
|
exports2.setAsset = setAsset;
|
|
7537
8353
|
exports2.setAssetAttachment = setAssetAttachment;
|
|
@@ -7541,6 +8357,14 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
7541
8357
|
exports2.setAssetType = setAssetType;
|
|
7542
8358
|
exports2.setAssetTypeAttachment = setAssetTypeAttachment;
|
|
7543
8359
|
exports2.setAssetTypeAttachments = setAssetTypeAttachments;
|
|
8360
|
+
exports2.setAssetTypeFieldValues = setAssetTypeFieldValues;
|
|
8361
|
+
exports2.setAssetTypeFieldValuesAttachment = setAssetTypeFieldValuesAttachment;
|
|
8362
|
+
exports2.setAssetTypeFieldValuesAttachments = setAssetTypeFieldValuesAttachments;
|
|
8363
|
+
exports2.setAssetTypeFieldValuesMany = setAssetTypeFieldValuesMany;
|
|
8364
|
+
exports2.setAssetTypeFields = setAssetTypeFields;
|
|
8365
|
+
exports2.setAssetTypeFieldsAttachment = setAssetTypeFieldsAttachment;
|
|
8366
|
+
exports2.setAssetTypeFieldsAttachments = setAssetTypeFieldsAttachments;
|
|
8367
|
+
exports2.setAssetTypeFieldsMany = setAssetTypeFieldsMany;
|
|
7544
8368
|
exports2.setAssetTypes = setAssetTypes;
|
|
7545
8369
|
exports2.setAssets = setAssets;
|
|
7546
8370
|
exports2.setConversation = setConversation;
|
|
@@ -7566,6 +8390,14 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
7566
8390
|
exports2.setIssueComment = setIssueComment;
|
|
7567
8391
|
exports2.setIssueComments = setIssueComments;
|
|
7568
8392
|
exports2.setIssueType = setIssueType;
|
|
8393
|
+
exports2.setIssueTypeFieldValues = setIssueTypeFieldValues;
|
|
8394
|
+
exports2.setIssueTypeFieldValuesAttachment = setIssueTypeFieldValuesAttachment;
|
|
8395
|
+
exports2.setIssueTypeFieldValuesAttachments = setIssueTypeFieldValuesAttachments;
|
|
8396
|
+
exports2.setIssueTypeFieldValuesMany = setIssueTypeFieldValuesMany;
|
|
8397
|
+
exports2.setIssueTypeFields = setIssueTypeFields;
|
|
8398
|
+
exports2.setIssueTypeFieldsAttachment = setIssueTypeFieldsAttachment;
|
|
8399
|
+
exports2.setIssueTypeFieldsAttachments = setIssueTypeFieldsAttachments;
|
|
8400
|
+
exports2.setIssueTypeFieldsMany = setIssueTypeFieldsMany;
|
|
7569
8401
|
exports2.setIssueUpdate = setIssueUpdate;
|
|
7570
8402
|
exports2.setLoggedIn = setLoggedIn;
|
|
7571
8403
|
exports2.setOrganizations = setOrganizations;
|
|
@@ -7600,6 +8432,14 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
7600
8432
|
exports2.updateAssetType = updateAssetType;
|
|
7601
8433
|
exports2.updateAssetTypeAttachment = updateAssetTypeAttachment;
|
|
7602
8434
|
exports2.updateAssetTypeAttachments = updateAssetTypeAttachments;
|
|
8435
|
+
exports2.updateAssetTypeFieldValues = updateAssetTypeFieldValues;
|
|
8436
|
+
exports2.updateAssetTypeFieldValuesAttachment = updateAssetTypeFieldValuesAttachment;
|
|
8437
|
+
exports2.updateAssetTypeFieldValuesAttachments = updateAssetTypeFieldValuesAttachments;
|
|
8438
|
+
exports2.updateAssetTypeFieldValuesMany = updateAssetTypeFieldValuesMany;
|
|
8439
|
+
exports2.updateAssetTypeFields = updateAssetTypeFields;
|
|
8440
|
+
exports2.updateAssetTypeFieldsAttachment = updateAssetTypeFieldsAttachment;
|
|
8441
|
+
exports2.updateAssetTypeFieldsAttachments = updateAssetTypeFieldsAttachments;
|
|
8442
|
+
exports2.updateAssetTypeFieldsMany = updateAssetTypeFieldsMany;
|
|
7603
8443
|
exports2.updateAssetTypes = updateAssetTypes;
|
|
7604
8444
|
exports2.updateAssets = updateAssets;
|
|
7605
8445
|
exports2.updateCategory = updateCategory;
|
|
@@ -7622,6 +8462,14 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
7622
8462
|
exports2.updateIssueAttachment = updateIssueAttachment;
|
|
7623
8463
|
exports2.updateIssueAttachments = updateIssueAttachments;
|
|
7624
8464
|
exports2.updateIssueType = updateIssueType;
|
|
8465
|
+
exports2.updateIssueTypeFieldValues = updateIssueTypeFieldValues;
|
|
8466
|
+
exports2.updateIssueTypeFieldValuesAttachment = updateIssueTypeFieldValuesAttachment;
|
|
8467
|
+
exports2.updateIssueTypeFieldValuesAttachments = updateIssueTypeFieldValuesAttachments;
|
|
8468
|
+
exports2.updateIssueTypeFieldValuesMany = updateIssueTypeFieldValuesMany;
|
|
8469
|
+
exports2.updateIssueTypeFields = updateIssueTypeFields;
|
|
8470
|
+
exports2.updateIssueTypeFieldsAttachment = updateIssueTypeFieldsAttachment;
|
|
8471
|
+
exports2.updateIssueTypeFieldsAttachments = updateIssueTypeFieldsAttachments;
|
|
8472
|
+
exports2.updateIssueTypeFieldsMany = updateIssueTypeFieldsMany;
|
|
7625
8473
|
exports2.updateLicense = updateLicense;
|
|
7626
8474
|
exports2.updateOrganizationAccess = updateOrganizationAccess;
|
|
7627
8475
|
exports2.updateProject = updateProject;
|