@overmap-ai/core 1.0.71-fields.8 → 1.0.71-mapbox.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/overmap-core.js +1031 -2010
- package/dist/overmap-core.js.map +1 -1
- package/dist/overmap-core.umd.cjs +1031 -2010
- package/dist/overmap-core.umd.cjs.map +1 -1
- package/dist/sdk/services/AssetAttachmentService.d.ts +8 -32
- package/dist/sdk/services/AssetTypeAttachmentService.d.ts +9 -32
- package/dist/sdk/services/BaseAttachmentService.d.ts +20 -18
- package/dist/sdk/services/BaseUploadService.d.ts +1 -2
- package/dist/sdk/services/DocumentAttachmentService.d.ts +8 -30
- package/dist/sdk/services/FormService.d.ts +14 -11
- package/dist/sdk/services/FormSubmissionService.d.ts +28 -8
- package/dist/sdk/services/IssueAssociationService.d.ts +2 -2
- package/dist/sdk/services/IssueAttachmentService.d.ts +8 -31
- package/dist/sdk/services/IssueService.d.ts +3 -0
- package/dist/sdk/services/ProjectAttachmentService.d.ts +8 -31
- package/dist/sdk/services/index.d.ts +0 -11
- package/dist/store/slices/formRevisionSlice.d.ts +2 -1
- package/dist/store/slices/formSlice.d.ts +5 -1
- package/dist/store/slices/formSubmissionSlice.d.ts +6 -0
- package/dist/store/slices/index.d.ts +0 -8
- package/dist/store/store.d.ts +1 -9
- package/dist/typings/files.d.ts +4 -8
- package/dist/typings/models/assets.d.ts +0 -15
- package/dist/typings/models/attachments.d.ts +6 -1
- package/dist/typings/models/forms.d.ts +27 -12
- package/dist/typings/models/geo.d.ts +3 -3
- package/dist/typings/models/index.d.ts +0 -1
- package/dist/typings/models/issues.d.ts +0 -15
- package/dist/typings/models/store.d.ts +1 -9
- package/dist/utils/coordinates.d.ts +4 -18
- package/dist/utils/file.d.ts +2 -2
- package/dist/utils/utils.d.ts +1 -7
- package/package.json +2 -5
- package/dist/sdk/services/AssetTypeFieldValuesAttachmentService.d.ts +0 -12
- package/dist/sdk/services/AssetTypeFieldValuesService.d.ts +0 -20
- package/dist/sdk/services/AssetTypeFieldsAttachmentService.d.ts +0 -12
- package/dist/sdk/services/AssetTypeFieldsService.d.ts +0 -8
- package/dist/sdk/services/FormRevisionAttachmentService.d.ts +0 -12
- package/dist/sdk/services/FormRevisionService.d.ts +0 -8
- package/dist/sdk/services/FormSubmissionAttachmentService.d.ts +0 -13
- package/dist/sdk/services/IssueTypeFieldValuesAttachmentService.d.ts +0 -13
- package/dist/sdk/services/IssueTypeFieldValuesService.d.ts +0 -10
- package/dist/sdk/services/IssueTypeFieldsAttachmentService.d.ts +0 -12
- package/dist/sdk/services/IssueTypeFieldsService.d.ts +0 -8
- package/dist/store/slices/assetTypeFieldValuesAttachmentSlice.d.ts +0 -52
- package/dist/store/slices/assetTypeFieldValuesSlice.d.ts +0 -53
- package/dist/store/slices/assetTypeFieldsAttachmentSlice.d.ts +0 -52
- package/dist/store/slices/assetTypeFieldsSlice.d.ts +0 -53
- package/dist/store/slices/issueTypeFieldValuesAttachmentSlice.d.ts +0 -52
- package/dist/store/slices/issueTypeFieldValuesSlice.d.ts +0 -52
- package/dist/store/slices/issueTypeFieldsAttachmentSlice.d.ts +0 -52
- package/dist/store/slices/issueTypeFieldsSlice.d.ts +0 -54
- package/dist/typings/models/fields.d.ts +0 -16
package/dist/overmap-core.js
CHANGED
|
@@ -329,70 +329,21 @@ class APIError extends Error {
|
|
|
329
329
|
this.options = options;
|
|
330
330
|
}
|
|
331
331
|
}
|
|
332
|
-
const
|
|
333
|
-
return { lng: coordinates[0], lat: coordinates[1] };
|
|
334
|
-
};
|
|
335
|
-
const literalToCoordinates = (literal) => {
|
|
336
|
-
return [literal.lng, literal.lat];
|
|
337
|
-
};
|
|
338
|
-
const flipCoordinates = (coordinates) => {
|
|
339
|
-
return [coordinates[1], coordinates[0]];
|
|
340
|
-
};
|
|
341
|
-
const flipBounds = (bounds) => {
|
|
342
|
-
return [flipCoordinates(bounds[0]), flipCoordinates(bounds[1])];
|
|
343
|
-
};
|
|
344
|
-
function offsetPositionByMeters(originalPosition, latMeters, lngMeters) {
|
|
345
|
-
const { lat, lng } = originalPosition;
|
|
346
|
-
const earthRadius = 6378137;
|
|
347
|
-
const metersPerDegree = 2 * Math.PI * earthRadius / 360;
|
|
348
|
-
const newLng = lng + lngMeters / metersPerDegree / Math.cos(lat * Math.PI / 180);
|
|
349
|
-
const newLat = lat - latMeters / metersPerDegree;
|
|
350
|
-
return { lat: newLat, lng: newLng };
|
|
351
|
-
}
|
|
352
|
-
const createPointGeometry = (coordinates) => {
|
|
332
|
+
const createPointGeometry = (position) => {
|
|
353
333
|
return {
|
|
354
334
|
type: "Point",
|
|
355
|
-
coordinates
|
|
335
|
+
coordinates: position
|
|
356
336
|
};
|
|
357
337
|
};
|
|
358
|
-
const coordinatesAreEqual = (a, b) => {
|
|
359
|
-
return a[0] === b[0] && a[1] === b[1];
|
|
360
|
-
};
|
|
361
|
-
const coordinatesToText = (coordinates, decimalPlaces) => {
|
|
362
|
-
if (!coordinates)
|
|
363
|
-
return "(No Location)";
|
|
364
|
-
const { lat, lng } = coordinatesToLiteral(coordinates);
|
|
365
|
-
if (decimalPlaces)
|
|
366
|
-
return `${lat.toFixed(decimalPlaces)}, ${lng.toFixed(decimalPlaces)}`;
|
|
367
|
-
return `${lat}, ${lng}`;
|
|
368
|
-
};
|
|
369
|
-
const coordinatesToUrlText = (coordinates) => {
|
|
370
|
-
const { lat, lng } = coordinatesToLiteral(coordinates);
|
|
371
|
-
return `${lat}%2C${lng}`;
|
|
372
|
-
};
|
|
373
|
-
const openCoordsInGoogleMaps = (coordinates) => {
|
|
374
|
-
const url = `https://www.google.com/maps/search/?api=1&query=${coordinatesToUrlText(coordinates)}`;
|
|
375
|
-
window.open(url);
|
|
376
|
-
};
|
|
377
|
-
const openDirectionsInGoogleMaps = (startingPoint, destination) => {
|
|
378
|
-
const startingPointUrl = coordinatesToUrlText(startingPoint);
|
|
379
|
-
const destinationUrl = coordinatesToUrlText(destination);
|
|
380
|
-
const url = `https://www.google.com/maps/dir/?api=1&origin=${startingPointUrl}&destination=${destinationUrl}`;
|
|
381
|
-
window.open(url);
|
|
382
|
-
};
|
|
383
|
-
const worldBounds = {
|
|
384
|
-
type: "MultiPoint",
|
|
385
|
-
coordinates: [
|
|
386
|
-
[90, -180],
|
|
387
|
-
[-90, 180]
|
|
388
|
-
]
|
|
389
|
-
};
|
|
390
338
|
const createMultiPointGeometry = (coordinates) => {
|
|
391
339
|
return {
|
|
392
340
|
type: "MultiPoint",
|
|
393
341
|
coordinates
|
|
394
342
|
};
|
|
395
343
|
};
|
|
344
|
+
const coordinatesAreEqual = (a, b) => {
|
|
345
|
+
return a[0] === b[0] && a[1] === b[1];
|
|
346
|
+
};
|
|
396
347
|
function hex(buffer) {
|
|
397
348
|
const hashArray = new Uint8Array(buffer);
|
|
398
349
|
return hashArray.reduce((data, byte) => data + byte.toString(16).padStart(2, "0"), "");
|
|
@@ -544,9 +495,6 @@ function onlyUniqueHashes(value, index, self) {
|
|
|
544
495
|
return v.file_sha1 === value.file_sha1;
|
|
545
496
|
}) === index;
|
|
546
497
|
}
|
|
547
|
-
function boundsContainPoint(bounds, coordinates) {
|
|
548
|
-
return bounds[0][0] > coordinates[0] && bounds[1][0] < coordinates[0] && bounds[0][1] > coordinates[1] && bounds[1][1] < coordinates[1];
|
|
549
|
-
}
|
|
550
498
|
const emailRegex = /^.+@.+\..+$/;
|
|
551
499
|
const DEFAULT_ISSUE_STATUS = IssueStatus.BACKLOG;
|
|
552
500
|
const DEFAULT_ISSUE_PRIORITY = IssuePriority.MEDIUM;
|
|
@@ -758,15 +706,15 @@ const wrapMigration = (migrator) => (state) => {
|
|
|
758
706
|
};
|
|
759
707
|
const migrations = [initialVersioning, signOut, signOut, createOutboxState];
|
|
760
708
|
const manifest = Object.fromEntries(migrations.map((migration2, i) => [i, wrapMigration(migration2)]));
|
|
761
|
-
const initialState$
|
|
709
|
+
const initialState$B = {
|
|
762
710
|
accessToken: "",
|
|
763
711
|
refreshToken: "",
|
|
764
712
|
isLoggedIn: false
|
|
765
713
|
};
|
|
766
714
|
const authSlice = createSlice({
|
|
767
715
|
name: "auth",
|
|
768
|
-
initialState: initialState$
|
|
769
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
716
|
+
initialState: initialState$B,
|
|
717
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$B)),
|
|
770
718
|
reducers: {
|
|
771
719
|
setTokens: (state, action) => {
|
|
772
720
|
state.accessToken = action.payload.accessToken;
|
|
@@ -854,11 +802,11 @@ function createModelAdapter(computeModelId) {
|
|
|
854
802
|
};
|
|
855
803
|
}
|
|
856
804
|
const categoryAdapter = createModelAdapter((category) => category.offline_id);
|
|
857
|
-
const initialState$
|
|
805
|
+
const initialState$A = categoryAdapter.getInitialState({});
|
|
858
806
|
const categorySlice = createSlice({
|
|
859
807
|
name: "categories",
|
|
860
|
-
initialState: initialState$
|
|
861
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
808
|
+
initialState: initialState$A,
|
|
809
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$A)),
|
|
862
810
|
reducers: {
|
|
863
811
|
initializeCategories: categoryAdapter.initialize,
|
|
864
812
|
addCategory: categoryAdapter.addOne,
|
|
@@ -902,11 +850,11 @@ const selectIssueCountOfCategory = (categoryId) => (state) => {
|
|
|
902
850
|
};
|
|
903
851
|
const categoryReducer = categorySlice.reducer;
|
|
904
852
|
const assetAdapter = createModelAdapter((asset) => asset.offline_id);
|
|
905
|
-
const initialState$
|
|
853
|
+
const initialState$z = assetAdapter.getInitialState({});
|
|
906
854
|
const assetSlice = createSlice({
|
|
907
855
|
name: "assets",
|
|
908
|
-
initialState: initialState$
|
|
909
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
856
|
+
initialState: initialState$z,
|
|
857
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$z)),
|
|
910
858
|
reducers: {
|
|
911
859
|
initializeAssets: assetAdapter.initialize,
|
|
912
860
|
addAsset: assetAdapter.addOne,
|
|
@@ -958,11 +906,11 @@ const selectNumberOfAssetsOfAssetType = (assetTypeId) => (state) => {
|
|
|
958
906
|
};
|
|
959
907
|
const assetReducer = assetSlice.reducer;
|
|
960
908
|
const assetAttachmentAdapter = createModelAdapter((attachment) => attachment.offline_id);
|
|
961
|
-
const initialState$
|
|
909
|
+
const initialState$y = assetAttachmentAdapter.getInitialState({});
|
|
962
910
|
const assetAttachmentSlice = createSlice({
|
|
963
911
|
name: "assetAttachments",
|
|
964
|
-
initialState: initialState$
|
|
965
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
912
|
+
initialState: initialState$y,
|
|
913
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$y)),
|
|
966
914
|
reducers: {
|
|
967
915
|
initializeAssetAttachments: assetAttachmentAdapter.initialize,
|
|
968
916
|
addAssetAttachment: assetAttachmentAdapter.addOne,
|
|
@@ -1023,11 +971,11 @@ const assetAttachmentReducer = assetAttachmentSlice.reducer;
|
|
|
1023
971
|
const assetStageCompletionAdapter = createModelAdapter(
|
|
1024
972
|
(stageCompletion) => stageCompletion.offline_id
|
|
1025
973
|
);
|
|
1026
|
-
const initialState$
|
|
974
|
+
const initialState$x = assetStageCompletionAdapter.getInitialState({});
|
|
1027
975
|
const assetStageCompletionSlice = createSlice({
|
|
1028
976
|
name: "assetStageCompletions",
|
|
1029
|
-
initialState: initialState$
|
|
1030
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
977
|
+
initialState: initialState$x,
|
|
978
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$x)),
|
|
1031
979
|
reducers: {
|
|
1032
980
|
initializeAssetStageCompletions: assetStageCompletionAdapter.initialize,
|
|
1033
981
|
addAssetStageCompletion: assetStageCompletionAdapter.addOne,
|
|
@@ -1089,11 +1037,11 @@ const selectAssetStageCompletionsByIds = restructureCreateSelectorWithArgs(
|
|
|
1089
1037
|
);
|
|
1090
1038
|
const assetStageCompletionReducer = assetStageCompletionSlice.reducer;
|
|
1091
1039
|
const assetStageAdapter = createModelAdapter((assetStage) => assetStage.offline_id);
|
|
1092
|
-
const initialState$
|
|
1040
|
+
const initialState$w = assetStageAdapter.getInitialState({});
|
|
1093
1041
|
const assetStageSlice = createSlice({
|
|
1094
1042
|
name: "assetStages",
|
|
1095
|
-
initialState: initialState$
|
|
1096
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1043
|
+
initialState: initialState$w,
|
|
1044
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$w)),
|
|
1097
1045
|
reducers: {
|
|
1098
1046
|
initializeAssetStages: assetStageAdapter.initialize,
|
|
1099
1047
|
setAssetStage: assetStageAdapter.setOne,
|
|
@@ -1173,11 +1121,11 @@ const selectStageFormIdsFromStageIds = restructureCreateSelectorWithArgs(
|
|
|
1173
1121
|
})
|
|
1174
1122
|
);
|
|
1175
1123
|
const assetTypeAdapter = createModelAdapter((assetType) => assetType.offline_id);
|
|
1176
|
-
const initialState$
|
|
1124
|
+
const initialState$v = assetTypeAdapter.getInitialState({});
|
|
1177
1125
|
const assetTypeSlice = createSlice({
|
|
1178
1126
|
name: "assetTypes",
|
|
1179
|
-
initialState: initialState$
|
|
1180
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1127
|
+
initialState: initialState$v,
|
|
1128
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$v)),
|
|
1181
1129
|
reducers: {
|
|
1182
1130
|
initializeAssetTypes: assetTypeAdapter.initialize,
|
|
1183
1131
|
setAssetType: assetTypeAdapter.setOne,
|
|
@@ -1230,11 +1178,11 @@ const assetTypeReducer = assetTypeSlice.reducer;
|
|
|
1230
1178
|
const assetTypeAttachmentAdapter = createModelAdapter(
|
|
1231
1179
|
(attachment) => attachment.offline_id
|
|
1232
1180
|
);
|
|
1233
|
-
const initialState$
|
|
1181
|
+
const initialState$u = assetTypeAttachmentAdapter.getInitialState({});
|
|
1234
1182
|
const assetTypeAttachmentSlice = createSlice({
|
|
1235
1183
|
name: "assetTypeAttachments",
|
|
1236
|
-
initialState: initialState$
|
|
1237
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1184
|
+
initialState: initialState$u,
|
|
1185
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$u)),
|
|
1238
1186
|
reducers: {
|
|
1239
1187
|
initializeAssetTypeAttachments: assetTypeAttachmentAdapter.initialize,
|
|
1240
1188
|
addAssetTypeAttachment: assetTypeAttachmentAdapter.addOne,
|
|
@@ -1293,12 +1241,12 @@ const selectAttachmentsOfAssetTypeByType = restructureCreateSelectorWithArgs(
|
|
|
1293
1241
|
);
|
|
1294
1242
|
const assetTypeAttachmentReducer = assetTypeAttachmentSlice.reducer;
|
|
1295
1243
|
const issueAdapter = createModelAdapter((issue) => issue.offline_id);
|
|
1296
|
-
const initialState$
|
|
1244
|
+
const initialState$t = issueAdapter.getInitialState({});
|
|
1297
1245
|
const issueSlice = createSlice({
|
|
1298
1246
|
name: "issues",
|
|
1299
|
-
initialState: initialState$
|
|
1247
|
+
initialState: initialState$t,
|
|
1300
1248
|
extraReducers: (builder) => builder.addCase("RESET", (state) => {
|
|
1301
|
-
Object.assign(state, initialState$
|
|
1249
|
+
Object.assign(state, initialState$t);
|
|
1302
1250
|
}),
|
|
1303
1251
|
reducers: {
|
|
1304
1252
|
initializeIssues: issueAdapter.initialize,
|
|
@@ -1330,12 +1278,12 @@ const selectIssuesByIds = restructureCreateSelectorWithArgs(
|
|
|
1330
1278
|
);
|
|
1331
1279
|
const issueReducer = issueSlice.reducer;
|
|
1332
1280
|
const issueTypeAdapter = createModelAdapter((issueType) => issueType.offline_id);
|
|
1333
|
-
const initialState$
|
|
1281
|
+
const initialState$s = issueTypeAdapter.getInitialState({});
|
|
1334
1282
|
const issueTypeSlice = createSlice({
|
|
1335
1283
|
name: "issueTypes",
|
|
1336
|
-
initialState: initialState$
|
|
1284
|
+
initialState: initialState$s,
|
|
1337
1285
|
extraReducers: (builder) => builder.addCase("RESET", (state) => {
|
|
1338
|
-
Object.assign(state, initialState$
|
|
1286
|
+
Object.assign(state, initialState$s);
|
|
1339
1287
|
}),
|
|
1340
1288
|
reducers: {
|
|
1341
1289
|
initializeIssueTypes: issueTypeAdapter.initialize,
|
|
@@ -1392,15 +1340,15 @@ const selectIssuesOfIssueTypeCount = (issueTypeId) => (state) => {
|
|
|
1392
1340
|
return selectIssuesOfIssueType(issueTypeId)(state).length;
|
|
1393
1341
|
};
|
|
1394
1342
|
const issueTypeReducer = issueTypeSlice.reducer;
|
|
1395
|
-
const initialState$
|
|
1343
|
+
const initialState$r = {
|
|
1396
1344
|
s3Urls: {}
|
|
1397
1345
|
};
|
|
1398
1346
|
const msPerHour = 1e3 * 60 * 60;
|
|
1399
1347
|
const msPerWeek = msPerHour * 24 * 7;
|
|
1400
1348
|
const fileSlice = createSlice({
|
|
1401
1349
|
name: "file",
|
|
1402
|
-
initialState: initialState$
|
|
1403
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1350
|
+
initialState: initialState$r,
|
|
1351
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$r)),
|
|
1404
1352
|
reducers: {
|
|
1405
1353
|
setUploadUrl: (state, action) => {
|
|
1406
1354
|
const { url, fields, sha1 } = action.payload;
|
|
@@ -1427,14 +1375,14 @@ const selectUploadUrl = (sha1) => (state) => {
|
|
|
1427
1375
|
return url;
|
|
1428
1376
|
};
|
|
1429
1377
|
const fileReducer = fileSlice.reducer;
|
|
1430
|
-
const initialState$
|
|
1378
|
+
const initialState$q = {
|
|
1431
1379
|
users: {},
|
|
1432
1380
|
currentUser: null
|
|
1433
1381
|
};
|
|
1434
1382
|
const userSlice = createSlice({
|
|
1435
1383
|
name: "users",
|
|
1436
|
-
initialState: initialState$
|
|
1437
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1384
|
+
initialState: initialState$q,
|
|
1385
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$q)),
|
|
1438
1386
|
reducers: {
|
|
1439
1387
|
setUsers: (state, action) => {
|
|
1440
1388
|
const usersMapping = {};
|
|
@@ -1492,11 +1440,11 @@ const selectUsersByIds = restructureCreateSelectorWithArgs(
|
|
|
1492
1440
|
const organizationAccessAdapter = createModelAdapter(
|
|
1493
1441
|
(organizationAccess) => organizationAccess.offline_id
|
|
1494
1442
|
);
|
|
1495
|
-
const initialState$
|
|
1443
|
+
const initialState$p = organizationAccessAdapter.getInitialState({});
|
|
1496
1444
|
const organizationAccessSlice = createSlice({
|
|
1497
1445
|
name: "organizationAccess",
|
|
1498
|
-
initialState: initialState$
|
|
1499
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1446
|
+
initialState: initialState$p,
|
|
1447
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$p)),
|
|
1500
1448
|
reducers: {
|
|
1501
1449
|
initializeOrganizationAccesses: organizationAccessAdapter.initialize,
|
|
1502
1450
|
updateOrganizationAccess: organizationAccessAdapter.updateOne,
|
|
@@ -1533,11 +1481,11 @@ const selectOrganizationAccessUserMapping = (state) => {
|
|
|
1533
1481
|
};
|
|
1534
1482
|
const organizationAccessReducer = organizationAccessSlice.reducer;
|
|
1535
1483
|
const licenseAdapter = createModelAdapter((license) => license.offline_id);
|
|
1536
|
-
const initialState$
|
|
1484
|
+
const initialState$o = licenseAdapter.getInitialState({});
|
|
1537
1485
|
const licenseSlice = createSlice({
|
|
1538
1486
|
name: "license",
|
|
1539
|
-
initialState: initialState$
|
|
1540
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1487
|
+
initialState: initialState$o,
|
|
1488
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$o)),
|
|
1541
1489
|
reducers: {
|
|
1542
1490
|
initializeLicences: licenseAdapter.initialize,
|
|
1543
1491
|
addLicenses: licenseAdapter.addMany,
|
|
@@ -1562,11 +1510,11 @@ const selectLicensesForProjectsMapping = createSelector(
|
|
|
1562
1510
|
);
|
|
1563
1511
|
const licenseReducer = licenseSlice.reducer;
|
|
1564
1512
|
const projectAccessAdapter = createModelAdapter((projectAccess) => projectAccess.offline_id);
|
|
1565
|
-
const initialState$
|
|
1513
|
+
const initialState$n = projectAccessAdapter.getInitialState({});
|
|
1566
1514
|
const projectAccessSlice = createSlice({
|
|
1567
1515
|
name: "projectAccess",
|
|
1568
|
-
initialState: initialState$
|
|
1569
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1516
|
+
initialState: initialState$n,
|
|
1517
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$n)),
|
|
1570
1518
|
reducers: {
|
|
1571
1519
|
initializeProjectAccesses: projectAccessAdapter.initialize,
|
|
1572
1520
|
updateProjectAccess: projectAccessAdapter.updateOne,
|
|
@@ -1607,14 +1555,14 @@ const selectProjectAccessUserMapping = (state) => {
|
|
|
1607
1555
|
return projectAccesses;
|
|
1608
1556
|
};
|
|
1609
1557
|
const projectAccessReducer = projectAccessSlice.reducer;
|
|
1610
|
-
const initialState$
|
|
1558
|
+
const initialState$m = {
|
|
1611
1559
|
projects: {},
|
|
1612
1560
|
activeProjectId: null
|
|
1613
1561
|
};
|
|
1614
1562
|
const projectSlice = createSlice({
|
|
1615
1563
|
name: "projects",
|
|
1616
|
-
initialState: initialState$
|
|
1617
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1564
|
+
initialState: initialState$m,
|
|
1565
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$m)),
|
|
1618
1566
|
reducers: {
|
|
1619
1567
|
setProjects: (state, action) => {
|
|
1620
1568
|
const projectsMap = {};
|
|
@@ -1721,13 +1669,13 @@ const selectSortedProjectUsers = createSelector(
|
|
|
1721
1669
|
});
|
|
1722
1670
|
}
|
|
1723
1671
|
);
|
|
1724
|
-
const initialState$
|
|
1672
|
+
const initialState$l = {
|
|
1725
1673
|
organizations: {}
|
|
1726
1674
|
};
|
|
1727
1675
|
const organizationSlice = createSlice({
|
|
1728
1676
|
name: "organizations",
|
|
1729
|
-
initialState: initialState$
|
|
1730
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1677
|
+
initialState: initialState$l,
|
|
1678
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$l)),
|
|
1731
1679
|
reducers: {
|
|
1732
1680
|
setOrganizations: (state, action) => {
|
|
1733
1681
|
for (const org of action.payload) {
|
|
@@ -1818,14 +1766,14 @@ const createOfflineAction = (request2, baseUrl, serviceName) => {
|
|
|
1818
1766
|
}
|
|
1819
1767
|
};
|
|
1820
1768
|
};
|
|
1821
|
-
const initialState$
|
|
1769
|
+
const initialState$k = {
|
|
1822
1770
|
deletedRequests: [],
|
|
1823
1771
|
latestRetryTime: 0
|
|
1824
1772
|
};
|
|
1825
1773
|
const outboxSlice = createSlice({
|
|
1826
1774
|
name: "outbox",
|
|
1827
|
-
initialState: initialState$
|
|
1828
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1775
|
+
initialState: initialState$k,
|
|
1776
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$k)),
|
|
1829
1777
|
reducers: {
|
|
1830
1778
|
// enqueueActions is a reducer that does nothing but enqueue API request to the Redux Offline outbox
|
|
1831
1779
|
// Whenever an issue is being created, a reducer addIssue() is responsible for adding it to the offline store
|
|
@@ -1857,15 +1805,15 @@ const selectDeletedRequests = (state) => state.outboxReducer.deletedRequests;
|
|
|
1857
1805
|
const selectLatestRetryTime = (state) => state.outboxReducer.latestRetryTime;
|
|
1858
1806
|
const { enqueueRequest, markForDeletion, markAsDeleted, _setLatestRetryTime } = outboxSlice.actions;
|
|
1859
1807
|
const outboxReducer = outboxSlice.reducer;
|
|
1860
|
-
const initialState$
|
|
1808
|
+
const initialState$j = {
|
|
1861
1809
|
projectFiles: {},
|
|
1862
1810
|
activeProjectFileId: null,
|
|
1863
1811
|
isImportingProjectFile: false
|
|
1864
1812
|
};
|
|
1865
1813
|
const projectFileSlice = createSlice({
|
|
1866
1814
|
name: "projectFiles",
|
|
1867
|
-
initialState: initialState$
|
|
1868
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1815
|
+
initialState: initialState$j,
|
|
1816
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$j)),
|
|
1869
1817
|
reducers: {
|
|
1870
1818
|
addOrReplaceProjectFiles: (state, action) => {
|
|
1871
1819
|
for (let fileObj of action.payload) {
|
|
@@ -1952,11 +1900,11 @@ const selectProjectFileById = (id) => (state) => {
|
|
|
1952
1900
|
};
|
|
1953
1901
|
const projectFileReducer = projectFileSlice.reducer;
|
|
1954
1902
|
const projectAttachmentAdapter = createModelAdapter((attachment) => attachment.offline_id);
|
|
1955
|
-
const initialState$
|
|
1903
|
+
const initialState$i = projectAttachmentAdapter.getInitialState({});
|
|
1956
1904
|
const projectAttachmentSlice = createSlice({
|
|
1957
1905
|
name: "projectAttachments",
|
|
1958
|
-
initialState: initialState$
|
|
1959
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1906
|
+
initialState: initialState$i,
|
|
1907
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$i)),
|
|
1960
1908
|
reducers: {
|
|
1961
1909
|
initializeProjectAttachments: projectAttachmentAdapter.initialize,
|
|
1962
1910
|
addProjectAttachment: projectAttachmentAdapter.addOne,
|
|
@@ -2011,12 +1959,12 @@ const selectAttachmentsOfProjectByType = restructureCreateSelectorWithArgs(
|
|
|
2011
1959
|
)
|
|
2012
1960
|
);
|
|
2013
1961
|
const projectAttachmentReducer = projectAttachmentSlice.reducer;
|
|
2014
|
-
const initialState$
|
|
1962
|
+
const initialState$h = {
|
|
2015
1963
|
isRehydrated: false
|
|
2016
1964
|
};
|
|
2017
1965
|
const rehydratedSlice = createSlice({
|
|
2018
1966
|
name: "rehydrated",
|
|
2019
|
-
initialState: initialState$
|
|
1967
|
+
initialState: initialState$h,
|
|
2020
1968
|
// The `reducers` field lets us define reducers and generate associated actions
|
|
2021
1969
|
reducers: {
|
|
2022
1970
|
setRehydrated: (state, action) => {
|
|
@@ -2041,11 +1989,11 @@ const formRevisionSortFn = (formRevisionA, formRevisionB) => {
|
|
|
2041
1989
|
}
|
|
2042
1990
|
};
|
|
2043
1991
|
const formRevisionAdapter = createModelAdapter((revision) => revision.offline_id);
|
|
2044
|
-
const initialState$
|
|
1992
|
+
const initialState$g = formRevisionAdapter.getInitialState({});
|
|
2045
1993
|
const formRevisionsSlice = createSlice({
|
|
2046
1994
|
name: "formRevisions",
|
|
2047
|
-
initialState: initialState$
|
|
2048
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1995
|
+
initialState: initialState$g,
|
|
1996
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$g)),
|
|
2049
1997
|
reducers: {
|
|
2050
1998
|
initializeFormRevisions: formRevisionAdapter.initialize,
|
|
2051
1999
|
setFormRevision: formRevisionAdapter.setOne,
|
|
@@ -2104,13 +2052,24 @@ const selectFormRevisionsOfForm = restructureCreateSelectorWithArgs(
|
|
|
2104
2052
|
}
|
|
2105
2053
|
)
|
|
2106
2054
|
);
|
|
2055
|
+
const selectLatestFormRevisionByForm = createSelector([selectFormRevisionMapping], (revisions) => {
|
|
2056
|
+
const latestRevisions = {};
|
|
2057
|
+
for (const revision of Object.values(revisions)) {
|
|
2058
|
+
const formId = revision.form;
|
|
2059
|
+
const currentLatestRevision = latestRevisions[formId];
|
|
2060
|
+
if (!currentLatestRevision || currentLatestRevision.revision < revision.revision) {
|
|
2061
|
+
latestRevisions[formId] = revision;
|
|
2062
|
+
}
|
|
2063
|
+
}
|
|
2064
|
+
return latestRevisions;
|
|
2065
|
+
});
|
|
2107
2066
|
const formRevisionReducer = formRevisionsSlice.reducer;
|
|
2108
2067
|
const formAdapter = createModelAdapter((form) => form.offline_id);
|
|
2109
|
-
const initialState$
|
|
2068
|
+
const initialState$f = formAdapter.getInitialState({});
|
|
2110
2069
|
const formSlice = createSlice({
|
|
2111
2070
|
name: "forms",
|
|
2112
|
-
initialState: initialState$
|
|
2113
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2071
|
+
initialState: initialState$f,
|
|
2072
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$f)),
|
|
2114
2073
|
reducers: {
|
|
2115
2074
|
initializeForms: formAdapter.initialize,
|
|
2116
2075
|
setForm: formAdapter.setOne,
|
|
@@ -2128,9 +2087,6 @@ const selectFormMapping = (state) => {
|
|
|
2128
2087
|
const selectForms = createSelector([selectFormMapping], (formsMapping) => {
|
|
2129
2088
|
return Object.values(formsMapping);
|
|
2130
2089
|
});
|
|
2131
|
-
const selectFormById = (formId) => (state) => {
|
|
2132
|
-
return state.formReducer.instances[formId];
|
|
2133
|
-
};
|
|
2134
2090
|
const selectFilteredForms = restructureCreateSelectorWithArgs(
|
|
2135
2091
|
createSelector(
|
|
2136
2092
|
[
|
|
@@ -2156,12 +2112,37 @@ const selectFilteredForms = restructureCreateSelectorWithArgs(
|
|
|
2156
2112
|
{ memoizeOptions: { equalityCheck: shallowEqual } }
|
|
2157
2113
|
)
|
|
2158
2114
|
);
|
|
2115
|
+
const selectFormById = (formId) => (state) => {
|
|
2116
|
+
return state.formReducer.instances[formId];
|
|
2117
|
+
};
|
|
2118
|
+
const selectFormOfAssetType = restructureCreateSelectorWithArgs(
|
|
2119
|
+
createSelector(
|
|
2120
|
+
[selectFormMapping, (_state, assetTypeId) => assetTypeId],
|
|
2121
|
+
(formsMapping, assetTypeId) => {
|
|
2122
|
+
return Object.values(formsMapping).find((form) => form.asset_type === assetTypeId);
|
|
2123
|
+
}
|
|
2124
|
+
)
|
|
2125
|
+
);
|
|
2126
|
+
const selectFormOfIssueType = restructureCreateSelectorWithArgs(
|
|
2127
|
+
createSelector(
|
|
2128
|
+
[selectFormMapping, (_state, issueTypeId) => issueTypeId],
|
|
2129
|
+
(formsMapping, issueTypeId) => {
|
|
2130
|
+
return Object.values(formsMapping).find((form) => form.issue_type === issueTypeId);
|
|
2131
|
+
}
|
|
2132
|
+
)
|
|
2133
|
+
);
|
|
2134
|
+
const selectFormsCount = createSelector([selectFormMapping], (formsMapping) => {
|
|
2135
|
+
return Object.keys(formsMapping).length;
|
|
2136
|
+
});
|
|
2137
|
+
const selectGeneralFormCount = createSelector([selectFormMapping], (formsMapping) => {
|
|
2138
|
+
return Object.values(formsMapping).filter((form) => !form.asset_type).length;
|
|
2139
|
+
});
|
|
2159
2140
|
const submissionAdapter = createModelAdapter((submission) => submission.offline_id);
|
|
2160
|
-
const initialState$
|
|
2141
|
+
const initialState$e = submissionAdapter.getInitialState({});
|
|
2161
2142
|
const formSubmissionSlice = createSlice({
|
|
2162
2143
|
name: "formSubmissions",
|
|
2163
|
-
initialState: initialState$
|
|
2164
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2144
|
+
initialState: initialState$e,
|
|
2145
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$e)),
|
|
2165
2146
|
reducers: {
|
|
2166
2147
|
initializeFormSubmissions: submissionAdapter.initialize,
|
|
2167
2148
|
setFormSubmission: submissionAdapter.setOne,
|
|
@@ -2217,6 +2198,43 @@ const selectFormSubmissionsOfForm = restructureCreateSelectorWithArgs(
|
|
|
2217
2198
|
}
|
|
2218
2199
|
)
|
|
2219
2200
|
);
|
|
2201
|
+
const selectFormSubmissionsByFormRevisions = createSelector([selectFormRevisionMapping, selectFormSubmissions], (revisions, submissions) => {
|
|
2202
|
+
var _a2;
|
|
2203
|
+
const submissionMapping = {};
|
|
2204
|
+
for (const revisionId in revisions) {
|
|
2205
|
+
submissionMapping[revisionId] = [];
|
|
2206
|
+
}
|
|
2207
|
+
for (const submission of submissions) {
|
|
2208
|
+
(_a2 = submissionMapping[submission.form_revision]) == null ? void 0 : _a2.push(submission);
|
|
2209
|
+
}
|
|
2210
|
+
return submissionMapping;
|
|
2211
|
+
});
|
|
2212
|
+
const selectSortedFormSubmissionsOfForm = restructureCreateSelectorWithArgs(
|
|
2213
|
+
createSelector(
|
|
2214
|
+
[
|
|
2215
|
+
selectFormRevisionMapping,
|
|
2216
|
+
selectFormSubmissionsByFormRevisions,
|
|
2217
|
+
(_state, formId) => formId
|
|
2218
|
+
],
|
|
2219
|
+
(revisionsMapping, submissionsByRevision, formId) => {
|
|
2220
|
+
const submissionsByFormRevisions = {};
|
|
2221
|
+
for (const revisionId in revisionsMapping) {
|
|
2222
|
+
const revision = revisionsMapping[revisionId];
|
|
2223
|
+
const submissionsOfRevision = submissionsByRevision[revisionId];
|
|
2224
|
+
if (revision && submissionsOfRevision && revision.form === formId) {
|
|
2225
|
+
submissionsByFormRevisions[revisionId] = submissionsOfRevision.sort(
|
|
2226
|
+
(a, b) => a.submitted_at < b.submitted_at ? -1 : 1
|
|
2227
|
+
);
|
|
2228
|
+
}
|
|
2229
|
+
}
|
|
2230
|
+
return Object.entries(submissionsByFormRevisions).sort((a, b) => {
|
|
2231
|
+
const aRevision = revisionsMapping[a[0]];
|
|
2232
|
+
const bRevision = revisionsMapping[b[0]];
|
|
2233
|
+
return formRevisionSortFn(aRevision, bRevision);
|
|
2234
|
+
}).map(([_revisionId, submissions]) => submissions).flat();
|
|
2235
|
+
}
|
|
2236
|
+
)
|
|
2237
|
+
);
|
|
2220
2238
|
const selectFormSubmissionsOfIssue = restructureCreateSelectorWithArgs(
|
|
2221
2239
|
createSelector(
|
|
2222
2240
|
[selectFormSubmissions, (_state, issueId) => issueId],
|
|
@@ -2227,6 +2245,54 @@ const selectFormSubmissionsOfIssue = restructureCreateSelectorWithArgs(
|
|
|
2227
2245
|
}
|
|
2228
2246
|
)
|
|
2229
2247
|
);
|
|
2248
|
+
const selectAttachedFormSubmissionsOfIssue = restructureCreateSelectorWithArgs(
|
|
2249
|
+
createSelector(
|
|
2250
|
+
[
|
|
2251
|
+
(state) => state.issueReducer.instances,
|
|
2252
|
+
(state) => state.formReducer.instances,
|
|
2253
|
+
(state) => state.formRevisionReducer.instances,
|
|
2254
|
+
(state) => state.formSubmissionReducer.instances,
|
|
2255
|
+
(_state, issueId) => issueId
|
|
2256
|
+
],
|
|
2257
|
+
(issues, forms, formRevisions, submissions, issueId) => {
|
|
2258
|
+
const issue = issues[issueId];
|
|
2259
|
+
if (!issue)
|
|
2260
|
+
return [];
|
|
2261
|
+
if (!issue.issue_type) {
|
|
2262
|
+
return Object.values(submissions).filter((submission) => submission.issue === issueId);
|
|
2263
|
+
}
|
|
2264
|
+
const issueTypeForms = new Set(
|
|
2265
|
+
Object.keys(forms).filter((formId) => forms[formId].issue_type === issue.issue_type)
|
|
2266
|
+
);
|
|
2267
|
+
const issueTypeFormRevisions = new Set(
|
|
2268
|
+
Object.keys(formRevisions).filter(
|
|
2269
|
+
(formRevisionId) => issueTypeForms.has(formRevisions[formRevisionId].form)
|
|
2270
|
+
)
|
|
2271
|
+
);
|
|
2272
|
+
return Object.values(submissions).filter(
|
|
2273
|
+
(submission) => submission.issue === issueId && !issueTypeFormRevisions.has(submission.form_revision)
|
|
2274
|
+
);
|
|
2275
|
+
}
|
|
2276
|
+
)
|
|
2277
|
+
);
|
|
2278
|
+
const selectFormSubmissionsByIssues = restructureCreateSelectorWithArgs(
|
|
2279
|
+
createSelector(
|
|
2280
|
+
[selectFormSubmissions, (_state, issueIds) => issueIds],
|
|
2281
|
+
(submissions, issueIds) => {
|
|
2282
|
+
var _a2;
|
|
2283
|
+
const issueSubmissions = {};
|
|
2284
|
+
for (const issueId of issueIds) {
|
|
2285
|
+
issueSubmissions[issueId] = [];
|
|
2286
|
+
}
|
|
2287
|
+
for (const submission of submissions) {
|
|
2288
|
+
if (submission.issue && issueIds.includes(submission.issue)) {
|
|
2289
|
+
(_a2 = issueSubmissions[submission.issue]) == null ? void 0 : _a2.push(submission);
|
|
2290
|
+
}
|
|
2291
|
+
}
|
|
2292
|
+
return issueSubmissions;
|
|
2293
|
+
}
|
|
2294
|
+
)
|
|
2295
|
+
);
|
|
2230
2296
|
const selectFormSubmissionsOfAsset = restructureCreateSelectorWithArgs(
|
|
2231
2297
|
createSelector(
|
|
2232
2298
|
[selectFormSubmissions, (_state, assetId) => assetId],
|
|
@@ -2237,15 +2303,62 @@ const selectFormSubmissionsOfAsset = restructureCreateSelectorWithArgs(
|
|
|
2237
2303
|
}
|
|
2238
2304
|
)
|
|
2239
2305
|
);
|
|
2306
|
+
const selectAttachedFormSubmissionsOfAsset = restructureCreateSelectorWithArgs(
|
|
2307
|
+
createSelector(
|
|
2308
|
+
[
|
|
2309
|
+
(state) => state.assetReducer.instances,
|
|
2310
|
+
(state) => state.formReducer.instances,
|
|
2311
|
+
(state) => state.formRevisionReducer.instances,
|
|
2312
|
+
(state) => state.formSubmissionReducer.instances,
|
|
2313
|
+
(_state, assetId) => assetId
|
|
2314
|
+
],
|
|
2315
|
+
(assets, forms, formRevisions, submissions, assetId) => {
|
|
2316
|
+
const asset = assets[assetId];
|
|
2317
|
+
if (!asset)
|
|
2318
|
+
return [];
|
|
2319
|
+
if (!asset.asset_type) {
|
|
2320
|
+
return Object.values(submissions).filter((submission) => submission.asset === assetId);
|
|
2321
|
+
}
|
|
2322
|
+
const issueTypeForms = new Set(
|
|
2323
|
+
Object.keys(forms).filter((formId) => forms[formId].asset_type === asset.asset_type)
|
|
2324
|
+
);
|
|
2325
|
+
const issueTypeFormRevisions = new Set(
|
|
2326
|
+
Object.keys(formRevisions).filter(
|
|
2327
|
+
(formRevisionId) => issueTypeForms.has(formRevisions[formRevisionId].form)
|
|
2328
|
+
)
|
|
2329
|
+
);
|
|
2330
|
+
return Object.values(submissions).filter(
|
|
2331
|
+
(submission) => submission.asset === assetId && !issueTypeFormRevisions.has(submission.form_revision)
|
|
2332
|
+
);
|
|
2333
|
+
}
|
|
2334
|
+
)
|
|
2335
|
+
);
|
|
2336
|
+
const selectFormSubmissionsByAssets = createSelector(
|
|
2337
|
+
[selectFormSubmissionsMapping, selectAssetsMapping],
|
|
2338
|
+
(submissions, assets) => {
|
|
2339
|
+
var _a2;
|
|
2340
|
+
const assetSubmissionMapping = {};
|
|
2341
|
+
for (const assetId in assets) {
|
|
2342
|
+
assetSubmissionMapping[assetId] = [];
|
|
2343
|
+
}
|
|
2344
|
+
for (const submissionId in submissions) {
|
|
2345
|
+
const submission = submissions[submissionId];
|
|
2346
|
+
if (submission.asset) {
|
|
2347
|
+
(_a2 = assetSubmissionMapping[submission.asset]) == null ? void 0 : _a2.push(submission);
|
|
2348
|
+
}
|
|
2349
|
+
}
|
|
2350
|
+
return assetSubmissionMapping;
|
|
2351
|
+
}
|
|
2352
|
+
);
|
|
2240
2353
|
const formSubmissionReducer = formSubmissionSlice.reducer;
|
|
2241
2354
|
const formSubmissionAttachmentAdapter = createModelAdapter(
|
|
2242
2355
|
(attachment) => attachment.offline_id
|
|
2243
2356
|
);
|
|
2244
|
-
const initialState$
|
|
2357
|
+
const initialState$d = formSubmissionAttachmentAdapter.getInitialState({});
|
|
2245
2358
|
const formSubmissionAttachmentSlice = createSlice({
|
|
2246
2359
|
name: "formSubmissionAttachments",
|
|
2247
|
-
initialState: initialState$
|
|
2248
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2360
|
+
initialState: initialState$d,
|
|
2361
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$d)),
|
|
2249
2362
|
reducers: {
|
|
2250
2363
|
initializeFormSubmissionAttachments: formSubmissionAttachmentAdapter.initialize,
|
|
2251
2364
|
addFormSubmissionAttachment: formSubmissionAttachmentAdapter.addOne,
|
|
@@ -2288,9 +2401,7 @@ const selectAttachmentsOfFormSubmission = restructureCreateSelectorWithArgs(
|
|
|
2288
2401
|
[selectFormSubmissionAttachmentsMapping, (_state, submissionId) => submissionId],
|
|
2289
2402
|
(attachmentsMapping, submissionId) => {
|
|
2290
2403
|
return fallbackToEmptyArray(
|
|
2291
|
-
Object.values(attachmentsMapping).filter(
|
|
2292
|
-
(attachment) => attachment.form_submission === submissionId
|
|
2293
|
-
)
|
|
2404
|
+
Object.values(attachmentsMapping).filter((attachment) => attachment.submission === submissionId)
|
|
2294
2405
|
);
|
|
2295
2406
|
}
|
|
2296
2407
|
)
|
|
@@ -2299,11 +2410,11 @@ const formSubmissionAttachmentReducer = formSubmissionAttachmentSlice.reducer;
|
|
|
2299
2410
|
const formRevisionAttachmentAdapter = createModelAdapter(
|
|
2300
2411
|
(attachment) => attachment.offline_id
|
|
2301
2412
|
);
|
|
2302
|
-
const initialState$
|
|
2413
|
+
const initialState$c = formRevisionAttachmentAdapter.getInitialState({});
|
|
2303
2414
|
const formRevisionAttachmentSlice = createSlice({
|
|
2304
2415
|
name: "formRevisionAttachments",
|
|
2305
|
-
initialState: initialState$
|
|
2306
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2416
|
+
initialState: initialState$c,
|
|
2417
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$c)),
|
|
2307
2418
|
reducers: {
|
|
2308
2419
|
initializeFormRevisionAttachments: formRevisionAttachmentAdapter.initialize,
|
|
2309
2420
|
addFormRevisionAttachment: formRevisionAttachmentAdapter.addOne,
|
|
@@ -2335,17 +2446,17 @@ const selectAttachmentsOfFormRevision = restructureCreateSelectorWithArgs(
|
|
|
2335
2446
|
[selectFormRevisionAttachmentsMapping, (_state, revisionId) => revisionId],
|
|
2336
2447
|
(attachments, revisionId) => {
|
|
2337
2448
|
return fallbackToEmptyArray(
|
|
2338
|
-
Object.values(attachments).filter((attachment) => attachment.
|
|
2449
|
+
Object.values(attachments).filter((attachment) => attachment.revision === revisionId)
|
|
2339
2450
|
);
|
|
2340
2451
|
}
|
|
2341
2452
|
)
|
|
2342
2453
|
);
|
|
2343
2454
|
const formRevisionAttachmentReducer = formRevisionAttachmentSlice.reducer;
|
|
2344
2455
|
const workspaceAdapter = createModelAdapter((workspace) => workspace.offline_id);
|
|
2345
|
-
const initialState$
|
|
2456
|
+
const initialState$b = workspaceAdapter.getInitialState({});
|
|
2346
2457
|
const workspaceSlice = createSlice({
|
|
2347
2458
|
name: "workspace",
|
|
2348
|
-
initialState: initialState$
|
|
2459
|
+
initialState: initialState$b,
|
|
2349
2460
|
reducers: {
|
|
2350
2461
|
initializeWorkspaces: workspaceAdapter.initialize,
|
|
2351
2462
|
setWorkspaces: workspaceAdapter.setMany,
|
|
@@ -2376,10 +2487,10 @@ const selectPermittedWorkspaceIds = createSelector(
|
|
|
2376
2487
|
);
|
|
2377
2488
|
const workspaceReducer = workspaceSlice.reducer;
|
|
2378
2489
|
const emailDomainAdapter = createModelAdapter((emailDomain) => emailDomain.offline_id);
|
|
2379
|
-
const initialState$
|
|
2490
|
+
const initialState$a = emailDomainAdapter.getInitialState({});
|
|
2380
2491
|
const emailDomainsSlice = createSlice({
|
|
2381
2492
|
name: "emailDomains",
|
|
2382
|
-
initialState: initialState$
|
|
2493
|
+
initialState: initialState$a,
|
|
2383
2494
|
reducers: {
|
|
2384
2495
|
initializeEmailDomains: emailDomainAdapter.initialize,
|
|
2385
2496
|
addEmailDomain: emailDomainAdapter.addOne,
|
|
@@ -2400,14 +2511,14 @@ const selectEmailDomainsOfOrganization = restructureCreateSelectorWithArgs(
|
|
|
2400
2511
|
)
|
|
2401
2512
|
);
|
|
2402
2513
|
const emailDomainsReducer = emailDomainsSlice.reducer;
|
|
2403
|
-
const initialState$
|
|
2514
|
+
const initialState$9 = {
|
|
2404
2515
|
documents: {}
|
|
2405
2516
|
};
|
|
2406
2517
|
const documentSlice = createSlice({
|
|
2407
2518
|
name: "documents",
|
|
2408
|
-
initialState: initialState$
|
|
2519
|
+
initialState: initialState$9,
|
|
2409
2520
|
extraReducers: (builder) => builder.addCase("RESET", (state) => {
|
|
2410
|
-
Object.assign(state, initialState$
|
|
2521
|
+
Object.assign(state, initialState$9);
|
|
2411
2522
|
}),
|
|
2412
2523
|
reducers: {
|
|
2413
2524
|
setDocuments: (state, action) => {
|
|
@@ -2596,11 +2707,11 @@ const selectRootDocuments = createSelector(
|
|
|
2596
2707
|
);
|
|
2597
2708
|
const documentsReducer = documentSlice.reducer;
|
|
2598
2709
|
const documentAttachmentAdapter = createModelAdapter((attachment) => attachment.offline_id);
|
|
2599
|
-
const initialState$
|
|
2710
|
+
const initialState$8 = documentAttachmentAdapter.getInitialState({});
|
|
2600
2711
|
const documentAttachmentSlice = createSlice({
|
|
2601
2712
|
name: "documentAttachments",
|
|
2602
|
-
initialState: initialState$
|
|
2603
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2713
|
+
initialState: initialState$8,
|
|
2714
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$8)),
|
|
2604
2715
|
reducers: {
|
|
2605
2716
|
initializeDocumentAttachments: documentAttachmentAdapter.initialize,
|
|
2606
2717
|
addDocumentAttachment: documentAttachmentAdapter.addOne,
|
|
@@ -2659,11 +2770,11 @@ const selectAttachmentsOfDocumentByType = restructureCreateSelectorWithArgs(
|
|
|
2659
2770
|
);
|
|
2660
2771
|
const documentAttachmentReducer = documentAttachmentSlice.reducer;
|
|
2661
2772
|
const teamAdapter = createModelAdapter((team) => team.offline_id);
|
|
2662
|
-
const initialState$
|
|
2773
|
+
const initialState$7 = teamAdapter.getInitialState({});
|
|
2663
2774
|
const teamSlice = createSlice({
|
|
2664
2775
|
name: "teams",
|
|
2665
|
-
initialState: initialState$
|
|
2666
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2776
|
+
initialState: initialState$7,
|
|
2777
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$7)),
|
|
2667
2778
|
reducers: {
|
|
2668
2779
|
setTeam: teamAdapter.setOne,
|
|
2669
2780
|
initializeTeams: teamAdapter.initialize,
|
|
@@ -2714,11 +2825,11 @@ const teamReducer = teamSlice.reducer;
|
|
|
2714
2825
|
const agentUserConversationAdapter = createModelAdapter(
|
|
2715
2826
|
(conversation) => conversation.offline_id
|
|
2716
2827
|
);
|
|
2717
|
-
const initialState$
|
|
2828
|
+
const initialState$6 = agentUserConversationAdapter.getInitialState({});
|
|
2718
2829
|
const agentsSlice = createSlice({
|
|
2719
2830
|
name: "agents",
|
|
2720
|
-
initialState: initialState$
|
|
2721
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2831
|
+
initialState: initialState$6,
|
|
2832
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$6)),
|
|
2722
2833
|
reducers: {
|
|
2723
2834
|
initializeConversations: agentUserConversationAdapter.initialize,
|
|
2724
2835
|
addConversation: agentUserConversationAdapter.addOne,
|
|
@@ -2740,11 +2851,11 @@ const selectConversation = restructureCreateSelectorWithArgs(
|
|
|
2740
2851
|
);
|
|
2741
2852
|
const agentsReducer = agentsSlice.reducer;
|
|
2742
2853
|
const issueCommentAdapter = createModelAdapter((comment) => comment.offline_id);
|
|
2743
|
-
const initialState$
|
|
2854
|
+
const initialState$5 = issueCommentAdapter.getInitialState({});
|
|
2744
2855
|
const issueCommentSlice = createSlice({
|
|
2745
2856
|
name: "issueComments",
|
|
2746
|
-
initialState: initialState$
|
|
2747
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2857
|
+
initialState: initialState$5,
|
|
2858
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$5)),
|
|
2748
2859
|
reducers: {
|
|
2749
2860
|
addIssueComment: issueCommentAdapter.addOne,
|
|
2750
2861
|
addIssueComments: issueCommentAdapter.addMany,
|
|
@@ -2773,11 +2884,11 @@ const selectCommentsOfIssue = restructureCreateSelectorWithArgs(
|
|
|
2773
2884
|
);
|
|
2774
2885
|
const issueCommentReducer = issueCommentSlice.reducer;
|
|
2775
2886
|
const issueUpdateAdapter = createModelAdapter((issueUpdate) => issueUpdate.offline_id);
|
|
2776
|
-
const initialState$
|
|
2887
|
+
const initialState$4 = issueUpdateAdapter.getInitialState({});
|
|
2777
2888
|
const issueUpdateSlice = createSlice({
|
|
2778
2889
|
name: "issueUpdates",
|
|
2779
|
-
initialState: initialState$
|
|
2780
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2890
|
+
initialState: initialState$4,
|
|
2891
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$4)),
|
|
2781
2892
|
reducers: {
|
|
2782
2893
|
initializeIssueUpdates: issueUpdateAdapter.setMany,
|
|
2783
2894
|
setIssueUpdate: issueUpdateAdapter.setOne,
|
|
@@ -2806,11 +2917,11 @@ const selectIssueUpdatesOfIssue = restructureCreateSelectorWithArgs(
|
|
|
2806
2917
|
);
|
|
2807
2918
|
const issueUpdateReducer = issueUpdateSlice.reducer;
|
|
2808
2919
|
const issueAttachmentAdapter = createModelAdapter((attachment) => attachment.offline_id);
|
|
2809
|
-
const initialState$
|
|
2920
|
+
const initialState$3 = issueAttachmentAdapter.getInitialState({});
|
|
2810
2921
|
const issueAttachmentSlice = createSlice({
|
|
2811
2922
|
name: "issueAttachments",
|
|
2812
|
-
initialState: initialState$
|
|
2813
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2923
|
+
initialState: initialState$3,
|
|
2924
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$3)),
|
|
2814
2925
|
reducers: {
|
|
2815
2926
|
initializeIssueAttachments: issueAttachmentAdapter.initialize,
|
|
2816
2927
|
addIssueAttachment: issueAttachmentAdapter.addOne,
|
|
@@ -2868,23 +2979,23 @@ const selectAttachmentsOfIssueByType = restructureCreateSelectorWithArgs(
|
|
|
2868
2979
|
)
|
|
2869
2980
|
);
|
|
2870
2981
|
const issueAttachmentReducer = issueAttachmentSlice.reducer;
|
|
2871
|
-
const initialState$
|
|
2982
|
+
const initialState$2 = {
|
|
2872
2983
|
version: 0
|
|
2873
2984
|
};
|
|
2874
2985
|
const versioningSlice = createSlice({
|
|
2875
2986
|
name: "versioning",
|
|
2876
|
-
initialState: initialState$
|
|
2987
|
+
initialState: initialState$2,
|
|
2877
2988
|
reducers: {}
|
|
2878
2989
|
});
|
|
2879
2990
|
const versioningReducer = versioningSlice.reducer;
|
|
2880
2991
|
const geoImageAdapter = createModelAdapter((model) => model.offline_id);
|
|
2881
|
-
const initialState$
|
|
2992
|
+
const initialState$1 = geoImageAdapter.getInitialState({});
|
|
2882
2993
|
const geoImageSlice = createSlice({
|
|
2883
2994
|
name: "geoImages",
|
|
2884
|
-
initialState: initialState$
|
|
2995
|
+
initialState: initialState$1,
|
|
2885
2996
|
extraReducers: (builder) => {
|
|
2886
2997
|
builder.addCase("RESET", (state) => {
|
|
2887
|
-
Object.assign(state, initialState$
|
|
2998
|
+
Object.assign(state, initialState$1);
|
|
2888
2999
|
});
|
|
2889
3000
|
},
|
|
2890
3001
|
reducers: {
|
|
@@ -2922,11 +3033,11 @@ const selectGeoImagesOfProject = restructureCreateSelectorWithArgs(
|
|
|
2922
3033
|
);
|
|
2923
3034
|
const geoImageReducer = geoImageSlice.reducer;
|
|
2924
3035
|
const issueAssociationAdapter = createModelAdapter((assoc) => assoc.offline_id);
|
|
2925
|
-
const initialState
|
|
3036
|
+
const initialState = issueAssociationAdapter.getInitialState({});
|
|
2926
3037
|
const issueAssociationSlice = createSlice({
|
|
2927
3038
|
name: "issueAssociations",
|
|
2928
|
-
initialState
|
|
2929
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState
|
|
3039
|
+
initialState,
|
|
3040
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState)),
|
|
2930
3041
|
reducers: {
|
|
2931
3042
|
initializeIssueAssociations: issueAssociationAdapter.initialize,
|
|
2932
3043
|
addIssueAssociation: issueAssociationAdapter.addOne,
|
|
@@ -2984,429 +3095,29 @@ const selectIssueAssociationsOfAsset = restructureCreateSelectorWithArgs(
|
|
|
2984
3095
|
)
|
|
2985
3096
|
);
|
|
2986
3097
|
const issueAssociationReducer = issueAssociationSlice.reducer;
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3098
|
+
let clientStore;
|
|
3099
|
+
function setClientStore(store) {
|
|
3100
|
+
clientStore = store;
|
|
3101
|
+
}
|
|
3102
|
+
function getClientStore() {
|
|
3103
|
+
return clientStore;
|
|
3104
|
+
}
|
|
3105
|
+
let clientSDK;
|
|
3106
|
+
function setClientSDK(sdkCtor) {
|
|
3107
|
+
clientSDK = sdkCtor;
|
|
3108
|
+
}
|
|
3109
|
+
function getClientSDK() {
|
|
3110
|
+
return clientSDK;
|
|
3111
|
+
}
|
|
3112
|
+
const CLASS_NAME_TO_SERVICE = {};
|
|
3113
|
+
class BaseService {
|
|
3114
|
+
constructor(sdk) {
|
|
3115
|
+
__publicField(this, "client");
|
|
3116
|
+
CLASS_NAME_TO_SERVICE[this.constructor.name] = this;
|
|
3117
|
+
this.client = sdk;
|
|
3005
3118
|
}
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
initializeIssueTypeFieldValues,
|
|
3009
|
-
addIssueTypeFieldValues,
|
|
3010
|
-
addIssueTypeFieldValuesMany,
|
|
3011
|
-
setIssueTypeFieldValues,
|
|
3012
|
-
setIssueTypeFieldValuesMany,
|
|
3013
|
-
updateIssueTypeFieldValues,
|
|
3014
|
-
updateIssueTypeFieldValuesMany,
|
|
3015
|
-
deleteIssueTypeFieldValues,
|
|
3016
|
-
deleteIssueTypeFieldValuesMany
|
|
3017
|
-
} = issueTypeFieldValuesSlice.actions;
|
|
3018
|
-
const selectIssueTypeFieldValuesMapping = (state) => state.issueTypeFieldValuesReducer.instances;
|
|
3019
|
-
const selectIssueTypeFieldValues = createSelector([selectIssueTypeFieldValuesMapping], (fieldValuesMapping) => {
|
|
3020
|
-
return Object.values(fieldValuesMapping);
|
|
3021
|
-
});
|
|
3022
|
-
const selectIssueTypeFieldValuesOfIssue = restructureCreateSelectorWithArgs(
|
|
3023
|
-
createSelector([selectIssueTypeFieldValues, (_state, issueId) => issueId], (fieldValues, issueId) => {
|
|
3024
|
-
return fallbackToEmptyArray(fieldValues.filter((fieldValue) => fieldValue.issue === issueId));
|
|
3025
|
-
})
|
|
3026
|
-
);
|
|
3027
|
-
const selectIssueTypeFieldValuesById = (fieldValuesId) => (state) => {
|
|
3028
|
-
return state.issueTypeFieldValuesReducer.instances[fieldValuesId];
|
|
3029
|
-
};
|
|
3030
|
-
const issueTypeFieldValuesReducer = issueTypeFieldValuesSlice.reducer;
|
|
3031
|
-
const issueTypeFieldsAdapter = createModelAdapter((fields) => fields.offline_id);
|
|
3032
|
-
const initialState$6 = issueTypeFieldsAdapter.getInitialState({});
|
|
3033
|
-
const issueTypeFieldsSlice = createSlice({
|
|
3034
|
-
name: "issueTypeFields",
|
|
3035
|
-
initialState: initialState$6,
|
|
3036
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$6)),
|
|
3037
|
-
reducers: {
|
|
3038
|
-
initializeIssueTypeFields: issueTypeFieldsAdapter.initialize,
|
|
3039
|
-
addIssueTypeFields: issueTypeFieldsAdapter.addOne,
|
|
3040
|
-
addIssueTypeFieldsMany: issueTypeFieldsAdapter.addMany,
|
|
3041
|
-
setIssueTypeFields: issueTypeFieldsAdapter.setOne,
|
|
3042
|
-
setIssueTypeFieldsMany: issueTypeFieldsAdapter.setMany,
|
|
3043
|
-
updateIssueTypeFields: issueTypeFieldsAdapter.updateOne,
|
|
3044
|
-
updateIssueTypeFieldsMany: issueTypeFieldsAdapter.updateMany,
|
|
3045
|
-
deleteIssueTypeFields: issueTypeFieldsAdapter.deleteOne,
|
|
3046
|
-
deleteIssueTypeFieldsMany: issueTypeFieldsAdapter.deleteMany
|
|
3047
|
-
}
|
|
3048
|
-
});
|
|
3049
|
-
const {
|
|
3050
|
-
initializeIssueTypeFields,
|
|
3051
|
-
addIssueTypeFields,
|
|
3052
|
-
addIssueTypeFieldsMany,
|
|
3053
|
-
setIssueTypeFields,
|
|
3054
|
-
setIssueTypeFieldsMany,
|
|
3055
|
-
updateIssueTypeFields,
|
|
3056
|
-
updateIssueTypeFieldsMany,
|
|
3057
|
-
deleteIssueTypeFields,
|
|
3058
|
-
deleteIssueTypeFieldsMany
|
|
3059
|
-
} = issueTypeFieldsSlice.actions;
|
|
3060
|
-
const selectIssueTypeFieldsMapping = (state) => state.issueTypeFieldsReducer.instances;
|
|
3061
|
-
const selectIssueTypeFields = createSelector([selectIssueTypeFieldsMapping], (fieldsMapping) => {
|
|
3062
|
-
return Object.values(fieldsMapping);
|
|
3063
|
-
});
|
|
3064
|
-
const selectIssueTypeFieldsOfIssueType = restructureCreateSelectorWithArgs(
|
|
3065
|
-
createSelector([selectIssueTypeFields, (_state, issueTypeId) => issueTypeId], (fields, issueTypeId) => {
|
|
3066
|
-
return fallbackToEmptyArray(fields.filter((field) => field.issue_type === issueTypeId));
|
|
3067
|
-
})
|
|
3068
|
-
);
|
|
3069
|
-
const selectLatestIssueTypeFieldsOfIssueType = restructureCreateSelectorWithArgs(
|
|
3070
|
-
createSelector([selectIssueTypeFields, (_state, id) => id], (fields, id) => {
|
|
3071
|
-
return fields.filter((field) => field.issue_type === id).sort((a, b) => a.submitted_at > b.submitted_at ? -1 : 1)[0];
|
|
3072
|
-
})
|
|
3073
|
-
);
|
|
3074
|
-
const selectIssueTypeValuesOfIssueType = restructureCreateSelectorWithArgs(
|
|
3075
|
-
createSelector(
|
|
3076
|
-
[selectIssueTypeFields, selectIssueTypeFieldValues, (_state, id) => id],
|
|
3077
|
-
(fields, fieldValues, id) => {
|
|
3078
|
-
const fieldsIds = new Set(
|
|
3079
|
-
fields.filter((field) => field.issue_type === id).map((field) => field.offline_id)
|
|
3080
|
-
);
|
|
3081
|
-
return fallbackToEmptyArray(fieldValues.filter((values) => fieldsIds.has(values.fields_revision)));
|
|
3082
|
-
}
|
|
3083
|
-
)
|
|
3084
|
-
);
|
|
3085
|
-
const selectIssueTypeFieldsById = (fieldsId) => (state) => {
|
|
3086
|
-
return state.issueTypeFieldsReducer.instances[fieldsId];
|
|
3087
|
-
};
|
|
3088
|
-
const issueTypeFieldsReducer = issueTypeFieldsSlice.reducer;
|
|
3089
|
-
const issueTypeFieldsAttachmentAdapter = createModelAdapter(
|
|
3090
|
-
(attachment) => attachment.offline_id
|
|
3091
|
-
);
|
|
3092
|
-
const initialState$5 = issueTypeFieldsAttachmentAdapter.getInitialState({});
|
|
3093
|
-
const issueTypeFieldsAttachmentSlice = createSlice({
|
|
3094
|
-
name: "issueTypeFieldsAttachments",
|
|
3095
|
-
initialState: initialState$5,
|
|
3096
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$5)),
|
|
3097
|
-
reducers: {
|
|
3098
|
-
initializeIssueTypeFieldsAttachments: issueTypeFieldsAttachmentAdapter.initialize,
|
|
3099
|
-
addIssueTypeFieldsAttachment: issueTypeFieldsAttachmentAdapter.addOne,
|
|
3100
|
-
addIssueTypeFieldsAttachments: issueTypeFieldsAttachmentAdapter.addMany,
|
|
3101
|
-
setIssueTypeFieldsAttachment: issueTypeFieldsAttachmentAdapter.setOne,
|
|
3102
|
-
setIssueTypeFieldsAttachments: issueTypeFieldsAttachmentAdapter.setMany,
|
|
3103
|
-
updateIssueTypeFieldsAttachment: issueTypeFieldsAttachmentAdapter.updateOne,
|
|
3104
|
-
updateIssueTypeFieldsAttachments: issueTypeFieldsAttachmentAdapter.updateMany,
|
|
3105
|
-
deleteIssueTypeFieldsAttachment: issueTypeFieldsAttachmentAdapter.deleteOne,
|
|
3106
|
-
deleteIssueTypeFieldsAttachments: issueTypeFieldsAttachmentAdapter.deleteMany
|
|
3107
|
-
}
|
|
3108
|
-
});
|
|
3109
|
-
const {
|
|
3110
|
-
initializeIssueTypeFieldsAttachments,
|
|
3111
|
-
addIssueTypeFieldsAttachment,
|
|
3112
|
-
addIssueTypeFieldsAttachments,
|
|
3113
|
-
setIssueTypeFieldsAttachment,
|
|
3114
|
-
setIssueTypeFieldsAttachments,
|
|
3115
|
-
updateIssueTypeFieldsAttachment,
|
|
3116
|
-
updateIssueTypeFieldsAttachments,
|
|
3117
|
-
deleteIssueTypeFieldsAttachment,
|
|
3118
|
-
deleteIssueTypeFieldsAttachments
|
|
3119
|
-
} = issueTypeFieldsAttachmentSlice.actions;
|
|
3120
|
-
const selectIssueTypeFieldsAttachmentsMapping = (state) => state.issueTypeFieldsAttachmentReducer.instances;
|
|
3121
|
-
const selectIssueTypeFieldsAttachments = createSelector(
|
|
3122
|
-
[selectIssueTypeFieldsAttachmentsMapping],
|
|
3123
|
-
(attachmentsMapping) => {
|
|
3124
|
-
return Object.values(attachmentsMapping);
|
|
3125
|
-
}
|
|
3126
|
-
);
|
|
3127
|
-
const selectAttachmentsOfIssueTypeFields = restructureCreateSelectorWithArgs(
|
|
3128
|
-
createSelector(
|
|
3129
|
-
[selectIssueTypeFieldsAttachments, (_state, fieldsRevision) => fieldsRevision],
|
|
3130
|
-
(attachments, fieldsRevision) => {
|
|
3131
|
-
return fallbackToEmptyArray(
|
|
3132
|
-
attachments.filter((attachment) => attachment.fields_revision === fieldsRevision)
|
|
3133
|
-
);
|
|
3134
|
-
}
|
|
3135
|
-
)
|
|
3136
|
-
);
|
|
3137
|
-
const selectIssueTypeFieldsAttachmentById = (attachmentId) => (state) => {
|
|
3138
|
-
return state.issueTypeFieldsAttachmentReducer.instances[attachmentId];
|
|
3139
|
-
};
|
|
3140
|
-
const issueTypeFieldsAttachmentReducer = issueTypeFieldsAttachmentSlice.reducer;
|
|
3141
|
-
const issueTypeFieldValuesAttachmentAdapter = createModelAdapter(
|
|
3142
|
-
(attachment) => attachment.offline_id
|
|
3143
|
-
);
|
|
3144
|
-
const initialState$4 = issueTypeFieldValuesAttachmentAdapter.getInitialState({});
|
|
3145
|
-
const issueTypeFieldValuesAttachmentSlice = createSlice({
|
|
3146
|
-
name: "issueTypeFieldValuesAttachments",
|
|
3147
|
-
initialState: initialState$4,
|
|
3148
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$4)),
|
|
3149
|
-
reducers: {
|
|
3150
|
-
initializeIssueTypeFieldValuesAttachments: issueTypeFieldValuesAttachmentAdapter.initialize,
|
|
3151
|
-
addIssueTypeFieldValuesAttachment: issueTypeFieldValuesAttachmentAdapter.addOne,
|
|
3152
|
-
addIssueTypeFieldValuesAttachments: issueTypeFieldValuesAttachmentAdapter.addMany,
|
|
3153
|
-
setIssueTypeFieldValuesAttachment: issueTypeFieldValuesAttachmentAdapter.setOne,
|
|
3154
|
-
setIssueTypeFieldValuesAttachments: issueTypeFieldValuesAttachmentAdapter.setMany,
|
|
3155
|
-
updateIssueTypeFieldValuesAttachment: issueTypeFieldValuesAttachmentAdapter.updateOne,
|
|
3156
|
-
updateIssueTypeFieldValuesAttachments: issueTypeFieldValuesAttachmentAdapter.updateMany,
|
|
3157
|
-
deleteIssueTypeFieldValuesAttachment: issueTypeFieldValuesAttachmentAdapter.deleteOne,
|
|
3158
|
-
deleteIssueTypeFieldValuesAttachments: issueTypeFieldValuesAttachmentAdapter.deleteMany
|
|
3159
|
-
}
|
|
3160
|
-
});
|
|
3161
|
-
const {
|
|
3162
|
-
initializeIssueTypeFieldValuesAttachments,
|
|
3163
|
-
addIssueTypeFieldValuesAttachment,
|
|
3164
|
-
addIssueTypeFieldValuesAttachments,
|
|
3165
|
-
setIssueTypeFieldValuesAttachment,
|
|
3166
|
-
setIssueTypeFieldValuesAttachments,
|
|
3167
|
-
updateIssueTypeFieldValuesAttachment,
|
|
3168
|
-
updateIssueTypeFieldValuesAttachments,
|
|
3169
|
-
deleteIssueTypeFieldValuesAttachment,
|
|
3170
|
-
deleteIssueTypeFieldValuesAttachments
|
|
3171
|
-
} = issueTypeFieldValuesAttachmentSlice.actions;
|
|
3172
|
-
const selectIssueTypeFieldValuesAttachmentsMapping = (state) => state.issueTypeFieldValuesAttachmentReducer.instances;
|
|
3173
|
-
const selectIssueTypeFieldValuesAttachments = createSelector(
|
|
3174
|
-
[selectIssueTypeFieldValuesAttachmentsMapping],
|
|
3175
|
-
(attachmentsMapping) => {
|
|
3176
|
-
return Object.values(attachmentsMapping);
|
|
3177
|
-
}
|
|
3178
|
-
);
|
|
3179
|
-
const selectAttachmentsOfIssueTypeFieldValues = restructureCreateSelectorWithArgs(
|
|
3180
|
-
createSelector(
|
|
3181
|
-
[selectIssueTypeFieldValuesAttachments, (_state, fieldValuesId) => fieldValuesId],
|
|
3182
|
-
(attachments, fieldValuesId) => {
|
|
3183
|
-
return fallbackToEmptyArray(attachments.filter((attachment) => attachment.field_values === fieldValuesId));
|
|
3184
|
-
}
|
|
3185
|
-
)
|
|
3186
|
-
);
|
|
3187
|
-
const selectIssueTypeFieldValuesAttachmentById = (attachmentId) => (state) => {
|
|
3188
|
-
return state.issueTypeFieldValuesAttachmentReducer.instances[attachmentId];
|
|
3189
|
-
};
|
|
3190
|
-
const issueTypeFieldValuesAttachmentReducer = issueTypeFieldValuesAttachmentSlice.reducer;
|
|
3191
|
-
const assetTypeFieldsAdapter = createModelAdapter((fields) => fields.offline_id);
|
|
3192
|
-
const initialState$3 = assetTypeFieldsAdapter.getInitialState({});
|
|
3193
|
-
const assetTypeFieldsSlice = createSlice({
|
|
3194
|
-
name: "assetTypeFields",
|
|
3195
|
-
initialState: initialState$3,
|
|
3196
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$3)),
|
|
3197
|
-
reducers: {
|
|
3198
|
-
initializeAssetTypeFields: assetTypeFieldsAdapter.initialize,
|
|
3199
|
-
addAssetTypeFields: assetTypeFieldsAdapter.addOne,
|
|
3200
|
-
addAssetTypeFieldsMany: assetTypeFieldsAdapter.addMany,
|
|
3201
|
-
setAssetTypeFields: assetTypeFieldsAdapter.setOne,
|
|
3202
|
-
setAssetTypeFieldsMany: assetTypeFieldsAdapter.setMany,
|
|
3203
|
-
updateAssetTypeFields: assetTypeFieldsAdapter.updateOne,
|
|
3204
|
-
updateAssetTypeFieldsMany: assetTypeFieldsAdapter.updateMany,
|
|
3205
|
-
deleteAssetTypeFields: assetTypeFieldsAdapter.deleteOne,
|
|
3206
|
-
deleteAssetTypeFieldsMany: assetTypeFieldsAdapter.deleteMany
|
|
3207
|
-
}
|
|
3208
|
-
});
|
|
3209
|
-
const {
|
|
3210
|
-
initializeAssetTypeFields,
|
|
3211
|
-
addAssetTypeFields,
|
|
3212
|
-
addAssetTypeFieldsMany,
|
|
3213
|
-
setAssetTypeFields,
|
|
3214
|
-
setAssetTypeFieldsMany,
|
|
3215
|
-
updateAssetTypeFields,
|
|
3216
|
-
updateAssetTypeFieldsMany,
|
|
3217
|
-
deleteAssetTypeFields,
|
|
3218
|
-
deleteAssetTypeFieldsMany
|
|
3219
|
-
} = assetTypeFieldsSlice.actions;
|
|
3220
|
-
const selectAssetTypeFieldsMapping = (state) => state.assetTypeFieldsReducer.instances;
|
|
3221
|
-
const selectAssetTypeFields = createSelector([selectAssetTypeFieldsMapping], (fieldsMapping) => {
|
|
3222
|
-
return Object.values(fieldsMapping);
|
|
3223
|
-
});
|
|
3224
|
-
const selectAssetTypeFieldsOfAssetType = restructureCreateSelectorWithArgs(
|
|
3225
|
-
createSelector([selectAssetTypeFields, (_state, assetTypeId) => assetTypeId], (fields, assetTypeId) => {
|
|
3226
|
-
return fallbackToEmptyArray(fields.filter((field) => field.asset_type === assetTypeId));
|
|
3227
|
-
})
|
|
3228
|
-
);
|
|
3229
|
-
const selectLatestAssetTypeFieldsOfAssetType = restructureCreateSelectorWithArgs(
|
|
3230
|
-
createSelector([selectAssetTypeFields, (_state, id) => id], (fields, id) => {
|
|
3231
|
-
return fields.filter((field) => field.asset_type === id).sort((a, b) => a.submitted_at > b.submitted_at ? -1 : 1)[0];
|
|
3232
|
-
})
|
|
3233
|
-
);
|
|
3234
|
-
const selectAssetTypeFieldsById = (fieldsId) => (state) => {
|
|
3235
|
-
return state.assetTypeFieldsReducer.instances[fieldsId];
|
|
3236
|
-
};
|
|
3237
|
-
const assetTypeFieldsReducer = assetTypeFieldsSlice.reducer;
|
|
3238
|
-
const assetTypeFieldValuesAdapter = createModelAdapter(
|
|
3239
|
-
(fieldValues) => fieldValues.offline_id
|
|
3240
|
-
);
|
|
3241
|
-
const initialState$2 = assetTypeFieldValuesAdapter.getInitialState({});
|
|
3242
|
-
const assetTypeFieldValuesSlice = createSlice({
|
|
3243
|
-
name: "assetTypeFieldValues",
|
|
3244
|
-
initialState: initialState$2,
|
|
3245
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$2)),
|
|
3246
|
-
reducers: {
|
|
3247
|
-
initializeAssetTypeFieldValues: assetTypeFieldValuesAdapter.initialize,
|
|
3248
|
-
addAssetTypeFieldValues: assetTypeFieldValuesAdapter.addOne,
|
|
3249
|
-
addAssetTypeFieldValuesMany: assetTypeFieldValuesAdapter.addMany,
|
|
3250
|
-
setAssetTypeFieldValues: assetTypeFieldValuesAdapter.setOne,
|
|
3251
|
-
setAssetTypeFieldValuesMany: assetTypeFieldValuesAdapter.setMany,
|
|
3252
|
-
updateAssetTypeFieldValues: assetTypeFieldValuesAdapter.updateOne,
|
|
3253
|
-
updateAssetTypeFieldValuesMany: assetTypeFieldValuesAdapter.updateMany,
|
|
3254
|
-
deleteAssetTypeFieldValues: assetTypeFieldValuesAdapter.deleteOne,
|
|
3255
|
-
deleteAssetTypeFieldValuesMany: assetTypeFieldValuesAdapter.deleteMany
|
|
3256
|
-
}
|
|
3257
|
-
});
|
|
3258
|
-
const {
|
|
3259
|
-
initializeAssetTypeFieldValues,
|
|
3260
|
-
addAssetTypeFieldValues,
|
|
3261
|
-
addAssetTypeFieldValuesMany,
|
|
3262
|
-
setAssetTypeFieldValues,
|
|
3263
|
-
setAssetTypeFieldValuesMany,
|
|
3264
|
-
updateAssetTypeFieldValues,
|
|
3265
|
-
updateAssetTypeFieldValuesMany,
|
|
3266
|
-
deleteAssetTypeFieldValues,
|
|
3267
|
-
deleteAssetTypeFieldValuesMany
|
|
3268
|
-
} = assetTypeFieldValuesSlice.actions;
|
|
3269
|
-
const selectAssetTypeFieldValuesMapping = (state) => state.assetTypeFieldValuesReducer.instances;
|
|
3270
|
-
const selectAssetTypeFieldValues = createSelector([selectAssetTypeFieldValuesMapping], (fieldValuesMapping) => {
|
|
3271
|
-
return Object.values(fieldValuesMapping);
|
|
3272
|
-
});
|
|
3273
|
-
const selectAssetTypeFieldValuesOfAsset = restructureCreateSelectorWithArgs(
|
|
3274
|
-
createSelector([selectAssetTypeFieldValues, (_state, assetId) => assetId], (fieldValues, assetId) => {
|
|
3275
|
-
return fallbackToEmptyArray(fieldValues.filter((fieldValue) => fieldValue.asset === assetId));
|
|
3276
|
-
})
|
|
3277
|
-
);
|
|
3278
|
-
const selectAssetTypeValuesOfAssetType = restructureCreateSelectorWithArgs(
|
|
3279
|
-
createSelector(
|
|
3280
|
-
[selectAssetTypeFields, selectAssetTypeFieldValues, (_state, id) => id],
|
|
3281
|
-
(fields, fieldValues, id) => {
|
|
3282
|
-
const fieldsIds = new Set(
|
|
3283
|
-
fields.filter((field) => field.asset_type === id).map((field) => field.offline_id)
|
|
3284
|
-
);
|
|
3285
|
-
return fallbackToEmptyArray(fieldValues.filter((values) => fieldsIds.has(values.fields_revision)));
|
|
3286
|
-
}
|
|
3287
|
-
)
|
|
3288
|
-
);
|
|
3289
|
-
const selectAssetTypeFieldValuesById = (fieldValuesId) => (state) => {
|
|
3290
|
-
return state.assetTypeFieldValuesReducer.instances[fieldValuesId];
|
|
3291
|
-
};
|
|
3292
|
-
const assetTypeFieldValuesReducer = assetTypeFieldValuesSlice.reducer;
|
|
3293
|
-
const assetTypeFieldsAttachmentAdapter = createModelAdapter(
|
|
3294
|
-
(attachment) => attachment.offline_id
|
|
3295
|
-
);
|
|
3296
|
-
const initialState$1 = assetTypeFieldsAttachmentAdapter.getInitialState({});
|
|
3297
|
-
const assetTypeFieldsAttachmentSlice = createSlice({
|
|
3298
|
-
name: "assetTypeFieldsAttachments",
|
|
3299
|
-
initialState: initialState$1,
|
|
3300
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$1)),
|
|
3301
|
-
reducers: {
|
|
3302
|
-
initializeAssetTypeFieldsAttachments: assetTypeFieldsAttachmentAdapter.initialize,
|
|
3303
|
-
addAssetTypeFieldsAttachment: assetTypeFieldsAttachmentAdapter.addOne,
|
|
3304
|
-
addAssetTypeFieldsAttachments: assetTypeFieldsAttachmentAdapter.addMany,
|
|
3305
|
-
setAssetTypeFieldsAttachment: assetTypeFieldsAttachmentAdapter.setOne,
|
|
3306
|
-
setAssetTypeFieldsAttachments: assetTypeFieldsAttachmentAdapter.setMany,
|
|
3307
|
-
updateAssetTypeFieldsAttachment: assetTypeFieldsAttachmentAdapter.updateOne,
|
|
3308
|
-
updateAssetTypeFieldsAttachments: assetTypeFieldsAttachmentAdapter.updateMany,
|
|
3309
|
-
deleteAssetTypeFieldsAttachment: assetTypeFieldsAttachmentAdapter.deleteOne,
|
|
3310
|
-
deleteAssetTypeFieldsAttachments: assetTypeFieldsAttachmentAdapter.deleteMany
|
|
3311
|
-
}
|
|
3312
|
-
});
|
|
3313
|
-
const {
|
|
3314
|
-
initializeAssetTypeFieldsAttachments,
|
|
3315
|
-
addAssetTypeFieldsAttachment,
|
|
3316
|
-
addAssetTypeFieldsAttachments,
|
|
3317
|
-
setAssetTypeFieldsAttachment,
|
|
3318
|
-
setAssetTypeFieldsAttachments,
|
|
3319
|
-
updateAssetTypeFieldsAttachment,
|
|
3320
|
-
updateAssetTypeFieldsAttachments,
|
|
3321
|
-
deleteAssetTypeFieldsAttachment,
|
|
3322
|
-
deleteAssetTypeFieldsAttachments
|
|
3323
|
-
} = assetTypeFieldsAttachmentSlice.actions;
|
|
3324
|
-
const selectAssetTypeFieldsAttachmentsMapping = (state) => state.assetTypeFieldsAttachmentReducer.instances;
|
|
3325
|
-
const selectAssetTypeFieldsAttachments = createSelector(
|
|
3326
|
-
[selectAssetTypeFieldsAttachmentsMapping],
|
|
3327
|
-
(attachmentsMapping) => {
|
|
3328
|
-
return Object.values(attachmentsMapping);
|
|
3329
|
-
}
|
|
3330
|
-
);
|
|
3331
|
-
const selectAttachmentsOfAssetTypeFields = restructureCreateSelectorWithArgs(
|
|
3332
|
-
createSelector([selectAssetTypeFieldsAttachments, (_state, id) => id], (attachments, id) => {
|
|
3333
|
-
return fallbackToEmptyArray(attachments.filter((attachment) => attachment.fields_revision === id));
|
|
3334
|
-
})
|
|
3335
|
-
);
|
|
3336
|
-
const selectAssetTypeFieldsAttachmentById = (attachmentId) => (state) => {
|
|
3337
|
-
return state.assetTypeFieldsAttachmentReducer.instances[attachmentId];
|
|
3338
|
-
};
|
|
3339
|
-
const assetTypeFieldsAttachmentReducer = assetTypeFieldsAttachmentSlice.reducer;
|
|
3340
|
-
const assetTypeFieldValuesAttachmentAdapter = createModelAdapter(
|
|
3341
|
-
(attachment) => attachment.offline_id
|
|
3342
|
-
);
|
|
3343
|
-
const initialState = assetTypeFieldValuesAttachmentAdapter.getInitialState({});
|
|
3344
|
-
const assetTypeFieldValuesAttachmentSlice = createSlice({
|
|
3345
|
-
name: "assetTypeFieldValuesAttachments",
|
|
3346
|
-
initialState,
|
|
3347
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState)),
|
|
3348
|
-
reducers: {
|
|
3349
|
-
initializeAssetTypeFieldValuesAttachments: assetTypeFieldValuesAttachmentAdapter.initialize,
|
|
3350
|
-
addAssetTypeFieldValuesAttachment: assetTypeFieldValuesAttachmentAdapter.addOne,
|
|
3351
|
-
addAssetTypeFieldValuesAttachments: assetTypeFieldValuesAttachmentAdapter.addMany,
|
|
3352
|
-
setAssetTypeFieldValuesAttachment: assetTypeFieldValuesAttachmentAdapter.setOne,
|
|
3353
|
-
setAssetTypeFieldValuesAttachments: assetTypeFieldValuesAttachmentAdapter.setMany,
|
|
3354
|
-
updateAssetTypeFieldValuesAttachment: assetTypeFieldValuesAttachmentAdapter.updateOne,
|
|
3355
|
-
updateAssetTypeFieldValuesAttachments: assetTypeFieldValuesAttachmentAdapter.updateMany,
|
|
3356
|
-
deleteAssetTypeFieldValuesAttachment: assetTypeFieldValuesAttachmentAdapter.deleteOne,
|
|
3357
|
-
deleteAssetTypeFieldValuesAttachments: assetTypeFieldValuesAttachmentAdapter.deleteMany
|
|
3358
|
-
}
|
|
3359
|
-
});
|
|
3360
|
-
const {
|
|
3361
|
-
initializeAssetTypeFieldValuesAttachments,
|
|
3362
|
-
addAssetTypeFieldValuesAttachment,
|
|
3363
|
-
addAssetTypeFieldValuesAttachments,
|
|
3364
|
-
setAssetTypeFieldValuesAttachment,
|
|
3365
|
-
setAssetTypeFieldValuesAttachments,
|
|
3366
|
-
updateAssetTypeFieldValuesAttachment,
|
|
3367
|
-
updateAssetTypeFieldValuesAttachments,
|
|
3368
|
-
deleteAssetTypeFieldValuesAttachment,
|
|
3369
|
-
deleteAssetTypeFieldValuesAttachments
|
|
3370
|
-
} = assetTypeFieldValuesAttachmentSlice.actions;
|
|
3371
|
-
const selectAssetTypeFieldValuesAttachmentsMapping = (state) => state.assetTypeFieldValuesAttachmentReducer.instances;
|
|
3372
|
-
const selectAssetTypeFieldValuesAttachments = createSelector(
|
|
3373
|
-
[selectAssetTypeFieldValuesAttachmentsMapping],
|
|
3374
|
-
(attachmentsMapping) => {
|
|
3375
|
-
return Object.values(attachmentsMapping);
|
|
3376
|
-
}
|
|
3377
|
-
);
|
|
3378
|
-
const selectAttachmentsOfAssetTypeFieldValues = restructureCreateSelectorWithArgs(
|
|
3379
|
-
createSelector([selectAssetTypeFieldValuesAttachments, (_state, id) => id], (attachments, id) => {
|
|
3380
|
-
return fallbackToEmptyArray(attachments.filter((attachment) => attachment.field_values === id));
|
|
3381
|
-
})
|
|
3382
|
-
);
|
|
3383
|
-
const selectAssetTypeFieldValuesAttachmentById = (attachmentId) => (state) => {
|
|
3384
|
-
return state.assetTypeFieldValuesAttachmentReducer.instances[attachmentId];
|
|
3385
|
-
};
|
|
3386
|
-
const assetTypeFieldValuesAttachmentReducer = assetTypeFieldValuesAttachmentSlice.reducer;
|
|
3387
|
-
let clientStore;
|
|
3388
|
-
function setClientStore(store) {
|
|
3389
|
-
clientStore = store;
|
|
3390
|
-
}
|
|
3391
|
-
function getClientStore() {
|
|
3392
|
-
return clientStore;
|
|
3393
|
-
}
|
|
3394
|
-
let clientSDK;
|
|
3395
|
-
function setClientSDK(sdkCtor) {
|
|
3396
|
-
clientSDK = sdkCtor;
|
|
3397
|
-
}
|
|
3398
|
-
function getClientSDK() {
|
|
3399
|
-
return clientSDK;
|
|
3400
|
-
}
|
|
3401
|
-
const CLASS_NAME_TO_SERVICE = {};
|
|
3402
|
-
class BaseService {
|
|
3403
|
-
constructor(sdk) {
|
|
3404
|
-
__publicField(this, "client");
|
|
3405
|
-
CLASS_NAME_TO_SERVICE[this.constructor.name] = this;
|
|
3406
|
-
this.client = sdk;
|
|
3407
|
-
}
|
|
3408
|
-
async enqueueRequest(requestDetails) {
|
|
3409
|
-
return this.client.enqueueRequest(requestDetails, this.host, this.constructor.name);
|
|
3119
|
+
async enqueueRequest(requestDetails) {
|
|
3120
|
+
return this.client.enqueueRequest(requestDetails, this.host, this.constructor.name);
|
|
3410
3121
|
}
|
|
3411
3122
|
dispatch(action) {
|
|
3412
3123
|
this.client.store.dispatch(action);
|
|
@@ -3452,15 +3163,7 @@ const overmapReducers = {
|
|
|
3452
3163
|
issueCommentReducer,
|
|
3453
3164
|
issueUpdateReducer,
|
|
3454
3165
|
geoImageReducer,
|
|
3455
|
-
issueAssociationReducer
|
|
3456
|
-
issueTypeFieldsReducer,
|
|
3457
|
-
issueTypeFieldValuesReducer,
|
|
3458
|
-
issueTypeFieldsAttachmentReducer,
|
|
3459
|
-
issueTypeFieldValuesAttachmentReducer,
|
|
3460
|
-
assetTypeFieldsReducer,
|
|
3461
|
-
assetTypeFieldValuesReducer,
|
|
3462
|
-
assetTypeFieldsAttachmentReducer,
|
|
3463
|
-
assetTypeFieldValuesAttachmentReducer
|
|
3166
|
+
issueAssociationReducer
|
|
3464
3167
|
};
|
|
3465
3168
|
const overmapReducer = combineReducers(overmapReducers);
|
|
3466
3169
|
const resetStore = "RESET";
|
|
@@ -4102,6 +3805,9 @@ class CategoryService extends BaseApiService {
|
|
|
4102
3805
|
description: "Create Category",
|
|
4103
3806
|
method: HttpMethod.POST,
|
|
4104
3807
|
url: "/categories/",
|
|
3808
|
+
queryParams: {
|
|
3809
|
+
workspace_id: payload.workspace.toString()
|
|
3810
|
+
},
|
|
4105
3811
|
payload: offlineCategory,
|
|
4106
3812
|
blockers: [payload.workspace],
|
|
4107
3813
|
blocks: [offlineCategory.offline_id]
|
|
@@ -4314,10 +4020,7 @@ class AssetService extends BaseApiService {
|
|
|
4314
4020
|
const result = await this.enqueueRequest({
|
|
4315
4021
|
description: "Get assets",
|
|
4316
4022
|
method: HttpMethod.GET,
|
|
4317
|
-
url:
|
|
4318
|
-
queryParams: {
|
|
4319
|
-
project: projectId.toString()
|
|
4320
|
-
},
|
|
4023
|
+
url: `/projects/${projectId}/assets/`,
|
|
4321
4024
|
blockers: [],
|
|
4322
4025
|
blocks: []
|
|
4323
4026
|
});
|
|
@@ -4338,7 +4041,7 @@ class AssetStageCompletionService extends BaseApiService {
|
|
|
4338
4041
|
const promise = this.enqueueRequest({
|
|
4339
4042
|
description: "Add asset stage completion",
|
|
4340
4043
|
method: HttpMethod.POST,
|
|
4341
|
-
url: "/
|
|
4044
|
+
url: "/assets/completions/",
|
|
4342
4045
|
payload: {
|
|
4343
4046
|
offline_id: offlineStageCompletion.offline_id,
|
|
4344
4047
|
submitted_at: submittedAt,
|
|
@@ -4365,7 +4068,7 @@ class AssetStageCompletionService extends BaseApiService {
|
|
|
4365
4068
|
const promise = this.enqueueRequest({
|
|
4366
4069
|
description: "Delete asset stage completion",
|
|
4367
4070
|
method: HttpMethod.DELETE,
|
|
4368
|
-
url: `/
|
|
4071
|
+
url: `/assets/completions/${id}/`,
|
|
4369
4072
|
blockers: [id],
|
|
4370
4073
|
blocks: []
|
|
4371
4074
|
});
|
|
@@ -4391,7 +4094,7 @@ class AssetStageCompletionService extends BaseApiService {
|
|
|
4391
4094
|
const promise = this.enqueueRequest({
|
|
4392
4095
|
description: "Bulk create asset stage completions",
|
|
4393
4096
|
method: HttpMethod.POST,
|
|
4394
|
-
url: "/
|
|
4097
|
+
url: "/assets/completions/bulk/",
|
|
4395
4098
|
payload: {
|
|
4396
4099
|
submitted_at: submittedAt,
|
|
4397
4100
|
completions: payload
|
|
@@ -4413,7 +4116,7 @@ class AssetStageCompletionService extends BaseApiService {
|
|
|
4413
4116
|
const promise = this.enqueueRequest({
|
|
4414
4117
|
description: "Deleting asset stage completions",
|
|
4415
4118
|
method: HttpMethod.DELETE,
|
|
4416
|
-
url: "/
|
|
4119
|
+
url: "/assets/completions/bulk/",
|
|
4417
4120
|
payload: {
|
|
4418
4121
|
completion_ids: ids
|
|
4419
4122
|
},
|
|
@@ -4429,10 +4132,7 @@ class AssetStageCompletionService extends BaseApiService {
|
|
|
4429
4132
|
const result = await this.enqueueRequest({
|
|
4430
4133
|
description: "Get asset stage completions",
|
|
4431
4134
|
method: HttpMethod.GET,
|
|
4432
|
-
url:
|
|
4433
|
-
queryParams: {
|
|
4434
|
-
project: projectId.toString()
|
|
4435
|
-
},
|
|
4135
|
+
url: `/projects/${projectId}/asset-stage-completions/`,
|
|
4436
4136
|
blockers: [],
|
|
4437
4137
|
blocks: []
|
|
4438
4138
|
});
|
|
@@ -4453,7 +4153,7 @@ class AssetStageService extends BaseApiService {
|
|
|
4453
4153
|
const promise = this.enqueueRequest({
|
|
4454
4154
|
description: "Add asset stages",
|
|
4455
4155
|
method: HttpMethod.POST,
|
|
4456
|
-
url: "/
|
|
4156
|
+
url: "/assets/stages/bulk/",
|
|
4457
4157
|
payload: {
|
|
4458
4158
|
submitted_at: submittedAt,
|
|
4459
4159
|
asset_type: assetTypeId,
|
|
@@ -4477,7 +4177,7 @@ class AssetStageService extends BaseApiService {
|
|
|
4477
4177
|
return this.enqueueRequest({
|
|
4478
4178
|
description: "Edit asset stages",
|
|
4479
4179
|
method: HttpMethod.PATCH,
|
|
4480
|
-
url: `/
|
|
4180
|
+
url: `/assets/types/${assetTypeId}/bulk-update-stages/`,
|
|
4481
4181
|
payload: {
|
|
4482
4182
|
stages: stagesToUpdate
|
|
4483
4183
|
},
|
|
@@ -4495,7 +4195,7 @@ class AssetStageService extends BaseApiService {
|
|
|
4495
4195
|
const promise = this.enqueueRequest({
|
|
4496
4196
|
description: "Delete asset stages",
|
|
4497
4197
|
method: HttpMethod.DELETE,
|
|
4498
|
-
url: "/
|
|
4198
|
+
url: "/assets/stages/bulk/",
|
|
4499
4199
|
payload: {
|
|
4500
4200
|
stage_ids: idsToDelete
|
|
4501
4201
|
},
|
|
@@ -4520,7 +4220,7 @@ class AssetStageService extends BaseApiService {
|
|
|
4520
4220
|
const promise = this.enqueueRequest({
|
|
4521
4221
|
description: "Update asset stage",
|
|
4522
4222
|
method: HttpMethod.PATCH,
|
|
4523
|
-
url: `/
|
|
4223
|
+
url: `/assets/stages/${assetStage.offline_id}/`,
|
|
4524
4224
|
payload: {
|
|
4525
4225
|
name: payload.name,
|
|
4526
4226
|
description: payload.description,
|
|
@@ -4548,7 +4248,7 @@ class AssetStageService extends BaseApiService {
|
|
|
4548
4248
|
await this.enqueueRequest({
|
|
4549
4249
|
description: "Link asset stage to form",
|
|
4550
4250
|
method: HttpMethod.POST,
|
|
4551
|
-
url: `/
|
|
4251
|
+
url: `/assets/stages/${stageId}/associate-with-form/`,
|
|
4552
4252
|
payload: { form: formId },
|
|
4553
4253
|
blockers: [stageId, formId],
|
|
4554
4254
|
blocks: [stageId]
|
|
@@ -4569,7 +4269,7 @@ class AssetStageService extends BaseApiService {
|
|
|
4569
4269
|
await this.enqueueRequest({
|
|
4570
4270
|
description: "Unlink asset stage from form",
|
|
4571
4271
|
method: HttpMethod.DELETE,
|
|
4572
|
-
url: `/
|
|
4272
|
+
url: `/assets/stages/${stageId}/associate-with-form/`,
|
|
4573
4273
|
blockers: [stageId, formId],
|
|
4574
4274
|
blocks: [stageId]
|
|
4575
4275
|
});
|
|
@@ -4582,10 +4282,7 @@ class AssetStageService extends BaseApiService {
|
|
|
4582
4282
|
const result = await this.enqueueRequest({
|
|
4583
4283
|
description: "Get asset stages",
|
|
4584
4284
|
method: HttpMethod.GET,
|
|
4585
|
-
url:
|
|
4586
|
-
queryParams: {
|
|
4587
|
-
project: projectId.toString()
|
|
4588
|
-
},
|
|
4285
|
+
url: `/projects/${projectId}/asset-stages/`,
|
|
4589
4286
|
blockers: [],
|
|
4590
4287
|
blocks: []
|
|
4591
4288
|
});
|
|
@@ -4602,12 +4299,7 @@ class BaseUploadService extends BaseApiService {
|
|
|
4602
4299
|
projectAttachmentReducer: projectAttachmentReducer2,
|
|
4603
4300
|
formRevisionAttachmentReducer: formRevisionAttachmentReducer2,
|
|
4604
4301
|
formSubmissionAttachmentReducer: formSubmissionAttachmentReducer2,
|
|
4605
|
-
geoImageReducer: geoImageReducer2
|
|
4606
|
-
// fields
|
|
4607
|
-
assetTypeFieldsAttachmentReducer: assetTypeFieldsAttachmentReducer2,
|
|
4608
|
-
assetTypeFieldValuesAttachmentReducer: assetTypeFieldValuesAttachmentReducer2,
|
|
4609
|
-
issueTypeFieldsAttachmentReducer: issueTypeFieldsAttachmentReducer2,
|
|
4610
|
-
issueTypeFieldValuesAttachmentReducer: issueTypeFieldValuesAttachmentReducer2
|
|
4302
|
+
geoImageReducer: geoImageReducer2
|
|
4611
4303
|
} = this.client.store.getState();
|
|
4612
4304
|
const objectsWithSha1 = [].concat(
|
|
4613
4305
|
Object.values(issueAttachmentReducer2.instances),
|
|
@@ -4617,11 +4309,7 @@ class BaseUploadService extends BaseApiService {
|
|
|
4617
4309
|
Object.values(projectAttachmentReducer2.instances),
|
|
4618
4310
|
Object.values(formRevisionAttachmentReducer2.instances),
|
|
4619
4311
|
Object.values(formSubmissionAttachmentReducer2.instances),
|
|
4620
|
-
Object.values(geoImageReducer2.instances)
|
|
4621
|
-
Object.values(assetTypeFieldsAttachmentReducer2.instances),
|
|
4622
|
-
Object.values(assetTypeFieldValuesAttachmentReducer2.instances),
|
|
4623
|
-
Object.values(issueTypeFieldsAttachmentReducer2.instances),
|
|
4624
|
-
Object.values(issueTypeFieldValuesAttachmentReducer2.instances)
|
|
4312
|
+
Object.values(geoImageReducer2.instances)
|
|
4625
4313
|
);
|
|
4626
4314
|
return objectsWithSha1.filter((object) => object.file_sha1 === sha1).length;
|
|
4627
4315
|
}
|
|
@@ -4643,20 +4331,41 @@ class BaseUploadService extends BaseApiService {
|
|
|
4643
4331
|
}
|
|
4644
4332
|
return promisesBySha1;
|
|
4645
4333
|
}
|
|
4646
|
-
async getFilePayload(file) {
|
|
4647
|
-
const sha1 = await hashFile(file);
|
|
4648
|
-
const filePayload = {
|
|
4649
|
-
sha1,
|
|
4650
|
-
file_type: file.type,
|
|
4651
|
-
extension: file.name.split(".").pop(),
|
|
4652
|
-
size: file.size
|
|
4653
|
-
};
|
|
4654
|
-
await this.client.files.addCache(file, sha1);
|
|
4655
|
-
return filePayload;
|
|
4656
|
-
}
|
|
4657
4334
|
}
|
|
4335
|
+
const AttachmentModelMeta = {
|
|
4336
|
+
[AttachmentModel.Issue]: {
|
|
4337
|
+
name: "issue",
|
|
4338
|
+
attachUrlPrefix: "/issues",
|
|
4339
|
+
deleteUrlPrefix: "/issues",
|
|
4340
|
+
fetchUrlPostfix: "/issue-attachments"
|
|
4341
|
+
},
|
|
4342
|
+
[AttachmentModel.Asset]: {
|
|
4343
|
+
name: "asset",
|
|
4344
|
+
attachUrlPrefix: "/assets",
|
|
4345
|
+
deleteUrlPrefix: "/assets",
|
|
4346
|
+
fetchUrlPostfix: "/asset-attachments"
|
|
4347
|
+
},
|
|
4348
|
+
[AttachmentModel.AssetType]: {
|
|
4349
|
+
name: "asset type",
|
|
4350
|
+
attachUrlPrefix: "/assets/types",
|
|
4351
|
+
deleteUrlPrefix: "/assets/types",
|
|
4352
|
+
fetchUrlPostfix: "/asset-type-attachments"
|
|
4353
|
+
},
|
|
4354
|
+
[AttachmentModel.Project]: {
|
|
4355
|
+
name: "project",
|
|
4356
|
+
attachUrlPrefix: "/projects",
|
|
4357
|
+
deleteUrlPrefix: "/projects",
|
|
4358
|
+
fetchUrlPostfix: "/attachments"
|
|
4359
|
+
},
|
|
4360
|
+
[AttachmentModel.Document]: {
|
|
4361
|
+
name: "document",
|
|
4362
|
+
attachUrlPrefix: "/documents",
|
|
4363
|
+
deleteUrlPrefix: "/documents",
|
|
4364
|
+
fetchUrlPostfix: "/document-attachments"
|
|
4365
|
+
}
|
|
4366
|
+
};
|
|
4658
4367
|
class BaseAttachmentService extends BaseUploadService {
|
|
4659
|
-
async
|
|
4368
|
+
async attachFiles(files, modelId, buildOfflineAttachment) {
|
|
4660
4369
|
var _a2;
|
|
4661
4370
|
const { store } = this.client;
|
|
4662
4371
|
const createdBy = (_a2 = store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
@@ -4664,36 +4373,39 @@ class BaseAttachmentService extends BaseUploadService {
|
|
|
4664
4373
|
const offlineAttachments = [];
|
|
4665
4374
|
const attachmentPayloads = [];
|
|
4666
4375
|
const filePayloads = {};
|
|
4667
|
-
for (const
|
|
4668
|
-
const
|
|
4669
|
-
|
|
4670
|
-
|
|
4671
|
-
|
|
4672
|
-
|
|
4376
|
+
for (const file of files) {
|
|
4377
|
+
const sha1 = await hashFile(file);
|
|
4378
|
+
if (!(sha1 in filePayloads)) {
|
|
4379
|
+
filePayloads[sha1] = {
|
|
4380
|
+
sha1,
|
|
4381
|
+
file_type: file.type,
|
|
4382
|
+
extension: file.name.split(".").pop(),
|
|
4383
|
+
size: file.size
|
|
4384
|
+
};
|
|
4385
|
+
await this.client.files.addCache(file, sha1);
|
|
4386
|
+
}
|
|
4387
|
+
const offlineAttachment = buildOfflineAttachment({
|
|
4673
4388
|
file,
|
|
4674
|
-
|
|
4675
|
-
|
|
4676
|
-
|
|
4389
|
+
sha1,
|
|
4390
|
+
submittedAt,
|
|
4391
|
+
createdBy,
|
|
4677
4392
|
description: "",
|
|
4678
4393
|
modelId
|
|
4679
4394
|
});
|
|
4680
4395
|
offlineAttachments.push(offlineAttachment);
|
|
4681
|
-
attachmentPayloads.push(
|
|
4682
|
-
|
|
4683
|
-
|
|
4684
|
-
|
|
4685
|
-
|
|
4686
|
-
|
|
4687
|
-
description: offlineAttachment.description,
|
|
4688
|
-
modelId
|
|
4689
|
-
})
|
|
4690
|
-
);
|
|
4396
|
+
attachmentPayloads.push({
|
|
4397
|
+
offline_id: offlineAttachment.offline_id,
|
|
4398
|
+
name: offlineAttachment.file_name,
|
|
4399
|
+
sha1: offlineAttachment.file_sha1,
|
|
4400
|
+
description: offlineAttachment.description
|
|
4401
|
+
});
|
|
4691
4402
|
}
|
|
4692
4403
|
this.dispatch(this.addAttachments(offlineAttachments));
|
|
4404
|
+
const meta = AttachmentModelMeta[this.attachmentModel];
|
|
4693
4405
|
const promise = this.enqueueRequest({
|
|
4694
|
-
description: `
|
|
4406
|
+
description: `Attach files to ${meta.name}`,
|
|
4695
4407
|
method: HttpMethod.POST,
|
|
4696
|
-
url: `${
|
|
4408
|
+
url: `${meta.attachUrlPrefix}/${modelId}/attach/`,
|
|
4697
4409
|
payload: {
|
|
4698
4410
|
submitted_at: submittedAt,
|
|
4699
4411
|
attachments: attachmentPayloads,
|
|
@@ -4710,7 +4422,7 @@ class BaseAttachmentService extends BaseUploadService {
|
|
|
4710
4422
|
});
|
|
4711
4423
|
return [offlineAttachments, promise.then(({ attachments }) => attachments)];
|
|
4712
4424
|
}
|
|
4713
|
-
async
|
|
4425
|
+
async deleteAttachment(attachmendId) {
|
|
4714
4426
|
const { store } = this.client;
|
|
4715
4427
|
const attachment = this.selectAttachment(attachmendId)(store.getState());
|
|
4716
4428
|
if (!attachment) {
|
|
@@ -4719,10 +4431,11 @@ class BaseAttachmentService extends BaseUploadService {
|
|
|
4719
4431
|
);
|
|
4720
4432
|
}
|
|
4721
4433
|
this.dispatch(this.removeAttachment(attachment.offline_id));
|
|
4434
|
+
const meta = AttachmentModelMeta[this.attachmentModel];
|
|
4722
4435
|
const promise = this.enqueueRequest({
|
|
4723
|
-
description:
|
|
4436
|
+
description: "Delete attachment",
|
|
4724
4437
|
method: HttpMethod.DELETE,
|
|
4725
|
-
url: `${
|
|
4438
|
+
url: `${meta.deleteUrlPrefix}/attachments/${attachmendId}/`,
|
|
4726
4439
|
blockers: [attachmendId],
|
|
4727
4440
|
blocks: []
|
|
4728
4441
|
});
|
|
@@ -4735,12 +4448,24 @@ class BaseAttachmentService extends BaseUploadService {
|
|
|
4735
4448
|
});
|
|
4736
4449
|
return promise;
|
|
4737
4450
|
}
|
|
4451
|
+
// Note that currently the fetching of attachments for all models dependds on the active projectId. This may change in the future. And
|
|
4452
|
+
// so for some attachment model services, this method will have to be overridden.
|
|
4453
|
+
async refreshStore(projectId, _organizationId) {
|
|
4454
|
+
const meta = AttachmentModelMeta[this.attachmentModel];
|
|
4455
|
+
const result = await this.enqueueRequest({
|
|
4456
|
+
description: `Get ${meta.name} attachments`,
|
|
4457
|
+
method: HttpMethod.GET,
|
|
4458
|
+
url: `/projects/${projectId}${meta.fetchUrlPostfix}/`,
|
|
4459
|
+
blocks: [],
|
|
4460
|
+
blockers: []
|
|
4461
|
+
});
|
|
4462
|
+
this.dispatch(this.initializeAttachments(result));
|
|
4463
|
+
}
|
|
4738
4464
|
}
|
|
4739
4465
|
class AssetAttachmentService extends BaseAttachmentService {
|
|
4740
4466
|
constructor() {
|
|
4741
4467
|
super(...arguments);
|
|
4742
|
-
__publicField(this, "
|
|
4743
|
-
__publicField(this, "url", "/asset-attachments");
|
|
4468
|
+
__publicField(this, "attachmentModel", AttachmentModel.Asset);
|
|
4744
4469
|
__publicField(this, "initializeAttachments", initializeAssetAttachments);
|
|
4745
4470
|
__publicField(this, "addAttachments", addAssetAttachments);
|
|
4746
4471
|
__publicField(this, "updateAttachments", updateAssetAttachments);
|
|
@@ -4752,39 +4477,20 @@ class AssetAttachmentService extends BaseAttachmentService {
|
|
|
4752
4477
|
buildOfflineAttachment(data) {
|
|
4753
4478
|
return offline({
|
|
4754
4479
|
file: URL.createObjectURL(data.file),
|
|
4755
|
-
file_sha1: data.
|
|
4756
|
-
created_by: data.
|
|
4480
|
+
file_sha1: data.sha1,
|
|
4481
|
+
created_by: data.createdBy,
|
|
4757
4482
|
file_name: data.file.name,
|
|
4758
4483
|
file_type: data.file.type,
|
|
4759
|
-
submitted_at: data.
|
|
4484
|
+
submitted_at: data.submittedAt,
|
|
4760
4485
|
description: data.description,
|
|
4761
4486
|
asset: data.modelId
|
|
4762
4487
|
});
|
|
4763
4488
|
}
|
|
4764
|
-
|
|
4765
|
-
return
|
|
4766
|
-
...data,
|
|
4767
|
-
asset: data.modelId
|
|
4768
|
-
};
|
|
4769
|
-
}
|
|
4770
|
-
async bulkAdd(payloads) {
|
|
4771
|
-
return this._bulkAdd(payloads.map((p) => ({ modelId: p.assetId, file: p.file })));
|
|
4772
|
-
}
|
|
4773
|
-
async delete(id) {
|
|
4774
|
-
return this._delete(id);
|
|
4489
|
+
async attachFilesToAsset(files, assetId) {
|
|
4490
|
+
return this.attachFiles(files, assetId, this.buildOfflineAttachment.bind(this));
|
|
4775
4491
|
}
|
|
4776
|
-
async
|
|
4777
|
-
|
|
4778
|
-
description: "Get asset attachments",
|
|
4779
|
-
method: HttpMethod.GET,
|
|
4780
|
-
url: `${this.url}/`,
|
|
4781
|
-
queryParams: {
|
|
4782
|
-
project: projectId.toString()
|
|
4783
|
-
},
|
|
4784
|
-
blocks: [],
|
|
4785
|
-
blockers: []
|
|
4786
|
-
});
|
|
4787
|
-
this.dispatch(initializeAssetAttachments(result));
|
|
4492
|
+
async deleteAssetAttachment(attachmentId) {
|
|
4493
|
+
return this.deleteAttachment(attachmentId);
|
|
4788
4494
|
}
|
|
4789
4495
|
}
|
|
4790
4496
|
class AssetTypeService extends BaseApiService {
|
|
@@ -4801,7 +4507,7 @@ class AssetTypeService extends BaseApiService {
|
|
|
4801
4507
|
const promise = this.enqueueRequest({
|
|
4802
4508
|
description: "Create asset type",
|
|
4803
4509
|
method: HttpMethod.POST,
|
|
4804
|
-
url:
|
|
4510
|
+
url: `/projects/${payload.project}/asset-types/`,
|
|
4805
4511
|
payload: { ...offlineAssetType },
|
|
4806
4512
|
blockers: [],
|
|
4807
4513
|
blocks: [offlineAssetType.offline_id]
|
|
@@ -4827,7 +4533,7 @@ class AssetTypeService extends BaseApiService {
|
|
|
4827
4533
|
const promise = this.enqueueRequest({
|
|
4828
4534
|
description: "Update asset type",
|
|
4829
4535
|
method: HttpMethod.PATCH,
|
|
4830
|
-
url: `/
|
|
4536
|
+
url: `/assets/types/${payload.offline_id}/`,
|
|
4831
4537
|
payload: {
|
|
4832
4538
|
icon: payload.icon,
|
|
4833
4539
|
color: payload.color,
|
|
@@ -4861,7 +4567,7 @@ class AssetTypeService extends BaseApiService {
|
|
|
4861
4567
|
return this.enqueueRequest({
|
|
4862
4568
|
description: "Delete asset type",
|
|
4863
4569
|
method: HttpMethod.DELETE,
|
|
4864
|
-
url: `/
|
|
4570
|
+
url: `/assets/types/${assetTypeId}/`,
|
|
4865
4571
|
blockers: [assetTypeId],
|
|
4866
4572
|
blocks: []
|
|
4867
4573
|
}).catch((e) => {
|
|
@@ -4876,10 +4582,7 @@ class AssetTypeService extends BaseApiService {
|
|
|
4876
4582
|
const result = await this.enqueueRequest({
|
|
4877
4583
|
description: "Get asset types",
|
|
4878
4584
|
method: HttpMethod.GET,
|
|
4879
|
-
url:
|
|
4880
|
-
queryParams: {
|
|
4881
|
-
project: projectId.toString()
|
|
4882
|
-
},
|
|
4585
|
+
url: `/projects/${projectId}/asset-types/`,
|
|
4883
4586
|
blockers: [],
|
|
4884
4587
|
blocks: []
|
|
4885
4588
|
});
|
|
@@ -4889,8 +4592,8 @@ class AssetTypeService extends BaseApiService {
|
|
|
4889
4592
|
class AssetTypeAttachmentService extends BaseAttachmentService {
|
|
4890
4593
|
constructor() {
|
|
4891
4594
|
super(...arguments);
|
|
4892
|
-
__publicField(this, "
|
|
4893
|
-
__publicField(this, "
|
|
4595
|
+
__publicField(this, "attachmentModel", AttachmentModel.AssetType);
|
|
4596
|
+
__publicField(this, "initializeAttachments", initializeAssetTypeAttachments);
|
|
4894
4597
|
__publicField(this, "addAttachments", addAssetTypeAttachments);
|
|
4895
4598
|
__publicField(this, "updateAttachments", updateAssetTypeAttachments);
|
|
4896
4599
|
__publicField(this, "removeAttachments", deleteAssetTypeAttachments);
|
|
@@ -4901,39 +4604,20 @@ class AssetTypeAttachmentService extends BaseAttachmentService {
|
|
|
4901
4604
|
buildOfflineAttachment(data) {
|
|
4902
4605
|
return offline({
|
|
4903
4606
|
file: URL.createObjectURL(data.file),
|
|
4904
|
-
file_sha1: data.
|
|
4905
|
-
created_by: data.
|
|
4607
|
+
file_sha1: data.sha1,
|
|
4608
|
+
created_by: data.createdBy,
|
|
4906
4609
|
file_name: data.file.name,
|
|
4907
4610
|
file_type: data.file.type,
|
|
4908
|
-
submitted_at: data.
|
|
4611
|
+
submitted_at: data.submittedAt,
|
|
4909
4612
|
description: data.description,
|
|
4910
4613
|
asset_type: data.modelId
|
|
4911
4614
|
});
|
|
4912
4615
|
}
|
|
4913
|
-
|
|
4914
|
-
return
|
|
4915
|
-
...data,
|
|
4916
|
-
asset_type: data.modelId
|
|
4917
|
-
};
|
|
4918
|
-
}
|
|
4919
|
-
async bulkAdd(payloads) {
|
|
4920
|
-
return this._bulkAdd(payloads.map((p) => ({ modelId: p.assetTypeId, file: p.file })));
|
|
4921
|
-
}
|
|
4922
|
-
async delete(attachmentId) {
|
|
4923
|
-
return this._delete(attachmentId);
|
|
4616
|
+
async attachFilesToAssetType(files, assetTypeId) {
|
|
4617
|
+
return this.attachFiles(files, assetTypeId, this.buildOfflineAttachment.bind(this));
|
|
4924
4618
|
}
|
|
4925
|
-
async
|
|
4926
|
-
|
|
4927
|
-
description: "Get asset type attachments",
|
|
4928
|
-
method: HttpMethod.GET,
|
|
4929
|
-
url: `${this.url}/`,
|
|
4930
|
-
queryParams: {
|
|
4931
|
-
project: projectId.toString()
|
|
4932
|
-
},
|
|
4933
|
-
blocks: [],
|
|
4934
|
-
blockers: []
|
|
4935
|
-
});
|
|
4936
|
-
this.dispatch(initializeAssetTypeAttachments(result));
|
|
4619
|
+
async deleteAssetTypeAttachment(attachmentId) {
|
|
4620
|
+
return this.deleteAttachment(attachmentId);
|
|
4937
4621
|
}
|
|
4938
4622
|
}
|
|
4939
4623
|
class IssueCommentService extends BaseApiService {
|
|
@@ -4949,7 +4633,7 @@ class IssueCommentService extends BaseApiService {
|
|
|
4949
4633
|
const promise = this.enqueueRequest({
|
|
4950
4634
|
description: "Add issue comment",
|
|
4951
4635
|
method: HttpMethod.POST,
|
|
4952
|
-
url:
|
|
4636
|
+
url: `/issues/${payload.issue}/comment/`,
|
|
4953
4637
|
payload: offlineComment,
|
|
4954
4638
|
blockers: [payload.issue],
|
|
4955
4639
|
blocks: [offlineComment.offline_id]
|
|
@@ -4973,7 +4657,7 @@ class IssueCommentService extends BaseApiService {
|
|
|
4973
4657
|
const promise = this.enqueueRequest({
|
|
4974
4658
|
description: "Edit issue comment",
|
|
4975
4659
|
method: HttpMethod.PATCH,
|
|
4976
|
-
url: `/
|
|
4660
|
+
url: `/issues/comments/${payload.offline_id}/`,
|
|
4977
4661
|
payload,
|
|
4978
4662
|
blockers: [payload.offline_id],
|
|
4979
4663
|
blocks: [payload.offline_id]
|
|
@@ -4992,7 +4676,7 @@ class IssueCommentService extends BaseApiService {
|
|
|
4992
4676
|
const promise = this.enqueueRequest({
|
|
4993
4677
|
description: "Delete comment",
|
|
4994
4678
|
method: HttpMethod.DELETE,
|
|
4995
|
-
url: `/
|
|
4679
|
+
url: `/issues/comments/${id}/`,
|
|
4996
4680
|
blockers: [id],
|
|
4997
4681
|
blocks: []
|
|
4998
4682
|
});
|
|
@@ -5005,10 +4689,7 @@ class IssueCommentService extends BaseApiService {
|
|
|
5005
4689
|
const result = await this.enqueueRequest({
|
|
5006
4690
|
description: "Get comments",
|
|
5007
4691
|
method: HttpMethod.GET,
|
|
5008
|
-
url:
|
|
5009
|
-
queryParams: {
|
|
5010
|
-
project: projectId.toString()
|
|
5011
|
-
},
|
|
4692
|
+
url: `/projects/${projectId}/comments/`,
|
|
5012
4693
|
blockers: [],
|
|
5013
4694
|
blocks: []
|
|
5014
4695
|
});
|
|
@@ -5020,21 +4701,27 @@ class IssueUpdateService extends BaseApiService {
|
|
|
5020
4701
|
const result = await this.enqueueRequest({
|
|
5021
4702
|
description: "Get issue updates",
|
|
5022
4703
|
method: HttpMethod.GET,
|
|
5023
|
-
url:
|
|
5024
|
-
queryParams: {
|
|
5025
|
-
project: projectId.toString()
|
|
5026
|
-
},
|
|
4704
|
+
url: `/projects/${projectId}/issues/updates/`,
|
|
5027
4705
|
blockers: [],
|
|
5028
4706
|
blocks: []
|
|
5029
4707
|
});
|
|
5030
|
-
|
|
4708
|
+
let filteredResult = result.filter(onlyUniqueOfflineIds);
|
|
4709
|
+
filteredResult = filteredResult.map((comment) => {
|
|
4710
|
+
return { ...comment };
|
|
4711
|
+
});
|
|
4712
|
+
if (result.length !== filteredResult.length) {
|
|
4713
|
+
console.error(
|
|
4714
|
+
`Received duplicate comments from the API (new length ${filteredResult.length}); filtered in browser.`
|
|
4715
|
+
);
|
|
4716
|
+
}
|
|
4717
|
+
this.dispatch(initializeIssueUpdates(filteredResult));
|
|
5031
4718
|
}
|
|
5032
4719
|
}
|
|
5033
4720
|
class IssueAttachmentService extends BaseAttachmentService {
|
|
5034
4721
|
constructor() {
|
|
5035
4722
|
super(...arguments);
|
|
5036
|
-
__publicField(this, "
|
|
5037
|
-
__publicField(this, "
|
|
4723
|
+
__publicField(this, "attachmentModel", AttachmentModel.Issue);
|
|
4724
|
+
__publicField(this, "initializeAttachments", initializeIssueAttachments);
|
|
5038
4725
|
__publicField(this, "addAttachments", addIssueAttachments);
|
|
5039
4726
|
__publicField(this, "updateAttachments", updateIssueAttachments);
|
|
5040
4727
|
__publicField(this, "removeAttachments", deleteIssueAttachments);
|
|
@@ -5045,42 +4732,24 @@ class IssueAttachmentService extends BaseAttachmentService {
|
|
|
5045
4732
|
buildOfflineAttachment(data) {
|
|
5046
4733
|
return offline({
|
|
5047
4734
|
file: URL.createObjectURL(data.file),
|
|
5048
|
-
file_sha1: data.
|
|
5049
|
-
created_by: data.
|
|
4735
|
+
file_sha1: data.sha1,
|
|
4736
|
+
created_by: data.createdBy,
|
|
5050
4737
|
file_name: data.file.name,
|
|
5051
4738
|
file_type: data.file.type,
|
|
5052
|
-
submitted_at: data.
|
|
4739
|
+
submitted_at: data.submittedAt,
|
|
5053
4740
|
description: data.description,
|
|
5054
4741
|
issue: data.modelId
|
|
5055
4742
|
});
|
|
5056
4743
|
}
|
|
5057
|
-
|
|
5058
|
-
return
|
|
5059
|
-
...data,
|
|
5060
|
-
issue: data.modelId
|
|
5061
|
-
};
|
|
5062
|
-
}
|
|
5063
|
-
async bulkAdd(payloads) {
|
|
5064
|
-
return this._bulkAdd(payloads.map((p) => ({ modelId: p.issueId, file: p.file })));
|
|
5065
|
-
}
|
|
5066
|
-
async delete(id) {
|
|
5067
|
-
return this._delete(id);
|
|
4744
|
+
async attachFilesToIssue(files, issueId) {
|
|
4745
|
+
return this.attachFiles(files, issueId, this.buildOfflineAttachment.bind(this));
|
|
5068
4746
|
}
|
|
5069
|
-
async
|
|
5070
|
-
|
|
5071
|
-
description: "Get issue attachments",
|
|
5072
|
-
method: HttpMethod.GET,
|
|
5073
|
-
url: `${this.url}/`,
|
|
5074
|
-
queryParams: {
|
|
5075
|
-
project: projectId.toString()
|
|
5076
|
-
},
|
|
5077
|
-
blocks: [],
|
|
5078
|
-
blockers: []
|
|
5079
|
-
});
|
|
5080
|
-
this.dispatch(initializeIssueAttachments(result));
|
|
4747
|
+
async deleteIssueAttachment(attachmentId) {
|
|
4748
|
+
return this.deleteAttachment(attachmentId);
|
|
5081
4749
|
}
|
|
5082
4750
|
}
|
|
5083
4751
|
class IssueService extends BaseApiService {
|
|
4752
|
+
// Basic CRUD functions
|
|
5084
4753
|
add(payload) {
|
|
5085
4754
|
var _a2;
|
|
5086
4755
|
const { store } = this.client;
|
|
@@ -5098,6 +4767,10 @@ class IssueService extends BaseApiService {
|
|
|
5098
4767
|
description: "Create issue",
|
|
5099
4768
|
method: HttpMethod.POST,
|
|
5100
4769
|
url: "/issues/",
|
|
4770
|
+
queryParams: {
|
|
4771
|
+
workspace_id: payload.index_workspace,
|
|
4772
|
+
...payload.issue_type ? { issue_type: payload.issue_type } : {}
|
|
4773
|
+
},
|
|
5101
4774
|
payload: offlineIssue,
|
|
5102
4775
|
blockers: ["add-issue", ...offlineIssue.index_workspace ? [offlineIssue.index_workspace] : []],
|
|
5103
4776
|
blocks: [offlineIssue.offline_id]
|
|
@@ -5253,10 +4926,7 @@ class IssueService extends BaseApiService {
|
|
|
5253
4926
|
const result = await this.enqueueRequest({
|
|
5254
4927
|
description: "Get issues",
|
|
5255
4928
|
method: HttpMethod.GET,
|
|
5256
|
-
url:
|
|
5257
|
-
queryParams: {
|
|
5258
|
-
project: projectId.toString()
|
|
5259
|
-
},
|
|
4929
|
+
url: `/projects/${projectId}/issues/`,
|
|
5260
4930
|
blockers: [],
|
|
5261
4931
|
blocks: []
|
|
5262
4932
|
});
|
|
@@ -5276,7 +4946,7 @@ class IssueTypeService extends BaseApiService {
|
|
|
5276
4946
|
this.dispatch(addIssueType(offlineIssueType));
|
|
5277
4947
|
const promise = this.enqueueRequest({
|
|
5278
4948
|
method: HttpMethod.POST,
|
|
5279
|
-
url:
|
|
4949
|
+
url: `/organizations/${payload.organization}/issue-types/`,
|
|
5280
4950
|
// Sending only whats needed here
|
|
5281
4951
|
payload: {
|
|
5282
4952
|
offline_id: offlineIssueType.offline_id,
|
|
@@ -5310,7 +4980,7 @@ class IssueTypeService extends BaseApiService {
|
|
|
5310
4980
|
this.dispatch(updateIssueType(offlineUpdatedIssueType));
|
|
5311
4981
|
const promise = this.enqueueRequest({
|
|
5312
4982
|
method: HttpMethod.PATCH,
|
|
5313
|
-
url: `/
|
|
4983
|
+
url: `/issues/types/${payload.offline_id}/`,
|
|
5314
4984
|
payload,
|
|
5315
4985
|
blockers: [payload.offline_id],
|
|
5316
4986
|
blocks: [payload.offline_id]
|
|
@@ -5334,7 +5004,7 @@ class IssueTypeService extends BaseApiService {
|
|
|
5334
5004
|
this.dispatch(deleteIssues(issuesOfIssueType.map((issue) => issue.offline_id)));
|
|
5335
5005
|
const promise = this.enqueueRequest({
|
|
5336
5006
|
method: HttpMethod.DELETE,
|
|
5337
|
-
url: `/
|
|
5007
|
+
url: `/issues/types/${id}/`,
|
|
5338
5008
|
blockers: [id],
|
|
5339
5009
|
blocks: []
|
|
5340
5010
|
});
|
|
@@ -5347,10 +5017,7 @@ class IssueTypeService extends BaseApiService {
|
|
|
5347
5017
|
async refreshStore(organizationId) {
|
|
5348
5018
|
const result = await this.enqueueRequest({
|
|
5349
5019
|
method: HttpMethod.GET,
|
|
5350
|
-
url:
|
|
5351
|
-
queryParams: {
|
|
5352
|
-
organization: organizationId.toString()
|
|
5353
|
-
},
|
|
5020
|
+
url: `/organizations/${organizationId}/issue-types/`,
|
|
5354
5021
|
blockers: [],
|
|
5355
5022
|
blocks: []
|
|
5356
5023
|
});
|
|
@@ -5494,8 +5161,8 @@ class ProjectFileService extends BaseApiService {
|
|
|
5494
5161
|
class ProjectAttachmentService extends BaseAttachmentService {
|
|
5495
5162
|
constructor() {
|
|
5496
5163
|
super(...arguments);
|
|
5497
|
-
__publicField(this, "
|
|
5498
|
-
__publicField(this, "
|
|
5164
|
+
__publicField(this, "attachmentModel", AttachmentModel.Project);
|
|
5165
|
+
__publicField(this, "initializeAttachments", initializeProjectAttachments);
|
|
5499
5166
|
__publicField(this, "addAttachments", addProjectAttachments);
|
|
5500
5167
|
__publicField(this, "updateAttachments", updateProjectAttachments);
|
|
5501
5168
|
__publicField(this, "removeAttachments", deleteProjectAttachments);
|
|
@@ -5506,39 +5173,20 @@ class ProjectAttachmentService extends BaseAttachmentService {
|
|
|
5506
5173
|
buildOfflineAttachment(data) {
|
|
5507
5174
|
return offline({
|
|
5508
5175
|
file: URL.createObjectURL(data.file),
|
|
5509
|
-
file_sha1: data.
|
|
5510
|
-
created_by: data.
|
|
5176
|
+
file_sha1: data.sha1,
|
|
5177
|
+
created_by: data.createdBy,
|
|
5511
5178
|
file_name: data.file.name,
|
|
5512
5179
|
file_type: data.file.type,
|
|
5513
|
-
submitted_at: data.
|
|
5180
|
+
submitted_at: data.submittedAt,
|
|
5514
5181
|
description: data.description,
|
|
5515
5182
|
project: data.modelId
|
|
5516
5183
|
});
|
|
5517
5184
|
}
|
|
5518
|
-
|
|
5519
|
-
return
|
|
5520
|
-
...data,
|
|
5521
|
-
project: data.modelId
|
|
5522
|
-
};
|
|
5523
|
-
}
|
|
5524
|
-
async bulkAdd(payloads) {
|
|
5525
|
-
return this._bulkAdd(payloads.map((p) => ({ modelId: p.projectId, file: p.file })));
|
|
5526
|
-
}
|
|
5527
|
-
async delete(attachmentId) {
|
|
5528
|
-
return this._delete(attachmentId);
|
|
5185
|
+
async attachFilesToProject(files, projectId) {
|
|
5186
|
+
return this.attachFiles(files, projectId, this.buildOfflineAttachment.bind(this));
|
|
5529
5187
|
}
|
|
5530
|
-
async
|
|
5531
|
-
|
|
5532
|
-
description: "Get project attachments",
|
|
5533
|
-
method: HttpMethod.GET,
|
|
5534
|
-
url: `${this.url}/`,
|
|
5535
|
-
queryParams: {
|
|
5536
|
-
project: projectId.toString()
|
|
5537
|
-
},
|
|
5538
|
-
blockers: [],
|
|
5539
|
-
blocks: []
|
|
5540
|
-
});
|
|
5541
|
-
this.dispatch(initializeProjectAttachments(result));
|
|
5188
|
+
async deleteProjectAttachment(attachmentId) {
|
|
5189
|
+
return this.deleteAttachment(attachmentId);
|
|
5542
5190
|
}
|
|
5543
5191
|
}
|
|
5544
5192
|
class ProjectService extends BaseApiService {
|
|
@@ -5681,55 +5329,203 @@ const separateImageFromFields = async (fields) => {
|
|
|
5681
5329
|
return { fields: newFields, images };
|
|
5682
5330
|
};
|
|
5683
5331
|
class FormService extends BaseUploadService {
|
|
5684
|
-
|
|
5332
|
+
async bulkAddRevisionAttachments(revisionId, files) {
|
|
5685
5333
|
var _a2;
|
|
5686
|
-
const { store } = this.client;
|
|
5687
5334
|
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
5688
|
-
const createdBy = (_a2 = store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
5689
|
-
const
|
|
5690
|
-
|
|
5691
|
-
|
|
5692
|
-
|
|
5693
|
-
|
|
5694
|
-
|
|
5695
|
-
|
|
5696
|
-
|
|
5697
|
-
|
|
5698
|
-
|
|
5699
|
-
|
|
5700
|
-
|
|
5701
|
-
|
|
5702
|
-
|
|
5703
|
-
|
|
5704
|
-
|
|
5705
|
-
|
|
5706
|
-
|
|
5707
|
-
|
|
5708
|
-
|
|
5709
|
-
|
|
5710
|
-
submitted_at:
|
|
5711
|
-
|
|
5712
|
-
|
|
5713
|
-
|
|
5714
|
-
|
|
5715
|
-
|
|
5716
|
-
|
|
5717
|
-
|
|
5718
|
-
|
|
5719
|
-
|
|
5720
|
-
|
|
5721
|
-
|
|
5722
|
-
|
|
5723
|
-
|
|
5724
|
-
|
|
5725
|
-
|
|
5726
|
-
|
|
5727
|
-
|
|
5728
|
-
|
|
5729
|
-
|
|
5730
|
-
|
|
5731
|
-
|
|
5732
|
-
|
|
5335
|
+
const createdBy = (_a2 = this.client.store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
5336
|
+
const filePayloads = {};
|
|
5337
|
+
const offlineFormRevisionAttachments = [];
|
|
5338
|
+
const attachmentPayloads = [];
|
|
5339
|
+
for (const [fieldIdentifier, file] of Object.entries(files)) {
|
|
5340
|
+
const sha1 = await hashFile(file);
|
|
5341
|
+
if (!(sha1 in filePayloads)) {
|
|
5342
|
+
filePayloads[sha1] = {
|
|
5343
|
+
sha1,
|
|
5344
|
+
file_type: file.type,
|
|
5345
|
+
extension: file.name.split(".").pop(),
|
|
5346
|
+
size: file.size
|
|
5347
|
+
};
|
|
5348
|
+
await this.client.files.addCache(file, sha1);
|
|
5349
|
+
}
|
|
5350
|
+
const offlineFormRevisionAttachment = offline({
|
|
5351
|
+
file: URL.createObjectURL(file),
|
|
5352
|
+
file_type: file.type,
|
|
5353
|
+
file_name: file.name,
|
|
5354
|
+
file_sha1: sha1,
|
|
5355
|
+
created_by: createdBy,
|
|
5356
|
+
revision: revisionId,
|
|
5357
|
+
submitted_at: submittedAt,
|
|
5358
|
+
field_identifier: fieldIdentifier
|
|
5359
|
+
});
|
|
5360
|
+
offlineFormRevisionAttachments.push(offlineFormRevisionAttachment);
|
|
5361
|
+
const attachmentPayload = {
|
|
5362
|
+
offline_id: offlineFormRevisionAttachment.offline_id,
|
|
5363
|
+
name: file.name,
|
|
5364
|
+
field_identifier: fieldIdentifier,
|
|
5365
|
+
sha1
|
|
5366
|
+
};
|
|
5367
|
+
attachmentPayloads.push(attachmentPayload);
|
|
5368
|
+
}
|
|
5369
|
+
this.dispatch(addFormRevisionAttachments(offlineFormRevisionAttachments));
|
|
5370
|
+
const promise = this.enqueueRequest({
|
|
5371
|
+
description: "Attach files to form revision",
|
|
5372
|
+
method: HttpMethod.POST,
|
|
5373
|
+
url: `/forms/revisions/${revisionId}/attachments/bulk/`,
|
|
5374
|
+
payload: {
|
|
5375
|
+
submitted_at: submittedAt,
|
|
5376
|
+
attachments: attachmentPayloads,
|
|
5377
|
+
files: Object.values(filePayloads)
|
|
5378
|
+
},
|
|
5379
|
+
blockers: [revisionId],
|
|
5380
|
+
blocks: offlineFormRevisionAttachments.map((attachment) => attachment.offline_id)
|
|
5381
|
+
});
|
|
5382
|
+
promise.then((result) => {
|
|
5383
|
+
this.processPresignedUrls(result.presigned_urls);
|
|
5384
|
+
this.dispatch(updateFormRevisionAttachments(result.attachments));
|
|
5385
|
+
}).catch(() => {
|
|
5386
|
+
this.dispatch(
|
|
5387
|
+
deleteFormRevisionAttachments(
|
|
5388
|
+
offlineFormRevisionAttachments.map((attachment) => attachment.offline_id)
|
|
5389
|
+
)
|
|
5390
|
+
);
|
|
5391
|
+
});
|
|
5392
|
+
return [offlineFormRevisionAttachments, promise.then(({ attachments }) => attachments)];
|
|
5393
|
+
}
|
|
5394
|
+
async add(ownerId, form, initialRevision, urlPrefix) {
|
|
5395
|
+
const { fields, images } = await separateImageFromFields(initialRevision.fields);
|
|
5396
|
+
const offlineFormRevision = offline({
|
|
5397
|
+
...initialRevision,
|
|
5398
|
+
fields,
|
|
5399
|
+
created_by: form.created_by,
|
|
5400
|
+
form: form.offline_id,
|
|
5401
|
+
submitted_at: form.submitted_at,
|
|
5402
|
+
revision: "Pending"
|
|
5403
|
+
});
|
|
5404
|
+
this.dispatch(addForm(form));
|
|
5405
|
+
this.dispatch(addFormRevision(offlineFormRevision));
|
|
5406
|
+
const formPromise = this.enqueueRequest({
|
|
5407
|
+
description: "Create form",
|
|
5408
|
+
method: HttpMethod.POST,
|
|
5409
|
+
url: urlPrefix,
|
|
5410
|
+
payload: {
|
|
5411
|
+
// Sending exactly what is currently needed for the endpoint
|
|
5412
|
+
offline_id: form.offline_id,
|
|
5413
|
+
submitted_at: form.submitted_at,
|
|
5414
|
+
initial_revision: {
|
|
5415
|
+
offline_id: offlineFormRevision.offline_id,
|
|
5416
|
+
submitted_at: offlineFormRevision.submitted_at,
|
|
5417
|
+
title: offlineFormRevision.title,
|
|
5418
|
+
description: offlineFormRevision.description,
|
|
5419
|
+
fields: offlineFormRevision.fields
|
|
5420
|
+
}
|
|
5421
|
+
},
|
|
5422
|
+
blockers: [ownerId],
|
|
5423
|
+
blocks: [form.offline_id, offlineFormRevision.offline_id]
|
|
5424
|
+
});
|
|
5425
|
+
const [offlineFormRevisionAttachments, attachmentsPromise] = await this.bulkAddRevisionAttachments(
|
|
5426
|
+
offlineFormRevision.offline_id,
|
|
5427
|
+
images
|
|
5428
|
+
);
|
|
5429
|
+
void formPromise.catch((e) => {
|
|
5430
|
+
this.dispatch(deleteForm(form.offline_id));
|
|
5431
|
+
this.dispatch(deleteFormRevision(offlineFormRevision.offline_id));
|
|
5432
|
+
throw e;
|
|
5433
|
+
});
|
|
5434
|
+
return [form, offlineFormRevision, offlineFormRevisionAttachments, formPromise, attachmentsPromise];
|
|
5435
|
+
}
|
|
5436
|
+
addForOrganization(organizationId, initialRevision) {
|
|
5437
|
+
var _a2;
|
|
5438
|
+
const state = this.client.store.getState();
|
|
5439
|
+
const offlineForm = offline({
|
|
5440
|
+
favorite: false,
|
|
5441
|
+
created_by: (_a2 = state.userReducer.currentUser) == null ? void 0 : _a2.id,
|
|
5442
|
+
submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
5443
|
+
organization: organizationId
|
|
5444
|
+
});
|
|
5445
|
+
return this.add(
|
|
5446
|
+
organizationId.toString(),
|
|
5447
|
+
offlineForm,
|
|
5448
|
+
initialRevision,
|
|
5449
|
+
`/organizations/${organizationId}/create-form/`
|
|
5450
|
+
);
|
|
5451
|
+
}
|
|
5452
|
+
addForProject(projectId, initialRevision) {
|
|
5453
|
+
var _a2;
|
|
5454
|
+
const state = this.client.store.getState();
|
|
5455
|
+
const offlineForm = offline({
|
|
5456
|
+
favorite: false,
|
|
5457
|
+
created_by: (_a2 = state.userReducer.currentUser) == null ? void 0 : _a2.id,
|
|
5458
|
+
submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
5459
|
+
project: projectId
|
|
5460
|
+
});
|
|
5461
|
+
return this.add(projectId.toString(), offlineForm, initialRevision, `/projects/${projectId}/create-form/`);
|
|
5462
|
+
}
|
|
5463
|
+
addForIssueType(issueTypeId, initialRevision) {
|
|
5464
|
+
var _a2;
|
|
5465
|
+
const state = this.client.store.getState();
|
|
5466
|
+
const offlineForm = offline({
|
|
5467
|
+
favorite: false,
|
|
5468
|
+
created_by: (_a2 = state.userReducer.currentUser) == null ? void 0 : _a2.id,
|
|
5469
|
+
submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
5470
|
+
issue_type: issueTypeId
|
|
5471
|
+
});
|
|
5472
|
+
return this.add(issueTypeId, offlineForm, initialRevision, `/issues/types/${issueTypeId}/create-form/`);
|
|
5473
|
+
}
|
|
5474
|
+
addForAssetType(assetTypeId, initialRevision) {
|
|
5475
|
+
var _a2;
|
|
5476
|
+
const state = this.client.store.getState();
|
|
5477
|
+
const offlineForm = offline({
|
|
5478
|
+
favorite: false,
|
|
5479
|
+
created_by: (_a2 = state.userReducer.currentUser) == null ? void 0 : _a2.id,
|
|
5480
|
+
submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
5481
|
+
asset_type: assetTypeId
|
|
5482
|
+
});
|
|
5483
|
+
return this.add(assetTypeId, offlineForm, initialRevision, `/assets/types/${assetTypeId}/create-form/`);
|
|
5484
|
+
}
|
|
5485
|
+
async createRevision(formId, revision) {
|
|
5486
|
+
var _a2;
|
|
5487
|
+
const offlineRevision = offline(revision);
|
|
5488
|
+
const { store } = this.client;
|
|
5489
|
+
const state = store.getState();
|
|
5490
|
+
const createdBy = (_a2 = state.userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
5491
|
+
const { fields, images } = await separateImageFromFields(offlineRevision.fields);
|
|
5492
|
+
const fullRevision = {
|
|
5493
|
+
...offlineRevision,
|
|
5494
|
+
fields,
|
|
5495
|
+
created_by: createdBy,
|
|
5496
|
+
revision: "Pending",
|
|
5497
|
+
form: formId,
|
|
5498
|
+
submitted_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
5499
|
+
};
|
|
5500
|
+
this.dispatch(addFormRevision(fullRevision));
|
|
5501
|
+
const promise = this.enqueueRequest({
|
|
5502
|
+
description: "Create form revision",
|
|
5503
|
+
method: HttpMethod.PATCH,
|
|
5504
|
+
url: `/forms/${formId}/`,
|
|
5505
|
+
payload: {
|
|
5506
|
+
initial_revision: {
|
|
5507
|
+
offline_id: fullRevision.offline_id,
|
|
5508
|
+
submitted_at: fullRevision.submitted_at,
|
|
5509
|
+
title: fullRevision.title,
|
|
5510
|
+
description: fullRevision.description,
|
|
5511
|
+
fields: fullRevision.fields
|
|
5512
|
+
}
|
|
5513
|
+
},
|
|
5514
|
+
blockers: [formId],
|
|
5515
|
+
blocks: [offlineRevision.offline_id]
|
|
5516
|
+
});
|
|
5517
|
+
const [offlineFormRevisionAttachments, attachmentsPromise] = await this.bulkAddRevisionAttachments(
|
|
5518
|
+
fullRevision.offline_id,
|
|
5519
|
+
images
|
|
5520
|
+
);
|
|
5521
|
+
void promise.then((result) => {
|
|
5522
|
+
this.dispatch(setFormRevision(result));
|
|
5523
|
+
}).catch(() => {
|
|
5524
|
+
this.dispatch(deleteFormRevision(fullRevision.offline_id));
|
|
5525
|
+
});
|
|
5526
|
+
return [fullRevision, offlineFormRevisionAttachments, promise, attachmentsPromise];
|
|
5527
|
+
}
|
|
5528
|
+
async delete(id) {
|
|
5733
5529
|
const { store } = this.client;
|
|
5734
5530
|
const state = store.getState();
|
|
5735
5531
|
const form = selectFormById(id)(state);
|
|
@@ -5764,31 +5560,65 @@ class FormService extends BaseUploadService {
|
|
|
5764
5560
|
throw e;
|
|
5765
5561
|
}
|
|
5766
5562
|
}
|
|
5767
|
-
async refreshStore(projectId
|
|
5768
|
-
|
|
5769
|
-
const
|
|
5563
|
+
async refreshStore(projectId) {
|
|
5564
|
+
const forms = [];
|
|
5565
|
+
const revisions = [];
|
|
5566
|
+
const attachments = [];
|
|
5567
|
+
const projectFormsResult = await this.enqueueRequest({
|
|
5770
5568
|
description: "Fetch project forms",
|
|
5771
5569
|
method: HttpMethod.GET,
|
|
5772
|
-
url:
|
|
5773
|
-
queryParams: {
|
|
5774
|
-
project: projectId.toString()
|
|
5775
|
-
},
|
|
5570
|
+
url: `/projects/${projectId}/forms/`,
|
|
5776
5571
|
blockers: [projectId.toString()],
|
|
5777
5572
|
blocks: []
|
|
5778
5573
|
});
|
|
5779
|
-
|
|
5780
|
-
|
|
5574
|
+
for (const form of projectFormsResult.forms)
|
|
5575
|
+
forms.push(form);
|
|
5576
|
+
for (const revision of projectFormsResult.revisions)
|
|
5577
|
+
revisions.push(revision);
|
|
5578
|
+
for (const attachment of projectFormsResult.attachments)
|
|
5579
|
+
attachments.push(attachment);
|
|
5580
|
+
const organizationFormsResult = await this.enqueueRequest({
|
|
5781
5581
|
description: "Fetch organization forms",
|
|
5782
5582
|
method: HttpMethod.GET,
|
|
5783
|
-
url:
|
|
5784
|
-
|
|
5785
|
-
|
|
5786
|
-
|
|
5787
|
-
|
|
5583
|
+
url: `/projects/${projectId}/organizations/forms/`,
|
|
5584
|
+
blockers: [projectId.toString()],
|
|
5585
|
+
blocks: []
|
|
5586
|
+
});
|
|
5587
|
+
for (const form of organizationFormsResult.forms)
|
|
5588
|
+
forms.push(form);
|
|
5589
|
+
for (const revision of organizationFormsResult.revisions)
|
|
5590
|
+
revisions.push(revision);
|
|
5591
|
+
for (const attachment of organizationFormsResult.attachments)
|
|
5592
|
+
attachments.push(attachment);
|
|
5593
|
+
const assetTypeFormsResult = await this.enqueueRequest({
|
|
5594
|
+
description: "Fetch asset type forms",
|
|
5595
|
+
method: HttpMethod.GET,
|
|
5596
|
+
url: `/projects/${projectId}/asset-types/forms/`,
|
|
5597
|
+
blockers: [projectId.toString()],
|
|
5598
|
+
blocks: []
|
|
5599
|
+
});
|
|
5600
|
+
for (const form of assetTypeFormsResult.forms)
|
|
5601
|
+
forms.push(form);
|
|
5602
|
+
for (const revision of assetTypeFormsResult.revisions)
|
|
5603
|
+
revisions.push(revision);
|
|
5604
|
+
for (const attachment of assetTypeFormsResult.attachments)
|
|
5605
|
+
attachments.push(attachment);
|
|
5606
|
+
const issueTypeFormsResult = await this.enqueueRequest({
|
|
5607
|
+
description: "Fetch issue type forms",
|
|
5608
|
+
method: HttpMethod.GET,
|
|
5609
|
+
url: `/projects/${projectId}/issue-types/forms/`,
|
|
5610
|
+
blockers: [projectId.toString()],
|
|
5788
5611
|
blocks: []
|
|
5789
5612
|
});
|
|
5790
|
-
|
|
5613
|
+
for (const form of issueTypeFormsResult.forms)
|
|
5614
|
+
forms.push(form);
|
|
5615
|
+
for (const revision of issueTypeFormsResult.revisions)
|
|
5616
|
+
revisions.push(revision);
|
|
5617
|
+
for (const attachment of issueTypeFormsResult.attachments)
|
|
5618
|
+
attachments.push(attachment);
|
|
5791
5619
|
this.dispatch(initializeForms(forms));
|
|
5620
|
+
this.dispatch(initializeFormRevisions(revisions));
|
|
5621
|
+
this.dispatch(initializeFormRevisionAttachments(attachments));
|
|
5792
5622
|
}
|
|
5793
5623
|
}
|
|
5794
5624
|
const isArrayOfFiles = (value) => {
|
|
@@ -5810,11 +5640,95 @@ const separateFilesFromValues = (values) => {
|
|
|
5810
5640
|
return { values: newValues, files };
|
|
5811
5641
|
};
|
|
5812
5642
|
class FormSubmissionService extends BaseUploadService {
|
|
5813
|
-
|
|
5643
|
+
async bulkAddSubmissionAttachments(submissionId, files) {
|
|
5644
|
+
var _a2;
|
|
5645
|
+
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
5646
|
+
const createdBy = (_a2 = this.client.store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
5647
|
+
const filePayloads = {};
|
|
5648
|
+
const offlineFormSubmissionAttachments = [];
|
|
5649
|
+
const attachmentPayloads = [];
|
|
5650
|
+
for (const [fieldIdentifier, filesArray] of Object.entries(files)) {
|
|
5651
|
+
for (const file of filesArray) {
|
|
5652
|
+
const sha1 = await hashFile(file);
|
|
5653
|
+
if (!(sha1 in filePayloads)) {
|
|
5654
|
+
filePayloads[sha1] = {
|
|
5655
|
+
sha1,
|
|
5656
|
+
file_type: file.type,
|
|
5657
|
+
extension: file.name.split(".").pop(),
|
|
5658
|
+
size: file.size
|
|
5659
|
+
};
|
|
5660
|
+
await this.client.files.addCache(file, sha1);
|
|
5661
|
+
}
|
|
5662
|
+
const offlineFormSubmissionAttachment = offline({
|
|
5663
|
+
file: URL.createObjectURL(file),
|
|
5664
|
+
file_type: file.type,
|
|
5665
|
+
file_name: file.name,
|
|
5666
|
+
file_sha1: sha1,
|
|
5667
|
+
created_by: createdBy,
|
|
5668
|
+
submission: submissionId,
|
|
5669
|
+
submitted_at: submittedAt,
|
|
5670
|
+
field_identifier: fieldIdentifier
|
|
5671
|
+
});
|
|
5672
|
+
offlineFormSubmissionAttachments.push(offlineFormSubmissionAttachment);
|
|
5673
|
+
const attachmentPayload = {
|
|
5674
|
+
offline_id: offlineFormSubmissionAttachment.offline_id,
|
|
5675
|
+
name: file.name,
|
|
5676
|
+
sha1,
|
|
5677
|
+
field_identifier: fieldIdentifier
|
|
5678
|
+
};
|
|
5679
|
+
attachmentPayloads.push(attachmentPayload);
|
|
5680
|
+
}
|
|
5681
|
+
}
|
|
5682
|
+
this.dispatch(addFormSubmissionAttachments(offlineFormSubmissionAttachments));
|
|
5683
|
+
const promise = this.enqueueRequest({
|
|
5684
|
+
description: "Attach files to form submission",
|
|
5685
|
+
method: HttpMethod.POST,
|
|
5686
|
+
url: `/forms/submissions/${submissionId}/attachments/bulk/`,
|
|
5687
|
+
payload: {
|
|
5688
|
+
submitted_at: submittedAt,
|
|
5689
|
+
attachments: attachmentPayloads,
|
|
5690
|
+
files: Object.values(filePayloads)
|
|
5691
|
+
},
|
|
5692
|
+
blockers: [submissionId],
|
|
5693
|
+
blocks: offlineFormSubmissionAttachments.map((attachment) => attachment.offline_id)
|
|
5694
|
+
});
|
|
5695
|
+
promise.then((result) => {
|
|
5696
|
+
this.processPresignedUrls(result.presigned_urls);
|
|
5697
|
+
this.dispatch(updateFormSubmissionAttachments(result.attachments));
|
|
5698
|
+
}).catch(() => {
|
|
5699
|
+
this.dispatch(
|
|
5700
|
+
deleteFormSubmissionAttachments(
|
|
5701
|
+
offlineFormSubmissionAttachments.map((attachment) => attachment.offline_id)
|
|
5702
|
+
)
|
|
5703
|
+
);
|
|
5704
|
+
});
|
|
5705
|
+
return [offlineFormSubmissionAttachments, promise.then(({ attachments }) => attachments)];
|
|
5706
|
+
}
|
|
5707
|
+
async bulkDeleteSubmissionAttachments(submissionId, attachmentsIds) {
|
|
5708
|
+
const { store } = this.client;
|
|
5709
|
+
const state = store.getState();
|
|
5710
|
+
const formSubmissionAttachments = selectFormSubmissionAttachemntsByIds(attachmentsIds)(state);
|
|
5711
|
+
this.dispatch(deleteFormSubmissionAttachments(attachmentsIds));
|
|
5712
|
+
try {
|
|
5713
|
+
await this.enqueueRequest({
|
|
5714
|
+
description: "Delete form submission attachments",
|
|
5715
|
+
method: HttpMethod.DELETE,
|
|
5716
|
+
url: `/forms/submissions/${submissionId}/attachments/bulk/`,
|
|
5717
|
+
payload: { attachments: attachmentsIds },
|
|
5718
|
+
blockers: [submissionId, ...attachmentsIds],
|
|
5719
|
+
blocks: []
|
|
5720
|
+
});
|
|
5721
|
+
} catch (e) {
|
|
5722
|
+
this.dispatch(addFormSubmissionAttachments(formSubmissionAttachments));
|
|
5723
|
+
throw e;
|
|
5724
|
+
}
|
|
5725
|
+
}
|
|
5726
|
+
// Outer promise is for hashing and caching files for submission attachments
|
|
5727
|
+
async add(payload) {
|
|
5814
5728
|
var _a2;
|
|
5815
5729
|
const { store } = this.client;
|
|
5816
5730
|
const state = store.getState();
|
|
5817
|
-
const { values } = separateFilesFromValues(payload.values);
|
|
5731
|
+
const { values, files } = separateFilesFromValues(payload.values);
|
|
5818
5732
|
const offlineSubmission = offline({
|
|
5819
5733
|
...payload,
|
|
5820
5734
|
values,
|
|
@@ -5824,7 +5738,7 @@ class FormSubmissionService extends BaseUploadService {
|
|
|
5824
5738
|
const promise = this.enqueueRequest({
|
|
5825
5739
|
description: "Respond to form",
|
|
5826
5740
|
method: HttpMethod.POST,
|
|
5827
|
-
url:
|
|
5741
|
+
url: `/forms/revisions/${payload.form_revision}/respond/`,
|
|
5828
5742
|
payload: offlineSubmission,
|
|
5829
5743
|
blockers: [payload.issue, payload.asset, payload.asset_stage, "add-form-entry"].filter(
|
|
5830
5744
|
(x) => x !== void 0
|
|
@@ -5832,6 +5746,10 @@ class FormSubmissionService extends BaseUploadService {
|
|
|
5832
5746
|
blocks: [offlineSubmission.offline_id]
|
|
5833
5747
|
});
|
|
5834
5748
|
this.dispatch(addFormSubmission(offlineSubmission));
|
|
5749
|
+
const [offlineFormSubmissionAttachments, attachmentsPromise] = await this.bulkAddSubmissionAttachments(
|
|
5750
|
+
offlineSubmission.offline_id,
|
|
5751
|
+
files
|
|
5752
|
+
);
|
|
5835
5753
|
promise.then((result) => {
|
|
5836
5754
|
this.dispatch(addActiveProjectFormSubmissionsCount(1));
|
|
5837
5755
|
this.dispatch(setFormSubmission(result));
|
|
@@ -5840,16 +5758,115 @@ class FormSubmissionService extends BaseUploadService {
|
|
|
5840
5758
|
this.dispatch(deleteFormSubmission(offlineSubmission.offline_id));
|
|
5841
5759
|
this.dispatch(addActiveProjectFormSubmissionsCount(-1));
|
|
5842
5760
|
});
|
|
5843
|
-
return [offlineSubmission, promise];
|
|
5761
|
+
return [offlineSubmission, offlineFormSubmissionAttachments, promise, attachmentsPromise];
|
|
5844
5762
|
}
|
|
5845
|
-
|
|
5763
|
+
// Note currently the bulkAdd method is specific to form submissions for assets
|
|
5764
|
+
// TODO: adapt the support bulk adding to any model type
|
|
5765
|
+
async bulkAdd(args, batchSize) {
|
|
5766
|
+
const { formRevision, commonFieldValues, fieldValuesByAsset } = args;
|
|
5767
|
+
const { values: fileSeperatedCommonFieldValues, files: commonFiles } = separateFilesFromValues(commonFieldValues);
|
|
5768
|
+
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
5769
|
+
const transactionId = v4();
|
|
5770
|
+
const assetIdBatches = chunkArray(Object.keys(fieldValuesByAsset), batchSize);
|
|
5771
|
+
const bulkAddBatches = await Promise.all(
|
|
5772
|
+
assetIdBatches.map(async (assetIdBatch) => {
|
|
5773
|
+
const batchId = v4();
|
|
5774
|
+
const submissionPayloads = [];
|
|
5775
|
+
const attachmentPayloads = [];
|
|
5776
|
+
const files = { ...commonFiles };
|
|
5777
|
+
for (const assetId of assetIdBatch) {
|
|
5778
|
+
const { values: fileSeperatedSubmissionSpecificValues, files: submissionSpecificFiles } = separateFilesFromValues(fieldValuesByAsset[assetId] ?? {});
|
|
5779
|
+
Object.assign(files, submissionSpecificFiles);
|
|
5780
|
+
const submissionPayload = offline({
|
|
5781
|
+
asset_id: assetId,
|
|
5782
|
+
form_data: fileSeperatedSubmissionSpecificValues
|
|
5783
|
+
});
|
|
5784
|
+
submissionPayloads.push(submissionPayload);
|
|
5785
|
+
for (const [fieldIdentifier, fileArray] of Object.entries(files)) {
|
|
5786
|
+
for (const file of fileArray) {
|
|
5787
|
+
const sha1 = await hashFile(file);
|
|
5788
|
+
await this.client.files.addCache(file, sha1);
|
|
5789
|
+
const attachmentPayload = offline({
|
|
5790
|
+
submission_id: submissionPayload.offline_id,
|
|
5791
|
+
sha1,
|
|
5792
|
+
name: file.name,
|
|
5793
|
+
field_identifier: fieldIdentifier
|
|
5794
|
+
});
|
|
5795
|
+
attachmentPayloads.push(attachmentPayload);
|
|
5796
|
+
}
|
|
5797
|
+
}
|
|
5798
|
+
}
|
|
5799
|
+
const filePaylods = [];
|
|
5800
|
+
for (const file of Object.values(files).flat()) {
|
|
5801
|
+
const sha1 = await hashFile(file);
|
|
5802
|
+
const filePayload = {
|
|
5803
|
+
sha1,
|
|
5804
|
+
extension: file.name.split(".").pop() || "",
|
|
5805
|
+
file_type: file.type,
|
|
5806
|
+
size: file.size
|
|
5807
|
+
};
|
|
5808
|
+
filePaylods.push(filePayload);
|
|
5809
|
+
}
|
|
5810
|
+
return {
|
|
5811
|
+
batchId,
|
|
5812
|
+
payload: {
|
|
5813
|
+
transaction_id: transactionId,
|
|
5814
|
+
form_data: fileSeperatedCommonFieldValues,
|
|
5815
|
+
submitted_at: submittedAt,
|
|
5816
|
+
submissions: submissionPayloads,
|
|
5817
|
+
attachments: attachmentPayloads,
|
|
5818
|
+
files: filePaylods
|
|
5819
|
+
}
|
|
5820
|
+
};
|
|
5821
|
+
})
|
|
5822
|
+
);
|
|
5823
|
+
const batchPromises = [];
|
|
5824
|
+
let prevBatchId = null;
|
|
5825
|
+
for (const batch of bulkAddBatches) {
|
|
5826
|
+
const { payload, batchId } = batch;
|
|
5827
|
+
const batchAssetIds = payload.submissions.map((x) => x.asset_id);
|
|
5828
|
+
const batchSubmissionOfflineIds = payload.submissions.map((x) => x.offline_id);
|
|
5829
|
+
const batchAttachmentsOfflineIds = payload.attachments.map((x) => x.offline_id);
|
|
5830
|
+
const blockers = batchAssetIds;
|
|
5831
|
+
if (prevBatchId)
|
|
5832
|
+
blockers.push(prevBatchId);
|
|
5833
|
+
const blocks = [...batchSubmissionOfflineIds, ...batchAttachmentsOfflineIds, batchId];
|
|
5834
|
+
const promise = this.enqueueRequest({
|
|
5835
|
+
description: "Bulk add form submissions",
|
|
5836
|
+
method: HttpMethod.POST,
|
|
5837
|
+
url: `/forms/revisions/${formRevision}/bulk-respond/`,
|
|
5838
|
+
payload,
|
|
5839
|
+
blockers,
|
|
5840
|
+
blocks
|
|
5841
|
+
});
|
|
5842
|
+
void promise.then(({ presigned_urls }) => {
|
|
5843
|
+
this.processPresignedUrls(presigned_urls);
|
|
5844
|
+
});
|
|
5845
|
+
prevBatchId = batchId;
|
|
5846
|
+
batchPromises.push(promise);
|
|
5847
|
+
}
|
|
5848
|
+
void Promise.all(batchPromises).then((results) => {
|
|
5849
|
+
const createdSubmissions = [];
|
|
5850
|
+
const createdAttachments = [];
|
|
5851
|
+
for (const result of results) {
|
|
5852
|
+
for (const createdSubmission of result.submissions)
|
|
5853
|
+
createdSubmissions.push(createdSubmission);
|
|
5854
|
+
for (const createdAttachment of result.attachments)
|
|
5855
|
+
createdAttachments.push(createdAttachment);
|
|
5856
|
+
}
|
|
5857
|
+
this.dispatch(addFormSubmissions(createdSubmissions));
|
|
5858
|
+
this.dispatch(addFormSubmissionAttachments(createdAttachments));
|
|
5859
|
+
});
|
|
5860
|
+
return batchPromises;
|
|
5861
|
+
}
|
|
5862
|
+
async update(payload) {
|
|
5846
5863
|
const { store } = this.client;
|
|
5847
5864
|
const state = store.getState();
|
|
5848
5865
|
const submissionToBeUpdated = selectFormSubmissionById(payload.offline_id)(state);
|
|
5849
5866
|
if (!submissionToBeUpdated) {
|
|
5850
5867
|
throw new Error(`Expected submission with offline_id ${payload.offline_id} to exist`);
|
|
5851
5868
|
}
|
|
5852
|
-
const { values } = separateFilesFromValues(payload.values ?? {});
|
|
5869
|
+
const { values, files } = separateFilesFromValues(payload.values ?? {});
|
|
5853
5870
|
const updatedSubmission = {
|
|
5854
5871
|
...submissionToBeUpdated,
|
|
5855
5872
|
...payload,
|
|
@@ -5863,18 +5880,39 @@ class FormSubmissionService extends BaseUploadService {
|
|
|
5863
5880
|
const promise = this.enqueueRequest({
|
|
5864
5881
|
description: "Delete user form submissions",
|
|
5865
5882
|
method: HttpMethod.PATCH,
|
|
5866
|
-
url: `/
|
|
5883
|
+
url: `/forms/submissions/${updatedSubmission.offline_id}/`,
|
|
5867
5884
|
// TODO: send just payload when FormSubmissionDeserializer is updated to handle partial updates
|
|
5868
5885
|
payload: updatedSubmission,
|
|
5869
5886
|
blockers: [updatedSubmission.offline_id],
|
|
5870
5887
|
blocks: [updatedSubmission.offline_id]
|
|
5871
5888
|
});
|
|
5889
|
+
const formSubmissionAttachments = selectAttachmentsOfFormSubmission(payload.offline_id)(state);
|
|
5890
|
+
const formSubmissionAttachmentIdsToBeDeleted = [];
|
|
5891
|
+
for (const attachment of formSubmissionAttachments) {
|
|
5892
|
+
if (attachment.field_identifier in files) {
|
|
5893
|
+
formSubmissionAttachmentIdsToBeDeleted.push(attachment.offline_id);
|
|
5894
|
+
}
|
|
5895
|
+
}
|
|
5896
|
+
const [offlineFormSubmissionAttachments, attachmentsPromise] = await this.bulkAddSubmissionAttachments(
|
|
5897
|
+
payload.offline_id,
|
|
5898
|
+
files
|
|
5899
|
+
);
|
|
5900
|
+
const deleteAttachmentsPromise = this.bulkDeleteSubmissionAttachments(
|
|
5901
|
+
payload.offline_id,
|
|
5902
|
+
formSubmissionAttachmentIdsToBeDeleted
|
|
5903
|
+
);
|
|
5872
5904
|
promise.then((result) => {
|
|
5873
5905
|
this.dispatch(setFormSubmission(result));
|
|
5874
5906
|
}).catch(() => {
|
|
5875
5907
|
this.dispatch(setFormSubmission(submissionToBeUpdated));
|
|
5876
5908
|
});
|
|
5877
|
-
return [
|
|
5909
|
+
return [
|
|
5910
|
+
updatedSubmission,
|
|
5911
|
+
offlineFormSubmissionAttachments,
|
|
5912
|
+
promise,
|
|
5913
|
+
attachmentsPromise,
|
|
5914
|
+
deleteAttachmentsPromise
|
|
5915
|
+
];
|
|
5878
5916
|
}
|
|
5879
5917
|
async delete(id) {
|
|
5880
5918
|
const { store } = this.client;
|
|
@@ -5891,7 +5929,7 @@ class FormSubmissionService extends BaseUploadService {
|
|
|
5891
5929
|
return await this.enqueueRequest({
|
|
5892
5930
|
description: "Delete user form submissions",
|
|
5893
5931
|
method: HttpMethod.DELETE,
|
|
5894
|
-
url: `/
|
|
5932
|
+
url: `/forms/submissions/${id}/`,
|
|
5895
5933
|
blockers: [id],
|
|
5896
5934
|
blocks: []
|
|
5897
5935
|
});
|
|
@@ -5903,17 +5941,50 @@ class FormSubmissionService extends BaseUploadService {
|
|
|
5903
5941
|
}
|
|
5904
5942
|
}
|
|
5905
5943
|
async refreshStore(projectId) {
|
|
5906
|
-
const
|
|
5907
|
-
|
|
5944
|
+
const formSubmissions = {};
|
|
5945
|
+
const modelSubmissions = await this.enqueueRequest({
|
|
5946
|
+
description: "Fetch model submissions",
|
|
5908
5947
|
method: HttpMethod.GET,
|
|
5909
|
-
url:
|
|
5910
|
-
|
|
5911
|
-
|
|
5912
|
-
|
|
5948
|
+
url: `/forms/in-project/${projectId}/submissions/model/latest/`,
|
|
5949
|
+
blockers: [],
|
|
5950
|
+
blocks: []
|
|
5951
|
+
});
|
|
5952
|
+
for (const modelSubmission of modelSubmissions) {
|
|
5953
|
+
formSubmissions[modelSubmission.offline_id] = modelSubmission;
|
|
5954
|
+
}
|
|
5955
|
+
const standaloneSubmissions = await this.enqueueRequest({
|
|
5956
|
+
description: "Fetch standalone submissions",
|
|
5957
|
+
method: HttpMethod.GET,
|
|
5958
|
+
url: `/forms/in-project/${projectId}/submissions/standalone/`,
|
|
5959
|
+
blockers: [],
|
|
5960
|
+
blocks: []
|
|
5961
|
+
});
|
|
5962
|
+
for (const standaloneSubmission of standaloneSubmissions) {
|
|
5963
|
+
formSubmissions[standaloneSubmission.offline_id] = standaloneSubmission;
|
|
5964
|
+
}
|
|
5965
|
+
this.dispatch(initializeFormSubmissions(Object.values(formSubmissions)));
|
|
5966
|
+
const attachments = {};
|
|
5967
|
+
const modelAttachments = await this.enqueueRequest({
|
|
5968
|
+
description: "Fetch model submission attachments",
|
|
5969
|
+
method: HttpMethod.GET,
|
|
5970
|
+
url: `/forms/in-project/${projectId}/attachments/model/latest/`,
|
|
5913
5971
|
blockers: [],
|
|
5914
5972
|
blocks: []
|
|
5915
5973
|
});
|
|
5916
|
-
|
|
5974
|
+
for (const modelAttachment of modelAttachments) {
|
|
5975
|
+
attachments[modelAttachment.offline_id] = modelAttachment;
|
|
5976
|
+
}
|
|
5977
|
+
const standaloneAttachments = await this.enqueueRequest({
|
|
5978
|
+
description: "Fetch standalone submission attachments",
|
|
5979
|
+
method: HttpMethod.GET,
|
|
5980
|
+
url: `/forms/in-project/${projectId}/attachments/standalone/`,
|
|
5981
|
+
blockers: [],
|
|
5982
|
+
blocks: []
|
|
5983
|
+
});
|
|
5984
|
+
for (const standaloneAttachent of standaloneAttachments) {
|
|
5985
|
+
attachments[standaloneAttachent.offline_id] = standaloneAttachent;
|
|
5986
|
+
}
|
|
5987
|
+
this.dispatch(initializeFormSubmissionAttachments(Object.values(attachments)));
|
|
5917
5988
|
}
|
|
5918
5989
|
}
|
|
5919
5990
|
class WorkspaceService extends BaseApiService {
|
|
@@ -6615,8 +6686,8 @@ class DocumentService extends BaseApiService {
|
|
|
6615
6686
|
class DocumentAttachmentService extends BaseAttachmentService {
|
|
6616
6687
|
constructor() {
|
|
6617
6688
|
super(...arguments);
|
|
6618
|
-
__publicField(this, "
|
|
6619
|
-
__publicField(this, "
|
|
6689
|
+
__publicField(this, "attachmentModel", AttachmentModel.Document);
|
|
6690
|
+
__publicField(this, "initializeAttachments", initializeDocumentAttachments);
|
|
6620
6691
|
__publicField(this, "addAttachments", addDocumentAttachments);
|
|
6621
6692
|
__publicField(this, "updateAttachments", updateDocumentAttachments);
|
|
6622
6693
|
__publicField(this, "removeAttachments", deleteDocumentAttachments);
|
|
@@ -6627,23 +6698,17 @@ class DocumentAttachmentService extends BaseAttachmentService {
|
|
|
6627
6698
|
buildOfflineAttachment(data) {
|
|
6628
6699
|
return offline({
|
|
6629
6700
|
file: URL.createObjectURL(data.file),
|
|
6630
|
-
file_sha1: data.
|
|
6631
|
-
created_by: data.
|
|
6701
|
+
file_sha1: data.sha1,
|
|
6702
|
+
created_by: data.createdBy,
|
|
6632
6703
|
file_name: data.file.name,
|
|
6633
6704
|
file_type: data.file.type,
|
|
6634
|
-
submitted_at: data.
|
|
6705
|
+
submitted_at: data.submittedAt,
|
|
6635
6706
|
description: data.description,
|
|
6636
6707
|
document: data.modelId
|
|
6637
6708
|
});
|
|
6638
6709
|
}
|
|
6639
|
-
buildAttachmentPayload(data) {
|
|
6640
|
-
return {
|
|
6641
|
-
...data,
|
|
6642
|
-
document: data.modelId
|
|
6643
|
-
};
|
|
6644
|
-
}
|
|
6645
6710
|
// NOTE: overriding the method from BaseAttachmentService since document attachments get vectorized
|
|
6646
|
-
async
|
|
6711
|
+
async attachFilesToDocument(files, documentId) {
|
|
6647
6712
|
var _a2;
|
|
6648
6713
|
const { store } = this.client;
|
|
6649
6714
|
const createdBy = (_a2 = store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
@@ -6652,36 +6717,40 @@ class DocumentAttachmentService extends BaseAttachmentService {
|
|
|
6652
6717
|
const attachmentPayloads = [];
|
|
6653
6718
|
const filePayloads = {};
|
|
6654
6719
|
const sha1ToAttachmentIds = {};
|
|
6655
|
-
for (const
|
|
6656
|
-
const
|
|
6657
|
-
|
|
6658
|
-
|
|
6659
|
-
|
|
6660
|
-
|
|
6720
|
+
for (const file of files) {
|
|
6721
|
+
const sha1 = await hashFile(file);
|
|
6722
|
+
if (!(sha1 in filePayloads)) {
|
|
6723
|
+
filePayloads[sha1] = {
|
|
6724
|
+
sha1,
|
|
6725
|
+
file_type: file.type,
|
|
6726
|
+
extension: file.name.split(".").pop(),
|
|
6727
|
+
size: file.size
|
|
6728
|
+
};
|
|
6729
|
+
sha1ToAttachmentIds[sha1] = [];
|
|
6730
|
+
await this.client.files.addCache(file, sha1);
|
|
6661
6731
|
}
|
|
6662
6732
|
const offlineAttachment = this.buildOfflineAttachment({
|
|
6663
6733
|
file,
|
|
6664
|
-
|
|
6665
|
-
|
|
6666
|
-
|
|
6734
|
+
sha1,
|
|
6735
|
+
submittedAt,
|
|
6736
|
+
createdBy,
|
|
6667
6737
|
description: "",
|
|
6668
6738
|
modelId: documentId
|
|
6669
6739
|
});
|
|
6670
6740
|
offlineAttachments.push(offlineAttachment);
|
|
6671
6741
|
attachmentPayloads.push({
|
|
6672
6742
|
offline_id: offlineAttachment.offline_id,
|
|
6673
|
-
|
|
6674
|
-
|
|
6675
|
-
file_extension: filePayload.extension,
|
|
6743
|
+
name: offlineAttachment.file_name,
|
|
6744
|
+
sha1: offlineAttachment.file_sha1,
|
|
6676
6745
|
description: offlineAttachment.description
|
|
6677
6746
|
});
|
|
6678
|
-
sha1ToAttachmentIds[
|
|
6747
|
+
sha1ToAttachmentIds[sha1].push(offlineAttachment.offline_id);
|
|
6679
6748
|
}
|
|
6680
6749
|
this.dispatch(this.addAttachments(offlineAttachments));
|
|
6681
6750
|
const promise = this.enqueueRequest({
|
|
6682
6751
|
description: "Attach files to document",
|
|
6683
6752
|
method: HttpMethod.POST,
|
|
6684
|
-
url:
|
|
6753
|
+
url: `/documents/${documentId}/attach/`,
|
|
6685
6754
|
payload: {
|
|
6686
6755
|
submitted_at: submittedAt,
|
|
6687
6756
|
attachments: attachmentPayloads,
|
|
@@ -6706,14 +6775,14 @@ class DocumentAttachmentService extends BaseAttachmentService {
|
|
|
6706
6775
|
});
|
|
6707
6776
|
return [offlineAttachments, promise.then(({ attachments }) => attachments)];
|
|
6708
6777
|
}
|
|
6709
|
-
async
|
|
6710
|
-
return this.
|
|
6778
|
+
async deleteDocumentAttachment(attachmentId) {
|
|
6779
|
+
return this.deleteAttachment(attachmentId);
|
|
6711
6780
|
}
|
|
6712
6781
|
makeReadable(attachmnentId) {
|
|
6713
6782
|
void this.enqueueRequest({
|
|
6714
6783
|
description: "Add attachment to AI assistant",
|
|
6715
6784
|
method: HttpMethod.PATCH,
|
|
6716
|
-
url: `/
|
|
6785
|
+
url: `/documents/attachments/${attachmnentId}/`,
|
|
6717
6786
|
payload: {
|
|
6718
6787
|
readable_to_assistant: true
|
|
6719
6788
|
},
|
|
@@ -6730,7 +6799,7 @@ class DocumentAttachmentService extends BaseAttachmentService {
|
|
|
6730
6799
|
blocks: [],
|
|
6731
6800
|
blockers: []
|
|
6732
6801
|
});
|
|
6733
|
-
this.dispatch(
|
|
6802
|
+
this.dispatch(this.initializeAttachments(projectDocumentAttachments));
|
|
6734
6803
|
const organizationDocumentAttachments = await this.enqueueRequest({
|
|
6735
6804
|
description: "Get document attachments",
|
|
6736
6805
|
method: HttpMethod.GET,
|
|
@@ -6974,11 +7043,17 @@ class GeoImageService extends BaseUploadService {
|
|
|
6974
7043
|
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
6975
7044
|
const createdBy = (_a2 = store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
6976
7045
|
const projectId = payloadWithoutFile.project;
|
|
6977
|
-
const
|
|
7046
|
+
const sha1 = await hashFile(file);
|
|
7047
|
+
const filePayload = {
|
|
7048
|
+
sha1,
|
|
7049
|
+
file_type: file.type,
|
|
7050
|
+
extension: file.name.split(".").pop(),
|
|
7051
|
+
size: file.size
|
|
7052
|
+
};
|
|
6978
7053
|
const offlineMapImage = offline({
|
|
6979
7054
|
...payloadWithoutFile,
|
|
6980
7055
|
file_name: file.name,
|
|
6981
|
-
file_sha1:
|
|
7056
|
+
file_sha1: sha1,
|
|
6982
7057
|
file: URL.createObjectURL(file),
|
|
6983
7058
|
submitted_at: submittedAt,
|
|
6984
7059
|
created_by: createdBy
|
|
@@ -7021,16 +7096,23 @@ class GeoImageService extends BaseUploadService {
|
|
|
7021
7096
|
const offlineGeoImages = [];
|
|
7022
7097
|
const offlineIds = [];
|
|
7023
7098
|
const geoImagePayloads = [];
|
|
7024
|
-
const
|
|
7099
|
+
const filePayloadRecord = {};
|
|
7025
7100
|
for (const payloadAndFile of payloads) {
|
|
7026
7101
|
const { file, ...payload } = payloadAndFile;
|
|
7027
|
-
const
|
|
7028
|
-
if (!(
|
|
7029
|
-
|
|
7102
|
+
const sha1 = await hashFile(file);
|
|
7103
|
+
if (!(sha1 in filePayloadRecord)) {
|
|
7104
|
+
filePayloadRecord[sha1] = {
|
|
7105
|
+
sha1,
|
|
7106
|
+
file_type: file.type,
|
|
7107
|
+
extension: file.name.split(".").pop(),
|
|
7108
|
+
size: file.size
|
|
7109
|
+
};
|
|
7110
|
+
await this.client.files.addCache(file, sha1);
|
|
7111
|
+
}
|
|
7030
7112
|
const offlineMapImage = offline({
|
|
7031
7113
|
...payload,
|
|
7032
7114
|
file_name: file.name,
|
|
7033
|
-
file_sha1:
|
|
7115
|
+
file_sha1: sha1,
|
|
7034
7116
|
file: URL.createObjectURL(file),
|
|
7035
7117
|
submitted_at: submittedAt,
|
|
7036
7118
|
created_by: createdBy,
|
|
@@ -7059,7 +7141,7 @@ class GeoImageService extends BaseUploadService {
|
|
|
7059
7141
|
submitted_at: submittedAt,
|
|
7060
7142
|
project: projectId,
|
|
7061
7143
|
geo_images: geoImagePayloads,
|
|
7062
|
-
files: Object.values(
|
|
7144
|
+
files: Object.values(filePayloadRecord)
|
|
7063
7145
|
},
|
|
7064
7146
|
blocks: [projectId.toString()],
|
|
7065
7147
|
blockers: offlineIds
|
|
@@ -7127,7 +7209,7 @@ class GeoImageService extends BaseUploadService {
|
|
|
7127
7209
|
this.dispatch(initializeGeoImages(result));
|
|
7128
7210
|
}
|
|
7129
7211
|
}
|
|
7130
|
-
class IssueAssociationService extends
|
|
7212
|
+
class IssueAssociationService extends BaseUploadService {
|
|
7131
7213
|
add(payload) {
|
|
7132
7214
|
var _a2;
|
|
7133
7215
|
const { store } = this.client;
|
|
@@ -7142,7 +7224,7 @@ class IssueAssociationService extends BaseApiService {
|
|
|
7142
7224
|
const promise = this.enqueueRequest({
|
|
7143
7225
|
description: "Add issue association",
|
|
7144
7226
|
method: HttpMethod.POST,
|
|
7145
|
-
url: "/
|
|
7227
|
+
url: "/issues/associations/",
|
|
7146
7228
|
payload: {
|
|
7147
7229
|
offline_id: offlineIssueAssociation.offline_id,
|
|
7148
7230
|
submitted_at: submittedAt,
|
|
@@ -7172,7 +7254,7 @@ class IssueAssociationService extends BaseApiService {
|
|
|
7172
7254
|
const promise = this.enqueueRequest({
|
|
7173
7255
|
description: "Delete issue association",
|
|
7174
7256
|
method: HttpMethod.DELETE,
|
|
7175
|
-
url: `/
|
|
7257
|
+
url: `/issues/associations/${id}/`,
|
|
7176
7258
|
blockers: [id],
|
|
7177
7259
|
blocks: []
|
|
7178
7260
|
});
|
|
@@ -7185,938 +7267,14 @@ class IssueAssociationService extends BaseApiService {
|
|
|
7185
7267
|
const issueAssociations = await this.enqueueRequest({
|
|
7186
7268
|
description: "Fetch issue associations",
|
|
7187
7269
|
method: HttpMethod.GET,
|
|
7188
|
-
url: "/
|
|
7189
|
-
queryParams: {
|
|
7270
|
+
url: "/issues/associations/",
|
|
7271
|
+
queryParams: { project_id: projectId.toString() },
|
|
7190
7272
|
blockers: [],
|
|
7191
7273
|
blocks: []
|
|
7192
7274
|
});
|
|
7193
7275
|
this.dispatch(initializeIssueAssociations(issueAssociations));
|
|
7194
7276
|
}
|
|
7195
7277
|
}
|
|
7196
|
-
class FormRevisionAttachmentService extends BaseUploadService {
|
|
7197
|
-
async bulkAdd(payloads) {
|
|
7198
|
-
var _a2;
|
|
7199
|
-
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7200
|
-
const createdBy = (_a2 = this.client.store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
7201
|
-
const filePayloads = {};
|
|
7202
|
-
const offlineFormRevisionAttachments = [];
|
|
7203
|
-
const attachmentPayloads = [];
|
|
7204
|
-
for (const payload of payloads) {
|
|
7205
|
-
const { revisionId, fieldIdentifier, file } = payload;
|
|
7206
|
-
const filePayload = await this.getFilePayload(file);
|
|
7207
|
-
if (!(filePayload.sha1 in filePayloads))
|
|
7208
|
-
filePayloads[filePayload.sha1] = filePayload;
|
|
7209
|
-
const offlineFormRevisionAttachment = offline({
|
|
7210
|
-
file: URL.createObjectURL(file),
|
|
7211
|
-
file_type: file.type,
|
|
7212
|
-
file_name: file.name,
|
|
7213
|
-
file_sha1: filePayload.sha1,
|
|
7214
|
-
created_by: createdBy,
|
|
7215
|
-
form_revision: revisionId,
|
|
7216
|
-
submitted_at: submittedAt,
|
|
7217
|
-
field_identifier: fieldIdentifier
|
|
7218
|
-
});
|
|
7219
|
-
offlineFormRevisionAttachments.push(offlineFormRevisionAttachment);
|
|
7220
|
-
const attachmentPayload = {
|
|
7221
|
-
offline_id: offlineFormRevisionAttachment.offline_id,
|
|
7222
|
-
file_name: file.name,
|
|
7223
|
-
field_identifier: fieldIdentifier,
|
|
7224
|
-
file_extension: filePayload.extension,
|
|
7225
|
-
file_sha1: filePayload.sha1,
|
|
7226
|
-
form_revision: revisionId
|
|
7227
|
-
};
|
|
7228
|
-
attachmentPayloads.push(attachmentPayload);
|
|
7229
|
-
}
|
|
7230
|
-
this.dispatch(addFormRevisionAttachments(offlineFormRevisionAttachments));
|
|
7231
|
-
const promise = this.enqueueRequest({
|
|
7232
|
-
description: "Attach files to form revision",
|
|
7233
|
-
method: HttpMethod.POST,
|
|
7234
|
-
url: "/form-revision-attachments/bulk/",
|
|
7235
|
-
payload: {
|
|
7236
|
-
submitted_at: submittedAt,
|
|
7237
|
-
attachments: attachmentPayloads,
|
|
7238
|
-
files: Object.values(filePayloads)
|
|
7239
|
-
},
|
|
7240
|
-
blockers: offlineFormRevisionAttachments.map((attachment) => attachment.form_revision),
|
|
7241
|
-
blocks: offlineFormRevisionAttachments.map((attachment) => attachment.offline_id)
|
|
7242
|
-
});
|
|
7243
|
-
promise.then((result) => {
|
|
7244
|
-
this.processPresignedUrls(result.presigned_urls);
|
|
7245
|
-
this.dispatch(updateFormRevisionAttachments(result.attachments));
|
|
7246
|
-
}).catch(() => {
|
|
7247
|
-
this.dispatch(
|
|
7248
|
-
deleteFormRevisionAttachments(
|
|
7249
|
-
offlineFormRevisionAttachments.map((attachment) => attachment.offline_id)
|
|
7250
|
-
)
|
|
7251
|
-
);
|
|
7252
|
-
});
|
|
7253
|
-
return [offlineFormRevisionAttachments, promise.then(({ attachments }) => attachments)];
|
|
7254
|
-
}
|
|
7255
|
-
async refreshStore(projectId, organizationId) {
|
|
7256
|
-
let attachments = [];
|
|
7257
|
-
const projectFormRevisions = await this.enqueueRequest({
|
|
7258
|
-
description: "Fetch project form revision attachments",
|
|
7259
|
-
method: HttpMethod.GET,
|
|
7260
|
-
url: "/form-revision-attachments/",
|
|
7261
|
-
queryParams: {
|
|
7262
|
-
project: projectId.toString()
|
|
7263
|
-
},
|
|
7264
|
-
blockers: [projectId.toString()],
|
|
7265
|
-
blocks: []
|
|
7266
|
-
});
|
|
7267
|
-
attachments = attachments.concat(projectFormRevisions);
|
|
7268
|
-
const organizationFormRevisions = await this.enqueueRequest({
|
|
7269
|
-
description: "Fetch organization form revision attachments",
|
|
7270
|
-
method: HttpMethod.GET,
|
|
7271
|
-
url: "/form-revision-attachments/",
|
|
7272
|
-
queryParams: {
|
|
7273
|
-
organization: organizationId.toString()
|
|
7274
|
-
},
|
|
7275
|
-
blockers: [organizationId.toString()],
|
|
7276
|
-
blocks: []
|
|
7277
|
-
});
|
|
7278
|
-
attachments = attachments.concat(organizationFormRevisions);
|
|
7279
|
-
this.dispatch(initializeFormRevisionAttachments(attachments));
|
|
7280
|
-
}
|
|
7281
|
-
}
|
|
7282
|
-
class FormSubmissionAttachmentService extends BaseUploadService {
|
|
7283
|
-
async bulkAdd(payloads) {
|
|
7284
|
-
var _a2;
|
|
7285
|
-
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7286
|
-
const createdBy = (_a2 = this.client.store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
7287
|
-
const filePayloads = {};
|
|
7288
|
-
const offlineFormSubmissionAttachments = [];
|
|
7289
|
-
const attachmentPayloads = [];
|
|
7290
|
-
for (const payload of payloads) {
|
|
7291
|
-
const { submissionId, fieldIdentifier, file } = payload;
|
|
7292
|
-
const filePayload = await this.getFilePayload(file);
|
|
7293
|
-
if (!(filePayload.sha1 in filePayloads))
|
|
7294
|
-
filePayloads[filePayload.sha1] = filePayload;
|
|
7295
|
-
const offlineFormSubmissionAttachment = offline({
|
|
7296
|
-
file: URL.createObjectURL(file),
|
|
7297
|
-
file_type: file.type,
|
|
7298
|
-
file_name: file.name,
|
|
7299
|
-
file_sha1: filePayload.sha1,
|
|
7300
|
-
created_by: createdBy,
|
|
7301
|
-
form_submission: submissionId,
|
|
7302
|
-
submitted_at: submittedAt,
|
|
7303
|
-
field_identifier: fieldIdentifier
|
|
7304
|
-
});
|
|
7305
|
-
offlineFormSubmissionAttachments.push(offlineFormSubmissionAttachment);
|
|
7306
|
-
const attachmentPayload = {
|
|
7307
|
-
offline_id: offlineFormSubmissionAttachment.offline_id,
|
|
7308
|
-
file_name: file.name,
|
|
7309
|
-
file_sha1: filePayload.sha1,
|
|
7310
|
-
file_extension: filePayload.extension,
|
|
7311
|
-
field_identifier: fieldIdentifier,
|
|
7312
|
-
form_submission: submissionId
|
|
7313
|
-
};
|
|
7314
|
-
attachmentPayloads.push(attachmentPayload);
|
|
7315
|
-
}
|
|
7316
|
-
this.dispatch(addFormSubmissionAttachments(offlineFormSubmissionAttachments));
|
|
7317
|
-
const promise = this.enqueueRequest({
|
|
7318
|
-
description: "Attach files to form submission",
|
|
7319
|
-
method: HttpMethod.POST,
|
|
7320
|
-
url: "/form-submission-attachments/bulk/",
|
|
7321
|
-
payload: {
|
|
7322
|
-
submitted_at: submittedAt,
|
|
7323
|
-
attachments: attachmentPayloads,
|
|
7324
|
-
files: Object.values(filePayloads)
|
|
7325
|
-
},
|
|
7326
|
-
blockers: offlineFormSubmissionAttachments.map((attachment) => attachment.form_submission),
|
|
7327
|
-
blocks: offlineFormSubmissionAttachments.map((attachment) => attachment.offline_id)
|
|
7328
|
-
});
|
|
7329
|
-
promise.then((result) => {
|
|
7330
|
-
this.processPresignedUrls(result.presigned_urls);
|
|
7331
|
-
this.dispatch(updateFormSubmissionAttachments(result.attachments));
|
|
7332
|
-
}).catch((error) => {
|
|
7333
|
-
this.dispatch(
|
|
7334
|
-
deleteFormSubmissionAttachments(
|
|
7335
|
-
offlineFormSubmissionAttachments.map((attachment) => attachment.offline_id)
|
|
7336
|
-
)
|
|
7337
|
-
);
|
|
7338
|
-
throw error;
|
|
7339
|
-
});
|
|
7340
|
-
return [offlineFormSubmissionAttachments, promise.then(({ attachments }) => attachments)];
|
|
7341
|
-
}
|
|
7342
|
-
async bulkDelete(attachmentsIds) {
|
|
7343
|
-
const { store } = this.client;
|
|
7344
|
-
const state = store.getState();
|
|
7345
|
-
const formSubmissionAttachments = selectFormSubmissionAttachemntsByIds(attachmentsIds)(state);
|
|
7346
|
-
this.dispatch(deleteFormSubmissionAttachments(attachmentsIds));
|
|
7347
|
-
try {
|
|
7348
|
-
await this.enqueueRequest({
|
|
7349
|
-
description: "Delete form submission attachments",
|
|
7350
|
-
method: HttpMethod.DELETE,
|
|
7351
|
-
url: "/form-submission-attachments/bulk/",
|
|
7352
|
-
payload: { attachment_ids: attachmentsIds },
|
|
7353
|
-
blockers: attachmentsIds,
|
|
7354
|
-
blocks: []
|
|
7355
|
-
});
|
|
7356
|
-
} catch (e) {
|
|
7357
|
-
this.dispatch(addFormSubmissionAttachments(formSubmissionAttachments));
|
|
7358
|
-
throw e;
|
|
7359
|
-
}
|
|
7360
|
-
}
|
|
7361
|
-
async refreshStore(projectId) {
|
|
7362
|
-
const result = await this.enqueueRequest({
|
|
7363
|
-
description: "Get form submission attachments",
|
|
7364
|
-
method: HttpMethod.GET,
|
|
7365
|
-
url: "/form-submission-attachments/",
|
|
7366
|
-
queryParams: {
|
|
7367
|
-
project: projectId.toString()
|
|
7368
|
-
},
|
|
7369
|
-
blockers: [],
|
|
7370
|
-
blocks: []
|
|
7371
|
-
});
|
|
7372
|
-
this.dispatch(initializeFormSubmissionAttachments(result));
|
|
7373
|
-
}
|
|
7374
|
-
}
|
|
7375
|
-
class FormRevisionService extends BaseUploadService {
|
|
7376
|
-
add(payload) {
|
|
7377
|
-
var _a2;
|
|
7378
|
-
const { store } = this.client;
|
|
7379
|
-
const state = store.getState();
|
|
7380
|
-
const createdBy = (_a2 = state.userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
7381
|
-
const offlineFormRevision = offline({
|
|
7382
|
-
...payload,
|
|
7383
|
-
created_by: createdBy,
|
|
7384
|
-
revision: "Pending",
|
|
7385
|
-
submitted_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
7386
|
-
});
|
|
7387
|
-
this.dispatch(addFormRevision(offlineFormRevision));
|
|
7388
|
-
const promise = this.enqueueRequest({
|
|
7389
|
-
description: "Create form revision",
|
|
7390
|
-
method: HttpMethod.POST,
|
|
7391
|
-
url: "/form-revisions/",
|
|
7392
|
-
payload: offlineFormRevision,
|
|
7393
|
-
blockers: [payload.form],
|
|
7394
|
-
blocks: [offlineFormRevision.offline_id]
|
|
7395
|
-
});
|
|
7396
|
-
void promise.then((result) => {
|
|
7397
|
-
this.dispatch(setFormRevision(result));
|
|
7398
|
-
}).catch(() => {
|
|
7399
|
-
this.dispatch(deleteFormRevision(offlineFormRevision.offline_id));
|
|
7400
|
-
});
|
|
7401
|
-
return [offlineFormRevision, promise];
|
|
7402
|
-
}
|
|
7403
|
-
async refreshStore(projectId, organizationId) {
|
|
7404
|
-
let formRevisions = [];
|
|
7405
|
-
const projectFormRevisions = await this.enqueueRequest({
|
|
7406
|
-
description: "Fetch project form revisions",
|
|
7407
|
-
method: HttpMethod.GET,
|
|
7408
|
-
url: "/form-revisions/",
|
|
7409
|
-
queryParams: {
|
|
7410
|
-
project: projectId.toString()
|
|
7411
|
-
},
|
|
7412
|
-
blockers: [projectId.toString()],
|
|
7413
|
-
blocks: []
|
|
7414
|
-
});
|
|
7415
|
-
formRevisions = formRevisions.concat(projectFormRevisions);
|
|
7416
|
-
const organizationFormRevisions = await this.enqueueRequest({
|
|
7417
|
-
description: "Fetch organization form revisions",
|
|
7418
|
-
method: HttpMethod.GET,
|
|
7419
|
-
url: "/form-revisions/",
|
|
7420
|
-
queryParams: {
|
|
7421
|
-
organization: organizationId.toString()
|
|
7422
|
-
},
|
|
7423
|
-
blockers: [organizationId.toString()],
|
|
7424
|
-
blocks: []
|
|
7425
|
-
});
|
|
7426
|
-
formRevisions = formRevisions.concat(organizationFormRevisions);
|
|
7427
|
-
this.dispatch(initializeFormRevisions(formRevisions));
|
|
7428
|
-
}
|
|
7429
|
-
}
|
|
7430
|
-
class AssetTypeFieldsAttachmentService extends BaseUploadService {
|
|
7431
|
-
async bulkAdd(payloads) {
|
|
7432
|
-
var _a2;
|
|
7433
|
-
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7434
|
-
const createdBy = (_a2 = this.client.store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
7435
|
-
const filePayloads = {};
|
|
7436
|
-
const offlineAssetTypeFieldsAttachments = [];
|
|
7437
|
-
const attachmentPayloads = [];
|
|
7438
|
-
for (const payload of payloads) {
|
|
7439
|
-
const { fieldsRevisionId, fieldIdentifier, file } = payload;
|
|
7440
|
-
const filePayload = await this.getFilePayload(file);
|
|
7441
|
-
if (!(filePayload.sha1 in filePayloads))
|
|
7442
|
-
filePayloads[filePayload.sha1] = filePayload;
|
|
7443
|
-
const offlineAssetTypeFieldsAttachment = offline({
|
|
7444
|
-
file: URL.createObjectURL(file),
|
|
7445
|
-
file_type: file.type,
|
|
7446
|
-
file_name: file.name,
|
|
7447
|
-
file_sha1: filePayload.sha1,
|
|
7448
|
-
created_by: createdBy,
|
|
7449
|
-
fields_revision: fieldsRevisionId,
|
|
7450
|
-
submitted_at: submittedAt,
|
|
7451
|
-
field_identifier: fieldIdentifier
|
|
7452
|
-
});
|
|
7453
|
-
offlineAssetTypeFieldsAttachments.push(offlineAssetTypeFieldsAttachment);
|
|
7454
|
-
const attachmentPayload = {
|
|
7455
|
-
offline_id: offlineAssetTypeFieldsAttachment.offline_id,
|
|
7456
|
-
file_name: file.name,
|
|
7457
|
-
field_identifier: fieldIdentifier,
|
|
7458
|
-
file_extension: filePayload.extension,
|
|
7459
|
-
file_sha1: filePayload.sha1,
|
|
7460
|
-
fields_revision: fieldsRevisionId
|
|
7461
|
-
};
|
|
7462
|
-
attachmentPayloads.push(attachmentPayload);
|
|
7463
|
-
}
|
|
7464
|
-
this.dispatch(addAssetTypeFieldsAttachments(offlineAssetTypeFieldsAttachments));
|
|
7465
|
-
const promise = this.enqueueRequest({
|
|
7466
|
-
description: "Add asset type fields attachments",
|
|
7467
|
-
method: HttpMethod.POST,
|
|
7468
|
-
url: "/asset-type-fields-attachments/bulk/",
|
|
7469
|
-
payload: {
|
|
7470
|
-
submitted_at: submittedAt,
|
|
7471
|
-
attachments: attachmentPayloads,
|
|
7472
|
-
files: Object.values(filePayloads)
|
|
7473
|
-
},
|
|
7474
|
-
blockers: offlineAssetTypeFieldsAttachments.map((attachment) => attachment.fields_revision),
|
|
7475
|
-
blocks: offlineAssetTypeFieldsAttachments.map((attachment) => attachment.offline_id)
|
|
7476
|
-
});
|
|
7477
|
-
promise.then((result) => {
|
|
7478
|
-
this.processPresignedUrls(result.presigned_urls);
|
|
7479
|
-
this.dispatch(updateAssetTypeFieldsAttachments(result.attachments));
|
|
7480
|
-
}).catch(() => {
|
|
7481
|
-
this.dispatch(
|
|
7482
|
-
deleteAssetTypeFieldsAttachments(
|
|
7483
|
-
offlineAssetTypeFieldsAttachments.map((attachment) => attachment.offline_id)
|
|
7484
|
-
)
|
|
7485
|
-
);
|
|
7486
|
-
});
|
|
7487
|
-
return [offlineAssetTypeFieldsAttachments, promise.then(({ attachments }) => attachments)];
|
|
7488
|
-
}
|
|
7489
|
-
async refreshStore(projectId) {
|
|
7490
|
-
const result = await this.enqueueRequest({
|
|
7491
|
-
description: "get asset type fields attachments",
|
|
7492
|
-
method: HttpMethod.GET,
|
|
7493
|
-
url: "/asset-type-fields-attachments/",
|
|
7494
|
-
queryParams: {
|
|
7495
|
-
project: projectId.toString()
|
|
7496
|
-
},
|
|
7497
|
-
blockers: [projectId.toString()],
|
|
7498
|
-
blocks: []
|
|
7499
|
-
});
|
|
7500
|
-
this.dispatch(initializeAssetTypeFieldsAttachments(result));
|
|
7501
|
-
}
|
|
7502
|
-
}
|
|
7503
|
-
class AssetTypeFieldsService extends BaseApiService {
|
|
7504
|
-
add(payload) {
|
|
7505
|
-
var _a2;
|
|
7506
|
-
const { store } = this.client;
|
|
7507
|
-
const createdBy = (_a2 = store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
7508
|
-
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7509
|
-
const offlineAssetTypeFields = offline({
|
|
7510
|
-
...payload,
|
|
7511
|
-
created_by: createdBy,
|
|
7512
|
-
submitted_at: submittedAt
|
|
7513
|
-
});
|
|
7514
|
-
this.dispatch(addAssetTypeFields(offlineAssetTypeFields));
|
|
7515
|
-
const promise = this.enqueueRequest({
|
|
7516
|
-
description: "Add Asset Type Fields",
|
|
7517
|
-
method: HttpMethod.POST,
|
|
7518
|
-
url: "/asset-type-fields/",
|
|
7519
|
-
payload: offlineAssetTypeFields,
|
|
7520
|
-
blockers: [offlineAssetTypeFields.asset_type],
|
|
7521
|
-
blocks: [offlineAssetTypeFields.offline_id]
|
|
7522
|
-
});
|
|
7523
|
-
promise.then((response) => {
|
|
7524
|
-
this.dispatch(updateAssetTypeFields(response));
|
|
7525
|
-
}).catch((error) => {
|
|
7526
|
-
this.dispatch(deleteAssetTypeFields(offlineAssetTypeFields.offline_id));
|
|
7527
|
-
throw error;
|
|
7528
|
-
});
|
|
7529
|
-
return [offlineAssetTypeFields, promise];
|
|
7530
|
-
}
|
|
7531
|
-
async refreshStore(projectId) {
|
|
7532
|
-
const result = await this.enqueueRequest({
|
|
7533
|
-
description: "Get Asset Type Fields",
|
|
7534
|
-
method: HttpMethod.GET,
|
|
7535
|
-
url: "/asset-type-fields/",
|
|
7536
|
-
queryParams: {
|
|
7537
|
-
project: projectId.toString()
|
|
7538
|
-
},
|
|
7539
|
-
blockers: [],
|
|
7540
|
-
blocks: []
|
|
7541
|
-
});
|
|
7542
|
-
this.dispatch(initializeAssetTypeFields(result));
|
|
7543
|
-
}
|
|
7544
|
-
}
|
|
7545
|
-
class AssetTypeFieldValuesService extends BaseApiService {
|
|
7546
|
-
add(payload) {
|
|
7547
|
-
var _a2;
|
|
7548
|
-
const { store } = this.client;
|
|
7549
|
-
const state = store.getState();
|
|
7550
|
-
const { values } = separateFilesFromValues(payload.values);
|
|
7551
|
-
const offlineAssetTypeFieldValues = offline({
|
|
7552
|
-
...payload,
|
|
7553
|
-
values,
|
|
7554
|
-
created_by: (_a2 = state.userReducer.currentUser) == null ? void 0 : _a2.id,
|
|
7555
|
-
submitted_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
7556
|
-
});
|
|
7557
|
-
const promise = this.enqueueRequest({
|
|
7558
|
-
description: "Add asset type field values",
|
|
7559
|
-
method: HttpMethod.POST,
|
|
7560
|
-
url: "/asset-type-field-values/",
|
|
7561
|
-
payload: offlineAssetTypeFieldValues,
|
|
7562
|
-
blockers: [payload.asset, payload.fields_revision],
|
|
7563
|
-
blocks: [offlineAssetTypeFieldValues.offline_id]
|
|
7564
|
-
});
|
|
7565
|
-
this.dispatch(addAssetTypeFieldValues(offlineAssetTypeFieldValues));
|
|
7566
|
-
promise.then((result) => {
|
|
7567
|
-
this.dispatch(updateAssetTypeFieldValues(result));
|
|
7568
|
-
return result;
|
|
7569
|
-
}).catch(() => {
|
|
7570
|
-
this.dispatch(deleteAssetTypeFieldValues(offlineAssetTypeFieldValues.offline_id));
|
|
7571
|
-
});
|
|
7572
|
-
return [offlineAssetTypeFieldValues, promise];
|
|
7573
|
-
}
|
|
7574
|
-
bulkAdd(payload, batchSize) {
|
|
7575
|
-
var _a2;
|
|
7576
|
-
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7577
|
-
const { values } = separateFilesFromValues(payload.values);
|
|
7578
|
-
const offlineAssetTypeFieldValuesMany = [];
|
|
7579
|
-
const batches = chunkArray(payload.payloads, batchSize ?? payload.payloads.length);
|
|
7580
|
-
const batchPayloads = [];
|
|
7581
|
-
for (const batch of batches) {
|
|
7582
|
-
const assetTypeFieldValuesPayloads = [];
|
|
7583
|
-
for (const payload2 of batch) {
|
|
7584
|
-
const offlineAssetTypeFieldValues = offline({
|
|
7585
|
-
...payload2,
|
|
7586
|
-
values: separateFilesFromValues(payload2.values).values,
|
|
7587
|
-
created_by: (_a2 = this.client.store.getState().userReducer.currentUser) == null ? void 0 : _a2.id,
|
|
7588
|
-
submitted_at: submittedAt
|
|
7589
|
-
});
|
|
7590
|
-
offlineAssetTypeFieldValuesMany.push(offlineAssetTypeFieldValues);
|
|
7591
|
-
assetTypeFieldValuesPayloads.push({
|
|
7592
|
-
offline_id: offlineAssetTypeFieldValues.offline_id,
|
|
7593
|
-
asset: payload2.asset,
|
|
7594
|
-
fields_revision: payload2.fields_revision,
|
|
7595
|
-
published_at: payload2.published_at,
|
|
7596
|
-
values: offlineAssetTypeFieldValues.values
|
|
7597
|
-
});
|
|
7598
|
-
}
|
|
7599
|
-
batchPayloads.push({
|
|
7600
|
-
submitted_at: submittedAt,
|
|
7601
|
-
values,
|
|
7602
|
-
field_values: assetTypeFieldValuesPayloads
|
|
7603
|
-
});
|
|
7604
|
-
}
|
|
7605
|
-
this.dispatch(addAssetTypeFieldValuesMany(offlineAssetTypeFieldValuesMany));
|
|
7606
|
-
const promises = [];
|
|
7607
|
-
for (const payload2 of batchPayloads) {
|
|
7608
|
-
const assetIds = payload2.field_values.map((x) => x.asset);
|
|
7609
|
-
const assetTypeFieldsIds = payload2.field_values.map((x) => x.fields_revision);
|
|
7610
|
-
const assetTypeFieldValuesIds = payload2.field_values.map((x) => x.offline_id);
|
|
7611
|
-
const promise = this.enqueueRequest({
|
|
7612
|
-
description: "Bulk add asset type field values",
|
|
7613
|
-
method: HttpMethod.POST,
|
|
7614
|
-
url: "/asset-type-field-values/bulk/",
|
|
7615
|
-
payload: payload2,
|
|
7616
|
-
blockers: [...assetIds, ...assetTypeFieldsIds],
|
|
7617
|
-
blocks: assetTypeFieldValuesIds
|
|
7618
|
-
});
|
|
7619
|
-
promises.push(promise);
|
|
7620
|
-
}
|
|
7621
|
-
void Promise.all(promises).then((results) => {
|
|
7622
|
-
this.dispatch(updateAssetTypeFieldValuesMany(results.flat()));
|
|
7623
|
-
}).catch(() => {
|
|
7624
|
-
this.dispatch(deleteAssetTypeFieldValuesMany(offlineAssetTypeFieldValuesMany.map((x) => x.offline_id)));
|
|
7625
|
-
});
|
|
7626
|
-
return [offlineAssetTypeFieldValuesMany, promises];
|
|
7627
|
-
}
|
|
7628
|
-
update(payload) {
|
|
7629
|
-
const { store } = this.client;
|
|
7630
|
-
const state = store.getState();
|
|
7631
|
-
const assetTypeFieldValues = selectAssetTypeFieldValuesById(payload.offline_id)(state);
|
|
7632
|
-
if (!assetTypeFieldValues) {
|
|
7633
|
-
throw new Error(`Expected AssetTypeFieldValues with offline_id ${payload.offline_id} to exist`);
|
|
7634
|
-
}
|
|
7635
|
-
const { values } = separateFilesFromValues(payload.values ?? {});
|
|
7636
|
-
const updatedAssetTypeFieldValues = {
|
|
7637
|
-
...assetTypeFieldValues,
|
|
7638
|
-
...payload,
|
|
7639
|
-
// values could also have a partial update
|
|
7640
|
-
values: {
|
|
7641
|
-
...assetTypeFieldValues.values,
|
|
7642
|
-
...values
|
|
7643
|
-
}
|
|
7644
|
-
};
|
|
7645
|
-
this.dispatch(updateAssetTypeFieldValues(updatedAssetTypeFieldValues));
|
|
7646
|
-
const promise = this.enqueueRequest({
|
|
7647
|
-
description: "Delete asset type field values",
|
|
7648
|
-
method: HttpMethod.PATCH,
|
|
7649
|
-
url: `/asset-type-field-values/${payload.offline_id}/`,
|
|
7650
|
-
payload,
|
|
7651
|
-
blockers: [
|
|
7652
|
-
updatedAssetTypeFieldValues.offline_id,
|
|
7653
|
-
updatedAssetTypeFieldValues.fields_revision,
|
|
7654
|
-
updatedAssetTypeFieldValues.asset
|
|
7655
|
-
],
|
|
7656
|
-
blocks: [updatedAssetTypeFieldValues.offline_id]
|
|
7657
|
-
});
|
|
7658
|
-
promise.then((result) => {
|
|
7659
|
-
this.dispatch(updateAssetTypeFieldValues(result));
|
|
7660
|
-
}).catch(() => {
|
|
7661
|
-
this.dispatch(updateAssetTypeFieldValues(assetTypeFieldValues));
|
|
7662
|
-
});
|
|
7663
|
-
return [updatedAssetTypeFieldValues, promise];
|
|
7664
|
-
}
|
|
7665
|
-
async delete(id) {
|
|
7666
|
-
const { store } = this.client;
|
|
7667
|
-
const state = store.getState();
|
|
7668
|
-
const assetTypeFieldValues = selectAssetTypeFieldValuesById(id)(state);
|
|
7669
|
-
if (!assetTypeFieldValues) {
|
|
7670
|
-
throw new Error(`Expected submission with offline_id ${id} to exist`);
|
|
7671
|
-
}
|
|
7672
|
-
const assetTypeFieldValuesAttachments = selectAttachmentsOfAssetTypeFieldValues(id)(state);
|
|
7673
|
-
this.dispatch(deleteAssetTypeFieldValues(id));
|
|
7674
|
-
this.dispatch(deleteAssetTypeFieldValuesAttachments(assetTypeFieldValuesAttachments.map((x) => x.offline_id)));
|
|
7675
|
-
try {
|
|
7676
|
-
await this.enqueueRequest({
|
|
7677
|
-
description: "Delete asset type field values",
|
|
7678
|
-
method: HttpMethod.DELETE,
|
|
7679
|
-
url: `/asset-type-field-values/${id}/`,
|
|
7680
|
-
blockers: [id],
|
|
7681
|
-
blocks: []
|
|
7682
|
-
});
|
|
7683
|
-
} catch (e) {
|
|
7684
|
-
this.dispatch(addAssetTypeFieldValues(assetTypeFieldValues));
|
|
7685
|
-
this.dispatch(addAssetTypeFieldValuesAttachments(assetTypeFieldValuesAttachments));
|
|
7686
|
-
throw e;
|
|
7687
|
-
}
|
|
7688
|
-
}
|
|
7689
|
-
async refreshStore(projectId) {
|
|
7690
|
-
const result = await this.enqueueRequest({
|
|
7691
|
-
description: "Get asset type field values",
|
|
7692
|
-
method: HttpMethod.GET,
|
|
7693
|
-
url: "/asset-type-field-values/",
|
|
7694
|
-
queryParams: {
|
|
7695
|
-
project: projectId.toString()
|
|
7696
|
-
},
|
|
7697
|
-
blockers: [],
|
|
7698
|
-
blocks: []
|
|
7699
|
-
});
|
|
7700
|
-
this.dispatch(initializeAssetTypeFieldValues(result));
|
|
7701
|
-
}
|
|
7702
|
-
}
|
|
7703
|
-
class AssetTypeFieldValuesAttachmentService extends BaseUploadService {
|
|
7704
|
-
async bulkAdd(payloads, batchSize) {
|
|
7705
|
-
var _a2;
|
|
7706
|
-
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7707
|
-
const createdBy = (_a2 = this.client.store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
7708
|
-
const batches = chunkArray(payloads, batchSize ?? payloads.length);
|
|
7709
|
-
const offlineAssetTypeFieldValuesAttachments = [];
|
|
7710
|
-
const batchPayloads = [];
|
|
7711
|
-
for (const batch of batches) {
|
|
7712
|
-
const filePayloads = {};
|
|
7713
|
-
const attachmentPayloads = [];
|
|
7714
|
-
for (const payload of batch) {
|
|
7715
|
-
const { fieldValuesId, fieldIdentifier, file } = payload;
|
|
7716
|
-
const filePayload = await this.getFilePayload(file);
|
|
7717
|
-
if (!(filePayload.sha1 in filePayloads))
|
|
7718
|
-
filePayloads[filePayload.sha1] = filePayload;
|
|
7719
|
-
const offlineAssetTypeFieldValuesAttachment = offline({
|
|
7720
|
-
file: URL.createObjectURL(file),
|
|
7721
|
-
file_type: file.type,
|
|
7722
|
-
file_name: file.name,
|
|
7723
|
-
file_sha1: filePayload.sha1,
|
|
7724
|
-
created_by: createdBy,
|
|
7725
|
-
field_values: fieldValuesId,
|
|
7726
|
-
submitted_at: submittedAt,
|
|
7727
|
-
field_identifier: fieldIdentifier
|
|
7728
|
-
});
|
|
7729
|
-
offlineAssetTypeFieldValuesAttachments.push(offlineAssetTypeFieldValuesAttachment);
|
|
7730
|
-
const attachmentPayload = {
|
|
7731
|
-
offline_id: offlineAssetTypeFieldValuesAttachment.offline_id,
|
|
7732
|
-
file_name: file.name,
|
|
7733
|
-
file_sha1: filePayload.sha1,
|
|
7734
|
-
file_extension: filePayload.extension,
|
|
7735
|
-
field_identifier: fieldIdentifier,
|
|
7736
|
-
field_values: fieldValuesId
|
|
7737
|
-
};
|
|
7738
|
-
attachmentPayloads.push(attachmentPayload);
|
|
7739
|
-
}
|
|
7740
|
-
batchPayloads.push({
|
|
7741
|
-
submitted_at: submittedAt,
|
|
7742
|
-
attachments: attachmentPayloads,
|
|
7743
|
-
files: Object.values(filePayloads)
|
|
7744
|
-
});
|
|
7745
|
-
}
|
|
7746
|
-
this.dispatch(addAssetTypeFieldValuesAttachments(offlineAssetTypeFieldValuesAttachments));
|
|
7747
|
-
const promises = batchPayloads.map((payload) => {
|
|
7748
|
-
return this.enqueueRequest({
|
|
7749
|
-
description: "Add asset type field values attachments",
|
|
7750
|
-
method: HttpMethod.POST,
|
|
7751
|
-
url: "/asset-type-field-values-attachments/bulk/",
|
|
7752
|
-
payload,
|
|
7753
|
-
blockers: payload.attachments.map((payload2) => payload2.field_values),
|
|
7754
|
-
blocks: payload.attachments.map((payload2) => payload2.offline_id)
|
|
7755
|
-
});
|
|
7756
|
-
});
|
|
7757
|
-
Promise.all(promises).then((result) => {
|
|
7758
|
-
for (const res of result)
|
|
7759
|
-
this.processPresignedUrls(res.presigned_urls);
|
|
7760
|
-
const attachments = result.flatMap((res) => res.attachments);
|
|
7761
|
-
this.dispatch(updateAssetTypeFieldValuesAttachments(attachments));
|
|
7762
|
-
}).catch((error) => {
|
|
7763
|
-
this.dispatch(
|
|
7764
|
-
deleteAssetTypeFieldValuesAttachments(
|
|
7765
|
-
offlineAssetTypeFieldValuesAttachments.map((attachment) => attachment.offline_id)
|
|
7766
|
-
)
|
|
7767
|
-
);
|
|
7768
|
-
throw error;
|
|
7769
|
-
});
|
|
7770
|
-
return [
|
|
7771
|
-
offlineAssetTypeFieldValuesAttachments,
|
|
7772
|
-
promises.map((promise) => promise.then(({ attachments }) => attachments))
|
|
7773
|
-
];
|
|
7774
|
-
}
|
|
7775
|
-
async bulkDelete(ids) {
|
|
7776
|
-
const { store } = this.client;
|
|
7777
|
-
const state = store.getState();
|
|
7778
|
-
const formSubmissionAttachments = selectFormSubmissionAttachemntsByIds(ids)(state);
|
|
7779
|
-
this.dispatch(deleteFormSubmissionAttachments(ids));
|
|
7780
|
-
try {
|
|
7781
|
-
await this.enqueueRequest({
|
|
7782
|
-
description: "Delete asset type field values attachments",
|
|
7783
|
-
method: HttpMethod.DELETE,
|
|
7784
|
-
url: "/asset-type-field-values-attachments/bulk/",
|
|
7785
|
-
payload: { attachment_ids: ids },
|
|
7786
|
-
blockers: ids,
|
|
7787
|
-
blocks: []
|
|
7788
|
-
});
|
|
7789
|
-
} catch (e) {
|
|
7790
|
-
this.dispatch(addFormSubmissionAttachments(formSubmissionAttachments));
|
|
7791
|
-
throw e;
|
|
7792
|
-
}
|
|
7793
|
-
}
|
|
7794
|
-
async refreshStore(projectId) {
|
|
7795
|
-
const result = await this.enqueueRequest({
|
|
7796
|
-
description: "Get asset type field values attachments",
|
|
7797
|
-
method: HttpMethod.GET,
|
|
7798
|
-
url: "/asset-type-field-values-attachments/",
|
|
7799
|
-
queryParams: {
|
|
7800
|
-
project: projectId.toString()
|
|
7801
|
-
},
|
|
7802
|
-
blockers: [],
|
|
7803
|
-
blocks: []
|
|
7804
|
-
});
|
|
7805
|
-
this.dispatch(initializeAssetTypeFieldValuesAttachments(result));
|
|
7806
|
-
}
|
|
7807
|
-
}
|
|
7808
|
-
class IssueTypeFieldsAttachmentService extends BaseUploadService {
|
|
7809
|
-
async bulkAdd(payloads) {
|
|
7810
|
-
var _a2;
|
|
7811
|
-
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7812
|
-
const createdBy = (_a2 = this.client.store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
7813
|
-
const filePayloads = {};
|
|
7814
|
-
const offlineIssueTypeFieldsAttachments = [];
|
|
7815
|
-
const attachmentPayloads = [];
|
|
7816
|
-
for (const payload of payloads) {
|
|
7817
|
-
const { fieldsRevisionId, fieldIdentifier, file } = payload;
|
|
7818
|
-
const filePayload = await this.getFilePayload(file);
|
|
7819
|
-
if (!(filePayload.sha1 in filePayloads))
|
|
7820
|
-
filePayloads[filePayload.sha1] = filePayload;
|
|
7821
|
-
const offlineIssueTypeFieldsAttachment = offline({
|
|
7822
|
-
file: URL.createObjectURL(file),
|
|
7823
|
-
file_type: file.type,
|
|
7824
|
-
file_name: file.name,
|
|
7825
|
-
file_sha1: filePayload.sha1,
|
|
7826
|
-
created_by: createdBy,
|
|
7827
|
-
fields_revision: fieldsRevisionId,
|
|
7828
|
-
submitted_at: submittedAt,
|
|
7829
|
-
field_identifier: fieldIdentifier
|
|
7830
|
-
});
|
|
7831
|
-
offlineIssueTypeFieldsAttachments.push(offlineIssueTypeFieldsAttachment);
|
|
7832
|
-
const attachmentPayload = {
|
|
7833
|
-
offline_id: offlineIssueTypeFieldsAttachment.offline_id,
|
|
7834
|
-
file_name: file.name,
|
|
7835
|
-
file_extension: filePayload.extension,
|
|
7836
|
-
field_identifier: fieldIdentifier,
|
|
7837
|
-
file_sha1: filePayload.sha1,
|
|
7838
|
-
fields_revision: fieldsRevisionId
|
|
7839
|
-
};
|
|
7840
|
-
attachmentPayloads.push(attachmentPayload);
|
|
7841
|
-
}
|
|
7842
|
-
this.dispatch(addIssueTypeFieldsAttachments(offlineIssueTypeFieldsAttachments));
|
|
7843
|
-
const promise = this.enqueueRequest({
|
|
7844
|
-
description: "Add issue type fields attachments",
|
|
7845
|
-
method: HttpMethod.POST,
|
|
7846
|
-
url: "/issue-type-fields-attachments/bulk/",
|
|
7847
|
-
payload: {
|
|
7848
|
-
submitted_at: submittedAt,
|
|
7849
|
-
attachments: attachmentPayloads,
|
|
7850
|
-
files: Object.values(filePayloads)
|
|
7851
|
-
},
|
|
7852
|
-
blockers: offlineIssueTypeFieldsAttachments.map((attachment) => attachment.fields_revision),
|
|
7853
|
-
blocks: offlineIssueTypeFieldsAttachments.map((attachment) => attachment.offline_id)
|
|
7854
|
-
});
|
|
7855
|
-
promise.then((result) => {
|
|
7856
|
-
this.processPresignedUrls(result.presigned_urls);
|
|
7857
|
-
this.dispatch(updateIssueTypeFieldsAttachments(result.attachments));
|
|
7858
|
-
}).catch(() => {
|
|
7859
|
-
this.dispatch(
|
|
7860
|
-
deleteIssueTypeFieldsAttachments(
|
|
7861
|
-
offlineIssueTypeFieldsAttachments.map((attachment) => attachment.offline_id)
|
|
7862
|
-
)
|
|
7863
|
-
);
|
|
7864
|
-
});
|
|
7865
|
-
return [offlineIssueTypeFieldsAttachments, promise.then(({ attachments }) => attachments)];
|
|
7866
|
-
}
|
|
7867
|
-
async refreshStore(organizationId) {
|
|
7868
|
-
const result = await this.enqueueRequest({
|
|
7869
|
-
description: "get issue type fields attachments",
|
|
7870
|
-
method: HttpMethod.GET,
|
|
7871
|
-
url: "/issue-type-fields-attachments/",
|
|
7872
|
-
queryParams: {
|
|
7873
|
-
organization: organizationId.toString()
|
|
7874
|
-
},
|
|
7875
|
-
blockers: [organizationId.toString()],
|
|
7876
|
-
blocks: []
|
|
7877
|
-
});
|
|
7878
|
-
this.dispatch(initializeIssueTypeFieldsAttachments(result));
|
|
7879
|
-
}
|
|
7880
|
-
}
|
|
7881
|
-
class IssueTypeFieldsService extends BaseApiService {
|
|
7882
|
-
add(payload) {
|
|
7883
|
-
var _a2;
|
|
7884
|
-
const { store } = this.client;
|
|
7885
|
-
const createdBy = (_a2 = store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
7886
|
-
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7887
|
-
const offlineIssueTypeFields = offline({
|
|
7888
|
-
...payload,
|
|
7889
|
-
created_by: createdBy,
|
|
7890
|
-
submitted_at: submittedAt
|
|
7891
|
-
});
|
|
7892
|
-
this.dispatch(addIssueTypeFields(offlineIssueTypeFields));
|
|
7893
|
-
const promise = this.enqueueRequest({
|
|
7894
|
-
description: "Add Issue Type Fields",
|
|
7895
|
-
method: HttpMethod.POST,
|
|
7896
|
-
url: "/issue-type-fields/",
|
|
7897
|
-
payload: offlineIssueTypeFields,
|
|
7898
|
-
blockers: [offlineIssueTypeFields.issue_type],
|
|
7899
|
-
blocks: [offlineIssueTypeFields.offline_id]
|
|
7900
|
-
});
|
|
7901
|
-
promise.then((response) => {
|
|
7902
|
-
this.dispatch(updateIssueTypeFields(response));
|
|
7903
|
-
}).catch((error) => {
|
|
7904
|
-
this.dispatch(deleteIssueTypeFields(offlineIssueTypeFields.offline_id));
|
|
7905
|
-
throw error;
|
|
7906
|
-
});
|
|
7907
|
-
return [offlineIssueTypeFields, promise];
|
|
7908
|
-
}
|
|
7909
|
-
async refreshStore(organizationId) {
|
|
7910
|
-
const result = await this.enqueueRequest({
|
|
7911
|
-
description: "Get Issue Type Fields",
|
|
7912
|
-
method: HttpMethod.GET,
|
|
7913
|
-
url: "/issue-type-fields/",
|
|
7914
|
-
queryParams: {
|
|
7915
|
-
organization: organizationId.toString()
|
|
7916
|
-
},
|
|
7917
|
-
blockers: [],
|
|
7918
|
-
blocks: []
|
|
7919
|
-
});
|
|
7920
|
-
this.dispatch(initializeIssueTypeFields(result));
|
|
7921
|
-
}
|
|
7922
|
-
}
|
|
7923
|
-
class IssueTypeFieldValuesAttachmentService extends BaseUploadService {
|
|
7924
|
-
async bulkAdd(payloads) {
|
|
7925
|
-
var _a2;
|
|
7926
|
-
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7927
|
-
const createdBy = (_a2 = this.client.store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
7928
|
-
const filePayloads = {};
|
|
7929
|
-
const offlineIssueTypeFieldValuesAttachments = [];
|
|
7930
|
-
const attachmentPayloads = [];
|
|
7931
|
-
for (const payload of payloads) {
|
|
7932
|
-
const { fieldValuesId, fieldIdentifier, file } = payload;
|
|
7933
|
-
const filePayload = await this.getFilePayload(file);
|
|
7934
|
-
if (!(filePayload.sha1 in filePayloads))
|
|
7935
|
-
filePayloads[filePayload.sha1] = filePayload;
|
|
7936
|
-
const offlineIssueTypeFieldValuesAttachment = offline({
|
|
7937
|
-
file: URL.createObjectURL(file),
|
|
7938
|
-
file_type: file.type,
|
|
7939
|
-
file_name: file.name,
|
|
7940
|
-
file_sha1: filePayload.sha1,
|
|
7941
|
-
created_by: createdBy,
|
|
7942
|
-
field_values: fieldValuesId,
|
|
7943
|
-
submitted_at: submittedAt,
|
|
7944
|
-
field_identifier: fieldIdentifier
|
|
7945
|
-
});
|
|
7946
|
-
offlineIssueTypeFieldValuesAttachments.push(offlineIssueTypeFieldValuesAttachment);
|
|
7947
|
-
const attachmentPayload = {
|
|
7948
|
-
offline_id: offlineIssueTypeFieldValuesAttachment.offline_id,
|
|
7949
|
-
file_name: file.name,
|
|
7950
|
-
file_sha1: filePayload.sha1,
|
|
7951
|
-
file_extension: filePayload.extension,
|
|
7952
|
-
field_identifier: fieldIdentifier,
|
|
7953
|
-
field_values: fieldValuesId
|
|
7954
|
-
};
|
|
7955
|
-
attachmentPayloads.push(attachmentPayload);
|
|
7956
|
-
}
|
|
7957
|
-
this.dispatch(addIssueTypeFieldValuesAttachments(offlineIssueTypeFieldValuesAttachments));
|
|
7958
|
-
const promise = this.enqueueRequest({
|
|
7959
|
-
description: "Add issue type field values attachments",
|
|
7960
|
-
method: HttpMethod.POST,
|
|
7961
|
-
url: "/issue-type-field-values-attachments/bulk/",
|
|
7962
|
-
payload: {
|
|
7963
|
-
submitted_at: submittedAt,
|
|
7964
|
-
attachments: attachmentPayloads,
|
|
7965
|
-
files: Object.values(filePayloads)
|
|
7966
|
-
},
|
|
7967
|
-
blockers: offlineIssueTypeFieldValuesAttachments.map((attachment) => attachment.field_values),
|
|
7968
|
-
blocks: offlineIssueTypeFieldValuesAttachments.map((attachment) => attachment.offline_id)
|
|
7969
|
-
});
|
|
7970
|
-
promise.then(({ presigned_urls, attachments }) => {
|
|
7971
|
-
this.processPresignedUrls(presigned_urls);
|
|
7972
|
-
this.dispatch(updateIssueTypeFieldValuesAttachments(attachments));
|
|
7973
|
-
}).catch((error) => {
|
|
7974
|
-
this.dispatch(
|
|
7975
|
-
deleteIssueTypeFieldValuesAttachments(
|
|
7976
|
-
offlineIssueTypeFieldValuesAttachments.map((attachment) => attachment.offline_id)
|
|
7977
|
-
)
|
|
7978
|
-
);
|
|
7979
|
-
throw error;
|
|
7980
|
-
});
|
|
7981
|
-
return [offlineIssueTypeFieldValuesAttachments, promise.then(({ attachments }) => attachments)];
|
|
7982
|
-
}
|
|
7983
|
-
async bulkDelete(attachmentsIds) {
|
|
7984
|
-
const { store } = this.client;
|
|
7985
|
-
const state = store.getState();
|
|
7986
|
-
const formSubmissionAttachments = selectFormSubmissionAttachemntsByIds(attachmentsIds)(state);
|
|
7987
|
-
this.dispatch(deleteFormSubmissionAttachments(attachmentsIds));
|
|
7988
|
-
try {
|
|
7989
|
-
await this.enqueueRequest({
|
|
7990
|
-
description: "Delete issue type field values attachments",
|
|
7991
|
-
method: HttpMethod.DELETE,
|
|
7992
|
-
url: "/issue-type-field-values-attachments/bulk/",
|
|
7993
|
-
payload: { attachment_ids: attachmentsIds },
|
|
7994
|
-
blockers: attachmentsIds,
|
|
7995
|
-
blocks: []
|
|
7996
|
-
});
|
|
7997
|
-
} catch (e) {
|
|
7998
|
-
this.dispatch(addFormSubmissionAttachments(formSubmissionAttachments));
|
|
7999
|
-
throw e;
|
|
8000
|
-
}
|
|
8001
|
-
}
|
|
8002
|
-
async refreshStore(projectId) {
|
|
8003
|
-
const result = await this.enqueueRequest({
|
|
8004
|
-
description: "Get issue type field values attachments",
|
|
8005
|
-
method: HttpMethod.GET,
|
|
8006
|
-
url: "/issue-type-field-values-attachments/",
|
|
8007
|
-
queryParams: {
|
|
8008
|
-
project: projectId.toString()
|
|
8009
|
-
},
|
|
8010
|
-
blockers: [],
|
|
8011
|
-
blocks: []
|
|
8012
|
-
});
|
|
8013
|
-
this.dispatch(initializeIssueTypeFieldValuesAttachments(result));
|
|
8014
|
-
}
|
|
8015
|
-
}
|
|
8016
|
-
class IssueTypeFieldValuesService extends BaseApiService {
|
|
8017
|
-
add(payload) {
|
|
8018
|
-
var _a2;
|
|
8019
|
-
const { store } = this.client;
|
|
8020
|
-
const state = store.getState();
|
|
8021
|
-
const { values } = separateFilesFromValues(payload.values);
|
|
8022
|
-
const offlineIssueTypeFieldValues = offline({
|
|
8023
|
-
...payload,
|
|
8024
|
-
values,
|
|
8025
|
-
created_by: (_a2 = state.userReducer.currentUser) == null ? void 0 : _a2.id,
|
|
8026
|
-
submitted_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
8027
|
-
});
|
|
8028
|
-
const promise = this.enqueueRequest({
|
|
8029
|
-
description: "Add issue type field values",
|
|
8030
|
-
method: HttpMethod.POST,
|
|
8031
|
-
url: "/issue-type-field-values/",
|
|
8032
|
-
payload: offlineIssueTypeFieldValues,
|
|
8033
|
-
blockers: [payload.issue, payload.fields_revision],
|
|
8034
|
-
blocks: [offlineIssueTypeFieldValues.offline_id]
|
|
8035
|
-
});
|
|
8036
|
-
this.dispatch(addIssueTypeFieldValues(offlineIssueTypeFieldValues));
|
|
8037
|
-
promise.then((result) => {
|
|
8038
|
-
this.dispatch(updateIssueTypeFieldValues(result));
|
|
8039
|
-
return result;
|
|
8040
|
-
}).catch(() => {
|
|
8041
|
-
this.dispatch(deleteIssueTypeFieldValues(offlineIssueTypeFieldValues.offline_id));
|
|
8042
|
-
});
|
|
8043
|
-
return [offlineIssueTypeFieldValues, promise];
|
|
8044
|
-
}
|
|
8045
|
-
update(payload) {
|
|
8046
|
-
const { store } = this.client;
|
|
8047
|
-
const state = store.getState();
|
|
8048
|
-
const issueTypeFieldValues = selectIssueTypeFieldValuesById(payload.offline_id)(state);
|
|
8049
|
-
if (!issueTypeFieldValues) {
|
|
8050
|
-
throw new Error(`Expected IssueTypeFieldValues with offline_id ${payload.offline_id} to exist`);
|
|
8051
|
-
}
|
|
8052
|
-
const { values } = separateFilesFromValues(payload.values ?? {});
|
|
8053
|
-
const updatedIssueTypeFieldValues = {
|
|
8054
|
-
...issueTypeFieldValues,
|
|
8055
|
-
...payload,
|
|
8056
|
-
// values could also have a partial update
|
|
8057
|
-
values: {
|
|
8058
|
-
...issueTypeFieldValues.values,
|
|
8059
|
-
...values
|
|
8060
|
-
}
|
|
8061
|
-
};
|
|
8062
|
-
this.dispatch(updateIssueTypeFieldValues(updatedIssueTypeFieldValues));
|
|
8063
|
-
const promise = this.enqueueRequest({
|
|
8064
|
-
description: "Update issue type field values",
|
|
8065
|
-
method: HttpMethod.PATCH,
|
|
8066
|
-
url: `/issue-type-field-values/${payload.offline_id}/`,
|
|
8067
|
-
payload,
|
|
8068
|
-
blockers: [
|
|
8069
|
-
updatedIssueTypeFieldValues.offline_id,
|
|
8070
|
-
updatedIssueTypeFieldValues.fields_revision,
|
|
8071
|
-
updatedIssueTypeFieldValues.issue
|
|
8072
|
-
],
|
|
8073
|
-
blocks: [updatedIssueTypeFieldValues.offline_id]
|
|
8074
|
-
});
|
|
8075
|
-
promise.then((result) => {
|
|
8076
|
-
this.dispatch(updateIssueTypeFieldValues(result));
|
|
8077
|
-
}).catch(() => {
|
|
8078
|
-
this.dispatch(updateIssueTypeFieldValues(issueTypeFieldValues));
|
|
8079
|
-
});
|
|
8080
|
-
return [updatedIssueTypeFieldValues, promise];
|
|
8081
|
-
}
|
|
8082
|
-
async delete(id) {
|
|
8083
|
-
const { store } = this.client;
|
|
8084
|
-
const state = store.getState();
|
|
8085
|
-
const issueTypeFieldValues = selectIssueTypeFieldValuesById(id)(state);
|
|
8086
|
-
if (!issueTypeFieldValues) {
|
|
8087
|
-
throw new Error(`Expected submission with offline_id ${id} to exist`);
|
|
8088
|
-
}
|
|
8089
|
-
const issueTypeFieldValuesAttachments = selectAttachmentsOfIssueTypeFieldValues(id)(state);
|
|
8090
|
-
this.dispatch(deleteIssueTypeFieldValues(id));
|
|
8091
|
-
this.dispatch(deleteIssueTypeFieldValuesAttachments(issueTypeFieldValuesAttachments.map((x) => x.offline_id)));
|
|
8092
|
-
try {
|
|
8093
|
-
await this.enqueueRequest({
|
|
8094
|
-
description: "Delete issue type field values",
|
|
8095
|
-
method: HttpMethod.DELETE,
|
|
8096
|
-
url: `/issue-type-field-values/${id}/`,
|
|
8097
|
-
blockers: [id],
|
|
8098
|
-
blocks: []
|
|
8099
|
-
});
|
|
8100
|
-
} catch (e) {
|
|
8101
|
-
this.dispatch(addIssueTypeFieldValues(issueTypeFieldValues));
|
|
8102
|
-
this.dispatch(addIssueTypeFieldValuesAttachments(issueTypeFieldValuesAttachments));
|
|
8103
|
-
throw e;
|
|
8104
|
-
}
|
|
8105
|
-
}
|
|
8106
|
-
async refreshStore(projectId) {
|
|
8107
|
-
const result = await this.enqueueRequest({
|
|
8108
|
-
description: "Get issue type field values",
|
|
8109
|
-
method: HttpMethod.GET,
|
|
8110
|
-
url: "/issue-type-field-values/",
|
|
8111
|
-
queryParams: {
|
|
8112
|
-
project: projectId.toString()
|
|
8113
|
-
},
|
|
8114
|
-
blockers: [],
|
|
8115
|
-
blocks: []
|
|
8116
|
-
});
|
|
8117
|
-
this.dispatch(initializeIssueTypeFieldValues(result));
|
|
8118
|
-
}
|
|
8119
|
-
}
|
|
8120
7278
|
var VerificationCodeType = /* @__PURE__ */ ((VerificationCodeType2) => {
|
|
8121
7279
|
VerificationCodeType2[VerificationCodeType2["USER_REGISTRATION"] = 0] = "USER_REGISTRATION";
|
|
8122
7280
|
VerificationCodeType2[VerificationCodeType2["APPLICATION_INVITE"] = 2] = "APPLICATION_INVITE";
|
|
@@ -8134,10 +7292,6 @@ export {
|
|
|
8134
7292
|
AssetStageCompletionService,
|
|
8135
7293
|
AssetStageService,
|
|
8136
7294
|
AssetTypeAttachmentService,
|
|
8137
|
-
AssetTypeFieldValuesAttachmentService,
|
|
8138
|
-
AssetTypeFieldValuesService,
|
|
8139
|
-
AssetTypeFieldsAttachmentService,
|
|
8140
|
-
AssetTypeFieldsService,
|
|
8141
7295
|
AssetTypeService,
|
|
8142
7296
|
AttachmentModel,
|
|
8143
7297
|
BaseApiService,
|
|
@@ -8153,10 +7307,7 @@ export {
|
|
|
8153
7307
|
EmailDomainsService,
|
|
8154
7308
|
EmailVerificationService,
|
|
8155
7309
|
FileService,
|
|
8156
|
-
FormRevisionAttachmentService,
|
|
8157
|
-
FormRevisionService,
|
|
8158
7310
|
FormService,
|
|
8159
|
-
FormSubmissionAttachmentService,
|
|
8160
7311
|
FormSubmissionService,
|
|
8161
7312
|
GREEN,
|
|
8162
7313
|
GeoImageService,
|
|
@@ -8167,10 +7318,6 @@ export {
|
|
|
8167
7318
|
IssuePriority,
|
|
8168
7319
|
IssueService,
|
|
8169
7320
|
IssueStatus,
|
|
8170
|
-
IssueTypeFieldValuesAttachmentService,
|
|
8171
|
-
IssueTypeFieldValuesService,
|
|
8172
|
-
IssueTypeFieldsAttachmentService,
|
|
8173
|
-
IssueTypeFieldsService,
|
|
8174
7321
|
IssueTypeService,
|
|
8175
7322
|
IssueUpdateChange,
|
|
8176
7323
|
IssueUpdateService,
|
|
@@ -8210,14 +7357,6 @@ export {
|
|
|
8210
7357
|
addAssetType,
|
|
8211
7358
|
addAssetTypeAttachment,
|
|
8212
7359
|
addAssetTypeAttachments,
|
|
8213
|
-
addAssetTypeFieldValues,
|
|
8214
|
-
addAssetTypeFieldValuesAttachment,
|
|
8215
|
-
addAssetTypeFieldValuesAttachments,
|
|
8216
|
-
addAssetTypeFieldValuesMany,
|
|
8217
|
-
addAssetTypeFields,
|
|
8218
|
-
addAssetTypeFieldsAttachment,
|
|
8219
|
-
addAssetTypeFieldsAttachments,
|
|
8220
|
-
addAssetTypeFieldsMany,
|
|
8221
7360
|
addAssetTypes,
|
|
8222
7361
|
addAssets,
|
|
8223
7362
|
addCategory,
|
|
@@ -8246,14 +7385,6 @@ export {
|
|
|
8246
7385
|
addIssueComment,
|
|
8247
7386
|
addIssueComments,
|
|
8248
7387
|
addIssueType,
|
|
8249
|
-
addIssueTypeFieldValues,
|
|
8250
|
-
addIssueTypeFieldValuesAttachment,
|
|
8251
|
-
addIssueTypeFieldValuesAttachments,
|
|
8252
|
-
addIssueTypeFieldValuesMany,
|
|
8253
|
-
addIssueTypeFields,
|
|
8254
|
-
addIssueTypeFieldsAttachment,
|
|
8255
|
-
addIssueTypeFieldsAttachments,
|
|
8256
|
-
addIssueTypeFieldsMany,
|
|
8257
7388
|
addIssueUpdate,
|
|
8258
7389
|
addIssueUpdates,
|
|
8259
7390
|
addIssues,
|
|
@@ -8279,28 +7410,16 @@ export {
|
|
|
8279
7410
|
assetStageSlice,
|
|
8280
7411
|
assetTypeAttachmentReducer,
|
|
8281
7412
|
assetTypeAttachmentSlice,
|
|
8282
|
-
assetTypeFieldValuesAttachmentReducer,
|
|
8283
|
-
assetTypeFieldValuesAttachmentSlice,
|
|
8284
|
-
assetTypeFieldValuesReducer,
|
|
8285
|
-
assetTypeFieldValuesSlice,
|
|
8286
|
-
assetTypeFieldsAttachmentReducer,
|
|
8287
|
-
assetTypeFieldsAttachmentSlice,
|
|
8288
|
-
assetTypeFieldsReducer,
|
|
8289
|
-
assetTypeFieldsSlice,
|
|
8290
7413
|
assetTypeReducer,
|
|
8291
7414
|
assetTypeSlice,
|
|
8292
7415
|
authReducer,
|
|
8293
7416
|
authSlice,
|
|
8294
7417
|
blobToBase64,
|
|
8295
|
-
boundsContainPoint,
|
|
8296
7418
|
categoryReducer,
|
|
8297
7419
|
categorySlice,
|
|
8298
7420
|
clearTokens,
|
|
8299
7421
|
constructUploadedFilePayloads,
|
|
8300
7422
|
coordinatesAreEqual,
|
|
8301
|
-
coordinatesToLiteral,
|
|
8302
|
-
coordinatesToText,
|
|
8303
|
-
coordinatesToUrlText,
|
|
8304
7423
|
createMultiPointGeometry,
|
|
8305
7424
|
createOfflineAction,
|
|
8306
7425
|
createPointGeometry,
|
|
@@ -8315,14 +7434,6 @@ export {
|
|
|
8315
7434
|
deleteAssetType,
|
|
8316
7435
|
deleteAssetTypeAttachment,
|
|
8317
7436
|
deleteAssetTypeAttachments,
|
|
8318
|
-
deleteAssetTypeFieldValues,
|
|
8319
|
-
deleteAssetTypeFieldValuesAttachment,
|
|
8320
|
-
deleteAssetTypeFieldValuesAttachments,
|
|
8321
|
-
deleteAssetTypeFieldValuesMany,
|
|
8322
|
-
deleteAssetTypeFields,
|
|
8323
|
-
deleteAssetTypeFieldsAttachment,
|
|
8324
|
-
deleteAssetTypeFieldsAttachments,
|
|
8325
|
-
deleteAssetTypeFieldsMany,
|
|
8326
7437
|
deleteAssetTypes,
|
|
8327
7438
|
deleteAssets,
|
|
8328
7439
|
deleteCategory,
|
|
@@ -8347,14 +7458,6 @@ export {
|
|
|
8347
7458
|
deleteIssueAttachments,
|
|
8348
7459
|
deleteIssueComment,
|
|
8349
7460
|
deleteIssueComments,
|
|
8350
|
-
deleteIssueTypeFieldValues,
|
|
8351
|
-
deleteIssueTypeFieldValuesAttachment,
|
|
8352
|
-
deleteIssueTypeFieldValuesAttachments,
|
|
8353
|
-
deleteIssueTypeFieldValuesMany,
|
|
8354
|
-
deleteIssueTypeFields,
|
|
8355
|
-
deleteIssueTypeFieldsAttachment,
|
|
8356
|
-
deleteIssueTypeFieldsAttachments,
|
|
8357
|
-
deleteIssueTypeFieldsMany,
|
|
8358
7461
|
deleteIssueUpdate,
|
|
8359
7462
|
deleteIssueUpdates,
|
|
8360
7463
|
deleteIssues,
|
|
@@ -8384,8 +7487,6 @@ export {
|
|
|
8384
7487
|
fileReducer,
|
|
8385
7488
|
fileSlice,
|
|
8386
7489
|
fileToBlob,
|
|
8387
|
-
flipBounds,
|
|
8388
|
-
flipCoordinates,
|
|
8389
7490
|
formReducer,
|
|
8390
7491
|
formRevisionAttachmentReducer,
|
|
8391
7492
|
formRevisionAttachmentSlice,
|
|
@@ -8411,10 +7512,6 @@ export {
|
|
|
8411
7512
|
initializeAssetStageCompletions,
|
|
8412
7513
|
initializeAssetStages,
|
|
8413
7514
|
initializeAssetTypeAttachments,
|
|
8414
|
-
initializeAssetTypeFieldValues,
|
|
8415
|
-
initializeAssetTypeFieldValuesAttachments,
|
|
8416
|
-
initializeAssetTypeFields,
|
|
8417
|
-
initializeAssetTypeFieldsAttachments,
|
|
8418
7515
|
initializeAssetTypes,
|
|
8419
7516
|
initializeAssets,
|
|
8420
7517
|
initializeCategories,
|
|
@@ -8429,10 +7526,6 @@ export {
|
|
|
8429
7526
|
initializeGeoImages,
|
|
8430
7527
|
initializeIssueAssociations,
|
|
8431
7528
|
initializeIssueAttachments,
|
|
8432
|
-
initializeIssueTypeFieldValues,
|
|
8433
|
-
initializeIssueTypeFieldValuesAttachments,
|
|
8434
|
-
initializeIssueTypeFields,
|
|
8435
|
-
initializeIssueTypeFieldsAttachments,
|
|
8436
7529
|
initializeIssueTypes,
|
|
8437
7530
|
initializeIssueUpdates,
|
|
8438
7531
|
initializeIssues,
|
|
@@ -8451,32 +7544,20 @@ export {
|
|
|
8451
7544
|
issueCommentSlice,
|
|
8452
7545
|
issueReducer,
|
|
8453
7546
|
issueSlice,
|
|
8454
|
-
issueTypeFieldValuesAttachmentReducer,
|
|
8455
|
-
issueTypeFieldValuesAttachmentSlice,
|
|
8456
|
-
issueTypeFieldValuesReducer,
|
|
8457
|
-
issueTypeFieldValuesSlice,
|
|
8458
|
-
issueTypeFieldsAttachmentReducer,
|
|
8459
|
-
issueTypeFieldsAttachmentSlice,
|
|
8460
|
-
issueTypeFieldsReducer,
|
|
8461
|
-
issueTypeFieldsSlice,
|
|
8462
7547
|
issueTypeReducer,
|
|
8463
7548
|
issueTypeSlice,
|
|
8464
7549
|
issueUpdateReducer,
|
|
8465
7550
|
issueUpdateSlice,
|
|
8466
7551
|
licenseReducer,
|
|
8467
7552
|
licenseSlice,
|
|
8468
|
-
literalToCoordinates,
|
|
8469
7553
|
logOnlyOnce,
|
|
8470
7554
|
markAsDeleted,
|
|
8471
7555
|
markForDeletion,
|
|
8472
7556
|
memoize,
|
|
8473
7557
|
moveDocument,
|
|
8474
7558
|
offline,
|
|
8475
|
-
offsetPositionByMeters,
|
|
8476
7559
|
onlyUniqueHashes,
|
|
8477
7560
|
onlyUniqueOfflineIds,
|
|
8478
|
-
openCoordsInGoogleMaps,
|
|
8479
|
-
openDirectionsInGoogleMaps,
|
|
8480
7561
|
organizationAccessReducer,
|
|
8481
7562
|
organizationAccessSlice,
|
|
8482
7563
|
organizationReducer,
|
|
@@ -8531,22 +7612,7 @@ export {
|
|
|
8531
7612
|
selectAssetTypeAttachmentMapping,
|
|
8532
7613
|
selectAssetTypeAttachments,
|
|
8533
7614
|
selectAssetTypeById,
|
|
8534
|
-
selectAssetTypeFieldValues,
|
|
8535
|
-
selectAssetTypeFieldValuesAttachmentById,
|
|
8536
|
-
selectAssetTypeFieldValuesAttachments,
|
|
8537
|
-
selectAssetTypeFieldValuesAttachmentsMapping,
|
|
8538
|
-
selectAssetTypeFieldValuesById,
|
|
8539
|
-
selectAssetTypeFieldValuesMapping,
|
|
8540
|
-
selectAssetTypeFieldValuesOfAsset,
|
|
8541
|
-
selectAssetTypeFields,
|
|
8542
|
-
selectAssetTypeFieldsAttachmentById,
|
|
8543
|
-
selectAssetTypeFieldsAttachments,
|
|
8544
|
-
selectAssetTypeFieldsAttachmentsMapping,
|
|
8545
|
-
selectAssetTypeFieldsById,
|
|
8546
|
-
selectAssetTypeFieldsMapping,
|
|
8547
|
-
selectAssetTypeFieldsOfAssetType,
|
|
8548
7615
|
selectAssetTypeStagesMapping,
|
|
8549
|
-
selectAssetTypeValuesOfAssetType,
|
|
8550
7616
|
selectAssetTypes,
|
|
8551
7617
|
selectAssetTypesByIds,
|
|
8552
7618
|
selectAssetTypesMapping,
|
|
@@ -8554,20 +7620,18 @@ export {
|
|
|
8554
7620
|
selectAssetsByIds,
|
|
8555
7621
|
selectAssetsMapping,
|
|
8556
7622
|
selectAssetsOfAssetType,
|
|
7623
|
+
selectAttachedFormSubmissionsOfAsset,
|
|
7624
|
+
selectAttachedFormSubmissionsOfIssue,
|
|
8557
7625
|
selectAttachmentsOfAsset,
|
|
8558
7626
|
selectAttachmentsOfAssetByType,
|
|
8559
7627
|
selectAttachmentsOfAssetType,
|
|
8560
7628
|
selectAttachmentsOfAssetTypeByType,
|
|
8561
|
-
selectAttachmentsOfAssetTypeFieldValues,
|
|
8562
|
-
selectAttachmentsOfAssetTypeFields,
|
|
8563
7629
|
selectAttachmentsOfDocument,
|
|
8564
7630
|
selectAttachmentsOfDocumentByType,
|
|
8565
7631
|
selectAttachmentsOfFormRevision,
|
|
8566
7632
|
selectAttachmentsOfFormSubmission,
|
|
8567
7633
|
selectAttachmentsOfIssue,
|
|
8568
7634
|
selectAttachmentsOfIssueByType,
|
|
8569
|
-
selectAttachmentsOfIssueTypeFieldValues,
|
|
8570
|
-
selectAttachmentsOfIssueTypeFields,
|
|
8571
7635
|
selectAttachmentsOfProject,
|
|
8572
7636
|
selectAttachmentsOfProjectByType,
|
|
8573
7637
|
selectCategories,
|
|
@@ -8595,6 +7659,8 @@ export {
|
|
|
8595
7659
|
selectFilteredForms,
|
|
8596
7660
|
selectFormById,
|
|
8597
7661
|
selectFormMapping,
|
|
7662
|
+
selectFormOfAssetType,
|
|
7663
|
+
selectFormOfIssueType,
|
|
8598
7664
|
selectFormRevisionAttachmentsMapping,
|
|
8599
7665
|
selectFormRevisionById,
|
|
8600
7666
|
selectFormRevisionMapping,
|
|
@@ -8604,11 +7670,16 @@ export {
|
|
|
8604
7670
|
selectFormSubmissionAttachmentsMapping,
|
|
8605
7671
|
selectFormSubmissionById,
|
|
8606
7672
|
selectFormSubmissions,
|
|
7673
|
+
selectFormSubmissionsByAssets,
|
|
7674
|
+
selectFormSubmissionsByFormRevisions,
|
|
7675
|
+
selectFormSubmissionsByIssues,
|
|
8607
7676
|
selectFormSubmissionsMapping,
|
|
8608
7677
|
selectFormSubmissionsOfAsset,
|
|
8609
7678
|
selectFormSubmissionsOfForm,
|
|
8610
7679
|
selectFormSubmissionsOfIssue,
|
|
8611
7680
|
selectForms,
|
|
7681
|
+
selectFormsCount,
|
|
7682
|
+
selectGeneralFormCount,
|
|
8612
7683
|
selectGeoImageById,
|
|
8613
7684
|
selectGeoImageMapping,
|
|
8614
7685
|
selectGeoImages,
|
|
@@ -8630,22 +7701,7 @@ export {
|
|
|
8630
7701
|
selectIssueCountOfCategory,
|
|
8631
7702
|
selectIssueMapping,
|
|
8632
7703
|
selectIssueTypeById,
|
|
8633
|
-
selectIssueTypeFieldValues,
|
|
8634
|
-
selectIssueTypeFieldValuesAttachmentById,
|
|
8635
|
-
selectIssueTypeFieldValuesAttachments,
|
|
8636
|
-
selectIssueTypeFieldValuesAttachmentsMapping,
|
|
8637
|
-
selectIssueTypeFieldValuesById,
|
|
8638
|
-
selectIssueTypeFieldValuesMapping,
|
|
8639
|
-
selectIssueTypeFieldValuesOfIssue,
|
|
8640
|
-
selectIssueTypeFields,
|
|
8641
|
-
selectIssueTypeFieldsAttachmentById,
|
|
8642
|
-
selectIssueTypeFieldsAttachments,
|
|
8643
|
-
selectIssueTypeFieldsAttachmentsMapping,
|
|
8644
|
-
selectIssueTypeFieldsById,
|
|
8645
|
-
selectIssueTypeFieldsMapping,
|
|
8646
|
-
selectIssueTypeFieldsOfIssueType,
|
|
8647
7704
|
selectIssueTypeMapping,
|
|
8648
|
-
selectIssueTypeValuesOfIssueType,
|
|
8649
7705
|
selectIssueTypes,
|
|
8650
7706
|
selectIssueTypesByIds,
|
|
8651
7707
|
selectIssueTypesOfOrganization,
|
|
@@ -8654,9 +7710,8 @@ export {
|
|
|
8654
7710
|
selectIssuesByIds,
|
|
8655
7711
|
selectIssuesOfIssueType,
|
|
8656
7712
|
selectIssuesOfIssueTypeCount,
|
|
8657
|
-
|
|
7713
|
+
selectLatestFormRevisionByForm,
|
|
8658
7714
|
selectLatestFormRevisionOfForm,
|
|
8659
|
-
selectLatestIssueTypeFieldsOfIssueType,
|
|
8660
7715
|
selectLatestRetryTime,
|
|
8661
7716
|
selectLicense,
|
|
8662
7717
|
selectLicenseForProject,
|
|
@@ -8693,6 +7748,7 @@ export {
|
|
|
8693
7748
|
selectProjectsOfOrganization,
|
|
8694
7749
|
selectRehydrated,
|
|
8695
7750
|
selectRootDocuments,
|
|
7751
|
+
selectSortedFormSubmissionsOfForm,
|
|
8696
7752
|
selectSortedOrganizationUsers,
|
|
8697
7753
|
selectSortedProjectUsers,
|
|
8698
7754
|
selectStageFormIdsFromStageIds,
|
|
@@ -8711,8 +7767,6 @@ export {
|
|
|
8711
7767
|
selectWorkspaceById,
|
|
8712
7768
|
selectWorkspaceMapping,
|
|
8713
7769
|
selectWorkspaces,
|
|
8714
|
-
separateFilesFromValues,
|
|
8715
|
-
separateImageFromFields,
|
|
8716
7770
|
setActiveProjectFileId,
|
|
8717
7771
|
setActiveProjectId,
|
|
8718
7772
|
setAsset,
|
|
@@ -8723,14 +7777,6 @@ export {
|
|
|
8723
7777
|
setAssetType,
|
|
8724
7778
|
setAssetTypeAttachment,
|
|
8725
7779
|
setAssetTypeAttachments,
|
|
8726
|
-
setAssetTypeFieldValues,
|
|
8727
|
-
setAssetTypeFieldValuesAttachment,
|
|
8728
|
-
setAssetTypeFieldValuesAttachments,
|
|
8729
|
-
setAssetTypeFieldValuesMany,
|
|
8730
|
-
setAssetTypeFields,
|
|
8731
|
-
setAssetTypeFieldsAttachment,
|
|
8732
|
-
setAssetTypeFieldsAttachments,
|
|
8733
|
-
setAssetTypeFieldsMany,
|
|
8734
7780
|
setAssetTypes,
|
|
8735
7781
|
setAssets,
|
|
8736
7782
|
setConversation,
|
|
@@ -8756,14 +7802,6 @@ export {
|
|
|
8756
7802
|
setIssueComment,
|
|
8757
7803
|
setIssueComments,
|
|
8758
7804
|
setIssueType,
|
|
8759
|
-
setIssueTypeFieldValues,
|
|
8760
|
-
setIssueTypeFieldValuesAttachment,
|
|
8761
|
-
setIssueTypeFieldValuesAttachments,
|
|
8762
|
-
setIssueTypeFieldValuesMany,
|
|
8763
|
-
setIssueTypeFields,
|
|
8764
|
-
setIssueTypeFieldsAttachment,
|
|
8765
|
-
setIssueTypeFieldsAttachments,
|
|
8766
|
-
setIssueTypeFieldsMany,
|
|
8767
7805
|
setIssueUpdate,
|
|
8768
7806
|
setLoggedIn,
|
|
8769
7807
|
setOrganizations,
|
|
@@ -8796,14 +7834,6 @@ export {
|
|
|
8796
7834
|
updateAssetType,
|
|
8797
7835
|
updateAssetTypeAttachment,
|
|
8798
7836
|
updateAssetTypeAttachments,
|
|
8799
|
-
updateAssetTypeFieldValues,
|
|
8800
|
-
updateAssetTypeFieldValuesAttachment,
|
|
8801
|
-
updateAssetTypeFieldValuesAttachments,
|
|
8802
|
-
updateAssetTypeFieldValuesMany,
|
|
8803
|
-
updateAssetTypeFields,
|
|
8804
|
-
updateAssetTypeFieldsAttachment,
|
|
8805
|
-
updateAssetTypeFieldsAttachments,
|
|
8806
|
-
updateAssetTypeFieldsMany,
|
|
8807
7837
|
updateAssetTypes,
|
|
8808
7838
|
updateAssets,
|
|
8809
7839
|
updateCategory,
|
|
@@ -8826,14 +7856,6 @@ export {
|
|
|
8826
7856
|
updateIssueAttachment,
|
|
8827
7857
|
updateIssueAttachments,
|
|
8828
7858
|
updateIssueType,
|
|
8829
|
-
updateIssueTypeFieldValues,
|
|
8830
|
-
updateIssueTypeFieldValuesAttachment,
|
|
8831
|
-
updateIssueTypeFieldValuesAttachments,
|
|
8832
|
-
updateIssueTypeFieldValuesMany,
|
|
8833
|
-
updateIssueTypeFields,
|
|
8834
|
-
updateIssueTypeFieldsAttachment,
|
|
8835
|
-
updateIssueTypeFieldsAttachments,
|
|
8836
|
-
updateIssueTypeFieldsMany,
|
|
8837
7859
|
updateLicense,
|
|
8838
7860
|
updateOrCreateProject,
|
|
8839
7861
|
updateOrganizationAccess,
|
|
@@ -8848,7 +7870,6 @@ export {
|
|
|
8848
7870
|
versioningSlice,
|
|
8849
7871
|
warningColor,
|
|
8850
7872
|
workspaceReducer,
|
|
8851
|
-
workspaceSlice
|
|
8852
|
-
worldBounds
|
|
7873
|
+
workspaceSlice
|
|
8853
7874
|
};
|
|
8854
7875
|
//# sourceMappingURL=overmap-core.js.map
|