@overmap-ai/core 1.0.49 → 1.0.50-bulk-form-submission.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/forms/renderer/FormSubmissionBrowser/FormSubmissionBrowser.d.ts +5 -5
- package/dist/forms/renderer/FormSubmissionViewer/FormSubmissionViewer.d.ts +3 -3
- package/dist/overmap-core.js +889 -454
- package/dist/overmap-core.js.map +1 -1
- package/dist/overmap-core.umd.cjs +889 -454
- package/dist/overmap-core.umd.cjs.map +1 -1
- package/dist/sdk/services/AttachmentService.d.ts +9 -7
- package/dist/sdk/services/UserFormSubmissionService.d.ts +9 -2
- package/dist/store/slices/categorySlice.d.ts +3 -1
- package/dist/store/slices/componentSlice.d.ts +1 -0
- package/dist/store/slices/componentTypeSlice.d.ts +1 -0
- package/dist/store/slices/documentSlice.d.ts +38 -3
- package/dist/store/slices/formRevisionSlice.d.ts +73 -0
- package/dist/store/slices/formSlice.d.ts +118 -0
- package/dist/store/slices/formSubmissionSlice.d.ts +47 -0
- package/dist/store/slices/index.d.ts +3 -1
- package/dist/store/slices/issueSlice.d.ts +13 -2
- package/dist/store/slices/projectFileSlice.d.ts +3 -1
- package/dist/store/slices/utils.d.ts +1 -0
- package/dist/store/slices/workspaceSlice.d.ts +3 -1
- package/dist/store/store.d.ts +10 -4
- package/dist/typings/files.d.ts +11 -1
- package/dist/typings/models/attachments.d.ts +11 -10
- package/dist/typings/models/base.d.ts +7 -0
- package/dist/typings/models/forms.d.ts +6 -11
- package/dist/utils/file.d.ts +2 -0
- package/package.json +1 -1
- package/dist/store/slices/userFormSlice.d.ts +0 -145
|
@@ -622,15 +622,15 @@ var __publicField = (obj, key, value) => {
|
|
|
622
622
|
};
|
|
623
623
|
const migrations = [initialVersioning, signOut, signOut, createOutboxState];
|
|
624
624
|
const manifest = Object.fromEntries(migrations.map((migration2, i) => [i, wrapMigration(migration2)]));
|
|
625
|
-
const initialState$
|
|
625
|
+
const initialState$p = {
|
|
626
626
|
accessToken: "",
|
|
627
627
|
refreshToken: "",
|
|
628
628
|
isLoggedIn: false
|
|
629
629
|
};
|
|
630
630
|
const authSlice = toolkit.createSlice({
|
|
631
631
|
name: "auth",
|
|
632
|
-
initialState: initialState$
|
|
633
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
632
|
+
initialState: initialState$p,
|
|
633
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$p)),
|
|
634
634
|
reducers: {
|
|
635
635
|
setTokens: (state, action) => {
|
|
636
636
|
state.accessToken = action.payload.accessToken;
|
|
@@ -795,6 +795,19 @@ var __publicField = (obj, key, value) => {
|
|
|
795
795
|
element.click();
|
|
796
796
|
document.body.removeChild(element);
|
|
797
797
|
}
|
|
798
|
+
const constructUploadedFilePayloads = async (files) => {
|
|
799
|
+
const filePayloads = {};
|
|
800
|
+
for (const file of files) {
|
|
801
|
+
const sha1 = await hashFile(file);
|
|
802
|
+
filePayloads[sha1] = {
|
|
803
|
+
sha1,
|
|
804
|
+
extension: file.name.split(".").pop() || "",
|
|
805
|
+
file_type: file.type,
|
|
806
|
+
size: file.size
|
|
807
|
+
};
|
|
808
|
+
}
|
|
809
|
+
return Object.values(filePayloads);
|
|
810
|
+
};
|
|
798
811
|
const fileToBlob = async (dataUrl) => {
|
|
799
812
|
return (await fetch(dataUrl)).blob();
|
|
800
813
|
};
|
|
@@ -1361,7 +1374,7 @@ var __publicField = (obj, key, value) => {
|
|
|
1361
1374
|
return getLocalDateString(date);
|
|
1362
1375
|
return relative.format(days, "days");
|
|
1363
1376
|
});
|
|
1364
|
-
const initialState$
|
|
1377
|
+
const initialState$o = {
|
|
1365
1378
|
categories: {},
|
|
1366
1379
|
usedCategoryColors: [],
|
|
1367
1380
|
categoryVisibility: {
|
|
@@ -1371,8 +1384,8 @@ var __publicField = (obj, key, value) => {
|
|
|
1371
1384
|
};
|
|
1372
1385
|
const categorySlice = toolkit.createSlice({
|
|
1373
1386
|
name: "categories",
|
|
1374
|
-
initialState: initialState$
|
|
1375
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1387
|
+
initialState: initialState$o,
|
|
1388
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$o)),
|
|
1376
1389
|
reducers: {
|
|
1377
1390
|
setCategories: (state, action) => {
|
|
1378
1391
|
if (!Array.isArray(action.payload))
|
|
@@ -1506,6 +1519,7 @@ var __publicField = (obj, key, value) => {
|
|
|
1506
1519
|
};
|
|
1507
1520
|
const categoryReducer = categorySlice.reducer;
|
|
1508
1521
|
function setAttachments(state, action) {
|
|
1522
|
+
state.attachments = {};
|
|
1509
1523
|
for (const attachment of action.payload) {
|
|
1510
1524
|
state.attachments[attachment.offline_id] = attachment;
|
|
1511
1525
|
}
|
|
@@ -1528,6 +1542,15 @@ var __publicField = (obj, key, value) => {
|
|
|
1528
1542
|
throw new Error(`Attachment ${action.payload.offline_id} does not exist.`);
|
|
1529
1543
|
}
|
|
1530
1544
|
}
|
|
1545
|
+
function updateAttachments(state, action) {
|
|
1546
|
+
for (const attachment of action.payload) {
|
|
1547
|
+
if (attachment.offline_id in state.attachments) {
|
|
1548
|
+
state.attachments[attachment.offline_id] = attachment;
|
|
1549
|
+
} else {
|
|
1550
|
+
throw new Error(`Attachment ${attachment.offline_id} does not exist.`);
|
|
1551
|
+
}
|
|
1552
|
+
}
|
|
1553
|
+
}
|
|
1531
1554
|
function removeAttachment(state, action) {
|
|
1532
1555
|
if (action.payload in state.attachments) {
|
|
1533
1556
|
delete state.attachments[action.payload];
|
|
@@ -1540,14 +1563,14 @@ var __publicField = (obj, key, value) => {
|
|
|
1540
1563
|
delete state.attachments[attachmentId];
|
|
1541
1564
|
}
|
|
1542
1565
|
}
|
|
1543
|
-
const initialState$
|
|
1566
|
+
const initialState$n = {
|
|
1544
1567
|
components: {},
|
|
1545
1568
|
attachments: {}
|
|
1546
1569
|
};
|
|
1547
1570
|
const componentSlice = toolkit.createSlice({
|
|
1548
1571
|
name: "components",
|
|
1549
|
-
initialState: initialState$
|
|
1550
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1572
|
+
initialState: initialState$n,
|
|
1573
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$n)),
|
|
1551
1574
|
reducers: {
|
|
1552
1575
|
addComponent: (state, action) => {
|
|
1553
1576
|
state.components[action.payload.offline_id] = action.payload;
|
|
@@ -1660,6 +1683,9 @@ var __publicField = (obj, key, value) => {
|
|
|
1660
1683
|
[selectComponentAttachmentMapping],
|
|
1661
1684
|
(mapping) => Object.values(mapping)
|
|
1662
1685
|
);
|
|
1686
|
+
const selectComponentAttachment = (attachmentId) => (state) => {
|
|
1687
|
+
return state.componentReducer.attachments[attachmentId];
|
|
1688
|
+
};
|
|
1663
1689
|
const selectAttachmentsOfComponent = restructureCreateSelectorWithArgs(
|
|
1664
1690
|
toolkit.createSelector(
|
|
1665
1691
|
[selectAllComponentAttachments, (_state, componentId) => componentId],
|
|
@@ -1700,13 +1726,13 @@ var __publicField = (obj, key, value) => {
|
|
|
1700
1726
|
removeAllComponentsOfType
|
|
1701
1727
|
} = componentSlice.actions;
|
|
1702
1728
|
const componentReducer = componentSlice.reducer;
|
|
1703
|
-
const initialState$
|
|
1729
|
+
const initialState$m = {
|
|
1704
1730
|
completionsByComponentId: {}
|
|
1705
1731
|
};
|
|
1706
1732
|
const componentStageCompletionSlice = toolkit.createSlice({
|
|
1707
1733
|
name: "componentStageCompletions",
|
|
1708
|
-
initialState: initialState$
|
|
1709
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1734
|
+
initialState: initialState$m,
|
|
1735
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$m)),
|
|
1710
1736
|
reducers: {
|
|
1711
1737
|
addStageCompletion: (state, action) => {
|
|
1712
1738
|
let stageToCompletionDateMapping = state.completionsByComponentId[action.payload.component];
|
|
@@ -1757,13 +1783,13 @@ var __publicField = (obj, key, value) => {
|
|
|
1757
1783
|
return Object.keys(state.componentStageCompletionReducer.completionsByComponentId[component.offline_id] ?? {});
|
|
1758
1784
|
};
|
|
1759
1785
|
const componentStageCompletionReducer = componentStageCompletionSlice.reducer;
|
|
1760
|
-
const initialState$
|
|
1786
|
+
const initialState$l = {
|
|
1761
1787
|
stages: {}
|
|
1762
1788
|
};
|
|
1763
1789
|
const componentStageSlice = toolkit.createSlice({
|
|
1764
1790
|
name: "componentStages",
|
|
1765
|
-
initialState: initialState$
|
|
1766
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1791
|
+
initialState: initialState$l,
|
|
1792
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$l)),
|
|
1767
1793
|
reducers: {
|
|
1768
1794
|
addStages: (state, action) => {
|
|
1769
1795
|
Object.assign(state.stages, toOfflineIdRecord(action.payload));
|
|
@@ -1873,15 +1899,15 @@ var __publicField = (obj, key, value) => {
|
|
|
1873
1899
|
);
|
|
1874
1900
|
const { addStages, updateStages, removeStages, linkStageToForm, unlinkStageToForm } = componentStageSlice.actions;
|
|
1875
1901
|
const componentStageReducer = componentStageSlice.reducer;
|
|
1876
|
-
const initialState$
|
|
1902
|
+
const initialState$k = {
|
|
1877
1903
|
componentTypes: {},
|
|
1878
1904
|
hiddenComponentTypeIds: {},
|
|
1879
1905
|
attachments: {}
|
|
1880
1906
|
};
|
|
1881
1907
|
const componentTypeSlice = toolkit.createSlice({
|
|
1882
1908
|
name: "componentTypes",
|
|
1883
|
-
initialState: initialState$
|
|
1884
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1909
|
+
initialState: initialState$k,
|
|
1910
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$k)),
|
|
1885
1911
|
reducers: {
|
|
1886
1912
|
addComponentType: (state, action) => {
|
|
1887
1913
|
state.componentTypes[action.payload.offline_id] = action.payload;
|
|
@@ -1949,6 +1975,9 @@ var __publicField = (obj, key, value) => {
|
|
|
1949
1975
|
[selectComponentTypeAttachmentMapping],
|
|
1950
1976
|
(mapping) => Object.values(mapping)
|
|
1951
1977
|
);
|
|
1978
|
+
const selectComponentTypeAttachment = (attachmentId) => (state) => {
|
|
1979
|
+
return state.componentTypeReducer.attachments[attachmentId];
|
|
1980
|
+
};
|
|
1952
1981
|
const selectAttachmentsOfComponentType = restructureCreateSelectorWithArgs(
|
|
1953
1982
|
toolkit.createSelector(
|
|
1954
1983
|
[selectAllComponentTypeAttachments, (_state, componentTypeId) => componentTypeId],
|
|
@@ -1989,13 +2018,13 @@ var __publicField = (obj, key, value) => {
|
|
|
1989
2018
|
deleteComponentType
|
|
1990
2019
|
} = componentTypeSlice.actions;
|
|
1991
2020
|
const componentTypeReducer = componentTypeSlice.reducer;
|
|
1992
|
-
const initialState$
|
|
2021
|
+
const initialState$j = {
|
|
1993
2022
|
workspaces: {},
|
|
1994
2023
|
activeWorkspaceId: null
|
|
1995
2024
|
};
|
|
1996
2025
|
const workspaceSlice = toolkit.createSlice({
|
|
1997
2026
|
name: "workspace",
|
|
1998
|
-
initialState: initialState$
|
|
2027
|
+
initialState: initialState$j,
|
|
1999
2028
|
// The `reducers` field lets us define reducers and generate associated actions
|
|
2000
2029
|
reducers: {
|
|
2001
2030
|
setWorkspaces: (state, action) => {
|
|
@@ -2052,7 +2081,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2052
2081
|
);
|
|
2053
2082
|
const workspaceReducer = workspaceSlice.reducer;
|
|
2054
2083
|
const maxRecentIssues = 10;
|
|
2055
|
-
const initialState$
|
|
2084
|
+
const initialState$i = {
|
|
2056
2085
|
issues: {},
|
|
2057
2086
|
attachments: {},
|
|
2058
2087
|
comments: {},
|
|
@@ -2064,9 +2093,9 @@ var __publicField = (obj, key, value) => {
|
|
|
2064
2093
|
};
|
|
2065
2094
|
const issueSlice = toolkit.createSlice({
|
|
2066
2095
|
name: "issues",
|
|
2067
|
-
initialState: initialState$
|
|
2096
|
+
initialState: initialState$i,
|
|
2068
2097
|
extraReducers: (builder) => builder.addCase("RESET", (state) => {
|
|
2069
|
-
Object.assign(state, initialState$
|
|
2098
|
+
Object.assign(state, initialState$i);
|
|
2070
2099
|
}),
|
|
2071
2100
|
reducers: {
|
|
2072
2101
|
setIssues: (state, action) => {
|
|
@@ -2121,6 +2150,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2121
2150
|
}
|
|
2122
2151
|
},
|
|
2123
2152
|
updateIssueAttachment: updateAttachment,
|
|
2153
|
+
updateIssueAttachments: updateAttachments,
|
|
2124
2154
|
removeIssue: (state, action) => {
|
|
2125
2155
|
if (action.payload in state.issues) {
|
|
2126
2156
|
delete state.issues[action.payload];
|
|
@@ -2129,6 +2159,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2129
2159
|
}
|
|
2130
2160
|
},
|
|
2131
2161
|
removeIssueAttachment: removeAttachment,
|
|
2162
|
+
removeIssueAttachments: removeAttachments,
|
|
2132
2163
|
removeIssueUpdate: (state, action) => {
|
|
2133
2164
|
if (action.payload in state.updates) {
|
|
2134
2165
|
delete state.updates[action.payload];
|
|
@@ -2238,6 +2269,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2238
2269
|
addToRecentIssues,
|
|
2239
2270
|
cleanRecentIssues,
|
|
2240
2271
|
removeIssueAttachment,
|
|
2272
|
+
removeIssueAttachments,
|
|
2241
2273
|
removeAttachmentsOfIssue,
|
|
2242
2274
|
removeIssue,
|
|
2243
2275
|
removeIssueUpdate,
|
|
@@ -2251,6 +2283,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2251
2283
|
setVisibleStatuses,
|
|
2252
2284
|
setVisibleUserIds,
|
|
2253
2285
|
updateIssueAttachment,
|
|
2286
|
+
updateIssueAttachments,
|
|
2254
2287
|
updateIssue,
|
|
2255
2288
|
// Commments
|
|
2256
2289
|
addIssueComment,
|
|
@@ -2343,6 +2376,9 @@ var __publicField = (obj, key, value) => {
|
|
|
2343
2376
|
}
|
|
2344
2377
|
)
|
|
2345
2378
|
);
|
|
2379
|
+
const selectIssueAttachment = (attachmentId) => (root) => {
|
|
2380
|
+
return root.issueReducer.attachments[attachmentId];
|
|
2381
|
+
};
|
|
2346
2382
|
const selectAttachmentsOfIssueByType = restructureCreateSelectorWithArgs(
|
|
2347
2383
|
toolkit.createSelector(
|
|
2348
2384
|
[selectIssueAttachments, (_state, issueId) => issueId],
|
|
@@ -2471,15 +2507,15 @@ var __publicField = (obj, key, value) => {
|
|
|
2471
2507
|
}
|
|
2472
2508
|
);
|
|
2473
2509
|
const issueReducer = issueSlice.reducer;
|
|
2474
|
-
const initialState$
|
|
2510
|
+
const initialState$h = {
|
|
2475
2511
|
s3Urls: {}
|
|
2476
2512
|
};
|
|
2477
2513
|
const msPerHour = 1e3 * 60 * 60;
|
|
2478
2514
|
const msPerWeek = msPerHour * 24 * 7;
|
|
2479
2515
|
const fileSlice = toolkit.createSlice({
|
|
2480
2516
|
name: "file",
|
|
2481
|
-
initialState: initialState$
|
|
2482
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2517
|
+
initialState: initialState$h,
|
|
2518
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$h)),
|
|
2483
2519
|
reducers: {
|
|
2484
2520
|
setUploadUrl: (state, action) => {
|
|
2485
2521
|
const { url, fields, sha1 } = action.payload;
|
|
@@ -2506,7 +2542,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2506
2542
|
return url;
|
|
2507
2543
|
};
|
|
2508
2544
|
const fileReducer = fileSlice.reducer;
|
|
2509
|
-
const initialState$
|
|
2545
|
+
const initialState$g = {
|
|
2510
2546
|
// TODO: Change first MapStyle.SATELLITE to MaptStyle.None when project creation map is fixed
|
|
2511
2547
|
mapStyle: MapStyle.SATELLITE,
|
|
2512
2548
|
showTooltips: false,
|
|
@@ -2514,8 +2550,8 @@ var __publicField = (obj, key, value) => {
|
|
|
2514
2550
|
};
|
|
2515
2551
|
const mapSlice = toolkit.createSlice({
|
|
2516
2552
|
name: "map",
|
|
2517
|
-
initialState: initialState$
|
|
2518
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2553
|
+
initialState: initialState$g,
|
|
2554
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$g)),
|
|
2519
2555
|
reducers: {
|
|
2520
2556
|
setMapStyle: (state, action) => {
|
|
2521
2557
|
state.mapStyle = action.payload;
|
|
@@ -2584,7 +2620,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2584
2620
|
LicenseStatus2[LicenseStatus2["PAST_DUE"] = 8] = "PAST_DUE";
|
|
2585
2621
|
return LicenseStatus2;
|
|
2586
2622
|
})(LicenseStatus || {});
|
|
2587
|
-
const initialState$
|
|
2623
|
+
const initialState$f = {
|
|
2588
2624
|
users: {},
|
|
2589
2625
|
currentUser: {
|
|
2590
2626
|
id: 0,
|
|
@@ -2595,8 +2631,8 @@ var __publicField = (obj, key, value) => {
|
|
|
2595
2631
|
};
|
|
2596
2632
|
const userSlice = toolkit.createSlice({
|
|
2597
2633
|
name: "users",
|
|
2598
|
-
initialState: initialState$
|
|
2599
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2634
|
+
initialState: initialState$f,
|
|
2635
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$f)),
|
|
2600
2636
|
reducers: {
|
|
2601
2637
|
setUsers: (state, action) => {
|
|
2602
2638
|
const usersMapping = {};
|
|
@@ -2658,13 +2694,13 @@ var __publicField = (obj, key, value) => {
|
|
|
2658
2694
|
const selectUsersAsMapping = (state) => state.userReducer.users;
|
|
2659
2695
|
const selectFavouriteProjects = (state) => state.userReducer.currentUser.profile.favourite_project_ids;
|
|
2660
2696
|
const userReducer = userSlice.reducer;
|
|
2661
|
-
const initialState$
|
|
2697
|
+
const initialState$e = {
|
|
2662
2698
|
organizationAccesses: {}
|
|
2663
2699
|
};
|
|
2664
2700
|
const organizationAccessSlice = toolkit.createSlice({
|
|
2665
2701
|
name: "organizationAccess",
|
|
2666
|
-
initialState: initialState$
|
|
2667
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2702
|
+
initialState: initialState$e,
|
|
2703
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$e)),
|
|
2668
2704
|
reducers: {
|
|
2669
2705
|
setOrganizationAccesses: (state, action) => {
|
|
2670
2706
|
if (!Array.isArray(action.payload))
|
|
@@ -2727,13 +2763,13 @@ var __publicField = (obj, key, value) => {
|
|
|
2727
2763
|
return organizationAccesses;
|
|
2728
2764
|
};
|
|
2729
2765
|
const organizationAccessReducer = organizationAccessSlice.reducer;
|
|
2730
|
-
const initialState$
|
|
2766
|
+
const initialState$d = {
|
|
2731
2767
|
licenses: {}
|
|
2732
2768
|
};
|
|
2733
2769
|
const licenseSlice = toolkit.createSlice({
|
|
2734
2770
|
name: "license",
|
|
2735
|
-
initialState: initialState$
|
|
2736
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2771
|
+
initialState: initialState$d,
|
|
2772
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$d)),
|
|
2737
2773
|
reducers: {
|
|
2738
2774
|
setLicenses: (state, action) => {
|
|
2739
2775
|
if (!Array.isArray(action.payload))
|
|
@@ -2778,13 +2814,13 @@ var __publicField = (obj, key, value) => {
|
|
|
2778
2814
|
(licenses) => Object.values(licenses).filter((license) => license.project).reduce((accum, license) => ({ ...accum, [license.project]: license }), {})
|
|
2779
2815
|
);
|
|
2780
2816
|
const licenseReducer = licenseSlice.reducer;
|
|
2781
|
-
const initialState$
|
|
2817
|
+
const initialState$c = {
|
|
2782
2818
|
projectAccesses: {}
|
|
2783
2819
|
};
|
|
2784
2820
|
const projectAccessSlice = toolkit.createSlice({
|
|
2785
2821
|
name: "projectAccess",
|
|
2786
|
-
initialState: initialState$
|
|
2787
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2822
|
+
initialState: initialState$c,
|
|
2823
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$c)),
|
|
2788
2824
|
reducers: {
|
|
2789
2825
|
setProjectAccesses: (state, action) => {
|
|
2790
2826
|
if (!Array.isArray(action.payload))
|
|
@@ -2852,7 +2888,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2852
2888
|
return projectAccesses;
|
|
2853
2889
|
};
|
|
2854
2890
|
const projectAccessReducer = projectAccessSlice.reducer;
|
|
2855
|
-
const initialState$
|
|
2891
|
+
const initialState$b = {
|
|
2856
2892
|
projects: {},
|
|
2857
2893
|
activeProjectId: null,
|
|
2858
2894
|
recentProjectIds: [],
|
|
@@ -2862,7 +2898,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2862
2898
|
};
|
|
2863
2899
|
const projectSlice = toolkit.createSlice({
|
|
2864
2900
|
name: "projects",
|
|
2865
|
-
initialState: initialState$
|
|
2901
|
+
initialState: initialState$b,
|
|
2866
2902
|
reducers: {
|
|
2867
2903
|
setProjects: (state, action) => {
|
|
2868
2904
|
const projectsMap = {};
|
|
@@ -3049,14 +3085,14 @@ var __publicField = (obj, key, value) => {
|
|
|
3049
3085
|
}
|
|
3050
3086
|
)
|
|
3051
3087
|
);
|
|
3052
|
-
const initialState$
|
|
3088
|
+
const initialState$a = {
|
|
3053
3089
|
organizations: {},
|
|
3054
3090
|
activeOrganizationId: null
|
|
3055
3091
|
};
|
|
3056
3092
|
const organizationSlice = toolkit.createSlice({
|
|
3057
3093
|
name: "organizations",
|
|
3058
|
-
initialState: initialState$
|
|
3059
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
3094
|
+
initialState: initialState$a,
|
|
3095
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$a)),
|
|
3060
3096
|
reducers: {
|
|
3061
3097
|
setOrganizations: (state, action) => {
|
|
3062
3098
|
for (const org of action.payload) {
|
|
@@ -3175,14 +3211,14 @@ var __publicField = (obj, key, value) => {
|
|
|
3175
3211
|
}
|
|
3176
3212
|
};
|
|
3177
3213
|
};
|
|
3178
|
-
const initialState$
|
|
3214
|
+
const initialState$9 = {
|
|
3179
3215
|
deletedRequests: [],
|
|
3180
3216
|
latestRetryTime: 0
|
|
3181
3217
|
};
|
|
3182
3218
|
const outboxSlice = toolkit.createSlice({
|
|
3183
3219
|
name: "outbox",
|
|
3184
|
-
initialState: initialState$
|
|
3185
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
3220
|
+
initialState: initialState$9,
|
|
3221
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$9)),
|
|
3186
3222
|
reducers: {
|
|
3187
3223
|
// enqueueActions is a reducer that does nothing but enqueue API request to the Redux Offline outbox
|
|
3188
3224
|
// Whenever an issue is being created, a reducer addIssue() is responsible for adding it to the offline store
|
|
@@ -3214,7 +3250,7 @@ var __publicField = (obj, key, value) => {
|
|
|
3214
3250
|
const selectLatestRetryTime = (state) => state.outboxReducer.latestRetryTime;
|
|
3215
3251
|
const { enqueueRequest, markForDeletion, markAsDeleted, _setLatestRetryTime } = outboxSlice.actions;
|
|
3216
3252
|
const outboxReducer = outboxSlice.reducer;
|
|
3217
|
-
const initialState$
|
|
3253
|
+
const initialState$8 = {
|
|
3218
3254
|
projectFiles: {},
|
|
3219
3255
|
activeProjectFileId: null,
|
|
3220
3256
|
isImportingProjectFile: false,
|
|
@@ -3222,8 +3258,8 @@ var __publicField = (obj, key, value) => {
|
|
|
3222
3258
|
};
|
|
3223
3259
|
const projectFileSlice = toolkit.createSlice({
|
|
3224
3260
|
name: "projectFiles",
|
|
3225
|
-
initialState: initialState$
|
|
3226
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
3261
|
+
initialState: initialState$8,
|
|
3262
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$8)),
|
|
3227
3263
|
reducers: {
|
|
3228
3264
|
addOrReplaceProjectFiles: (state, action) => {
|
|
3229
3265
|
for (let fileObj of action.payload) {
|
|
@@ -3324,12 +3360,12 @@ var __publicField = (obj, key, value) => {
|
|
|
3324
3360
|
const selectActiveProjectFileId = (state) => state.projectFileReducer.activeProjectFileId;
|
|
3325
3361
|
const selectIsImportingProjectFile = (state) => state.projectFileReducer.isImportingProjectFile;
|
|
3326
3362
|
const projectFileReducer = projectFileSlice.reducer;
|
|
3327
|
-
const initialState$
|
|
3363
|
+
const initialState$7 = {
|
|
3328
3364
|
isRehydrated: false
|
|
3329
3365
|
};
|
|
3330
3366
|
const rehydratedSlice = toolkit.createSlice({
|
|
3331
3367
|
name: "rehydrated",
|
|
3332
|
-
initialState: initialState$
|
|
3368
|
+
initialState: initialState$7,
|
|
3333
3369
|
// The `reducers` field lets us define reducers and generate associated actions
|
|
3334
3370
|
reducers: {
|
|
3335
3371
|
setRehydrated: (state, action) => {
|
|
@@ -3339,7 +3375,7 @@ var __publicField = (obj, key, value) => {
|
|
|
3339
3375
|
});
|
|
3340
3376
|
const selectRehydrated = (state) => state.rehydratedReducer.isRehydrated;
|
|
3341
3377
|
const rehydratedReducer = rehydratedSlice.reducer;
|
|
3342
|
-
const initialState$
|
|
3378
|
+
const initialState$6 = {
|
|
3343
3379
|
useIssueTemplate: false,
|
|
3344
3380
|
placementMode: false,
|
|
3345
3381
|
enableClustering: false,
|
|
@@ -3356,8 +3392,8 @@ var __publicField = (obj, key, value) => {
|
|
|
3356
3392
|
};
|
|
3357
3393
|
const settingSlice = toolkit.createSlice({
|
|
3358
3394
|
name: "settings",
|
|
3359
|
-
initialState: initialState$
|
|
3360
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
3395
|
+
initialState: initialState$6,
|
|
3396
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$6)),
|
|
3361
3397
|
reducers: {
|
|
3362
3398
|
setEnableDuplicateIssues: (state, action) => {
|
|
3363
3399
|
state.useIssueTemplate = action.payload;
|
|
@@ -3403,146 +3439,248 @@ var __publicField = (obj, key, value) => {
|
|
|
3403
3439
|
const settingReducer = settingSlice.reducer;
|
|
3404
3440
|
const selectIsFetchingInitialData = (state) => state.settingReducer.isFetchingInitialData;
|
|
3405
3441
|
const selectIsLoading = (state) => state.settingReducer.isLoading;
|
|
3406
|
-
const
|
|
3407
|
-
function
|
|
3442
|
+
const LATEST_FORM_REVISION_CACHE = {};
|
|
3443
|
+
function considerCachingFormRevision(formRevision, formId2, preferPending = false) {
|
|
3408
3444
|
var _a2;
|
|
3409
|
-
if (!
|
|
3445
|
+
if (!formRevision) {
|
|
3410
3446
|
if (!formId2) {
|
|
3411
|
-
throw new Error("If revision is null, formId is required.");
|
|
3447
|
+
throw new Error("If form revision is null, formId is required.");
|
|
3412
3448
|
}
|
|
3413
|
-
const
|
|
3414
|
-
if (
|
|
3449
|
+
const currentLatestFormRevision = getLatestFormRevisionFromCache(formId2);
|
|
3450
|
+
if (currentLatestFormRevision)
|
|
3415
3451
|
return;
|
|
3416
|
-
|
|
3452
|
+
LATEST_FORM_REVISION_CACHE[formId2] = null;
|
|
3417
3453
|
return;
|
|
3418
3454
|
}
|
|
3419
|
-
if (
|
|
3455
|
+
if (formRevision.revision === "Pending") {
|
|
3420
3456
|
if (preferPending) {
|
|
3421
|
-
|
|
3457
|
+
LATEST_FORM_REVISION_CACHE[formRevision.form] = formRevision;
|
|
3422
3458
|
}
|
|
3423
3459
|
return;
|
|
3424
3460
|
}
|
|
3425
|
-
const
|
|
3426
|
-
if (
|
|
3427
|
-
|
|
3461
|
+
const cachedFormRevision = (_a2 = LATEST_FORM_REVISION_CACHE[formRevision.form]) == null ? void 0 : _a2.revision;
|
|
3462
|
+
if (formRevision.revision > (typeof cachedFormRevision === "number" ? cachedFormRevision : -1)) {
|
|
3463
|
+
LATEST_FORM_REVISION_CACHE[formRevision.form] = formRevision;
|
|
3428
3464
|
}
|
|
3429
3465
|
}
|
|
3430
|
-
function
|
|
3431
|
-
return
|
|
3466
|
+
function getLatestFormRevisionFromCache(formId2) {
|
|
3467
|
+
return LATEST_FORM_REVISION_CACHE[formId2];
|
|
3432
3468
|
}
|
|
3433
|
-
const initialState$
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
name: "userForms",
|
|
3442
|
-
initialState: initialState$3,
|
|
3443
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$3)),
|
|
3469
|
+
const initialState$5 = {
|
|
3470
|
+
formRevisions: {},
|
|
3471
|
+
attachments: {}
|
|
3472
|
+
};
|
|
3473
|
+
const formRevisionsSlice = toolkit.createSlice({
|
|
3474
|
+
name: "formRevisions",
|
|
3475
|
+
initialState: initialState$5,
|
|
3476
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$5)),
|
|
3444
3477
|
reducers: {
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
action.payload.
|
|
3448
|
-
|
|
3449
|
-
});
|
|
3450
|
-
},
|
|
3451
|
-
addUserForm: (state, action) => {
|
|
3452
|
-
state.userForms[action.payload.offline_id] = action.payload;
|
|
3478
|
+
// revision related actions
|
|
3479
|
+
setFormRevision: (state, action) => {
|
|
3480
|
+
state.formRevisions[action.payload.offline_id] = action.payload;
|
|
3481
|
+
considerCachingFormRevision(action.payload);
|
|
3453
3482
|
},
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
action.payload.forEach((userFormRevision) => {
|
|
3461
|
-
state.revisions[userFormRevision.offline_id] = userFormRevision;
|
|
3462
|
-
considerCachingRevision(userFormRevision);
|
|
3463
|
-
});
|
|
3464
|
-
},
|
|
3465
|
-
addUserFormRevision: (state, action) => {
|
|
3466
|
-
state.revisions[action.payload.offline_id] = action.payload;
|
|
3467
|
-
considerCachingRevision(action.payload);
|
|
3483
|
+
setFormRevisions: (state, action) => {
|
|
3484
|
+
state.formRevisions = {};
|
|
3485
|
+
for (const revision of action.payload) {
|
|
3486
|
+
state.formRevisions[revision.offline_id] = revision;
|
|
3487
|
+
considerCachingFormRevision(revision);
|
|
3488
|
+
}
|
|
3468
3489
|
},
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3490
|
+
addFormRevision: (state, action) => {
|
|
3491
|
+
if (state.formRevisions[action.payload.offline_id] !== void 0) {
|
|
3492
|
+
throw new Error(`Revision with offline_id ${action.payload.offline_id} already exists`);
|
|
3493
|
+
}
|
|
3494
|
+
state.formRevisions[action.payload.offline_id] = action.payload;
|
|
3495
|
+
considerCachingFormRevision(action.payload);
|
|
3472
3496
|
},
|
|
3473
|
-
|
|
3497
|
+
// TODO: @Audiopolis / Magnus - do we want to standardize using PayloadAction?
|
|
3498
|
+
addFormRevisions: (state, action) => {
|
|
3474
3499
|
for (const userFormRevision of action.payload) {
|
|
3475
|
-
|
|
3476
|
-
|
|
3500
|
+
if (state.formRevisions[userFormRevision.offline_id] !== void 0) {
|
|
3501
|
+
throw new Error(`Revision with offline_id ${userFormRevision.offline_id} already exists`);
|
|
3502
|
+
}
|
|
3503
|
+
}
|
|
3504
|
+
for (const userFormRevision of action.payload) {
|
|
3505
|
+
state.formRevisions[userFormRevision.offline_id] = userFormRevision;
|
|
3506
|
+
considerCachingFormRevision(userFormRevision);
|
|
3477
3507
|
}
|
|
3478
3508
|
},
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
const submissionId = action.payload.submission;
|
|
3484
|
-
const submissionAttachments = state.submissionAttachments[submissionId];
|
|
3485
|
-
if (submissionAttachments) {
|
|
3486
|
-
submissionAttachments.push(action.payload);
|
|
3487
|
-
} else {
|
|
3488
|
-
state.submissionAttachments[submissionId] = [action.payload];
|
|
3509
|
+
// UserFormRevisions do not get updated
|
|
3510
|
+
deleteFormRevision: (state, action) => {
|
|
3511
|
+
if (state.formRevisions[action.payload] === void 0) {
|
|
3512
|
+
throw new Error(`Revision with offline_id ${action.payload} does not exist`);
|
|
3489
3513
|
}
|
|
3514
|
+
delete state.formRevisions[action.payload];
|
|
3515
|
+
delete LATEST_FORM_REVISION_CACHE[action.payload];
|
|
3490
3516
|
},
|
|
3491
|
-
|
|
3492
|
-
const
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
}
|
|
3497
|
-
|
|
3517
|
+
deleteFormRevisions: (state, action) => {
|
|
3518
|
+
for (const offlineId of action.payload) {
|
|
3519
|
+
if (state.formRevisions[offlineId] === void 0) {
|
|
3520
|
+
throw new Error(`Revision with offline_id ${offlineId} does not exist`);
|
|
3521
|
+
}
|
|
3522
|
+
}
|
|
3523
|
+
for (const offlineId of action.payload) {
|
|
3524
|
+
delete state.formRevisions[offlineId];
|
|
3525
|
+
delete LATEST_FORM_REVISION_CACHE[offlineId];
|
|
3498
3526
|
}
|
|
3499
3527
|
},
|
|
3500
|
-
|
|
3501
|
-
|
|
3528
|
+
// attachment related actions
|
|
3529
|
+
setFormRevisionAttachments: (state, action) => {
|
|
3530
|
+
state.attachments = {};
|
|
3502
3531
|
for (const attachment of action.payload) {
|
|
3503
|
-
|
|
3504
|
-
const submissionAttachments = state.submissionAttachments[submissionId];
|
|
3505
|
-
if (submissionAttachments) {
|
|
3506
|
-
submissionAttachments.push(attachment);
|
|
3507
|
-
} else {
|
|
3508
|
-
state.submissionAttachments[submissionId] = [attachment];
|
|
3509
|
-
}
|
|
3532
|
+
state.attachments[attachment.offline_id] = attachment;
|
|
3510
3533
|
}
|
|
3511
3534
|
},
|
|
3512
|
-
|
|
3513
|
-
state.
|
|
3535
|
+
addFormRevisionAttachment: (state, action) => {
|
|
3536
|
+
if (state.attachments[action.payload.offline_id] !== void 0) {
|
|
3537
|
+
throw new Error(`Attachment with offline_id ${action.payload.offline_id} already exists`);
|
|
3538
|
+
}
|
|
3539
|
+
state.attachments[action.payload.offline_id] = action.payload;
|
|
3540
|
+
},
|
|
3541
|
+
addFormRevisionAttachments: (state, action) => {
|
|
3514
3542
|
for (const attachment of action.payload) {
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
if (revisionAttachments) {
|
|
3518
|
-
revisionAttachments.push(attachment);
|
|
3519
|
-
} else {
|
|
3520
|
-
state.revisionAttachments[revisionId] = [attachment];
|
|
3543
|
+
if (state.attachments[attachment.offline_id] !== void 0) {
|
|
3544
|
+
throw new Error(`Attachment with offline_id ${attachment.offline_id} already exists`);
|
|
3521
3545
|
}
|
|
3522
3546
|
}
|
|
3547
|
+
for (const attachment of action.payload) {
|
|
3548
|
+
state.attachments[attachment.offline_id] = attachment;
|
|
3549
|
+
}
|
|
3523
3550
|
},
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
deleteUserFormSubmissions: (state, action) => {
|
|
3528
|
-
for (const userFormSubmission of action.payload) {
|
|
3529
|
-
delete state.submissions[userFormSubmission.offline_id];
|
|
3551
|
+
deleteFormRevisionAttachment: (state, action) => {
|
|
3552
|
+
if (state.attachments[action.payload] === void 0) {
|
|
3553
|
+
throw new Error(`Attachment with offline_id ${action.payload} does not exist`);
|
|
3530
3554
|
}
|
|
3555
|
+
delete state.attachments[action.payload];
|
|
3531
3556
|
},
|
|
3532
|
-
|
|
3533
|
-
for (const
|
|
3534
|
-
state.
|
|
3557
|
+
deleteFormRevisionAttachments: (state, action) => {
|
|
3558
|
+
for (const offlineId of action.payload) {
|
|
3559
|
+
if (state.attachments[offlineId] === void 0) {
|
|
3560
|
+
throw new Error(`Attachment with offline_id ${offlineId} does not exist`);
|
|
3561
|
+
}
|
|
3535
3562
|
}
|
|
3563
|
+
for (const offlineId of action.payload) {
|
|
3564
|
+
delete state.attachments[offlineId];
|
|
3565
|
+
}
|
|
3566
|
+
}
|
|
3567
|
+
}
|
|
3568
|
+
});
|
|
3569
|
+
const {
|
|
3570
|
+
setFormRevision,
|
|
3571
|
+
setFormRevisions,
|
|
3572
|
+
addFormRevision,
|
|
3573
|
+
addFormRevisions,
|
|
3574
|
+
deleteFormRevision,
|
|
3575
|
+
deleteFormRevisions,
|
|
3576
|
+
setFormRevisionAttachments,
|
|
3577
|
+
addFormRevisionAttachment,
|
|
3578
|
+
addFormRevisionAttachments,
|
|
3579
|
+
deleteFormRevisionAttachment,
|
|
3580
|
+
deleteFormRevisionAttachments
|
|
3581
|
+
} = formRevisionsSlice.actions;
|
|
3582
|
+
const selectFormRevisionMapping = (state) => state.formRevisionReducer.formRevisions;
|
|
3583
|
+
const selectFormRevisions = toolkit.createSelector(
|
|
3584
|
+
[selectFormRevisionMapping],
|
|
3585
|
+
(formRevisions) => Object.values(formRevisions)
|
|
3586
|
+
);
|
|
3587
|
+
const selectFormRevision = (formRevisionId) => (state) => {
|
|
3588
|
+
return state.formRevisionReducer.formRevisions[formRevisionId];
|
|
3589
|
+
};
|
|
3590
|
+
const _selectLatestFormRevision = (formRevisions, formId2) => {
|
|
3591
|
+
let ret = null;
|
|
3592
|
+
for (const candidate of Object.values(formRevisions)) {
|
|
3593
|
+
if (candidate.form === formId2 && (!ret || ret.revision < candidate.revision)) {
|
|
3594
|
+
ret = candidate;
|
|
3595
|
+
}
|
|
3596
|
+
}
|
|
3597
|
+
if (!ret) {
|
|
3598
|
+
throw new Error("No form revision found for form " + formId2);
|
|
3599
|
+
}
|
|
3600
|
+
return ret;
|
|
3601
|
+
};
|
|
3602
|
+
const selectLatestFormRevisionOfForm = restructureCreateSelectorWithArgs(
|
|
3603
|
+
toolkit.createSelector([selectFormRevisionMapping, (_state, formId2) => formId2], (revisions, formId2) => {
|
|
3604
|
+
if (!formId2) {
|
|
3605
|
+
throw new Error("formId is required");
|
|
3606
|
+
}
|
|
3607
|
+
return _selectLatestFormRevision(revisions, formId2);
|
|
3608
|
+
})
|
|
3609
|
+
);
|
|
3610
|
+
const selectFormRevisionsOfForm = restructureCreateSelectorWithArgs(
|
|
3611
|
+
toolkit.createSelector([selectFormRevisions, (_state, formId2) => formId2], (revisions, formId2) => {
|
|
3612
|
+
return revisions.filter((revision) => {
|
|
3613
|
+
return revision.form === formId2;
|
|
3614
|
+
});
|
|
3615
|
+
})
|
|
3616
|
+
);
|
|
3617
|
+
const selectLatestFormRevisionsOfComponentTypes = restructureCreateSelectorWithArgs(
|
|
3618
|
+
toolkit.createSelector(
|
|
3619
|
+
[
|
|
3620
|
+
(state) => state.formReducer.forms,
|
|
3621
|
+
selectFormRevisionMapping,
|
|
3622
|
+
(_state, componentTypeIds) => componentTypeIds
|
|
3623
|
+
],
|
|
3624
|
+
(userForms, revisions, componentTypeIds) => {
|
|
3625
|
+
const componentTypeIdsSet = new Set(componentTypeIds);
|
|
3626
|
+
const ret = {};
|
|
3627
|
+
for (const form of Object.values(userForms)) {
|
|
3628
|
+
if (form.component_type && componentTypeIdsSet.has(form.component_type)) {
|
|
3629
|
+
ret[form.component_type] = _selectLatestFormRevision(revisions, form.offline_id);
|
|
3630
|
+
}
|
|
3631
|
+
}
|
|
3632
|
+
return ret;
|
|
3633
|
+
}
|
|
3634
|
+
)
|
|
3635
|
+
);
|
|
3636
|
+
const selectLatestFormRevisionByForm = toolkit.createSelector([selectFormRevisionMapping], (revisions) => {
|
|
3637
|
+
const latestRevisions = {};
|
|
3638
|
+
for (const revision of Object.values(revisions)) {
|
|
3639
|
+
const formId2 = revision.form;
|
|
3640
|
+
const currentLatestRevision = latestRevisions[formId2];
|
|
3641
|
+
if (!currentLatestRevision || currentLatestRevision.revision < revision.revision) {
|
|
3642
|
+
latestRevisions[formId2] = revision;
|
|
3643
|
+
}
|
|
3644
|
+
}
|
|
3645
|
+
return latestRevisions;
|
|
3646
|
+
});
|
|
3647
|
+
const selectUserFormRevisionAttachmentsMapping = (state) => {
|
|
3648
|
+
return state.formRevisionReducer.attachments;
|
|
3649
|
+
};
|
|
3650
|
+
const selectAttachmentsOfFormRevision = restructureCreateSelectorWithArgs(
|
|
3651
|
+
toolkit.createSelector(
|
|
3652
|
+
[selectUserFormRevisionAttachmentsMapping, (_state, revisionId) => revisionId],
|
|
3653
|
+
(attachments, revisionId) => {
|
|
3654
|
+
return Object.values(attachments).filter((attachment) => attachment.revision === revisionId);
|
|
3655
|
+
}
|
|
3656
|
+
)
|
|
3657
|
+
);
|
|
3658
|
+
const formRevisionReducer = formRevisionsSlice.reducer;
|
|
3659
|
+
const initialState$4 = {
|
|
3660
|
+
forms: {}
|
|
3661
|
+
};
|
|
3662
|
+
const formSlice = toolkit.createSlice({
|
|
3663
|
+
name: "forms",
|
|
3664
|
+
initialState: initialState$4,
|
|
3665
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$4)),
|
|
3666
|
+
reducers: {
|
|
3667
|
+
setForms: (state, action) => {
|
|
3668
|
+
state.forms = {};
|
|
3669
|
+
action.payload.forEach((userForm) => {
|
|
3670
|
+
state.forms[userForm.offline_id] = userForm;
|
|
3671
|
+
});
|
|
3536
3672
|
},
|
|
3537
|
-
|
|
3538
|
-
state.
|
|
3539
|
-
|
|
3540
|
-
|
|
3673
|
+
addForm: (state, action) => {
|
|
3674
|
+
state.forms[action.payload.offline_id] = action.payload;
|
|
3675
|
+
},
|
|
3676
|
+
addForms: (state, action) => {
|
|
3677
|
+
action.payload.forEach((userForm) => {
|
|
3678
|
+
state.forms[userForm.offline_id] = userForm;
|
|
3541
3679
|
});
|
|
3542
3680
|
},
|
|
3543
3681
|
favoriteForm: (state, action) => {
|
|
3544
3682
|
const { formId: formId2 } = action.payload;
|
|
3545
|
-
const form = state.
|
|
3683
|
+
const form = state.forms[formId2];
|
|
3546
3684
|
if (!form) {
|
|
3547
3685
|
throw new Error("No form exists with the id " + formId2);
|
|
3548
3686
|
}
|
|
@@ -3550,48 +3688,23 @@ var __publicField = (obj, key, value) => {
|
|
|
3550
3688
|
},
|
|
3551
3689
|
unfavoriteForm: (state, action) => {
|
|
3552
3690
|
const { formId: formId2 } = action.payload;
|
|
3553
|
-
const form = state.
|
|
3691
|
+
const form = state.forms[formId2];
|
|
3554
3692
|
if (!form) {
|
|
3555
3693
|
throw new Error("No form exists with the id " + formId2);
|
|
3556
3694
|
}
|
|
3557
3695
|
form.favorite = false;
|
|
3558
3696
|
},
|
|
3559
|
-
|
|
3560
|
-
delete state.
|
|
3697
|
+
deleteForm: (state, action) => {
|
|
3698
|
+
delete state.forms[action.payload];
|
|
3561
3699
|
}
|
|
3562
3700
|
}
|
|
3563
3701
|
});
|
|
3564
|
-
const {
|
|
3565
|
-
|
|
3566
|
-
addUserForms,
|
|
3567
|
-
addUserFormRevisions,
|
|
3568
|
-
updateOrCreateUserFormSubmission,
|
|
3569
|
-
addUserFormSubmissions,
|
|
3570
|
-
deleteUserFormSubmission,
|
|
3571
|
-
deleteUserFormSubmissions,
|
|
3572
|
-
favoriteForm,
|
|
3573
|
-
unfavoriteForm,
|
|
3574
|
-
deleteUserForm,
|
|
3575
|
-
deleteUserFormRevision,
|
|
3576
|
-
deleteUserFormRevisions,
|
|
3577
|
-
setUserFormSubmissions,
|
|
3578
|
-
addUserFormRevision,
|
|
3579
|
-
addUserFormSubmissionAttachment,
|
|
3580
|
-
addUserFormRevisionAttachment,
|
|
3581
|
-
setUserFormSubmissionAttachments,
|
|
3582
|
-
setUserFormRevisionAttachments
|
|
3583
|
-
} = userFormSlice.actions;
|
|
3584
|
-
const selectSubmissionAttachments = (submissionId) => (state) => {
|
|
3585
|
-
return state.userFormReducer.submissionAttachments[submissionId] || [];
|
|
3586
|
-
};
|
|
3587
|
-
const selectRevisionAttachments = (revisionId) => (state) => {
|
|
3588
|
-
return state.userFormReducer.revisionAttachments[revisionId] || [];
|
|
3589
|
-
};
|
|
3590
|
-
const selectFilteredUserForms = restructureCreateSelectorWithArgs(
|
|
3702
|
+
const { setForms, addForm, addForms, favoriteForm, unfavoriteForm, deleteForm } = formSlice.actions;
|
|
3703
|
+
const selectFilteredForms = restructureCreateSelectorWithArgs(
|
|
3591
3704
|
toolkit.createSelector(
|
|
3592
3705
|
[
|
|
3593
|
-
(state) => state.
|
|
3594
|
-
(state) => state.
|
|
3706
|
+
(state) => state.formReducer.forms,
|
|
3707
|
+
(state) => state.formRevisionReducer.formRevisions,
|
|
3595
3708
|
(_state, search) => search
|
|
3596
3709
|
],
|
|
3597
3710
|
(userForms, revisions, search) => {
|
|
@@ -3625,63 +3738,188 @@ var __publicField = (obj, key, value) => {
|
|
|
3625
3738
|
{ memoizeOptions: { equalityCheck: reactRedux.shallowEqual } }
|
|
3626
3739
|
)
|
|
3627
3740
|
);
|
|
3628
|
-
const
|
|
3629
|
-
return state.
|
|
3741
|
+
const selectForm = (formId2) => (state) => {
|
|
3742
|
+
return state.formReducer.forms[formId2];
|
|
3630
3743
|
};
|
|
3631
|
-
const
|
|
3632
|
-
|
|
3633
|
-
for (const candidate of Object.values(revisions)) {
|
|
3634
|
-
if (candidate.form === formId2 && (!ret || ret.revision < candidate.revision)) {
|
|
3635
|
-
ret = candidate;
|
|
3636
|
-
}
|
|
3637
|
-
}
|
|
3638
|
-
if (!ret) {
|
|
3639
|
-
throw new Error("No revision found for form " + formId2);
|
|
3640
|
-
}
|
|
3641
|
-
return ret;
|
|
3744
|
+
const selectFormMapping = (state) => {
|
|
3745
|
+
return state.formReducer.forms;
|
|
3642
3746
|
};
|
|
3643
|
-
const
|
|
3747
|
+
const selectFormOfComponentType = restructureCreateSelectorWithArgs(
|
|
3644
3748
|
toolkit.createSelector(
|
|
3645
|
-
[
|
|
3646
|
-
(
|
|
3647
|
-
|
|
3648
|
-
throw new Error("formId is required");
|
|
3649
|
-
}
|
|
3650
|
-
return _selectLatestFormRevision(revisions, formId2);
|
|
3749
|
+
[selectFormMapping, (_state, componentTypeId) => componentTypeId],
|
|
3750
|
+
(userForms, componentTypeId) => {
|
|
3751
|
+
return Object.values(userForms).find((userForm) => userForm.component_type === componentTypeId);
|
|
3651
3752
|
}
|
|
3652
3753
|
)
|
|
3653
3754
|
);
|
|
3654
|
-
const
|
|
3655
|
-
return
|
|
3656
|
-
};
|
|
3657
|
-
const
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
const
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3755
|
+
const selectFormsCount = toolkit.createSelector([selectFormMapping], (userForms) => {
|
|
3756
|
+
return Object.keys(userForms).length;
|
|
3757
|
+
});
|
|
3758
|
+
const selectGeneralFormCount = toolkit.createSelector([selectFormMapping], (userForms) => {
|
|
3759
|
+
return Object.values(userForms).filter((form) => !form.component_type).length;
|
|
3760
|
+
});
|
|
3761
|
+
const formReducer = formSlice.reducer;
|
|
3762
|
+
const initialState$3 = {
|
|
3763
|
+
formSubmissions: {},
|
|
3764
|
+
attachments: {}
|
|
3765
|
+
};
|
|
3766
|
+
const formSubmissionSlice = toolkit.createSlice({
|
|
3767
|
+
name: "formSubmissions",
|
|
3768
|
+
initialState: initialState$3,
|
|
3769
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$3)),
|
|
3770
|
+
reducers: {
|
|
3771
|
+
setFormSubmission: (state, action) => {
|
|
3772
|
+
state.formSubmissions[action.payload.offline_id] = action.payload;
|
|
3773
|
+
},
|
|
3774
|
+
setFormSubmissions: (state, action) => {
|
|
3775
|
+
state.formSubmissions = {};
|
|
3776
|
+
for (const submission of action.payload) {
|
|
3777
|
+
state.formSubmissions[submission.offline_id] = submission;
|
|
3778
|
+
}
|
|
3779
|
+
},
|
|
3780
|
+
addFormSubmission: (state, action) => {
|
|
3781
|
+
if (state.formSubmissions[action.payload.offline_id] !== void 0) {
|
|
3782
|
+
throw new Error(`Submission with offline_id ${action.payload.offline_id} already exists`);
|
|
3783
|
+
}
|
|
3784
|
+
state.formSubmissions[action.payload.offline_id] = action.payload;
|
|
3785
|
+
},
|
|
3786
|
+
addFormSubmissions: (state, action) => {
|
|
3787
|
+
for (const submission of action.payload) {
|
|
3788
|
+
if (state.formSubmissions[submission.offline_id] !== void 0) {
|
|
3789
|
+
throw new Error(`Submission with offline_id ${submission.offline_id} already exists`);
|
|
3790
|
+
}
|
|
3791
|
+
}
|
|
3792
|
+
for (const submission of action.payload) {
|
|
3793
|
+
state.formSubmissions[submission.offline_id] = submission;
|
|
3794
|
+
}
|
|
3795
|
+
},
|
|
3796
|
+
updateFormSubmission: (state, action) => {
|
|
3797
|
+
if (state.formSubmissions[action.payload.offline_id] === void 0) {
|
|
3798
|
+
throw new Error(`Submission with offline_id ${action.payload.offline_id} does not exist`);
|
|
3799
|
+
}
|
|
3800
|
+
state.formSubmissions[action.payload.offline_id] = action.payload;
|
|
3801
|
+
},
|
|
3802
|
+
updateFormSubmissions: (state, action) => {
|
|
3803
|
+
for (const submission of action.payload) {
|
|
3804
|
+
if (state.formSubmissions[submission.offline_id] === void 0) {
|
|
3805
|
+
throw new Error(`Submission with offline_id ${submission.offline_id} does not exist`);
|
|
3806
|
+
}
|
|
3807
|
+
}
|
|
3808
|
+
for (const submission of action.payload) {
|
|
3809
|
+
state.formSubmissions[submission.offline_id] = submission;
|
|
3810
|
+
}
|
|
3811
|
+
},
|
|
3812
|
+
deleteFormSubmission: (state, action) => {
|
|
3813
|
+
if (state.formSubmissions[action.payload] === void 0) {
|
|
3814
|
+
throw new Error(`Submission with offline_id ${action.payload} does not exist`);
|
|
3815
|
+
}
|
|
3816
|
+
delete state.formSubmissions[action.payload];
|
|
3817
|
+
},
|
|
3818
|
+
deleteFormSubmissions: (state, action) => {
|
|
3819
|
+
for (const offlineId of action.payload) {
|
|
3820
|
+
if (state.formSubmissions[offlineId] === void 0) {
|
|
3821
|
+
throw new Error(`Submission with offline_id ${offlineId} does not exist`);
|
|
3822
|
+
}
|
|
3823
|
+
delete state.formSubmissions[offlineId];
|
|
3824
|
+
}
|
|
3825
|
+
for (const offlineId of action.payload) {
|
|
3826
|
+
delete state.formSubmissions[offlineId];
|
|
3827
|
+
}
|
|
3828
|
+
},
|
|
3829
|
+
// Attachments
|
|
3830
|
+
addFormSubmissionAttachment: (state, action) => {
|
|
3831
|
+
if (state.attachments[action.payload.offline_id] !== void 0) {
|
|
3832
|
+
throw new Error(`Attachment with offline_id ${action.payload.offline_id} already exists`);
|
|
3833
|
+
}
|
|
3834
|
+
state.attachments[action.payload.offline_id] = action.payload;
|
|
3835
|
+
},
|
|
3836
|
+
addFormSubmissionAttachments: (state, action) => {
|
|
3837
|
+
for (const attachment of action.payload) {
|
|
3838
|
+
if (state.attachments[attachment.offline_id] !== void 0) {
|
|
3839
|
+
throw new Error(`Attachment with offline_id ${attachment.offline_id} already exists`);
|
|
3840
|
+
}
|
|
3841
|
+
}
|
|
3842
|
+
for (const attachment of action.payload) {
|
|
3843
|
+
state.attachments[attachment.offline_id] = attachment;
|
|
3844
|
+
}
|
|
3845
|
+
},
|
|
3846
|
+
// We only need a multi set for attachments because they are not updated, only added and deleted
|
|
3847
|
+
setFormSubmissionAttachments: (state, action) => {
|
|
3848
|
+
state.attachments = {};
|
|
3849
|
+
for (const attachment of action.payload) {
|
|
3850
|
+
state.attachments[attachment.offline_id] = attachment;
|
|
3851
|
+
}
|
|
3852
|
+
},
|
|
3853
|
+
updateFormSubmissionAttachments: (state, action) => {
|
|
3854
|
+
for (const attachment of action.payload) {
|
|
3855
|
+
if (state.attachments[attachment.offline_id] === void 0) {
|
|
3856
|
+
throw new Error(`Attachment with offline_id ${attachment.offline_id} does not exist`);
|
|
3857
|
+
}
|
|
3858
|
+
}
|
|
3859
|
+
for (const attachment of action.payload) {
|
|
3860
|
+
state.attachments[attachment.offline_id] = attachment;
|
|
3861
|
+
}
|
|
3862
|
+
},
|
|
3863
|
+
// The delete actions for UserFormSubmissionAttachments are not used in the app, but are included for completeness
|
|
3864
|
+
// Could be used if editing a submission is ever supported, will be applicable for supporting tip tap content in submissions
|
|
3865
|
+
deleteFormSubmissionAttachment: (state, action) => {
|
|
3866
|
+
if (state.attachments[action.payload] === void 0) {
|
|
3867
|
+
throw new Error(`Attachment with offline_id ${action.payload} does not exist`);
|
|
3868
|
+
}
|
|
3869
|
+
delete state.attachments[action.payload];
|
|
3870
|
+
},
|
|
3871
|
+
deleteFormSubmissionAttachments: (state, action) => {
|
|
3872
|
+
for (const offlineId of action.payload) {
|
|
3873
|
+
if (state.attachments[offlineId] === void 0) {
|
|
3874
|
+
throw new Error(`Attachment with offline_id ${offlineId} does not exist`);
|
|
3875
|
+
}
|
|
3876
|
+
delete state.attachments[offlineId];
|
|
3877
|
+
}
|
|
3878
|
+
}
|
|
3879
|
+
}
|
|
3880
|
+
});
|
|
3881
|
+
const {
|
|
3882
|
+
setFormSubmission,
|
|
3883
|
+
setFormSubmissions,
|
|
3884
|
+
addFormSubmission,
|
|
3885
|
+
addFormSubmissions,
|
|
3886
|
+
updateFormSubmission,
|
|
3887
|
+
updateFormSubmissions,
|
|
3888
|
+
deleteFormSubmission,
|
|
3889
|
+
deleteFormSubmissions,
|
|
3890
|
+
addFormSubmissionAttachment,
|
|
3891
|
+
addFormSubmissionAttachments,
|
|
3892
|
+
setFormSubmissionAttachments,
|
|
3893
|
+
updateFormSubmissionAttachments,
|
|
3894
|
+
deleteFormSubmissionAttachment,
|
|
3895
|
+
deleteFormSubmissionAttachments
|
|
3896
|
+
} = formSubmissionSlice.actions;
|
|
3897
|
+
const selectFormSubmissionsMapping = (state) => {
|
|
3898
|
+
return state.formSubmissionReducer.formSubmissions;
|
|
3899
|
+
};
|
|
3900
|
+
const selectFormSubmissions = toolkit.createSelector(
|
|
3901
|
+
[selectFormSubmissionsMapping],
|
|
3902
|
+
(submissions) => {
|
|
3903
|
+
return Object.values(submissions);
|
|
3904
|
+
}
|
|
3670
3905
|
);
|
|
3671
|
-
const
|
|
3906
|
+
const selectFormSubmission = (submissionId) => (state) => {
|
|
3907
|
+
return state.formSubmissionReducer.formSubmissions[submissionId];
|
|
3908
|
+
};
|
|
3909
|
+
const selectFormSubmissionsOfForm = restructureCreateSelectorWithArgs(
|
|
3672
3910
|
toolkit.createSelector(
|
|
3673
|
-
[
|
|
3911
|
+
[selectFormSubmissions, selectFormRevisionMapping, (_state, formId2) => formId2],
|
|
3674
3912
|
(submissions, revisionMapping, formId2) => {
|
|
3675
|
-
return
|
|
3913
|
+
return submissions.filter((submission) => {
|
|
3676
3914
|
const revision = revisionMapping[submission.form_revision];
|
|
3677
3915
|
return (revision == null ? void 0 : revision.form) === formId2;
|
|
3678
3916
|
});
|
|
3679
3917
|
}
|
|
3680
3918
|
)
|
|
3681
3919
|
);
|
|
3682
|
-
const
|
|
3920
|
+
const selectFormSubmissionsOfIssue = restructureCreateSelectorWithArgs(
|
|
3683
3921
|
toolkit.createSelector(
|
|
3684
|
-
[
|
|
3922
|
+
[selectFormSubmissions, (_state, issueId) => issueId],
|
|
3685
3923
|
(submissions, issueId) => {
|
|
3686
3924
|
return Object.values(submissions).filter((submission) => {
|
|
3687
3925
|
return submission.issue === issueId;
|
|
@@ -3689,9 +3927,9 @@ var __publicField = (obj, key, value) => {
|
|
|
3689
3927
|
}
|
|
3690
3928
|
)
|
|
3691
3929
|
);
|
|
3692
|
-
const
|
|
3930
|
+
const selectFormSubmissionsOfComponent = restructureCreateSelectorWithArgs(
|
|
3693
3931
|
toolkit.createSelector(
|
|
3694
|
-
[
|
|
3932
|
+
[selectFormSubmissions, (_state, componentId) => componentId],
|
|
3695
3933
|
(submissions, componentId) => {
|
|
3696
3934
|
return submissions.filter((submission) => {
|
|
3697
3935
|
return submission.component === componentId;
|
|
@@ -3699,8 +3937,8 @@ var __publicField = (obj, key, value) => {
|
|
|
3699
3937
|
}
|
|
3700
3938
|
)
|
|
3701
3939
|
);
|
|
3702
|
-
const
|
|
3703
|
-
[
|
|
3940
|
+
const selectFormSubmissionsByComponents = toolkit.createSelector(
|
|
3941
|
+
[selectFormSubmissionsMapping, selectComponentsMapping],
|
|
3704
3942
|
(submissions, components) => {
|
|
3705
3943
|
var _a2;
|
|
3706
3944
|
const componentSubmissionMapping = {};
|
|
@@ -3716,54 +3954,18 @@ var __publicField = (obj, key, value) => {
|
|
|
3716
3954
|
return componentSubmissionMapping;
|
|
3717
3955
|
}
|
|
3718
3956
|
);
|
|
3719
|
-
const
|
|
3720
|
-
return state.
|
|
3957
|
+
const selectFormSubmissionAttachmentsMapping = (state) => {
|
|
3958
|
+
return state.formSubmissionReducer.attachments;
|
|
3721
3959
|
};
|
|
3722
|
-
const
|
|
3723
|
-
toolkit.createSelector(
|
|
3724
|
-
[selectUserFormMapping, (_state, componentTypeId) => componentTypeId],
|
|
3725
|
-
(userForms, componentTypeId) => {
|
|
3726
|
-
return Object.values(userForms).find((userForm) => userForm.component_type === componentTypeId);
|
|
3727
|
-
}
|
|
3728
|
-
)
|
|
3729
|
-
);
|
|
3730
|
-
const selectLatestRevisionsFromComponentTypeIds = restructureCreateSelectorWithArgs(
|
|
3960
|
+
const selectAttachmentsOfFormSubmission = restructureCreateSelectorWithArgs(
|
|
3731
3961
|
toolkit.createSelector(
|
|
3732
|
-
[
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
(_state, componentTypeIds) => componentTypeIds
|
|
3736
|
-
],
|
|
3737
|
-
(userForms, revisions, componentTypeIds) => {
|
|
3738
|
-
const componentTypeIdsSet = new Set(componentTypeIds);
|
|
3739
|
-
const ret = {};
|
|
3740
|
-
for (const form of Object.values(userForms)) {
|
|
3741
|
-
if (form.component_type && componentTypeIdsSet.has(form.component_type)) {
|
|
3742
|
-
ret[form.component_type] = _selectLatestFormRevision(revisions, form.offline_id);
|
|
3743
|
-
}
|
|
3744
|
-
}
|
|
3745
|
-
return ret;
|
|
3962
|
+
[selectFormSubmissionAttachmentsMapping, (_state, submissionId) => submissionId],
|
|
3963
|
+
(attachmentsMapping, submissionId) => {
|
|
3964
|
+
return Object.values(attachmentsMapping).filter((attachment) => attachment.submission === submissionId);
|
|
3746
3965
|
}
|
|
3747
3966
|
)
|
|
3748
3967
|
);
|
|
3749
|
-
const
|
|
3750
|
-
const latestRevisions = {};
|
|
3751
|
-
for (const revision of Object.values(revisions)) {
|
|
3752
|
-
const formId2 = revision.form;
|
|
3753
|
-
const currentLatestRevision = latestRevisions[formId2];
|
|
3754
|
-
if (!currentLatestRevision || currentLatestRevision.revision < revision.revision) {
|
|
3755
|
-
latestRevisions[formId2] = revision;
|
|
3756
|
-
}
|
|
3757
|
-
}
|
|
3758
|
-
return latestRevisions;
|
|
3759
|
-
});
|
|
3760
|
-
const selectNumberOfUserForms = toolkit.createSelector([selectUserFormMapping], (userForms) => {
|
|
3761
|
-
return Object.keys(userForms).length;
|
|
3762
|
-
});
|
|
3763
|
-
const selectNumberOfGeneralUserForms = toolkit.createSelector([selectUserFormMapping], (userForms) => {
|
|
3764
|
-
return Object.values(userForms).filter((form) => !form.component_type).length;
|
|
3765
|
-
});
|
|
3766
|
-
const userFormReducer = userFormSlice.reducer;
|
|
3968
|
+
const formSubmissionReducer = formSubmissionSlice.reducer;
|
|
3767
3969
|
const initialState$2 = {
|
|
3768
3970
|
emailDomains: {}
|
|
3769
3971
|
};
|
|
@@ -3797,7 +3999,8 @@ var __publicField = (obj, key, value) => {
|
|
|
3797
3999
|
);
|
|
3798
4000
|
const emailDomainsReducer = emailDomainsSlice.reducer;
|
|
3799
4001
|
const initialState$1 = {
|
|
3800
|
-
documents: {}
|
|
4002
|
+
documents: {},
|
|
4003
|
+
attachments: {}
|
|
3801
4004
|
};
|
|
3802
4005
|
const documentSlice = toolkit.createSlice({
|
|
3803
4006
|
name: "documents",
|
|
@@ -3934,10 +4137,28 @@ var __publicField = (obj, key, value) => {
|
|
|
3934
4137
|
}
|
|
3935
4138
|
delete state.documents[documentId];
|
|
3936
4139
|
}
|
|
3937
|
-
}
|
|
4140
|
+
},
|
|
4141
|
+
setDocumentAttachments: setAttachments,
|
|
4142
|
+
addDocumentAttachment: addAttachment,
|
|
4143
|
+
addDocumentAttachments: addAttachments,
|
|
4144
|
+
updateDocumentAttachment: updateAttachment,
|
|
4145
|
+
removeDocumentAttachment: removeAttachment,
|
|
4146
|
+
removeDocumentAttachments: removeAttachments
|
|
3938
4147
|
}
|
|
3939
4148
|
});
|
|
3940
|
-
const {
|
|
4149
|
+
const {
|
|
4150
|
+
setDocuments,
|
|
4151
|
+
addDocuments,
|
|
4152
|
+
updateDocuments,
|
|
4153
|
+
moveDocument,
|
|
4154
|
+
removeDocuments,
|
|
4155
|
+
setDocumentAttachments,
|
|
4156
|
+
addDocumentAttachment,
|
|
4157
|
+
addDocumentAttachments,
|
|
4158
|
+
updateDocumentAttachment,
|
|
4159
|
+
removeDocumentAttachment,
|
|
4160
|
+
removeDocumentAttachments
|
|
4161
|
+
} = documentSlice.actions;
|
|
3941
4162
|
const selectDocumentsMapping = (state) => state.documentsReducer.documents;
|
|
3942
4163
|
const selectDocuments = toolkit.createSelector(
|
|
3943
4164
|
[selectDocumentsMapping],
|
|
@@ -3967,6 +4188,39 @@ var __publicField = (obj, key, value) => {
|
|
|
3967
4188
|
[selectDocuments],
|
|
3968
4189
|
(documents) => documents.filter((document2) => !document2.parent_document)
|
|
3969
4190
|
);
|
|
4191
|
+
const selectDocumentAttachmentMapping = (state) => state.documentsReducer.attachments;
|
|
4192
|
+
const selectAllDocumentAttachments = toolkit.createSelector(
|
|
4193
|
+
[selectDocumentAttachmentMapping],
|
|
4194
|
+
(mapping) => Object.values(mapping)
|
|
4195
|
+
);
|
|
4196
|
+
const selectDocumentAttachment = (attachmentId) => (state) => {
|
|
4197
|
+
return state.documentsReducer.attachments[attachmentId];
|
|
4198
|
+
};
|
|
4199
|
+
const selectAttachmentsOfDocument = restructureCreateSelectorWithArgs(
|
|
4200
|
+
toolkit.createSelector(
|
|
4201
|
+
[selectAllDocumentAttachments, (_state, documentId) => documentId],
|
|
4202
|
+
(attachments, documentId) => {
|
|
4203
|
+
return attachments.filter(({ document: document2 }) => documentId === document2);
|
|
4204
|
+
}
|
|
4205
|
+
)
|
|
4206
|
+
);
|
|
4207
|
+
const selectAttachmentsOfDocumentByType = restructureCreateSelectorWithArgs(
|
|
4208
|
+
toolkit.createSelector(
|
|
4209
|
+
[selectAllDocumentAttachments, (_state, documentId) => documentId],
|
|
4210
|
+
(attachments, documentId) => {
|
|
4211
|
+
const attachmentsOfProject = attachments.filter(({ document: document2 }) => documentId === document2);
|
|
4212
|
+
const fileAttachments = attachmentsOfProject.filter(
|
|
4213
|
+
// this null check here is necessary, there are cases where file_type is null or undefined
|
|
4214
|
+
({ file_type }) => !file_type || !file_type.startsWith("image/")
|
|
4215
|
+
);
|
|
4216
|
+
const imageAttachments = attachmentsOfProject.filter(
|
|
4217
|
+
// this null check here is necessary, there are cases where file_type is null or undefined
|
|
4218
|
+
({ file_type }) => file_type && file_type.startsWith("image/")
|
|
4219
|
+
);
|
|
4220
|
+
return { fileAttachments, imageAttachments };
|
|
4221
|
+
}
|
|
4222
|
+
)
|
|
4223
|
+
);
|
|
3970
4224
|
const documentsReducer = documentSlice.reducer;
|
|
3971
4225
|
const initialState = {
|
|
3972
4226
|
version: 0
|
|
@@ -4009,7 +4263,9 @@ var __publicField = (obj, key, value) => {
|
|
|
4009
4263
|
projectFileReducer,
|
|
4010
4264
|
rehydratedReducer,
|
|
4011
4265
|
settingReducer,
|
|
4012
|
-
|
|
4266
|
+
formReducer,
|
|
4267
|
+
formRevisionReducer,
|
|
4268
|
+
formSubmissionReducer,
|
|
4013
4269
|
userReducer,
|
|
4014
4270
|
workspaceReducer,
|
|
4015
4271
|
emailDomainsReducer,
|
|
@@ -4062,9 +4318,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4062
4318
|
throw new Error(`Failed to update index_workspace of issue ${issue.offline_id} to main workspace`);
|
|
4063
4319
|
}
|
|
4064
4320
|
}
|
|
4065
|
-
const indexedForms = Object.values(draft.
|
|
4066
|
-
(form) => form.index_workspace === workspaceId
|
|
4067
|
-
);
|
|
4321
|
+
const indexedForms = Object.values(draft.formReducer.forms).filter((form) => form.index_workspace === workspaceId);
|
|
4068
4322
|
for (const form of indexedForms) {
|
|
4069
4323
|
form.index_workspace = mainWorkspace.offline_id;
|
|
4070
4324
|
}
|
|
@@ -4542,6 +4796,23 @@ var __publicField = (obj, key, value) => {
|
|
|
4542
4796
|
}
|
|
4543
4797
|
}
|
|
4544
4798
|
class AttachmentService extends BaseApiService {
|
|
4799
|
+
processPresignedUrls(presignedUrls) {
|
|
4800
|
+
for (const [sha1, presignedUrl] of Object.entries(presignedUrls)) {
|
|
4801
|
+
console.debug(sha1, presignedUrl);
|
|
4802
|
+
void this.enqueueRequest({
|
|
4803
|
+
url: presignedUrl.url,
|
|
4804
|
+
description: "Upload file to S3",
|
|
4805
|
+
method: HttpMethod.POST,
|
|
4806
|
+
isExternalUrl: true,
|
|
4807
|
+
isAuthNeeded: false,
|
|
4808
|
+
attachmentHash: sha1,
|
|
4809
|
+
// TODO: can we use the sha1 as the blocker?
|
|
4810
|
+
blockers: [`s3-${sha1}`],
|
|
4811
|
+
blocks: [sha1],
|
|
4812
|
+
s3url: presignedUrl
|
|
4813
|
+
});
|
|
4814
|
+
}
|
|
4815
|
+
}
|
|
4545
4816
|
fetchAll(projectId) {
|
|
4546
4817
|
const promise = this.enqueueRequest({
|
|
4547
4818
|
description: "Fetch attachments",
|
|
@@ -4555,7 +4826,8 @@ var __publicField = (obj, key, value) => {
|
|
|
4555
4826
|
issue_attachments: Object.values(state.issueReducer.attachments),
|
|
4556
4827
|
component_attachments: Object.values(state.componentReducer.attachments),
|
|
4557
4828
|
component_type_attachments: Object.values(state.componentTypeReducer.attachments),
|
|
4558
|
-
project_attachments: Object.values(state.projectReducer.attachments)
|
|
4829
|
+
project_attachments: Object.values(state.projectReducer.attachments),
|
|
4830
|
+
document_attachments: Object.values(state.documentsReducer.attachments)
|
|
4559
4831
|
};
|
|
4560
4832
|
return [allAttachments, promise];
|
|
4561
4833
|
}
|
|
@@ -4567,6 +4839,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4567
4839
|
}
|
|
4568
4840
|
const offlineAttachment = {
|
|
4569
4841
|
...attachmentPayload,
|
|
4842
|
+
// TODO: just handle creating the objectURL in here, then the front end doesn't need to worry about it
|
|
4570
4843
|
file: attachmentPayload.file.objectURL,
|
|
4571
4844
|
file_name: attachmentPayload.file.name,
|
|
4572
4845
|
file_type: attachmentPayload.file.type,
|
|
@@ -4600,6 +4873,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4600
4873
|
}
|
|
4601
4874
|
const offlineAttachment = {
|
|
4602
4875
|
...attachmentPayload,
|
|
4876
|
+
// TODO: just handle creating the objectURL in here, then the front end doesn't need to worry about it
|
|
4603
4877
|
file: attachmentPayload.file.objectURL,
|
|
4604
4878
|
file_name: attachmentPayload.file.name,
|
|
4605
4879
|
file_type: attachmentPayload.file.type,
|
|
@@ -4633,6 +4907,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4633
4907
|
}
|
|
4634
4908
|
const offlineAttachment = {
|
|
4635
4909
|
...attachmentPayload,
|
|
4910
|
+
// TODO: just handle creating the objectURL in here, then the front end doesn't need to worry about it
|
|
4636
4911
|
file: attachmentPayload.file.objectURL,
|
|
4637
4912
|
file_name: attachmentPayload.file.name,
|
|
4638
4913
|
file_type: attachmentPayload.file.type,
|
|
@@ -4659,8 +4934,8 @@ var __publicField = (obj, key, value) => {
|
|
|
4659
4934
|
});
|
|
4660
4935
|
return [offlineAttachment, promise];
|
|
4661
4936
|
}
|
|
4662
|
-
async
|
|
4663
|
-
const { description: description2,
|
|
4937
|
+
async addDocumentAttachment(attachmentPayload) {
|
|
4938
|
+
const { description: description2, document: document2, file_sha1, offline_id } = attachmentPayload;
|
|
4664
4939
|
if (!attachmentPayload.file.objectURL) {
|
|
4665
4940
|
throw new Error("Expected attachmentPayload.file.objectURL to be defined.");
|
|
4666
4941
|
}
|
|
@@ -4673,24 +4948,24 @@ var __publicField = (obj, key, value) => {
|
|
|
4673
4948
|
created_by: this.client.store.getState().userReducer.currentUser.id
|
|
4674
4949
|
};
|
|
4675
4950
|
await this.client.files.addCache(attachmentPayload.file, file_sha1);
|
|
4676
|
-
this.client.store.dispatch(
|
|
4951
|
+
this.client.store.dispatch(addDocumentAttachment(offlineAttachment));
|
|
4677
4952
|
const [fileProps] = await this.client.files.uploadFileToS3(file_sha1);
|
|
4678
4953
|
const promise = this.enqueueRequest({
|
|
4679
4954
|
description: "Create attachment",
|
|
4680
4955
|
method: HttpMethod.POST,
|
|
4681
|
-
url: `/
|
|
4682
|
-
blocks: [offline_id,
|
|
4956
|
+
url: `/documents/${document2}/attach/`,
|
|
4957
|
+
blocks: [offline_id, document2],
|
|
4683
4958
|
blockers: [file_sha1],
|
|
4684
4959
|
payload: {
|
|
4685
4960
|
offline_id,
|
|
4686
|
-
|
|
4961
|
+
document: document2,
|
|
4687
4962
|
description: description2 ?? "",
|
|
4688
4963
|
submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4689
4964
|
...fileProps
|
|
4690
4965
|
}
|
|
4691
4966
|
});
|
|
4692
4967
|
promise.catch((error2) => {
|
|
4693
|
-
this.client.store.dispatch(
|
|
4968
|
+
this.client.store.dispatch(removeDocumentAttachment(offlineAttachment.offline_id));
|
|
4694
4969
|
throw error2;
|
|
4695
4970
|
});
|
|
4696
4971
|
return [offlineAttachment, promise];
|
|
@@ -4698,26 +4973,54 @@ var __publicField = (obj, key, value) => {
|
|
|
4698
4973
|
/** the outer Promise is needed to await the hashing of each file, which is required before offline use. If wanting to
|
|
4699
4974
|
* attach promise handlers to the request to add the attachment in the backend, apply it on the promise returned from the
|
|
4700
4975
|
* OptimisticModelResult. */
|
|
4701
|
-
|
|
4702
|
-
|
|
4703
|
-
|
|
4704
|
-
|
|
4705
|
-
|
|
4706
|
-
|
|
4707
|
-
|
|
4708
|
-
|
|
4709
|
-
|
|
4710
|
-
|
|
4711
|
-
|
|
4712
|
-
|
|
4713
|
-
|
|
4714
|
-
|
|
4715
|
-
|
|
4716
|
-
|
|
4717
|
-
|
|
4718
|
-
};
|
|
4719
|
-
|
|
4976
|
+
// note the method is only marked as async since files needs to be hashed
|
|
4977
|
+
async attachFilesToIssue(files, issueId) {
|
|
4978
|
+
const { store } = this.client;
|
|
4979
|
+
const offlineAttachments = [];
|
|
4980
|
+
const attachmentsPayload = [];
|
|
4981
|
+
const currentUser = store.getState().userReducer.currentUser;
|
|
4982
|
+
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
4983
|
+
for (const file of files) {
|
|
4984
|
+
const attachment = offline({
|
|
4985
|
+
file: URL.createObjectURL(file),
|
|
4986
|
+
file_name: file.name,
|
|
4987
|
+
file_type: file.type,
|
|
4988
|
+
file_sha1: await hashFile(file),
|
|
4989
|
+
description: "",
|
|
4990
|
+
submitted_at: submittedAt,
|
|
4991
|
+
created_by: currentUser.id,
|
|
4992
|
+
issue: issueId
|
|
4993
|
+
});
|
|
4994
|
+
attachmentsPayload.push({
|
|
4995
|
+
offline_id: attachment.offline_id,
|
|
4996
|
+
name: attachment.file_name,
|
|
4997
|
+
sha1: attachment.file_sha1,
|
|
4998
|
+
description: attachment.description,
|
|
4999
|
+
created_by: attachment.created_by,
|
|
5000
|
+
issue_id: attachment.issue
|
|
5001
|
+
});
|
|
5002
|
+
offlineAttachments.push(attachment);
|
|
5003
|
+
}
|
|
5004
|
+
store.dispatch(addIssueAttachments(offlineAttachments));
|
|
5005
|
+
const promise = this.enqueueRequest({
|
|
5006
|
+
description: "Attach files to issue",
|
|
5007
|
+
method: HttpMethod.POST,
|
|
5008
|
+
url: `/issues/${issueId}/attach/`,
|
|
5009
|
+
payload: {
|
|
5010
|
+
submitted_at: submittedAt,
|
|
5011
|
+
attachments: attachmentsPayload,
|
|
5012
|
+
files: await constructUploadedFilePayloads(files)
|
|
5013
|
+
},
|
|
5014
|
+
blocks: offlineAttachments.map((attachment) => attachment.offline_id),
|
|
5015
|
+
blockers: offlineAttachments.map((attachment) => attachment.file_sha1)
|
|
4720
5016
|
});
|
|
5017
|
+
promise.then(({ attachments, presigned_urls }) => {
|
|
5018
|
+
store.dispatch(updateIssueAttachments(attachments));
|
|
5019
|
+
this.processPresignedUrls(presigned_urls);
|
|
5020
|
+
}).catch(() => {
|
|
5021
|
+
store.dispatch(removeIssueAttachments(offlineAttachments.map((attachment) => attachment.offline_id)));
|
|
5022
|
+
});
|
|
5023
|
+
return [offlineAttachments, promise.then(({ attachments }) => attachments)];
|
|
4721
5024
|
}
|
|
4722
5025
|
attachFilesToComponent(filesToSubmit, componentId) {
|
|
4723
5026
|
return filesToSubmit.map((file) => {
|
|
@@ -4761,7 +5064,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4761
5064
|
return photoAttachmentPromise(file);
|
|
4762
5065
|
});
|
|
4763
5066
|
}
|
|
4764
|
-
|
|
5067
|
+
attachFilesToDocument(filesToSubmit, documentId) {
|
|
4765
5068
|
return filesToSubmit.map((file) => {
|
|
4766
5069
|
if (!(file instanceof File)) {
|
|
4767
5070
|
throw new Error("Expected a File instance.");
|
|
@@ -4772,12 +5075,12 @@ var __publicField = (obj, key, value) => {
|
|
|
4772
5075
|
file: file2,
|
|
4773
5076
|
file_name: file2.name,
|
|
4774
5077
|
file_type: file2.type,
|
|
4775
|
-
|
|
5078
|
+
document: documentId,
|
|
4776
5079
|
file_sha1: hash,
|
|
4777
5080
|
submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4778
5081
|
created_by: this.client.store.getState().userReducer.currentUser.id
|
|
4779
5082
|
});
|
|
4780
|
-
return this.
|
|
5083
|
+
return this.addDocumentAttachment(attachment);
|
|
4781
5084
|
};
|
|
4782
5085
|
return photoAttachmentPromise(file);
|
|
4783
5086
|
});
|
|
@@ -4957,9 +5260,9 @@ var __publicField = (obj, key, value) => {
|
|
|
4957
5260
|
const promise = performRequest2();
|
|
4958
5261
|
return [offlineAttachment, promise];
|
|
4959
5262
|
}
|
|
4960
|
-
async
|
|
5263
|
+
async replaceDocumentAttachmentFile(attachmentId, newFile) {
|
|
4961
5264
|
const { store } = this.client;
|
|
4962
|
-
const attachment = store.getState().
|
|
5265
|
+
const attachment = store.getState().documentsReducer.attachments[attachmentId];
|
|
4963
5266
|
if (!attachment)
|
|
4964
5267
|
throw new Error(`Attachment ${attachmentId} not found`);
|
|
4965
5268
|
let oldFile = void 0;
|
|
@@ -4973,7 +5276,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4973
5276
|
throw new Error(`newFile["objectURL"] is unexpectedly ${newFile.objectURL}`);
|
|
4974
5277
|
}
|
|
4975
5278
|
store.dispatch(
|
|
4976
|
-
|
|
5279
|
+
updateDocumentAttachment({
|
|
4977
5280
|
...attachment,
|
|
4978
5281
|
file_sha1: newSha1,
|
|
4979
5282
|
file: URL.createObjectURL(newFile)
|
|
@@ -4981,13 +5284,13 @@ var __publicField = (obj, key, value) => {
|
|
|
4981
5284
|
);
|
|
4982
5285
|
await this.client.files.addCache(newFile, newSha1);
|
|
4983
5286
|
const [fileProps] = await this.client.files.uploadFileToS3(newSha1).catch((e) => {
|
|
4984
|
-
store.dispatch(
|
|
5287
|
+
store.dispatch(updateDocumentAttachment(attachment));
|
|
4985
5288
|
throw e;
|
|
4986
5289
|
});
|
|
4987
5290
|
const promise2 = this.enqueueRequest({
|
|
4988
5291
|
description: "Edit attachment",
|
|
4989
5292
|
method: HttpMethod.PATCH,
|
|
4990
|
-
url: `/attachments/
|
|
5293
|
+
url: `/attachments/documents/${attachment.offline_id}/`,
|
|
4991
5294
|
isResponseBlob: false,
|
|
4992
5295
|
payload: fileProps,
|
|
4993
5296
|
blockers: [attachmentId, newSha1],
|
|
@@ -5000,7 +5303,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5000
5303
|
} catch (e) {
|
|
5001
5304
|
if (oldFile) {
|
|
5002
5305
|
store.dispatch(
|
|
5003
|
-
|
|
5306
|
+
updateDocumentAttachment({
|
|
5004
5307
|
...attachment,
|
|
5005
5308
|
file_sha1: attachment.file_sha1,
|
|
5006
5309
|
file: URL.createObjectURL(oldFile)
|
|
@@ -5070,20 +5373,20 @@ var __publicField = (obj, key, value) => {
|
|
|
5070
5373
|
blocks: [componentTypeAttachmentId]
|
|
5071
5374
|
});
|
|
5072
5375
|
}
|
|
5073
|
-
|
|
5376
|
+
deleteDocumentAttachment(documentAttachmentId) {
|
|
5074
5377
|
const { store } = this.client;
|
|
5075
|
-
const attachment =
|
|
5378
|
+
const attachment = store.getState().documentsReducer.attachments[documentAttachmentId];
|
|
5076
5379
|
if (!attachment) {
|
|
5077
|
-
throw new Error(`Attachment ${
|
|
5380
|
+
throw new Error(`Attachment ${documentAttachmentId} not found`);
|
|
5078
5381
|
}
|
|
5079
|
-
store.dispatch(
|
|
5382
|
+
store.dispatch(removeDocumentAttachment(documentAttachmentId));
|
|
5080
5383
|
void this.client.files.removeCache(attachment.file_sha1);
|
|
5081
5384
|
return this.enqueueRequest({
|
|
5082
|
-
description: "Delete attachment",
|
|
5385
|
+
description: "Delete document attachment",
|
|
5083
5386
|
method: HttpMethod.DELETE,
|
|
5084
|
-
url: `/attachments/
|
|
5085
|
-
blockers: [
|
|
5086
|
-
blocks: [
|
|
5387
|
+
url: `/attachments/documents/${documentAttachmentId}/`,
|
|
5388
|
+
blockers: [documentAttachmentId],
|
|
5389
|
+
blocks: [documentAttachmentId]
|
|
5087
5390
|
});
|
|
5088
5391
|
}
|
|
5089
5392
|
}
|
|
@@ -6321,11 +6624,18 @@ var __publicField = (obj, key, value) => {
|
|
|
6321
6624
|
if (currentProjectId) {
|
|
6322
6625
|
const [_offlineAttachments, promise] = this.client.attachments.fetchAll(currentProjectId);
|
|
6323
6626
|
void promise.then((result) => {
|
|
6324
|
-
const {
|
|
6627
|
+
const {
|
|
6628
|
+
issue_attachments,
|
|
6629
|
+
component_type_attachments,
|
|
6630
|
+
component_attachments,
|
|
6631
|
+
project_attachments,
|
|
6632
|
+
document_attachments
|
|
6633
|
+
} = result;
|
|
6325
6634
|
store.dispatch(setIssueAttachments(issue_attachments));
|
|
6326
6635
|
store.dispatch(setComponentAttachments(component_attachments));
|
|
6327
6636
|
store.dispatch(setComponentTypeAttachments(component_type_attachments));
|
|
6328
6637
|
store.dispatch(setProjectAttachments(project_attachments));
|
|
6638
|
+
store.dispatch(setDocumentAttachments(document_attachments));
|
|
6329
6639
|
});
|
|
6330
6640
|
void this.client.documents.refreshStore();
|
|
6331
6641
|
void this.client.issueUpdates.refreshStore();
|
|
@@ -6693,7 +7003,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6693
7003
|
...revisionAttachmentPayload,
|
|
6694
7004
|
file: URL.createObjectURL(image)
|
|
6695
7005
|
};
|
|
6696
|
-
store.dispatch(
|
|
7006
|
+
store.dispatch(addFormRevisionAttachment(offlinePayload));
|
|
6697
7007
|
return attach;
|
|
6698
7008
|
});
|
|
6699
7009
|
});
|
|
@@ -6727,8 +7037,8 @@ var __publicField = (obj, key, value) => {
|
|
|
6727
7037
|
revision: 0
|
|
6728
7038
|
};
|
|
6729
7039
|
const { store } = this.client;
|
|
6730
|
-
store.dispatch(
|
|
6731
|
-
store.dispatch(
|
|
7040
|
+
store.dispatch(addForm(retForm));
|
|
7041
|
+
store.dispatch(addFormRevision(retRevision));
|
|
6732
7042
|
const formPromise = this.enqueueRequest({
|
|
6733
7043
|
description: "Create form",
|
|
6734
7044
|
method: HttpMethod.POST,
|
|
@@ -6746,8 +7056,8 @@ var __publicField = (obj, key, value) => {
|
|
|
6746
7056
|
});
|
|
6747
7057
|
const attachImagesPromises = this.getAttachImagePromises(images, offlineRevisionPayload.offline_id);
|
|
6748
7058
|
void formPromise.catch((e) => {
|
|
6749
|
-
store.dispatch(
|
|
6750
|
-
store.dispatch(
|
|
7059
|
+
store.dispatch(deleteForm(retForm.offline_id));
|
|
7060
|
+
store.dispatch(deleteFormRevision(retRevision.offline_id));
|
|
6751
7061
|
throw e;
|
|
6752
7062
|
});
|
|
6753
7063
|
const settledPromise = Promise.all([formPromise, ...attachImagesPromises]).then(() => formPromise);
|
|
@@ -6789,7 +7099,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6789
7099
|
revision: "Pending",
|
|
6790
7100
|
form: formId2
|
|
6791
7101
|
};
|
|
6792
|
-
store.dispatch(
|
|
7102
|
+
store.dispatch(addFormRevision(fullRevision));
|
|
6793
7103
|
const promise = this.enqueueRequest({
|
|
6794
7104
|
description: "Create form revision",
|
|
6795
7105
|
method: HttpMethod.PATCH,
|
|
@@ -6803,9 +7113,9 @@ var __publicField = (obj, key, value) => {
|
|
|
6803
7113
|
});
|
|
6804
7114
|
const attachImagesPromises = this.getAttachImagePromises(images, offlineRevision.offline_id);
|
|
6805
7115
|
void promise.then((result) => {
|
|
6806
|
-
store.dispatch(
|
|
7116
|
+
store.dispatch(setFormRevision(result));
|
|
6807
7117
|
}).catch(() => {
|
|
6808
|
-
store.dispatch(
|
|
7118
|
+
store.dispatch(deleteFormRevision(fullRevision.offline_id));
|
|
6809
7119
|
});
|
|
6810
7120
|
const settledPromise = Promise.all([promise, ...attachImagesPromises]).then(() => promise);
|
|
6811
7121
|
return [fullRevision, settledPromise];
|
|
@@ -6847,19 +7157,19 @@ var __publicField = (obj, key, value) => {
|
|
|
6847
7157
|
async delete(formId2) {
|
|
6848
7158
|
const { store } = this.client;
|
|
6849
7159
|
const state = store.getState();
|
|
6850
|
-
const userForm =
|
|
7160
|
+
const userForm = selectForm(formId2)(state);
|
|
6851
7161
|
if (!userForm) {
|
|
6852
7162
|
throw new Error("Expected userForm to exist");
|
|
6853
7163
|
}
|
|
6854
|
-
const userFormSubmissions =
|
|
7164
|
+
const userFormSubmissions = selectFormSubmissionsOfForm(formId2)(state);
|
|
6855
7165
|
if (userFormSubmissions && userFormSubmissions.length > 0) {
|
|
6856
|
-
store.dispatch(
|
|
7166
|
+
store.dispatch(deleteFormSubmissions(userFormSubmissions.map(({ offline_id }) => offline_id)));
|
|
6857
7167
|
}
|
|
6858
|
-
const userFormRevisions =
|
|
7168
|
+
const userFormRevisions = selectFormRevisionsOfForm(formId2)(state);
|
|
6859
7169
|
if (userFormRevisions && userFormRevisions.length > 0) {
|
|
6860
|
-
store.dispatch(
|
|
7170
|
+
store.dispatch(deleteFormRevisions(userFormRevisions.map(({ offline_id }) => offline_id)));
|
|
6861
7171
|
}
|
|
6862
|
-
store.dispatch(
|
|
7172
|
+
store.dispatch(deleteForm(formId2));
|
|
6863
7173
|
try {
|
|
6864
7174
|
return await this.enqueueRequest({
|
|
6865
7175
|
description: "Delete form",
|
|
@@ -6869,12 +7179,12 @@ var __publicField = (obj, key, value) => {
|
|
|
6869
7179
|
blocks: []
|
|
6870
7180
|
});
|
|
6871
7181
|
} catch (e) {
|
|
6872
|
-
store.dispatch(
|
|
7182
|
+
store.dispatch(addForm(userForm));
|
|
6873
7183
|
if (userFormRevisions && userFormRevisions.length > 0) {
|
|
6874
|
-
store.dispatch(
|
|
7184
|
+
store.dispatch(addFormRevisions(userFormRevisions));
|
|
6875
7185
|
}
|
|
6876
7186
|
if (userFormSubmissions && userFormSubmissions.length > 0) {
|
|
6877
|
-
store.dispatch(
|
|
7187
|
+
store.dispatch(addFormSubmissions(userFormSubmissions));
|
|
6878
7188
|
}
|
|
6879
7189
|
throw e;
|
|
6880
7190
|
}
|
|
@@ -6888,16 +7198,15 @@ var __publicField = (obj, key, value) => {
|
|
|
6888
7198
|
blockers: [],
|
|
6889
7199
|
blocks: []
|
|
6890
7200
|
});
|
|
6891
|
-
store.dispatch(
|
|
6892
|
-
store.dispatch(
|
|
6893
|
-
store.dispatch(
|
|
7201
|
+
store.dispatch(setForms(Object.values(result.forms)));
|
|
7202
|
+
store.dispatch(setFormRevisions(Object.values(result.revisions)));
|
|
7203
|
+
store.dispatch(setFormRevisionAttachments(Object.values(result.attachments)));
|
|
6894
7204
|
}
|
|
6895
7205
|
}
|
|
6896
7206
|
const isArrayOfFiles = (value) => {
|
|
6897
7207
|
return Array.isArray(value) && value[0] instanceof File;
|
|
6898
7208
|
};
|
|
6899
|
-
const separateFilesFromValues = (
|
|
6900
|
-
const { values } = payload;
|
|
7209
|
+
const separateFilesFromValues = (values) => {
|
|
6901
7210
|
const files = {};
|
|
6902
7211
|
const newValues = {};
|
|
6903
7212
|
for (const key in values) {
|
|
@@ -6912,17 +7221,13 @@ var __publicField = (obj, key, value) => {
|
|
|
6912
7221
|
newValues[key] = value;
|
|
6913
7222
|
}
|
|
6914
7223
|
}
|
|
6915
|
-
|
|
6916
|
-
...payload,
|
|
6917
|
-
values: newValues
|
|
6918
|
-
};
|
|
6919
|
-
return { payloadWithoutFiles, files };
|
|
7224
|
+
return { values: newValues, files };
|
|
6920
7225
|
};
|
|
6921
7226
|
class UserFormSubmissionService extends BaseApiService {
|
|
6922
7227
|
constructor() {
|
|
6923
7228
|
super(...arguments);
|
|
6924
7229
|
// Attach files to submission, after uploading them to S3
|
|
6925
|
-
__publicField(this, "getAttachFilesPromises", (files,
|
|
7230
|
+
__publicField(this, "getAttachFilesPromises", (files, submission) => {
|
|
6926
7231
|
const { store } = this.client;
|
|
6927
7232
|
return Object.entries(files).map(async ([key, fileArray]) => {
|
|
6928
7233
|
const attachResults = [];
|
|
@@ -6932,24 +7237,27 @@ var __publicField = (obj, key, value) => {
|
|
|
6932
7237
|
const [fileProps] = await this.client.files.uploadFileToS3(sha1);
|
|
6933
7238
|
const submissionAttachmentPayload = offline({
|
|
6934
7239
|
...fileProps,
|
|
6935
|
-
submission:
|
|
7240
|
+
submission: submission.offline_id,
|
|
6936
7241
|
field_identifier: key
|
|
6937
7242
|
});
|
|
6938
7243
|
const attach = await this.enqueueRequest({
|
|
6939
7244
|
description: "Attach file to form submission",
|
|
6940
7245
|
method: HttpMethod.POST,
|
|
6941
|
-
url: `/forms/submission/${
|
|
7246
|
+
url: `/forms/submission/${submission.offline_id}/attachments/`,
|
|
6942
7247
|
payload: submissionAttachmentPayload,
|
|
6943
|
-
blockers: [
|
|
6944
|
-
|
|
6945
|
-
|
|
7248
|
+
blockers: [
|
|
7249
|
+
submission.component,
|
|
7250
|
+
submission.component_stage,
|
|
7251
|
+
submission.issue,
|
|
7252
|
+
submission.form_revision
|
|
7253
|
+
].filter((x) => x !== void 0),
|
|
6946
7254
|
blocks: [submissionAttachmentPayload.offline_id]
|
|
6947
7255
|
});
|
|
6948
7256
|
const offlinePayload = {
|
|
6949
7257
|
...submissionAttachmentPayload,
|
|
6950
7258
|
file: URL.createObjectURL(file)
|
|
6951
7259
|
};
|
|
6952
|
-
store.dispatch(
|
|
7260
|
+
store.dispatch(addFormSubmissionAttachment(offlinePayload));
|
|
6953
7261
|
attachResults.push(attach);
|
|
6954
7262
|
}
|
|
6955
7263
|
return attachResults;
|
|
@@ -6963,70 +7271,165 @@ var __publicField = (obj, key, value) => {
|
|
|
6963
7271
|
if (!activeProjectId) {
|
|
6964
7272
|
throw new Error("Expected an active project");
|
|
6965
7273
|
}
|
|
6966
|
-
const {
|
|
7274
|
+
const { values, files } = separateFilesFromValues(payload.values);
|
|
7275
|
+
const offlineSubmission = {
|
|
7276
|
+
...payload,
|
|
7277
|
+
values,
|
|
7278
|
+
created_by: state.userReducer.currentUser.id,
|
|
7279
|
+
submitted_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
7280
|
+
};
|
|
6967
7281
|
const promise = this.enqueueRequest({
|
|
6968
7282
|
description: "Respond to form",
|
|
6969
7283
|
method: HttpMethod.POST,
|
|
6970
7284
|
url: `/forms/revisions/${payload.form_revision}/respond/`,
|
|
6971
|
-
payload: { ...
|
|
7285
|
+
payload: { ...offlineSubmission, project: activeProjectId },
|
|
6972
7286
|
blockers: [payload.issue, payload.component, payload.component_stage, "add-form-entry"].filter(
|
|
6973
7287
|
(x) => x !== void 0
|
|
6974
7288
|
),
|
|
6975
7289
|
blocks: [payload.offline_id]
|
|
6976
7290
|
});
|
|
6977
|
-
const attachFilesPromises = this.getAttachFilesPromises(files,
|
|
6978
|
-
|
|
6979
|
-
const fullOfflineResult = {
|
|
6980
|
-
...payload,
|
|
6981
|
-
created_by: state.userReducer.currentUser.id,
|
|
6982
|
-
created_at: now,
|
|
6983
|
-
updated_at: now
|
|
6984
|
-
};
|
|
6985
|
-
const offlineResultWithoutFiles = {
|
|
6986
|
-
...fullOfflineResult,
|
|
6987
|
-
...payloadWithoutFiles
|
|
6988
|
-
};
|
|
6989
|
-
store.dispatch(updateOrCreateUserFormSubmission(offlineResultWithoutFiles));
|
|
7291
|
+
const attachFilesPromises = this.getAttachFilesPromises(files, offlineSubmission);
|
|
7292
|
+
store.dispatch(addFormSubmission(offlineSubmission));
|
|
6990
7293
|
void promise.then((result) => {
|
|
6991
7294
|
store.dispatch(addActiveProjectFormSubmissionsCount(1));
|
|
6992
|
-
store.dispatch(
|
|
7295
|
+
store.dispatch(setFormSubmission(result));
|
|
6993
7296
|
return result;
|
|
6994
7297
|
}).catch(() => {
|
|
6995
|
-
store.dispatch(
|
|
7298
|
+
store.dispatch(deleteFormSubmission(payload.offline_id));
|
|
6996
7299
|
store.dispatch(addActiveProjectFormSubmissionsCount(-1));
|
|
6997
7300
|
});
|
|
6998
7301
|
const settledPromise = Promise.all([promise, ...attachFilesPromises]).then(() => promise);
|
|
6999
|
-
return [
|
|
7302
|
+
return [offlineSubmission, settledPromise];
|
|
7000
7303
|
}
|
|
7001
|
-
|
|
7304
|
+
// Note currently the bulkAdd method is specific to form submissions for components
|
|
7305
|
+
// TODO: adapt the support bulk adding to any model type
|
|
7306
|
+
async bulkAdd(args) {
|
|
7307
|
+
const { form_revision, values: argsValues, componentOfflineIds } = args;
|
|
7002
7308
|
const { store } = this.client;
|
|
7003
|
-
const
|
|
7004
|
-
|
|
7005
|
-
|
|
7309
|
+
const offlineSubmissions = [];
|
|
7310
|
+
const offlineAttachments = [];
|
|
7311
|
+
const submissionOfflineIds = [];
|
|
7312
|
+
const submissionsPayload = [];
|
|
7313
|
+
const attachmentsPayload = [];
|
|
7314
|
+
const { values, files } = separateFilesFromValues(argsValues);
|
|
7315
|
+
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7316
|
+
const createdBy = store.getState().userReducer.currentUser.id;
|
|
7317
|
+
for (const component_id of componentOfflineIds) {
|
|
7318
|
+
const submission = offline({
|
|
7319
|
+
form_revision,
|
|
7320
|
+
values,
|
|
7321
|
+
created_by: createdBy,
|
|
7322
|
+
submitted_at: submittedAt,
|
|
7323
|
+
component: component_id
|
|
7324
|
+
});
|
|
7325
|
+
submissionOfflineIds.push(submission.offline_id);
|
|
7326
|
+
submissionsPayload.push({ offline_id: submission.offline_id, component_id });
|
|
7327
|
+
offlineSubmissions.push(submission);
|
|
7328
|
+
for (const [fieldIdentifier, fileArray] of Object.entries(files)) {
|
|
7329
|
+
for (const file of fileArray) {
|
|
7330
|
+
const sha1 = await hashFile(file);
|
|
7331
|
+
await this.client.files.addCache(file, sha1);
|
|
7332
|
+
const offlineAttachment = offline({
|
|
7333
|
+
file_name: file.name,
|
|
7334
|
+
file_sha1: sha1,
|
|
7335
|
+
file: URL.createObjectURL(file),
|
|
7336
|
+
submission: submission.offline_id,
|
|
7337
|
+
field_identifier: fieldIdentifier
|
|
7338
|
+
});
|
|
7339
|
+
offlineAttachments.push(offlineAttachment);
|
|
7340
|
+
attachmentsPayload.push({
|
|
7341
|
+
offline_id: offlineAttachment.offline_id,
|
|
7342
|
+
submission_id: submission.offline_id,
|
|
7343
|
+
sha1,
|
|
7344
|
+
name: file.name,
|
|
7345
|
+
field_identifier: fieldIdentifier
|
|
7346
|
+
});
|
|
7347
|
+
}
|
|
7348
|
+
}
|
|
7349
|
+
}
|
|
7350
|
+
const filesRecord = {};
|
|
7351
|
+
for (const file of Object.values(files).flat()) {
|
|
7352
|
+
const sha1 = await hashFile(file);
|
|
7353
|
+
filesRecord[sha1] = {
|
|
7354
|
+
sha1,
|
|
7355
|
+
extension: file.name.split(".").pop() || "",
|
|
7356
|
+
file_type: file.type,
|
|
7357
|
+
size: file.size
|
|
7358
|
+
};
|
|
7006
7359
|
}
|
|
7360
|
+
store.dispatch(addFormSubmissions(offlineSubmissions));
|
|
7361
|
+
store.dispatch(addFormSubmissionAttachments(offlineAttachments));
|
|
7362
|
+
const promise = this.enqueueRequest({
|
|
7363
|
+
description: "Bulk add form submissions",
|
|
7364
|
+
method: HttpMethod.POST,
|
|
7365
|
+
url: `/forms/revisions/${form_revision}/bulk-respond/`,
|
|
7366
|
+
payload: {
|
|
7367
|
+
form_data: values,
|
|
7368
|
+
submitted_at: submittedAt,
|
|
7369
|
+
submissions: submissionsPayload,
|
|
7370
|
+
attachments: attachmentsPayload,
|
|
7371
|
+
files: Object.values(filesRecord)
|
|
7372
|
+
},
|
|
7373
|
+
blockers: componentOfflineIds,
|
|
7374
|
+
blocks: submissionOfflineIds
|
|
7375
|
+
});
|
|
7376
|
+
promise.then(({ submissions, attachments, presigned_urls }) => {
|
|
7377
|
+
store.dispatch(updateFormSubmissions(submissions));
|
|
7378
|
+
store.dispatch(updateFormSubmissionAttachments(attachments));
|
|
7379
|
+
for (const [sha1, presigned_url] of Object.entries(presigned_urls)) {
|
|
7380
|
+
const file = filesRecord[sha1];
|
|
7381
|
+
if (!file)
|
|
7382
|
+
continue;
|
|
7383
|
+
void this.enqueueRequest({
|
|
7384
|
+
url: presigned_url.url,
|
|
7385
|
+
description: "Upload file",
|
|
7386
|
+
method: HttpMethod.POST,
|
|
7387
|
+
isExternalUrl: true,
|
|
7388
|
+
isAuthNeeded: false,
|
|
7389
|
+
attachmentHash: sha1,
|
|
7390
|
+
blockers: [`s3-${file.sha1}.${file.extension}`],
|
|
7391
|
+
blocks: [sha1],
|
|
7392
|
+
s3url: presigned_url
|
|
7393
|
+
});
|
|
7394
|
+
}
|
|
7395
|
+
}).catch(() => {
|
|
7396
|
+
store.dispatch(deleteFormSubmissions(submissionOfflineIds));
|
|
7397
|
+
store.dispatch(deleteFormSubmissionAttachments(offlineAttachments.map((x) => x.offline_id)));
|
|
7398
|
+
});
|
|
7399
|
+
return [offlineSubmissions, promise.then(({ submissions }) => submissions)];
|
|
7400
|
+
}
|
|
7401
|
+
update(submission) {
|
|
7402
|
+
const { store } = this.client;
|
|
7403
|
+
const { values, files } = separateFilesFromValues(submission.values);
|
|
7007
7404
|
const attachFilesPromises = this.getAttachFilesPromises(files, submission);
|
|
7008
|
-
const
|
|
7009
|
-
...
|
|
7010
|
-
|
|
7405
|
+
const offlineSubmission = {
|
|
7406
|
+
...submission,
|
|
7407
|
+
values
|
|
7011
7408
|
};
|
|
7012
|
-
store.
|
|
7409
|
+
const submissionToBeUpdated = store.getState().formSubmissionReducer.formSubmissions[submission.offline_id];
|
|
7410
|
+
store.dispatch(updateFormSubmission(offlineSubmission));
|
|
7013
7411
|
const promise = this.enqueueRequest({
|
|
7014
7412
|
description: "Patch form submission",
|
|
7015
7413
|
method: HttpMethod.PATCH,
|
|
7016
7414
|
url: `/forms/submissions/${submission.offline_id}/`,
|
|
7017
|
-
payload:
|
|
7018
|
-
blockers: [
|
|
7415
|
+
payload: offlineSubmission,
|
|
7416
|
+
blockers: [offlineSubmission.issue, offlineSubmission.component, offlineSubmission.component_stage].filter(
|
|
7019
7417
|
(x) => x !== void 0
|
|
7020
7418
|
),
|
|
7021
|
-
blocks: [
|
|
7419
|
+
blocks: [offlineSubmission.offline_id]
|
|
7420
|
+
});
|
|
7421
|
+
promise.then((createdSubmission) => {
|
|
7422
|
+
store.dispatch(setFormSubmission(createdSubmission));
|
|
7423
|
+
}).catch(() => {
|
|
7424
|
+
store.dispatch(setFormSubmission(submissionToBeUpdated));
|
|
7022
7425
|
});
|
|
7023
|
-
return Promise.all([promise, ...attachFilesPromises]).then(() => promise);
|
|
7426
|
+
return [offlineSubmission, Promise.all([promise, ...attachFilesPromises]).then(() => promise)];
|
|
7024
7427
|
}
|
|
7025
7428
|
async delete(submissionId) {
|
|
7026
7429
|
const { store } = this.client;
|
|
7027
7430
|
const state = store.getState();
|
|
7028
|
-
const submission = state.
|
|
7029
|
-
store.dispatch(
|
|
7431
|
+
const submission = state.formSubmissionReducer.formSubmissions[submissionId];
|
|
7432
|
+
store.dispatch(deleteFormSubmission(submissionId));
|
|
7030
7433
|
store.dispatch(addActiveProjectFormSubmissionsCount(-1));
|
|
7031
7434
|
try {
|
|
7032
7435
|
return await this.enqueueRequest({
|
|
@@ -7037,10 +7440,8 @@ var __publicField = (obj, key, value) => {
|
|
|
7037
7440
|
blocks: []
|
|
7038
7441
|
});
|
|
7039
7442
|
} catch (e) {
|
|
7040
|
-
|
|
7041
|
-
|
|
7042
|
-
store.dispatch(updateOrCreateUserFormSubmission(submission));
|
|
7043
|
-
}
|
|
7443
|
+
store.dispatch(addActiveProjectFormSubmissionsCount(1));
|
|
7444
|
+
store.dispatch(addFormSubmission(submission));
|
|
7044
7445
|
throw e;
|
|
7045
7446
|
}
|
|
7046
7447
|
}
|
|
@@ -7054,7 +7455,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7054
7455
|
blockers: [],
|
|
7055
7456
|
blocks: []
|
|
7056
7457
|
});
|
|
7057
|
-
store.dispatch(
|
|
7458
|
+
store.dispatch(setFormSubmissions(submissions));
|
|
7058
7459
|
const attachments = await this.enqueueRequest({
|
|
7059
7460
|
description: "Fetch form attachments",
|
|
7060
7461
|
method: HttpMethod.GET,
|
|
@@ -7062,7 +7463,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7062
7463
|
blockers: [],
|
|
7063
7464
|
blocks: []
|
|
7064
7465
|
});
|
|
7065
|
-
store.dispatch(
|
|
7466
|
+
store.dispatch(setFormSubmissionAttachments(attachments));
|
|
7066
7467
|
}
|
|
7067
7468
|
}
|
|
7068
7469
|
class WorkspaceService extends BaseApiService {
|
|
@@ -13921,7 +14322,7 @@ var __publicField = (obj, key, value) => {
|
|
|
13921
14322
|
};
|
|
13922
14323
|
const useAttachImagesToFormRevisionFields = (revision) => {
|
|
13923
14324
|
const { sdk } = useSDK();
|
|
13924
|
-
const attachments = useAppSelector(
|
|
14325
|
+
const attachments = useAppSelector(selectAttachmentsOfFormRevision((revision == null ? void 0 : revision.offline_id) ?? ""));
|
|
13925
14326
|
return React.useMemo(() => {
|
|
13926
14327
|
if (!revision || !attachments)
|
|
13927
14328
|
return revision;
|
|
@@ -14018,7 +14419,7 @@ var __publicField = (obj, key, value) => {
|
|
|
14018
14419
|
return formRevisionToSchema(revisionWithImages, { readonly: true });
|
|
14019
14420
|
}, [revisionWithImages]);
|
|
14020
14421
|
const submissionValuesWithAttachments = React.useMemo(() => {
|
|
14021
|
-
const attachments =
|
|
14422
|
+
const attachments = selectAttachmentsOfFormSubmission(submission.offline_id)(sdk.store.getState()) ?? [];
|
|
14022
14423
|
const downloadedAttachments = {};
|
|
14023
14424
|
for (const attachment of attachments) {
|
|
14024
14425
|
const promise = sdk.files.fetchFileFromUrl(attachment.file, attachment.file_sha1, attachment.file_name);
|
|
@@ -14068,8 +14469,8 @@ var __publicField = (obj, key, value) => {
|
|
|
14068
14469
|
}
|
|
14069
14470
|
return ret;
|
|
14070
14471
|
}, [filter, maxResults, ownerFilter]);
|
|
14071
|
-
const userForms = useAppSelector(
|
|
14072
|
-
const userFormMapping = useAppSelector(
|
|
14472
|
+
const userForms = useAppSelector(selectFilteredForms(ownerFilterOptions)) ?? [];
|
|
14473
|
+
const userFormMapping = useAppSelector(selectFormMapping);
|
|
14073
14474
|
const attachableUserForms = userForms.filter((form) => !form.component_type);
|
|
14074
14475
|
const attachableUserFormMapping = Object.values(userFormMapping).filter(
|
|
14075
14476
|
(form) => !form.component_type
|
|
@@ -14102,7 +14503,7 @@ var __publicField = (obj, key, value) => {
|
|
|
14102
14503
|
const handleChange = React.useCallback((e) => {
|
|
14103
14504
|
setFilter(e.currentTarget.value);
|
|
14104
14505
|
}, []);
|
|
14105
|
-
const numberOfForms = useAppSelector(
|
|
14506
|
+
const numberOfForms = useAppSelector(selectGeneralFormCount) || 0;
|
|
14106
14507
|
const numberOfHiddenForms = numberOfForms - attachableUserForms.length;
|
|
14107
14508
|
const overflowMessage = attachableUserForms.length == maxResults && numberOfHiddenForms > 0 ? `Only the first ${maxResults} results are shown (${numberOfHiddenForms} hidden)` : numberOfHiddenForms > 0 && `${numberOfHiddenForms} hidden forms`;
|
|
14108
14509
|
return /* @__PURE__ */ jsxRuntime.jsxs(blocks.Flex, { ref, direction: "column", gap: "2", children: [
|
|
@@ -14196,16 +14597,13 @@ var __publicField = (obj, key, value) => {
|
|
|
14196
14597
|
const { submission, onSubmissionClick, compact, labelType, rowDecorator } = props;
|
|
14197
14598
|
const currentUser = useAppSelector(selectCurrentUser);
|
|
14198
14599
|
const createdBy = useAppSelector(selectUser("created_by" in submission ? submission.created_by : currentUser.id));
|
|
14199
|
-
const dateToUse =
|
|
14200
|
-
const formattedDateTime =
|
|
14201
|
-
hour: "2-digit",
|
|
14202
|
-
minute: "2-digit"
|
|
14203
|
-
}) : getLocalDateString(dateToUse);
|
|
14600
|
+
const dateToUse = submission.submitted_at;
|
|
14601
|
+
const formattedDateTime = getLocalDateString(dateToUse);
|
|
14204
14602
|
const revision = useAppSelector(selectFormRevision(submission.form_revision));
|
|
14205
14603
|
if (!revision) {
|
|
14206
14604
|
throw new Error(`Could not find revision ${submission.form_revision} for submission ${submission.offline_id}.`);
|
|
14207
14605
|
}
|
|
14208
|
-
const latestRevisionNumber = (_a2 = useAppSelector(
|
|
14606
|
+
const latestRevisionNumber = (_a2 = useAppSelector(selectLatestFormRevisionOfForm(revision.form))) == null ? void 0 : _a2.revision;
|
|
14209
14607
|
const creatorProfileSrc = useFileSrc({
|
|
14210
14608
|
file: (createdBy == null ? void 0 : createdBy.profile.file) ?? null,
|
|
14211
14609
|
fileSha1: (createdBy == null ? void 0 : createdBy.profile.file_sha1) ?? null
|
|
@@ -14236,10 +14634,6 @@ var __publicField = (obj, key, value) => {
|
|
|
14236
14634
|
return row;
|
|
14237
14635
|
});
|
|
14238
14636
|
FormSubmissionBrowserEntry.displayName = "FormSubmissionBrowserEntry";
|
|
14239
|
-
const getCreatedAtOrSubmittedAtDate = (submission) => {
|
|
14240
|
-
const date = "created_at" in submission ? submission.created_at : submission.submitted_at;
|
|
14241
|
-
return new Date(date);
|
|
14242
|
-
};
|
|
14243
14637
|
const FormSubmissionBrowser = React.memo((props) => {
|
|
14244
14638
|
const {
|
|
14245
14639
|
formId: formId2,
|
|
@@ -14253,10 +14647,10 @@ var __publicField = (obj, key, value) => {
|
|
|
14253
14647
|
if (!!formId2 === !!propSubmissions) {
|
|
14254
14648
|
throw new Error("Either formId or submissions must be provided, but not both.");
|
|
14255
14649
|
}
|
|
14256
|
-
const submissions = useAppSelector(propSubmissions ? () => propSubmissions :
|
|
14650
|
+
const submissions = useAppSelector(propSubmissions ? () => propSubmissions : selectFormSubmissionsOfForm(formId2));
|
|
14257
14651
|
const sortedSubmissions = React.useMemo(
|
|
14258
14652
|
() => submissions == null ? void 0 : submissions.sort((a, b) => {
|
|
14259
|
-
return
|
|
14653
|
+
return a.submitted_at.localeCompare(b.submitted_at);
|
|
14260
14654
|
}),
|
|
14261
14655
|
[submissions]
|
|
14262
14656
|
);
|
|
@@ -15573,6 +15967,7 @@ var __publicField = (obj, key, value) => {
|
|
|
15573
15967
|
exports2.VerificationCodeType = VerificationCodeType;
|
|
15574
15968
|
exports2.WorkspaceService = WorkspaceService;
|
|
15575
15969
|
exports2.YELLOW = YELLOW;
|
|
15970
|
+
exports2._selectLatestFormRevision = _selectLatestFormRevision;
|
|
15576
15971
|
exports2._setLatestRetryTime = _setLatestRetryTime;
|
|
15577
15972
|
exports2.acceptProjectInvite = acceptProjectInvite;
|
|
15578
15973
|
exports2.addActiveProjectFormSubmissionsCount = addActiveProjectFormSubmissionsCount;
|
|
@@ -15585,9 +15980,21 @@ var __publicField = (obj, key, value) => {
|
|
|
15585
15980
|
exports2.addComponentTypeAttachment = addComponentTypeAttachment;
|
|
15586
15981
|
exports2.addComponentTypeAttachments = addComponentTypeAttachments;
|
|
15587
15982
|
exports2.addComponentsInBatches = addComponentsInBatches;
|
|
15983
|
+
exports2.addDocumentAttachment = addDocumentAttachment;
|
|
15984
|
+
exports2.addDocumentAttachments = addDocumentAttachments;
|
|
15588
15985
|
exports2.addDocuments = addDocuments;
|
|
15589
15986
|
exports2.addEmailDomain = addEmailDomain;
|
|
15590
15987
|
exports2.addFavouriteProjectId = addFavouriteProjectId;
|
|
15988
|
+
exports2.addForm = addForm;
|
|
15989
|
+
exports2.addFormRevision = addFormRevision;
|
|
15990
|
+
exports2.addFormRevisionAttachment = addFormRevisionAttachment;
|
|
15991
|
+
exports2.addFormRevisionAttachments = addFormRevisionAttachments;
|
|
15992
|
+
exports2.addFormRevisions = addFormRevisions;
|
|
15993
|
+
exports2.addFormSubmission = addFormSubmission;
|
|
15994
|
+
exports2.addFormSubmissionAttachment = addFormSubmissionAttachment;
|
|
15995
|
+
exports2.addFormSubmissionAttachments = addFormSubmissionAttachments;
|
|
15996
|
+
exports2.addFormSubmissions = addFormSubmissions;
|
|
15997
|
+
exports2.addForms = addForms;
|
|
15591
15998
|
exports2.addIssue = addIssue;
|
|
15592
15999
|
exports2.addIssueAttachment = addIssueAttachment;
|
|
15593
16000
|
exports2.addIssueAttachments = addIssueAttachments;
|
|
@@ -15608,13 +16015,6 @@ var __publicField = (obj, key, value) => {
|
|
|
15608
16015
|
exports2.addStageCompletions = addStageCompletions;
|
|
15609
16016
|
exports2.addStages = addStages;
|
|
15610
16017
|
exports2.addToRecentIssues = addToRecentIssues;
|
|
15611
|
-
exports2.addUserForm = addUserForm;
|
|
15612
|
-
exports2.addUserFormRevision = addUserFormRevision;
|
|
15613
|
-
exports2.addUserFormRevisionAttachment = addUserFormRevisionAttachment;
|
|
15614
|
-
exports2.addUserFormRevisions = addUserFormRevisions;
|
|
15615
|
-
exports2.addUserFormSubmissionAttachment = addUserFormSubmissionAttachment;
|
|
15616
|
-
exports2.addUserFormSubmissions = addUserFormSubmissions;
|
|
15617
|
-
exports2.addUserForms = addUserForms;
|
|
15618
16018
|
exports2.addUsers = addUsers;
|
|
15619
16019
|
exports2.addWorkspace = addWorkspace;
|
|
15620
16020
|
exports2.areArraysEqual = areArraysEqual;
|
|
@@ -15635,6 +16035,7 @@ var __publicField = (obj, key, value) => {
|
|
|
15635
16035
|
exports2.componentStageSlice = componentStageSlice;
|
|
15636
16036
|
exports2.componentTypeReducer = componentTypeReducer;
|
|
15637
16037
|
exports2.componentTypeSlice = componentTypeSlice;
|
|
16038
|
+
exports2.constructUploadedFilePayloads = constructUploadedFilePayloads;
|
|
15638
16039
|
exports2.coordinatesAreEqual = coordinatesAreEqual;
|
|
15639
16040
|
exports2.coordinatesToLiteral = coordinatesToLiteral;
|
|
15640
16041
|
exports2.coordinatesToPointGeometry = coordinatesToPointGeometry;
|
|
@@ -15645,12 +16046,16 @@ var __publicField = (obj, key, value) => {
|
|
|
15645
16046
|
exports2.defaultBadgeColor = defaultBadgeColor;
|
|
15646
16047
|
exports2.defaultStore = defaultStore;
|
|
15647
16048
|
exports2.deleteComponentType = deleteComponentType;
|
|
16049
|
+
exports2.deleteForm = deleteForm;
|
|
16050
|
+
exports2.deleteFormRevision = deleteFormRevision;
|
|
16051
|
+
exports2.deleteFormRevisionAttachment = deleteFormRevisionAttachment;
|
|
16052
|
+
exports2.deleteFormRevisionAttachments = deleteFormRevisionAttachments;
|
|
16053
|
+
exports2.deleteFormRevisions = deleteFormRevisions;
|
|
16054
|
+
exports2.deleteFormSubmission = deleteFormSubmission;
|
|
16055
|
+
exports2.deleteFormSubmissionAttachment = deleteFormSubmissionAttachment;
|
|
16056
|
+
exports2.deleteFormSubmissionAttachments = deleteFormSubmissionAttachments;
|
|
16057
|
+
exports2.deleteFormSubmissions = deleteFormSubmissions;
|
|
15648
16058
|
exports2.deleteProject = deleteProject;
|
|
15649
|
-
exports2.deleteUserForm = deleteUserForm;
|
|
15650
|
-
exports2.deleteUserFormRevision = deleteUserFormRevision;
|
|
15651
|
-
exports2.deleteUserFormRevisions = deleteUserFormRevisions;
|
|
15652
|
-
exports2.deleteUserFormSubmission = deleteUserFormSubmission;
|
|
15653
|
-
exports2.deleteUserFormSubmissions = deleteUserFormSubmissions;
|
|
15654
16059
|
exports2.dequeue = dequeue;
|
|
15655
16060
|
exports2.deserialize = deserialize;
|
|
15656
16061
|
exports2.deserializeField = deserializeField;
|
|
@@ -15679,7 +16084,13 @@ var __publicField = (obj, key, value) => {
|
|
|
15679
16084
|
exports2.fileSlice = fileSlice;
|
|
15680
16085
|
exports2.fileToBlob = fileToBlob;
|
|
15681
16086
|
exports2.flipCoordinates = flipCoordinates;
|
|
16087
|
+
exports2.formReducer = formReducer;
|
|
16088
|
+
exports2.formRevisionReducer = formRevisionReducer;
|
|
15682
16089
|
exports2.formRevisionToSchema = formRevisionToSchema;
|
|
16090
|
+
exports2.formRevisionsSlice = formRevisionsSlice;
|
|
16091
|
+
exports2.formSlice = formSlice;
|
|
16092
|
+
exports2.formSubmissionReducer = formSubmissionReducer;
|
|
16093
|
+
exports2.formSubmissionSlice = formSubmissionSlice;
|
|
15683
16094
|
exports2.forms = index;
|
|
15684
16095
|
exports2.fullComponentMarkerSize = fullComponentMarkerSize;
|
|
15685
16096
|
exports2.generateBadgeColors = generateBadgeColors;
|
|
@@ -15748,11 +16159,14 @@ var __publicField = (obj, key, value) => {
|
|
|
15748
16159
|
exports2.removeComponentAttachments = removeComponentAttachments;
|
|
15749
16160
|
exports2.removeComponentTypeAttachment = removeComponentTypeAttachment;
|
|
15750
16161
|
exports2.removeComponentTypeAttachments = removeComponentTypeAttachments;
|
|
16162
|
+
exports2.removeDocumentAttachment = removeDocumentAttachment;
|
|
16163
|
+
exports2.removeDocumentAttachments = removeDocumentAttachments;
|
|
15751
16164
|
exports2.removeDocuments = removeDocuments;
|
|
15752
16165
|
exports2.removeEmailDomain = removeEmailDomain;
|
|
15753
16166
|
exports2.removeFavouriteProjectId = removeFavouriteProjectId;
|
|
15754
16167
|
exports2.removeIssue = removeIssue;
|
|
15755
16168
|
exports2.removeIssueAttachment = removeIssueAttachment;
|
|
16169
|
+
exports2.removeIssueAttachments = removeIssueAttachments;
|
|
15756
16170
|
exports2.removeIssueComment = removeIssueComment;
|
|
15757
16171
|
exports2.removeIssueComments = removeIssueComments;
|
|
15758
16172
|
exports2.removeIssueUpdate = removeIssueUpdate;
|
|
@@ -15795,6 +16209,7 @@ var __publicField = (obj, key, value) => {
|
|
|
15795
16209
|
exports2.selectAllAttachments = selectAllAttachments;
|
|
15796
16210
|
exports2.selectAllComponentAttachments = selectAllComponentAttachments;
|
|
15797
16211
|
exports2.selectAllComponentTypeAttachments = selectAllComponentTypeAttachments;
|
|
16212
|
+
exports2.selectAllDocumentAttachments = selectAllDocumentAttachments;
|
|
15798
16213
|
exports2.selectAllProjectAttachments = selectAllProjectAttachments;
|
|
15799
16214
|
exports2.selectAncestorIdsOfDocument = selectAncestorIdsOfDocument;
|
|
15800
16215
|
exports2.selectAppearance = selectAppearance;
|
|
@@ -15802,6 +16217,10 @@ var __publicField = (obj, key, value) => {
|
|
|
15802
16217
|
exports2.selectAttachmentsOfComponentByType = selectAttachmentsOfComponentByType;
|
|
15803
16218
|
exports2.selectAttachmentsOfComponentType = selectAttachmentsOfComponentType;
|
|
15804
16219
|
exports2.selectAttachmentsOfComponentTypeByType = selectAttachmentsOfComponentTypeByType;
|
|
16220
|
+
exports2.selectAttachmentsOfDocument = selectAttachmentsOfDocument;
|
|
16221
|
+
exports2.selectAttachmentsOfDocumentByType = selectAttachmentsOfDocumentByType;
|
|
16222
|
+
exports2.selectAttachmentsOfFormRevision = selectAttachmentsOfFormRevision;
|
|
16223
|
+
exports2.selectAttachmentsOfFormSubmission = selectAttachmentsOfFormSubmission;
|
|
15805
16224
|
exports2.selectAttachmentsOfIssue = selectAttachmentsOfIssue;
|
|
15806
16225
|
exports2.selectAttachmentsOfIssueByType = selectAttachmentsOfIssueByType;
|
|
15807
16226
|
exports2.selectAttachmentsOfProject = selectAttachmentsOfProject;
|
|
@@ -15817,11 +16236,11 @@ var __publicField = (obj, key, value) => {
|
|
|
15817
16236
|
exports2.selectCompletedStageIdsForComponent = selectCompletedStageIdsForComponent;
|
|
15818
16237
|
exports2.selectCompletedStages = selectCompletedStages;
|
|
15819
16238
|
exports2.selectComponent = selectComponent;
|
|
16239
|
+
exports2.selectComponentAttachment = selectComponentAttachment;
|
|
15820
16240
|
exports2.selectComponentAttachmentMapping = selectComponentAttachmentMapping;
|
|
15821
|
-
exports2.selectComponentSubmissionMapping = selectComponentSubmissionMapping;
|
|
15822
16241
|
exports2.selectComponentType = selectComponentType;
|
|
16242
|
+
exports2.selectComponentTypeAttachment = selectComponentTypeAttachment;
|
|
15823
16243
|
exports2.selectComponentTypeAttachmentMapping = selectComponentTypeAttachmentMapping;
|
|
15824
|
-
exports2.selectComponentTypeForm = selectComponentTypeForm;
|
|
15825
16244
|
exports2.selectComponentTypeFromComponent = selectComponentTypeFromComponent;
|
|
15826
16245
|
exports2.selectComponentTypeFromComponents = selectComponentTypeFromComponents;
|
|
15827
16246
|
exports2.selectComponentTypeStagesMapping = selectComponentTypeStagesMapping;
|
|
@@ -15837,6 +16256,8 @@ var __publicField = (obj, key, value) => {
|
|
|
15837
16256
|
exports2.selectCurrentUser = selectCurrentUser;
|
|
15838
16257
|
exports2.selectDeletedRequests = selectDeletedRequests;
|
|
15839
16258
|
exports2.selectDocument = selectDocument;
|
|
16259
|
+
exports2.selectDocumentAttachment = selectDocumentAttachment;
|
|
16260
|
+
exports2.selectDocumentAttachmentMapping = selectDocumentAttachmentMapping;
|
|
15840
16261
|
exports2.selectDocuments = selectDocuments;
|
|
15841
16262
|
exports2.selectDocumentsMapping = selectDocumentsMapping;
|
|
15842
16263
|
exports2.selectEmailDomainsAsMapping = selectEmailDomainsAsMapping;
|
|
@@ -15849,8 +16270,24 @@ var __publicField = (obj, key, value) => {
|
|
|
15849
16270
|
exports2.selectExpandedSections = selectExpandedSections;
|
|
15850
16271
|
exports2.selectFavouriteProjects = selectFavouriteProjects;
|
|
15851
16272
|
exports2.selectFileAttachmentsOfIssue = selectFileAttachmentsOfIssue;
|
|
15852
|
-
exports2.
|
|
16273
|
+
exports2.selectFilteredForms = selectFilteredForms;
|
|
16274
|
+
exports2.selectForm = selectForm;
|
|
16275
|
+
exports2.selectFormMapping = selectFormMapping;
|
|
16276
|
+
exports2.selectFormOfComponentType = selectFormOfComponentType;
|
|
15853
16277
|
exports2.selectFormRevision = selectFormRevision;
|
|
16278
|
+
exports2.selectFormRevisionMapping = selectFormRevisionMapping;
|
|
16279
|
+
exports2.selectFormRevisions = selectFormRevisions;
|
|
16280
|
+
exports2.selectFormRevisionsOfForm = selectFormRevisionsOfForm;
|
|
16281
|
+
exports2.selectFormSubmission = selectFormSubmission;
|
|
16282
|
+
exports2.selectFormSubmissionAttachmentsMapping = selectFormSubmissionAttachmentsMapping;
|
|
16283
|
+
exports2.selectFormSubmissions = selectFormSubmissions;
|
|
16284
|
+
exports2.selectFormSubmissionsByComponents = selectFormSubmissionsByComponents;
|
|
16285
|
+
exports2.selectFormSubmissionsMapping = selectFormSubmissionsMapping;
|
|
16286
|
+
exports2.selectFormSubmissionsOfComponent = selectFormSubmissionsOfComponent;
|
|
16287
|
+
exports2.selectFormSubmissionsOfForm = selectFormSubmissionsOfForm;
|
|
16288
|
+
exports2.selectFormSubmissionsOfIssue = selectFormSubmissionsOfIssue;
|
|
16289
|
+
exports2.selectFormsCount = selectFormsCount;
|
|
16290
|
+
exports2.selectGeneralFormCount = selectGeneralFormCount;
|
|
15854
16291
|
exports2.selectHiddenCategoryCount = selectHiddenCategoryCount;
|
|
15855
16292
|
exports2.selectHiddenComponentTypeIds = selectHiddenComponentTypeIds;
|
|
15856
16293
|
exports2.selectIsFetchingInitialData = selectIsFetchingInitialData;
|
|
@@ -15858,16 +16295,17 @@ var __publicField = (obj, key, value) => {
|
|
|
15858
16295
|
exports2.selectIsLoading = selectIsLoading;
|
|
15859
16296
|
exports2.selectIsLoggedIn = selectIsLoggedIn;
|
|
15860
16297
|
exports2.selectIssue = selectIssue;
|
|
16298
|
+
exports2.selectIssueAttachment = selectIssueAttachment;
|
|
15861
16299
|
exports2.selectIssueAttachmentMapping = selectIssueAttachmentMapping;
|
|
15862
16300
|
exports2.selectIssueAttachments = selectIssueAttachments;
|
|
15863
16301
|
exports2.selectIssueMapping = selectIssueMapping;
|
|
15864
16302
|
exports2.selectIssueUpdateMapping = selectIssueUpdateMapping;
|
|
15865
16303
|
exports2.selectIssueUpdatesOfIssue = selectIssueUpdatesOfIssue;
|
|
15866
16304
|
exports2.selectIssues = selectIssues;
|
|
15867
|
-
exports2.
|
|
16305
|
+
exports2.selectLatestFormRevisionByForm = selectLatestFormRevisionByForm;
|
|
16306
|
+
exports2.selectLatestFormRevisionOfForm = selectLatestFormRevisionOfForm;
|
|
16307
|
+
exports2.selectLatestFormRevisionsOfComponentTypes = selectLatestFormRevisionsOfComponentTypes;
|
|
15868
16308
|
exports2.selectLatestRetryTime = selectLatestRetryTime;
|
|
15869
|
-
exports2.selectLatestRevisionByFormId = selectLatestRevisionByFormId;
|
|
15870
|
-
exports2.selectLatestRevisionsFromComponentTypeIds = selectLatestRevisionsFromComponentTypeIds;
|
|
15871
16309
|
exports2.selectLicense = selectLicense;
|
|
15872
16310
|
exports2.selectLicenseForProject = selectLicenseForProject;
|
|
15873
16311
|
exports2.selectLicenses = selectLicenses;
|
|
@@ -15876,8 +16314,6 @@ var __publicField = (obj, key, value) => {
|
|
|
15876
16314
|
exports2.selectMapStyle = selectMapStyle;
|
|
15877
16315
|
exports2.selectNumberOfComponentTypesMatchingCaseInsensitiveName = selectNumberOfComponentTypesMatchingCaseInsensitiveName;
|
|
15878
16316
|
exports2.selectNumberOfComponentsOfComponentType = selectNumberOfComponentsOfComponentType;
|
|
15879
|
-
exports2.selectNumberOfGeneralUserForms = selectNumberOfGeneralUserForms;
|
|
15880
|
-
exports2.selectNumberOfUserForms = selectNumberOfUserForms;
|
|
15881
16317
|
exports2.selectOrganization = selectOrganization;
|
|
15882
16318
|
exports2.selectOrganizationAccess = selectOrganizationAccess;
|
|
15883
16319
|
exports2.selectOrganizationAccessForUser = selectOrganizationAccessForUser;
|
|
@@ -15905,8 +16341,6 @@ var __publicField = (obj, key, value) => {
|
|
|
15905
16341
|
exports2.selectRecentIssuesAsSearchResults = selectRecentIssuesAsSearchResults;
|
|
15906
16342
|
exports2.selectRecentProjects = selectRecentProjects;
|
|
15907
16343
|
exports2.selectRehydrated = selectRehydrated;
|
|
15908
|
-
exports2.selectRevisionAttachments = selectRevisionAttachments;
|
|
15909
|
-
exports2.selectRevisionsForForm = selectRevisionsForForm;
|
|
15910
16344
|
exports2.selectRootDocuments = selectRootDocuments;
|
|
15911
16345
|
exports2.selectShowTooltips = selectShowTooltips;
|
|
15912
16346
|
exports2.selectSortedEmailDomains = selectSortedEmailDomains;
|
|
@@ -15921,16 +16355,10 @@ var __publicField = (obj, key, value) => {
|
|
|
15921
16355
|
exports2.selectStagesFromComponentType = selectStagesFromComponentType;
|
|
15922
16356
|
exports2.selectStagesFromComponentTypeIds = selectStagesFromComponentTypeIds;
|
|
15923
16357
|
exports2.selectStagesFromStageIds = selectStagesFromStageIds;
|
|
15924
|
-
exports2.selectSubmissionAttachments = selectSubmissionAttachments;
|
|
15925
|
-
exports2.selectSubmissionsForComponent = selectSubmissionsForComponent;
|
|
15926
|
-
exports2.selectSubmissionsForForm = selectSubmissionsForForm;
|
|
15927
|
-
exports2.selectSubmissionsForIssue = selectSubmissionsForIssue;
|
|
15928
16358
|
exports2.selectUploadUrl = selectUploadUrl;
|
|
15929
16359
|
exports2.selectUsedColors = selectUsedColors;
|
|
15930
16360
|
exports2.selectUser = selectUser;
|
|
15931
|
-
exports2.
|
|
15932
|
-
exports2.selectUserFormMapping = selectUserFormMapping;
|
|
15933
|
-
exports2.selectUserFormSubmission = selectUserFormSubmission;
|
|
16361
|
+
exports2.selectUserFormRevisionAttachmentsMapping = selectUserFormRevisionAttachmentsMapping;
|
|
15934
16362
|
exports2.selectUsersAsMapping = selectUsersAsMapping;
|
|
15935
16363
|
exports2.selectVisibleStatuses = selectVisibleStatuses;
|
|
15936
16364
|
exports2.selectVisibleUserIds = selectVisibleUserIds;
|
|
@@ -15951,11 +16379,19 @@ var __publicField = (obj, key, value) => {
|
|
|
15951
16379
|
exports2.setComponents = setComponents;
|
|
15952
16380
|
exports2.setCreateProjectType = setCreateProjectType;
|
|
15953
16381
|
exports2.setCurrentUser = setCurrentUser;
|
|
16382
|
+
exports2.setDocumentAttachments = setDocumentAttachments;
|
|
15954
16383
|
exports2.setDocuments = setDocuments;
|
|
15955
16384
|
exports2.setEmailDomains = setEmailDomains;
|
|
15956
16385
|
exports2.setEnableClustering = setEnableClustering;
|
|
15957
16386
|
exports2.setEnableDuplicateIssues = setEnableDuplicateIssues;
|
|
15958
16387
|
exports2.setEnablePlacementMode = setEnablePlacementMode;
|
|
16388
|
+
exports2.setFormRevision = setFormRevision;
|
|
16389
|
+
exports2.setFormRevisionAttachments = setFormRevisionAttachments;
|
|
16390
|
+
exports2.setFormRevisions = setFormRevisions;
|
|
16391
|
+
exports2.setFormSubmission = setFormSubmission;
|
|
16392
|
+
exports2.setFormSubmissionAttachments = setFormSubmissionAttachments;
|
|
16393
|
+
exports2.setFormSubmissions = setFormSubmissions;
|
|
16394
|
+
exports2.setForms = setForms;
|
|
15959
16395
|
exports2.setIsFetchingInitialData = setIsFetchingInitialData;
|
|
15960
16396
|
exports2.setIsImportingProjectFile = setIsImportingProjectFile;
|
|
15961
16397
|
exports2.setIsLoading = setIsLoading;
|
|
@@ -15980,9 +16416,6 @@ var __publicField = (obj, key, value) => {
|
|
|
15980
16416
|
exports2.setTokens = setTokens;
|
|
15981
16417
|
exports2.setTourStep = setTourStep;
|
|
15982
16418
|
exports2.setUploadUrl = setUploadUrl;
|
|
15983
|
-
exports2.setUserFormRevisionAttachments = setUserFormRevisionAttachments;
|
|
15984
|
-
exports2.setUserFormSubmissionAttachments = setUserFormSubmissionAttachments;
|
|
15985
|
-
exports2.setUserFormSubmissions = setUserFormSubmissions;
|
|
15986
16419
|
exports2.setUsers = setUsers;
|
|
15987
16420
|
exports2.setVisibleStatuses = setVisibleStatuses;
|
|
15988
16421
|
exports2.setVisibleUserIds = setVisibleUserIds;
|
|
@@ -16005,12 +16438,16 @@ var __publicField = (obj, key, value) => {
|
|
|
16005
16438
|
exports2.updateComponent = updateComponent;
|
|
16006
16439
|
exports2.updateComponentAttachment = updateComponentAttachment;
|
|
16007
16440
|
exports2.updateComponentTypeAttachment = updateComponentTypeAttachment;
|
|
16441
|
+
exports2.updateDocumentAttachment = updateDocumentAttachment;
|
|
16008
16442
|
exports2.updateDocuments = updateDocuments;
|
|
16443
|
+
exports2.updateFormSubmission = updateFormSubmission;
|
|
16444
|
+
exports2.updateFormSubmissionAttachments = updateFormSubmissionAttachments;
|
|
16445
|
+
exports2.updateFormSubmissions = updateFormSubmissions;
|
|
16009
16446
|
exports2.updateIssue = updateIssue;
|
|
16010
16447
|
exports2.updateIssueAttachment = updateIssueAttachment;
|
|
16448
|
+
exports2.updateIssueAttachments = updateIssueAttachments;
|
|
16011
16449
|
exports2.updateLicense = updateLicense;
|
|
16012
16450
|
exports2.updateOrCreateProject = updateOrCreateProject;
|
|
16013
|
-
exports2.updateOrCreateUserFormSubmission = updateOrCreateUserFormSubmission;
|
|
16014
16451
|
exports2.updateOrganizationAccess = updateOrganizationAccess;
|
|
16015
16452
|
exports2.updateProjectAccess = updateProjectAccess;
|
|
16016
16453
|
exports2.updateProjectAttachment = updateProjectAttachment;
|
|
@@ -16024,8 +16461,6 @@ var __publicField = (obj, key, value) => {
|
|
|
16024
16461
|
exports2.useFormikInput = useFormikInput;
|
|
16025
16462
|
exports2.useMemoCompare = useMemoCompare;
|
|
16026
16463
|
exports2.useSDK = useSDK;
|
|
16027
|
-
exports2.userFormReducer = userFormReducer;
|
|
16028
|
-
exports2.userFormSlice = userFormSlice;
|
|
16029
16464
|
exports2.userReducer = userReducer;
|
|
16030
16465
|
exports2.userSlice = userSlice;
|
|
16031
16466
|
exports2.valueIsFile = valueIsFile;
|