@overmap-ai/core 1.0.71-depend-on-forms.0 → 1.0.71-fields.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/overmap-core.js +1848 -994
- package/dist/overmap-core.js.map +1 -1
- package/dist/overmap-core.umd.cjs +1846 -992
- package/dist/overmap-core.umd.cjs.map +1 -1
- package/dist/sdk/services/AssetAttachmentService.d.ts +32 -8
- package/dist/sdk/services/AssetTypeAttachmentService.d.ts +32 -9
- package/dist/sdk/services/AssetTypeFieldValuesAttachmentService.d.ts +13 -0
- package/dist/sdk/services/AssetTypeFieldValuesService.d.ts +20 -0
- package/dist/sdk/services/AssetTypeFieldsAttachmentService.d.ts +12 -0
- package/dist/sdk/services/AssetTypeFieldsService.d.ts +8 -0
- package/dist/sdk/services/BaseAttachmentService.d.ts +18 -20
- package/dist/sdk/services/BaseUploadService.d.ts +2 -1
- package/dist/sdk/services/DocumentAttachmentService.d.ts +30 -8
- package/dist/sdk/services/FormRevisionAttachmentService.d.ts +12 -0
- package/dist/sdk/services/FormRevisionService.d.ts +8 -0
- package/dist/sdk/services/FormService.d.ts +11 -14
- package/dist/sdk/services/FormSubmissionAttachmentService.d.ts +13 -0
- package/dist/sdk/services/FormSubmissionService.d.ts +8 -28
- package/dist/sdk/services/IssueAssociationService.d.ts +2 -2
- package/dist/sdk/services/IssueAttachmentService.d.ts +31 -8
- package/dist/sdk/services/IssueService.d.ts +0 -3
- package/dist/sdk/services/IssueTypeFieldValuesAttachmentService.d.ts +13 -0
- package/dist/sdk/services/IssueTypeFieldValuesService.d.ts +10 -0
- package/dist/sdk/services/IssueTypeFieldsAttachmentService.d.ts +12 -0
- package/dist/sdk/services/IssueTypeFieldsService.d.ts +8 -0
- package/dist/sdk/services/ProjectAttachmentService.d.ts +31 -8
- package/dist/sdk/services/index.d.ts +10 -0
- package/dist/store/slices/assetTypeFieldValuesAttachmentSlice.d.ts +52 -0
- package/dist/store/slices/assetTypeFieldValuesSlice.d.ts +52 -0
- package/dist/store/slices/assetTypeFieldsAttachmentSlice.d.ts +52 -0
- package/dist/store/slices/assetTypeFieldsSlice.d.ts +52 -0
- package/dist/store/slices/formSlice.d.ts +0 -2
- package/dist/store/slices/formSubmissionSlice.d.ts +0 -4
- package/dist/store/slices/index.d.ts +8 -0
- package/dist/store/slices/issueTypeFieldValuesAttachmentSlice.d.ts +52 -0
- package/dist/store/slices/issueTypeFieldValuesSlice.d.ts +52 -0
- package/dist/store/slices/issueTypeFieldsAttachmentSlice.d.ts +52 -0
- package/dist/store/slices/issueTypeFieldsSlice.d.ts +52 -0
- package/dist/store/store.d.ts +9 -1
- package/dist/typings/files.d.ts +8 -4
- package/dist/typings/models/assets.d.ts +15 -0
- package/dist/typings/models/attachments.d.ts +1 -6
- package/dist/typings/models/fields.d.ts +16 -0
- package/dist/typings/models/forms.d.ts +12 -27
- package/dist/typings/models/index.d.ts +1 -0
- package/dist/typings/models/issues.d.ts +15 -0
- package/dist/typings/models/store.d.ts +9 -1
- package/dist/utils/file.d.ts +2 -2
- package/package.json +1 -1
package/dist/overmap-core.js
CHANGED
|
@@ -758,15 +758,15 @@ const wrapMigration = (migrator) => (state) => {
|
|
|
758
758
|
};
|
|
759
759
|
const migrations = [initialVersioning, signOut, signOut, createOutboxState];
|
|
760
760
|
const manifest = Object.fromEntries(migrations.map((migration2, i) => [i, wrapMigration(migration2)]));
|
|
761
|
-
const initialState$
|
|
761
|
+
const initialState$J = {
|
|
762
762
|
accessToken: "",
|
|
763
763
|
refreshToken: "",
|
|
764
764
|
isLoggedIn: false
|
|
765
765
|
};
|
|
766
766
|
const authSlice = createSlice({
|
|
767
767
|
name: "auth",
|
|
768
|
-
initialState: initialState$
|
|
769
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
768
|
+
initialState: initialState$J,
|
|
769
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$J)),
|
|
770
770
|
reducers: {
|
|
771
771
|
setTokens: (state, action) => {
|
|
772
772
|
state.accessToken = action.payload.accessToken;
|
|
@@ -854,11 +854,11 @@ function createModelAdapter(computeModelId) {
|
|
|
854
854
|
};
|
|
855
855
|
}
|
|
856
856
|
const categoryAdapter = createModelAdapter((category) => category.offline_id);
|
|
857
|
-
const initialState$
|
|
857
|
+
const initialState$I = categoryAdapter.getInitialState({});
|
|
858
858
|
const categorySlice = createSlice({
|
|
859
859
|
name: "categories",
|
|
860
|
-
initialState: initialState$
|
|
861
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
860
|
+
initialState: initialState$I,
|
|
861
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$I)),
|
|
862
862
|
reducers: {
|
|
863
863
|
initializeCategories: categoryAdapter.initialize,
|
|
864
864
|
addCategory: categoryAdapter.addOne,
|
|
@@ -902,11 +902,11 @@ const selectIssueCountOfCategory = (categoryId) => (state) => {
|
|
|
902
902
|
};
|
|
903
903
|
const categoryReducer = categorySlice.reducer;
|
|
904
904
|
const assetAdapter = createModelAdapter((asset) => asset.offline_id);
|
|
905
|
-
const initialState$
|
|
905
|
+
const initialState$H = assetAdapter.getInitialState({});
|
|
906
906
|
const assetSlice = createSlice({
|
|
907
907
|
name: "assets",
|
|
908
|
-
initialState: initialState$
|
|
909
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
908
|
+
initialState: initialState$H,
|
|
909
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$H)),
|
|
910
910
|
reducers: {
|
|
911
911
|
initializeAssets: assetAdapter.initialize,
|
|
912
912
|
addAsset: assetAdapter.addOne,
|
|
@@ -958,11 +958,11 @@ const selectNumberOfAssetsOfAssetType = (assetTypeId) => (state) => {
|
|
|
958
958
|
};
|
|
959
959
|
const assetReducer = assetSlice.reducer;
|
|
960
960
|
const assetAttachmentAdapter = createModelAdapter((attachment) => attachment.offline_id);
|
|
961
|
-
const initialState$
|
|
961
|
+
const initialState$G = assetAttachmentAdapter.getInitialState({});
|
|
962
962
|
const assetAttachmentSlice = createSlice({
|
|
963
963
|
name: "assetAttachments",
|
|
964
|
-
initialState: initialState$
|
|
965
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
964
|
+
initialState: initialState$G,
|
|
965
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$G)),
|
|
966
966
|
reducers: {
|
|
967
967
|
initializeAssetAttachments: assetAttachmentAdapter.initialize,
|
|
968
968
|
addAssetAttachment: assetAttachmentAdapter.addOne,
|
|
@@ -1023,11 +1023,11 @@ const assetAttachmentReducer = assetAttachmentSlice.reducer;
|
|
|
1023
1023
|
const assetStageCompletionAdapter = createModelAdapter(
|
|
1024
1024
|
(stageCompletion) => stageCompletion.offline_id
|
|
1025
1025
|
);
|
|
1026
|
-
const initialState$
|
|
1026
|
+
const initialState$F = assetStageCompletionAdapter.getInitialState({});
|
|
1027
1027
|
const assetStageCompletionSlice = createSlice({
|
|
1028
1028
|
name: "assetStageCompletions",
|
|
1029
|
-
initialState: initialState$
|
|
1030
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1029
|
+
initialState: initialState$F,
|
|
1030
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$F)),
|
|
1031
1031
|
reducers: {
|
|
1032
1032
|
initializeAssetStageCompletions: assetStageCompletionAdapter.initialize,
|
|
1033
1033
|
addAssetStageCompletion: assetStageCompletionAdapter.addOne,
|
|
@@ -1089,11 +1089,11 @@ const selectAssetStageCompletionsByIds = restructureCreateSelectorWithArgs(
|
|
|
1089
1089
|
);
|
|
1090
1090
|
const assetStageCompletionReducer = assetStageCompletionSlice.reducer;
|
|
1091
1091
|
const assetStageAdapter = createModelAdapter((assetStage) => assetStage.offline_id);
|
|
1092
|
-
const initialState$
|
|
1092
|
+
const initialState$E = assetStageAdapter.getInitialState({});
|
|
1093
1093
|
const assetStageSlice = createSlice({
|
|
1094
1094
|
name: "assetStages",
|
|
1095
|
-
initialState: initialState$
|
|
1096
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1095
|
+
initialState: initialState$E,
|
|
1096
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$E)),
|
|
1097
1097
|
reducers: {
|
|
1098
1098
|
initializeAssetStages: assetStageAdapter.initialize,
|
|
1099
1099
|
setAssetStage: assetStageAdapter.setOne,
|
|
@@ -1173,11 +1173,11 @@ const selectStageFormIdsFromStageIds = restructureCreateSelectorWithArgs(
|
|
|
1173
1173
|
})
|
|
1174
1174
|
);
|
|
1175
1175
|
const assetTypeAdapter = createModelAdapter((assetType) => assetType.offline_id);
|
|
1176
|
-
const initialState$
|
|
1176
|
+
const initialState$D = assetTypeAdapter.getInitialState({});
|
|
1177
1177
|
const assetTypeSlice = createSlice({
|
|
1178
1178
|
name: "assetTypes",
|
|
1179
|
-
initialState: initialState$
|
|
1180
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1179
|
+
initialState: initialState$D,
|
|
1180
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$D)),
|
|
1181
1181
|
reducers: {
|
|
1182
1182
|
initializeAssetTypes: assetTypeAdapter.initialize,
|
|
1183
1183
|
setAssetType: assetTypeAdapter.setOne,
|
|
@@ -1230,11 +1230,11 @@ const assetTypeReducer = assetTypeSlice.reducer;
|
|
|
1230
1230
|
const assetTypeAttachmentAdapter = createModelAdapter(
|
|
1231
1231
|
(attachment) => attachment.offline_id
|
|
1232
1232
|
);
|
|
1233
|
-
const initialState$
|
|
1233
|
+
const initialState$C = assetTypeAttachmentAdapter.getInitialState({});
|
|
1234
1234
|
const assetTypeAttachmentSlice = createSlice({
|
|
1235
1235
|
name: "assetTypeAttachments",
|
|
1236
|
-
initialState: initialState$
|
|
1237
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1236
|
+
initialState: initialState$C,
|
|
1237
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$C)),
|
|
1238
1238
|
reducers: {
|
|
1239
1239
|
initializeAssetTypeAttachments: assetTypeAttachmentAdapter.initialize,
|
|
1240
1240
|
addAssetTypeAttachment: assetTypeAttachmentAdapter.addOne,
|
|
@@ -1293,12 +1293,12 @@ const selectAttachmentsOfAssetTypeByType = restructureCreateSelectorWithArgs(
|
|
|
1293
1293
|
);
|
|
1294
1294
|
const assetTypeAttachmentReducer = assetTypeAttachmentSlice.reducer;
|
|
1295
1295
|
const issueAdapter = createModelAdapter((issue) => issue.offline_id);
|
|
1296
|
-
const initialState$
|
|
1296
|
+
const initialState$B = issueAdapter.getInitialState({});
|
|
1297
1297
|
const issueSlice = createSlice({
|
|
1298
1298
|
name: "issues",
|
|
1299
|
-
initialState: initialState$
|
|
1299
|
+
initialState: initialState$B,
|
|
1300
1300
|
extraReducers: (builder) => builder.addCase("RESET", (state) => {
|
|
1301
|
-
Object.assign(state, initialState$
|
|
1301
|
+
Object.assign(state, initialState$B);
|
|
1302
1302
|
}),
|
|
1303
1303
|
reducers: {
|
|
1304
1304
|
initializeIssues: issueAdapter.initialize,
|
|
@@ -1330,12 +1330,12 @@ const selectIssuesByIds = restructureCreateSelectorWithArgs(
|
|
|
1330
1330
|
);
|
|
1331
1331
|
const issueReducer = issueSlice.reducer;
|
|
1332
1332
|
const issueTypeAdapter = createModelAdapter((issueType) => issueType.offline_id);
|
|
1333
|
-
const initialState$
|
|
1333
|
+
const initialState$A = issueTypeAdapter.getInitialState({});
|
|
1334
1334
|
const issueTypeSlice = createSlice({
|
|
1335
1335
|
name: "issueTypes",
|
|
1336
|
-
initialState: initialState$
|
|
1336
|
+
initialState: initialState$A,
|
|
1337
1337
|
extraReducers: (builder) => builder.addCase("RESET", (state) => {
|
|
1338
|
-
Object.assign(state, initialState$
|
|
1338
|
+
Object.assign(state, initialState$A);
|
|
1339
1339
|
}),
|
|
1340
1340
|
reducers: {
|
|
1341
1341
|
initializeIssueTypes: issueTypeAdapter.initialize,
|
|
@@ -1392,15 +1392,15 @@ const selectIssuesOfIssueTypeCount = (issueTypeId) => (state) => {
|
|
|
1392
1392
|
return selectIssuesOfIssueType(issueTypeId)(state).length;
|
|
1393
1393
|
};
|
|
1394
1394
|
const issueTypeReducer = issueTypeSlice.reducer;
|
|
1395
|
-
const initialState$
|
|
1395
|
+
const initialState$z = {
|
|
1396
1396
|
s3Urls: {}
|
|
1397
1397
|
};
|
|
1398
1398
|
const msPerHour = 1e3 * 60 * 60;
|
|
1399
1399
|
const msPerWeek = msPerHour * 24 * 7;
|
|
1400
1400
|
const fileSlice = createSlice({
|
|
1401
1401
|
name: "file",
|
|
1402
|
-
initialState: initialState$
|
|
1403
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1402
|
+
initialState: initialState$z,
|
|
1403
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$z)),
|
|
1404
1404
|
reducers: {
|
|
1405
1405
|
setUploadUrl: (state, action) => {
|
|
1406
1406
|
const { url, fields, sha1 } = action.payload;
|
|
@@ -1427,14 +1427,14 @@ const selectUploadUrl = (sha1) => (state) => {
|
|
|
1427
1427
|
return url;
|
|
1428
1428
|
};
|
|
1429
1429
|
const fileReducer = fileSlice.reducer;
|
|
1430
|
-
const initialState$
|
|
1430
|
+
const initialState$y = {
|
|
1431
1431
|
users: {},
|
|
1432
1432
|
currentUser: null
|
|
1433
1433
|
};
|
|
1434
1434
|
const userSlice = createSlice({
|
|
1435
1435
|
name: "users",
|
|
1436
|
-
initialState: initialState$
|
|
1437
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1436
|
+
initialState: initialState$y,
|
|
1437
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$y)),
|
|
1438
1438
|
reducers: {
|
|
1439
1439
|
setUsers: (state, action) => {
|
|
1440
1440
|
const usersMapping = {};
|
|
@@ -1492,11 +1492,11 @@ const selectUsersByIds = restructureCreateSelectorWithArgs(
|
|
|
1492
1492
|
const organizationAccessAdapter = createModelAdapter(
|
|
1493
1493
|
(organizationAccess) => organizationAccess.offline_id
|
|
1494
1494
|
);
|
|
1495
|
-
const initialState$
|
|
1495
|
+
const initialState$x = organizationAccessAdapter.getInitialState({});
|
|
1496
1496
|
const organizationAccessSlice = createSlice({
|
|
1497
1497
|
name: "organizationAccess",
|
|
1498
|
-
initialState: initialState$
|
|
1499
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1498
|
+
initialState: initialState$x,
|
|
1499
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$x)),
|
|
1500
1500
|
reducers: {
|
|
1501
1501
|
initializeOrganizationAccesses: organizationAccessAdapter.initialize,
|
|
1502
1502
|
updateOrganizationAccess: organizationAccessAdapter.updateOne,
|
|
@@ -1533,11 +1533,11 @@ const selectOrganizationAccessUserMapping = (state) => {
|
|
|
1533
1533
|
};
|
|
1534
1534
|
const organizationAccessReducer = organizationAccessSlice.reducer;
|
|
1535
1535
|
const licenseAdapter = createModelAdapter((license) => license.offline_id);
|
|
1536
|
-
const initialState$
|
|
1536
|
+
const initialState$w = licenseAdapter.getInitialState({});
|
|
1537
1537
|
const licenseSlice = createSlice({
|
|
1538
1538
|
name: "license",
|
|
1539
|
-
initialState: initialState$
|
|
1540
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1539
|
+
initialState: initialState$w,
|
|
1540
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$w)),
|
|
1541
1541
|
reducers: {
|
|
1542
1542
|
initializeLicences: licenseAdapter.initialize,
|
|
1543
1543
|
addLicenses: licenseAdapter.addMany,
|
|
@@ -1562,11 +1562,11 @@ const selectLicensesForProjectsMapping = createSelector(
|
|
|
1562
1562
|
);
|
|
1563
1563
|
const licenseReducer = licenseSlice.reducer;
|
|
1564
1564
|
const projectAccessAdapter = createModelAdapter((projectAccess) => projectAccess.offline_id);
|
|
1565
|
-
const initialState$
|
|
1565
|
+
const initialState$v = projectAccessAdapter.getInitialState({});
|
|
1566
1566
|
const projectAccessSlice = createSlice({
|
|
1567
1567
|
name: "projectAccess",
|
|
1568
|
-
initialState: initialState$
|
|
1569
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1568
|
+
initialState: initialState$v,
|
|
1569
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$v)),
|
|
1570
1570
|
reducers: {
|
|
1571
1571
|
initializeProjectAccesses: projectAccessAdapter.initialize,
|
|
1572
1572
|
updateProjectAccess: projectAccessAdapter.updateOne,
|
|
@@ -1607,14 +1607,14 @@ const selectProjectAccessUserMapping = (state) => {
|
|
|
1607
1607
|
return projectAccesses;
|
|
1608
1608
|
};
|
|
1609
1609
|
const projectAccessReducer = projectAccessSlice.reducer;
|
|
1610
|
-
const initialState$
|
|
1610
|
+
const initialState$u = {
|
|
1611
1611
|
projects: {},
|
|
1612
1612
|
activeProjectId: null
|
|
1613
1613
|
};
|
|
1614
1614
|
const projectSlice = createSlice({
|
|
1615
1615
|
name: "projects",
|
|
1616
|
-
initialState: initialState$
|
|
1617
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1616
|
+
initialState: initialState$u,
|
|
1617
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$u)),
|
|
1618
1618
|
reducers: {
|
|
1619
1619
|
setProjects: (state, action) => {
|
|
1620
1620
|
const projectsMap = {};
|
|
@@ -1721,13 +1721,13 @@ const selectSortedProjectUsers = createSelector(
|
|
|
1721
1721
|
});
|
|
1722
1722
|
}
|
|
1723
1723
|
);
|
|
1724
|
-
const initialState$
|
|
1724
|
+
const initialState$t = {
|
|
1725
1725
|
organizations: {}
|
|
1726
1726
|
};
|
|
1727
1727
|
const organizationSlice = createSlice({
|
|
1728
1728
|
name: "organizations",
|
|
1729
|
-
initialState: initialState$
|
|
1730
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1729
|
+
initialState: initialState$t,
|
|
1730
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$t)),
|
|
1731
1731
|
reducers: {
|
|
1732
1732
|
setOrganizations: (state, action) => {
|
|
1733
1733
|
for (const org of action.payload) {
|
|
@@ -1818,14 +1818,14 @@ const createOfflineAction = (request2, baseUrl, serviceName) => {
|
|
|
1818
1818
|
}
|
|
1819
1819
|
};
|
|
1820
1820
|
};
|
|
1821
|
-
const initialState$
|
|
1821
|
+
const initialState$s = {
|
|
1822
1822
|
deletedRequests: [],
|
|
1823
1823
|
latestRetryTime: 0
|
|
1824
1824
|
};
|
|
1825
1825
|
const outboxSlice = createSlice({
|
|
1826
1826
|
name: "outbox",
|
|
1827
|
-
initialState: initialState$
|
|
1828
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1827
|
+
initialState: initialState$s,
|
|
1828
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$s)),
|
|
1829
1829
|
reducers: {
|
|
1830
1830
|
// enqueueActions is a reducer that does nothing but enqueue API request to the Redux Offline outbox
|
|
1831
1831
|
// Whenever an issue is being created, a reducer addIssue() is responsible for adding it to the offline store
|
|
@@ -1857,15 +1857,15 @@ const selectDeletedRequests = (state) => state.outboxReducer.deletedRequests;
|
|
|
1857
1857
|
const selectLatestRetryTime = (state) => state.outboxReducer.latestRetryTime;
|
|
1858
1858
|
const { enqueueRequest, markForDeletion, markAsDeleted, _setLatestRetryTime } = outboxSlice.actions;
|
|
1859
1859
|
const outboxReducer = outboxSlice.reducer;
|
|
1860
|
-
const initialState$
|
|
1860
|
+
const initialState$r = {
|
|
1861
1861
|
projectFiles: {},
|
|
1862
1862
|
activeProjectFileId: null,
|
|
1863
1863
|
isImportingProjectFile: false
|
|
1864
1864
|
};
|
|
1865
1865
|
const projectFileSlice = createSlice({
|
|
1866
1866
|
name: "projectFiles",
|
|
1867
|
-
initialState: initialState$
|
|
1868
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1867
|
+
initialState: initialState$r,
|
|
1868
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$r)),
|
|
1869
1869
|
reducers: {
|
|
1870
1870
|
addOrReplaceProjectFiles: (state, action) => {
|
|
1871
1871
|
for (let fileObj of action.payload) {
|
|
@@ -1952,11 +1952,11 @@ const selectProjectFileById = (id) => (state) => {
|
|
|
1952
1952
|
};
|
|
1953
1953
|
const projectFileReducer = projectFileSlice.reducer;
|
|
1954
1954
|
const projectAttachmentAdapter = createModelAdapter((attachment) => attachment.offline_id);
|
|
1955
|
-
const initialState$
|
|
1955
|
+
const initialState$q = projectAttachmentAdapter.getInitialState({});
|
|
1956
1956
|
const projectAttachmentSlice = createSlice({
|
|
1957
1957
|
name: "projectAttachments",
|
|
1958
|
-
initialState: initialState$
|
|
1959
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1958
|
+
initialState: initialState$q,
|
|
1959
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$q)),
|
|
1960
1960
|
reducers: {
|
|
1961
1961
|
initializeProjectAttachments: projectAttachmentAdapter.initialize,
|
|
1962
1962
|
addProjectAttachment: projectAttachmentAdapter.addOne,
|
|
@@ -2011,12 +2011,12 @@ const selectAttachmentsOfProjectByType = restructureCreateSelectorWithArgs(
|
|
|
2011
2011
|
)
|
|
2012
2012
|
);
|
|
2013
2013
|
const projectAttachmentReducer = projectAttachmentSlice.reducer;
|
|
2014
|
-
const initialState$
|
|
2014
|
+
const initialState$p = {
|
|
2015
2015
|
isRehydrated: false
|
|
2016
2016
|
};
|
|
2017
2017
|
const rehydratedSlice = createSlice({
|
|
2018
2018
|
name: "rehydrated",
|
|
2019
|
-
initialState: initialState$
|
|
2019
|
+
initialState: initialState$p,
|
|
2020
2020
|
// The `reducers` field lets us define reducers and generate associated actions
|
|
2021
2021
|
reducers: {
|
|
2022
2022
|
setRehydrated: (state, action) => {
|
|
@@ -2041,11 +2041,11 @@ const formRevisionSortFn = (formRevisionA, formRevisionB) => {
|
|
|
2041
2041
|
}
|
|
2042
2042
|
};
|
|
2043
2043
|
const formRevisionAdapter = createModelAdapter((revision) => revision.offline_id);
|
|
2044
|
-
const initialState$
|
|
2044
|
+
const initialState$o = formRevisionAdapter.getInitialState({});
|
|
2045
2045
|
const formRevisionsSlice = createSlice({
|
|
2046
2046
|
name: "formRevisions",
|
|
2047
|
-
initialState: initialState$
|
|
2048
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2047
|
+
initialState: initialState$o,
|
|
2048
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$o)),
|
|
2049
2049
|
reducers: {
|
|
2050
2050
|
initializeFormRevisions: formRevisionAdapter.initialize,
|
|
2051
2051
|
setFormRevision: formRevisionAdapter.setOne,
|
|
@@ -2117,11 +2117,11 @@ const selectLatestFormRevisionByForm = createSelector([selectFormRevisionMapping
|
|
|
2117
2117
|
});
|
|
2118
2118
|
const formRevisionReducer = formRevisionsSlice.reducer;
|
|
2119
2119
|
const formAdapter = createModelAdapter((form) => form.offline_id);
|
|
2120
|
-
const initialState$
|
|
2120
|
+
const initialState$n = formAdapter.getInitialState({});
|
|
2121
2121
|
const formSlice = createSlice({
|
|
2122
2122
|
name: "forms",
|
|
2123
|
-
initialState: initialState$
|
|
2124
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2123
|
+
initialState: initialState$n,
|
|
2124
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$n)),
|
|
2125
2125
|
reducers: {
|
|
2126
2126
|
initializeForms: formAdapter.initialize,
|
|
2127
2127
|
setForm: formAdapter.setOne,
|
|
@@ -2167,34 +2167,18 @@ const selectFilteredForms = restructureCreateSelectorWithArgs(
|
|
|
2167
2167
|
const selectFormById = (formId) => (state) => {
|
|
2168
2168
|
return state.formReducer.instances[formId];
|
|
2169
2169
|
};
|
|
2170
|
-
const selectFormOfAssetType = restructureCreateSelectorWithArgs(
|
|
2171
|
-
createSelector(
|
|
2172
|
-
[selectFormMapping, (_state, assetTypeId) => assetTypeId],
|
|
2173
|
-
(formsMapping, assetTypeId) => {
|
|
2174
|
-
return Object.values(formsMapping).find((form) => form.asset_type === assetTypeId);
|
|
2175
|
-
}
|
|
2176
|
-
)
|
|
2177
|
-
);
|
|
2178
|
-
const selectFormOfIssueType = restructureCreateSelectorWithArgs(
|
|
2179
|
-
createSelector(
|
|
2180
|
-
[selectFormMapping, (_state, issueTypeId) => issueTypeId],
|
|
2181
|
-
(formsMapping, issueTypeId) => {
|
|
2182
|
-
return Object.values(formsMapping).find((form) => form.issue_type === issueTypeId);
|
|
2183
|
-
}
|
|
2184
|
-
)
|
|
2185
|
-
);
|
|
2186
2170
|
const selectFormsCount = createSelector([selectFormMapping], (formsMapping) => {
|
|
2187
2171
|
return Object.keys(formsMapping).length;
|
|
2188
2172
|
});
|
|
2189
2173
|
const selectGeneralFormCount = createSelector([selectFormMapping], (formsMapping) => {
|
|
2190
|
-
return Object.values(formsMapping).
|
|
2174
|
+
return Object.values(formsMapping).length;
|
|
2191
2175
|
});
|
|
2192
2176
|
const submissionAdapter = createModelAdapter((submission) => submission.offline_id);
|
|
2193
|
-
const initialState$
|
|
2177
|
+
const initialState$m = submissionAdapter.getInitialState({});
|
|
2194
2178
|
const formSubmissionSlice = createSlice({
|
|
2195
2179
|
name: "formSubmissions",
|
|
2196
|
-
initialState: initialState$
|
|
2197
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2180
|
+
initialState: initialState$m,
|
|
2181
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$m)),
|
|
2198
2182
|
reducers: {
|
|
2199
2183
|
initializeFormSubmissions: submissionAdapter.initialize,
|
|
2200
2184
|
setFormSubmission: submissionAdapter.setOne,
|
|
@@ -2297,54 +2281,6 @@ const selectFormSubmissionsOfIssue = restructureCreateSelectorWithArgs(
|
|
|
2297
2281
|
}
|
|
2298
2282
|
)
|
|
2299
2283
|
);
|
|
2300
|
-
const selectAttachedFormSubmissionsOfIssue = restructureCreateSelectorWithArgs(
|
|
2301
|
-
createSelector(
|
|
2302
|
-
[
|
|
2303
|
-
(state) => state.issueReducer.instances,
|
|
2304
|
-
(state) => state.formReducer.instances,
|
|
2305
|
-
(state) => state.formRevisionReducer.instances,
|
|
2306
|
-
(state) => state.formSubmissionReducer.instances,
|
|
2307
|
-
(_state, issueId) => issueId
|
|
2308
|
-
],
|
|
2309
|
-
(issues, forms, formRevisions, submissions, issueId) => {
|
|
2310
|
-
const issue = issues[issueId];
|
|
2311
|
-
if (!issue)
|
|
2312
|
-
return [];
|
|
2313
|
-
if (!issue.issue_type) {
|
|
2314
|
-
return Object.values(submissions).filter((submission) => submission.issue === issueId);
|
|
2315
|
-
}
|
|
2316
|
-
const issueTypeForms = new Set(
|
|
2317
|
-
Object.keys(forms).filter((formId) => forms[formId].issue_type === issue.issue_type)
|
|
2318
|
-
);
|
|
2319
|
-
const issueTypeFormRevisions = new Set(
|
|
2320
|
-
Object.keys(formRevisions).filter(
|
|
2321
|
-
(formRevisionId) => issueTypeForms.has(formRevisions[formRevisionId].form)
|
|
2322
|
-
)
|
|
2323
|
-
);
|
|
2324
|
-
return Object.values(submissions).filter(
|
|
2325
|
-
(submission) => submission.issue === issueId && !issueTypeFormRevisions.has(submission.form_revision)
|
|
2326
|
-
);
|
|
2327
|
-
}
|
|
2328
|
-
)
|
|
2329
|
-
);
|
|
2330
|
-
const selectFormSubmissionsByIssues = restructureCreateSelectorWithArgs(
|
|
2331
|
-
createSelector(
|
|
2332
|
-
[selectFormSubmissions, (_state, issueIds) => issueIds],
|
|
2333
|
-
(submissions, issueIds) => {
|
|
2334
|
-
var _a2;
|
|
2335
|
-
const issueSubmissions = {};
|
|
2336
|
-
for (const issueId of issueIds) {
|
|
2337
|
-
issueSubmissions[issueId] = [];
|
|
2338
|
-
}
|
|
2339
|
-
for (const submission of submissions) {
|
|
2340
|
-
if (submission.issue && issueIds.includes(submission.issue)) {
|
|
2341
|
-
(_a2 = issueSubmissions[submission.issue]) == null ? void 0 : _a2.push(submission);
|
|
2342
|
-
}
|
|
2343
|
-
}
|
|
2344
|
-
return issueSubmissions;
|
|
2345
|
-
}
|
|
2346
|
-
)
|
|
2347
|
-
);
|
|
2348
2284
|
const selectFormSubmissionsOfAsset = restructureCreateSelectorWithArgs(
|
|
2349
2285
|
createSelector(
|
|
2350
2286
|
[selectFormSubmissions, (_state, assetId) => assetId],
|
|
@@ -2355,62 +2291,15 @@ const selectFormSubmissionsOfAsset = restructureCreateSelectorWithArgs(
|
|
|
2355
2291
|
}
|
|
2356
2292
|
)
|
|
2357
2293
|
);
|
|
2358
|
-
const selectAttachedFormSubmissionsOfAsset = restructureCreateSelectorWithArgs(
|
|
2359
|
-
createSelector(
|
|
2360
|
-
[
|
|
2361
|
-
(state) => state.assetReducer.instances,
|
|
2362
|
-
(state) => state.formReducer.instances,
|
|
2363
|
-
(state) => state.formRevisionReducer.instances,
|
|
2364
|
-
(state) => state.formSubmissionReducer.instances,
|
|
2365
|
-
(_state, assetId) => assetId
|
|
2366
|
-
],
|
|
2367
|
-
(assets, forms, formRevisions, submissions, assetId) => {
|
|
2368
|
-
const asset = assets[assetId];
|
|
2369
|
-
if (!asset)
|
|
2370
|
-
return [];
|
|
2371
|
-
if (!asset.asset_type) {
|
|
2372
|
-
return Object.values(submissions).filter((submission) => submission.asset === assetId);
|
|
2373
|
-
}
|
|
2374
|
-
const issueTypeForms = new Set(
|
|
2375
|
-
Object.keys(forms).filter((formId) => forms[formId].asset_type === asset.asset_type)
|
|
2376
|
-
);
|
|
2377
|
-
const issueTypeFormRevisions = new Set(
|
|
2378
|
-
Object.keys(formRevisions).filter(
|
|
2379
|
-
(formRevisionId) => issueTypeForms.has(formRevisions[formRevisionId].form)
|
|
2380
|
-
)
|
|
2381
|
-
);
|
|
2382
|
-
return Object.values(submissions).filter(
|
|
2383
|
-
(submission) => submission.asset === assetId && !issueTypeFormRevisions.has(submission.form_revision)
|
|
2384
|
-
);
|
|
2385
|
-
}
|
|
2386
|
-
)
|
|
2387
|
-
);
|
|
2388
|
-
const selectFormSubmissionsByAssets = createSelector(
|
|
2389
|
-
[selectFormSubmissionsMapping, selectAssetsMapping],
|
|
2390
|
-
(submissions, assets) => {
|
|
2391
|
-
var _a2;
|
|
2392
|
-
const assetSubmissionMapping = {};
|
|
2393
|
-
for (const assetId in assets) {
|
|
2394
|
-
assetSubmissionMapping[assetId] = [];
|
|
2395
|
-
}
|
|
2396
|
-
for (const submissionId in submissions) {
|
|
2397
|
-
const submission = submissions[submissionId];
|
|
2398
|
-
if (submission.asset) {
|
|
2399
|
-
(_a2 = assetSubmissionMapping[submission.asset]) == null ? void 0 : _a2.push(submission);
|
|
2400
|
-
}
|
|
2401
|
-
}
|
|
2402
|
-
return assetSubmissionMapping;
|
|
2403
|
-
}
|
|
2404
|
-
);
|
|
2405
2294
|
const formSubmissionReducer = formSubmissionSlice.reducer;
|
|
2406
2295
|
const formSubmissionAttachmentAdapter = createModelAdapter(
|
|
2407
2296
|
(attachment) => attachment.offline_id
|
|
2408
2297
|
);
|
|
2409
|
-
const initialState$
|
|
2298
|
+
const initialState$l = formSubmissionAttachmentAdapter.getInitialState({});
|
|
2410
2299
|
const formSubmissionAttachmentSlice = createSlice({
|
|
2411
2300
|
name: "formSubmissionAttachments",
|
|
2412
|
-
initialState: initialState$
|
|
2413
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2301
|
+
initialState: initialState$l,
|
|
2302
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$l)),
|
|
2414
2303
|
reducers: {
|
|
2415
2304
|
initializeFormSubmissionAttachments: formSubmissionAttachmentAdapter.initialize,
|
|
2416
2305
|
addFormSubmissionAttachment: formSubmissionAttachmentAdapter.addOne,
|
|
@@ -2453,7 +2342,9 @@ const selectAttachmentsOfFormSubmission = restructureCreateSelectorWithArgs(
|
|
|
2453
2342
|
[selectFormSubmissionAttachmentsMapping, (_state, submissionId) => submissionId],
|
|
2454
2343
|
(attachmentsMapping, submissionId) => {
|
|
2455
2344
|
return fallbackToEmptyArray(
|
|
2456
|
-
Object.values(attachmentsMapping).filter(
|
|
2345
|
+
Object.values(attachmentsMapping).filter(
|
|
2346
|
+
(attachment) => attachment.form_submission === submissionId
|
|
2347
|
+
)
|
|
2457
2348
|
);
|
|
2458
2349
|
}
|
|
2459
2350
|
)
|
|
@@ -2462,11 +2353,11 @@ const formSubmissionAttachmentReducer = formSubmissionAttachmentSlice.reducer;
|
|
|
2462
2353
|
const formRevisionAttachmentAdapter = createModelAdapter(
|
|
2463
2354
|
(attachment) => attachment.offline_id
|
|
2464
2355
|
);
|
|
2465
|
-
const initialState$
|
|
2356
|
+
const initialState$k = formRevisionAttachmentAdapter.getInitialState({});
|
|
2466
2357
|
const formRevisionAttachmentSlice = createSlice({
|
|
2467
2358
|
name: "formRevisionAttachments",
|
|
2468
|
-
initialState: initialState$
|
|
2469
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2359
|
+
initialState: initialState$k,
|
|
2360
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$k)),
|
|
2470
2361
|
reducers: {
|
|
2471
2362
|
initializeFormRevisionAttachments: formRevisionAttachmentAdapter.initialize,
|
|
2472
2363
|
addFormRevisionAttachment: formRevisionAttachmentAdapter.addOne,
|
|
@@ -2498,17 +2389,17 @@ const selectAttachmentsOfFormRevision = restructureCreateSelectorWithArgs(
|
|
|
2498
2389
|
[selectFormRevisionAttachmentsMapping, (_state, revisionId) => revisionId],
|
|
2499
2390
|
(attachments, revisionId) => {
|
|
2500
2391
|
return fallbackToEmptyArray(
|
|
2501
|
-
Object.values(attachments).filter((attachment) => attachment.
|
|
2392
|
+
Object.values(attachments).filter((attachment) => attachment.form_revision === revisionId)
|
|
2502
2393
|
);
|
|
2503
2394
|
}
|
|
2504
2395
|
)
|
|
2505
2396
|
);
|
|
2506
2397
|
const formRevisionAttachmentReducer = formRevisionAttachmentSlice.reducer;
|
|
2507
2398
|
const workspaceAdapter = createModelAdapter((workspace) => workspace.offline_id);
|
|
2508
|
-
const initialState$
|
|
2399
|
+
const initialState$j = workspaceAdapter.getInitialState({});
|
|
2509
2400
|
const workspaceSlice = createSlice({
|
|
2510
2401
|
name: "workspace",
|
|
2511
|
-
initialState: initialState$
|
|
2402
|
+
initialState: initialState$j,
|
|
2512
2403
|
reducers: {
|
|
2513
2404
|
initializeWorkspaces: workspaceAdapter.initialize,
|
|
2514
2405
|
setWorkspaces: workspaceAdapter.setMany,
|
|
@@ -2539,10 +2430,10 @@ const selectPermittedWorkspaceIds = createSelector(
|
|
|
2539
2430
|
);
|
|
2540
2431
|
const workspaceReducer = workspaceSlice.reducer;
|
|
2541
2432
|
const emailDomainAdapter = createModelAdapter((emailDomain) => emailDomain.offline_id);
|
|
2542
|
-
const initialState$
|
|
2433
|
+
const initialState$i = emailDomainAdapter.getInitialState({});
|
|
2543
2434
|
const emailDomainsSlice = createSlice({
|
|
2544
2435
|
name: "emailDomains",
|
|
2545
|
-
initialState: initialState$
|
|
2436
|
+
initialState: initialState$i,
|
|
2546
2437
|
reducers: {
|
|
2547
2438
|
initializeEmailDomains: emailDomainAdapter.initialize,
|
|
2548
2439
|
addEmailDomain: emailDomainAdapter.addOne,
|
|
@@ -2563,14 +2454,14 @@ const selectEmailDomainsOfOrganization = restructureCreateSelectorWithArgs(
|
|
|
2563
2454
|
)
|
|
2564
2455
|
);
|
|
2565
2456
|
const emailDomainsReducer = emailDomainsSlice.reducer;
|
|
2566
|
-
const initialState$
|
|
2457
|
+
const initialState$h = {
|
|
2567
2458
|
documents: {}
|
|
2568
2459
|
};
|
|
2569
2460
|
const documentSlice = createSlice({
|
|
2570
2461
|
name: "documents",
|
|
2571
|
-
initialState: initialState$
|
|
2462
|
+
initialState: initialState$h,
|
|
2572
2463
|
extraReducers: (builder) => builder.addCase("RESET", (state) => {
|
|
2573
|
-
Object.assign(state, initialState$
|
|
2464
|
+
Object.assign(state, initialState$h);
|
|
2574
2465
|
}),
|
|
2575
2466
|
reducers: {
|
|
2576
2467
|
setDocuments: (state, action) => {
|
|
@@ -2759,11 +2650,11 @@ const selectRootDocuments = createSelector(
|
|
|
2759
2650
|
);
|
|
2760
2651
|
const documentsReducer = documentSlice.reducer;
|
|
2761
2652
|
const documentAttachmentAdapter = createModelAdapter((attachment) => attachment.offline_id);
|
|
2762
|
-
const initialState$
|
|
2653
|
+
const initialState$g = documentAttachmentAdapter.getInitialState({});
|
|
2763
2654
|
const documentAttachmentSlice = createSlice({
|
|
2764
2655
|
name: "documentAttachments",
|
|
2765
|
-
initialState: initialState$
|
|
2766
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2656
|
+
initialState: initialState$g,
|
|
2657
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$g)),
|
|
2767
2658
|
reducers: {
|
|
2768
2659
|
initializeDocumentAttachments: documentAttachmentAdapter.initialize,
|
|
2769
2660
|
addDocumentAttachment: documentAttachmentAdapter.addOne,
|
|
@@ -2822,11 +2713,11 @@ const selectAttachmentsOfDocumentByType = restructureCreateSelectorWithArgs(
|
|
|
2822
2713
|
);
|
|
2823
2714
|
const documentAttachmentReducer = documentAttachmentSlice.reducer;
|
|
2824
2715
|
const teamAdapter = createModelAdapter((team) => team.offline_id);
|
|
2825
|
-
const initialState$
|
|
2716
|
+
const initialState$f = teamAdapter.getInitialState({});
|
|
2826
2717
|
const teamSlice = createSlice({
|
|
2827
2718
|
name: "teams",
|
|
2828
|
-
initialState: initialState$
|
|
2829
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2719
|
+
initialState: initialState$f,
|
|
2720
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$f)),
|
|
2830
2721
|
reducers: {
|
|
2831
2722
|
setTeam: teamAdapter.setOne,
|
|
2832
2723
|
initializeTeams: teamAdapter.initialize,
|
|
@@ -2877,11 +2768,11 @@ const teamReducer = teamSlice.reducer;
|
|
|
2877
2768
|
const agentUserConversationAdapter = createModelAdapter(
|
|
2878
2769
|
(conversation) => conversation.offline_id
|
|
2879
2770
|
);
|
|
2880
|
-
const initialState$
|
|
2771
|
+
const initialState$e = agentUserConversationAdapter.getInitialState({});
|
|
2881
2772
|
const agentsSlice = createSlice({
|
|
2882
2773
|
name: "agents",
|
|
2883
|
-
initialState: initialState$
|
|
2884
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2774
|
+
initialState: initialState$e,
|
|
2775
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$e)),
|
|
2885
2776
|
reducers: {
|
|
2886
2777
|
initializeConversations: agentUserConversationAdapter.initialize,
|
|
2887
2778
|
addConversation: agentUserConversationAdapter.addOne,
|
|
@@ -2903,11 +2794,11 @@ const selectConversation = restructureCreateSelectorWithArgs(
|
|
|
2903
2794
|
);
|
|
2904
2795
|
const agentsReducer = agentsSlice.reducer;
|
|
2905
2796
|
const issueCommentAdapter = createModelAdapter((comment) => comment.offline_id);
|
|
2906
|
-
const initialState$
|
|
2797
|
+
const initialState$d = issueCommentAdapter.getInitialState({});
|
|
2907
2798
|
const issueCommentSlice = createSlice({
|
|
2908
2799
|
name: "issueComments",
|
|
2909
|
-
initialState: initialState$
|
|
2910
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2800
|
+
initialState: initialState$d,
|
|
2801
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$d)),
|
|
2911
2802
|
reducers: {
|
|
2912
2803
|
addIssueComment: issueCommentAdapter.addOne,
|
|
2913
2804
|
addIssueComments: issueCommentAdapter.addMany,
|
|
@@ -2936,11 +2827,11 @@ const selectCommentsOfIssue = restructureCreateSelectorWithArgs(
|
|
|
2936
2827
|
);
|
|
2937
2828
|
const issueCommentReducer = issueCommentSlice.reducer;
|
|
2938
2829
|
const issueUpdateAdapter = createModelAdapter((issueUpdate) => issueUpdate.offline_id);
|
|
2939
|
-
const initialState$
|
|
2830
|
+
const initialState$c = issueUpdateAdapter.getInitialState({});
|
|
2940
2831
|
const issueUpdateSlice = createSlice({
|
|
2941
2832
|
name: "issueUpdates",
|
|
2942
|
-
initialState: initialState$
|
|
2943
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2833
|
+
initialState: initialState$c,
|
|
2834
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$c)),
|
|
2944
2835
|
reducers: {
|
|
2945
2836
|
initializeIssueUpdates: issueUpdateAdapter.setMany,
|
|
2946
2837
|
setIssueUpdate: issueUpdateAdapter.setOne,
|
|
@@ -2969,11 +2860,11 @@ const selectIssueUpdatesOfIssue = restructureCreateSelectorWithArgs(
|
|
|
2969
2860
|
);
|
|
2970
2861
|
const issueUpdateReducer = issueUpdateSlice.reducer;
|
|
2971
2862
|
const issueAttachmentAdapter = createModelAdapter((attachment) => attachment.offline_id);
|
|
2972
|
-
const initialState$
|
|
2863
|
+
const initialState$b = issueAttachmentAdapter.getInitialState({});
|
|
2973
2864
|
const issueAttachmentSlice = createSlice({
|
|
2974
2865
|
name: "issueAttachments",
|
|
2975
|
-
initialState: initialState$
|
|
2976
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2866
|
+
initialState: initialState$b,
|
|
2867
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$b)),
|
|
2977
2868
|
reducers: {
|
|
2978
2869
|
initializeIssueAttachments: issueAttachmentAdapter.initialize,
|
|
2979
2870
|
addIssueAttachment: issueAttachmentAdapter.addOne,
|
|
@@ -3031,23 +2922,23 @@ const selectAttachmentsOfIssueByType = restructureCreateSelectorWithArgs(
|
|
|
3031
2922
|
)
|
|
3032
2923
|
);
|
|
3033
2924
|
const issueAttachmentReducer = issueAttachmentSlice.reducer;
|
|
3034
|
-
const initialState$
|
|
2925
|
+
const initialState$a = {
|
|
3035
2926
|
version: 0
|
|
3036
2927
|
};
|
|
3037
2928
|
const versioningSlice = createSlice({
|
|
3038
2929
|
name: "versioning",
|
|
3039
|
-
initialState: initialState$
|
|
2930
|
+
initialState: initialState$a,
|
|
3040
2931
|
reducers: {}
|
|
3041
2932
|
});
|
|
3042
2933
|
const versioningReducer = versioningSlice.reducer;
|
|
3043
2934
|
const geoImageAdapter = createModelAdapter((model) => model.offline_id);
|
|
3044
|
-
const initialState$
|
|
2935
|
+
const initialState$9 = geoImageAdapter.getInitialState({});
|
|
3045
2936
|
const geoImageSlice = createSlice({
|
|
3046
2937
|
name: "geoImages",
|
|
3047
|
-
initialState: initialState$
|
|
2938
|
+
initialState: initialState$9,
|
|
3048
2939
|
extraReducers: (builder) => {
|
|
3049
2940
|
builder.addCase("RESET", (state) => {
|
|
3050
|
-
Object.assign(state, initialState$
|
|
2941
|
+
Object.assign(state, initialState$9);
|
|
3051
2942
|
});
|
|
3052
2943
|
},
|
|
3053
2944
|
reducers: {
|
|
@@ -3085,11 +2976,11 @@ const selectGeoImagesOfProject = restructureCreateSelectorWithArgs(
|
|
|
3085
2976
|
);
|
|
3086
2977
|
const geoImageReducer = geoImageSlice.reducer;
|
|
3087
2978
|
const issueAssociationAdapter = createModelAdapter((assoc) => assoc.offline_id);
|
|
3088
|
-
const initialState = issueAssociationAdapter.getInitialState({});
|
|
2979
|
+
const initialState$8 = issueAssociationAdapter.getInitialState({});
|
|
3089
2980
|
const issueAssociationSlice = createSlice({
|
|
3090
2981
|
name: "issueAssociations",
|
|
3091
|
-
initialState,
|
|
3092
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState)),
|
|
2982
|
+
initialState: initialState$8,
|
|
2983
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$8)),
|
|
3093
2984
|
reducers: {
|
|
3094
2985
|
initializeIssueAssociations: issueAssociationAdapter.initialize,
|
|
3095
2986
|
addIssueAssociation: issueAssociationAdapter.addOne,
|
|
@@ -3147,86 +3038,462 @@ const selectIssueAssociationsOfAsset = restructureCreateSelectorWithArgs(
|
|
|
3147
3038
|
)
|
|
3148
3039
|
);
|
|
3149
3040
|
const issueAssociationReducer = issueAssociationSlice.reducer;
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
constructor(sdk) {
|
|
3167
|
-
__publicField(this, "client");
|
|
3168
|
-
CLASS_NAME_TO_SERVICE[this.constructor.name] = this;
|
|
3169
|
-
this.client = sdk;
|
|
3170
|
-
}
|
|
3171
|
-
async enqueueRequest(requestDetails) {
|
|
3172
|
-
return this.client.enqueueRequest(requestDetails, this.host, this.constructor.name);
|
|
3173
|
-
}
|
|
3174
|
-
dispatch(action) {
|
|
3175
|
-
this.client.store.dispatch(action);
|
|
3041
|
+
const issueTypeFieldsAdapter = createModelAdapter((fields) => fields.offline_id);
|
|
3042
|
+
const initialState$7 = issueTypeFieldsAdapter.getInitialState({});
|
|
3043
|
+
const issueTypeFieldsSlice = createSlice({
|
|
3044
|
+
name: "issueTypeFields",
|
|
3045
|
+
initialState: initialState$7,
|
|
3046
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$7)),
|
|
3047
|
+
reducers: {
|
|
3048
|
+
initializeIssueTypeFields: issueTypeFieldsAdapter.initialize,
|
|
3049
|
+
addIssueTypeFields: issueTypeFieldsAdapter.addOne,
|
|
3050
|
+
addIssueTypeFieldsMany: issueTypeFieldsAdapter.addMany,
|
|
3051
|
+
setIssueTypeFields: issueTypeFieldsAdapter.setOne,
|
|
3052
|
+
setIssueTypeFieldsMany: issueTypeFieldsAdapter.setMany,
|
|
3053
|
+
updateIssueTypeFields: issueTypeFieldsAdapter.updateOne,
|
|
3054
|
+
updateIssueTypeFieldsMany: issueTypeFieldsAdapter.updateMany,
|
|
3055
|
+
deleteIssueTypeFields: issueTypeFieldsAdapter.deleteOne,
|
|
3056
|
+
deleteIssueTypeFieldsMany: issueTypeFieldsAdapter.deleteMany
|
|
3176
3057
|
}
|
|
3177
|
-
}
|
|
3178
|
-
const
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
projectFileReducer,
|
|
3201
|
-
rehydratedReducer,
|
|
3202
|
-
formReducer,
|
|
3203
|
-
formRevisionReducer,
|
|
3204
|
-
formRevisionAttachmentReducer,
|
|
3205
|
-
formSubmissionAttachmentReducer,
|
|
3206
|
-
formSubmissionReducer,
|
|
3207
|
-
userReducer,
|
|
3208
|
-
workspaceReducer,
|
|
3209
|
-
emailDomainsReducer,
|
|
3210
|
-
licenseReducer,
|
|
3211
|
-
documentsReducer,
|
|
3212
|
-
documentAttachmentReducer,
|
|
3213
|
-
teamReducer,
|
|
3214
|
-
agentsReducer,
|
|
3215
|
-
issueCommentReducer,
|
|
3216
|
-
issueUpdateReducer,
|
|
3217
|
-
geoImageReducer,
|
|
3218
|
-
issueAssociationReducer
|
|
3058
|
+
});
|
|
3059
|
+
const {
|
|
3060
|
+
initializeIssueTypeFields,
|
|
3061
|
+
addIssueTypeFields,
|
|
3062
|
+
addIssueTypeFieldsMany,
|
|
3063
|
+
setIssueTypeFields,
|
|
3064
|
+
setIssueTypeFieldsMany,
|
|
3065
|
+
updateIssueTypeFields,
|
|
3066
|
+
updateIssueTypeFieldsMany,
|
|
3067
|
+
deleteIssueTypeFields,
|
|
3068
|
+
deleteIssueTypeFieldsMany
|
|
3069
|
+
} = issueTypeFieldsSlice.actions;
|
|
3070
|
+
const selectIssueTypeFieldsMapping = (state) => state.issueTypeFieldsReducer.instances;
|
|
3071
|
+
const selectIssueTypeFields = createSelector([selectIssueTypeFieldsMapping], (fieldsMapping) => {
|
|
3072
|
+
return Object.values(fieldsMapping);
|
|
3073
|
+
});
|
|
3074
|
+
const selectIssueTypeFieldsOfIssueType = restructureCreateSelectorWithArgs(
|
|
3075
|
+
createSelector([selectIssueTypeFields, (_state, issueTypeId) => issueTypeId], (fields, issueTypeId) => {
|
|
3076
|
+
return fallbackToEmptyArray(fields.filter((field) => field.issue_type === issueTypeId));
|
|
3077
|
+
})
|
|
3078
|
+
);
|
|
3079
|
+
const selectIssueTypeFieldsById = (fieldsId) => (state) => {
|
|
3080
|
+
return state.issueTypeFieldsReducer.instances[fieldsId];
|
|
3219
3081
|
};
|
|
3220
|
-
const
|
|
3221
|
-
const
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3082
|
+
const issueTypeFieldsReducer = issueTypeFieldsSlice.reducer;
|
|
3083
|
+
const issueTypeFieldValuesAdapter = createModelAdapter(
|
|
3084
|
+
(fieldValues) => fieldValues.offline_id
|
|
3085
|
+
);
|
|
3086
|
+
const initialState$6 = issueTypeFieldValuesAdapter.getInitialState({});
|
|
3087
|
+
const issueTypeFieldValuesSlice = createSlice({
|
|
3088
|
+
name: "issueTypeFieldValues",
|
|
3089
|
+
initialState: initialState$6,
|
|
3090
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$6)),
|
|
3091
|
+
reducers: {
|
|
3092
|
+
initializeIssueTypeFieldValues: issueTypeFieldValuesAdapter.initialize,
|
|
3093
|
+
addIssueTypeFieldValues: issueTypeFieldValuesAdapter.addOne,
|
|
3094
|
+
addIssueTypeFieldValuesMany: issueTypeFieldValuesAdapter.addMany,
|
|
3095
|
+
setIssueTypeFieldValues: issueTypeFieldValuesAdapter.setOne,
|
|
3096
|
+
setIssueTypeFieldValuesMany: issueTypeFieldValuesAdapter.setMany,
|
|
3097
|
+
updateIssueTypeFieldValues: issueTypeFieldValuesAdapter.updateOne,
|
|
3098
|
+
updateIssueTypeFieldValuesMany: issueTypeFieldValuesAdapter.updateMany,
|
|
3099
|
+
deleteIssueTypeFieldValues: issueTypeFieldValuesAdapter.deleteOne,
|
|
3100
|
+
deleteIssueTypeFieldValuesMany: issueTypeFieldValuesAdapter.deleteMany
|
|
3225
3101
|
}
|
|
3226
|
-
|
|
3102
|
+
});
|
|
3103
|
+
const {
|
|
3104
|
+
initializeIssueTypeFieldValues,
|
|
3105
|
+
addIssueTypeFieldValues,
|
|
3106
|
+
addIssueTypeFieldValuesMany,
|
|
3107
|
+
setIssueTypeFieldValues,
|
|
3108
|
+
setIssueTypeFieldValuesMany,
|
|
3109
|
+
updateIssueTypeFieldValues,
|
|
3110
|
+
updateIssueTypeFieldValuesMany,
|
|
3111
|
+
deleteIssueTypeFieldValues,
|
|
3112
|
+
deleteIssueTypeFieldValuesMany
|
|
3113
|
+
} = issueTypeFieldValuesSlice.actions;
|
|
3114
|
+
const selectIssueTypeFieldValuesMapping = (state) => state.issueTypeFieldValuesReducer.instances;
|
|
3115
|
+
const selectIssueTypeFieldValues = createSelector([selectIssueTypeFieldValuesMapping], (fieldValuesMapping) => {
|
|
3116
|
+
return Object.values(fieldValuesMapping);
|
|
3117
|
+
});
|
|
3118
|
+
const selectIssueTypeFieldValuesOfIssue = restructureCreateSelectorWithArgs(
|
|
3119
|
+
createSelector([selectIssueTypeFieldValues, (_state, issueId) => issueId], (fieldValues, issueId) => {
|
|
3120
|
+
return fallbackToEmptyArray(fieldValues.filter((fieldValue) => fieldValue.issue === issueId));
|
|
3121
|
+
})
|
|
3122
|
+
);
|
|
3123
|
+
const selectIssueTypeFieldValuesById = (fieldValuesId) => (state) => {
|
|
3124
|
+
return state.issueTypeFieldValuesReducer.instances[fieldValuesId];
|
|
3227
3125
|
};
|
|
3228
|
-
|
|
3229
|
-
|
|
3126
|
+
const issueTypeFieldValuesReducer = issueTypeFieldValuesSlice.reducer;
|
|
3127
|
+
const issueTypeFieldsAttachmentAdapter = createModelAdapter(
|
|
3128
|
+
(attachment) => attachment.offline_id
|
|
3129
|
+
);
|
|
3130
|
+
const initialState$5 = issueTypeFieldsAttachmentAdapter.getInitialState({});
|
|
3131
|
+
const issueTypeFieldsAttachmentSlice = createSlice({
|
|
3132
|
+
name: "issueTypeFieldsAttachments",
|
|
3133
|
+
initialState: initialState$5,
|
|
3134
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$5)),
|
|
3135
|
+
reducers: {
|
|
3136
|
+
initializeIssueTypeFieldsAttachments: issueTypeFieldsAttachmentAdapter.initialize,
|
|
3137
|
+
addIssueTypeFieldsAttachment: issueTypeFieldsAttachmentAdapter.addOne,
|
|
3138
|
+
addIssueTypeFieldsAttachments: issueTypeFieldsAttachmentAdapter.addMany,
|
|
3139
|
+
setIssueTypeFieldsAttachment: issueTypeFieldsAttachmentAdapter.setOne,
|
|
3140
|
+
setIssueTypeFieldsAttachments: issueTypeFieldsAttachmentAdapter.setMany,
|
|
3141
|
+
updateIssueTypeFieldsAttachment: issueTypeFieldsAttachmentAdapter.updateOne,
|
|
3142
|
+
updateIssueTypeFieldsAttachments: issueTypeFieldsAttachmentAdapter.updateMany,
|
|
3143
|
+
deleteIssueTypeFieldsAttachment: issueTypeFieldsAttachmentAdapter.deleteOne,
|
|
3144
|
+
deleteIssueTypeFieldsAttachments: issueTypeFieldsAttachmentAdapter.deleteMany
|
|
3145
|
+
}
|
|
3146
|
+
});
|
|
3147
|
+
const {
|
|
3148
|
+
initializeIssueTypeFieldsAttachments,
|
|
3149
|
+
addIssueTypeFieldsAttachment,
|
|
3150
|
+
addIssueTypeFieldsAttachments,
|
|
3151
|
+
setIssueTypeFieldsAttachment,
|
|
3152
|
+
setIssueTypeFieldsAttachments,
|
|
3153
|
+
updateIssueTypeFieldsAttachment,
|
|
3154
|
+
updateIssueTypeFieldsAttachments,
|
|
3155
|
+
deleteIssueTypeFieldsAttachment,
|
|
3156
|
+
deleteIssueTypeFieldsAttachments
|
|
3157
|
+
} = issueTypeFieldsAttachmentSlice.actions;
|
|
3158
|
+
const selectIssueTypeFieldsAttachmentsMapping = (state) => state.issueTypeFieldsAttachmentReducer.instances;
|
|
3159
|
+
const selectIssueTypeFieldsAttachments = createSelector(
|
|
3160
|
+
[selectIssueTypeFieldsAttachmentsMapping],
|
|
3161
|
+
(attachmentsMapping) => {
|
|
3162
|
+
return Object.values(attachmentsMapping);
|
|
3163
|
+
}
|
|
3164
|
+
);
|
|
3165
|
+
const selectAttachmentsOfIssueTypeFields = restructureCreateSelectorWithArgs(
|
|
3166
|
+
createSelector(
|
|
3167
|
+
[selectIssueTypeFieldsAttachments, (_state, fieldsRevision) => fieldsRevision],
|
|
3168
|
+
(attachments, fieldsRevision) => {
|
|
3169
|
+
return fallbackToEmptyArray(
|
|
3170
|
+
attachments.filter((attachment) => attachment.fields_revision === fieldsRevision)
|
|
3171
|
+
);
|
|
3172
|
+
}
|
|
3173
|
+
)
|
|
3174
|
+
);
|
|
3175
|
+
const selectIssueTypeFieldsAttachmentById = (attachmentId) => (state) => {
|
|
3176
|
+
return state.issueTypeFieldsAttachmentReducer.instances[attachmentId];
|
|
3177
|
+
};
|
|
3178
|
+
const issueTypeFieldsAttachmentReducer = issueTypeFieldsAttachmentSlice.reducer;
|
|
3179
|
+
const issueTypeFieldValuesAttachmentAdapter = createModelAdapter(
|
|
3180
|
+
(attachment) => attachment.offline_id
|
|
3181
|
+
);
|
|
3182
|
+
const initialState$4 = issueTypeFieldValuesAttachmentAdapter.getInitialState({});
|
|
3183
|
+
const issueTypeFieldValuesAttachmentSlice = createSlice({
|
|
3184
|
+
name: "issueTypeFieldValuesAttachments",
|
|
3185
|
+
initialState: initialState$4,
|
|
3186
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$4)),
|
|
3187
|
+
reducers: {
|
|
3188
|
+
initializeIssueTypeFieldValuesAttachments: issueTypeFieldValuesAttachmentAdapter.initialize,
|
|
3189
|
+
addIssueTypeFieldValuesAttachment: issueTypeFieldValuesAttachmentAdapter.addOne,
|
|
3190
|
+
addIssueTypeFieldValuesAttachments: issueTypeFieldValuesAttachmentAdapter.addMany,
|
|
3191
|
+
setIssueTypeFieldValuesAttachment: issueTypeFieldValuesAttachmentAdapter.setOne,
|
|
3192
|
+
setIssueTypeFieldValuesAttachments: issueTypeFieldValuesAttachmentAdapter.setMany,
|
|
3193
|
+
updateIssueTypeFieldValuesAttachment: issueTypeFieldValuesAttachmentAdapter.updateOne,
|
|
3194
|
+
updateIssueTypeFieldValuesAttachments: issueTypeFieldValuesAttachmentAdapter.updateMany,
|
|
3195
|
+
deleteIssueTypeFieldValuesAttachment: issueTypeFieldValuesAttachmentAdapter.deleteOne,
|
|
3196
|
+
deleteIssueTypeFieldValuesAttachments: issueTypeFieldValuesAttachmentAdapter.deleteMany
|
|
3197
|
+
}
|
|
3198
|
+
});
|
|
3199
|
+
const {
|
|
3200
|
+
initializeIssueTypeFieldValuesAttachments,
|
|
3201
|
+
addIssueTypeFieldValuesAttachment,
|
|
3202
|
+
addIssueTypeFieldValuesAttachments,
|
|
3203
|
+
setIssueTypeFieldValuesAttachment,
|
|
3204
|
+
setIssueTypeFieldValuesAttachments,
|
|
3205
|
+
updateIssueTypeFieldValuesAttachment,
|
|
3206
|
+
updateIssueTypeFieldValuesAttachments,
|
|
3207
|
+
deleteIssueTypeFieldValuesAttachment,
|
|
3208
|
+
deleteIssueTypeFieldValuesAttachments
|
|
3209
|
+
} = issueTypeFieldValuesAttachmentSlice.actions;
|
|
3210
|
+
const selectIssueTypeFieldValuesAttachmentsMapping = (state) => state.issueTypeFieldValuesAttachmentReducer.instances;
|
|
3211
|
+
const selectIssueTypeFieldValuesAttachments = createSelector(
|
|
3212
|
+
[selectIssueTypeFieldValuesAttachmentsMapping],
|
|
3213
|
+
(attachmentsMapping) => {
|
|
3214
|
+
return Object.values(attachmentsMapping);
|
|
3215
|
+
}
|
|
3216
|
+
);
|
|
3217
|
+
const selectAttachmentsOfIssueTypeFieldValues = restructureCreateSelectorWithArgs(
|
|
3218
|
+
createSelector(
|
|
3219
|
+
[selectIssueTypeFieldValuesAttachments, (_state, fieldValuesId) => fieldValuesId],
|
|
3220
|
+
(attachments, fieldValuesId) => {
|
|
3221
|
+
return fallbackToEmptyArray(attachments.filter((attachment) => attachment.field_values === fieldValuesId));
|
|
3222
|
+
}
|
|
3223
|
+
)
|
|
3224
|
+
);
|
|
3225
|
+
const selectIssueTypeFieldValuesAttachmentById = (attachmentId) => (state) => {
|
|
3226
|
+
return state.issueTypeFieldValuesAttachmentReducer.instances[attachmentId];
|
|
3227
|
+
};
|
|
3228
|
+
const issueTypeFieldValuesAttachmentReducer = issueTypeFieldValuesAttachmentSlice.reducer;
|
|
3229
|
+
const assetTypeFieldsAdapter = createModelAdapter((fields) => fields.offline_id);
|
|
3230
|
+
const initialState$3 = assetTypeFieldsAdapter.getInitialState({});
|
|
3231
|
+
const assetTypeFieldsSlice = createSlice({
|
|
3232
|
+
name: "assetTypeFields",
|
|
3233
|
+
initialState: initialState$3,
|
|
3234
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$3)),
|
|
3235
|
+
reducers: {
|
|
3236
|
+
initializeAssetTypeFields: assetTypeFieldsAdapter.initialize,
|
|
3237
|
+
addAssetTypeFields: assetTypeFieldsAdapter.addOne,
|
|
3238
|
+
addAssetTypeFieldsMany: assetTypeFieldsAdapter.addMany,
|
|
3239
|
+
setAssetTypeFields: assetTypeFieldsAdapter.setOne,
|
|
3240
|
+
setAssetTypeFieldsMany: assetTypeFieldsAdapter.setMany,
|
|
3241
|
+
updateAssetTypeFields: assetTypeFieldsAdapter.updateOne,
|
|
3242
|
+
updateAssetTypeFieldsMany: assetTypeFieldsAdapter.updateMany,
|
|
3243
|
+
deleteAssetTypeFields: assetTypeFieldsAdapter.deleteOne,
|
|
3244
|
+
deleteAssetTypeFieldsMany: assetTypeFieldsAdapter.deleteMany
|
|
3245
|
+
}
|
|
3246
|
+
});
|
|
3247
|
+
const {
|
|
3248
|
+
initializeAssetTypeFields,
|
|
3249
|
+
addAssetTypeFields,
|
|
3250
|
+
addAssetTypeFieldsMany,
|
|
3251
|
+
setAssetTypeFields,
|
|
3252
|
+
setAssetTypeFieldsMany,
|
|
3253
|
+
updateAssetTypeFields,
|
|
3254
|
+
updateAssetTypeFieldsMany,
|
|
3255
|
+
deleteAssetTypeFields,
|
|
3256
|
+
deleteAssetTypeFieldsMany
|
|
3257
|
+
} = assetTypeFieldsSlice.actions;
|
|
3258
|
+
const selectAssetTypeFieldsMapping = (state) => state.assetTypeFieldsReducer.instances;
|
|
3259
|
+
const selectAssetTypeFields = createSelector([selectAssetTypeFieldsMapping], (fieldsMapping) => {
|
|
3260
|
+
return Object.values(fieldsMapping);
|
|
3261
|
+
});
|
|
3262
|
+
const selectAssetTypeFieldsOfAssetType = restructureCreateSelectorWithArgs(
|
|
3263
|
+
createSelector([selectAssetTypeFields, (_state, assetTypeId) => assetTypeId], (fields, assetTypeId) => {
|
|
3264
|
+
return fallbackToEmptyArray(fields.filter((field) => field.asset_type === assetTypeId));
|
|
3265
|
+
})
|
|
3266
|
+
);
|
|
3267
|
+
const selectAssetTypeFieldsById = (fieldsId) => (state) => {
|
|
3268
|
+
return state.assetTypeFieldsReducer.instances[fieldsId];
|
|
3269
|
+
};
|
|
3270
|
+
const assetTypeFieldsReducer = assetTypeFieldsSlice.reducer;
|
|
3271
|
+
const assetTypeFieldValuesAdapter = createModelAdapter(
|
|
3272
|
+
(fieldValues) => fieldValues.offline_id
|
|
3273
|
+
);
|
|
3274
|
+
const initialState$2 = assetTypeFieldValuesAdapter.getInitialState({});
|
|
3275
|
+
const assetTypeFieldValuesSlice = createSlice({
|
|
3276
|
+
name: "assetTypeFieldValues",
|
|
3277
|
+
initialState: initialState$2,
|
|
3278
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$2)),
|
|
3279
|
+
reducers: {
|
|
3280
|
+
initializeAssetTypeFieldValues: assetTypeFieldValuesAdapter.initialize,
|
|
3281
|
+
addAssetTypeFieldValues: assetTypeFieldValuesAdapter.addOne,
|
|
3282
|
+
addAssetTypeFieldValuesMany: assetTypeFieldValuesAdapter.addMany,
|
|
3283
|
+
setAssetTypeFieldValues: assetTypeFieldValuesAdapter.setOne,
|
|
3284
|
+
setAssetTypeFieldValuesMany: assetTypeFieldValuesAdapter.setMany,
|
|
3285
|
+
updateAssetTypeFieldValues: assetTypeFieldValuesAdapter.updateOne,
|
|
3286
|
+
updateAssetTypeFieldValuesMany: assetTypeFieldValuesAdapter.updateMany,
|
|
3287
|
+
deleteAssetTypeFieldValues: assetTypeFieldValuesAdapter.deleteOne,
|
|
3288
|
+
deleteAssetTypeFieldValuesMany: assetTypeFieldValuesAdapter.deleteMany
|
|
3289
|
+
}
|
|
3290
|
+
});
|
|
3291
|
+
const {
|
|
3292
|
+
initializeAssetTypeFieldValues,
|
|
3293
|
+
addAssetTypeFieldValues,
|
|
3294
|
+
addAssetTypeFieldValuesMany,
|
|
3295
|
+
setAssetTypeFieldValues,
|
|
3296
|
+
setAssetTypeFieldValuesMany,
|
|
3297
|
+
updateAssetTypeFieldValues,
|
|
3298
|
+
updateAssetTypeFieldValuesMany,
|
|
3299
|
+
deleteAssetTypeFieldValues,
|
|
3300
|
+
deleteAssetTypeFieldValuesMany
|
|
3301
|
+
} = assetTypeFieldValuesSlice.actions;
|
|
3302
|
+
const selectAssetTypeFieldValuesMapping = (state) => state.assetTypeFieldValuesReducer.instances;
|
|
3303
|
+
const selectAssetTypeFieldValues = createSelector([selectAssetTypeFieldValuesMapping], (fieldValuesMapping) => {
|
|
3304
|
+
return Object.values(fieldValuesMapping);
|
|
3305
|
+
});
|
|
3306
|
+
const selectAssetTypeFieldValuesOfAsset = restructureCreateSelectorWithArgs(
|
|
3307
|
+
createSelector([selectAssetTypeFieldValues, (_state, assetId) => assetId], (fieldValues, assetId) => {
|
|
3308
|
+
return fallbackToEmptyArray(fieldValues.filter((fieldValue) => fieldValue.asset === assetId));
|
|
3309
|
+
})
|
|
3310
|
+
);
|
|
3311
|
+
const selectAssetTypeFieldValuesById = (fieldValuesId) => (state) => {
|
|
3312
|
+
return state.assetTypeFieldValuesReducer.instances[fieldValuesId];
|
|
3313
|
+
};
|
|
3314
|
+
const assetTypeFieldValuesReducer = assetTypeFieldValuesSlice.reducer;
|
|
3315
|
+
const assetTypeFieldsAttachmentAdapter = createModelAdapter(
|
|
3316
|
+
(attachment) => attachment.offline_id
|
|
3317
|
+
);
|
|
3318
|
+
const initialState$1 = assetTypeFieldsAttachmentAdapter.getInitialState({});
|
|
3319
|
+
const assetTypeFieldsAttachmentSlice = createSlice({
|
|
3320
|
+
name: "assetTypeFieldsAttachments",
|
|
3321
|
+
initialState: initialState$1,
|
|
3322
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$1)),
|
|
3323
|
+
reducers: {
|
|
3324
|
+
initializeAssetTypeFieldsAttachments: assetTypeFieldsAttachmentAdapter.initialize,
|
|
3325
|
+
addAssetTypeFieldsAttachment: assetTypeFieldsAttachmentAdapter.addOne,
|
|
3326
|
+
addAssetTypeFieldsAttachments: assetTypeFieldsAttachmentAdapter.addMany,
|
|
3327
|
+
setAssetTypeFieldsAttachment: assetTypeFieldsAttachmentAdapter.setOne,
|
|
3328
|
+
setAssetTypeFieldsAttachments: assetTypeFieldsAttachmentAdapter.setMany,
|
|
3329
|
+
updateAssetTypeFieldsAttachment: assetTypeFieldsAttachmentAdapter.updateOne,
|
|
3330
|
+
updateAssetTypeFieldsAttachments: assetTypeFieldsAttachmentAdapter.updateMany,
|
|
3331
|
+
deleteAssetTypeFieldsAttachment: assetTypeFieldsAttachmentAdapter.deleteOne,
|
|
3332
|
+
deleteAssetTypeFieldsAttachments: assetTypeFieldsAttachmentAdapter.deleteMany
|
|
3333
|
+
}
|
|
3334
|
+
});
|
|
3335
|
+
const {
|
|
3336
|
+
initializeAssetTypeFieldsAttachments,
|
|
3337
|
+
addAssetTypeFieldsAttachment,
|
|
3338
|
+
addAssetTypeFieldsAttachments,
|
|
3339
|
+
setAssetTypeFieldsAttachment,
|
|
3340
|
+
setAssetTypeFieldsAttachments,
|
|
3341
|
+
updateAssetTypeFieldsAttachment,
|
|
3342
|
+
updateAssetTypeFieldsAttachments,
|
|
3343
|
+
deleteAssetTypeFieldsAttachment,
|
|
3344
|
+
deleteAssetTypeFieldsAttachments
|
|
3345
|
+
} = assetTypeFieldsAttachmentSlice.actions;
|
|
3346
|
+
const selectAssetTypeFieldsAttachmentsMapping = (state) => state.assetTypeFieldsAttachmentReducer.instances;
|
|
3347
|
+
const selectAssetTypeFieldsAttachments = createSelector(
|
|
3348
|
+
[selectAssetTypeFieldsAttachmentsMapping],
|
|
3349
|
+
(attachmentsMapping) => {
|
|
3350
|
+
return Object.values(attachmentsMapping);
|
|
3351
|
+
}
|
|
3352
|
+
);
|
|
3353
|
+
const selectAttachmentsOfAssetTypeFields = restructureCreateSelectorWithArgs(
|
|
3354
|
+
createSelector([selectAssetTypeFieldsAttachments, (_state, id) => id], (attachments, id) => {
|
|
3355
|
+
return fallbackToEmptyArray(attachments.filter((attachment) => attachment.fields_revision === id));
|
|
3356
|
+
})
|
|
3357
|
+
);
|
|
3358
|
+
const selectAssetTypeFieldsAttachmentById = (attachmentId) => (state) => {
|
|
3359
|
+
return state.assetTypeFieldsAttachmentReducer.instances[attachmentId];
|
|
3360
|
+
};
|
|
3361
|
+
const assetTypeFieldsAttachmentReducer = assetTypeFieldsAttachmentSlice.reducer;
|
|
3362
|
+
const assetTypeFieldValuesAttachmentAdapter = createModelAdapter(
|
|
3363
|
+
(attachment) => attachment.offline_id
|
|
3364
|
+
);
|
|
3365
|
+
const initialState = assetTypeFieldValuesAttachmentAdapter.getInitialState({});
|
|
3366
|
+
const assetTypeFieldValuesAttachmentSlice = createSlice({
|
|
3367
|
+
name: "assetTypeFieldValuesAttachments",
|
|
3368
|
+
initialState,
|
|
3369
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState)),
|
|
3370
|
+
reducers: {
|
|
3371
|
+
initializeAssetTypeFieldValuesAttachments: assetTypeFieldValuesAttachmentAdapter.initialize,
|
|
3372
|
+
addAssetTypeFieldValuesAttachment: assetTypeFieldValuesAttachmentAdapter.addOne,
|
|
3373
|
+
addAssetTypeFieldValuesAttachments: assetTypeFieldValuesAttachmentAdapter.addMany,
|
|
3374
|
+
setAssetTypeFieldValuesAttachment: assetTypeFieldValuesAttachmentAdapter.setOne,
|
|
3375
|
+
setAssetTypeFieldValuesAttachments: assetTypeFieldValuesAttachmentAdapter.setMany,
|
|
3376
|
+
updateAssetTypeFieldValuesAttachment: assetTypeFieldValuesAttachmentAdapter.updateOne,
|
|
3377
|
+
updateAssetTypeFieldValuesAttachments: assetTypeFieldValuesAttachmentAdapter.updateMany,
|
|
3378
|
+
deleteAssetTypeFieldValuesAttachment: assetTypeFieldValuesAttachmentAdapter.deleteOne,
|
|
3379
|
+
deleteAssetTypeFieldValuesAttachments: assetTypeFieldValuesAttachmentAdapter.deleteMany
|
|
3380
|
+
}
|
|
3381
|
+
});
|
|
3382
|
+
const {
|
|
3383
|
+
initializeAssetTypeFieldValuesAttachments,
|
|
3384
|
+
addAssetTypeFieldValuesAttachment,
|
|
3385
|
+
addAssetTypeFieldValuesAttachments,
|
|
3386
|
+
setAssetTypeFieldValuesAttachment,
|
|
3387
|
+
setAssetTypeFieldValuesAttachments,
|
|
3388
|
+
updateAssetTypeFieldValuesAttachment,
|
|
3389
|
+
updateAssetTypeFieldValuesAttachments,
|
|
3390
|
+
deleteAssetTypeFieldValuesAttachment,
|
|
3391
|
+
deleteAssetTypeFieldValuesAttachments
|
|
3392
|
+
} = assetTypeFieldValuesAttachmentSlice.actions;
|
|
3393
|
+
const selectAssetTypeFieldValuesAttachmentsMapping = (state) => state.assetTypeFieldValuesAttachmentReducer.instances;
|
|
3394
|
+
const selectAssetTypeFieldValuesAttachments = createSelector(
|
|
3395
|
+
[selectAssetTypeFieldValuesAttachmentsMapping],
|
|
3396
|
+
(attachmentsMapping) => {
|
|
3397
|
+
return Object.values(attachmentsMapping);
|
|
3398
|
+
}
|
|
3399
|
+
);
|
|
3400
|
+
const selectAttachmentsOfAssetTypeFieldValues = restructureCreateSelectorWithArgs(
|
|
3401
|
+
createSelector([selectAssetTypeFieldValuesAttachments, (_state, id) => id], (attachments, id) => {
|
|
3402
|
+
return fallbackToEmptyArray(attachments.filter((attachment) => attachment.field_values === id));
|
|
3403
|
+
})
|
|
3404
|
+
);
|
|
3405
|
+
const selectAssetTypeFieldValuesAttachmentById = (attachmentId) => (state) => {
|
|
3406
|
+
return state.assetTypeFieldValuesAttachmentReducer.instances[attachmentId];
|
|
3407
|
+
};
|
|
3408
|
+
const assetTypeFieldValuesAttachmentReducer = assetTypeFieldValuesAttachmentSlice.reducer;
|
|
3409
|
+
let clientStore;
|
|
3410
|
+
function setClientStore(store) {
|
|
3411
|
+
clientStore = store;
|
|
3412
|
+
}
|
|
3413
|
+
function getClientStore() {
|
|
3414
|
+
return clientStore;
|
|
3415
|
+
}
|
|
3416
|
+
let clientSDK;
|
|
3417
|
+
function setClientSDK(sdkCtor) {
|
|
3418
|
+
clientSDK = sdkCtor;
|
|
3419
|
+
}
|
|
3420
|
+
function getClientSDK() {
|
|
3421
|
+
return clientSDK;
|
|
3422
|
+
}
|
|
3423
|
+
const CLASS_NAME_TO_SERVICE = {};
|
|
3424
|
+
class BaseService {
|
|
3425
|
+
constructor(sdk) {
|
|
3426
|
+
__publicField(this, "client");
|
|
3427
|
+
CLASS_NAME_TO_SERVICE[this.constructor.name] = this;
|
|
3428
|
+
this.client = sdk;
|
|
3429
|
+
}
|
|
3430
|
+
async enqueueRequest(requestDetails) {
|
|
3431
|
+
return this.client.enqueueRequest(requestDetails, this.host, this.constructor.name);
|
|
3432
|
+
}
|
|
3433
|
+
dispatch(action) {
|
|
3434
|
+
this.client.store.dispatch(action);
|
|
3435
|
+
}
|
|
3436
|
+
}
|
|
3437
|
+
const VERSION_REDUCER_KEY = "versioning";
|
|
3438
|
+
const overmapReducers = {
|
|
3439
|
+
// TODO: attachmentReducer,
|
|
3440
|
+
[VERSION_REDUCER_KEY]: versioningReducer,
|
|
3441
|
+
fileReducer,
|
|
3442
|
+
authReducer,
|
|
3443
|
+
categoryReducer,
|
|
3444
|
+
assetReducer,
|
|
3445
|
+
assetAttachmentReducer,
|
|
3446
|
+
assetStageCompletionReducer,
|
|
3447
|
+
assetStageReducer,
|
|
3448
|
+
assetTypeReducer,
|
|
3449
|
+
assetTypeAttachmentReducer,
|
|
3450
|
+
issueReducer,
|
|
3451
|
+
issueAttachmentReducer,
|
|
3452
|
+
issueTypeReducer,
|
|
3453
|
+
organizationReducer,
|
|
3454
|
+
outboxReducer,
|
|
3455
|
+
projectReducer,
|
|
3456
|
+
projectAttachmentReducer,
|
|
3457
|
+
projectAccessReducer,
|
|
3458
|
+
organizationAccessReducer,
|
|
3459
|
+
projectFileReducer,
|
|
3460
|
+
rehydratedReducer,
|
|
3461
|
+
formReducer,
|
|
3462
|
+
formRevisionReducer,
|
|
3463
|
+
formRevisionAttachmentReducer,
|
|
3464
|
+
formSubmissionAttachmentReducer,
|
|
3465
|
+
formSubmissionReducer,
|
|
3466
|
+
userReducer,
|
|
3467
|
+
workspaceReducer,
|
|
3468
|
+
emailDomainsReducer,
|
|
3469
|
+
licenseReducer,
|
|
3470
|
+
documentsReducer,
|
|
3471
|
+
documentAttachmentReducer,
|
|
3472
|
+
teamReducer,
|
|
3473
|
+
agentsReducer,
|
|
3474
|
+
issueCommentReducer,
|
|
3475
|
+
issueUpdateReducer,
|
|
3476
|
+
geoImageReducer,
|
|
3477
|
+
issueAssociationReducer,
|
|
3478
|
+
issueTypeFieldsReducer,
|
|
3479
|
+
issueTypeFieldValuesReducer,
|
|
3480
|
+
issueTypeFieldsAttachmentReducer,
|
|
3481
|
+
issueTypeFieldValuesAttachmentReducer,
|
|
3482
|
+
assetTypeFieldsReducer,
|
|
3483
|
+
assetTypeFieldValuesReducer,
|
|
3484
|
+
assetTypeFieldsAttachmentReducer,
|
|
3485
|
+
assetTypeFieldValuesAttachmentReducer
|
|
3486
|
+
};
|
|
3487
|
+
const overmapReducer = combineReducers(overmapReducers);
|
|
3488
|
+
const resetStore = "RESET";
|
|
3489
|
+
const overmapRootReducer = (state, action) => {
|
|
3490
|
+
if (action.type === "auth/setLoggedIn" && !action.payload) {
|
|
3491
|
+
return overmapReducer(void 0, action);
|
|
3492
|
+
}
|
|
3493
|
+
return overmapReducer(state, action);
|
|
3494
|
+
};
|
|
3495
|
+
let __OUTBOX_COORDINATOR = null;
|
|
3496
|
+
function getOutboxCoordinator() {
|
|
3230
3497
|
const clientStore2 = getClientStore();
|
|
3231
3498
|
if (!clientStore2) {
|
|
3232
3499
|
console.warn("Client store not set; cannot get outbox coordinator yet.");
|
|
@@ -3857,9 +4124,6 @@ class CategoryService extends BaseApiService {
|
|
|
3857
4124
|
description: "Create Category",
|
|
3858
4125
|
method: HttpMethod.POST,
|
|
3859
4126
|
url: "/categories/",
|
|
3860
|
-
queryParams: {
|
|
3861
|
-
workspace_id: payload.workspace.toString()
|
|
3862
|
-
},
|
|
3863
4127
|
payload: offlineCategory,
|
|
3864
4128
|
blockers: [payload.workspace],
|
|
3865
4129
|
blocks: [offlineCategory.offline_id]
|
|
@@ -4072,7 +4336,10 @@ class AssetService extends BaseApiService {
|
|
|
4072
4336
|
const result = await this.enqueueRequest({
|
|
4073
4337
|
description: "Get assets",
|
|
4074
4338
|
method: HttpMethod.GET,
|
|
4075
|
-
url:
|
|
4339
|
+
url: "/assets/",
|
|
4340
|
+
queryParams: {
|
|
4341
|
+
project: projectId.toString()
|
|
4342
|
+
},
|
|
4076
4343
|
blockers: [],
|
|
4077
4344
|
blocks: []
|
|
4078
4345
|
});
|
|
@@ -4093,7 +4360,7 @@ class AssetStageCompletionService extends BaseApiService {
|
|
|
4093
4360
|
const promise = this.enqueueRequest({
|
|
4094
4361
|
description: "Add asset stage completion",
|
|
4095
4362
|
method: HttpMethod.POST,
|
|
4096
|
-
url: "/
|
|
4363
|
+
url: "/asset-stage-completions/",
|
|
4097
4364
|
payload: {
|
|
4098
4365
|
offline_id: offlineStageCompletion.offline_id,
|
|
4099
4366
|
submitted_at: submittedAt,
|
|
@@ -4120,7 +4387,7 @@ class AssetStageCompletionService extends BaseApiService {
|
|
|
4120
4387
|
const promise = this.enqueueRequest({
|
|
4121
4388
|
description: "Delete asset stage completion",
|
|
4122
4389
|
method: HttpMethod.DELETE,
|
|
4123
|
-
url: `/
|
|
4390
|
+
url: `/asset-stage-completions/${id}/`,
|
|
4124
4391
|
blockers: [id],
|
|
4125
4392
|
blocks: []
|
|
4126
4393
|
});
|
|
@@ -4146,7 +4413,7 @@ class AssetStageCompletionService extends BaseApiService {
|
|
|
4146
4413
|
const promise = this.enqueueRequest({
|
|
4147
4414
|
description: "Bulk create asset stage completions",
|
|
4148
4415
|
method: HttpMethod.POST,
|
|
4149
|
-
url: "/
|
|
4416
|
+
url: "/asset-stage-completions/bulk/",
|
|
4150
4417
|
payload: {
|
|
4151
4418
|
submitted_at: submittedAt,
|
|
4152
4419
|
completions: payload
|
|
@@ -4168,7 +4435,7 @@ class AssetStageCompletionService extends BaseApiService {
|
|
|
4168
4435
|
const promise = this.enqueueRequest({
|
|
4169
4436
|
description: "Deleting asset stage completions",
|
|
4170
4437
|
method: HttpMethod.DELETE,
|
|
4171
|
-
url: "/
|
|
4438
|
+
url: "/asset-stage-completions/bulk/",
|
|
4172
4439
|
payload: {
|
|
4173
4440
|
completion_ids: ids
|
|
4174
4441
|
},
|
|
@@ -4184,7 +4451,10 @@ class AssetStageCompletionService extends BaseApiService {
|
|
|
4184
4451
|
const result = await this.enqueueRequest({
|
|
4185
4452
|
description: "Get asset stage completions",
|
|
4186
4453
|
method: HttpMethod.GET,
|
|
4187
|
-
url:
|
|
4454
|
+
url: "/asset-stage-completions/",
|
|
4455
|
+
queryParams: {
|
|
4456
|
+
project: projectId.toString()
|
|
4457
|
+
},
|
|
4188
4458
|
blockers: [],
|
|
4189
4459
|
blocks: []
|
|
4190
4460
|
});
|
|
@@ -4205,7 +4475,7 @@ class AssetStageService extends BaseApiService {
|
|
|
4205
4475
|
const promise = this.enqueueRequest({
|
|
4206
4476
|
description: "Add asset stages",
|
|
4207
4477
|
method: HttpMethod.POST,
|
|
4208
|
-
url: "/
|
|
4478
|
+
url: "/asset-stages/bulk/",
|
|
4209
4479
|
payload: {
|
|
4210
4480
|
submitted_at: submittedAt,
|
|
4211
4481
|
asset_type: assetTypeId,
|
|
@@ -4229,7 +4499,7 @@ class AssetStageService extends BaseApiService {
|
|
|
4229
4499
|
return this.enqueueRequest({
|
|
4230
4500
|
description: "Edit asset stages",
|
|
4231
4501
|
method: HttpMethod.PATCH,
|
|
4232
|
-
url: `/
|
|
4502
|
+
url: `/asset-types/${assetTypeId}/bulk-update-stages/`,
|
|
4233
4503
|
payload: {
|
|
4234
4504
|
stages: stagesToUpdate
|
|
4235
4505
|
},
|
|
@@ -4247,7 +4517,7 @@ class AssetStageService extends BaseApiService {
|
|
|
4247
4517
|
const promise = this.enqueueRequest({
|
|
4248
4518
|
description: "Delete asset stages",
|
|
4249
4519
|
method: HttpMethod.DELETE,
|
|
4250
|
-
url: "/
|
|
4520
|
+
url: "/asset-stages/bulk/",
|
|
4251
4521
|
payload: {
|
|
4252
4522
|
stage_ids: idsToDelete
|
|
4253
4523
|
},
|
|
@@ -4272,7 +4542,7 @@ class AssetStageService extends BaseApiService {
|
|
|
4272
4542
|
const promise = this.enqueueRequest({
|
|
4273
4543
|
description: "Update asset stage",
|
|
4274
4544
|
method: HttpMethod.PATCH,
|
|
4275
|
-
url: `/
|
|
4545
|
+
url: `/asset-stages/${assetStage.offline_id}/`,
|
|
4276
4546
|
payload: {
|
|
4277
4547
|
name: payload.name,
|
|
4278
4548
|
description: payload.description,
|
|
@@ -4300,7 +4570,7 @@ class AssetStageService extends BaseApiService {
|
|
|
4300
4570
|
await this.enqueueRequest({
|
|
4301
4571
|
description: "Link asset stage to form",
|
|
4302
4572
|
method: HttpMethod.POST,
|
|
4303
|
-
url: `/
|
|
4573
|
+
url: `/asset-stages/${stageId}/associate-with-form/`,
|
|
4304
4574
|
payload: { form: formId },
|
|
4305
4575
|
blockers: [stageId, formId],
|
|
4306
4576
|
blocks: [stageId]
|
|
@@ -4321,7 +4591,7 @@ class AssetStageService extends BaseApiService {
|
|
|
4321
4591
|
await this.enqueueRequest({
|
|
4322
4592
|
description: "Unlink asset stage from form",
|
|
4323
4593
|
method: HttpMethod.DELETE,
|
|
4324
|
-
url: `/
|
|
4594
|
+
url: `/asset-stages/${stageId}/associate-with-form/`,
|
|
4325
4595
|
blockers: [stageId, formId],
|
|
4326
4596
|
blocks: [stageId]
|
|
4327
4597
|
});
|
|
@@ -4334,7 +4604,10 @@ class AssetStageService extends BaseApiService {
|
|
|
4334
4604
|
const result = await this.enqueueRequest({
|
|
4335
4605
|
description: "Get asset stages",
|
|
4336
4606
|
method: HttpMethod.GET,
|
|
4337
|
-
url:
|
|
4607
|
+
url: "/asset-stages/",
|
|
4608
|
+
queryParams: {
|
|
4609
|
+
project: projectId.toString()
|
|
4610
|
+
},
|
|
4338
4611
|
blockers: [],
|
|
4339
4612
|
blocks: []
|
|
4340
4613
|
});
|
|
@@ -4351,7 +4624,12 @@ class BaseUploadService extends BaseApiService {
|
|
|
4351
4624
|
projectAttachmentReducer: projectAttachmentReducer2,
|
|
4352
4625
|
formRevisionAttachmentReducer: formRevisionAttachmentReducer2,
|
|
4353
4626
|
formSubmissionAttachmentReducer: formSubmissionAttachmentReducer2,
|
|
4354
|
-
geoImageReducer: geoImageReducer2
|
|
4627
|
+
geoImageReducer: geoImageReducer2,
|
|
4628
|
+
// fields
|
|
4629
|
+
assetTypeFieldsAttachmentReducer: assetTypeFieldsAttachmentReducer2,
|
|
4630
|
+
assetTypeFieldValuesAttachmentReducer: assetTypeFieldValuesAttachmentReducer2,
|
|
4631
|
+
issueTypeFieldsAttachmentReducer: issueTypeFieldsAttachmentReducer2,
|
|
4632
|
+
issueTypeFieldValuesAttachmentReducer: issueTypeFieldValuesAttachmentReducer2
|
|
4355
4633
|
} = this.client.store.getState();
|
|
4356
4634
|
const objectsWithSha1 = [].concat(
|
|
4357
4635
|
Object.values(issueAttachmentReducer2.instances),
|
|
@@ -4361,7 +4639,11 @@ class BaseUploadService extends BaseApiService {
|
|
|
4361
4639
|
Object.values(projectAttachmentReducer2.instances),
|
|
4362
4640
|
Object.values(formRevisionAttachmentReducer2.instances),
|
|
4363
4641
|
Object.values(formSubmissionAttachmentReducer2.instances),
|
|
4364
|
-
Object.values(geoImageReducer2.instances)
|
|
4642
|
+
Object.values(geoImageReducer2.instances),
|
|
4643
|
+
Object.values(assetTypeFieldsAttachmentReducer2.instances),
|
|
4644
|
+
Object.values(assetTypeFieldValuesAttachmentReducer2.instances),
|
|
4645
|
+
Object.values(issueTypeFieldsAttachmentReducer2.instances),
|
|
4646
|
+
Object.values(issueTypeFieldValuesAttachmentReducer2.instances)
|
|
4365
4647
|
);
|
|
4366
4648
|
return objectsWithSha1.filter((object) => object.file_sha1 === sha1).length;
|
|
4367
4649
|
}
|
|
@@ -4383,41 +4665,20 @@ class BaseUploadService extends BaseApiService {
|
|
|
4383
4665
|
}
|
|
4384
4666
|
return promisesBySha1;
|
|
4385
4667
|
}
|
|
4386
|
-
|
|
4387
|
-
const
|
|
4388
|
-
|
|
4389
|
-
|
|
4390
|
-
|
|
4391
|
-
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4396
|
-
attachUrlPrefix: "/assets",
|
|
4397
|
-
deleteUrlPrefix: "/assets",
|
|
4398
|
-
fetchUrlPostfix: "/asset-attachments"
|
|
4399
|
-
},
|
|
4400
|
-
[AttachmentModel.AssetType]: {
|
|
4401
|
-
name: "asset type",
|
|
4402
|
-
attachUrlPrefix: "/assets/types",
|
|
4403
|
-
deleteUrlPrefix: "/assets/types",
|
|
4404
|
-
fetchUrlPostfix: "/asset-type-attachments"
|
|
4405
|
-
},
|
|
4406
|
-
[AttachmentModel.Project]: {
|
|
4407
|
-
name: "project",
|
|
4408
|
-
attachUrlPrefix: "/projects",
|
|
4409
|
-
deleteUrlPrefix: "/projects",
|
|
4410
|
-
fetchUrlPostfix: "/attachments"
|
|
4411
|
-
},
|
|
4412
|
-
[AttachmentModel.Document]: {
|
|
4413
|
-
name: "document",
|
|
4414
|
-
attachUrlPrefix: "/documents",
|
|
4415
|
-
deleteUrlPrefix: "/documents",
|
|
4416
|
-
fetchUrlPostfix: "/document-attachments"
|
|
4668
|
+
async getFilePayload(file) {
|
|
4669
|
+
const sha1 = await hashFile(file);
|
|
4670
|
+
const filePayload = {
|
|
4671
|
+
sha1,
|
|
4672
|
+
file_type: file.type,
|
|
4673
|
+
extension: file.name.split(".").pop(),
|
|
4674
|
+
size: file.size
|
|
4675
|
+
};
|
|
4676
|
+
await this.client.files.addCache(file, sha1);
|
|
4677
|
+
return filePayload;
|
|
4417
4678
|
}
|
|
4418
|
-
}
|
|
4679
|
+
}
|
|
4419
4680
|
class BaseAttachmentService extends BaseUploadService {
|
|
4420
|
-
async
|
|
4681
|
+
async _bulkAdd(payloads) {
|
|
4421
4682
|
var _a2;
|
|
4422
4683
|
const { store } = this.client;
|
|
4423
4684
|
const createdBy = (_a2 = store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
@@ -4425,39 +4686,36 @@ class BaseAttachmentService extends BaseUploadService {
|
|
|
4425
4686
|
const offlineAttachments = [];
|
|
4426
4687
|
const attachmentPayloads = [];
|
|
4427
4688
|
const filePayloads = {};
|
|
4428
|
-
for (const
|
|
4429
|
-
const
|
|
4430
|
-
|
|
4431
|
-
|
|
4432
|
-
|
|
4433
|
-
|
|
4434
|
-
extension: file.name.split(".").pop(),
|
|
4435
|
-
size: file.size
|
|
4436
|
-
};
|
|
4437
|
-
await this.client.files.addCache(file, sha1);
|
|
4438
|
-
}
|
|
4439
|
-
const offlineAttachment = buildOfflineAttachment({
|
|
4689
|
+
for (const payload of payloads) {
|
|
4690
|
+
const { modelId, file } = payload;
|
|
4691
|
+
const filePayload = await this.getFilePayload(file);
|
|
4692
|
+
if (!(filePayload.sha1 in filePayloads))
|
|
4693
|
+
filePayloads[filePayload.sha1] = filePayload;
|
|
4694
|
+
const offlineAttachment = this.buildOfflineAttachment({
|
|
4440
4695
|
file,
|
|
4441
|
-
sha1,
|
|
4442
|
-
submittedAt,
|
|
4443
|
-
createdBy,
|
|
4696
|
+
file_sha1: filePayload.sha1,
|
|
4697
|
+
submitted_at: submittedAt,
|
|
4698
|
+
created_by: createdBy,
|
|
4444
4699
|
description: "",
|
|
4445
4700
|
modelId
|
|
4446
4701
|
});
|
|
4447
4702
|
offlineAttachments.push(offlineAttachment);
|
|
4448
|
-
attachmentPayloads.push(
|
|
4449
|
-
|
|
4450
|
-
|
|
4451
|
-
|
|
4452
|
-
|
|
4453
|
-
|
|
4703
|
+
attachmentPayloads.push(
|
|
4704
|
+
this.buildAttachmentPayload({
|
|
4705
|
+
offline_id: offlineAttachment.offline_id,
|
|
4706
|
+
file_name: offlineAttachment.file_name,
|
|
4707
|
+
file_sha1: offlineAttachment.file_sha1,
|
|
4708
|
+
file_extension: filePayload.extension,
|
|
4709
|
+
description: offlineAttachment.description,
|
|
4710
|
+
modelId
|
|
4711
|
+
})
|
|
4712
|
+
);
|
|
4454
4713
|
}
|
|
4455
4714
|
this.dispatch(this.addAttachments(offlineAttachments));
|
|
4456
|
-
const meta = AttachmentModelMeta[this.attachmentModel];
|
|
4457
4715
|
const promise = this.enqueueRequest({
|
|
4458
|
-
description: `
|
|
4716
|
+
description: `Add ${this.name}`,
|
|
4459
4717
|
method: HttpMethod.POST,
|
|
4460
|
-
url: `${
|
|
4718
|
+
url: `${this.url}/bulk/`,
|
|
4461
4719
|
payload: {
|
|
4462
4720
|
submitted_at: submittedAt,
|
|
4463
4721
|
attachments: attachmentPayloads,
|
|
@@ -4474,7 +4732,7 @@ class BaseAttachmentService extends BaseUploadService {
|
|
|
4474
4732
|
});
|
|
4475
4733
|
return [offlineAttachments, promise.then(({ attachments }) => attachments)];
|
|
4476
4734
|
}
|
|
4477
|
-
async
|
|
4735
|
+
async _delete(attachmendId) {
|
|
4478
4736
|
const { store } = this.client;
|
|
4479
4737
|
const attachment = this.selectAttachment(attachmendId)(store.getState());
|
|
4480
4738
|
if (!attachment) {
|
|
@@ -4483,11 +4741,10 @@ class BaseAttachmentService extends BaseUploadService {
|
|
|
4483
4741
|
);
|
|
4484
4742
|
}
|
|
4485
4743
|
this.dispatch(this.removeAttachment(attachment.offline_id));
|
|
4486
|
-
const meta = AttachmentModelMeta[this.attachmentModel];
|
|
4487
4744
|
const promise = this.enqueueRequest({
|
|
4488
|
-
description:
|
|
4745
|
+
description: `Delete ${this.name}`,
|
|
4489
4746
|
method: HttpMethod.DELETE,
|
|
4490
|
-
url: `${
|
|
4747
|
+
url: `${this.url}/${attachmendId}/`,
|
|
4491
4748
|
blockers: [attachmendId],
|
|
4492
4749
|
blocks: []
|
|
4493
4750
|
});
|
|
@@ -4500,24 +4757,12 @@ class BaseAttachmentService extends BaseUploadService {
|
|
|
4500
4757
|
});
|
|
4501
4758
|
return promise;
|
|
4502
4759
|
}
|
|
4503
|
-
// Note that currently the fetching of attachments for all models dependds on the active projectId. This may change in the future. And
|
|
4504
|
-
// so for some attachment model services, this method will have to be overridden.
|
|
4505
|
-
async refreshStore(projectId, _organizationId) {
|
|
4506
|
-
const meta = AttachmentModelMeta[this.attachmentModel];
|
|
4507
|
-
const result = await this.enqueueRequest({
|
|
4508
|
-
description: `Get ${meta.name} attachments`,
|
|
4509
|
-
method: HttpMethod.GET,
|
|
4510
|
-
url: `/projects/${projectId}${meta.fetchUrlPostfix}/`,
|
|
4511
|
-
blocks: [],
|
|
4512
|
-
blockers: []
|
|
4513
|
-
});
|
|
4514
|
-
this.dispatch(this.initializeAttachments(result));
|
|
4515
|
-
}
|
|
4516
4760
|
}
|
|
4517
4761
|
class AssetAttachmentService extends BaseAttachmentService {
|
|
4518
4762
|
constructor() {
|
|
4519
4763
|
super(...arguments);
|
|
4520
|
-
__publicField(this, "
|
|
4764
|
+
__publicField(this, "name", "Asset Attachment");
|
|
4765
|
+
__publicField(this, "url", "/asset-attachments");
|
|
4521
4766
|
__publicField(this, "initializeAttachments", initializeAssetAttachments);
|
|
4522
4767
|
__publicField(this, "addAttachments", addAssetAttachments);
|
|
4523
4768
|
__publicField(this, "updateAttachments", updateAssetAttachments);
|
|
@@ -4529,20 +4774,39 @@ class AssetAttachmentService extends BaseAttachmentService {
|
|
|
4529
4774
|
buildOfflineAttachment(data) {
|
|
4530
4775
|
return offline({
|
|
4531
4776
|
file: URL.createObjectURL(data.file),
|
|
4532
|
-
file_sha1: data.
|
|
4533
|
-
created_by: data.
|
|
4777
|
+
file_sha1: data.file_sha1,
|
|
4778
|
+
created_by: data.created_by,
|
|
4534
4779
|
file_name: data.file.name,
|
|
4535
4780
|
file_type: data.file.type,
|
|
4536
|
-
submitted_at: data.
|
|
4781
|
+
submitted_at: data.submitted_at,
|
|
4537
4782
|
description: data.description,
|
|
4538
4783
|
asset: data.modelId
|
|
4539
4784
|
});
|
|
4540
4785
|
}
|
|
4541
|
-
|
|
4542
|
-
return
|
|
4786
|
+
buildAttachmentPayload(data) {
|
|
4787
|
+
return {
|
|
4788
|
+
...data,
|
|
4789
|
+
asset: data.modelId
|
|
4790
|
+
};
|
|
4791
|
+
}
|
|
4792
|
+
async bulkAdd(payloads) {
|
|
4793
|
+
return this._bulkAdd(payloads.map((p) => ({ modelId: p.assetId, file: p.file })));
|
|
4543
4794
|
}
|
|
4544
|
-
async
|
|
4545
|
-
return this.
|
|
4795
|
+
async delete(id) {
|
|
4796
|
+
return this._delete(id);
|
|
4797
|
+
}
|
|
4798
|
+
async refreshStore(projectId) {
|
|
4799
|
+
const result = await this.enqueueRequest({
|
|
4800
|
+
description: "Get asset attachments",
|
|
4801
|
+
method: HttpMethod.GET,
|
|
4802
|
+
url: `${this.url}/`,
|
|
4803
|
+
queryParams: {
|
|
4804
|
+
project: projectId.toString()
|
|
4805
|
+
},
|
|
4806
|
+
blocks: [],
|
|
4807
|
+
blockers: []
|
|
4808
|
+
});
|
|
4809
|
+
this.dispatch(initializeAssetAttachments(result));
|
|
4546
4810
|
}
|
|
4547
4811
|
}
|
|
4548
4812
|
class AssetTypeService extends BaseApiService {
|
|
@@ -4559,7 +4823,7 @@ class AssetTypeService extends BaseApiService {
|
|
|
4559
4823
|
const promise = this.enqueueRequest({
|
|
4560
4824
|
description: "Create asset type",
|
|
4561
4825
|
method: HttpMethod.POST,
|
|
4562
|
-
url:
|
|
4826
|
+
url: "/asset-types/",
|
|
4563
4827
|
payload: { ...offlineAssetType },
|
|
4564
4828
|
blockers: [],
|
|
4565
4829
|
blocks: [offlineAssetType.offline_id]
|
|
@@ -4585,7 +4849,7 @@ class AssetTypeService extends BaseApiService {
|
|
|
4585
4849
|
const promise = this.enqueueRequest({
|
|
4586
4850
|
description: "Update asset type",
|
|
4587
4851
|
method: HttpMethod.PATCH,
|
|
4588
|
-
url: `/
|
|
4852
|
+
url: `/asset-types/${payload.offline_id}/`,
|
|
4589
4853
|
payload: {
|
|
4590
4854
|
icon: payload.icon,
|
|
4591
4855
|
color: payload.color,
|
|
@@ -4619,7 +4883,7 @@ class AssetTypeService extends BaseApiService {
|
|
|
4619
4883
|
return this.enqueueRequest({
|
|
4620
4884
|
description: "Delete asset type",
|
|
4621
4885
|
method: HttpMethod.DELETE,
|
|
4622
|
-
url: `/
|
|
4886
|
+
url: `/asset-types/${assetTypeId}/`,
|
|
4623
4887
|
blockers: [assetTypeId],
|
|
4624
4888
|
blocks: []
|
|
4625
4889
|
}).catch((e) => {
|
|
@@ -4634,7 +4898,10 @@ class AssetTypeService extends BaseApiService {
|
|
|
4634
4898
|
const result = await this.enqueueRequest({
|
|
4635
4899
|
description: "Get asset types",
|
|
4636
4900
|
method: HttpMethod.GET,
|
|
4637
|
-
url:
|
|
4901
|
+
url: "/asset-types/",
|
|
4902
|
+
queryParams: {
|
|
4903
|
+
project: projectId.toString()
|
|
4904
|
+
},
|
|
4638
4905
|
blockers: [],
|
|
4639
4906
|
blocks: []
|
|
4640
4907
|
});
|
|
@@ -4644,8 +4911,8 @@ class AssetTypeService extends BaseApiService {
|
|
|
4644
4911
|
class AssetTypeAttachmentService extends BaseAttachmentService {
|
|
4645
4912
|
constructor() {
|
|
4646
4913
|
super(...arguments);
|
|
4647
|
-
__publicField(this, "
|
|
4648
|
-
__publicField(this, "
|
|
4914
|
+
__publicField(this, "name", "Asset Type Attachment");
|
|
4915
|
+
__publicField(this, "url", "/asset-type-attachments");
|
|
4649
4916
|
__publicField(this, "addAttachments", addAssetTypeAttachments);
|
|
4650
4917
|
__publicField(this, "updateAttachments", updateAssetTypeAttachments);
|
|
4651
4918
|
__publicField(this, "removeAttachments", deleteAssetTypeAttachments);
|
|
@@ -4656,20 +4923,39 @@ class AssetTypeAttachmentService extends BaseAttachmentService {
|
|
|
4656
4923
|
buildOfflineAttachment(data) {
|
|
4657
4924
|
return offline({
|
|
4658
4925
|
file: URL.createObjectURL(data.file),
|
|
4659
|
-
file_sha1: data.
|
|
4660
|
-
created_by: data.
|
|
4926
|
+
file_sha1: data.file_sha1,
|
|
4927
|
+
created_by: data.created_by,
|
|
4661
4928
|
file_name: data.file.name,
|
|
4662
4929
|
file_type: data.file.type,
|
|
4663
|
-
submitted_at: data.
|
|
4930
|
+
submitted_at: data.submitted_at,
|
|
4664
4931
|
description: data.description,
|
|
4665
4932
|
asset_type: data.modelId
|
|
4666
4933
|
});
|
|
4667
4934
|
}
|
|
4668
|
-
|
|
4669
|
-
return
|
|
4935
|
+
buildAttachmentPayload(data) {
|
|
4936
|
+
return {
|
|
4937
|
+
...data,
|
|
4938
|
+
asset_type: data.modelId
|
|
4939
|
+
};
|
|
4940
|
+
}
|
|
4941
|
+
async bulkAdd(payloads) {
|
|
4942
|
+
return this._bulkAdd(payloads.map((p) => ({ modelId: p.assetTypeId, file: p.file })));
|
|
4670
4943
|
}
|
|
4671
|
-
async
|
|
4672
|
-
return this.
|
|
4944
|
+
async delete(attachmentId) {
|
|
4945
|
+
return this._delete(attachmentId);
|
|
4946
|
+
}
|
|
4947
|
+
async refreshStore(projectId) {
|
|
4948
|
+
const result = await this.enqueueRequest({
|
|
4949
|
+
description: "Get asset type attachments",
|
|
4950
|
+
method: HttpMethod.GET,
|
|
4951
|
+
url: `${this.url}/`,
|
|
4952
|
+
queryParams: {
|
|
4953
|
+
project: projectId.toString()
|
|
4954
|
+
},
|
|
4955
|
+
blocks: [],
|
|
4956
|
+
blockers: []
|
|
4957
|
+
});
|
|
4958
|
+
this.dispatch(initializeAssetTypeAttachments(result));
|
|
4673
4959
|
}
|
|
4674
4960
|
}
|
|
4675
4961
|
class IssueCommentService extends BaseApiService {
|
|
@@ -4685,7 +4971,7 @@ class IssueCommentService extends BaseApiService {
|
|
|
4685
4971
|
const promise = this.enqueueRequest({
|
|
4686
4972
|
description: "Add issue comment",
|
|
4687
4973
|
method: HttpMethod.POST,
|
|
4688
|
-
url:
|
|
4974
|
+
url: "/issue-comments/",
|
|
4689
4975
|
payload: offlineComment,
|
|
4690
4976
|
blockers: [payload.issue],
|
|
4691
4977
|
blocks: [offlineComment.offline_id]
|
|
@@ -4709,7 +4995,7 @@ class IssueCommentService extends BaseApiService {
|
|
|
4709
4995
|
const promise = this.enqueueRequest({
|
|
4710
4996
|
description: "Edit issue comment",
|
|
4711
4997
|
method: HttpMethod.PATCH,
|
|
4712
|
-
url: `/
|
|
4998
|
+
url: `/issue-comments/${payload.offline_id}/`,
|
|
4713
4999
|
payload,
|
|
4714
5000
|
blockers: [payload.offline_id],
|
|
4715
5001
|
blocks: [payload.offline_id]
|
|
@@ -4728,7 +5014,7 @@ class IssueCommentService extends BaseApiService {
|
|
|
4728
5014
|
const promise = this.enqueueRequest({
|
|
4729
5015
|
description: "Delete comment",
|
|
4730
5016
|
method: HttpMethod.DELETE,
|
|
4731
|
-
url: `/
|
|
5017
|
+
url: `/issue-comments/${id}/`,
|
|
4732
5018
|
blockers: [id],
|
|
4733
5019
|
blocks: []
|
|
4734
5020
|
});
|
|
@@ -4741,7 +5027,10 @@ class IssueCommentService extends BaseApiService {
|
|
|
4741
5027
|
const result = await this.enqueueRequest({
|
|
4742
5028
|
description: "Get comments",
|
|
4743
5029
|
method: HttpMethod.GET,
|
|
4744
|
-
url:
|
|
5030
|
+
url: "/issue-comments/",
|
|
5031
|
+
queryParams: {
|
|
5032
|
+
project: projectId.toString()
|
|
5033
|
+
},
|
|
4745
5034
|
blockers: [],
|
|
4746
5035
|
blocks: []
|
|
4747
5036
|
});
|
|
@@ -4753,27 +5042,21 @@ class IssueUpdateService extends BaseApiService {
|
|
|
4753
5042
|
const result = await this.enqueueRequest({
|
|
4754
5043
|
description: "Get issue updates",
|
|
4755
5044
|
method: HttpMethod.GET,
|
|
4756
|
-
url:
|
|
5045
|
+
url: "/issue-updates/",
|
|
5046
|
+
queryParams: {
|
|
5047
|
+
project: projectId.toString()
|
|
5048
|
+
},
|
|
4757
5049
|
blockers: [],
|
|
4758
5050
|
blocks: []
|
|
4759
5051
|
});
|
|
4760
|
-
|
|
4761
|
-
filteredResult = filteredResult.map((comment) => {
|
|
4762
|
-
return { ...comment };
|
|
4763
|
-
});
|
|
4764
|
-
if (result.length !== filteredResult.length) {
|
|
4765
|
-
console.error(
|
|
4766
|
-
`Received duplicate comments from the API (new length ${filteredResult.length}); filtered in browser.`
|
|
4767
|
-
);
|
|
4768
|
-
}
|
|
4769
|
-
this.dispatch(initializeIssueUpdates(filteredResult));
|
|
5052
|
+
this.dispatch(initializeIssueUpdates(result));
|
|
4770
5053
|
}
|
|
4771
5054
|
}
|
|
4772
5055
|
class IssueAttachmentService extends BaseAttachmentService {
|
|
4773
5056
|
constructor() {
|
|
4774
5057
|
super(...arguments);
|
|
4775
|
-
__publicField(this, "
|
|
4776
|
-
__publicField(this, "
|
|
5058
|
+
__publicField(this, "name", "Issue Attachment");
|
|
5059
|
+
__publicField(this, "url", "/issue-attachments");
|
|
4777
5060
|
__publicField(this, "addAttachments", addIssueAttachments);
|
|
4778
5061
|
__publicField(this, "updateAttachments", updateIssueAttachments);
|
|
4779
5062
|
__publicField(this, "removeAttachments", deleteIssueAttachments);
|
|
@@ -4784,24 +5067,42 @@ class IssueAttachmentService extends BaseAttachmentService {
|
|
|
4784
5067
|
buildOfflineAttachment(data) {
|
|
4785
5068
|
return offline({
|
|
4786
5069
|
file: URL.createObjectURL(data.file),
|
|
4787
|
-
file_sha1: data.
|
|
4788
|
-
created_by: data.
|
|
5070
|
+
file_sha1: data.file_sha1,
|
|
5071
|
+
created_by: data.created_by,
|
|
4789
5072
|
file_name: data.file.name,
|
|
4790
5073
|
file_type: data.file.type,
|
|
4791
|
-
submitted_at: data.
|
|
5074
|
+
submitted_at: data.submitted_at,
|
|
4792
5075
|
description: data.description,
|
|
4793
5076
|
issue: data.modelId
|
|
4794
5077
|
});
|
|
4795
5078
|
}
|
|
4796
|
-
|
|
4797
|
-
return
|
|
5079
|
+
buildAttachmentPayload(data) {
|
|
5080
|
+
return {
|
|
5081
|
+
...data,
|
|
5082
|
+
issue: data.modelId
|
|
5083
|
+
};
|
|
5084
|
+
}
|
|
5085
|
+
async bulkAdd(payloads) {
|
|
5086
|
+
return this._bulkAdd(payloads.map((p) => ({ modelId: p.issueId, file: p.file })));
|
|
4798
5087
|
}
|
|
4799
|
-
async
|
|
4800
|
-
return this.
|
|
5088
|
+
async delete(id) {
|
|
5089
|
+
return this._delete(id);
|
|
5090
|
+
}
|
|
5091
|
+
async refreshStore(projectId) {
|
|
5092
|
+
const result = await this.enqueueRequest({
|
|
5093
|
+
description: "Get issue attachments",
|
|
5094
|
+
method: HttpMethod.GET,
|
|
5095
|
+
url: `${this.url}/`,
|
|
5096
|
+
queryParams: {
|
|
5097
|
+
project: projectId.toString()
|
|
5098
|
+
},
|
|
5099
|
+
blocks: [],
|
|
5100
|
+
blockers: []
|
|
5101
|
+
});
|
|
5102
|
+
this.dispatch(initializeIssueAttachments(result));
|
|
4801
5103
|
}
|
|
4802
5104
|
}
|
|
4803
5105
|
class IssueService extends BaseApiService {
|
|
4804
|
-
// Basic CRUD functions
|
|
4805
5106
|
add(payload) {
|
|
4806
5107
|
var _a2;
|
|
4807
5108
|
const { store } = this.client;
|
|
@@ -4819,10 +5120,6 @@ class IssueService extends BaseApiService {
|
|
|
4819
5120
|
description: "Create issue",
|
|
4820
5121
|
method: HttpMethod.POST,
|
|
4821
5122
|
url: "/issues/",
|
|
4822
|
-
queryParams: {
|
|
4823
|
-
workspace_id: payload.index_workspace,
|
|
4824
|
-
...payload.issue_type ? { issue_type: payload.issue_type } : {}
|
|
4825
|
-
},
|
|
4826
5123
|
payload: offlineIssue,
|
|
4827
5124
|
blockers: ["add-issue", ...offlineIssue.index_workspace ? [offlineIssue.index_workspace] : []],
|
|
4828
5125
|
blocks: [offlineIssue.offline_id]
|
|
@@ -4978,7 +5275,10 @@ class IssueService extends BaseApiService {
|
|
|
4978
5275
|
const result = await this.enqueueRequest({
|
|
4979
5276
|
description: "Get issues",
|
|
4980
5277
|
method: HttpMethod.GET,
|
|
4981
|
-
url:
|
|
5278
|
+
url: "/issues/",
|
|
5279
|
+
queryParams: {
|
|
5280
|
+
project: projectId.toString()
|
|
5281
|
+
},
|
|
4982
5282
|
blockers: [],
|
|
4983
5283
|
blocks: []
|
|
4984
5284
|
});
|
|
@@ -4998,7 +5298,7 @@ class IssueTypeService extends BaseApiService {
|
|
|
4998
5298
|
this.dispatch(addIssueType(offlineIssueType));
|
|
4999
5299
|
const promise = this.enqueueRequest({
|
|
5000
5300
|
method: HttpMethod.POST,
|
|
5001
|
-
url:
|
|
5301
|
+
url: "/issue-types/",
|
|
5002
5302
|
// Sending only whats needed here
|
|
5003
5303
|
payload: {
|
|
5004
5304
|
offline_id: offlineIssueType.offline_id,
|
|
@@ -5032,7 +5332,7 @@ class IssueTypeService extends BaseApiService {
|
|
|
5032
5332
|
this.dispatch(updateIssueType(offlineUpdatedIssueType));
|
|
5033
5333
|
const promise = this.enqueueRequest({
|
|
5034
5334
|
method: HttpMethod.PATCH,
|
|
5035
|
-
url: `/
|
|
5335
|
+
url: `/issue-types/${payload.offline_id}/`,
|
|
5036
5336
|
payload,
|
|
5037
5337
|
blockers: [payload.offline_id],
|
|
5038
5338
|
blocks: [payload.offline_id]
|
|
@@ -5056,7 +5356,7 @@ class IssueTypeService extends BaseApiService {
|
|
|
5056
5356
|
this.dispatch(deleteIssues(issuesOfIssueType.map((issue) => issue.offline_id)));
|
|
5057
5357
|
const promise = this.enqueueRequest({
|
|
5058
5358
|
method: HttpMethod.DELETE,
|
|
5059
|
-
url: `/
|
|
5359
|
+
url: `/issue-types/${id}/`,
|
|
5060
5360
|
blockers: [id],
|
|
5061
5361
|
blocks: []
|
|
5062
5362
|
});
|
|
@@ -5069,7 +5369,10 @@ class IssueTypeService extends BaseApiService {
|
|
|
5069
5369
|
async refreshStore(organizationId) {
|
|
5070
5370
|
const result = await this.enqueueRequest({
|
|
5071
5371
|
method: HttpMethod.GET,
|
|
5072
|
-
url:
|
|
5372
|
+
url: "/issue-types/",
|
|
5373
|
+
queryParams: {
|
|
5374
|
+
organization: organizationId.toString()
|
|
5375
|
+
},
|
|
5073
5376
|
blockers: [],
|
|
5074
5377
|
blocks: []
|
|
5075
5378
|
});
|
|
@@ -5213,8 +5516,8 @@ class ProjectFileService extends BaseApiService {
|
|
|
5213
5516
|
class ProjectAttachmentService extends BaseAttachmentService {
|
|
5214
5517
|
constructor() {
|
|
5215
5518
|
super(...arguments);
|
|
5216
|
-
__publicField(this, "
|
|
5217
|
-
__publicField(this, "
|
|
5519
|
+
__publicField(this, "name", "Project Attachment");
|
|
5520
|
+
__publicField(this, "url", "/project-attachments");
|
|
5218
5521
|
__publicField(this, "addAttachments", addProjectAttachments);
|
|
5219
5522
|
__publicField(this, "updateAttachments", updateProjectAttachments);
|
|
5220
5523
|
__publicField(this, "removeAttachments", deleteProjectAttachments);
|
|
@@ -5225,21 +5528,40 @@ class ProjectAttachmentService extends BaseAttachmentService {
|
|
|
5225
5528
|
buildOfflineAttachment(data) {
|
|
5226
5529
|
return offline({
|
|
5227
5530
|
file: URL.createObjectURL(data.file),
|
|
5228
|
-
file_sha1: data.
|
|
5229
|
-
created_by: data.
|
|
5531
|
+
file_sha1: data.file_sha1,
|
|
5532
|
+
created_by: data.created_by,
|
|
5230
5533
|
file_name: data.file.name,
|
|
5231
5534
|
file_type: data.file.type,
|
|
5232
|
-
submitted_at: data.
|
|
5535
|
+
submitted_at: data.submitted_at,
|
|
5233
5536
|
description: data.description,
|
|
5234
5537
|
project: data.modelId
|
|
5235
5538
|
});
|
|
5236
5539
|
}
|
|
5237
|
-
|
|
5238
|
-
return
|
|
5239
|
-
|
|
5240
|
-
|
|
5241
|
-
|
|
5242
|
-
}
|
|
5540
|
+
buildAttachmentPayload(data) {
|
|
5541
|
+
return {
|
|
5542
|
+
...data,
|
|
5543
|
+
project: data.modelId
|
|
5544
|
+
};
|
|
5545
|
+
}
|
|
5546
|
+
async bulkAdd(payloads) {
|
|
5547
|
+
return this._bulkAdd(payloads.map((p) => ({ modelId: p.projectId, file: p.file })));
|
|
5548
|
+
}
|
|
5549
|
+
async delete(attachmentId) {
|
|
5550
|
+
return this._delete(attachmentId);
|
|
5551
|
+
}
|
|
5552
|
+
async refreshStore(projectId) {
|
|
5553
|
+
const result = await this.enqueueRequest({
|
|
5554
|
+
description: "Get project attachments",
|
|
5555
|
+
method: HttpMethod.GET,
|
|
5556
|
+
url: `${this.url}/`,
|
|
5557
|
+
queryParams: {
|
|
5558
|
+
project: projectId.toString()
|
|
5559
|
+
},
|
|
5560
|
+
blockers: [],
|
|
5561
|
+
blocks: []
|
|
5562
|
+
});
|
|
5563
|
+
this.dispatch(initializeProjectAttachments(result));
|
|
5564
|
+
}
|
|
5243
5565
|
}
|
|
5244
5566
|
class ProjectService extends BaseApiService {
|
|
5245
5567
|
async add(payload) {
|
|
@@ -5381,88 +5703,33 @@ const separateImageFromFields = async (fields) => {
|
|
|
5381
5703
|
return { fields: newFields, images };
|
|
5382
5704
|
};
|
|
5383
5705
|
class FormService extends BaseUploadService {
|
|
5384
|
-
|
|
5706
|
+
add(payload, initialRevision) {
|
|
5385
5707
|
var _a2;
|
|
5708
|
+
const { store } = this.client;
|
|
5386
5709
|
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
5387
|
-
const createdBy = (_a2 =
|
|
5388
|
-
const
|
|
5389
|
-
|
|
5390
|
-
|
|
5391
|
-
|
|
5392
|
-
const sha1 = await hashFile(file);
|
|
5393
|
-
if (!(sha1 in filePayloads)) {
|
|
5394
|
-
filePayloads[sha1] = {
|
|
5395
|
-
sha1,
|
|
5396
|
-
file_type: file.type,
|
|
5397
|
-
extension: file.name.split(".").pop(),
|
|
5398
|
-
size: file.size
|
|
5399
|
-
};
|
|
5400
|
-
await this.client.files.addCache(file, sha1);
|
|
5401
|
-
}
|
|
5402
|
-
const offlineFormRevisionAttachment = offline({
|
|
5403
|
-
file: URL.createObjectURL(file),
|
|
5404
|
-
file_type: file.type,
|
|
5405
|
-
file_name: file.name,
|
|
5406
|
-
file_sha1: sha1,
|
|
5407
|
-
created_by: createdBy,
|
|
5408
|
-
revision: revisionId,
|
|
5409
|
-
submitted_at: submittedAt,
|
|
5410
|
-
field_identifier: fieldIdentifier
|
|
5411
|
-
});
|
|
5412
|
-
offlineFormRevisionAttachments.push(offlineFormRevisionAttachment);
|
|
5413
|
-
const attachmentPayload = {
|
|
5414
|
-
offline_id: offlineFormRevisionAttachment.offline_id,
|
|
5415
|
-
name: file.name,
|
|
5416
|
-
field_identifier: fieldIdentifier,
|
|
5417
|
-
sha1
|
|
5418
|
-
};
|
|
5419
|
-
attachmentPayloads.push(attachmentPayload);
|
|
5420
|
-
}
|
|
5421
|
-
this.dispatch(addFormRevisionAttachments(offlineFormRevisionAttachments));
|
|
5422
|
-
const promise = this.enqueueRequest({
|
|
5423
|
-
description: "Attach files to form revision",
|
|
5424
|
-
method: HttpMethod.POST,
|
|
5425
|
-
url: `/forms/revisions/${revisionId}/attachments/bulk/`,
|
|
5426
|
-
payload: {
|
|
5427
|
-
submitted_at: submittedAt,
|
|
5428
|
-
attachments: attachmentPayloads,
|
|
5429
|
-
files: Object.values(filePayloads)
|
|
5430
|
-
},
|
|
5431
|
-
blockers: [revisionId],
|
|
5432
|
-
blocks: offlineFormRevisionAttachments.map((attachment) => attachment.offline_id)
|
|
5433
|
-
});
|
|
5434
|
-
promise.then((result) => {
|
|
5435
|
-
this.processPresignedUrls(result.presigned_urls);
|
|
5436
|
-
this.dispatch(updateFormRevisionAttachments(result.attachments));
|
|
5437
|
-
}).catch(() => {
|
|
5438
|
-
this.dispatch(
|
|
5439
|
-
deleteFormRevisionAttachments(
|
|
5440
|
-
offlineFormRevisionAttachments.map((attachment) => attachment.offline_id)
|
|
5441
|
-
)
|
|
5442
|
-
);
|
|
5710
|
+
const createdBy = (_a2 = store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
5711
|
+
const offlineForm = offline({
|
|
5712
|
+
...payload,
|
|
5713
|
+
submitted_at: submittedAt,
|
|
5714
|
+
created_by: createdBy
|
|
5443
5715
|
});
|
|
5444
|
-
return [offlineFormRevisionAttachments, promise.then(({ attachments }) => attachments)];
|
|
5445
|
-
}
|
|
5446
|
-
async add(ownerId, form, initialRevision, urlPrefix) {
|
|
5447
|
-
const { fields, images } = await separateImageFromFields(initialRevision.fields);
|
|
5448
5716
|
const offlineFormRevision = offline({
|
|
5449
5717
|
...initialRevision,
|
|
5450
|
-
|
|
5451
|
-
|
|
5452
|
-
|
|
5453
|
-
|
|
5454
|
-
revision: "Pending"
|
|
5718
|
+
form: offlineForm.offline_id,
|
|
5719
|
+
revision: "Pending",
|
|
5720
|
+
submitted_at: submittedAt,
|
|
5721
|
+
created_by: createdBy
|
|
5455
5722
|
});
|
|
5456
|
-
this.dispatch(addForm(
|
|
5723
|
+
this.dispatch(addForm(offlineForm));
|
|
5457
5724
|
this.dispatch(addFormRevision(offlineFormRevision));
|
|
5458
5725
|
const formPromise = this.enqueueRequest({
|
|
5459
5726
|
description: "Create form",
|
|
5460
5727
|
method: HttpMethod.POST,
|
|
5461
|
-
url:
|
|
5728
|
+
url: "/forms/",
|
|
5462
5729
|
payload: {
|
|
5463
5730
|
// Sending exactly what is currently needed for the endpoint
|
|
5464
|
-
offline_id:
|
|
5465
|
-
submitted_at:
|
|
5731
|
+
offline_id: offlineForm.offline_id,
|
|
5732
|
+
submitted_at: offlineForm.submitted_at,
|
|
5466
5733
|
initial_revision: {
|
|
5467
5734
|
offline_id: offlineFormRevision.offline_id,
|
|
5468
5735
|
submitted_at: offlineFormRevision.submitted_at,
|
|
@@ -5471,111 +5738,18 @@ class FormService extends BaseUploadService {
|
|
|
5471
5738
|
fields: offlineFormRevision.fields
|
|
5472
5739
|
}
|
|
5473
5740
|
},
|
|
5474
|
-
blockers: [
|
|
5475
|
-
|
|
5741
|
+
blockers: [
|
|
5742
|
+
...payload.project ? [payload.project.toString()] : [],
|
|
5743
|
+
...payload.organization ? [payload.organization.toString()] : []
|
|
5744
|
+
],
|
|
5745
|
+
blocks: [offlineForm.offline_id, offlineFormRevision.offline_id]
|
|
5476
5746
|
});
|
|
5477
|
-
const [offlineFormRevisionAttachments, attachmentsPromise] = await this.bulkAddRevisionAttachments(
|
|
5478
|
-
offlineFormRevision.offline_id,
|
|
5479
|
-
images
|
|
5480
|
-
);
|
|
5481
5747
|
void formPromise.catch((e) => {
|
|
5482
|
-
this.dispatch(deleteForm(
|
|
5748
|
+
this.dispatch(deleteForm(offlineForm.offline_id));
|
|
5483
5749
|
this.dispatch(deleteFormRevision(offlineFormRevision.offline_id));
|
|
5484
5750
|
throw e;
|
|
5485
5751
|
});
|
|
5486
|
-
return [
|
|
5487
|
-
}
|
|
5488
|
-
addForOrganization(organizationId, initialRevision) {
|
|
5489
|
-
var _a2;
|
|
5490
|
-
const state = this.client.store.getState();
|
|
5491
|
-
const offlineForm = offline({
|
|
5492
|
-
favorite: false,
|
|
5493
|
-
created_by: (_a2 = state.userReducer.currentUser) == null ? void 0 : _a2.id,
|
|
5494
|
-
submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
5495
|
-
organization: organizationId
|
|
5496
|
-
});
|
|
5497
|
-
return this.add(
|
|
5498
|
-
organizationId.toString(),
|
|
5499
|
-
offlineForm,
|
|
5500
|
-
initialRevision,
|
|
5501
|
-
`/organizations/${organizationId}/create-form/`
|
|
5502
|
-
);
|
|
5503
|
-
}
|
|
5504
|
-
addForProject(projectId, initialRevision) {
|
|
5505
|
-
var _a2;
|
|
5506
|
-
const state = this.client.store.getState();
|
|
5507
|
-
const offlineForm = offline({
|
|
5508
|
-
favorite: false,
|
|
5509
|
-
created_by: (_a2 = state.userReducer.currentUser) == null ? void 0 : _a2.id,
|
|
5510
|
-
submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
5511
|
-
project: projectId
|
|
5512
|
-
});
|
|
5513
|
-
return this.add(projectId.toString(), offlineForm, initialRevision, `/projects/${projectId}/create-form/`);
|
|
5514
|
-
}
|
|
5515
|
-
addForIssueType(issueTypeId, initialRevision) {
|
|
5516
|
-
var _a2;
|
|
5517
|
-
const state = this.client.store.getState();
|
|
5518
|
-
const offlineForm = offline({
|
|
5519
|
-
favorite: false,
|
|
5520
|
-
created_by: (_a2 = state.userReducer.currentUser) == null ? void 0 : _a2.id,
|
|
5521
|
-
submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
5522
|
-
issue_type: issueTypeId
|
|
5523
|
-
});
|
|
5524
|
-
return this.add(issueTypeId, offlineForm, initialRevision, `/issues/types/${issueTypeId}/create-form/`);
|
|
5525
|
-
}
|
|
5526
|
-
addForAssetType(assetTypeId, initialRevision) {
|
|
5527
|
-
var _a2;
|
|
5528
|
-
const state = this.client.store.getState();
|
|
5529
|
-
const offlineForm = offline({
|
|
5530
|
-
favorite: false,
|
|
5531
|
-
created_by: (_a2 = state.userReducer.currentUser) == null ? void 0 : _a2.id,
|
|
5532
|
-
submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
5533
|
-
asset_type: assetTypeId
|
|
5534
|
-
});
|
|
5535
|
-
return this.add(assetTypeId, offlineForm, initialRevision, `/assets/types/${assetTypeId}/create-form/`);
|
|
5536
|
-
}
|
|
5537
|
-
async createRevision(formId, revision) {
|
|
5538
|
-
var _a2;
|
|
5539
|
-
const offlineRevision = offline(revision);
|
|
5540
|
-
const { store } = this.client;
|
|
5541
|
-
const state = store.getState();
|
|
5542
|
-
const createdBy = (_a2 = state.userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
5543
|
-
const { fields, images } = await separateImageFromFields(offlineRevision.fields);
|
|
5544
|
-
const fullRevision = {
|
|
5545
|
-
...offlineRevision,
|
|
5546
|
-
fields,
|
|
5547
|
-
created_by: createdBy,
|
|
5548
|
-
revision: "Pending",
|
|
5549
|
-
form: formId,
|
|
5550
|
-
submitted_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
5551
|
-
};
|
|
5552
|
-
this.dispatch(addFormRevision(fullRevision));
|
|
5553
|
-
const promise = this.enqueueRequest({
|
|
5554
|
-
description: "Create form revision",
|
|
5555
|
-
method: HttpMethod.PATCH,
|
|
5556
|
-
url: `/forms/${formId}/`,
|
|
5557
|
-
payload: {
|
|
5558
|
-
initial_revision: {
|
|
5559
|
-
offline_id: fullRevision.offline_id,
|
|
5560
|
-
submitted_at: fullRevision.submitted_at,
|
|
5561
|
-
title: fullRevision.title,
|
|
5562
|
-
description: fullRevision.description,
|
|
5563
|
-
fields: fullRevision.fields
|
|
5564
|
-
}
|
|
5565
|
-
},
|
|
5566
|
-
blockers: [formId],
|
|
5567
|
-
blocks: [offlineRevision.offline_id]
|
|
5568
|
-
});
|
|
5569
|
-
const [offlineFormRevisionAttachments, attachmentsPromise] = await this.bulkAddRevisionAttachments(
|
|
5570
|
-
fullRevision.offline_id,
|
|
5571
|
-
images
|
|
5572
|
-
);
|
|
5573
|
-
void promise.then((result) => {
|
|
5574
|
-
this.dispatch(setFormRevision(result));
|
|
5575
|
-
}).catch(() => {
|
|
5576
|
-
this.dispatch(deleteFormRevision(fullRevision.offline_id));
|
|
5577
|
-
});
|
|
5578
|
-
return [fullRevision, offlineFormRevisionAttachments, promise, attachmentsPromise];
|
|
5752
|
+
return [offlineForm, offlineFormRevision, formPromise];
|
|
5579
5753
|
}
|
|
5580
5754
|
async delete(id) {
|
|
5581
5755
|
const { store } = this.client;
|
|
@@ -5612,65 +5786,31 @@ class FormService extends BaseUploadService {
|
|
|
5612
5786
|
throw e;
|
|
5613
5787
|
}
|
|
5614
5788
|
}
|
|
5615
|
-
async refreshStore(projectId) {
|
|
5616
|
-
|
|
5617
|
-
const
|
|
5618
|
-
const attachments = [];
|
|
5619
|
-
const projectFormsResult = await this.enqueueRequest({
|
|
5789
|
+
async refreshStore(projectId, organizationId) {
|
|
5790
|
+
let forms = [];
|
|
5791
|
+
const projectForms = await this.enqueueRequest({
|
|
5620
5792
|
description: "Fetch project forms",
|
|
5621
5793
|
method: HttpMethod.GET,
|
|
5622
|
-
url:
|
|
5794
|
+
url: "/forms/",
|
|
5795
|
+
queryParams: {
|
|
5796
|
+
project: projectId.toString()
|
|
5797
|
+
},
|
|
5623
5798
|
blockers: [projectId.toString()],
|
|
5624
5799
|
blocks: []
|
|
5625
5800
|
});
|
|
5626
|
-
|
|
5627
|
-
|
|
5628
|
-
for (const revision of projectFormsResult.revisions)
|
|
5629
|
-
revisions.push(revision);
|
|
5630
|
-
for (const attachment of projectFormsResult.attachments)
|
|
5631
|
-
attachments.push(attachment);
|
|
5632
|
-
const organizationFormsResult = await this.enqueueRequest({
|
|
5801
|
+
forms = forms.concat(projectForms);
|
|
5802
|
+
const organizationForms = await this.enqueueRequest({
|
|
5633
5803
|
description: "Fetch organization forms",
|
|
5634
5804
|
method: HttpMethod.GET,
|
|
5635
|
-
url:
|
|
5636
|
-
|
|
5637
|
-
|
|
5638
|
-
|
|
5639
|
-
|
|
5640
|
-
forms.push(form);
|
|
5641
|
-
for (const revision of organizationFormsResult.revisions)
|
|
5642
|
-
revisions.push(revision);
|
|
5643
|
-
for (const attachment of organizationFormsResult.attachments)
|
|
5644
|
-
attachments.push(attachment);
|
|
5645
|
-
const assetTypeFormsResult = await this.enqueueRequest({
|
|
5646
|
-
description: "Fetch asset type forms",
|
|
5647
|
-
method: HttpMethod.GET,
|
|
5648
|
-
url: `/projects/${projectId}/asset-types/forms/`,
|
|
5649
|
-
blockers: [projectId.toString()],
|
|
5650
|
-
blocks: []
|
|
5651
|
-
});
|
|
5652
|
-
for (const form of assetTypeFormsResult.forms)
|
|
5653
|
-
forms.push(form);
|
|
5654
|
-
for (const revision of assetTypeFormsResult.revisions)
|
|
5655
|
-
revisions.push(revision);
|
|
5656
|
-
for (const attachment of assetTypeFormsResult.attachments)
|
|
5657
|
-
attachments.push(attachment);
|
|
5658
|
-
const issueTypeFormsResult = await this.enqueueRequest({
|
|
5659
|
-
description: "Fetch issue type forms",
|
|
5660
|
-
method: HttpMethod.GET,
|
|
5661
|
-
url: `/projects/${projectId}/issue-types/forms/`,
|
|
5662
|
-
blockers: [projectId.toString()],
|
|
5805
|
+
url: "/forms/",
|
|
5806
|
+
queryParams: {
|
|
5807
|
+
organization: organizationId.toString()
|
|
5808
|
+
},
|
|
5809
|
+
blockers: [organizationId.toString()],
|
|
5663
5810
|
blocks: []
|
|
5664
5811
|
});
|
|
5665
|
-
|
|
5666
|
-
forms.push(form);
|
|
5667
|
-
for (const revision of issueTypeFormsResult.revisions)
|
|
5668
|
-
revisions.push(revision);
|
|
5669
|
-
for (const attachment of issueTypeFormsResult.attachments)
|
|
5670
|
-
attachments.push(attachment);
|
|
5812
|
+
forms = forms.concat(organizationForms);
|
|
5671
5813
|
this.dispatch(initializeForms(forms));
|
|
5672
|
-
this.dispatch(initializeFormRevisions(revisions));
|
|
5673
|
-
this.dispatch(initializeFormRevisionAttachments(attachments));
|
|
5674
5814
|
}
|
|
5675
5815
|
}
|
|
5676
5816
|
const isArrayOfFiles = (value) => {
|
|
@@ -5692,95 +5832,11 @@ const separateFilesFromValues = (values) => {
|
|
|
5692
5832
|
return { values: newValues, files };
|
|
5693
5833
|
};
|
|
5694
5834
|
class FormSubmissionService extends BaseUploadService {
|
|
5695
|
-
|
|
5696
|
-
var _a2;
|
|
5697
|
-
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
5698
|
-
const createdBy = (_a2 = this.client.store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
5699
|
-
const filePayloads = {};
|
|
5700
|
-
const offlineFormSubmissionAttachments = [];
|
|
5701
|
-
const attachmentPayloads = [];
|
|
5702
|
-
for (const [fieldIdentifier, filesArray] of Object.entries(files)) {
|
|
5703
|
-
for (const file of filesArray) {
|
|
5704
|
-
const sha1 = await hashFile(file);
|
|
5705
|
-
if (!(sha1 in filePayloads)) {
|
|
5706
|
-
filePayloads[sha1] = {
|
|
5707
|
-
sha1,
|
|
5708
|
-
file_type: file.type,
|
|
5709
|
-
extension: file.name.split(".").pop(),
|
|
5710
|
-
size: file.size
|
|
5711
|
-
};
|
|
5712
|
-
await this.client.files.addCache(file, sha1);
|
|
5713
|
-
}
|
|
5714
|
-
const offlineFormSubmissionAttachment = offline({
|
|
5715
|
-
file: URL.createObjectURL(file),
|
|
5716
|
-
file_type: file.type,
|
|
5717
|
-
file_name: file.name,
|
|
5718
|
-
file_sha1: sha1,
|
|
5719
|
-
created_by: createdBy,
|
|
5720
|
-
submission: submissionId,
|
|
5721
|
-
submitted_at: submittedAt,
|
|
5722
|
-
field_identifier: fieldIdentifier
|
|
5723
|
-
});
|
|
5724
|
-
offlineFormSubmissionAttachments.push(offlineFormSubmissionAttachment);
|
|
5725
|
-
const attachmentPayload = {
|
|
5726
|
-
offline_id: offlineFormSubmissionAttachment.offline_id,
|
|
5727
|
-
name: file.name,
|
|
5728
|
-
sha1,
|
|
5729
|
-
field_identifier: fieldIdentifier
|
|
5730
|
-
};
|
|
5731
|
-
attachmentPayloads.push(attachmentPayload);
|
|
5732
|
-
}
|
|
5733
|
-
}
|
|
5734
|
-
this.dispatch(addFormSubmissionAttachments(offlineFormSubmissionAttachments));
|
|
5735
|
-
const promise = this.enqueueRequest({
|
|
5736
|
-
description: "Attach files to form submission",
|
|
5737
|
-
method: HttpMethod.POST,
|
|
5738
|
-
url: `/forms/submissions/${submissionId}/attachments/bulk/`,
|
|
5739
|
-
payload: {
|
|
5740
|
-
submitted_at: submittedAt,
|
|
5741
|
-
attachments: attachmentPayloads,
|
|
5742
|
-
files: Object.values(filePayloads)
|
|
5743
|
-
},
|
|
5744
|
-
blockers: [submissionId],
|
|
5745
|
-
blocks: offlineFormSubmissionAttachments.map((attachment) => attachment.offline_id)
|
|
5746
|
-
});
|
|
5747
|
-
promise.then((result) => {
|
|
5748
|
-
this.processPresignedUrls(result.presigned_urls);
|
|
5749
|
-
this.dispatch(updateFormSubmissionAttachments(result.attachments));
|
|
5750
|
-
}).catch(() => {
|
|
5751
|
-
this.dispatch(
|
|
5752
|
-
deleteFormSubmissionAttachments(
|
|
5753
|
-
offlineFormSubmissionAttachments.map((attachment) => attachment.offline_id)
|
|
5754
|
-
)
|
|
5755
|
-
);
|
|
5756
|
-
});
|
|
5757
|
-
return [offlineFormSubmissionAttachments, promise.then(({ attachments }) => attachments)];
|
|
5758
|
-
}
|
|
5759
|
-
async bulkDeleteSubmissionAttachments(submissionId, attachmentsIds) {
|
|
5760
|
-
const { store } = this.client;
|
|
5761
|
-
const state = store.getState();
|
|
5762
|
-
const formSubmissionAttachments = selectFormSubmissionAttachemntsByIds(attachmentsIds)(state);
|
|
5763
|
-
this.dispatch(deleteFormSubmissionAttachments(attachmentsIds));
|
|
5764
|
-
try {
|
|
5765
|
-
await this.enqueueRequest({
|
|
5766
|
-
description: "Delete form submission attachments",
|
|
5767
|
-
method: HttpMethod.DELETE,
|
|
5768
|
-
url: `/forms/submissions/${submissionId}/attachments/bulk/`,
|
|
5769
|
-
payload: { attachments: attachmentsIds },
|
|
5770
|
-
blockers: [submissionId, ...attachmentsIds],
|
|
5771
|
-
blocks: []
|
|
5772
|
-
});
|
|
5773
|
-
} catch (e) {
|
|
5774
|
-
this.dispatch(addFormSubmissionAttachments(formSubmissionAttachments));
|
|
5775
|
-
throw e;
|
|
5776
|
-
}
|
|
5777
|
-
}
|
|
5778
|
-
// Outer promise is for hashing and caching files for submission attachments
|
|
5779
|
-
async add(payload) {
|
|
5835
|
+
add(payload) {
|
|
5780
5836
|
var _a2;
|
|
5781
5837
|
const { store } = this.client;
|
|
5782
5838
|
const state = store.getState();
|
|
5783
|
-
const { values
|
|
5839
|
+
const { values } = separateFilesFromValues(payload.values);
|
|
5784
5840
|
const offlineSubmission = offline({
|
|
5785
5841
|
...payload,
|
|
5786
5842
|
values,
|
|
@@ -5790,7 +5846,7 @@ class FormSubmissionService extends BaseUploadService {
|
|
|
5790
5846
|
const promise = this.enqueueRequest({
|
|
5791
5847
|
description: "Respond to form",
|
|
5792
5848
|
method: HttpMethod.POST,
|
|
5793
|
-
url:
|
|
5849
|
+
url: "/form-submissions/",
|
|
5794
5850
|
payload: offlineSubmission,
|
|
5795
5851
|
blockers: [payload.issue, payload.asset, payload.asset_stage, "add-form-entry"].filter(
|
|
5796
5852
|
(x) => x !== void 0
|
|
@@ -5798,10 +5854,6 @@ class FormSubmissionService extends BaseUploadService {
|
|
|
5798
5854
|
blocks: [offlineSubmission.offline_id]
|
|
5799
5855
|
});
|
|
5800
5856
|
this.dispatch(addFormSubmission(offlineSubmission));
|
|
5801
|
-
const [offlineFormSubmissionAttachments, attachmentsPromise] = await this.bulkAddSubmissionAttachments(
|
|
5802
|
-
offlineSubmission.offline_id,
|
|
5803
|
-
files
|
|
5804
|
-
);
|
|
5805
5857
|
promise.then((result) => {
|
|
5806
5858
|
this.dispatch(addActiveProjectFormSubmissionsCount(1));
|
|
5807
5859
|
this.dispatch(setFormSubmission(result));
|
|
@@ -5810,115 +5862,16 @@ class FormSubmissionService extends BaseUploadService {
|
|
|
5810
5862
|
this.dispatch(deleteFormSubmission(offlineSubmission.offline_id));
|
|
5811
5863
|
this.dispatch(addActiveProjectFormSubmissionsCount(-1));
|
|
5812
5864
|
});
|
|
5813
|
-
return [offlineSubmission,
|
|
5814
|
-
}
|
|
5815
|
-
// Note currently the bulkAdd method is specific to form submissions for assets
|
|
5816
|
-
// TODO: adapt the support bulk adding to any model type
|
|
5817
|
-
async bulkAdd(args, batchSize) {
|
|
5818
|
-
const { formRevision, commonFieldValues, fieldValuesByAsset } = args;
|
|
5819
|
-
const { values: fileSeperatedCommonFieldValues, files: commonFiles } = separateFilesFromValues(commonFieldValues);
|
|
5820
|
-
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
5821
|
-
const transactionId = v4();
|
|
5822
|
-
const assetIdBatches = chunkArray(Object.keys(fieldValuesByAsset), batchSize);
|
|
5823
|
-
const bulkAddBatches = await Promise.all(
|
|
5824
|
-
assetIdBatches.map(async (assetIdBatch) => {
|
|
5825
|
-
const batchId = v4();
|
|
5826
|
-
const submissionPayloads = [];
|
|
5827
|
-
const attachmentPayloads = [];
|
|
5828
|
-
const files = { ...commonFiles };
|
|
5829
|
-
for (const assetId of assetIdBatch) {
|
|
5830
|
-
const { values: fileSeperatedSubmissionSpecificValues, files: submissionSpecificFiles } = separateFilesFromValues(fieldValuesByAsset[assetId] ?? {});
|
|
5831
|
-
Object.assign(files, submissionSpecificFiles);
|
|
5832
|
-
const submissionPayload = offline({
|
|
5833
|
-
asset_id: assetId,
|
|
5834
|
-
form_data: fileSeperatedSubmissionSpecificValues
|
|
5835
|
-
});
|
|
5836
|
-
submissionPayloads.push(submissionPayload);
|
|
5837
|
-
for (const [fieldIdentifier, fileArray] of Object.entries(files)) {
|
|
5838
|
-
for (const file of fileArray) {
|
|
5839
|
-
const sha1 = await hashFile(file);
|
|
5840
|
-
await this.client.files.addCache(file, sha1);
|
|
5841
|
-
const attachmentPayload = offline({
|
|
5842
|
-
submission_id: submissionPayload.offline_id,
|
|
5843
|
-
sha1,
|
|
5844
|
-
name: file.name,
|
|
5845
|
-
field_identifier: fieldIdentifier
|
|
5846
|
-
});
|
|
5847
|
-
attachmentPayloads.push(attachmentPayload);
|
|
5848
|
-
}
|
|
5849
|
-
}
|
|
5850
|
-
}
|
|
5851
|
-
const filePaylods = [];
|
|
5852
|
-
for (const file of Object.values(files).flat()) {
|
|
5853
|
-
const sha1 = await hashFile(file);
|
|
5854
|
-
const filePayload = {
|
|
5855
|
-
sha1,
|
|
5856
|
-
extension: file.name.split(".").pop() || "",
|
|
5857
|
-
file_type: file.type,
|
|
5858
|
-
size: file.size
|
|
5859
|
-
};
|
|
5860
|
-
filePaylods.push(filePayload);
|
|
5861
|
-
}
|
|
5862
|
-
return {
|
|
5863
|
-
batchId,
|
|
5864
|
-
payload: {
|
|
5865
|
-
transaction_id: transactionId,
|
|
5866
|
-
form_data: fileSeperatedCommonFieldValues,
|
|
5867
|
-
submitted_at: submittedAt,
|
|
5868
|
-
submissions: submissionPayloads,
|
|
5869
|
-
attachments: attachmentPayloads,
|
|
5870
|
-
files: filePaylods
|
|
5871
|
-
}
|
|
5872
|
-
};
|
|
5873
|
-
})
|
|
5874
|
-
);
|
|
5875
|
-
const batchPromises = [];
|
|
5876
|
-
let prevBatchId = null;
|
|
5877
|
-
for (const batch of bulkAddBatches) {
|
|
5878
|
-
const { payload, batchId } = batch;
|
|
5879
|
-
const batchAssetIds = payload.submissions.map((x) => x.asset_id);
|
|
5880
|
-
const batchSubmissionOfflineIds = payload.submissions.map((x) => x.offline_id);
|
|
5881
|
-
const batchAttachmentsOfflineIds = payload.attachments.map((x) => x.offline_id);
|
|
5882
|
-
const blockers = batchAssetIds;
|
|
5883
|
-
if (prevBatchId)
|
|
5884
|
-
blockers.push(prevBatchId);
|
|
5885
|
-
const blocks = [...batchSubmissionOfflineIds, ...batchAttachmentsOfflineIds, batchId];
|
|
5886
|
-
const promise = this.enqueueRequest({
|
|
5887
|
-
description: "Bulk add form submissions",
|
|
5888
|
-
method: HttpMethod.POST,
|
|
5889
|
-
url: `/forms/revisions/${formRevision}/bulk-respond/`,
|
|
5890
|
-
payload,
|
|
5891
|
-
blockers,
|
|
5892
|
-
blocks
|
|
5893
|
-
});
|
|
5894
|
-
void promise.then(({ presigned_urls }) => {
|
|
5895
|
-
this.processPresignedUrls(presigned_urls);
|
|
5896
|
-
});
|
|
5897
|
-
prevBatchId = batchId;
|
|
5898
|
-
batchPromises.push(promise);
|
|
5899
|
-
}
|
|
5900
|
-
void Promise.all(batchPromises).then((results) => {
|
|
5901
|
-
const createdSubmissions = [];
|
|
5902
|
-
const createdAttachments = [];
|
|
5903
|
-
for (const result of results) {
|
|
5904
|
-
for (const createdSubmission of result.submissions)
|
|
5905
|
-
createdSubmissions.push(createdSubmission);
|
|
5906
|
-
for (const createdAttachment of result.attachments)
|
|
5907
|
-
createdAttachments.push(createdAttachment);
|
|
5908
|
-
}
|
|
5909
|
-
this.dispatch(addFormSubmissions(createdSubmissions));
|
|
5910
|
-
this.dispatch(addFormSubmissionAttachments(createdAttachments));
|
|
5911
|
-
});
|
|
5912
|
-
return batchPromises;
|
|
5865
|
+
return [offlineSubmission, promise];
|
|
5913
5866
|
}
|
|
5914
|
-
|
|
5867
|
+
update(payload) {
|
|
5915
5868
|
const { store } = this.client;
|
|
5916
5869
|
const state = store.getState();
|
|
5917
5870
|
const submissionToBeUpdated = selectFormSubmissionById(payload.offline_id)(state);
|
|
5918
5871
|
if (!submissionToBeUpdated) {
|
|
5919
5872
|
throw new Error(`Expected submission with offline_id ${payload.offline_id} to exist`);
|
|
5920
5873
|
}
|
|
5921
|
-
const { values
|
|
5874
|
+
const { values } = separateFilesFromValues(payload.values ?? {});
|
|
5922
5875
|
const updatedSubmission = {
|
|
5923
5876
|
...submissionToBeUpdated,
|
|
5924
5877
|
...payload,
|
|
@@ -5932,39 +5885,18 @@ class FormSubmissionService extends BaseUploadService {
|
|
|
5932
5885
|
const promise = this.enqueueRequest({
|
|
5933
5886
|
description: "Delete user form submissions",
|
|
5934
5887
|
method: HttpMethod.PATCH,
|
|
5935
|
-
url: `/
|
|
5888
|
+
url: `/form-submissions/${updatedSubmission.offline_id}/`,
|
|
5936
5889
|
// TODO: send just payload when FormSubmissionDeserializer is updated to handle partial updates
|
|
5937
5890
|
payload: updatedSubmission,
|
|
5938
5891
|
blockers: [updatedSubmission.offline_id],
|
|
5939
5892
|
blocks: [updatedSubmission.offline_id]
|
|
5940
5893
|
});
|
|
5941
|
-
const formSubmissionAttachments = selectAttachmentsOfFormSubmission(payload.offline_id)(state);
|
|
5942
|
-
const formSubmissionAttachmentIdsToBeDeleted = [];
|
|
5943
|
-
for (const attachment of formSubmissionAttachments) {
|
|
5944
|
-
if (attachment.field_identifier in files) {
|
|
5945
|
-
formSubmissionAttachmentIdsToBeDeleted.push(attachment.offline_id);
|
|
5946
|
-
}
|
|
5947
|
-
}
|
|
5948
|
-
const [offlineFormSubmissionAttachments, attachmentsPromise] = await this.bulkAddSubmissionAttachments(
|
|
5949
|
-
payload.offline_id,
|
|
5950
|
-
files
|
|
5951
|
-
);
|
|
5952
|
-
const deleteAttachmentsPromise = this.bulkDeleteSubmissionAttachments(
|
|
5953
|
-
payload.offline_id,
|
|
5954
|
-
formSubmissionAttachmentIdsToBeDeleted
|
|
5955
|
-
);
|
|
5956
5894
|
promise.then((result) => {
|
|
5957
5895
|
this.dispatch(setFormSubmission(result));
|
|
5958
5896
|
}).catch(() => {
|
|
5959
5897
|
this.dispatch(setFormSubmission(submissionToBeUpdated));
|
|
5960
5898
|
});
|
|
5961
|
-
return [
|
|
5962
|
-
updatedSubmission,
|
|
5963
|
-
offlineFormSubmissionAttachments,
|
|
5964
|
-
promise,
|
|
5965
|
-
attachmentsPromise,
|
|
5966
|
-
deleteAttachmentsPromise
|
|
5967
|
-
];
|
|
5899
|
+
return [updatedSubmission, promise];
|
|
5968
5900
|
}
|
|
5969
5901
|
async delete(id) {
|
|
5970
5902
|
const { store } = this.client;
|
|
@@ -5981,7 +5913,7 @@ class FormSubmissionService extends BaseUploadService {
|
|
|
5981
5913
|
return await this.enqueueRequest({
|
|
5982
5914
|
description: "Delete user form submissions",
|
|
5983
5915
|
method: HttpMethod.DELETE,
|
|
5984
|
-
url: `/
|
|
5916
|
+
url: `/form-submissions/${id}/`,
|
|
5985
5917
|
blockers: [id],
|
|
5986
5918
|
blocks: []
|
|
5987
5919
|
});
|
|
@@ -5993,50 +5925,17 @@ class FormSubmissionService extends BaseUploadService {
|
|
|
5993
5925
|
}
|
|
5994
5926
|
}
|
|
5995
5927
|
async refreshStore(projectId) {
|
|
5996
|
-
const
|
|
5997
|
-
|
|
5998
|
-
description: "Fetch model submissions",
|
|
5999
|
-
method: HttpMethod.GET,
|
|
6000
|
-
url: `/forms/in-project/${projectId}/submissions/model/latest/`,
|
|
6001
|
-
blockers: [],
|
|
6002
|
-
blocks: []
|
|
6003
|
-
});
|
|
6004
|
-
for (const modelSubmission of modelSubmissions) {
|
|
6005
|
-
formSubmissions[modelSubmission.offline_id] = modelSubmission;
|
|
6006
|
-
}
|
|
6007
|
-
const standaloneSubmissions = await this.enqueueRequest({
|
|
6008
|
-
description: "Fetch standalone submissions",
|
|
6009
|
-
method: HttpMethod.GET,
|
|
6010
|
-
url: `/forms/in-project/${projectId}/submissions/standalone/`,
|
|
6011
|
-
blockers: [],
|
|
6012
|
-
blocks: []
|
|
6013
|
-
});
|
|
6014
|
-
for (const standaloneSubmission of standaloneSubmissions) {
|
|
6015
|
-
formSubmissions[standaloneSubmission.offline_id] = standaloneSubmission;
|
|
6016
|
-
}
|
|
6017
|
-
this.dispatch(initializeFormSubmissions(Object.values(formSubmissions)));
|
|
6018
|
-
const attachments = {};
|
|
6019
|
-
const modelAttachments = await this.enqueueRequest({
|
|
6020
|
-
description: "Fetch model submission attachments",
|
|
6021
|
-
method: HttpMethod.GET,
|
|
6022
|
-
url: `/forms/in-project/${projectId}/attachments/model/latest/`,
|
|
6023
|
-
blockers: [],
|
|
6024
|
-
blocks: []
|
|
6025
|
-
});
|
|
6026
|
-
for (const modelAttachment of modelAttachments) {
|
|
6027
|
-
attachments[modelAttachment.offline_id] = modelAttachment;
|
|
6028
|
-
}
|
|
6029
|
-
const standaloneAttachments = await this.enqueueRequest({
|
|
6030
|
-
description: "Fetch standalone submission attachments",
|
|
5928
|
+
const result = await this.enqueueRequest({
|
|
5929
|
+
description: "Fetch form submissions",
|
|
6031
5930
|
method: HttpMethod.GET,
|
|
6032
|
-
url:
|
|
5931
|
+
url: "/form-submissions/",
|
|
5932
|
+
queryParams: {
|
|
5933
|
+
project: projectId.toString()
|
|
5934
|
+
},
|
|
6033
5935
|
blockers: [],
|
|
6034
5936
|
blocks: []
|
|
6035
5937
|
});
|
|
6036
|
-
|
|
6037
|
-
attachments[standaloneAttachent.offline_id] = standaloneAttachent;
|
|
6038
|
-
}
|
|
6039
|
-
this.dispatch(initializeFormSubmissionAttachments(Object.values(attachments)));
|
|
5938
|
+
this.dispatch(initializeFormSubmissions(result));
|
|
6040
5939
|
}
|
|
6041
5940
|
}
|
|
6042
5941
|
class WorkspaceService extends BaseApiService {
|
|
@@ -6738,8 +6637,8 @@ class DocumentService extends BaseApiService {
|
|
|
6738
6637
|
class DocumentAttachmentService extends BaseAttachmentService {
|
|
6739
6638
|
constructor() {
|
|
6740
6639
|
super(...arguments);
|
|
6741
|
-
__publicField(this, "
|
|
6742
|
-
__publicField(this, "
|
|
6640
|
+
__publicField(this, "name", "Document Attachment");
|
|
6641
|
+
__publicField(this, "url", "/document-attachments");
|
|
6743
6642
|
__publicField(this, "addAttachments", addDocumentAttachments);
|
|
6744
6643
|
__publicField(this, "updateAttachments", updateDocumentAttachments);
|
|
6745
6644
|
__publicField(this, "removeAttachments", deleteDocumentAttachments);
|
|
@@ -6750,17 +6649,23 @@ class DocumentAttachmentService extends BaseAttachmentService {
|
|
|
6750
6649
|
buildOfflineAttachment(data) {
|
|
6751
6650
|
return offline({
|
|
6752
6651
|
file: URL.createObjectURL(data.file),
|
|
6753
|
-
file_sha1: data.
|
|
6754
|
-
created_by: data.
|
|
6652
|
+
file_sha1: data.file_sha1,
|
|
6653
|
+
created_by: data.created_by,
|
|
6755
6654
|
file_name: data.file.name,
|
|
6756
6655
|
file_type: data.file.type,
|
|
6757
|
-
submitted_at: data.
|
|
6656
|
+
submitted_at: data.submitted_at,
|
|
6758
6657
|
description: data.description,
|
|
6759
6658
|
document: data.modelId
|
|
6760
6659
|
});
|
|
6761
6660
|
}
|
|
6661
|
+
buildAttachmentPayload(data) {
|
|
6662
|
+
return {
|
|
6663
|
+
...data,
|
|
6664
|
+
document: data.modelId
|
|
6665
|
+
};
|
|
6666
|
+
}
|
|
6762
6667
|
// NOTE: overriding the method from BaseAttachmentService since document attachments get vectorized
|
|
6763
|
-
async
|
|
6668
|
+
async bulkAdd(payloads) {
|
|
6764
6669
|
var _a2;
|
|
6765
6670
|
const { store } = this.client;
|
|
6766
6671
|
const createdBy = (_a2 = store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
@@ -6769,40 +6674,36 @@ class DocumentAttachmentService extends BaseAttachmentService {
|
|
|
6769
6674
|
const attachmentPayloads = [];
|
|
6770
6675
|
const filePayloads = {};
|
|
6771
6676
|
const sha1ToAttachmentIds = {};
|
|
6772
|
-
for (const
|
|
6773
|
-
const
|
|
6774
|
-
|
|
6775
|
-
|
|
6776
|
-
|
|
6777
|
-
|
|
6778
|
-
extension: file.name.split(".").pop(),
|
|
6779
|
-
size: file.size
|
|
6780
|
-
};
|
|
6781
|
-
sha1ToAttachmentIds[sha1] = [];
|
|
6782
|
-
await this.client.files.addCache(file, sha1);
|
|
6677
|
+
for (const payload of payloads) {
|
|
6678
|
+
const { documentId, file } = payload;
|
|
6679
|
+
const filePayload = await this.getFilePayload(file);
|
|
6680
|
+
if (!(filePayload.sha1 in filePayloads)) {
|
|
6681
|
+
filePayloads[filePayload.sha1] = filePayload;
|
|
6682
|
+
sha1ToAttachmentIds[filePayload.sha1] = [];
|
|
6783
6683
|
}
|
|
6784
6684
|
const offlineAttachment = this.buildOfflineAttachment({
|
|
6785
6685
|
file,
|
|
6786
|
-
sha1,
|
|
6787
|
-
submittedAt,
|
|
6788
|
-
createdBy,
|
|
6686
|
+
file_sha1: filePayload.sha1,
|
|
6687
|
+
submitted_at: submittedAt,
|
|
6688
|
+
created_by: createdBy,
|
|
6789
6689
|
description: "",
|
|
6790
6690
|
modelId: documentId
|
|
6791
6691
|
});
|
|
6792
6692
|
offlineAttachments.push(offlineAttachment);
|
|
6793
6693
|
attachmentPayloads.push({
|
|
6794
6694
|
offline_id: offlineAttachment.offline_id,
|
|
6795
|
-
|
|
6796
|
-
|
|
6695
|
+
file_name: offlineAttachment.file_name,
|
|
6696
|
+
file_sha1: offlineAttachment.file_sha1,
|
|
6697
|
+
file_extension: filePayload.extension,
|
|
6797
6698
|
description: offlineAttachment.description
|
|
6798
6699
|
});
|
|
6799
|
-
sha1ToAttachmentIds[sha1].push(offlineAttachment.offline_id);
|
|
6700
|
+
sha1ToAttachmentIds[filePayload.sha1].push(offlineAttachment.offline_id);
|
|
6800
6701
|
}
|
|
6801
6702
|
this.dispatch(this.addAttachments(offlineAttachments));
|
|
6802
6703
|
const promise = this.enqueueRequest({
|
|
6803
6704
|
description: "Attach files to document",
|
|
6804
6705
|
method: HttpMethod.POST,
|
|
6805
|
-
url:
|
|
6706
|
+
url: "/document-attachments/bulk/",
|
|
6806
6707
|
payload: {
|
|
6807
6708
|
submitted_at: submittedAt,
|
|
6808
6709
|
attachments: attachmentPayloads,
|
|
@@ -6827,14 +6728,14 @@ class DocumentAttachmentService extends BaseAttachmentService {
|
|
|
6827
6728
|
});
|
|
6828
6729
|
return [offlineAttachments, promise.then(({ attachments }) => attachments)];
|
|
6829
6730
|
}
|
|
6830
|
-
async
|
|
6831
|
-
return this.
|
|
6731
|
+
async delete(id) {
|
|
6732
|
+
return this._delete(id);
|
|
6832
6733
|
}
|
|
6833
6734
|
makeReadable(attachmnentId) {
|
|
6834
6735
|
void this.enqueueRequest({
|
|
6835
6736
|
description: "Add attachment to AI assistant",
|
|
6836
6737
|
method: HttpMethod.PATCH,
|
|
6837
|
-
url: `/
|
|
6738
|
+
url: `/document-attachments/${attachmnentId}/`,
|
|
6838
6739
|
payload: {
|
|
6839
6740
|
readable_to_assistant: true
|
|
6840
6741
|
},
|
|
@@ -6851,7 +6752,7 @@ class DocumentAttachmentService extends BaseAttachmentService {
|
|
|
6851
6752
|
blocks: [],
|
|
6852
6753
|
blockers: []
|
|
6853
6754
|
});
|
|
6854
|
-
this.dispatch(
|
|
6755
|
+
this.dispatch(initializeDocumentAttachments(projectDocumentAttachments));
|
|
6855
6756
|
const organizationDocumentAttachments = await this.enqueueRequest({
|
|
6856
6757
|
description: "Get document attachments",
|
|
6857
6758
|
method: HttpMethod.GET,
|
|
@@ -7095,17 +6996,11 @@ class GeoImageService extends BaseUploadService {
|
|
|
7095
6996
|
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7096
6997
|
const createdBy = (_a2 = store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
7097
6998
|
const projectId = payloadWithoutFile.project;
|
|
7098
|
-
const
|
|
7099
|
-
const filePayload = {
|
|
7100
|
-
sha1,
|
|
7101
|
-
file_type: file.type,
|
|
7102
|
-
extension: file.name.split(".").pop(),
|
|
7103
|
-
size: file.size
|
|
7104
|
-
};
|
|
6999
|
+
const filePayload = await this.getFilePayload(file);
|
|
7105
7000
|
const offlineMapImage = offline({
|
|
7106
7001
|
...payloadWithoutFile,
|
|
7107
7002
|
file_name: file.name,
|
|
7108
|
-
file_sha1: sha1,
|
|
7003
|
+
file_sha1: filePayload.sha1,
|
|
7109
7004
|
file: URL.createObjectURL(file),
|
|
7110
7005
|
submitted_at: submittedAt,
|
|
7111
7006
|
created_by: createdBy
|
|
@@ -7148,23 +7043,16 @@ class GeoImageService extends BaseUploadService {
|
|
|
7148
7043
|
const offlineGeoImages = [];
|
|
7149
7044
|
const offlineIds = [];
|
|
7150
7045
|
const geoImagePayloads = [];
|
|
7151
|
-
const
|
|
7046
|
+
const filePayloads = {};
|
|
7152
7047
|
for (const payloadAndFile of payloads) {
|
|
7153
7048
|
const { file, ...payload } = payloadAndFile;
|
|
7154
|
-
const
|
|
7155
|
-
if (!(sha1 in
|
|
7156
|
-
|
|
7157
|
-
sha1,
|
|
7158
|
-
file_type: file.type,
|
|
7159
|
-
extension: file.name.split(".").pop(),
|
|
7160
|
-
size: file.size
|
|
7161
|
-
};
|
|
7162
|
-
await this.client.files.addCache(file, sha1);
|
|
7163
|
-
}
|
|
7049
|
+
const filePayload = await this.getFilePayload(file);
|
|
7050
|
+
if (!(filePayload.sha1 in filePayloads))
|
|
7051
|
+
filePayloads[filePayload.sha1] = filePayload;
|
|
7164
7052
|
const offlineMapImage = offline({
|
|
7165
7053
|
...payload,
|
|
7166
7054
|
file_name: file.name,
|
|
7167
|
-
file_sha1: sha1,
|
|
7055
|
+
file_sha1: filePayload.sha1,
|
|
7168
7056
|
file: URL.createObjectURL(file),
|
|
7169
7057
|
submitted_at: submittedAt,
|
|
7170
7058
|
created_by: createdBy,
|
|
@@ -7193,7 +7081,7 @@ class GeoImageService extends BaseUploadService {
|
|
|
7193
7081
|
submitted_at: submittedAt,
|
|
7194
7082
|
project: projectId,
|
|
7195
7083
|
geo_images: geoImagePayloads,
|
|
7196
|
-
files: Object.values(
|
|
7084
|
+
files: Object.values(filePayloads)
|
|
7197
7085
|
},
|
|
7198
7086
|
blocks: [projectId.toString()],
|
|
7199
7087
|
blockers: offlineIds
|
|
@@ -7261,7 +7149,7 @@ class GeoImageService extends BaseUploadService {
|
|
|
7261
7149
|
this.dispatch(initializeGeoImages(result));
|
|
7262
7150
|
}
|
|
7263
7151
|
}
|
|
7264
|
-
class IssueAssociationService extends
|
|
7152
|
+
class IssueAssociationService extends BaseApiService {
|
|
7265
7153
|
add(payload) {
|
|
7266
7154
|
var _a2;
|
|
7267
7155
|
const { store } = this.client;
|
|
@@ -7276,7 +7164,7 @@ class IssueAssociationService extends BaseUploadService {
|
|
|
7276
7164
|
const promise = this.enqueueRequest({
|
|
7277
7165
|
description: "Add issue association",
|
|
7278
7166
|
method: HttpMethod.POST,
|
|
7279
|
-
url: "/
|
|
7167
|
+
url: "/issue-associations/",
|
|
7280
7168
|
payload: {
|
|
7281
7169
|
offline_id: offlineIssueAssociation.offline_id,
|
|
7282
7170
|
submitted_at: submittedAt,
|
|
@@ -7306,7 +7194,7 @@ class IssueAssociationService extends BaseUploadService {
|
|
|
7306
7194
|
const promise = this.enqueueRequest({
|
|
7307
7195
|
description: "Delete issue association",
|
|
7308
7196
|
method: HttpMethod.DELETE,
|
|
7309
|
-
url: `/
|
|
7197
|
+
url: `/issue-associations/${id}/`,
|
|
7310
7198
|
blockers: [id],
|
|
7311
7199
|
blocks: []
|
|
7312
7200
|
});
|
|
@@ -7319,14 +7207,854 @@ class IssueAssociationService extends BaseUploadService {
|
|
|
7319
7207
|
const issueAssociations = await this.enqueueRequest({
|
|
7320
7208
|
description: "Fetch issue associations",
|
|
7321
7209
|
method: HttpMethod.GET,
|
|
7322
|
-
url: "/
|
|
7323
|
-
queryParams: {
|
|
7210
|
+
url: "/issue-associations/",
|
|
7211
|
+
queryParams: { project: projectId.toString() },
|
|
7324
7212
|
blockers: [],
|
|
7325
7213
|
blocks: []
|
|
7326
7214
|
});
|
|
7327
7215
|
this.dispatch(initializeIssueAssociations(issueAssociations));
|
|
7328
7216
|
}
|
|
7329
7217
|
}
|
|
7218
|
+
class FormRevisionAttachmentService extends BaseUploadService {
|
|
7219
|
+
async bulkAdd(payloads) {
|
|
7220
|
+
var _a2;
|
|
7221
|
+
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7222
|
+
const createdBy = (_a2 = this.client.store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
7223
|
+
const filePayloads = {};
|
|
7224
|
+
const offlineFormRevisionAttachments = [];
|
|
7225
|
+
const attachmentPayloads = [];
|
|
7226
|
+
for (const payload of payloads) {
|
|
7227
|
+
const { revisionId, fieldIdentifier, file } = payload;
|
|
7228
|
+
const filePayload = await this.getFilePayload(file);
|
|
7229
|
+
if (!(filePayload.sha1 in filePayloads))
|
|
7230
|
+
filePayloads[filePayload.sha1] = filePayload;
|
|
7231
|
+
const offlineFormRevisionAttachment = offline({
|
|
7232
|
+
file: URL.createObjectURL(file),
|
|
7233
|
+
file_type: file.type,
|
|
7234
|
+
file_name: file.name,
|
|
7235
|
+
file_sha1: filePayload.sha1,
|
|
7236
|
+
created_by: createdBy,
|
|
7237
|
+
form_revision: revisionId,
|
|
7238
|
+
submitted_at: submittedAt,
|
|
7239
|
+
field_identifier: fieldIdentifier
|
|
7240
|
+
});
|
|
7241
|
+
offlineFormRevisionAttachments.push(offlineFormRevisionAttachment);
|
|
7242
|
+
const attachmentPayload = {
|
|
7243
|
+
offline_id: offlineFormRevisionAttachment.offline_id,
|
|
7244
|
+
file_name: file.name,
|
|
7245
|
+
field_identifier: fieldIdentifier,
|
|
7246
|
+
file_extension: filePayload.extension,
|
|
7247
|
+
file_sha1: filePayload.sha1,
|
|
7248
|
+
form_revision: revisionId
|
|
7249
|
+
};
|
|
7250
|
+
attachmentPayloads.push(attachmentPayload);
|
|
7251
|
+
}
|
|
7252
|
+
this.dispatch(addFormRevisionAttachments(offlineFormRevisionAttachments));
|
|
7253
|
+
const promise = this.enqueueRequest({
|
|
7254
|
+
description: "Attach files to form revision",
|
|
7255
|
+
method: HttpMethod.POST,
|
|
7256
|
+
url: "/form-revision-attachments/bulk/",
|
|
7257
|
+
payload: {
|
|
7258
|
+
submitted_at: submittedAt,
|
|
7259
|
+
attachments: attachmentPayloads,
|
|
7260
|
+
files: Object.values(filePayloads)
|
|
7261
|
+
},
|
|
7262
|
+
blockers: offlineFormRevisionAttachments.map((attachment) => attachment.form_revision),
|
|
7263
|
+
blocks: offlineFormRevisionAttachments.map((attachment) => attachment.offline_id)
|
|
7264
|
+
});
|
|
7265
|
+
promise.then((result) => {
|
|
7266
|
+
this.processPresignedUrls(result.presigned_urls);
|
|
7267
|
+
this.dispatch(updateFormRevisionAttachments(result.attachments));
|
|
7268
|
+
}).catch(() => {
|
|
7269
|
+
this.dispatch(
|
|
7270
|
+
deleteFormRevisionAttachments(
|
|
7271
|
+
offlineFormRevisionAttachments.map((attachment) => attachment.offline_id)
|
|
7272
|
+
)
|
|
7273
|
+
);
|
|
7274
|
+
});
|
|
7275
|
+
return [offlineFormRevisionAttachments, promise.then(({ attachments }) => attachments)];
|
|
7276
|
+
}
|
|
7277
|
+
async refreshStore(projectId, organizationId) {
|
|
7278
|
+
let attachments = [];
|
|
7279
|
+
const projectFormRevisions = await this.enqueueRequest({
|
|
7280
|
+
description: "Fetch project form revision attachments",
|
|
7281
|
+
method: HttpMethod.GET,
|
|
7282
|
+
url: "/form-revision-attachments/",
|
|
7283
|
+
queryParams: {
|
|
7284
|
+
project: projectId.toString()
|
|
7285
|
+
},
|
|
7286
|
+
blockers: [projectId.toString()],
|
|
7287
|
+
blocks: []
|
|
7288
|
+
});
|
|
7289
|
+
attachments = attachments.concat(projectFormRevisions);
|
|
7290
|
+
const organizationFormRevisions = await this.enqueueRequest({
|
|
7291
|
+
description: "Fetch organization form revision attachments",
|
|
7292
|
+
method: HttpMethod.GET,
|
|
7293
|
+
url: "/form-revision-attachments/",
|
|
7294
|
+
queryParams: {
|
|
7295
|
+
organization: organizationId.toString()
|
|
7296
|
+
},
|
|
7297
|
+
blockers: [organizationId.toString()],
|
|
7298
|
+
blocks: []
|
|
7299
|
+
});
|
|
7300
|
+
attachments = attachments.concat(organizationFormRevisions);
|
|
7301
|
+
this.dispatch(initializeFormRevisionAttachments(attachments));
|
|
7302
|
+
}
|
|
7303
|
+
}
|
|
7304
|
+
class FormSubmissionAttachmentService extends BaseUploadService {
|
|
7305
|
+
async bulkAdd(payloads) {
|
|
7306
|
+
var _a2;
|
|
7307
|
+
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7308
|
+
const createdBy = (_a2 = this.client.store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
7309
|
+
const filePayloads = {};
|
|
7310
|
+
const offlineFormSubmissionAttachments = [];
|
|
7311
|
+
const attachmentPayloads = [];
|
|
7312
|
+
for (const payload of payloads) {
|
|
7313
|
+
const { submissionId, fieldIdentifier, file } = payload;
|
|
7314
|
+
const filePayload = await this.getFilePayload(file);
|
|
7315
|
+
if (!(filePayload.sha1 in filePayloads))
|
|
7316
|
+
filePayloads[filePayload.sha1] = filePayload;
|
|
7317
|
+
const offlineFormSubmissionAttachment = offline({
|
|
7318
|
+
file: URL.createObjectURL(file),
|
|
7319
|
+
file_type: file.type,
|
|
7320
|
+
file_name: file.name,
|
|
7321
|
+
file_sha1: filePayload.sha1,
|
|
7322
|
+
created_by: createdBy,
|
|
7323
|
+
form_submission: submissionId,
|
|
7324
|
+
submitted_at: submittedAt,
|
|
7325
|
+
field_identifier: fieldIdentifier
|
|
7326
|
+
});
|
|
7327
|
+
offlineFormSubmissionAttachments.push(offlineFormSubmissionAttachment);
|
|
7328
|
+
const attachmentPayload = {
|
|
7329
|
+
offline_id: offlineFormSubmissionAttachment.offline_id,
|
|
7330
|
+
file_name: file.name,
|
|
7331
|
+
file_sha1: filePayload.sha1,
|
|
7332
|
+
file_extension: filePayload.extension,
|
|
7333
|
+
field_identifier: fieldIdentifier,
|
|
7334
|
+
form_submission: submissionId
|
|
7335
|
+
};
|
|
7336
|
+
attachmentPayloads.push(attachmentPayload);
|
|
7337
|
+
}
|
|
7338
|
+
this.dispatch(addFormSubmissionAttachments(offlineFormSubmissionAttachments));
|
|
7339
|
+
const promise = this.enqueueRequest({
|
|
7340
|
+
description: "Attach files to form submission",
|
|
7341
|
+
method: HttpMethod.POST,
|
|
7342
|
+
url: "/form-submission-attachments/bulk/",
|
|
7343
|
+
payload: {
|
|
7344
|
+
submitted_at: submittedAt,
|
|
7345
|
+
attachments: attachmentPayloads,
|
|
7346
|
+
files: Object.values(filePayloads)
|
|
7347
|
+
},
|
|
7348
|
+
blockers: offlineFormSubmissionAttachments.map((attachment) => attachment.form_submission),
|
|
7349
|
+
blocks: offlineFormSubmissionAttachments.map((attachment) => attachment.offline_id)
|
|
7350
|
+
});
|
|
7351
|
+
promise.then((result) => {
|
|
7352
|
+
this.processPresignedUrls(result.presigned_urls);
|
|
7353
|
+
this.dispatch(updateFormSubmissionAttachments(result.attachments));
|
|
7354
|
+
}).catch((error) => {
|
|
7355
|
+
this.dispatch(
|
|
7356
|
+
deleteFormSubmissionAttachments(
|
|
7357
|
+
offlineFormSubmissionAttachments.map((attachment) => attachment.offline_id)
|
|
7358
|
+
)
|
|
7359
|
+
);
|
|
7360
|
+
throw error;
|
|
7361
|
+
});
|
|
7362
|
+
return [offlineFormSubmissionAttachments, promise.then(({ attachments }) => attachments)];
|
|
7363
|
+
}
|
|
7364
|
+
async bulkDelete(attachmentsIds) {
|
|
7365
|
+
const { store } = this.client;
|
|
7366
|
+
const state = store.getState();
|
|
7367
|
+
const formSubmissionAttachments = selectFormSubmissionAttachemntsByIds(attachmentsIds)(state);
|
|
7368
|
+
this.dispatch(deleteFormSubmissionAttachments(attachmentsIds));
|
|
7369
|
+
try {
|
|
7370
|
+
await this.enqueueRequest({
|
|
7371
|
+
description: "Delete form submission attachments",
|
|
7372
|
+
method: HttpMethod.DELETE,
|
|
7373
|
+
url: "/form-submission-attachments/bulk/",
|
|
7374
|
+
payload: { attachment_ids: attachmentsIds },
|
|
7375
|
+
blockers: attachmentsIds,
|
|
7376
|
+
blocks: []
|
|
7377
|
+
});
|
|
7378
|
+
} catch (e) {
|
|
7379
|
+
this.dispatch(addFormSubmissionAttachments(formSubmissionAttachments));
|
|
7380
|
+
throw e;
|
|
7381
|
+
}
|
|
7382
|
+
}
|
|
7383
|
+
async refreshStore(projectId) {
|
|
7384
|
+
const result = await this.enqueueRequest({
|
|
7385
|
+
description: "Get form submission attachments",
|
|
7386
|
+
method: HttpMethod.GET,
|
|
7387
|
+
url: "/form-submission-attachments/",
|
|
7388
|
+
queryParams: {
|
|
7389
|
+
project: projectId.toString()
|
|
7390
|
+
},
|
|
7391
|
+
blockers: [],
|
|
7392
|
+
blocks: []
|
|
7393
|
+
});
|
|
7394
|
+
this.dispatch(initializeFormSubmissionAttachments(result));
|
|
7395
|
+
}
|
|
7396
|
+
}
|
|
7397
|
+
class AssetTypeFieldsAttachmentService extends BaseUploadService {
|
|
7398
|
+
async bulkAdd(payloads) {
|
|
7399
|
+
var _a2;
|
|
7400
|
+
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7401
|
+
const createdBy = (_a2 = this.client.store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
7402
|
+
const filePayloads = {};
|
|
7403
|
+
const offlineAssetTypeFieldsAttachments = [];
|
|
7404
|
+
const attachmentPayloads = [];
|
|
7405
|
+
for (const payload of payloads) {
|
|
7406
|
+
const { fieldsRevisionId, fieldIdentifier, file } = payload;
|
|
7407
|
+
const filePayload = await this.getFilePayload(file);
|
|
7408
|
+
if (!(filePayload.sha1 in filePayloads))
|
|
7409
|
+
filePayloads[filePayload.sha1] = filePayload;
|
|
7410
|
+
const offlineAssetTypeFieldsAttachment = offline({
|
|
7411
|
+
file: URL.createObjectURL(file),
|
|
7412
|
+
file_type: file.type,
|
|
7413
|
+
file_name: file.name,
|
|
7414
|
+
file_sha1: filePayload.sha1,
|
|
7415
|
+
created_by: createdBy,
|
|
7416
|
+
fields_revision: fieldsRevisionId,
|
|
7417
|
+
submitted_at: submittedAt,
|
|
7418
|
+
field_identifier: fieldIdentifier
|
|
7419
|
+
});
|
|
7420
|
+
offlineAssetTypeFieldsAttachments.push(offlineAssetTypeFieldsAttachment);
|
|
7421
|
+
const attachmentPayload = {
|
|
7422
|
+
offline_id: offlineAssetTypeFieldsAttachment.offline_id,
|
|
7423
|
+
file_name: file.name,
|
|
7424
|
+
field_identifier: fieldIdentifier,
|
|
7425
|
+
file_extension: filePayload.extension,
|
|
7426
|
+
file_sha1: filePayload.sha1,
|
|
7427
|
+
fields_revision: fieldsRevisionId
|
|
7428
|
+
};
|
|
7429
|
+
attachmentPayloads.push(attachmentPayload);
|
|
7430
|
+
}
|
|
7431
|
+
this.dispatch(addAssetTypeFieldsAttachments(offlineAssetTypeFieldsAttachments));
|
|
7432
|
+
const promise = this.enqueueRequest({
|
|
7433
|
+
description: "Add asset type fields attachments",
|
|
7434
|
+
method: HttpMethod.POST,
|
|
7435
|
+
url: "/asset-type-fields-attachments/bulk/",
|
|
7436
|
+
payload: {
|
|
7437
|
+
submitted_at: submittedAt,
|
|
7438
|
+
attachments: attachmentPayloads,
|
|
7439
|
+
files: Object.values(filePayloads)
|
|
7440
|
+
},
|
|
7441
|
+
blockers: offlineAssetTypeFieldsAttachments.map((attachment) => attachment.fields_revision),
|
|
7442
|
+
blocks: offlineAssetTypeFieldsAttachments.map((attachment) => attachment.offline_id)
|
|
7443
|
+
});
|
|
7444
|
+
promise.then((result) => {
|
|
7445
|
+
this.processPresignedUrls(result.presigned_urls);
|
|
7446
|
+
this.dispatch(updateAssetTypeFieldsAttachments(result.attachments));
|
|
7447
|
+
}).catch(() => {
|
|
7448
|
+
this.dispatch(
|
|
7449
|
+
deleteAssetTypeFieldsAttachments(
|
|
7450
|
+
offlineAssetTypeFieldsAttachments.map((attachment) => attachment.offline_id)
|
|
7451
|
+
)
|
|
7452
|
+
);
|
|
7453
|
+
});
|
|
7454
|
+
return [offlineAssetTypeFieldsAttachments, promise.then(({ attachments }) => attachments)];
|
|
7455
|
+
}
|
|
7456
|
+
async refreshStore(projectId) {
|
|
7457
|
+
const result = await this.enqueueRequest({
|
|
7458
|
+
description: "get asset type fields attachments",
|
|
7459
|
+
method: HttpMethod.GET,
|
|
7460
|
+
url: "/asset-type-fields-attachments/",
|
|
7461
|
+
queryParams: {
|
|
7462
|
+
project: projectId.toString()
|
|
7463
|
+
},
|
|
7464
|
+
blockers: [projectId.toString()],
|
|
7465
|
+
blocks: []
|
|
7466
|
+
});
|
|
7467
|
+
this.dispatch(initializeAssetTypeFieldsAttachments(result));
|
|
7468
|
+
}
|
|
7469
|
+
}
|
|
7470
|
+
class AssetTypeFieldsService extends BaseApiService {
|
|
7471
|
+
add(payload) {
|
|
7472
|
+
var _a2;
|
|
7473
|
+
const { store } = this.client;
|
|
7474
|
+
const createdBy = (_a2 = store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
7475
|
+
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7476
|
+
const offlineAssetTypeFields = offline({
|
|
7477
|
+
...payload,
|
|
7478
|
+
created_by: createdBy,
|
|
7479
|
+
submitted_at: submittedAt
|
|
7480
|
+
});
|
|
7481
|
+
this.dispatch(addAssetTypeFields(offlineAssetTypeFields));
|
|
7482
|
+
const promise = this.enqueueRequest({
|
|
7483
|
+
description: "Add Asset Type Fields",
|
|
7484
|
+
method: HttpMethod.POST,
|
|
7485
|
+
url: "/asset-type-fields/",
|
|
7486
|
+
payload: offlineAssetTypeFields,
|
|
7487
|
+
blockers: [offlineAssetTypeFields.asset_type],
|
|
7488
|
+
blocks: [offlineAssetTypeFields.offline_id]
|
|
7489
|
+
});
|
|
7490
|
+
promise.then((response) => {
|
|
7491
|
+
this.dispatch(updateAssetTypeFields(response));
|
|
7492
|
+
}).catch((error) => {
|
|
7493
|
+
this.dispatch(deleteAssetTypeFields(offlineAssetTypeFields.offline_id));
|
|
7494
|
+
throw error;
|
|
7495
|
+
});
|
|
7496
|
+
return [offlineAssetTypeFields, promise];
|
|
7497
|
+
}
|
|
7498
|
+
async refreshStore(projectId) {
|
|
7499
|
+
const result = await this.enqueueRequest({
|
|
7500
|
+
description: "Get Asset Type Fields",
|
|
7501
|
+
method: HttpMethod.GET,
|
|
7502
|
+
url: "/asset-type-fields/",
|
|
7503
|
+
queryParams: {
|
|
7504
|
+
project: projectId.toString()
|
|
7505
|
+
},
|
|
7506
|
+
blockers: [],
|
|
7507
|
+
blocks: []
|
|
7508
|
+
});
|
|
7509
|
+
this.dispatch(initializeAssetTypeFields(result));
|
|
7510
|
+
}
|
|
7511
|
+
}
|
|
7512
|
+
class AssetTypeFieldValuesService extends BaseApiService {
|
|
7513
|
+
add(payload) {
|
|
7514
|
+
var _a2;
|
|
7515
|
+
const { store } = this.client;
|
|
7516
|
+
const state = store.getState();
|
|
7517
|
+
const { values } = separateFilesFromValues(payload.values);
|
|
7518
|
+
const offlineAssetTypeFieldValues = offline({
|
|
7519
|
+
...payload,
|
|
7520
|
+
values,
|
|
7521
|
+
created_by: (_a2 = state.userReducer.currentUser) == null ? void 0 : _a2.id,
|
|
7522
|
+
submitted_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
7523
|
+
});
|
|
7524
|
+
const promise = this.enqueueRequest({
|
|
7525
|
+
description: "Add asset type field values",
|
|
7526
|
+
method: HttpMethod.POST,
|
|
7527
|
+
url: "/asset-type-field-values/",
|
|
7528
|
+
payload: offlineAssetTypeFieldValues,
|
|
7529
|
+
blockers: [payload.asset, payload.fields_revision],
|
|
7530
|
+
blocks: [offlineAssetTypeFieldValues.offline_id]
|
|
7531
|
+
});
|
|
7532
|
+
this.dispatch(addAssetTypeFieldValues(offlineAssetTypeFieldValues));
|
|
7533
|
+
promise.then((result) => {
|
|
7534
|
+
this.dispatch(updateAssetTypeFieldValues(result));
|
|
7535
|
+
return result;
|
|
7536
|
+
}).catch(() => {
|
|
7537
|
+
this.dispatch(deleteAssetTypeFieldValues(offlineAssetTypeFieldValues.offline_id));
|
|
7538
|
+
});
|
|
7539
|
+
return [offlineAssetTypeFieldValues, promise];
|
|
7540
|
+
}
|
|
7541
|
+
bulkAdd(payload, batchSize) {
|
|
7542
|
+
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7543
|
+
const { values } = separateFilesFromValues(payload.values);
|
|
7544
|
+
const payloadsBatches = chunkArray(payload.payloads, batchSize);
|
|
7545
|
+
const bulkAddPayloads = payloadsBatches.map((batch) => {
|
|
7546
|
+
return {
|
|
7547
|
+
submitted_at: submittedAt,
|
|
7548
|
+
values,
|
|
7549
|
+
field_values: batch.map((payload2) => {
|
|
7550
|
+
const { values: values2 } = separateFilesFromValues(payload2.values);
|
|
7551
|
+
return offline({
|
|
7552
|
+
...payload2,
|
|
7553
|
+
values: values2
|
|
7554
|
+
});
|
|
7555
|
+
})
|
|
7556
|
+
};
|
|
7557
|
+
});
|
|
7558
|
+
const promises = [];
|
|
7559
|
+
for (const payload2 of bulkAddPayloads) {
|
|
7560
|
+
const assetIds = payload2.field_values.map((x) => x.asset);
|
|
7561
|
+
const assetTypeFieldsIds = payload2.field_values.map((x) => x.fields_revision);
|
|
7562
|
+
const assetTypeFieldValuesIds = payload2.field_values.map((x) => x.offline_id);
|
|
7563
|
+
const promise = this.enqueueRequest({
|
|
7564
|
+
description: "Bulk add asset type field values",
|
|
7565
|
+
method: HttpMethod.POST,
|
|
7566
|
+
url: "/asset-type-field-values/bulk/",
|
|
7567
|
+
payload: payload2,
|
|
7568
|
+
blockers: [...assetIds, ...assetTypeFieldsIds],
|
|
7569
|
+
blocks: assetTypeFieldValuesIds
|
|
7570
|
+
});
|
|
7571
|
+
promises.push(promise);
|
|
7572
|
+
}
|
|
7573
|
+
void Promise.all(promises).then((results) => {
|
|
7574
|
+
this.dispatch(addAssetTypeFieldValuesMany(results.flat()));
|
|
7575
|
+
});
|
|
7576
|
+
return promises;
|
|
7577
|
+
}
|
|
7578
|
+
update(payload) {
|
|
7579
|
+
const { store } = this.client;
|
|
7580
|
+
const state = store.getState();
|
|
7581
|
+
const assetTypeFieldValues = selectAssetTypeFieldValuesById(payload.offline_id)(state);
|
|
7582
|
+
if (!assetTypeFieldValues) {
|
|
7583
|
+
throw new Error(`Expected AssetTypeFieldValues with offline_id ${payload.offline_id} to exist`);
|
|
7584
|
+
}
|
|
7585
|
+
const { values } = separateFilesFromValues(payload.values ?? {});
|
|
7586
|
+
const updatedAssetTypeFieldValues = {
|
|
7587
|
+
...assetTypeFieldValues,
|
|
7588
|
+
...payload,
|
|
7589
|
+
// values could also have a partial update
|
|
7590
|
+
values: {
|
|
7591
|
+
...assetTypeFieldValues.values,
|
|
7592
|
+
...values
|
|
7593
|
+
}
|
|
7594
|
+
};
|
|
7595
|
+
this.dispatch(updateAssetTypeFieldValues(updatedAssetTypeFieldValues));
|
|
7596
|
+
const promise = this.enqueueRequest({
|
|
7597
|
+
description: "Delete asset type field values",
|
|
7598
|
+
method: HttpMethod.PATCH,
|
|
7599
|
+
url: `/asset-type-field-values/${payload.offline_id}/`,
|
|
7600
|
+
payload,
|
|
7601
|
+
blockers: [
|
|
7602
|
+
updatedAssetTypeFieldValues.offline_id,
|
|
7603
|
+
updatedAssetTypeFieldValues.fields_revision,
|
|
7604
|
+
updatedAssetTypeFieldValues.asset
|
|
7605
|
+
],
|
|
7606
|
+
blocks: [updatedAssetTypeFieldValues.offline_id]
|
|
7607
|
+
});
|
|
7608
|
+
promise.then((result) => {
|
|
7609
|
+
this.dispatch(updateAssetTypeFieldValues(result));
|
|
7610
|
+
}).catch(() => {
|
|
7611
|
+
this.dispatch(updateAssetTypeFieldValues(assetTypeFieldValues));
|
|
7612
|
+
});
|
|
7613
|
+
return [updatedAssetTypeFieldValues, promise];
|
|
7614
|
+
}
|
|
7615
|
+
async delete(id) {
|
|
7616
|
+
const { store } = this.client;
|
|
7617
|
+
const state = store.getState();
|
|
7618
|
+
const assetTypeFieldValues = selectAssetTypeFieldValuesById(id)(state);
|
|
7619
|
+
if (!assetTypeFieldValues) {
|
|
7620
|
+
throw new Error(`Expected submission with offline_id ${id} to exist`);
|
|
7621
|
+
}
|
|
7622
|
+
const assetTypeFieldValuesAttachments = selectAttachmentsOfAssetTypeFieldValues(id)(state);
|
|
7623
|
+
this.dispatch(deleteAssetTypeFieldValues(id));
|
|
7624
|
+
this.dispatch(deleteAssetTypeFieldValuesAttachments(assetTypeFieldValuesAttachments.map((x) => x.offline_id)));
|
|
7625
|
+
try {
|
|
7626
|
+
await this.enqueueRequest({
|
|
7627
|
+
description: "Delete asset type field values",
|
|
7628
|
+
method: HttpMethod.DELETE,
|
|
7629
|
+
url: `/asset-type-field-values/${id}/`,
|
|
7630
|
+
blockers: [id],
|
|
7631
|
+
blocks: []
|
|
7632
|
+
});
|
|
7633
|
+
} catch (e) {
|
|
7634
|
+
this.dispatch(addAssetTypeFieldValues(assetTypeFieldValues));
|
|
7635
|
+
this.dispatch(addAssetTypeFieldValuesAttachments(assetTypeFieldValuesAttachments));
|
|
7636
|
+
throw e;
|
|
7637
|
+
}
|
|
7638
|
+
}
|
|
7639
|
+
async refreshStore(projectId) {
|
|
7640
|
+
const result = await this.enqueueRequest({
|
|
7641
|
+
description: "Get asset type field values",
|
|
7642
|
+
method: HttpMethod.GET,
|
|
7643
|
+
url: "/asset-type-field-values/",
|
|
7644
|
+
queryParams: {
|
|
7645
|
+
project: projectId.toString()
|
|
7646
|
+
},
|
|
7647
|
+
blockers: [],
|
|
7648
|
+
blocks: []
|
|
7649
|
+
});
|
|
7650
|
+
this.dispatch(initializeAssetTypeFieldValues(result));
|
|
7651
|
+
}
|
|
7652
|
+
}
|
|
7653
|
+
class AssetTypeFieldValuesAttachmentService extends BaseUploadService {
|
|
7654
|
+
async bulkAdd(payloads) {
|
|
7655
|
+
var _a2;
|
|
7656
|
+
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7657
|
+
const createdBy = (_a2 = this.client.store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
7658
|
+
const filePayloads = {};
|
|
7659
|
+
const offlineAssetTypeFieldValuesAttachments = [];
|
|
7660
|
+
const attachmentPayloads = [];
|
|
7661
|
+
for (const payload of payloads) {
|
|
7662
|
+
const { fieldValuesId, fieldIdentifier, file } = payload;
|
|
7663
|
+
const filePayload = await this.getFilePayload(file);
|
|
7664
|
+
if (!(filePayload.sha1 in filePayloads))
|
|
7665
|
+
filePayloads[filePayload.sha1] = filePayload;
|
|
7666
|
+
const offlineAssetTypeFieldValuesAttachment = offline({
|
|
7667
|
+
file: URL.createObjectURL(file),
|
|
7668
|
+
file_type: file.type,
|
|
7669
|
+
file_name: file.name,
|
|
7670
|
+
file_sha1: filePayload.sha1,
|
|
7671
|
+
created_by: createdBy,
|
|
7672
|
+
field_values: fieldValuesId,
|
|
7673
|
+
submitted_at: submittedAt,
|
|
7674
|
+
field_identifier: fieldIdentifier
|
|
7675
|
+
});
|
|
7676
|
+
offlineAssetTypeFieldValuesAttachments.push(offlineAssetTypeFieldValuesAttachment);
|
|
7677
|
+
const attachmentPayload = {
|
|
7678
|
+
offline_id: offlineAssetTypeFieldValuesAttachment.offline_id,
|
|
7679
|
+
file_name: file.name,
|
|
7680
|
+
file_sha1: filePayload.sha1,
|
|
7681
|
+
file_extension: filePayload.extension,
|
|
7682
|
+
field_identifier: fieldIdentifier,
|
|
7683
|
+
field_values: fieldValuesId
|
|
7684
|
+
};
|
|
7685
|
+
attachmentPayloads.push(attachmentPayload);
|
|
7686
|
+
}
|
|
7687
|
+
this.dispatch(addAssetTypeFieldValuesAttachments(offlineAssetTypeFieldValuesAttachments));
|
|
7688
|
+
const promise = this.enqueueRequest({
|
|
7689
|
+
description: "Add asset type field values attachments",
|
|
7690
|
+
method: HttpMethod.POST,
|
|
7691
|
+
url: "/asset-type-field-values-attachments/bulk/",
|
|
7692
|
+
payload: {
|
|
7693
|
+
submitted_at: submittedAt,
|
|
7694
|
+
attachments: attachmentPayloads,
|
|
7695
|
+
files: Object.values(filePayloads)
|
|
7696
|
+
},
|
|
7697
|
+
blockers: offlineAssetTypeFieldValuesAttachments.map((attachment) => attachment.field_values),
|
|
7698
|
+
blocks: offlineAssetTypeFieldValuesAttachments.map((attachment) => attachment.offline_id)
|
|
7699
|
+
});
|
|
7700
|
+
promise.then(({ presigned_urls, attachments }) => {
|
|
7701
|
+
this.processPresignedUrls(presigned_urls);
|
|
7702
|
+
this.dispatch(updateAssetTypeFieldValuesAttachments(attachments));
|
|
7703
|
+
}).catch((error) => {
|
|
7704
|
+
this.dispatch(
|
|
7705
|
+
deleteAssetTypeFieldValuesAttachments(
|
|
7706
|
+
offlineAssetTypeFieldValuesAttachments.map((attachment) => attachment.offline_id)
|
|
7707
|
+
)
|
|
7708
|
+
);
|
|
7709
|
+
throw error;
|
|
7710
|
+
});
|
|
7711
|
+
return [offlineAssetTypeFieldValuesAttachments, promise.then(({ attachments }) => attachments)];
|
|
7712
|
+
}
|
|
7713
|
+
async bulkDelete(ids) {
|
|
7714
|
+
const { store } = this.client;
|
|
7715
|
+
const state = store.getState();
|
|
7716
|
+
const formSubmissionAttachments = selectFormSubmissionAttachemntsByIds(ids)(state);
|
|
7717
|
+
this.dispatch(deleteFormSubmissionAttachments(ids));
|
|
7718
|
+
try {
|
|
7719
|
+
await this.enqueueRequest({
|
|
7720
|
+
description: "Delete asset type field values attachments",
|
|
7721
|
+
method: HttpMethod.DELETE,
|
|
7722
|
+
url: "/asset-type-field-values-attachments/bulk/",
|
|
7723
|
+
payload: { attachment_ids: ids },
|
|
7724
|
+
blockers: ids,
|
|
7725
|
+
blocks: []
|
|
7726
|
+
});
|
|
7727
|
+
} catch (e) {
|
|
7728
|
+
this.dispatch(addFormSubmissionAttachments(formSubmissionAttachments));
|
|
7729
|
+
throw e;
|
|
7730
|
+
}
|
|
7731
|
+
}
|
|
7732
|
+
async refreshStore(projectId) {
|
|
7733
|
+
const result = await this.enqueueRequest({
|
|
7734
|
+
description: "Gfet asset type field values attachments",
|
|
7735
|
+
method: HttpMethod.GET,
|
|
7736
|
+
url: "/asset-type-field-values-attachments/",
|
|
7737
|
+
queryParams: {
|
|
7738
|
+
project: projectId.toString()
|
|
7739
|
+
},
|
|
7740
|
+
blockers: [],
|
|
7741
|
+
blocks: []
|
|
7742
|
+
});
|
|
7743
|
+
this.dispatch(initializeAssetTypeFieldValuesAttachments(result));
|
|
7744
|
+
}
|
|
7745
|
+
}
|
|
7746
|
+
class IssueTypeFieldsAttachmentService extends BaseUploadService {
|
|
7747
|
+
async bulkAdd(payloads) {
|
|
7748
|
+
var _a2;
|
|
7749
|
+
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7750
|
+
const createdBy = (_a2 = this.client.store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
7751
|
+
const filePayloads = {};
|
|
7752
|
+
const offlineIssueTypeFieldsAttachments = [];
|
|
7753
|
+
const attachmentPayloads = [];
|
|
7754
|
+
for (const payload of payloads) {
|
|
7755
|
+
const { fieldsRevisionId, fieldIdentifier, file } = payload;
|
|
7756
|
+
const filePayload = await this.getFilePayload(file);
|
|
7757
|
+
if (!(filePayload.sha1 in filePayloads))
|
|
7758
|
+
filePayloads[filePayload.sha1] = filePayload;
|
|
7759
|
+
const offlineIssueTypeFieldsAttachment = offline({
|
|
7760
|
+
file: URL.createObjectURL(file),
|
|
7761
|
+
file_type: file.type,
|
|
7762
|
+
file_name: file.name,
|
|
7763
|
+
file_sha1: filePayload.sha1,
|
|
7764
|
+
created_by: createdBy,
|
|
7765
|
+
fields_revision: fieldsRevisionId,
|
|
7766
|
+
submitted_at: submittedAt,
|
|
7767
|
+
field_identifier: fieldIdentifier
|
|
7768
|
+
});
|
|
7769
|
+
offlineIssueTypeFieldsAttachments.push(offlineIssueTypeFieldsAttachment);
|
|
7770
|
+
const attachmentPayload = {
|
|
7771
|
+
offline_id: offlineIssueTypeFieldsAttachment.offline_id,
|
|
7772
|
+
file_name: file.name,
|
|
7773
|
+
file_extension: filePayload.extension,
|
|
7774
|
+
field_identifier: fieldIdentifier,
|
|
7775
|
+
file_sha1: filePayload.sha1,
|
|
7776
|
+
fields_revision: fieldsRevisionId
|
|
7777
|
+
};
|
|
7778
|
+
attachmentPayloads.push(attachmentPayload);
|
|
7779
|
+
}
|
|
7780
|
+
this.dispatch(addIssueTypeFieldsAttachments(offlineIssueTypeFieldsAttachments));
|
|
7781
|
+
const promise = this.enqueueRequest({
|
|
7782
|
+
description: "Add issue type fields attachments",
|
|
7783
|
+
method: HttpMethod.POST,
|
|
7784
|
+
url: "/issue-type-fields-attachments/bulk/",
|
|
7785
|
+
payload: {
|
|
7786
|
+
submitted_at: submittedAt,
|
|
7787
|
+
attachments: attachmentPayloads,
|
|
7788
|
+
files: Object.values(filePayloads)
|
|
7789
|
+
},
|
|
7790
|
+
blockers: offlineIssueTypeFieldsAttachments.map((attachment) => attachment.fields_revision),
|
|
7791
|
+
blocks: offlineIssueTypeFieldsAttachments.map((attachment) => attachment.offline_id)
|
|
7792
|
+
});
|
|
7793
|
+
promise.then((result) => {
|
|
7794
|
+
this.processPresignedUrls(result.presigned_urls);
|
|
7795
|
+
this.dispatch(updateIssueTypeFieldsAttachments(result.attachments));
|
|
7796
|
+
}).catch(() => {
|
|
7797
|
+
this.dispatch(
|
|
7798
|
+
deleteIssueTypeFieldsAttachments(
|
|
7799
|
+
offlineIssueTypeFieldsAttachments.map((attachment) => attachment.offline_id)
|
|
7800
|
+
)
|
|
7801
|
+
);
|
|
7802
|
+
});
|
|
7803
|
+
return [offlineIssueTypeFieldsAttachments, promise.then(({ attachments }) => attachments)];
|
|
7804
|
+
}
|
|
7805
|
+
async refreshStore(organizationId) {
|
|
7806
|
+
const result = await this.enqueueRequest({
|
|
7807
|
+
description: "get issue type fields attachments",
|
|
7808
|
+
method: HttpMethod.GET,
|
|
7809
|
+
url: "/issue-type-fields-attachments/",
|
|
7810
|
+
queryParams: {
|
|
7811
|
+
organization: organizationId.toString()
|
|
7812
|
+
},
|
|
7813
|
+
blockers: [organizationId.toString()],
|
|
7814
|
+
blocks: []
|
|
7815
|
+
});
|
|
7816
|
+
this.dispatch(initializeIssueTypeFieldsAttachments(result));
|
|
7817
|
+
}
|
|
7818
|
+
}
|
|
7819
|
+
class IssueTypeFieldsService extends BaseApiService {
|
|
7820
|
+
add(payload) {
|
|
7821
|
+
var _a2;
|
|
7822
|
+
const { store } = this.client;
|
|
7823
|
+
const createdBy = (_a2 = store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
7824
|
+
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7825
|
+
const offlineIssueTypeFields = offline({
|
|
7826
|
+
...payload,
|
|
7827
|
+
created_by: createdBy,
|
|
7828
|
+
submitted_at: submittedAt
|
|
7829
|
+
});
|
|
7830
|
+
this.dispatch(addIssueTypeFields(offlineIssueTypeFields));
|
|
7831
|
+
const promise = this.enqueueRequest({
|
|
7832
|
+
description: "Add Issue Type Fields",
|
|
7833
|
+
method: HttpMethod.POST,
|
|
7834
|
+
url: "/issue-type-fields/",
|
|
7835
|
+
payload: offlineIssueTypeFields,
|
|
7836
|
+
blockers: [offlineIssueTypeFields.issue_type],
|
|
7837
|
+
blocks: [offlineIssueTypeFields.offline_id]
|
|
7838
|
+
});
|
|
7839
|
+
promise.then((response) => {
|
|
7840
|
+
this.dispatch(updateIssueTypeFields(response));
|
|
7841
|
+
}).catch((error) => {
|
|
7842
|
+
this.dispatch(deleteIssueTypeFields(offlineIssueTypeFields.offline_id));
|
|
7843
|
+
throw error;
|
|
7844
|
+
});
|
|
7845
|
+
return [offlineIssueTypeFields, promise];
|
|
7846
|
+
}
|
|
7847
|
+
async refreshStore(organizationId) {
|
|
7848
|
+
const result = await this.enqueueRequest({
|
|
7849
|
+
description: "Get Issue Type Fields",
|
|
7850
|
+
method: HttpMethod.GET,
|
|
7851
|
+
url: "/issue-type-fields/",
|
|
7852
|
+
queryParams: {
|
|
7853
|
+
organization: organizationId.toString()
|
|
7854
|
+
},
|
|
7855
|
+
blockers: [],
|
|
7856
|
+
blocks: []
|
|
7857
|
+
});
|
|
7858
|
+
this.dispatch(initializeIssueTypeFields(result));
|
|
7859
|
+
}
|
|
7860
|
+
}
|
|
7861
|
+
class IssueTypeFieldValuesAttachmentService extends BaseUploadService {
|
|
7862
|
+
async bulkAdd(payloads) {
|
|
7863
|
+
var _a2;
|
|
7864
|
+
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7865
|
+
const createdBy = (_a2 = this.client.store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
7866
|
+
const filePayloads = {};
|
|
7867
|
+
const offlineIssueTypeFieldValuesAttachments = [];
|
|
7868
|
+
const attachmentPayloads = [];
|
|
7869
|
+
for (const payload of payloads) {
|
|
7870
|
+
const { fieldValuesId, fieldIdentifier, file } = payload;
|
|
7871
|
+
const filePayload = await this.getFilePayload(file);
|
|
7872
|
+
if (!(filePayload.sha1 in filePayloads))
|
|
7873
|
+
filePayloads[filePayload.sha1] = filePayload;
|
|
7874
|
+
const offlineIssueTypeFieldValuesAttachment = offline({
|
|
7875
|
+
file: URL.createObjectURL(file),
|
|
7876
|
+
file_type: file.type,
|
|
7877
|
+
file_name: file.name,
|
|
7878
|
+
file_sha1: filePayload.sha1,
|
|
7879
|
+
created_by: createdBy,
|
|
7880
|
+
field_values: fieldValuesId,
|
|
7881
|
+
submitted_at: submittedAt,
|
|
7882
|
+
field_identifier: fieldIdentifier
|
|
7883
|
+
});
|
|
7884
|
+
offlineIssueTypeFieldValuesAttachments.push(offlineIssueTypeFieldValuesAttachment);
|
|
7885
|
+
const attachmentPayload = {
|
|
7886
|
+
offline_id: offlineIssueTypeFieldValuesAttachment.offline_id,
|
|
7887
|
+
file_name: file.name,
|
|
7888
|
+
file_sha1: filePayload.sha1,
|
|
7889
|
+
file_extension: filePayload.extension,
|
|
7890
|
+
field_identifier: fieldIdentifier,
|
|
7891
|
+
field_values: fieldValuesId
|
|
7892
|
+
};
|
|
7893
|
+
attachmentPayloads.push(attachmentPayload);
|
|
7894
|
+
}
|
|
7895
|
+
this.dispatch(addIssueTypeFieldValuesAttachments(offlineIssueTypeFieldValuesAttachments));
|
|
7896
|
+
const promise = this.enqueueRequest({
|
|
7897
|
+
description: "Add issue type field values attachments",
|
|
7898
|
+
method: HttpMethod.POST,
|
|
7899
|
+
url: "/issue-type-field-values-attachments/bulk/",
|
|
7900
|
+
payload: {
|
|
7901
|
+
submitted_at: submittedAt,
|
|
7902
|
+
attachments: attachmentPayloads,
|
|
7903
|
+
files: Object.values(filePayloads)
|
|
7904
|
+
},
|
|
7905
|
+
blockers: offlineIssueTypeFieldValuesAttachments.map((attachment) => attachment.field_values),
|
|
7906
|
+
blocks: offlineIssueTypeFieldValuesAttachments.map((attachment) => attachment.offline_id)
|
|
7907
|
+
});
|
|
7908
|
+
promise.then(({ presigned_urls, attachments }) => {
|
|
7909
|
+
this.processPresignedUrls(presigned_urls);
|
|
7910
|
+
this.dispatch(updateIssueTypeFieldValuesAttachments(attachments));
|
|
7911
|
+
}).catch((error) => {
|
|
7912
|
+
this.dispatch(
|
|
7913
|
+
deleteIssueTypeFieldValuesAttachments(
|
|
7914
|
+
offlineIssueTypeFieldValuesAttachments.map((attachment) => attachment.offline_id)
|
|
7915
|
+
)
|
|
7916
|
+
);
|
|
7917
|
+
throw error;
|
|
7918
|
+
});
|
|
7919
|
+
return [offlineIssueTypeFieldValuesAttachments, promise.then(({ attachments }) => attachments)];
|
|
7920
|
+
}
|
|
7921
|
+
async bulkDelete(attachmentsIds) {
|
|
7922
|
+
const { store } = this.client;
|
|
7923
|
+
const state = store.getState();
|
|
7924
|
+
const formSubmissionAttachments = selectFormSubmissionAttachemntsByIds(attachmentsIds)(state);
|
|
7925
|
+
this.dispatch(deleteFormSubmissionAttachments(attachmentsIds));
|
|
7926
|
+
try {
|
|
7927
|
+
await this.enqueueRequest({
|
|
7928
|
+
description: "Delete issue type field values attachments",
|
|
7929
|
+
method: HttpMethod.DELETE,
|
|
7930
|
+
url: "/issue-type-field-values-attachments/bulk/",
|
|
7931
|
+
payload: { attachment_ids: attachmentsIds },
|
|
7932
|
+
blockers: attachmentsIds,
|
|
7933
|
+
blocks: []
|
|
7934
|
+
});
|
|
7935
|
+
} catch (e) {
|
|
7936
|
+
this.dispatch(addFormSubmissionAttachments(formSubmissionAttachments));
|
|
7937
|
+
throw e;
|
|
7938
|
+
}
|
|
7939
|
+
}
|
|
7940
|
+
async refreshStore(projectId) {
|
|
7941
|
+
const result = await this.enqueueRequest({
|
|
7942
|
+
description: "Get issue type field values attachments",
|
|
7943
|
+
method: HttpMethod.GET,
|
|
7944
|
+
url: "/issue-type-field-values-attachments/",
|
|
7945
|
+
queryParams: {
|
|
7946
|
+
project: projectId.toString()
|
|
7947
|
+
},
|
|
7948
|
+
blockers: [],
|
|
7949
|
+
blocks: []
|
|
7950
|
+
});
|
|
7951
|
+
this.dispatch(initializeIssueTypeFieldValuesAttachments(result));
|
|
7952
|
+
}
|
|
7953
|
+
}
|
|
7954
|
+
class IssueTypeFieldValuesService extends BaseApiService {
|
|
7955
|
+
add(payload) {
|
|
7956
|
+
var _a2;
|
|
7957
|
+
const { store } = this.client;
|
|
7958
|
+
const state = store.getState();
|
|
7959
|
+
const { values } = separateFilesFromValues(payload.values);
|
|
7960
|
+
const offlineIssueTypeFieldValues = offline({
|
|
7961
|
+
...payload,
|
|
7962
|
+
values,
|
|
7963
|
+
created_by: (_a2 = state.userReducer.currentUser) == null ? void 0 : _a2.id,
|
|
7964
|
+
submitted_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
7965
|
+
});
|
|
7966
|
+
const promise = this.enqueueRequest({
|
|
7967
|
+
description: "Add issue type field values",
|
|
7968
|
+
method: HttpMethod.POST,
|
|
7969
|
+
url: "/issue-type-field-values/",
|
|
7970
|
+
payload: offlineIssueTypeFieldValues,
|
|
7971
|
+
blockers: [payload.issue, payload.fields_revision],
|
|
7972
|
+
blocks: [offlineIssueTypeFieldValues.offline_id]
|
|
7973
|
+
});
|
|
7974
|
+
this.dispatch(addIssueTypeFieldValues(offlineIssueTypeFieldValues));
|
|
7975
|
+
promise.then((result) => {
|
|
7976
|
+
this.dispatch(updateIssueTypeFieldValues(result));
|
|
7977
|
+
return result;
|
|
7978
|
+
}).catch(() => {
|
|
7979
|
+
this.dispatch(deleteIssueTypeFieldValues(offlineIssueTypeFieldValues.offline_id));
|
|
7980
|
+
});
|
|
7981
|
+
return [offlineIssueTypeFieldValues, promise];
|
|
7982
|
+
}
|
|
7983
|
+
update(payload) {
|
|
7984
|
+
const { store } = this.client;
|
|
7985
|
+
const state = store.getState();
|
|
7986
|
+
const issueTypeFieldValues = selectIssueTypeFieldValuesById(payload.offline_id)(state);
|
|
7987
|
+
if (!issueTypeFieldValues) {
|
|
7988
|
+
throw new Error(`Expected IssueTypeFieldValues with offline_id ${payload.offline_id} to exist`);
|
|
7989
|
+
}
|
|
7990
|
+
const { values } = separateFilesFromValues(payload.values ?? {});
|
|
7991
|
+
const updatedIssueTypeFieldValues = {
|
|
7992
|
+
...issueTypeFieldValues,
|
|
7993
|
+
...payload,
|
|
7994
|
+
// values could also have a partial update
|
|
7995
|
+
values: {
|
|
7996
|
+
...issueTypeFieldValues.values,
|
|
7997
|
+
...values
|
|
7998
|
+
}
|
|
7999
|
+
};
|
|
8000
|
+
this.dispatch(updateIssueTypeFieldValues(updatedIssueTypeFieldValues));
|
|
8001
|
+
const promise = this.enqueueRequest({
|
|
8002
|
+
description: "Update issue type field values",
|
|
8003
|
+
method: HttpMethod.PATCH,
|
|
8004
|
+
url: `/issue-type-field-values/${payload.offline_id}/`,
|
|
8005
|
+
payload,
|
|
8006
|
+
blockers: [
|
|
8007
|
+
updatedIssueTypeFieldValues.offline_id,
|
|
8008
|
+
updatedIssueTypeFieldValues.fields_revision,
|
|
8009
|
+
updatedIssueTypeFieldValues.issue
|
|
8010
|
+
],
|
|
8011
|
+
blocks: [updatedIssueTypeFieldValues.offline_id]
|
|
8012
|
+
});
|
|
8013
|
+
promise.then((result) => {
|
|
8014
|
+
this.dispatch(updateIssueTypeFieldValues(result));
|
|
8015
|
+
}).catch(() => {
|
|
8016
|
+
this.dispatch(updateIssueTypeFieldValues(issueTypeFieldValues));
|
|
8017
|
+
});
|
|
8018
|
+
return [updatedIssueTypeFieldValues, promise];
|
|
8019
|
+
}
|
|
8020
|
+
async delete(id) {
|
|
8021
|
+
const { store } = this.client;
|
|
8022
|
+
const state = store.getState();
|
|
8023
|
+
const issueTypeFieldValues = selectIssueTypeFieldValuesById(id)(state);
|
|
8024
|
+
if (!issueTypeFieldValues) {
|
|
8025
|
+
throw new Error(`Expected submission with offline_id ${id} to exist`);
|
|
8026
|
+
}
|
|
8027
|
+
const issueTypeFieldValuesAttachments = selectAttachmentsOfIssueTypeFieldValues(id)(state);
|
|
8028
|
+
this.dispatch(deleteIssueTypeFieldValues(id));
|
|
8029
|
+
this.dispatch(deleteIssueTypeFieldValuesAttachments(issueTypeFieldValuesAttachments.map((x) => x.offline_id)));
|
|
8030
|
+
try {
|
|
8031
|
+
await this.enqueueRequest({
|
|
8032
|
+
description: "Delete issue type field values",
|
|
8033
|
+
method: HttpMethod.DELETE,
|
|
8034
|
+
url: `/issue-type-field-values/${id}/`,
|
|
8035
|
+
blockers: [id],
|
|
8036
|
+
blocks: []
|
|
8037
|
+
});
|
|
8038
|
+
} catch (e) {
|
|
8039
|
+
this.dispatch(addIssueTypeFieldValues(issueTypeFieldValues));
|
|
8040
|
+
this.dispatch(addIssueTypeFieldValuesAttachments(issueTypeFieldValuesAttachments));
|
|
8041
|
+
throw e;
|
|
8042
|
+
}
|
|
8043
|
+
}
|
|
8044
|
+
async refreshStore(projectId) {
|
|
8045
|
+
const result = await this.enqueueRequest({
|
|
8046
|
+
description: "Get issue type field values",
|
|
8047
|
+
method: HttpMethod.GET,
|
|
8048
|
+
url: "/issue-type-field-values/",
|
|
8049
|
+
queryParams: {
|
|
8050
|
+
project: projectId.toString()
|
|
8051
|
+
},
|
|
8052
|
+
blockers: [],
|
|
8053
|
+
blocks: []
|
|
8054
|
+
});
|
|
8055
|
+
this.dispatch(initializeIssueTypeFieldValues(result));
|
|
8056
|
+
}
|
|
8057
|
+
}
|
|
7330
8058
|
var VerificationCodeType = /* @__PURE__ */ ((VerificationCodeType2) => {
|
|
7331
8059
|
VerificationCodeType2[VerificationCodeType2["USER_REGISTRATION"] = 0] = "USER_REGISTRATION";
|
|
7332
8060
|
VerificationCodeType2[VerificationCodeType2["APPLICATION_INVITE"] = 2] = "APPLICATION_INVITE";
|
|
@@ -7344,6 +8072,10 @@ export {
|
|
|
7344
8072
|
AssetStageCompletionService,
|
|
7345
8073
|
AssetStageService,
|
|
7346
8074
|
AssetTypeAttachmentService,
|
|
8075
|
+
AssetTypeFieldValuesAttachmentService,
|
|
8076
|
+
AssetTypeFieldValuesService,
|
|
8077
|
+
AssetTypeFieldsAttachmentService,
|
|
8078
|
+
AssetTypeFieldsService,
|
|
7347
8079
|
AssetTypeService,
|
|
7348
8080
|
AttachmentModel,
|
|
7349
8081
|
BaseApiService,
|
|
@@ -7359,7 +8091,9 @@ export {
|
|
|
7359
8091
|
EmailDomainsService,
|
|
7360
8092
|
EmailVerificationService,
|
|
7361
8093
|
FileService,
|
|
8094
|
+
FormRevisionAttachmentService,
|
|
7362
8095
|
FormService,
|
|
8096
|
+
FormSubmissionAttachmentService,
|
|
7363
8097
|
FormSubmissionService,
|
|
7364
8098
|
GREEN,
|
|
7365
8099
|
GeoImageService,
|
|
@@ -7370,6 +8104,10 @@ export {
|
|
|
7370
8104
|
IssuePriority,
|
|
7371
8105
|
IssueService,
|
|
7372
8106
|
IssueStatus,
|
|
8107
|
+
IssueTypeFieldValuesAttachmentService,
|
|
8108
|
+
IssueTypeFieldValuesService,
|
|
8109
|
+
IssueTypeFieldsAttachmentService,
|
|
8110
|
+
IssueTypeFieldsService,
|
|
7373
8111
|
IssueTypeService,
|
|
7374
8112
|
IssueUpdateChange,
|
|
7375
8113
|
IssueUpdateService,
|
|
@@ -7409,6 +8147,14 @@ export {
|
|
|
7409
8147
|
addAssetType,
|
|
7410
8148
|
addAssetTypeAttachment,
|
|
7411
8149
|
addAssetTypeAttachments,
|
|
8150
|
+
addAssetTypeFieldValues,
|
|
8151
|
+
addAssetTypeFieldValuesAttachment,
|
|
8152
|
+
addAssetTypeFieldValuesAttachments,
|
|
8153
|
+
addAssetTypeFieldValuesMany,
|
|
8154
|
+
addAssetTypeFields,
|
|
8155
|
+
addAssetTypeFieldsAttachment,
|
|
8156
|
+
addAssetTypeFieldsAttachments,
|
|
8157
|
+
addAssetTypeFieldsMany,
|
|
7412
8158
|
addAssetTypes,
|
|
7413
8159
|
addAssets,
|
|
7414
8160
|
addCategory,
|
|
@@ -7437,6 +8183,14 @@ export {
|
|
|
7437
8183
|
addIssueComment,
|
|
7438
8184
|
addIssueComments,
|
|
7439
8185
|
addIssueType,
|
|
8186
|
+
addIssueTypeFieldValues,
|
|
8187
|
+
addIssueTypeFieldValuesAttachment,
|
|
8188
|
+
addIssueTypeFieldValuesAttachments,
|
|
8189
|
+
addIssueTypeFieldValuesMany,
|
|
8190
|
+
addIssueTypeFields,
|
|
8191
|
+
addIssueTypeFieldsAttachment,
|
|
8192
|
+
addIssueTypeFieldsAttachments,
|
|
8193
|
+
addIssueTypeFieldsMany,
|
|
7440
8194
|
addIssueUpdate,
|
|
7441
8195
|
addIssueUpdates,
|
|
7442
8196
|
addIssues,
|
|
@@ -7462,6 +8216,14 @@ export {
|
|
|
7462
8216
|
assetStageSlice,
|
|
7463
8217
|
assetTypeAttachmentReducer,
|
|
7464
8218
|
assetTypeAttachmentSlice,
|
|
8219
|
+
assetTypeFieldValuesAttachmentReducer,
|
|
8220
|
+
assetTypeFieldValuesAttachmentSlice,
|
|
8221
|
+
assetTypeFieldValuesReducer,
|
|
8222
|
+
assetTypeFieldValuesSlice,
|
|
8223
|
+
assetTypeFieldsAttachmentReducer,
|
|
8224
|
+
assetTypeFieldsAttachmentSlice,
|
|
8225
|
+
assetTypeFieldsReducer,
|
|
8226
|
+
assetTypeFieldsSlice,
|
|
7465
8227
|
assetTypeReducer,
|
|
7466
8228
|
assetTypeSlice,
|
|
7467
8229
|
authReducer,
|
|
@@ -7490,6 +8252,14 @@ export {
|
|
|
7490
8252
|
deleteAssetType,
|
|
7491
8253
|
deleteAssetTypeAttachment,
|
|
7492
8254
|
deleteAssetTypeAttachments,
|
|
8255
|
+
deleteAssetTypeFieldValues,
|
|
8256
|
+
deleteAssetTypeFieldValuesAttachment,
|
|
8257
|
+
deleteAssetTypeFieldValuesAttachments,
|
|
8258
|
+
deleteAssetTypeFieldValuesMany,
|
|
8259
|
+
deleteAssetTypeFields,
|
|
8260
|
+
deleteAssetTypeFieldsAttachment,
|
|
8261
|
+
deleteAssetTypeFieldsAttachments,
|
|
8262
|
+
deleteAssetTypeFieldsMany,
|
|
7493
8263
|
deleteAssetTypes,
|
|
7494
8264
|
deleteAssets,
|
|
7495
8265
|
deleteCategory,
|
|
@@ -7514,6 +8284,14 @@ export {
|
|
|
7514
8284
|
deleteIssueAttachments,
|
|
7515
8285
|
deleteIssueComment,
|
|
7516
8286
|
deleteIssueComments,
|
|
8287
|
+
deleteIssueTypeFieldValues,
|
|
8288
|
+
deleteIssueTypeFieldValuesAttachment,
|
|
8289
|
+
deleteIssueTypeFieldValuesAttachments,
|
|
8290
|
+
deleteIssueTypeFieldValuesMany,
|
|
8291
|
+
deleteIssueTypeFields,
|
|
8292
|
+
deleteIssueTypeFieldsAttachment,
|
|
8293
|
+
deleteIssueTypeFieldsAttachments,
|
|
8294
|
+
deleteIssueTypeFieldsMany,
|
|
7517
8295
|
deleteIssueUpdate,
|
|
7518
8296
|
deleteIssueUpdates,
|
|
7519
8297
|
deleteIssues,
|
|
@@ -7570,6 +8348,10 @@ export {
|
|
|
7570
8348
|
initializeAssetStageCompletions,
|
|
7571
8349
|
initializeAssetStages,
|
|
7572
8350
|
initializeAssetTypeAttachments,
|
|
8351
|
+
initializeAssetTypeFieldValues,
|
|
8352
|
+
initializeAssetTypeFieldValuesAttachments,
|
|
8353
|
+
initializeAssetTypeFields,
|
|
8354
|
+
initializeAssetTypeFieldsAttachments,
|
|
7573
8355
|
initializeAssetTypes,
|
|
7574
8356
|
initializeAssets,
|
|
7575
8357
|
initializeCategories,
|
|
@@ -7584,6 +8366,10 @@ export {
|
|
|
7584
8366
|
initializeGeoImages,
|
|
7585
8367
|
initializeIssueAssociations,
|
|
7586
8368
|
initializeIssueAttachments,
|
|
8369
|
+
initializeIssueTypeFieldValues,
|
|
8370
|
+
initializeIssueTypeFieldValuesAttachments,
|
|
8371
|
+
initializeIssueTypeFields,
|
|
8372
|
+
initializeIssueTypeFieldsAttachments,
|
|
7587
8373
|
initializeIssueTypes,
|
|
7588
8374
|
initializeIssueUpdates,
|
|
7589
8375
|
initializeIssues,
|
|
@@ -7602,6 +8388,14 @@ export {
|
|
|
7602
8388
|
issueCommentSlice,
|
|
7603
8389
|
issueReducer,
|
|
7604
8390
|
issueSlice,
|
|
8391
|
+
issueTypeFieldValuesAttachmentReducer,
|
|
8392
|
+
issueTypeFieldValuesAttachmentSlice,
|
|
8393
|
+
issueTypeFieldValuesReducer,
|
|
8394
|
+
issueTypeFieldValuesSlice,
|
|
8395
|
+
issueTypeFieldsAttachmentReducer,
|
|
8396
|
+
issueTypeFieldsAttachmentSlice,
|
|
8397
|
+
issueTypeFieldsReducer,
|
|
8398
|
+
issueTypeFieldsSlice,
|
|
7605
8399
|
issueTypeReducer,
|
|
7606
8400
|
issueTypeSlice,
|
|
7607
8401
|
issueUpdateReducer,
|
|
@@ -7674,6 +8468,20 @@ export {
|
|
|
7674
8468
|
selectAssetTypeAttachmentMapping,
|
|
7675
8469
|
selectAssetTypeAttachments,
|
|
7676
8470
|
selectAssetTypeById,
|
|
8471
|
+
selectAssetTypeFieldValues,
|
|
8472
|
+
selectAssetTypeFieldValuesAttachmentById,
|
|
8473
|
+
selectAssetTypeFieldValuesAttachments,
|
|
8474
|
+
selectAssetTypeFieldValuesAttachmentsMapping,
|
|
8475
|
+
selectAssetTypeFieldValuesById,
|
|
8476
|
+
selectAssetTypeFieldValuesMapping,
|
|
8477
|
+
selectAssetTypeFieldValuesOfAsset,
|
|
8478
|
+
selectAssetTypeFields,
|
|
8479
|
+
selectAssetTypeFieldsAttachmentById,
|
|
8480
|
+
selectAssetTypeFieldsAttachments,
|
|
8481
|
+
selectAssetTypeFieldsAttachmentsMapping,
|
|
8482
|
+
selectAssetTypeFieldsById,
|
|
8483
|
+
selectAssetTypeFieldsMapping,
|
|
8484
|
+
selectAssetTypeFieldsOfAssetType,
|
|
7677
8485
|
selectAssetTypeStagesMapping,
|
|
7678
8486
|
selectAssetTypes,
|
|
7679
8487
|
selectAssetTypesByIds,
|
|
@@ -7682,18 +8490,20 @@ export {
|
|
|
7682
8490
|
selectAssetsByIds,
|
|
7683
8491
|
selectAssetsMapping,
|
|
7684
8492
|
selectAssetsOfAssetType,
|
|
7685
|
-
selectAttachedFormSubmissionsOfAsset,
|
|
7686
|
-
selectAttachedFormSubmissionsOfIssue,
|
|
7687
8493
|
selectAttachmentsOfAsset,
|
|
7688
8494
|
selectAttachmentsOfAssetByType,
|
|
7689
8495
|
selectAttachmentsOfAssetType,
|
|
7690
8496
|
selectAttachmentsOfAssetTypeByType,
|
|
8497
|
+
selectAttachmentsOfAssetTypeFieldValues,
|
|
8498
|
+
selectAttachmentsOfAssetTypeFields,
|
|
7691
8499
|
selectAttachmentsOfDocument,
|
|
7692
8500
|
selectAttachmentsOfDocumentByType,
|
|
7693
8501
|
selectAttachmentsOfFormRevision,
|
|
7694
8502
|
selectAttachmentsOfFormSubmission,
|
|
7695
8503
|
selectAttachmentsOfIssue,
|
|
7696
8504
|
selectAttachmentsOfIssueByType,
|
|
8505
|
+
selectAttachmentsOfIssueTypeFieldValues,
|
|
8506
|
+
selectAttachmentsOfIssueTypeFields,
|
|
7697
8507
|
selectAttachmentsOfProject,
|
|
7698
8508
|
selectAttachmentsOfProjectByType,
|
|
7699
8509
|
selectCategories,
|
|
@@ -7721,8 +8531,6 @@ export {
|
|
|
7721
8531
|
selectFilteredForms,
|
|
7722
8532
|
selectFormById,
|
|
7723
8533
|
selectFormMapping,
|
|
7724
|
-
selectFormOfAssetType,
|
|
7725
|
-
selectFormOfIssueType,
|
|
7726
8534
|
selectFormRevisionAttachmentsMapping,
|
|
7727
8535
|
selectFormRevisionById,
|
|
7728
8536
|
selectFormRevisionMapping,
|
|
@@ -7732,9 +8540,7 @@ export {
|
|
|
7732
8540
|
selectFormSubmissionAttachmentsMapping,
|
|
7733
8541
|
selectFormSubmissionById,
|
|
7734
8542
|
selectFormSubmissions,
|
|
7735
|
-
selectFormSubmissionsByAssets,
|
|
7736
8543
|
selectFormSubmissionsByFormRevisions,
|
|
7737
|
-
selectFormSubmissionsByIssues,
|
|
7738
8544
|
selectFormSubmissionsMapping,
|
|
7739
8545
|
selectFormSubmissionsOfAsset,
|
|
7740
8546
|
selectFormSubmissionsOfForm,
|
|
@@ -7763,6 +8569,20 @@ export {
|
|
|
7763
8569
|
selectIssueCountOfCategory,
|
|
7764
8570
|
selectIssueMapping,
|
|
7765
8571
|
selectIssueTypeById,
|
|
8572
|
+
selectIssueTypeFieldValues,
|
|
8573
|
+
selectIssueTypeFieldValuesAttachmentById,
|
|
8574
|
+
selectIssueTypeFieldValuesAttachments,
|
|
8575
|
+
selectIssueTypeFieldValuesAttachmentsMapping,
|
|
8576
|
+
selectIssueTypeFieldValuesById,
|
|
8577
|
+
selectIssueTypeFieldValuesMapping,
|
|
8578
|
+
selectIssueTypeFieldValuesOfIssue,
|
|
8579
|
+
selectIssueTypeFields,
|
|
8580
|
+
selectIssueTypeFieldsAttachmentById,
|
|
8581
|
+
selectIssueTypeFieldsAttachments,
|
|
8582
|
+
selectIssueTypeFieldsAttachmentsMapping,
|
|
8583
|
+
selectIssueTypeFieldsById,
|
|
8584
|
+
selectIssueTypeFieldsMapping,
|
|
8585
|
+
selectIssueTypeFieldsOfIssueType,
|
|
7766
8586
|
selectIssueTypeMapping,
|
|
7767
8587
|
selectIssueTypes,
|
|
7768
8588
|
selectIssueTypesByIds,
|
|
@@ -7829,6 +8649,8 @@ export {
|
|
|
7829
8649
|
selectWorkspaceById,
|
|
7830
8650
|
selectWorkspaceMapping,
|
|
7831
8651
|
selectWorkspaces,
|
|
8652
|
+
separateFilesFromValues,
|
|
8653
|
+
separateImageFromFields,
|
|
7832
8654
|
setActiveProjectFileId,
|
|
7833
8655
|
setActiveProjectId,
|
|
7834
8656
|
setAsset,
|
|
@@ -7839,6 +8661,14 @@ export {
|
|
|
7839
8661
|
setAssetType,
|
|
7840
8662
|
setAssetTypeAttachment,
|
|
7841
8663
|
setAssetTypeAttachments,
|
|
8664
|
+
setAssetTypeFieldValues,
|
|
8665
|
+
setAssetTypeFieldValuesAttachment,
|
|
8666
|
+
setAssetTypeFieldValuesAttachments,
|
|
8667
|
+
setAssetTypeFieldValuesMany,
|
|
8668
|
+
setAssetTypeFields,
|
|
8669
|
+
setAssetTypeFieldsAttachment,
|
|
8670
|
+
setAssetTypeFieldsAttachments,
|
|
8671
|
+
setAssetTypeFieldsMany,
|
|
7842
8672
|
setAssetTypes,
|
|
7843
8673
|
setAssets,
|
|
7844
8674
|
setConversation,
|
|
@@ -7864,6 +8694,14 @@ export {
|
|
|
7864
8694
|
setIssueComment,
|
|
7865
8695
|
setIssueComments,
|
|
7866
8696
|
setIssueType,
|
|
8697
|
+
setIssueTypeFieldValues,
|
|
8698
|
+
setIssueTypeFieldValuesAttachment,
|
|
8699
|
+
setIssueTypeFieldValuesAttachments,
|
|
8700
|
+
setIssueTypeFieldValuesMany,
|
|
8701
|
+
setIssueTypeFields,
|
|
8702
|
+
setIssueTypeFieldsAttachment,
|
|
8703
|
+
setIssueTypeFieldsAttachments,
|
|
8704
|
+
setIssueTypeFieldsMany,
|
|
7867
8705
|
setIssueUpdate,
|
|
7868
8706
|
setLoggedIn,
|
|
7869
8707
|
setOrganizations,
|
|
@@ -7896,6 +8734,14 @@ export {
|
|
|
7896
8734
|
updateAssetType,
|
|
7897
8735
|
updateAssetTypeAttachment,
|
|
7898
8736
|
updateAssetTypeAttachments,
|
|
8737
|
+
updateAssetTypeFieldValues,
|
|
8738
|
+
updateAssetTypeFieldValuesAttachment,
|
|
8739
|
+
updateAssetTypeFieldValuesAttachments,
|
|
8740
|
+
updateAssetTypeFieldValuesMany,
|
|
8741
|
+
updateAssetTypeFields,
|
|
8742
|
+
updateAssetTypeFieldsAttachment,
|
|
8743
|
+
updateAssetTypeFieldsAttachments,
|
|
8744
|
+
updateAssetTypeFieldsMany,
|
|
7899
8745
|
updateAssetTypes,
|
|
7900
8746
|
updateAssets,
|
|
7901
8747
|
updateCategory,
|
|
@@ -7918,6 +8764,14 @@ export {
|
|
|
7918
8764
|
updateIssueAttachment,
|
|
7919
8765
|
updateIssueAttachments,
|
|
7920
8766
|
updateIssueType,
|
|
8767
|
+
updateIssueTypeFieldValues,
|
|
8768
|
+
updateIssueTypeFieldValuesAttachment,
|
|
8769
|
+
updateIssueTypeFieldValuesAttachments,
|
|
8770
|
+
updateIssueTypeFieldValuesMany,
|
|
8771
|
+
updateIssueTypeFields,
|
|
8772
|
+
updateIssueTypeFieldsAttachment,
|
|
8773
|
+
updateIssueTypeFieldsAttachments,
|
|
8774
|
+
updateIssueTypeFieldsMany,
|
|
7921
8775
|
updateLicense,
|
|
7922
8776
|
updateOrCreateProject,
|
|
7923
8777
|
updateOrganizationAccess,
|