@overmap-ai/core 1.0.71-fields.9 → 1.0.71-mapbox.1
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 +1038 -2009
- package/dist/overmap-core.js.map +1 -1
- package/dist/overmap-core.umd.cjs +1038 -2009
- 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 -8
- 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,8 +4946,16 @@ class IssueTypeService extends BaseApiService {
|
|
|
5276
4946
|
this.dispatch(addIssueType(offlineIssueType));
|
|
5277
4947
|
const promise = this.enqueueRequest({
|
|
5278
4948
|
method: HttpMethod.POST,
|
|
5279
|
-
url:
|
|
5280
|
-
|
|
4949
|
+
url: `/organizations/${payload.organization}/issue-types/`,
|
|
4950
|
+
// Sending only whats needed here
|
|
4951
|
+
payload: {
|
|
4952
|
+
offline_id: offlineIssueType.offline_id,
|
|
4953
|
+
submitted_at: offlineIssueType.submitted_at,
|
|
4954
|
+
icon: offlineIssueType.icon,
|
|
4955
|
+
color: offlineIssueType.color,
|
|
4956
|
+
name: offlineIssueType.name,
|
|
4957
|
+
description: offlineIssueType.description
|
|
4958
|
+
},
|
|
5281
4959
|
blockers: [],
|
|
5282
4960
|
blocks: [offlineIssueType.offline_id]
|
|
5283
4961
|
});
|
|
@@ -5302,7 +4980,7 @@ class IssueTypeService extends BaseApiService {
|
|
|
5302
4980
|
this.dispatch(updateIssueType(offlineUpdatedIssueType));
|
|
5303
4981
|
const promise = this.enqueueRequest({
|
|
5304
4982
|
method: HttpMethod.PATCH,
|
|
5305
|
-
url: `/
|
|
4983
|
+
url: `/issues/types/${payload.offline_id}/`,
|
|
5306
4984
|
payload,
|
|
5307
4985
|
blockers: [payload.offline_id],
|
|
5308
4986
|
blocks: [payload.offline_id]
|
|
@@ -5326,7 +5004,7 @@ class IssueTypeService extends BaseApiService {
|
|
|
5326
5004
|
this.dispatch(deleteIssues(issuesOfIssueType.map((issue) => issue.offline_id)));
|
|
5327
5005
|
const promise = this.enqueueRequest({
|
|
5328
5006
|
method: HttpMethod.DELETE,
|
|
5329
|
-
url: `/
|
|
5007
|
+
url: `/issues/types/${id}/`,
|
|
5330
5008
|
blockers: [id],
|
|
5331
5009
|
blocks: []
|
|
5332
5010
|
});
|
|
@@ -5339,10 +5017,7 @@ class IssueTypeService extends BaseApiService {
|
|
|
5339
5017
|
async refreshStore(organizationId) {
|
|
5340
5018
|
const result = await this.enqueueRequest({
|
|
5341
5019
|
method: HttpMethod.GET,
|
|
5342
|
-
url:
|
|
5343
|
-
queryParams: {
|
|
5344
|
-
organization: organizationId.toString()
|
|
5345
|
-
},
|
|
5020
|
+
url: `/organizations/${organizationId}/issue-types/`,
|
|
5346
5021
|
blockers: [],
|
|
5347
5022
|
blocks: []
|
|
5348
5023
|
});
|
|
@@ -5486,8 +5161,8 @@ class ProjectFileService extends BaseApiService {
|
|
|
5486
5161
|
class ProjectAttachmentService extends BaseAttachmentService {
|
|
5487
5162
|
constructor() {
|
|
5488
5163
|
super(...arguments);
|
|
5489
|
-
__publicField(this, "
|
|
5490
|
-
__publicField(this, "
|
|
5164
|
+
__publicField(this, "attachmentModel", AttachmentModel.Project);
|
|
5165
|
+
__publicField(this, "initializeAttachments", initializeProjectAttachments);
|
|
5491
5166
|
__publicField(this, "addAttachments", addProjectAttachments);
|
|
5492
5167
|
__publicField(this, "updateAttachments", updateProjectAttachments);
|
|
5493
5168
|
__publicField(this, "removeAttachments", deleteProjectAttachments);
|
|
@@ -5498,39 +5173,20 @@ class ProjectAttachmentService extends BaseAttachmentService {
|
|
|
5498
5173
|
buildOfflineAttachment(data) {
|
|
5499
5174
|
return offline({
|
|
5500
5175
|
file: URL.createObjectURL(data.file),
|
|
5501
|
-
file_sha1: data.
|
|
5502
|
-
created_by: data.
|
|
5176
|
+
file_sha1: data.sha1,
|
|
5177
|
+
created_by: data.createdBy,
|
|
5503
5178
|
file_name: data.file.name,
|
|
5504
5179
|
file_type: data.file.type,
|
|
5505
|
-
submitted_at: data.
|
|
5180
|
+
submitted_at: data.submittedAt,
|
|
5506
5181
|
description: data.description,
|
|
5507
5182
|
project: data.modelId
|
|
5508
5183
|
});
|
|
5509
5184
|
}
|
|
5510
|
-
|
|
5511
|
-
return
|
|
5512
|
-
...data,
|
|
5513
|
-
project: data.modelId
|
|
5514
|
-
};
|
|
5515
|
-
}
|
|
5516
|
-
async bulkAdd(payloads) {
|
|
5517
|
-
return this._bulkAdd(payloads.map((p) => ({ modelId: p.projectId, file: p.file })));
|
|
5518
|
-
}
|
|
5519
|
-
async delete(attachmentId) {
|
|
5520
|
-
return this._delete(attachmentId);
|
|
5185
|
+
async attachFilesToProject(files, projectId) {
|
|
5186
|
+
return this.attachFiles(files, projectId, this.buildOfflineAttachment.bind(this));
|
|
5521
5187
|
}
|
|
5522
|
-
async
|
|
5523
|
-
|
|
5524
|
-
description: "Get project attachments",
|
|
5525
|
-
method: HttpMethod.GET,
|
|
5526
|
-
url: `${this.url}/`,
|
|
5527
|
-
queryParams: {
|
|
5528
|
-
project: projectId.toString()
|
|
5529
|
-
},
|
|
5530
|
-
blockers: [],
|
|
5531
|
-
blocks: []
|
|
5532
|
-
});
|
|
5533
|
-
this.dispatch(initializeProjectAttachments(result));
|
|
5188
|
+
async deleteProjectAttachment(attachmentId) {
|
|
5189
|
+
return this.deleteAttachment(attachmentId);
|
|
5534
5190
|
}
|
|
5535
5191
|
}
|
|
5536
5192
|
class ProjectService extends BaseApiService {
|
|
@@ -5673,53 +5329,201 @@ const separateImageFromFields = async (fields) => {
|
|
|
5673
5329
|
return { fields: newFields, images };
|
|
5674
5330
|
};
|
|
5675
5331
|
class FormService extends BaseUploadService {
|
|
5676
|
-
|
|
5332
|
+
async bulkAddRevisionAttachments(revisionId, files) {
|
|
5677
5333
|
var _a2;
|
|
5678
|
-
const { store } = this.client;
|
|
5679
5334
|
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
5680
|
-
const createdBy = (_a2 = store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
5681
|
-
const
|
|
5682
|
-
|
|
5683
|
-
|
|
5684
|
-
|
|
5685
|
-
|
|
5686
|
-
|
|
5687
|
-
|
|
5688
|
-
|
|
5689
|
-
|
|
5690
|
-
|
|
5691
|
-
|
|
5692
|
-
|
|
5693
|
-
|
|
5694
|
-
|
|
5695
|
-
|
|
5696
|
-
|
|
5697
|
-
|
|
5698
|
-
|
|
5699
|
-
|
|
5700
|
-
|
|
5701
|
-
|
|
5702
|
-
submitted_at:
|
|
5703
|
-
|
|
5704
|
-
|
|
5705
|
-
|
|
5706
|
-
|
|
5707
|
-
|
|
5708
|
-
|
|
5709
|
-
|
|
5710
|
-
|
|
5711
|
-
|
|
5712
|
-
|
|
5713
|
-
|
|
5714
|
-
|
|
5715
|
-
|
|
5716
|
-
|
|
5717
|
-
|
|
5718
|
-
|
|
5719
|
-
|
|
5720
|
-
|
|
5721
|
-
|
|
5722
|
-
|
|
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];
|
|
5723
5527
|
}
|
|
5724
5528
|
async delete(id) {
|
|
5725
5529
|
const { store } = this.client;
|
|
@@ -5756,31 +5560,65 @@ class FormService extends BaseUploadService {
|
|
|
5756
5560
|
throw e;
|
|
5757
5561
|
}
|
|
5758
5562
|
}
|
|
5759
|
-
async refreshStore(projectId
|
|
5760
|
-
|
|
5761
|
-
const
|
|
5563
|
+
async refreshStore(projectId) {
|
|
5564
|
+
const forms = [];
|
|
5565
|
+
const revisions = [];
|
|
5566
|
+
const attachments = [];
|
|
5567
|
+
const projectFormsResult = await this.enqueueRequest({
|
|
5762
5568
|
description: "Fetch project forms",
|
|
5763
5569
|
method: HttpMethod.GET,
|
|
5764
|
-
url:
|
|
5765
|
-
queryParams: {
|
|
5766
|
-
project: projectId.toString()
|
|
5767
|
-
},
|
|
5570
|
+
url: `/projects/${projectId}/forms/`,
|
|
5768
5571
|
blockers: [projectId.toString()],
|
|
5769
5572
|
blocks: []
|
|
5770
5573
|
});
|
|
5771
|
-
|
|
5772
|
-
|
|
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({
|
|
5773
5581
|
description: "Fetch organization forms",
|
|
5774
5582
|
method: HttpMethod.GET,
|
|
5775
|
-
url:
|
|
5776
|
-
|
|
5777
|
-
|
|
5778
|
-
|
|
5779
|
-
|
|
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()],
|
|
5780
5611
|
blocks: []
|
|
5781
5612
|
});
|
|
5782
|
-
|
|
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);
|
|
5783
5619
|
this.dispatch(initializeForms(forms));
|
|
5620
|
+
this.dispatch(initializeFormRevisions(revisions));
|
|
5621
|
+
this.dispatch(initializeFormRevisionAttachments(attachments));
|
|
5784
5622
|
}
|
|
5785
5623
|
}
|
|
5786
5624
|
const isArrayOfFiles = (value) => {
|
|
@@ -5802,11 +5640,95 @@ const separateFilesFromValues = (values) => {
|
|
|
5802
5640
|
return { values: newValues, files };
|
|
5803
5641
|
};
|
|
5804
5642
|
class FormSubmissionService extends BaseUploadService {
|
|
5805
|
-
|
|
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) {
|
|
5806
5728
|
var _a2;
|
|
5807
5729
|
const { store } = this.client;
|
|
5808
5730
|
const state = store.getState();
|
|
5809
|
-
const { values } = separateFilesFromValues(payload.values);
|
|
5731
|
+
const { values, files } = separateFilesFromValues(payload.values);
|
|
5810
5732
|
const offlineSubmission = offline({
|
|
5811
5733
|
...payload,
|
|
5812
5734
|
values,
|
|
@@ -5816,7 +5738,7 @@ class FormSubmissionService extends BaseUploadService {
|
|
|
5816
5738
|
const promise = this.enqueueRequest({
|
|
5817
5739
|
description: "Respond to form",
|
|
5818
5740
|
method: HttpMethod.POST,
|
|
5819
|
-
url:
|
|
5741
|
+
url: `/forms/revisions/${payload.form_revision}/respond/`,
|
|
5820
5742
|
payload: offlineSubmission,
|
|
5821
5743
|
blockers: [payload.issue, payload.asset, payload.asset_stage, "add-form-entry"].filter(
|
|
5822
5744
|
(x) => x !== void 0
|
|
@@ -5824,6 +5746,10 @@ class FormSubmissionService extends BaseUploadService {
|
|
|
5824
5746
|
blocks: [offlineSubmission.offline_id]
|
|
5825
5747
|
});
|
|
5826
5748
|
this.dispatch(addFormSubmission(offlineSubmission));
|
|
5749
|
+
const [offlineFormSubmissionAttachments, attachmentsPromise] = await this.bulkAddSubmissionAttachments(
|
|
5750
|
+
offlineSubmission.offline_id,
|
|
5751
|
+
files
|
|
5752
|
+
);
|
|
5827
5753
|
promise.then((result) => {
|
|
5828
5754
|
this.dispatch(addActiveProjectFormSubmissionsCount(1));
|
|
5829
5755
|
this.dispatch(setFormSubmission(result));
|
|
@@ -5832,16 +5758,115 @@ class FormSubmissionService extends BaseUploadService {
|
|
|
5832
5758
|
this.dispatch(deleteFormSubmission(offlineSubmission.offline_id));
|
|
5833
5759
|
this.dispatch(addActiveProjectFormSubmissionsCount(-1));
|
|
5834
5760
|
});
|
|
5835
|
-
return [offlineSubmission, promise];
|
|
5761
|
+
return [offlineSubmission, offlineFormSubmissionAttachments, promise, attachmentsPromise];
|
|
5836
5762
|
}
|
|
5837
|
-
|
|
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) {
|
|
5838
5863
|
const { store } = this.client;
|
|
5839
5864
|
const state = store.getState();
|
|
5840
5865
|
const submissionToBeUpdated = selectFormSubmissionById(payload.offline_id)(state);
|
|
5841
5866
|
if (!submissionToBeUpdated) {
|
|
5842
5867
|
throw new Error(`Expected submission with offline_id ${payload.offline_id} to exist`);
|
|
5843
5868
|
}
|
|
5844
|
-
const { values } = separateFilesFromValues(payload.values ?? {});
|
|
5869
|
+
const { values, files } = separateFilesFromValues(payload.values ?? {});
|
|
5845
5870
|
const updatedSubmission = {
|
|
5846
5871
|
...submissionToBeUpdated,
|
|
5847
5872
|
...payload,
|
|
@@ -5855,18 +5880,39 @@ class FormSubmissionService extends BaseUploadService {
|
|
|
5855
5880
|
const promise = this.enqueueRequest({
|
|
5856
5881
|
description: "Delete user form submissions",
|
|
5857
5882
|
method: HttpMethod.PATCH,
|
|
5858
|
-
url: `/
|
|
5883
|
+
url: `/forms/submissions/${updatedSubmission.offline_id}/`,
|
|
5859
5884
|
// TODO: send just payload when FormSubmissionDeserializer is updated to handle partial updates
|
|
5860
5885
|
payload: updatedSubmission,
|
|
5861
5886
|
blockers: [updatedSubmission.offline_id],
|
|
5862
5887
|
blocks: [updatedSubmission.offline_id]
|
|
5863
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
|
+
);
|
|
5864
5904
|
promise.then((result) => {
|
|
5865
5905
|
this.dispatch(setFormSubmission(result));
|
|
5866
5906
|
}).catch(() => {
|
|
5867
5907
|
this.dispatch(setFormSubmission(submissionToBeUpdated));
|
|
5868
5908
|
});
|
|
5869
|
-
return [
|
|
5909
|
+
return [
|
|
5910
|
+
updatedSubmission,
|
|
5911
|
+
offlineFormSubmissionAttachments,
|
|
5912
|
+
promise,
|
|
5913
|
+
attachmentsPromise,
|
|
5914
|
+
deleteAttachmentsPromise
|
|
5915
|
+
];
|
|
5870
5916
|
}
|
|
5871
5917
|
async delete(id) {
|
|
5872
5918
|
const { store } = this.client;
|
|
@@ -5883,7 +5929,7 @@ class FormSubmissionService extends BaseUploadService {
|
|
|
5883
5929
|
return await this.enqueueRequest({
|
|
5884
5930
|
description: "Delete user form submissions",
|
|
5885
5931
|
method: HttpMethod.DELETE,
|
|
5886
|
-
url: `/
|
|
5932
|
+
url: `/forms/submissions/${id}/`,
|
|
5887
5933
|
blockers: [id],
|
|
5888
5934
|
blocks: []
|
|
5889
5935
|
});
|
|
@@ -5895,17 +5941,50 @@ class FormSubmissionService extends BaseUploadService {
|
|
|
5895
5941
|
}
|
|
5896
5942
|
}
|
|
5897
5943
|
async refreshStore(projectId) {
|
|
5898
|
-
const
|
|
5899
|
-
|
|
5944
|
+
const formSubmissions = {};
|
|
5945
|
+
const modelSubmissions = await this.enqueueRequest({
|
|
5946
|
+
description: "Fetch model submissions",
|
|
5900
5947
|
method: HttpMethod.GET,
|
|
5901
|
-
url:
|
|
5902
|
-
|
|
5903
|
-
|
|
5904
|
-
|
|
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/`,
|
|
5971
|
+
blockers: [],
|
|
5972
|
+
blocks: []
|
|
5973
|
+
});
|
|
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/`,
|
|
5905
5981
|
blockers: [],
|
|
5906
5982
|
blocks: []
|
|
5907
5983
|
});
|
|
5908
|
-
|
|
5984
|
+
for (const standaloneAttachent of standaloneAttachments) {
|
|
5985
|
+
attachments[standaloneAttachent.offline_id] = standaloneAttachent;
|
|
5986
|
+
}
|
|
5987
|
+
this.dispatch(initializeFormSubmissionAttachments(Object.values(attachments)));
|
|
5909
5988
|
}
|
|
5910
5989
|
}
|
|
5911
5990
|
class WorkspaceService extends BaseApiService {
|
|
@@ -6607,8 +6686,8 @@ class DocumentService extends BaseApiService {
|
|
|
6607
6686
|
class DocumentAttachmentService extends BaseAttachmentService {
|
|
6608
6687
|
constructor() {
|
|
6609
6688
|
super(...arguments);
|
|
6610
|
-
__publicField(this, "
|
|
6611
|
-
__publicField(this, "
|
|
6689
|
+
__publicField(this, "attachmentModel", AttachmentModel.Document);
|
|
6690
|
+
__publicField(this, "initializeAttachments", initializeDocumentAttachments);
|
|
6612
6691
|
__publicField(this, "addAttachments", addDocumentAttachments);
|
|
6613
6692
|
__publicField(this, "updateAttachments", updateDocumentAttachments);
|
|
6614
6693
|
__publicField(this, "removeAttachments", deleteDocumentAttachments);
|
|
@@ -6619,23 +6698,17 @@ class DocumentAttachmentService extends BaseAttachmentService {
|
|
|
6619
6698
|
buildOfflineAttachment(data) {
|
|
6620
6699
|
return offline({
|
|
6621
6700
|
file: URL.createObjectURL(data.file),
|
|
6622
|
-
file_sha1: data.
|
|
6623
|
-
created_by: data.
|
|
6701
|
+
file_sha1: data.sha1,
|
|
6702
|
+
created_by: data.createdBy,
|
|
6624
6703
|
file_name: data.file.name,
|
|
6625
6704
|
file_type: data.file.type,
|
|
6626
|
-
submitted_at: data.
|
|
6705
|
+
submitted_at: data.submittedAt,
|
|
6627
6706
|
description: data.description,
|
|
6628
6707
|
document: data.modelId
|
|
6629
6708
|
});
|
|
6630
6709
|
}
|
|
6631
|
-
buildAttachmentPayload(data) {
|
|
6632
|
-
return {
|
|
6633
|
-
...data,
|
|
6634
|
-
document: data.modelId
|
|
6635
|
-
};
|
|
6636
|
-
}
|
|
6637
6710
|
// NOTE: overriding the method from BaseAttachmentService since document attachments get vectorized
|
|
6638
|
-
async
|
|
6711
|
+
async attachFilesToDocument(files, documentId) {
|
|
6639
6712
|
var _a2;
|
|
6640
6713
|
const { store } = this.client;
|
|
6641
6714
|
const createdBy = (_a2 = store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
@@ -6644,36 +6717,40 @@ class DocumentAttachmentService extends BaseAttachmentService {
|
|
|
6644
6717
|
const attachmentPayloads = [];
|
|
6645
6718
|
const filePayloads = {};
|
|
6646
6719
|
const sha1ToAttachmentIds = {};
|
|
6647
|
-
for (const
|
|
6648
|
-
const
|
|
6649
|
-
|
|
6650
|
-
|
|
6651
|
-
|
|
6652
|
-
|
|
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);
|
|
6653
6731
|
}
|
|
6654
6732
|
const offlineAttachment = this.buildOfflineAttachment({
|
|
6655
6733
|
file,
|
|
6656
|
-
|
|
6657
|
-
|
|
6658
|
-
|
|
6734
|
+
sha1,
|
|
6735
|
+
submittedAt,
|
|
6736
|
+
createdBy,
|
|
6659
6737
|
description: "",
|
|
6660
6738
|
modelId: documentId
|
|
6661
6739
|
});
|
|
6662
6740
|
offlineAttachments.push(offlineAttachment);
|
|
6663
6741
|
attachmentPayloads.push({
|
|
6664
6742
|
offline_id: offlineAttachment.offline_id,
|
|
6665
|
-
|
|
6666
|
-
|
|
6667
|
-
file_extension: filePayload.extension,
|
|
6743
|
+
name: offlineAttachment.file_name,
|
|
6744
|
+
sha1: offlineAttachment.file_sha1,
|
|
6668
6745
|
description: offlineAttachment.description
|
|
6669
6746
|
});
|
|
6670
|
-
sha1ToAttachmentIds[
|
|
6747
|
+
sha1ToAttachmentIds[sha1].push(offlineAttachment.offline_id);
|
|
6671
6748
|
}
|
|
6672
6749
|
this.dispatch(this.addAttachments(offlineAttachments));
|
|
6673
6750
|
const promise = this.enqueueRequest({
|
|
6674
6751
|
description: "Attach files to document",
|
|
6675
6752
|
method: HttpMethod.POST,
|
|
6676
|
-
url:
|
|
6753
|
+
url: `/documents/${documentId}/attach/`,
|
|
6677
6754
|
payload: {
|
|
6678
6755
|
submitted_at: submittedAt,
|
|
6679
6756
|
attachments: attachmentPayloads,
|
|
@@ -6698,14 +6775,14 @@ class DocumentAttachmentService extends BaseAttachmentService {
|
|
|
6698
6775
|
});
|
|
6699
6776
|
return [offlineAttachments, promise.then(({ attachments }) => attachments)];
|
|
6700
6777
|
}
|
|
6701
|
-
async
|
|
6702
|
-
return this.
|
|
6778
|
+
async deleteDocumentAttachment(attachmentId) {
|
|
6779
|
+
return this.deleteAttachment(attachmentId);
|
|
6703
6780
|
}
|
|
6704
6781
|
makeReadable(attachmnentId) {
|
|
6705
6782
|
void this.enqueueRequest({
|
|
6706
6783
|
description: "Add attachment to AI assistant",
|
|
6707
6784
|
method: HttpMethod.PATCH,
|
|
6708
|
-
url: `/
|
|
6785
|
+
url: `/documents/attachments/${attachmnentId}/`,
|
|
6709
6786
|
payload: {
|
|
6710
6787
|
readable_to_assistant: true
|
|
6711
6788
|
},
|
|
@@ -6722,7 +6799,7 @@ class DocumentAttachmentService extends BaseAttachmentService {
|
|
|
6722
6799
|
blocks: [],
|
|
6723
6800
|
blockers: []
|
|
6724
6801
|
});
|
|
6725
|
-
this.dispatch(
|
|
6802
|
+
this.dispatch(this.initializeAttachments(projectDocumentAttachments));
|
|
6726
6803
|
const organizationDocumentAttachments = await this.enqueueRequest({
|
|
6727
6804
|
description: "Get document attachments",
|
|
6728
6805
|
method: HttpMethod.GET,
|
|
@@ -6966,11 +7043,17 @@ class GeoImageService extends BaseUploadService {
|
|
|
6966
7043
|
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
6967
7044
|
const createdBy = (_a2 = store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
6968
7045
|
const projectId = payloadWithoutFile.project;
|
|
6969
|
-
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
|
+
};
|
|
6970
7053
|
const offlineMapImage = offline({
|
|
6971
7054
|
...payloadWithoutFile,
|
|
6972
7055
|
file_name: file.name,
|
|
6973
|
-
file_sha1:
|
|
7056
|
+
file_sha1: sha1,
|
|
6974
7057
|
file: URL.createObjectURL(file),
|
|
6975
7058
|
submitted_at: submittedAt,
|
|
6976
7059
|
created_by: createdBy
|
|
@@ -7013,16 +7096,23 @@ class GeoImageService extends BaseUploadService {
|
|
|
7013
7096
|
const offlineGeoImages = [];
|
|
7014
7097
|
const offlineIds = [];
|
|
7015
7098
|
const geoImagePayloads = [];
|
|
7016
|
-
const
|
|
7099
|
+
const filePayloadRecord = {};
|
|
7017
7100
|
for (const payloadAndFile of payloads) {
|
|
7018
7101
|
const { file, ...payload } = payloadAndFile;
|
|
7019
|
-
const
|
|
7020
|
-
if (!(
|
|
7021
|
-
|
|
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
|
+
}
|
|
7022
7112
|
const offlineMapImage = offline({
|
|
7023
7113
|
...payload,
|
|
7024
7114
|
file_name: file.name,
|
|
7025
|
-
file_sha1:
|
|
7115
|
+
file_sha1: sha1,
|
|
7026
7116
|
file: URL.createObjectURL(file),
|
|
7027
7117
|
submitted_at: submittedAt,
|
|
7028
7118
|
created_by: createdBy,
|
|
@@ -7051,7 +7141,7 @@ class GeoImageService extends BaseUploadService {
|
|
|
7051
7141
|
submitted_at: submittedAt,
|
|
7052
7142
|
project: projectId,
|
|
7053
7143
|
geo_images: geoImagePayloads,
|
|
7054
|
-
files: Object.values(
|
|
7144
|
+
files: Object.values(filePayloadRecord)
|
|
7055
7145
|
},
|
|
7056
7146
|
blocks: [projectId.toString()],
|
|
7057
7147
|
blockers: offlineIds
|
|
@@ -7119,7 +7209,7 @@ class GeoImageService extends BaseUploadService {
|
|
|
7119
7209
|
this.dispatch(initializeGeoImages(result));
|
|
7120
7210
|
}
|
|
7121
7211
|
}
|
|
7122
|
-
class IssueAssociationService extends
|
|
7212
|
+
class IssueAssociationService extends BaseUploadService {
|
|
7123
7213
|
add(payload) {
|
|
7124
7214
|
var _a2;
|
|
7125
7215
|
const { store } = this.client;
|
|
@@ -7134,7 +7224,7 @@ class IssueAssociationService extends BaseApiService {
|
|
|
7134
7224
|
const promise = this.enqueueRequest({
|
|
7135
7225
|
description: "Add issue association",
|
|
7136
7226
|
method: HttpMethod.POST,
|
|
7137
|
-
url: "/
|
|
7227
|
+
url: "/issues/associations/",
|
|
7138
7228
|
payload: {
|
|
7139
7229
|
offline_id: offlineIssueAssociation.offline_id,
|
|
7140
7230
|
submitted_at: submittedAt,
|
|
@@ -7164,7 +7254,7 @@ class IssueAssociationService extends BaseApiService {
|
|
|
7164
7254
|
const promise = this.enqueueRequest({
|
|
7165
7255
|
description: "Delete issue association",
|
|
7166
7256
|
method: HttpMethod.DELETE,
|
|
7167
|
-
url: `/
|
|
7257
|
+
url: `/issues/associations/${id}/`,
|
|
7168
7258
|
blockers: [id],
|
|
7169
7259
|
blocks: []
|
|
7170
7260
|
});
|
|
@@ -7177,938 +7267,14 @@ class IssueAssociationService extends BaseApiService {
|
|
|
7177
7267
|
const issueAssociations = await this.enqueueRequest({
|
|
7178
7268
|
description: "Fetch issue associations",
|
|
7179
7269
|
method: HttpMethod.GET,
|
|
7180
|
-
url: "/
|
|
7181
|
-
queryParams: {
|
|
7270
|
+
url: "/issues/associations/",
|
|
7271
|
+
queryParams: { project_id: projectId.toString() },
|
|
7182
7272
|
blockers: [],
|
|
7183
7273
|
blocks: []
|
|
7184
7274
|
});
|
|
7185
7275
|
this.dispatch(initializeIssueAssociations(issueAssociations));
|
|
7186
7276
|
}
|
|
7187
7277
|
}
|
|
7188
|
-
class FormRevisionAttachmentService extends BaseUploadService {
|
|
7189
|
-
async bulkAdd(payloads) {
|
|
7190
|
-
var _a2;
|
|
7191
|
-
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7192
|
-
const createdBy = (_a2 = this.client.store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
7193
|
-
const filePayloads = {};
|
|
7194
|
-
const offlineFormRevisionAttachments = [];
|
|
7195
|
-
const attachmentPayloads = [];
|
|
7196
|
-
for (const payload of payloads) {
|
|
7197
|
-
const { revisionId, fieldIdentifier, file } = payload;
|
|
7198
|
-
const filePayload = await this.getFilePayload(file);
|
|
7199
|
-
if (!(filePayload.sha1 in filePayloads))
|
|
7200
|
-
filePayloads[filePayload.sha1] = filePayload;
|
|
7201
|
-
const offlineFormRevisionAttachment = offline({
|
|
7202
|
-
file: URL.createObjectURL(file),
|
|
7203
|
-
file_type: file.type,
|
|
7204
|
-
file_name: file.name,
|
|
7205
|
-
file_sha1: filePayload.sha1,
|
|
7206
|
-
created_by: createdBy,
|
|
7207
|
-
form_revision: revisionId,
|
|
7208
|
-
submitted_at: submittedAt,
|
|
7209
|
-
field_identifier: fieldIdentifier
|
|
7210
|
-
});
|
|
7211
|
-
offlineFormRevisionAttachments.push(offlineFormRevisionAttachment);
|
|
7212
|
-
const attachmentPayload = {
|
|
7213
|
-
offline_id: offlineFormRevisionAttachment.offline_id,
|
|
7214
|
-
file_name: file.name,
|
|
7215
|
-
field_identifier: fieldIdentifier,
|
|
7216
|
-
file_extension: filePayload.extension,
|
|
7217
|
-
file_sha1: filePayload.sha1,
|
|
7218
|
-
form_revision: revisionId
|
|
7219
|
-
};
|
|
7220
|
-
attachmentPayloads.push(attachmentPayload);
|
|
7221
|
-
}
|
|
7222
|
-
this.dispatch(addFormRevisionAttachments(offlineFormRevisionAttachments));
|
|
7223
|
-
const promise = this.enqueueRequest({
|
|
7224
|
-
description: "Attach files to form revision",
|
|
7225
|
-
method: HttpMethod.POST,
|
|
7226
|
-
url: "/form-revision-attachments/bulk/",
|
|
7227
|
-
payload: {
|
|
7228
|
-
submitted_at: submittedAt,
|
|
7229
|
-
attachments: attachmentPayloads,
|
|
7230
|
-
files: Object.values(filePayloads)
|
|
7231
|
-
},
|
|
7232
|
-
blockers: offlineFormRevisionAttachments.map((attachment) => attachment.form_revision),
|
|
7233
|
-
blocks: offlineFormRevisionAttachments.map((attachment) => attachment.offline_id)
|
|
7234
|
-
});
|
|
7235
|
-
promise.then((result) => {
|
|
7236
|
-
this.processPresignedUrls(result.presigned_urls);
|
|
7237
|
-
this.dispatch(updateFormRevisionAttachments(result.attachments));
|
|
7238
|
-
}).catch(() => {
|
|
7239
|
-
this.dispatch(
|
|
7240
|
-
deleteFormRevisionAttachments(
|
|
7241
|
-
offlineFormRevisionAttachments.map((attachment) => attachment.offline_id)
|
|
7242
|
-
)
|
|
7243
|
-
);
|
|
7244
|
-
});
|
|
7245
|
-
return [offlineFormRevisionAttachments, promise.then(({ attachments }) => attachments)];
|
|
7246
|
-
}
|
|
7247
|
-
async refreshStore(projectId, organizationId) {
|
|
7248
|
-
let attachments = [];
|
|
7249
|
-
const projectFormRevisions = await this.enqueueRequest({
|
|
7250
|
-
description: "Fetch project form revision attachments",
|
|
7251
|
-
method: HttpMethod.GET,
|
|
7252
|
-
url: "/form-revision-attachments/",
|
|
7253
|
-
queryParams: {
|
|
7254
|
-
project: projectId.toString()
|
|
7255
|
-
},
|
|
7256
|
-
blockers: [projectId.toString()],
|
|
7257
|
-
blocks: []
|
|
7258
|
-
});
|
|
7259
|
-
attachments = attachments.concat(projectFormRevisions);
|
|
7260
|
-
const organizationFormRevisions = await this.enqueueRequest({
|
|
7261
|
-
description: "Fetch organization form revision attachments",
|
|
7262
|
-
method: HttpMethod.GET,
|
|
7263
|
-
url: "/form-revision-attachments/",
|
|
7264
|
-
queryParams: {
|
|
7265
|
-
organization: organizationId.toString()
|
|
7266
|
-
},
|
|
7267
|
-
blockers: [organizationId.toString()],
|
|
7268
|
-
blocks: []
|
|
7269
|
-
});
|
|
7270
|
-
attachments = attachments.concat(organizationFormRevisions);
|
|
7271
|
-
this.dispatch(initializeFormRevisionAttachments(attachments));
|
|
7272
|
-
}
|
|
7273
|
-
}
|
|
7274
|
-
class FormSubmissionAttachmentService extends BaseUploadService {
|
|
7275
|
-
async bulkAdd(payloads) {
|
|
7276
|
-
var _a2;
|
|
7277
|
-
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7278
|
-
const createdBy = (_a2 = this.client.store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
7279
|
-
const filePayloads = {};
|
|
7280
|
-
const offlineFormSubmissionAttachments = [];
|
|
7281
|
-
const attachmentPayloads = [];
|
|
7282
|
-
for (const payload of payloads) {
|
|
7283
|
-
const { submissionId, fieldIdentifier, file } = payload;
|
|
7284
|
-
const filePayload = await this.getFilePayload(file);
|
|
7285
|
-
if (!(filePayload.sha1 in filePayloads))
|
|
7286
|
-
filePayloads[filePayload.sha1] = filePayload;
|
|
7287
|
-
const offlineFormSubmissionAttachment = offline({
|
|
7288
|
-
file: URL.createObjectURL(file),
|
|
7289
|
-
file_type: file.type,
|
|
7290
|
-
file_name: file.name,
|
|
7291
|
-
file_sha1: filePayload.sha1,
|
|
7292
|
-
created_by: createdBy,
|
|
7293
|
-
form_submission: submissionId,
|
|
7294
|
-
submitted_at: submittedAt,
|
|
7295
|
-
field_identifier: fieldIdentifier
|
|
7296
|
-
});
|
|
7297
|
-
offlineFormSubmissionAttachments.push(offlineFormSubmissionAttachment);
|
|
7298
|
-
const attachmentPayload = {
|
|
7299
|
-
offline_id: offlineFormSubmissionAttachment.offline_id,
|
|
7300
|
-
file_name: file.name,
|
|
7301
|
-
file_sha1: filePayload.sha1,
|
|
7302
|
-
file_extension: filePayload.extension,
|
|
7303
|
-
field_identifier: fieldIdentifier,
|
|
7304
|
-
form_submission: submissionId
|
|
7305
|
-
};
|
|
7306
|
-
attachmentPayloads.push(attachmentPayload);
|
|
7307
|
-
}
|
|
7308
|
-
this.dispatch(addFormSubmissionAttachments(offlineFormSubmissionAttachments));
|
|
7309
|
-
const promise = this.enqueueRequest({
|
|
7310
|
-
description: "Attach files to form submission",
|
|
7311
|
-
method: HttpMethod.POST,
|
|
7312
|
-
url: "/form-submission-attachments/bulk/",
|
|
7313
|
-
payload: {
|
|
7314
|
-
submitted_at: submittedAt,
|
|
7315
|
-
attachments: attachmentPayloads,
|
|
7316
|
-
files: Object.values(filePayloads)
|
|
7317
|
-
},
|
|
7318
|
-
blockers: offlineFormSubmissionAttachments.map((attachment) => attachment.form_submission),
|
|
7319
|
-
blocks: offlineFormSubmissionAttachments.map((attachment) => attachment.offline_id)
|
|
7320
|
-
});
|
|
7321
|
-
promise.then((result) => {
|
|
7322
|
-
this.processPresignedUrls(result.presigned_urls);
|
|
7323
|
-
this.dispatch(updateFormSubmissionAttachments(result.attachments));
|
|
7324
|
-
}).catch((error) => {
|
|
7325
|
-
this.dispatch(
|
|
7326
|
-
deleteFormSubmissionAttachments(
|
|
7327
|
-
offlineFormSubmissionAttachments.map((attachment) => attachment.offline_id)
|
|
7328
|
-
)
|
|
7329
|
-
);
|
|
7330
|
-
throw error;
|
|
7331
|
-
});
|
|
7332
|
-
return [offlineFormSubmissionAttachments, promise.then(({ attachments }) => attachments)];
|
|
7333
|
-
}
|
|
7334
|
-
async bulkDelete(attachmentsIds) {
|
|
7335
|
-
const { store } = this.client;
|
|
7336
|
-
const state = store.getState();
|
|
7337
|
-
const formSubmissionAttachments = selectFormSubmissionAttachemntsByIds(attachmentsIds)(state);
|
|
7338
|
-
this.dispatch(deleteFormSubmissionAttachments(attachmentsIds));
|
|
7339
|
-
try {
|
|
7340
|
-
await this.enqueueRequest({
|
|
7341
|
-
description: "Delete form submission attachments",
|
|
7342
|
-
method: HttpMethod.DELETE,
|
|
7343
|
-
url: "/form-submission-attachments/bulk/",
|
|
7344
|
-
payload: { attachment_ids: attachmentsIds },
|
|
7345
|
-
blockers: attachmentsIds,
|
|
7346
|
-
blocks: []
|
|
7347
|
-
});
|
|
7348
|
-
} catch (e) {
|
|
7349
|
-
this.dispatch(addFormSubmissionAttachments(formSubmissionAttachments));
|
|
7350
|
-
throw e;
|
|
7351
|
-
}
|
|
7352
|
-
}
|
|
7353
|
-
async refreshStore(projectId) {
|
|
7354
|
-
const result = await this.enqueueRequest({
|
|
7355
|
-
description: "Get form submission attachments",
|
|
7356
|
-
method: HttpMethod.GET,
|
|
7357
|
-
url: "/form-submission-attachments/",
|
|
7358
|
-
queryParams: {
|
|
7359
|
-
project: projectId.toString()
|
|
7360
|
-
},
|
|
7361
|
-
blockers: [],
|
|
7362
|
-
blocks: []
|
|
7363
|
-
});
|
|
7364
|
-
this.dispatch(initializeFormSubmissionAttachments(result));
|
|
7365
|
-
}
|
|
7366
|
-
}
|
|
7367
|
-
class FormRevisionService extends BaseUploadService {
|
|
7368
|
-
add(payload) {
|
|
7369
|
-
var _a2;
|
|
7370
|
-
const { store } = this.client;
|
|
7371
|
-
const state = store.getState();
|
|
7372
|
-
const createdBy = (_a2 = state.userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
7373
|
-
const offlineFormRevision = offline({
|
|
7374
|
-
...payload,
|
|
7375
|
-
created_by: createdBy,
|
|
7376
|
-
revision: "Pending",
|
|
7377
|
-
submitted_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
7378
|
-
});
|
|
7379
|
-
this.dispatch(addFormRevision(offlineFormRevision));
|
|
7380
|
-
const promise = this.enqueueRequest({
|
|
7381
|
-
description: "Create form revision",
|
|
7382
|
-
method: HttpMethod.POST,
|
|
7383
|
-
url: "/form-revisions/",
|
|
7384
|
-
payload: offlineFormRevision,
|
|
7385
|
-
blockers: [payload.form],
|
|
7386
|
-
blocks: [offlineFormRevision.offline_id]
|
|
7387
|
-
});
|
|
7388
|
-
void promise.then((result) => {
|
|
7389
|
-
this.dispatch(setFormRevision(result));
|
|
7390
|
-
}).catch(() => {
|
|
7391
|
-
this.dispatch(deleteFormRevision(offlineFormRevision.offline_id));
|
|
7392
|
-
});
|
|
7393
|
-
return [offlineFormRevision, promise];
|
|
7394
|
-
}
|
|
7395
|
-
async refreshStore(projectId, organizationId) {
|
|
7396
|
-
let formRevisions = [];
|
|
7397
|
-
const projectFormRevisions = await this.enqueueRequest({
|
|
7398
|
-
description: "Fetch project form revisions",
|
|
7399
|
-
method: HttpMethod.GET,
|
|
7400
|
-
url: "/form-revisions/",
|
|
7401
|
-
queryParams: {
|
|
7402
|
-
project: projectId.toString()
|
|
7403
|
-
},
|
|
7404
|
-
blockers: [projectId.toString()],
|
|
7405
|
-
blocks: []
|
|
7406
|
-
});
|
|
7407
|
-
formRevisions = formRevisions.concat(projectFormRevisions);
|
|
7408
|
-
const organizationFormRevisions = await this.enqueueRequest({
|
|
7409
|
-
description: "Fetch organization form revisions",
|
|
7410
|
-
method: HttpMethod.GET,
|
|
7411
|
-
url: "/form-revisions/",
|
|
7412
|
-
queryParams: {
|
|
7413
|
-
organization: organizationId.toString()
|
|
7414
|
-
},
|
|
7415
|
-
blockers: [organizationId.toString()],
|
|
7416
|
-
blocks: []
|
|
7417
|
-
});
|
|
7418
|
-
formRevisions = formRevisions.concat(organizationFormRevisions);
|
|
7419
|
-
this.dispatch(initializeFormRevisions(formRevisions));
|
|
7420
|
-
}
|
|
7421
|
-
}
|
|
7422
|
-
class AssetTypeFieldsAttachmentService extends BaseUploadService {
|
|
7423
|
-
async bulkAdd(payloads) {
|
|
7424
|
-
var _a2;
|
|
7425
|
-
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7426
|
-
const createdBy = (_a2 = this.client.store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
7427
|
-
const filePayloads = {};
|
|
7428
|
-
const offlineAssetTypeFieldsAttachments = [];
|
|
7429
|
-
const attachmentPayloads = [];
|
|
7430
|
-
for (const payload of payloads) {
|
|
7431
|
-
const { fieldsRevisionId, fieldIdentifier, file } = payload;
|
|
7432
|
-
const filePayload = await this.getFilePayload(file);
|
|
7433
|
-
if (!(filePayload.sha1 in filePayloads))
|
|
7434
|
-
filePayloads[filePayload.sha1] = filePayload;
|
|
7435
|
-
const offlineAssetTypeFieldsAttachment = offline({
|
|
7436
|
-
file: URL.createObjectURL(file),
|
|
7437
|
-
file_type: file.type,
|
|
7438
|
-
file_name: file.name,
|
|
7439
|
-
file_sha1: filePayload.sha1,
|
|
7440
|
-
created_by: createdBy,
|
|
7441
|
-
fields_revision: fieldsRevisionId,
|
|
7442
|
-
submitted_at: submittedAt,
|
|
7443
|
-
field_identifier: fieldIdentifier
|
|
7444
|
-
});
|
|
7445
|
-
offlineAssetTypeFieldsAttachments.push(offlineAssetTypeFieldsAttachment);
|
|
7446
|
-
const attachmentPayload = {
|
|
7447
|
-
offline_id: offlineAssetTypeFieldsAttachment.offline_id,
|
|
7448
|
-
file_name: file.name,
|
|
7449
|
-
field_identifier: fieldIdentifier,
|
|
7450
|
-
file_extension: filePayload.extension,
|
|
7451
|
-
file_sha1: filePayload.sha1,
|
|
7452
|
-
fields_revision: fieldsRevisionId
|
|
7453
|
-
};
|
|
7454
|
-
attachmentPayloads.push(attachmentPayload);
|
|
7455
|
-
}
|
|
7456
|
-
this.dispatch(addAssetTypeFieldsAttachments(offlineAssetTypeFieldsAttachments));
|
|
7457
|
-
const promise = this.enqueueRequest({
|
|
7458
|
-
description: "Add asset type fields attachments",
|
|
7459
|
-
method: HttpMethod.POST,
|
|
7460
|
-
url: "/asset-type-fields-attachments/bulk/",
|
|
7461
|
-
payload: {
|
|
7462
|
-
submitted_at: submittedAt,
|
|
7463
|
-
attachments: attachmentPayloads,
|
|
7464
|
-
files: Object.values(filePayloads)
|
|
7465
|
-
},
|
|
7466
|
-
blockers: offlineAssetTypeFieldsAttachments.map((attachment) => attachment.fields_revision),
|
|
7467
|
-
blocks: offlineAssetTypeFieldsAttachments.map((attachment) => attachment.offline_id)
|
|
7468
|
-
});
|
|
7469
|
-
promise.then((result) => {
|
|
7470
|
-
this.processPresignedUrls(result.presigned_urls);
|
|
7471
|
-
this.dispatch(updateAssetTypeFieldsAttachments(result.attachments));
|
|
7472
|
-
}).catch(() => {
|
|
7473
|
-
this.dispatch(
|
|
7474
|
-
deleteAssetTypeFieldsAttachments(
|
|
7475
|
-
offlineAssetTypeFieldsAttachments.map((attachment) => attachment.offline_id)
|
|
7476
|
-
)
|
|
7477
|
-
);
|
|
7478
|
-
});
|
|
7479
|
-
return [offlineAssetTypeFieldsAttachments, promise.then(({ attachments }) => attachments)];
|
|
7480
|
-
}
|
|
7481
|
-
async refreshStore(projectId) {
|
|
7482
|
-
const result = await this.enqueueRequest({
|
|
7483
|
-
description: "get asset type fields attachments",
|
|
7484
|
-
method: HttpMethod.GET,
|
|
7485
|
-
url: "/asset-type-fields-attachments/",
|
|
7486
|
-
queryParams: {
|
|
7487
|
-
project: projectId.toString()
|
|
7488
|
-
},
|
|
7489
|
-
blockers: [projectId.toString()],
|
|
7490
|
-
blocks: []
|
|
7491
|
-
});
|
|
7492
|
-
this.dispatch(initializeAssetTypeFieldsAttachments(result));
|
|
7493
|
-
}
|
|
7494
|
-
}
|
|
7495
|
-
class AssetTypeFieldsService extends BaseApiService {
|
|
7496
|
-
add(payload) {
|
|
7497
|
-
var _a2;
|
|
7498
|
-
const { store } = this.client;
|
|
7499
|
-
const createdBy = (_a2 = store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
7500
|
-
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7501
|
-
const offlineAssetTypeFields = offline({
|
|
7502
|
-
...payload,
|
|
7503
|
-
created_by: createdBy,
|
|
7504
|
-
submitted_at: submittedAt
|
|
7505
|
-
});
|
|
7506
|
-
this.dispatch(addAssetTypeFields(offlineAssetTypeFields));
|
|
7507
|
-
const promise = this.enqueueRequest({
|
|
7508
|
-
description: "Add Asset Type Fields",
|
|
7509
|
-
method: HttpMethod.POST,
|
|
7510
|
-
url: "/asset-type-fields/",
|
|
7511
|
-
payload: offlineAssetTypeFields,
|
|
7512
|
-
blockers: [offlineAssetTypeFields.asset_type],
|
|
7513
|
-
blocks: [offlineAssetTypeFields.offline_id]
|
|
7514
|
-
});
|
|
7515
|
-
promise.then((response) => {
|
|
7516
|
-
this.dispatch(updateAssetTypeFields(response));
|
|
7517
|
-
}).catch((error) => {
|
|
7518
|
-
this.dispatch(deleteAssetTypeFields(offlineAssetTypeFields.offline_id));
|
|
7519
|
-
throw error;
|
|
7520
|
-
});
|
|
7521
|
-
return [offlineAssetTypeFields, promise];
|
|
7522
|
-
}
|
|
7523
|
-
async refreshStore(projectId) {
|
|
7524
|
-
const result = await this.enqueueRequest({
|
|
7525
|
-
description: "Get Asset Type Fields",
|
|
7526
|
-
method: HttpMethod.GET,
|
|
7527
|
-
url: "/asset-type-fields/",
|
|
7528
|
-
queryParams: {
|
|
7529
|
-
project: projectId.toString()
|
|
7530
|
-
},
|
|
7531
|
-
blockers: [],
|
|
7532
|
-
blocks: []
|
|
7533
|
-
});
|
|
7534
|
-
this.dispatch(initializeAssetTypeFields(result));
|
|
7535
|
-
}
|
|
7536
|
-
}
|
|
7537
|
-
class AssetTypeFieldValuesService extends BaseApiService {
|
|
7538
|
-
add(payload) {
|
|
7539
|
-
var _a2;
|
|
7540
|
-
const { store } = this.client;
|
|
7541
|
-
const state = store.getState();
|
|
7542
|
-
const { values } = separateFilesFromValues(payload.values);
|
|
7543
|
-
const offlineAssetTypeFieldValues = offline({
|
|
7544
|
-
...payload,
|
|
7545
|
-
values,
|
|
7546
|
-
created_by: (_a2 = state.userReducer.currentUser) == null ? void 0 : _a2.id,
|
|
7547
|
-
submitted_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
7548
|
-
});
|
|
7549
|
-
const promise = this.enqueueRequest({
|
|
7550
|
-
description: "Add asset type field values",
|
|
7551
|
-
method: HttpMethod.POST,
|
|
7552
|
-
url: "/asset-type-field-values/",
|
|
7553
|
-
payload: offlineAssetTypeFieldValues,
|
|
7554
|
-
blockers: [payload.asset, payload.fields_revision],
|
|
7555
|
-
blocks: [offlineAssetTypeFieldValues.offline_id]
|
|
7556
|
-
});
|
|
7557
|
-
this.dispatch(addAssetTypeFieldValues(offlineAssetTypeFieldValues));
|
|
7558
|
-
promise.then((result) => {
|
|
7559
|
-
this.dispatch(updateAssetTypeFieldValues(result));
|
|
7560
|
-
return result;
|
|
7561
|
-
}).catch(() => {
|
|
7562
|
-
this.dispatch(deleteAssetTypeFieldValues(offlineAssetTypeFieldValues.offline_id));
|
|
7563
|
-
});
|
|
7564
|
-
return [offlineAssetTypeFieldValues, promise];
|
|
7565
|
-
}
|
|
7566
|
-
bulkAdd(payload, batchSize) {
|
|
7567
|
-
var _a2;
|
|
7568
|
-
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7569
|
-
const { values } = separateFilesFromValues(payload.values);
|
|
7570
|
-
const offlineAssetTypeFieldValuesMany = [];
|
|
7571
|
-
const batches = chunkArray(payload.payloads, batchSize ?? payload.payloads.length);
|
|
7572
|
-
const batchPayloads = [];
|
|
7573
|
-
for (const batch of batches) {
|
|
7574
|
-
const assetTypeFieldValuesPayloads = [];
|
|
7575
|
-
for (const payload2 of batch) {
|
|
7576
|
-
const offlineAssetTypeFieldValues = offline({
|
|
7577
|
-
...payload2,
|
|
7578
|
-
values: separateFilesFromValues(payload2.values).values,
|
|
7579
|
-
created_by: (_a2 = this.client.store.getState().userReducer.currentUser) == null ? void 0 : _a2.id,
|
|
7580
|
-
submitted_at: submittedAt
|
|
7581
|
-
});
|
|
7582
|
-
offlineAssetTypeFieldValuesMany.push(offlineAssetTypeFieldValues);
|
|
7583
|
-
assetTypeFieldValuesPayloads.push({
|
|
7584
|
-
offline_id: offlineAssetTypeFieldValues.offline_id,
|
|
7585
|
-
asset: payload2.asset,
|
|
7586
|
-
fields_revision: payload2.fields_revision,
|
|
7587
|
-
published_at: payload2.published_at,
|
|
7588
|
-
values: offlineAssetTypeFieldValues.values
|
|
7589
|
-
});
|
|
7590
|
-
}
|
|
7591
|
-
batchPayloads.push({
|
|
7592
|
-
submitted_at: submittedAt,
|
|
7593
|
-
values,
|
|
7594
|
-
field_values: assetTypeFieldValuesPayloads
|
|
7595
|
-
});
|
|
7596
|
-
}
|
|
7597
|
-
this.dispatch(addAssetTypeFieldValuesMany(offlineAssetTypeFieldValuesMany));
|
|
7598
|
-
const promises = [];
|
|
7599
|
-
for (const payload2 of batchPayloads) {
|
|
7600
|
-
const assetIds = payload2.field_values.map((x) => x.asset);
|
|
7601
|
-
const assetTypeFieldsIds = payload2.field_values.map((x) => x.fields_revision);
|
|
7602
|
-
const assetTypeFieldValuesIds = payload2.field_values.map((x) => x.offline_id);
|
|
7603
|
-
const promise = this.enqueueRequest({
|
|
7604
|
-
description: "Bulk add asset type field values",
|
|
7605
|
-
method: HttpMethod.POST,
|
|
7606
|
-
url: "/asset-type-field-values/bulk/",
|
|
7607
|
-
payload: payload2,
|
|
7608
|
-
blockers: [...assetIds, ...assetTypeFieldsIds],
|
|
7609
|
-
blocks: assetTypeFieldValuesIds
|
|
7610
|
-
});
|
|
7611
|
-
promises.push(promise);
|
|
7612
|
-
}
|
|
7613
|
-
void Promise.all(promises).then((results) => {
|
|
7614
|
-
this.dispatch(updateAssetTypeFieldValuesMany(results.flat()));
|
|
7615
|
-
}).catch(() => {
|
|
7616
|
-
this.dispatch(deleteAssetTypeFieldValuesMany(offlineAssetTypeFieldValuesMany.map((x) => x.offline_id)));
|
|
7617
|
-
});
|
|
7618
|
-
return [offlineAssetTypeFieldValuesMany, promises];
|
|
7619
|
-
}
|
|
7620
|
-
update(payload) {
|
|
7621
|
-
const { store } = this.client;
|
|
7622
|
-
const state = store.getState();
|
|
7623
|
-
const assetTypeFieldValues = selectAssetTypeFieldValuesById(payload.offline_id)(state);
|
|
7624
|
-
if (!assetTypeFieldValues) {
|
|
7625
|
-
throw new Error(`Expected AssetTypeFieldValues with offline_id ${payload.offline_id} to exist`);
|
|
7626
|
-
}
|
|
7627
|
-
const { values } = separateFilesFromValues(payload.values ?? {});
|
|
7628
|
-
const updatedAssetTypeFieldValues = {
|
|
7629
|
-
...assetTypeFieldValues,
|
|
7630
|
-
...payload,
|
|
7631
|
-
// values could also have a partial update
|
|
7632
|
-
values: {
|
|
7633
|
-
...assetTypeFieldValues.values,
|
|
7634
|
-
...values
|
|
7635
|
-
}
|
|
7636
|
-
};
|
|
7637
|
-
this.dispatch(updateAssetTypeFieldValues(updatedAssetTypeFieldValues));
|
|
7638
|
-
const promise = this.enqueueRequest({
|
|
7639
|
-
description: "Delete asset type field values",
|
|
7640
|
-
method: HttpMethod.PATCH,
|
|
7641
|
-
url: `/asset-type-field-values/${payload.offline_id}/`,
|
|
7642
|
-
payload,
|
|
7643
|
-
blockers: [
|
|
7644
|
-
updatedAssetTypeFieldValues.offline_id,
|
|
7645
|
-
updatedAssetTypeFieldValues.fields_revision,
|
|
7646
|
-
updatedAssetTypeFieldValues.asset
|
|
7647
|
-
],
|
|
7648
|
-
blocks: [updatedAssetTypeFieldValues.offline_id]
|
|
7649
|
-
});
|
|
7650
|
-
promise.then((result) => {
|
|
7651
|
-
this.dispatch(updateAssetTypeFieldValues(result));
|
|
7652
|
-
}).catch(() => {
|
|
7653
|
-
this.dispatch(updateAssetTypeFieldValues(assetTypeFieldValues));
|
|
7654
|
-
});
|
|
7655
|
-
return [updatedAssetTypeFieldValues, promise];
|
|
7656
|
-
}
|
|
7657
|
-
async delete(id) {
|
|
7658
|
-
const { store } = this.client;
|
|
7659
|
-
const state = store.getState();
|
|
7660
|
-
const assetTypeFieldValues = selectAssetTypeFieldValuesById(id)(state);
|
|
7661
|
-
if (!assetTypeFieldValues) {
|
|
7662
|
-
throw new Error(`Expected submission with offline_id ${id} to exist`);
|
|
7663
|
-
}
|
|
7664
|
-
const assetTypeFieldValuesAttachments = selectAttachmentsOfAssetTypeFieldValues(id)(state);
|
|
7665
|
-
this.dispatch(deleteAssetTypeFieldValues(id));
|
|
7666
|
-
this.dispatch(deleteAssetTypeFieldValuesAttachments(assetTypeFieldValuesAttachments.map((x) => x.offline_id)));
|
|
7667
|
-
try {
|
|
7668
|
-
await this.enqueueRequest({
|
|
7669
|
-
description: "Delete asset type field values",
|
|
7670
|
-
method: HttpMethod.DELETE,
|
|
7671
|
-
url: `/asset-type-field-values/${id}/`,
|
|
7672
|
-
blockers: [id],
|
|
7673
|
-
blocks: []
|
|
7674
|
-
});
|
|
7675
|
-
} catch (e) {
|
|
7676
|
-
this.dispatch(addAssetTypeFieldValues(assetTypeFieldValues));
|
|
7677
|
-
this.dispatch(addAssetTypeFieldValuesAttachments(assetTypeFieldValuesAttachments));
|
|
7678
|
-
throw e;
|
|
7679
|
-
}
|
|
7680
|
-
}
|
|
7681
|
-
async refreshStore(projectId) {
|
|
7682
|
-
const result = await this.enqueueRequest({
|
|
7683
|
-
description: "Get asset type field values",
|
|
7684
|
-
method: HttpMethod.GET,
|
|
7685
|
-
url: "/asset-type-field-values/",
|
|
7686
|
-
queryParams: {
|
|
7687
|
-
project: projectId.toString()
|
|
7688
|
-
},
|
|
7689
|
-
blockers: [],
|
|
7690
|
-
blocks: []
|
|
7691
|
-
});
|
|
7692
|
-
this.dispatch(initializeAssetTypeFieldValues(result));
|
|
7693
|
-
}
|
|
7694
|
-
}
|
|
7695
|
-
class AssetTypeFieldValuesAttachmentService extends BaseUploadService {
|
|
7696
|
-
async bulkAdd(payloads, batchSize) {
|
|
7697
|
-
var _a2;
|
|
7698
|
-
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7699
|
-
const createdBy = (_a2 = this.client.store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
7700
|
-
const batches = chunkArray(payloads, batchSize ?? payloads.length);
|
|
7701
|
-
const offlineAssetTypeFieldValuesAttachments = [];
|
|
7702
|
-
const batchPayloads = [];
|
|
7703
|
-
for (const batch of batches) {
|
|
7704
|
-
const filePayloads = {};
|
|
7705
|
-
const attachmentPayloads = [];
|
|
7706
|
-
for (const payload of batch) {
|
|
7707
|
-
const { fieldValuesId, fieldIdentifier, file } = payload;
|
|
7708
|
-
const filePayload = await this.getFilePayload(file);
|
|
7709
|
-
if (!(filePayload.sha1 in filePayloads))
|
|
7710
|
-
filePayloads[filePayload.sha1] = filePayload;
|
|
7711
|
-
const offlineAssetTypeFieldValuesAttachment = offline({
|
|
7712
|
-
file: URL.createObjectURL(file),
|
|
7713
|
-
file_type: file.type,
|
|
7714
|
-
file_name: file.name,
|
|
7715
|
-
file_sha1: filePayload.sha1,
|
|
7716
|
-
created_by: createdBy,
|
|
7717
|
-
field_values: fieldValuesId,
|
|
7718
|
-
submitted_at: submittedAt,
|
|
7719
|
-
field_identifier: fieldIdentifier
|
|
7720
|
-
});
|
|
7721
|
-
offlineAssetTypeFieldValuesAttachments.push(offlineAssetTypeFieldValuesAttachment);
|
|
7722
|
-
const attachmentPayload = {
|
|
7723
|
-
offline_id: offlineAssetTypeFieldValuesAttachment.offline_id,
|
|
7724
|
-
file_name: file.name,
|
|
7725
|
-
file_sha1: filePayload.sha1,
|
|
7726
|
-
file_extension: filePayload.extension,
|
|
7727
|
-
field_identifier: fieldIdentifier,
|
|
7728
|
-
field_values: fieldValuesId
|
|
7729
|
-
};
|
|
7730
|
-
attachmentPayloads.push(attachmentPayload);
|
|
7731
|
-
}
|
|
7732
|
-
batchPayloads.push({
|
|
7733
|
-
submitted_at: submittedAt,
|
|
7734
|
-
attachments: attachmentPayloads,
|
|
7735
|
-
files: Object.values(filePayloads)
|
|
7736
|
-
});
|
|
7737
|
-
}
|
|
7738
|
-
this.dispatch(addAssetTypeFieldValuesAttachments(offlineAssetTypeFieldValuesAttachments));
|
|
7739
|
-
const promises = batchPayloads.map((payload) => {
|
|
7740
|
-
return this.enqueueRequest({
|
|
7741
|
-
description: "Add asset type field values attachments",
|
|
7742
|
-
method: HttpMethod.POST,
|
|
7743
|
-
url: "/asset-type-field-values-attachments/bulk/",
|
|
7744
|
-
payload,
|
|
7745
|
-
blockers: payload.attachments.map((payload2) => payload2.field_values),
|
|
7746
|
-
blocks: payload.attachments.map((payload2) => payload2.offline_id)
|
|
7747
|
-
});
|
|
7748
|
-
});
|
|
7749
|
-
Promise.all(promises).then((result) => {
|
|
7750
|
-
for (const res of result)
|
|
7751
|
-
this.processPresignedUrls(res.presigned_urls);
|
|
7752
|
-
const attachments = result.flatMap((res) => res.attachments);
|
|
7753
|
-
this.dispatch(updateAssetTypeFieldValuesAttachments(attachments));
|
|
7754
|
-
}).catch((error) => {
|
|
7755
|
-
this.dispatch(
|
|
7756
|
-
deleteAssetTypeFieldValuesAttachments(
|
|
7757
|
-
offlineAssetTypeFieldValuesAttachments.map((attachment) => attachment.offline_id)
|
|
7758
|
-
)
|
|
7759
|
-
);
|
|
7760
|
-
throw error;
|
|
7761
|
-
});
|
|
7762
|
-
return [
|
|
7763
|
-
offlineAssetTypeFieldValuesAttachments,
|
|
7764
|
-
promises.map((promise) => promise.then(({ attachments }) => attachments))
|
|
7765
|
-
];
|
|
7766
|
-
}
|
|
7767
|
-
async bulkDelete(ids) {
|
|
7768
|
-
const { store } = this.client;
|
|
7769
|
-
const state = store.getState();
|
|
7770
|
-
const formSubmissionAttachments = selectFormSubmissionAttachemntsByIds(ids)(state);
|
|
7771
|
-
this.dispatch(deleteFormSubmissionAttachments(ids));
|
|
7772
|
-
try {
|
|
7773
|
-
await this.enqueueRequest({
|
|
7774
|
-
description: "Delete asset type field values attachments",
|
|
7775
|
-
method: HttpMethod.DELETE,
|
|
7776
|
-
url: "/asset-type-field-values-attachments/bulk/",
|
|
7777
|
-
payload: { attachment_ids: ids },
|
|
7778
|
-
blockers: ids,
|
|
7779
|
-
blocks: []
|
|
7780
|
-
});
|
|
7781
|
-
} catch (e) {
|
|
7782
|
-
this.dispatch(addFormSubmissionAttachments(formSubmissionAttachments));
|
|
7783
|
-
throw e;
|
|
7784
|
-
}
|
|
7785
|
-
}
|
|
7786
|
-
async refreshStore(projectId) {
|
|
7787
|
-
const result = await this.enqueueRequest({
|
|
7788
|
-
description: "Get asset type field values attachments",
|
|
7789
|
-
method: HttpMethod.GET,
|
|
7790
|
-
url: "/asset-type-field-values-attachments/",
|
|
7791
|
-
queryParams: {
|
|
7792
|
-
project: projectId.toString()
|
|
7793
|
-
},
|
|
7794
|
-
blockers: [],
|
|
7795
|
-
blocks: []
|
|
7796
|
-
});
|
|
7797
|
-
this.dispatch(initializeAssetTypeFieldValuesAttachments(result));
|
|
7798
|
-
}
|
|
7799
|
-
}
|
|
7800
|
-
class IssueTypeFieldsAttachmentService extends BaseUploadService {
|
|
7801
|
-
async bulkAdd(payloads) {
|
|
7802
|
-
var _a2;
|
|
7803
|
-
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7804
|
-
const createdBy = (_a2 = this.client.store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
7805
|
-
const filePayloads = {};
|
|
7806
|
-
const offlineIssueTypeFieldsAttachments = [];
|
|
7807
|
-
const attachmentPayloads = [];
|
|
7808
|
-
for (const payload of payloads) {
|
|
7809
|
-
const { fieldsRevisionId, fieldIdentifier, file } = payload;
|
|
7810
|
-
const filePayload = await this.getFilePayload(file);
|
|
7811
|
-
if (!(filePayload.sha1 in filePayloads))
|
|
7812
|
-
filePayloads[filePayload.sha1] = filePayload;
|
|
7813
|
-
const offlineIssueTypeFieldsAttachment = offline({
|
|
7814
|
-
file: URL.createObjectURL(file),
|
|
7815
|
-
file_type: file.type,
|
|
7816
|
-
file_name: file.name,
|
|
7817
|
-
file_sha1: filePayload.sha1,
|
|
7818
|
-
created_by: createdBy,
|
|
7819
|
-
fields_revision: fieldsRevisionId,
|
|
7820
|
-
submitted_at: submittedAt,
|
|
7821
|
-
field_identifier: fieldIdentifier
|
|
7822
|
-
});
|
|
7823
|
-
offlineIssueTypeFieldsAttachments.push(offlineIssueTypeFieldsAttachment);
|
|
7824
|
-
const attachmentPayload = {
|
|
7825
|
-
offline_id: offlineIssueTypeFieldsAttachment.offline_id,
|
|
7826
|
-
file_name: file.name,
|
|
7827
|
-
file_extension: filePayload.extension,
|
|
7828
|
-
field_identifier: fieldIdentifier,
|
|
7829
|
-
file_sha1: filePayload.sha1,
|
|
7830
|
-
fields_revision: fieldsRevisionId
|
|
7831
|
-
};
|
|
7832
|
-
attachmentPayloads.push(attachmentPayload);
|
|
7833
|
-
}
|
|
7834
|
-
this.dispatch(addIssueTypeFieldsAttachments(offlineIssueTypeFieldsAttachments));
|
|
7835
|
-
const promise = this.enqueueRequest({
|
|
7836
|
-
description: "Add issue type fields attachments",
|
|
7837
|
-
method: HttpMethod.POST,
|
|
7838
|
-
url: "/issue-type-fields-attachments/bulk/",
|
|
7839
|
-
payload: {
|
|
7840
|
-
submitted_at: submittedAt,
|
|
7841
|
-
attachments: attachmentPayloads,
|
|
7842
|
-
files: Object.values(filePayloads)
|
|
7843
|
-
},
|
|
7844
|
-
blockers: offlineIssueTypeFieldsAttachments.map((attachment) => attachment.fields_revision),
|
|
7845
|
-
blocks: offlineIssueTypeFieldsAttachments.map((attachment) => attachment.offline_id)
|
|
7846
|
-
});
|
|
7847
|
-
promise.then((result) => {
|
|
7848
|
-
this.processPresignedUrls(result.presigned_urls);
|
|
7849
|
-
this.dispatch(updateIssueTypeFieldsAttachments(result.attachments));
|
|
7850
|
-
}).catch(() => {
|
|
7851
|
-
this.dispatch(
|
|
7852
|
-
deleteIssueTypeFieldsAttachments(
|
|
7853
|
-
offlineIssueTypeFieldsAttachments.map((attachment) => attachment.offline_id)
|
|
7854
|
-
)
|
|
7855
|
-
);
|
|
7856
|
-
});
|
|
7857
|
-
return [offlineIssueTypeFieldsAttachments, promise.then(({ attachments }) => attachments)];
|
|
7858
|
-
}
|
|
7859
|
-
async refreshStore(organizationId) {
|
|
7860
|
-
const result = await this.enqueueRequest({
|
|
7861
|
-
description: "get issue type fields attachments",
|
|
7862
|
-
method: HttpMethod.GET,
|
|
7863
|
-
url: "/issue-type-fields-attachments/",
|
|
7864
|
-
queryParams: {
|
|
7865
|
-
organization: organizationId.toString()
|
|
7866
|
-
},
|
|
7867
|
-
blockers: [organizationId.toString()],
|
|
7868
|
-
blocks: []
|
|
7869
|
-
});
|
|
7870
|
-
this.dispatch(initializeIssueTypeFieldsAttachments(result));
|
|
7871
|
-
}
|
|
7872
|
-
}
|
|
7873
|
-
class IssueTypeFieldsService extends BaseApiService {
|
|
7874
|
-
add(payload) {
|
|
7875
|
-
var _a2;
|
|
7876
|
-
const { store } = this.client;
|
|
7877
|
-
const createdBy = (_a2 = store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
7878
|
-
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7879
|
-
const offlineIssueTypeFields = offline({
|
|
7880
|
-
...payload,
|
|
7881
|
-
created_by: createdBy,
|
|
7882
|
-
submitted_at: submittedAt
|
|
7883
|
-
});
|
|
7884
|
-
this.dispatch(addIssueTypeFields(offlineIssueTypeFields));
|
|
7885
|
-
const promise = this.enqueueRequest({
|
|
7886
|
-
description: "Add Issue Type Fields",
|
|
7887
|
-
method: HttpMethod.POST,
|
|
7888
|
-
url: "/issue-type-fields/",
|
|
7889
|
-
payload: offlineIssueTypeFields,
|
|
7890
|
-
blockers: [offlineIssueTypeFields.issue_type],
|
|
7891
|
-
blocks: [offlineIssueTypeFields.offline_id]
|
|
7892
|
-
});
|
|
7893
|
-
promise.then((response) => {
|
|
7894
|
-
this.dispatch(updateIssueTypeFields(response));
|
|
7895
|
-
}).catch((error) => {
|
|
7896
|
-
this.dispatch(deleteIssueTypeFields(offlineIssueTypeFields.offline_id));
|
|
7897
|
-
throw error;
|
|
7898
|
-
});
|
|
7899
|
-
return [offlineIssueTypeFields, promise];
|
|
7900
|
-
}
|
|
7901
|
-
async refreshStore(organizationId) {
|
|
7902
|
-
const result = await this.enqueueRequest({
|
|
7903
|
-
description: "Get Issue Type Fields",
|
|
7904
|
-
method: HttpMethod.GET,
|
|
7905
|
-
url: "/issue-type-fields/",
|
|
7906
|
-
queryParams: {
|
|
7907
|
-
organization: organizationId.toString()
|
|
7908
|
-
},
|
|
7909
|
-
blockers: [],
|
|
7910
|
-
blocks: []
|
|
7911
|
-
});
|
|
7912
|
-
this.dispatch(initializeIssueTypeFields(result));
|
|
7913
|
-
}
|
|
7914
|
-
}
|
|
7915
|
-
class IssueTypeFieldValuesAttachmentService extends BaseUploadService {
|
|
7916
|
-
async bulkAdd(payloads) {
|
|
7917
|
-
var _a2;
|
|
7918
|
-
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7919
|
-
const createdBy = (_a2 = this.client.store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
7920
|
-
const filePayloads = {};
|
|
7921
|
-
const offlineIssueTypeFieldValuesAttachments = [];
|
|
7922
|
-
const attachmentPayloads = [];
|
|
7923
|
-
for (const payload of payloads) {
|
|
7924
|
-
const { fieldValuesId, fieldIdentifier, file } = payload;
|
|
7925
|
-
const filePayload = await this.getFilePayload(file);
|
|
7926
|
-
if (!(filePayload.sha1 in filePayloads))
|
|
7927
|
-
filePayloads[filePayload.sha1] = filePayload;
|
|
7928
|
-
const offlineIssueTypeFieldValuesAttachment = offline({
|
|
7929
|
-
file: URL.createObjectURL(file),
|
|
7930
|
-
file_type: file.type,
|
|
7931
|
-
file_name: file.name,
|
|
7932
|
-
file_sha1: filePayload.sha1,
|
|
7933
|
-
created_by: createdBy,
|
|
7934
|
-
field_values: fieldValuesId,
|
|
7935
|
-
submitted_at: submittedAt,
|
|
7936
|
-
field_identifier: fieldIdentifier
|
|
7937
|
-
});
|
|
7938
|
-
offlineIssueTypeFieldValuesAttachments.push(offlineIssueTypeFieldValuesAttachment);
|
|
7939
|
-
const attachmentPayload = {
|
|
7940
|
-
offline_id: offlineIssueTypeFieldValuesAttachment.offline_id,
|
|
7941
|
-
file_name: file.name,
|
|
7942
|
-
file_sha1: filePayload.sha1,
|
|
7943
|
-
file_extension: filePayload.extension,
|
|
7944
|
-
field_identifier: fieldIdentifier,
|
|
7945
|
-
field_values: fieldValuesId
|
|
7946
|
-
};
|
|
7947
|
-
attachmentPayloads.push(attachmentPayload);
|
|
7948
|
-
}
|
|
7949
|
-
this.dispatch(addIssueTypeFieldValuesAttachments(offlineIssueTypeFieldValuesAttachments));
|
|
7950
|
-
const promise = this.enqueueRequest({
|
|
7951
|
-
description: "Add issue type field values attachments",
|
|
7952
|
-
method: HttpMethod.POST,
|
|
7953
|
-
url: "/issue-type-field-values-attachments/bulk/",
|
|
7954
|
-
payload: {
|
|
7955
|
-
submitted_at: submittedAt,
|
|
7956
|
-
attachments: attachmentPayloads,
|
|
7957
|
-
files: Object.values(filePayloads)
|
|
7958
|
-
},
|
|
7959
|
-
blockers: offlineIssueTypeFieldValuesAttachments.map((attachment) => attachment.field_values),
|
|
7960
|
-
blocks: offlineIssueTypeFieldValuesAttachments.map((attachment) => attachment.offline_id)
|
|
7961
|
-
});
|
|
7962
|
-
promise.then(({ presigned_urls, attachments }) => {
|
|
7963
|
-
this.processPresignedUrls(presigned_urls);
|
|
7964
|
-
this.dispatch(updateIssueTypeFieldValuesAttachments(attachments));
|
|
7965
|
-
}).catch((error) => {
|
|
7966
|
-
this.dispatch(
|
|
7967
|
-
deleteIssueTypeFieldValuesAttachments(
|
|
7968
|
-
offlineIssueTypeFieldValuesAttachments.map((attachment) => attachment.offline_id)
|
|
7969
|
-
)
|
|
7970
|
-
);
|
|
7971
|
-
throw error;
|
|
7972
|
-
});
|
|
7973
|
-
return [offlineIssueTypeFieldValuesAttachments, promise.then(({ attachments }) => attachments)];
|
|
7974
|
-
}
|
|
7975
|
-
async bulkDelete(attachmentsIds) {
|
|
7976
|
-
const { store } = this.client;
|
|
7977
|
-
const state = store.getState();
|
|
7978
|
-
const formSubmissionAttachments = selectFormSubmissionAttachemntsByIds(attachmentsIds)(state);
|
|
7979
|
-
this.dispatch(deleteFormSubmissionAttachments(attachmentsIds));
|
|
7980
|
-
try {
|
|
7981
|
-
await this.enqueueRequest({
|
|
7982
|
-
description: "Delete issue type field values attachments",
|
|
7983
|
-
method: HttpMethod.DELETE,
|
|
7984
|
-
url: "/issue-type-field-values-attachments/bulk/",
|
|
7985
|
-
payload: { attachment_ids: attachmentsIds },
|
|
7986
|
-
blockers: attachmentsIds,
|
|
7987
|
-
blocks: []
|
|
7988
|
-
});
|
|
7989
|
-
} catch (e) {
|
|
7990
|
-
this.dispatch(addFormSubmissionAttachments(formSubmissionAttachments));
|
|
7991
|
-
throw e;
|
|
7992
|
-
}
|
|
7993
|
-
}
|
|
7994
|
-
async refreshStore(projectId) {
|
|
7995
|
-
const result = await this.enqueueRequest({
|
|
7996
|
-
description: "Get issue type field values attachments",
|
|
7997
|
-
method: HttpMethod.GET,
|
|
7998
|
-
url: "/issue-type-field-values-attachments/",
|
|
7999
|
-
queryParams: {
|
|
8000
|
-
project: projectId.toString()
|
|
8001
|
-
},
|
|
8002
|
-
blockers: [],
|
|
8003
|
-
blocks: []
|
|
8004
|
-
});
|
|
8005
|
-
this.dispatch(initializeIssueTypeFieldValuesAttachments(result));
|
|
8006
|
-
}
|
|
8007
|
-
}
|
|
8008
|
-
class IssueTypeFieldValuesService extends BaseApiService {
|
|
8009
|
-
add(payload) {
|
|
8010
|
-
var _a2;
|
|
8011
|
-
const { store } = this.client;
|
|
8012
|
-
const state = store.getState();
|
|
8013
|
-
const { values } = separateFilesFromValues(payload.values);
|
|
8014
|
-
const offlineIssueTypeFieldValues = offline({
|
|
8015
|
-
...payload,
|
|
8016
|
-
values,
|
|
8017
|
-
created_by: (_a2 = state.userReducer.currentUser) == null ? void 0 : _a2.id,
|
|
8018
|
-
submitted_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
8019
|
-
});
|
|
8020
|
-
const promise = this.enqueueRequest({
|
|
8021
|
-
description: "Add issue type field values",
|
|
8022
|
-
method: HttpMethod.POST,
|
|
8023
|
-
url: "/issue-type-field-values/",
|
|
8024
|
-
payload: offlineIssueTypeFieldValues,
|
|
8025
|
-
blockers: [payload.issue, payload.fields_revision],
|
|
8026
|
-
blocks: [offlineIssueTypeFieldValues.offline_id]
|
|
8027
|
-
});
|
|
8028
|
-
this.dispatch(addIssueTypeFieldValues(offlineIssueTypeFieldValues));
|
|
8029
|
-
promise.then((result) => {
|
|
8030
|
-
this.dispatch(updateIssueTypeFieldValues(result));
|
|
8031
|
-
return result;
|
|
8032
|
-
}).catch(() => {
|
|
8033
|
-
this.dispatch(deleteIssueTypeFieldValues(offlineIssueTypeFieldValues.offline_id));
|
|
8034
|
-
});
|
|
8035
|
-
return [offlineIssueTypeFieldValues, promise];
|
|
8036
|
-
}
|
|
8037
|
-
update(payload) {
|
|
8038
|
-
const { store } = this.client;
|
|
8039
|
-
const state = store.getState();
|
|
8040
|
-
const issueTypeFieldValues = selectIssueTypeFieldValuesById(payload.offline_id)(state);
|
|
8041
|
-
if (!issueTypeFieldValues) {
|
|
8042
|
-
throw new Error(`Expected IssueTypeFieldValues with offline_id ${payload.offline_id} to exist`);
|
|
8043
|
-
}
|
|
8044
|
-
const { values } = separateFilesFromValues(payload.values ?? {});
|
|
8045
|
-
const updatedIssueTypeFieldValues = {
|
|
8046
|
-
...issueTypeFieldValues,
|
|
8047
|
-
...payload,
|
|
8048
|
-
// values could also have a partial update
|
|
8049
|
-
values: {
|
|
8050
|
-
...issueTypeFieldValues.values,
|
|
8051
|
-
...values
|
|
8052
|
-
}
|
|
8053
|
-
};
|
|
8054
|
-
this.dispatch(updateIssueTypeFieldValues(updatedIssueTypeFieldValues));
|
|
8055
|
-
const promise = this.enqueueRequest({
|
|
8056
|
-
description: "Update issue type field values",
|
|
8057
|
-
method: HttpMethod.PATCH,
|
|
8058
|
-
url: `/issue-type-field-values/${payload.offline_id}/`,
|
|
8059
|
-
payload,
|
|
8060
|
-
blockers: [
|
|
8061
|
-
updatedIssueTypeFieldValues.offline_id,
|
|
8062
|
-
updatedIssueTypeFieldValues.fields_revision,
|
|
8063
|
-
updatedIssueTypeFieldValues.issue
|
|
8064
|
-
],
|
|
8065
|
-
blocks: [updatedIssueTypeFieldValues.offline_id]
|
|
8066
|
-
});
|
|
8067
|
-
promise.then((result) => {
|
|
8068
|
-
this.dispatch(updateIssueTypeFieldValues(result));
|
|
8069
|
-
}).catch(() => {
|
|
8070
|
-
this.dispatch(updateIssueTypeFieldValues(issueTypeFieldValues));
|
|
8071
|
-
});
|
|
8072
|
-
return [updatedIssueTypeFieldValues, promise];
|
|
8073
|
-
}
|
|
8074
|
-
async delete(id) {
|
|
8075
|
-
const { store } = this.client;
|
|
8076
|
-
const state = store.getState();
|
|
8077
|
-
const issueTypeFieldValues = selectIssueTypeFieldValuesById(id)(state);
|
|
8078
|
-
if (!issueTypeFieldValues) {
|
|
8079
|
-
throw new Error(`Expected submission with offline_id ${id} to exist`);
|
|
8080
|
-
}
|
|
8081
|
-
const issueTypeFieldValuesAttachments = selectAttachmentsOfIssueTypeFieldValues(id)(state);
|
|
8082
|
-
this.dispatch(deleteIssueTypeFieldValues(id));
|
|
8083
|
-
this.dispatch(deleteIssueTypeFieldValuesAttachments(issueTypeFieldValuesAttachments.map((x) => x.offline_id)));
|
|
8084
|
-
try {
|
|
8085
|
-
await this.enqueueRequest({
|
|
8086
|
-
description: "Delete issue type field values",
|
|
8087
|
-
method: HttpMethod.DELETE,
|
|
8088
|
-
url: `/issue-type-field-values/${id}/`,
|
|
8089
|
-
blockers: [id],
|
|
8090
|
-
blocks: []
|
|
8091
|
-
});
|
|
8092
|
-
} catch (e) {
|
|
8093
|
-
this.dispatch(addIssueTypeFieldValues(issueTypeFieldValues));
|
|
8094
|
-
this.dispatch(addIssueTypeFieldValuesAttachments(issueTypeFieldValuesAttachments));
|
|
8095
|
-
throw e;
|
|
8096
|
-
}
|
|
8097
|
-
}
|
|
8098
|
-
async refreshStore(projectId) {
|
|
8099
|
-
const result = await this.enqueueRequest({
|
|
8100
|
-
description: "Get issue type field values",
|
|
8101
|
-
method: HttpMethod.GET,
|
|
8102
|
-
url: "/issue-type-field-values/",
|
|
8103
|
-
queryParams: {
|
|
8104
|
-
project: projectId.toString()
|
|
8105
|
-
},
|
|
8106
|
-
blockers: [],
|
|
8107
|
-
blocks: []
|
|
8108
|
-
});
|
|
8109
|
-
this.dispatch(initializeIssueTypeFieldValues(result));
|
|
8110
|
-
}
|
|
8111
|
-
}
|
|
8112
7278
|
var VerificationCodeType = /* @__PURE__ */ ((VerificationCodeType2) => {
|
|
8113
7279
|
VerificationCodeType2[VerificationCodeType2["USER_REGISTRATION"] = 0] = "USER_REGISTRATION";
|
|
8114
7280
|
VerificationCodeType2[VerificationCodeType2["APPLICATION_INVITE"] = 2] = "APPLICATION_INVITE";
|
|
@@ -8126,10 +7292,6 @@ export {
|
|
|
8126
7292
|
AssetStageCompletionService,
|
|
8127
7293
|
AssetStageService,
|
|
8128
7294
|
AssetTypeAttachmentService,
|
|
8129
|
-
AssetTypeFieldValuesAttachmentService,
|
|
8130
|
-
AssetTypeFieldValuesService,
|
|
8131
|
-
AssetTypeFieldsAttachmentService,
|
|
8132
|
-
AssetTypeFieldsService,
|
|
8133
7295
|
AssetTypeService,
|
|
8134
7296
|
AttachmentModel,
|
|
8135
7297
|
BaseApiService,
|
|
@@ -8145,10 +7307,7 @@ export {
|
|
|
8145
7307
|
EmailDomainsService,
|
|
8146
7308
|
EmailVerificationService,
|
|
8147
7309
|
FileService,
|
|
8148
|
-
FormRevisionAttachmentService,
|
|
8149
|
-
FormRevisionService,
|
|
8150
7310
|
FormService,
|
|
8151
|
-
FormSubmissionAttachmentService,
|
|
8152
7311
|
FormSubmissionService,
|
|
8153
7312
|
GREEN,
|
|
8154
7313
|
GeoImageService,
|
|
@@ -8159,10 +7318,6 @@ export {
|
|
|
8159
7318
|
IssuePriority,
|
|
8160
7319
|
IssueService,
|
|
8161
7320
|
IssueStatus,
|
|
8162
|
-
IssueTypeFieldValuesAttachmentService,
|
|
8163
|
-
IssueTypeFieldValuesService,
|
|
8164
|
-
IssueTypeFieldsAttachmentService,
|
|
8165
|
-
IssueTypeFieldsService,
|
|
8166
7321
|
IssueTypeService,
|
|
8167
7322
|
IssueUpdateChange,
|
|
8168
7323
|
IssueUpdateService,
|
|
@@ -8202,14 +7357,6 @@ export {
|
|
|
8202
7357
|
addAssetType,
|
|
8203
7358
|
addAssetTypeAttachment,
|
|
8204
7359
|
addAssetTypeAttachments,
|
|
8205
|
-
addAssetTypeFieldValues,
|
|
8206
|
-
addAssetTypeFieldValuesAttachment,
|
|
8207
|
-
addAssetTypeFieldValuesAttachments,
|
|
8208
|
-
addAssetTypeFieldValuesMany,
|
|
8209
|
-
addAssetTypeFields,
|
|
8210
|
-
addAssetTypeFieldsAttachment,
|
|
8211
|
-
addAssetTypeFieldsAttachments,
|
|
8212
|
-
addAssetTypeFieldsMany,
|
|
8213
7360
|
addAssetTypes,
|
|
8214
7361
|
addAssets,
|
|
8215
7362
|
addCategory,
|
|
@@ -8238,14 +7385,6 @@ export {
|
|
|
8238
7385
|
addIssueComment,
|
|
8239
7386
|
addIssueComments,
|
|
8240
7387
|
addIssueType,
|
|
8241
|
-
addIssueTypeFieldValues,
|
|
8242
|
-
addIssueTypeFieldValuesAttachment,
|
|
8243
|
-
addIssueTypeFieldValuesAttachments,
|
|
8244
|
-
addIssueTypeFieldValuesMany,
|
|
8245
|
-
addIssueTypeFields,
|
|
8246
|
-
addIssueTypeFieldsAttachment,
|
|
8247
|
-
addIssueTypeFieldsAttachments,
|
|
8248
|
-
addIssueTypeFieldsMany,
|
|
8249
7388
|
addIssueUpdate,
|
|
8250
7389
|
addIssueUpdates,
|
|
8251
7390
|
addIssues,
|
|
@@ -8271,28 +7410,16 @@ export {
|
|
|
8271
7410
|
assetStageSlice,
|
|
8272
7411
|
assetTypeAttachmentReducer,
|
|
8273
7412
|
assetTypeAttachmentSlice,
|
|
8274
|
-
assetTypeFieldValuesAttachmentReducer,
|
|
8275
|
-
assetTypeFieldValuesAttachmentSlice,
|
|
8276
|
-
assetTypeFieldValuesReducer,
|
|
8277
|
-
assetTypeFieldValuesSlice,
|
|
8278
|
-
assetTypeFieldsAttachmentReducer,
|
|
8279
|
-
assetTypeFieldsAttachmentSlice,
|
|
8280
|
-
assetTypeFieldsReducer,
|
|
8281
|
-
assetTypeFieldsSlice,
|
|
8282
7413
|
assetTypeReducer,
|
|
8283
7414
|
assetTypeSlice,
|
|
8284
7415
|
authReducer,
|
|
8285
7416
|
authSlice,
|
|
8286
7417
|
blobToBase64,
|
|
8287
|
-
boundsContainPoint,
|
|
8288
7418
|
categoryReducer,
|
|
8289
7419
|
categorySlice,
|
|
8290
7420
|
clearTokens,
|
|
8291
7421
|
constructUploadedFilePayloads,
|
|
8292
7422
|
coordinatesAreEqual,
|
|
8293
|
-
coordinatesToLiteral,
|
|
8294
|
-
coordinatesToText,
|
|
8295
|
-
coordinatesToUrlText,
|
|
8296
7423
|
createMultiPointGeometry,
|
|
8297
7424
|
createOfflineAction,
|
|
8298
7425
|
createPointGeometry,
|
|
@@ -8307,14 +7434,6 @@ export {
|
|
|
8307
7434
|
deleteAssetType,
|
|
8308
7435
|
deleteAssetTypeAttachment,
|
|
8309
7436
|
deleteAssetTypeAttachments,
|
|
8310
|
-
deleteAssetTypeFieldValues,
|
|
8311
|
-
deleteAssetTypeFieldValuesAttachment,
|
|
8312
|
-
deleteAssetTypeFieldValuesAttachments,
|
|
8313
|
-
deleteAssetTypeFieldValuesMany,
|
|
8314
|
-
deleteAssetTypeFields,
|
|
8315
|
-
deleteAssetTypeFieldsAttachment,
|
|
8316
|
-
deleteAssetTypeFieldsAttachments,
|
|
8317
|
-
deleteAssetTypeFieldsMany,
|
|
8318
7437
|
deleteAssetTypes,
|
|
8319
7438
|
deleteAssets,
|
|
8320
7439
|
deleteCategory,
|
|
@@ -8339,14 +7458,6 @@ export {
|
|
|
8339
7458
|
deleteIssueAttachments,
|
|
8340
7459
|
deleteIssueComment,
|
|
8341
7460
|
deleteIssueComments,
|
|
8342
|
-
deleteIssueTypeFieldValues,
|
|
8343
|
-
deleteIssueTypeFieldValuesAttachment,
|
|
8344
|
-
deleteIssueTypeFieldValuesAttachments,
|
|
8345
|
-
deleteIssueTypeFieldValuesMany,
|
|
8346
|
-
deleteIssueTypeFields,
|
|
8347
|
-
deleteIssueTypeFieldsAttachment,
|
|
8348
|
-
deleteIssueTypeFieldsAttachments,
|
|
8349
|
-
deleteIssueTypeFieldsMany,
|
|
8350
7461
|
deleteIssueUpdate,
|
|
8351
7462
|
deleteIssueUpdates,
|
|
8352
7463
|
deleteIssues,
|
|
@@ -8376,8 +7487,6 @@ export {
|
|
|
8376
7487
|
fileReducer,
|
|
8377
7488
|
fileSlice,
|
|
8378
7489
|
fileToBlob,
|
|
8379
|
-
flipBounds,
|
|
8380
|
-
flipCoordinates,
|
|
8381
7490
|
formReducer,
|
|
8382
7491
|
formRevisionAttachmentReducer,
|
|
8383
7492
|
formRevisionAttachmentSlice,
|
|
@@ -8403,10 +7512,6 @@ export {
|
|
|
8403
7512
|
initializeAssetStageCompletions,
|
|
8404
7513
|
initializeAssetStages,
|
|
8405
7514
|
initializeAssetTypeAttachments,
|
|
8406
|
-
initializeAssetTypeFieldValues,
|
|
8407
|
-
initializeAssetTypeFieldValuesAttachments,
|
|
8408
|
-
initializeAssetTypeFields,
|
|
8409
|
-
initializeAssetTypeFieldsAttachments,
|
|
8410
7515
|
initializeAssetTypes,
|
|
8411
7516
|
initializeAssets,
|
|
8412
7517
|
initializeCategories,
|
|
@@ -8421,10 +7526,6 @@ export {
|
|
|
8421
7526
|
initializeGeoImages,
|
|
8422
7527
|
initializeIssueAssociations,
|
|
8423
7528
|
initializeIssueAttachments,
|
|
8424
|
-
initializeIssueTypeFieldValues,
|
|
8425
|
-
initializeIssueTypeFieldValuesAttachments,
|
|
8426
|
-
initializeIssueTypeFields,
|
|
8427
|
-
initializeIssueTypeFieldsAttachments,
|
|
8428
7529
|
initializeIssueTypes,
|
|
8429
7530
|
initializeIssueUpdates,
|
|
8430
7531
|
initializeIssues,
|
|
@@ -8443,32 +7544,20 @@ export {
|
|
|
8443
7544
|
issueCommentSlice,
|
|
8444
7545
|
issueReducer,
|
|
8445
7546
|
issueSlice,
|
|
8446
|
-
issueTypeFieldValuesAttachmentReducer,
|
|
8447
|
-
issueTypeFieldValuesAttachmentSlice,
|
|
8448
|
-
issueTypeFieldValuesReducer,
|
|
8449
|
-
issueTypeFieldValuesSlice,
|
|
8450
|
-
issueTypeFieldsAttachmentReducer,
|
|
8451
|
-
issueTypeFieldsAttachmentSlice,
|
|
8452
|
-
issueTypeFieldsReducer,
|
|
8453
|
-
issueTypeFieldsSlice,
|
|
8454
7547
|
issueTypeReducer,
|
|
8455
7548
|
issueTypeSlice,
|
|
8456
7549
|
issueUpdateReducer,
|
|
8457
7550
|
issueUpdateSlice,
|
|
8458
7551
|
licenseReducer,
|
|
8459
7552
|
licenseSlice,
|
|
8460
|
-
literalToCoordinates,
|
|
8461
7553
|
logOnlyOnce,
|
|
8462
7554
|
markAsDeleted,
|
|
8463
7555
|
markForDeletion,
|
|
8464
7556
|
memoize,
|
|
8465
7557
|
moveDocument,
|
|
8466
7558
|
offline,
|
|
8467
|
-
offsetPositionByMeters,
|
|
8468
7559
|
onlyUniqueHashes,
|
|
8469
7560
|
onlyUniqueOfflineIds,
|
|
8470
|
-
openCoordsInGoogleMaps,
|
|
8471
|
-
openDirectionsInGoogleMaps,
|
|
8472
7561
|
organizationAccessReducer,
|
|
8473
7562
|
organizationAccessSlice,
|
|
8474
7563
|
organizationReducer,
|
|
@@ -8523,22 +7612,7 @@ export {
|
|
|
8523
7612
|
selectAssetTypeAttachmentMapping,
|
|
8524
7613
|
selectAssetTypeAttachments,
|
|
8525
7614
|
selectAssetTypeById,
|
|
8526
|
-
selectAssetTypeFieldValues,
|
|
8527
|
-
selectAssetTypeFieldValuesAttachmentById,
|
|
8528
|
-
selectAssetTypeFieldValuesAttachments,
|
|
8529
|
-
selectAssetTypeFieldValuesAttachmentsMapping,
|
|
8530
|
-
selectAssetTypeFieldValuesById,
|
|
8531
|
-
selectAssetTypeFieldValuesMapping,
|
|
8532
|
-
selectAssetTypeFieldValuesOfAsset,
|
|
8533
|
-
selectAssetTypeFields,
|
|
8534
|
-
selectAssetTypeFieldsAttachmentById,
|
|
8535
|
-
selectAssetTypeFieldsAttachments,
|
|
8536
|
-
selectAssetTypeFieldsAttachmentsMapping,
|
|
8537
|
-
selectAssetTypeFieldsById,
|
|
8538
|
-
selectAssetTypeFieldsMapping,
|
|
8539
|
-
selectAssetTypeFieldsOfAssetType,
|
|
8540
7615
|
selectAssetTypeStagesMapping,
|
|
8541
|
-
selectAssetTypeValuesOfAssetType,
|
|
8542
7616
|
selectAssetTypes,
|
|
8543
7617
|
selectAssetTypesByIds,
|
|
8544
7618
|
selectAssetTypesMapping,
|
|
@@ -8546,20 +7620,18 @@ export {
|
|
|
8546
7620
|
selectAssetsByIds,
|
|
8547
7621
|
selectAssetsMapping,
|
|
8548
7622
|
selectAssetsOfAssetType,
|
|
7623
|
+
selectAttachedFormSubmissionsOfAsset,
|
|
7624
|
+
selectAttachedFormSubmissionsOfIssue,
|
|
8549
7625
|
selectAttachmentsOfAsset,
|
|
8550
7626
|
selectAttachmentsOfAssetByType,
|
|
8551
7627
|
selectAttachmentsOfAssetType,
|
|
8552
7628
|
selectAttachmentsOfAssetTypeByType,
|
|
8553
|
-
selectAttachmentsOfAssetTypeFieldValues,
|
|
8554
|
-
selectAttachmentsOfAssetTypeFields,
|
|
8555
7629
|
selectAttachmentsOfDocument,
|
|
8556
7630
|
selectAttachmentsOfDocumentByType,
|
|
8557
7631
|
selectAttachmentsOfFormRevision,
|
|
8558
7632
|
selectAttachmentsOfFormSubmission,
|
|
8559
7633
|
selectAttachmentsOfIssue,
|
|
8560
7634
|
selectAttachmentsOfIssueByType,
|
|
8561
|
-
selectAttachmentsOfIssueTypeFieldValues,
|
|
8562
|
-
selectAttachmentsOfIssueTypeFields,
|
|
8563
7635
|
selectAttachmentsOfProject,
|
|
8564
7636
|
selectAttachmentsOfProjectByType,
|
|
8565
7637
|
selectCategories,
|
|
@@ -8587,6 +7659,8 @@ export {
|
|
|
8587
7659
|
selectFilteredForms,
|
|
8588
7660
|
selectFormById,
|
|
8589
7661
|
selectFormMapping,
|
|
7662
|
+
selectFormOfAssetType,
|
|
7663
|
+
selectFormOfIssueType,
|
|
8590
7664
|
selectFormRevisionAttachmentsMapping,
|
|
8591
7665
|
selectFormRevisionById,
|
|
8592
7666
|
selectFormRevisionMapping,
|
|
@@ -8596,11 +7670,16 @@ export {
|
|
|
8596
7670
|
selectFormSubmissionAttachmentsMapping,
|
|
8597
7671
|
selectFormSubmissionById,
|
|
8598
7672
|
selectFormSubmissions,
|
|
7673
|
+
selectFormSubmissionsByAssets,
|
|
7674
|
+
selectFormSubmissionsByFormRevisions,
|
|
7675
|
+
selectFormSubmissionsByIssues,
|
|
8599
7676
|
selectFormSubmissionsMapping,
|
|
8600
7677
|
selectFormSubmissionsOfAsset,
|
|
8601
7678
|
selectFormSubmissionsOfForm,
|
|
8602
7679
|
selectFormSubmissionsOfIssue,
|
|
8603
7680
|
selectForms,
|
|
7681
|
+
selectFormsCount,
|
|
7682
|
+
selectGeneralFormCount,
|
|
8604
7683
|
selectGeoImageById,
|
|
8605
7684
|
selectGeoImageMapping,
|
|
8606
7685
|
selectGeoImages,
|
|
@@ -8622,22 +7701,7 @@ export {
|
|
|
8622
7701
|
selectIssueCountOfCategory,
|
|
8623
7702
|
selectIssueMapping,
|
|
8624
7703
|
selectIssueTypeById,
|
|
8625
|
-
selectIssueTypeFieldValues,
|
|
8626
|
-
selectIssueTypeFieldValuesAttachmentById,
|
|
8627
|
-
selectIssueTypeFieldValuesAttachments,
|
|
8628
|
-
selectIssueTypeFieldValuesAttachmentsMapping,
|
|
8629
|
-
selectIssueTypeFieldValuesById,
|
|
8630
|
-
selectIssueTypeFieldValuesMapping,
|
|
8631
|
-
selectIssueTypeFieldValuesOfIssue,
|
|
8632
|
-
selectIssueTypeFields,
|
|
8633
|
-
selectIssueTypeFieldsAttachmentById,
|
|
8634
|
-
selectIssueTypeFieldsAttachments,
|
|
8635
|
-
selectIssueTypeFieldsAttachmentsMapping,
|
|
8636
|
-
selectIssueTypeFieldsById,
|
|
8637
|
-
selectIssueTypeFieldsMapping,
|
|
8638
|
-
selectIssueTypeFieldsOfIssueType,
|
|
8639
7704
|
selectIssueTypeMapping,
|
|
8640
|
-
selectIssueTypeValuesOfIssueType,
|
|
8641
7705
|
selectIssueTypes,
|
|
8642
7706
|
selectIssueTypesByIds,
|
|
8643
7707
|
selectIssueTypesOfOrganization,
|
|
@@ -8646,9 +7710,8 @@ export {
|
|
|
8646
7710
|
selectIssuesByIds,
|
|
8647
7711
|
selectIssuesOfIssueType,
|
|
8648
7712
|
selectIssuesOfIssueTypeCount,
|
|
8649
|
-
|
|
7713
|
+
selectLatestFormRevisionByForm,
|
|
8650
7714
|
selectLatestFormRevisionOfForm,
|
|
8651
|
-
selectLatestIssueTypeFieldsOfIssueType,
|
|
8652
7715
|
selectLatestRetryTime,
|
|
8653
7716
|
selectLicense,
|
|
8654
7717
|
selectLicenseForProject,
|
|
@@ -8685,6 +7748,7 @@ export {
|
|
|
8685
7748
|
selectProjectsOfOrganization,
|
|
8686
7749
|
selectRehydrated,
|
|
8687
7750
|
selectRootDocuments,
|
|
7751
|
+
selectSortedFormSubmissionsOfForm,
|
|
8688
7752
|
selectSortedOrganizationUsers,
|
|
8689
7753
|
selectSortedProjectUsers,
|
|
8690
7754
|
selectStageFormIdsFromStageIds,
|
|
@@ -8703,8 +7767,6 @@ export {
|
|
|
8703
7767
|
selectWorkspaceById,
|
|
8704
7768
|
selectWorkspaceMapping,
|
|
8705
7769
|
selectWorkspaces,
|
|
8706
|
-
separateFilesFromValues,
|
|
8707
|
-
separateImageFromFields,
|
|
8708
7770
|
setActiveProjectFileId,
|
|
8709
7771
|
setActiveProjectId,
|
|
8710
7772
|
setAsset,
|
|
@@ -8715,14 +7777,6 @@ export {
|
|
|
8715
7777
|
setAssetType,
|
|
8716
7778
|
setAssetTypeAttachment,
|
|
8717
7779
|
setAssetTypeAttachments,
|
|
8718
|
-
setAssetTypeFieldValues,
|
|
8719
|
-
setAssetTypeFieldValuesAttachment,
|
|
8720
|
-
setAssetTypeFieldValuesAttachments,
|
|
8721
|
-
setAssetTypeFieldValuesMany,
|
|
8722
|
-
setAssetTypeFields,
|
|
8723
|
-
setAssetTypeFieldsAttachment,
|
|
8724
|
-
setAssetTypeFieldsAttachments,
|
|
8725
|
-
setAssetTypeFieldsMany,
|
|
8726
7780
|
setAssetTypes,
|
|
8727
7781
|
setAssets,
|
|
8728
7782
|
setConversation,
|
|
@@ -8748,14 +7802,6 @@ export {
|
|
|
8748
7802
|
setIssueComment,
|
|
8749
7803
|
setIssueComments,
|
|
8750
7804
|
setIssueType,
|
|
8751
|
-
setIssueTypeFieldValues,
|
|
8752
|
-
setIssueTypeFieldValuesAttachment,
|
|
8753
|
-
setIssueTypeFieldValuesAttachments,
|
|
8754
|
-
setIssueTypeFieldValuesMany,
|
|
8755
|
-
setIssueTypeFields,
|
|
8756
|
-
setIssueTypeFieldsAttachment,
|
|
8757
|
-
setIssueTypeFieldsAttachments,
|
|
8758
|
-
setIssueTypeFieldsMany,
|
|
8759
7805
|
setIssueUpdate,
|
|
8760
7806
|
setLoggedIn,
|
|
8761
7807
|
setOrganizations,
|
|
@@ -8788,14 +7834,6 @@ export {
|
|
|
8788
7834
|
updateAssetType,
|
|
8789
7835
|
updateAssetTypeAttachment,
|
|
8790
7836
|
updateAssetTypeAttachments,
|
|
8791
|
-
updateAssetTypeFieldValues,
|
|
8792
|
-
updateAssetTypeFieldValuesAttachment,
|
|
8793
|
-
updateAssetTypeFieldValuesAttachments,
|
|
8794
|
-
updateAssetTypeFieldValuesMany,
|
|
8795
|
-
updateAssetTypeFields,
|
|
8796
|
-
updateAssetTypeFieldsAttachment,
|
|
8797
|
-
updateAssetTypeFieldsAttachments,
|
|
8798
|
-
updateAssetTypeFieldsMany,
|
|
8799
7837
|
updateAssetTypes,
|
|
8800
7838
|
updateAssets,
|
|
8801
7839
|
updateCategory,
|
|
@@ -8818,14 +7856,6 @@ export {
|
|
|
8818
7856
|
updateIssueAttachment,
|
|
8819
7857
|
updateIssueAttachments,
|
|
8820
7858
|
updateIssueType,
|
|
8821
|
-
updateIssueTypeFieldValues,
|
|
8822
|
-
updateIssueTypeFieldValuesAttachment,
|
|
8823
|
-
updateIssueTypeFieldValuesAttachments,
|
|
8824
|
-
updateIssueTypeFieldValuesMany,
|
|
8825
|
-
updateIssueTypeFields,
|
|
8826
|
-
updateIssueTypeFieldsAttachment,
|
|
8827
|
-
updateIssueTypeFieldsAttachments,
|
|
8828
|
-
updateIssueTypeFieldsMany,
|
|
8829
7859
|
updateLicense,
|
|
8830
7860
|
updateOrCreateProject,
|
|
8831
7861
|
updateOrganizationAccess,
|
|
@@ -8840,7 +7870,6 @@ export {
|
|
|
8840
7870
|
versioningSlice,
|
|
8841
7871
|
warningColor,
|
|
8842
7872
|
workspaceReducer,
|
|
8843
|
-
workspaceSlice
|
|
8844
|
-
worldBounds
|
|
7873
|
+
workspaceSlice
|
|
8845
7874
|
};
|
|
8846
7875
|
//# sourceMappingURL=overmap-core.js.map
|