@overmap-ai/core 1.0.60-forms-removal.8 → 1.0.60-geo-images.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/overmap-core.js +383 -162
- package/dist/overmap-core.js.map +1 -1
- package/dist/overmap-core.umd.cjs +383 -162
- package/dist/overmap-core.umd.cjs.map +1 -1
- package/dist/sdk/services/BaseAttachmentService.d.ts +8 -4
- package/dist/sdk/services/BaseUploadService.d.ts +8 -0
- package/dist/sdk/services/GeoImageService.d.ts +14 -0
- package/dist/sdk/services/UserFormSubmissionService.d.ts +4 -5
- package/dist/sdk/services/index.d.ts +1 -0
- package/dist/sdk/typings.d.ts +2 -1
- package/dist/store/slices/geoImageSlice.d.ts +48 -0
- package/dist/store/slices/index.d.ts +1 -0
- package/dist/store/store.d.ts +2 -1
- package/dist/typings/models/geoImages.d.ts +11 -0
- package/dist/typings/models/index.d.ts +1 -0
- package/dist/typings/models/store.d.ts +2 -2
- package/package.json +1 -1
package/dist/overmap-core.js
CHANGED
|
@@ -379,15 +379,15 @@ const wrapMigration = (migrator) => (state) => {
|
|
|
379
379
|
};
|
|
380
380
|
const migrations = [initialVersioning, signOut, signOut, createOutboxState];
|
|
381
381
|
const manifest = Object.fromEntries(migrations.map((migration2, i) => [i, wrapMigration(migration2)]));
|
|
382
|
-
const initialState$
|
|
382
|
+
const initialState$B = {
|
|
383
383
|
accessToken: "",
|
|
384
384
|
refreshToken: "",
|
|
385
385
|
isLoggedIn: false
|
|
386
386
|
};
|
|
387
387
|
const authSlice = createSlice({
|
|
388
388
|
name: "auth",
|
|
389
|
-
initialState: initialState$
|
|
390
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
389
|
+
initialState: initialState$B,
|
|
390
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$B)),
|
|
391
391
|
reducers: {
|
|
392
392
|
setTokens: (state, action) => {
|
|
393
393
|
state.accessToken = action.payload.accessToken;
|
|
@@ -854,7 +854,7 @@ function createModelAdapter(computeModelId) {
|
|
|
854
854
|
};
|
|
855
855
|
}
|
|
856
856
|
const categoryAdapter = createModelAdapter((category) => category.offline_id);
|
|
857
|
-
const initialState$
|
|
857
|
+
const initialState$A = categoryAdapter.getInitialState({
|
|
858
858
|
categoryVisibility: {
|
|
859
859
|
hiddenCategoryIds: [],
|
|
860
860
|
isNullCategoryHidden: false
|
|
@@ -862,8 +862,8 @@ const initialState$z = categoryAdapter.getInitialState({
|
|
|
862
862
|
});
|
|
863
863
|
const categorySlice = createSlice({
|
|
864
864
|
name: "categories",
|
|
865
|
-
initialState: initialState$
|
|
866
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
865
|
+
initialState: initialState$A,
|
|
866
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$A)),
|
|
867
867
|
reducers: {
|
|
868
868
|
initializeCategories: (state, action) => {
|
|
869
869
|
categoryAdapter.initialize(state, action);
|
|
@@ -945,13 +945,13 @@ const selectIssueCountOfCategory = (categoryId) => (state) => {
|
|
|
945
945
|
};
|
|
946
946
|
const categoryReducer = categorySlice.reducer;
|
|
947
947
|
const assetTypeAdapter = createModelAdapter((assetType) => assetType.offline_id);
|
|
948
|
-
const initialState$
|
|
948
|
+
const initialState$z = assetTypeAdapter.getInitialState({
|
|
949
949
|
hiddenAssetTypeIds: {}
|
|
950
950
|
});
|
|
951
951
|
const assetTypeSlice = createSlice({
|
|
952
952
|
name: "assetTypes",
|
|
953
|
-
initialState: initialState$
|
|
954
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
953
|
+
initialState: initialState$z,
|
|
954
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$z)),
|
|
955
955
|
reducers: {
|
|
956
956
|
initializeAssetTypes: assetTypeAdapter.initialize,
|
|
957
957
|
addAssetType: assetTypeAdapter.addOne,
|
|
@@ -1000,11 +1000,11 @@ const selectAssetTypesByName = restructureCreateSelectorWithArgs(
|
|
|
1000
1000
|
const selectHiddenAssetTypeIds = (state) => state.assetTypeReducer.hiddenAssetTypeIds;
|
|
1001
1001
|
const assetTypeReducer = assetTypeSlice.reducer;
|
|
1002
1002
|
const assetAdapter = createModelAdapter((asset) => asset.offline_id);
|
|
1003
|
-
const initialState$
|
|
1003
|
+
const initialState$y = assetAdapter.getInitialState({});
|
|
1004
1004
|
const assetSlice = createSlice({
|
|
1005
1005
|
name: "assets",
|
|
1006
|
-
initialState: initialState$
|
|
1007
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1006
|
+
initialState: initialState$y,
|
|
1007
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$y)),
|
|
1008
1008
|
reducers: {
|
|
1009
1009
|
initializeAssets: (state, action) => {
|
|
1010
1010
|
assetAdapter.initialize(state, action);
|
|
@@ -1107,11 +1107,11 @@ const selectAssetTypesFromIds = (assetTypeIds) => (state) => {
|
|
|
1107
1107
|
};
|
|
1108
1108
|
const assetReducer = assetSlice.reducer;
|
|
1109
1109
|
const assetAttachmentAdapter = createModelAdapter((attachment) => attachment.offline_id);
|
|
1110
|
-
const initialState$
|
|
1110
|
+
const initialState$x = assetAttachmentAdapter.getInitialState({});
|
|
1111
1111
|
const assetAttachmentSlice = createSlice({
|
|
1112
1112
|
name: "assetAttachments",
|
|
1113
|
-
initialState: initialState$
|
|
1114
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1113
|
+
initialState: initialState$x,
|
|
1114
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$x)),
|
|
1115
1115
|
reducers: {
|
|
1116
1116
|
initializeAssetAttachments: assetAttachmentAdapter.initialize,
|
|
1117
1117
|
addAssetAttachment: assetAttachmentAdapter.addOne,
|
|
@@ -1169,13 +1169,13 @@ const selectAttachmentsOfAssetByType = restructureCreateSelectorWithArgs(
|
|
|
1169
1169
|
)
|
|
1170
1170
|
);
|
|
1171
1171
|
const assetAttachmentReducer = assetAttachmentSlice.reducer;
|
|
1172
|
-
const initialState$
|
|
1172
|
+
const initialState$w = {
|
|
1173
1173
|
completionsByAssetId: {}
|
|
1174
1174
|
};
|
|
1175
1175
|
const assetStageCompletionSlice = createSlice({
|
|
1176
1176
|
name: "assetStageCompletions",
|
|
1177
|
-
initialState: initialState$
|
|
1178
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1177
|
+
initialState: initialState$w,
|
|
1178
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$w)),
|
|
1179
1179
|
reducers: {
|
|
1180
1180
|
addStageCompletion: (state, action) => {
|
|
1181
1181
|
let stageToCompletionDateMapping = state.completionsByAssetId[action.payload.asset];
|
|
@@ -1227,11 +1227,11 @@ const selectCompletedStageIdsForAsset = restructureCreateSelectorWithArgs(
|
|
|
1227
1227
|
);
|
|
1228
1228
|
const assetStageCompletionReducer = assetStageCompletionSlice.reducer;
|
|
1229
1229
|
const assetStageAdapter = createModelAdapter((assetStage) => assetStage.offline_id);
|
|
1230
|
-
const initialState$
|
|
1230
|
+
const initialState$v = assetStageAdapter.getInitialState({});
|
|
1231
1231
|
const assetStageSlice = createSlice({
|
|
1232
1232
|
name: "assetStages",
|
|
1233
|
-
initialState: initialState$
|
|
1234
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1233
|
+
initialState: initialState$v,
|
|
1234
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$v)),
|
|
1235
1235
|
reducers: {
|
|
1236
1236
|
initializeStages: assetStageAdapter.initialize,
|
|
1237
1237
|
setStage: assetStageAdapter.setOne,
|
|
@@ -1312,11 +1312,11 @@ const assetStageReducer = assetStageSlice.reducer;
|
|
|
1312
1312
|
const assetTypeAttachmentAdapter = createModelAdapter(
|
|
1313
1313
|
(attachment) => attachment.offline_id
|
|
1314
1314
|
);
|
|
1315
|
-
const initialState$
|
|
1315
|
+
const initialState$u = assetTypeAttachmentAdapter.getInitialState({});
|
|
1316
1316
|
const assetTypeAttachmentSlice = createSlice({
|
|
1317
1317
|
name: "assetTypeAttachments",
|
|
1318
|
-
initialState: initialState$
|
|
1319
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1318
|
+
initialState: initialState$u,
|
|
1319
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$u)),
|
|
1320
1320
|
reducers: {
|
|
1321
1321
|
initializeAssetTypeAttachments: assetTypeAttachmentAdapter.initialize,
|
|
1322
1322
|
addAssetTypeAttachment: assetTypeAttachmentAdapter.addOne,
|
|
@@ -1375,12 +1375,12 @@ const selectAttachmentsOfAssetTypeByType = restructureCreateSelectorWithArgs(
|
|
|
1375
1375
|
);
|
|
1376
1376
|
const assetTypeAttachmentReducer = assetTypeAttachmentSlice.reducer;
|
|
1377
1377
|
const workspaceAdapter = createModelAdapter((workspace) => workspace.offline_id);
|
|
1378
|
-
const initialState$
|
|
1378
|
+
const initialState$t = workspaceAdapter.getInitialState({
|
|
1379
1379
|
activeWorkspaceId: null
|
|
1380
1380
|
});
|
|
1381
1381
|
const workspaceSlice = createSlice({
|
|
1382
1382
|
name: "workspace",
|
|
1383
|
-
initialState: initialState$
|
|
1383
|
+
initialState: initialState$t,
|
|
1384
1384
|
reducers: {
|
|
1385
1385
|
initializeWorkspaces: workspaceAdapter.initialize,
|
|
1386
1386
|
setWorkspaces: workspaceAdapter.setMany,
|
|
@@ -1433,16 +1433,16 @@ const selectPermittedWorkspaceIds = createSelector(
|
|
|
1433
1433
|
const workspaceReducer = workspaceSlice.reducer;
|
|
1434
1434
|
const maxRecentIssues = 10;
|
|
1435
1435
|
const issueAdapter = createModelAdapter((issue) => issue.offline_id);
|
|
1436
|
-
const initialState$
|
|
1436
|
+
const initialState$s = issueAdapter.getInitialState({
|
|
1437
1437
|
visibleStatuses: [IssueStatus.BACKLOG, IssueStatus.SELECTED],
|
|
1438
1438
|
visibleUserIds: null,
|
|
1439
1439
|
recentIssueIds: []
|
|
1440
1440
|
});
|
|
1441
1441
|
const issueSlice = createSlice({
|
|
1442
1442
|
name: "issues",
|
|
1443
|
-
initialState: initialState$
|
|
1443
|
+
initialState: initialState$s,
|
|
1444
1444
|
extraReducers: (builder) => builder.addCase("RESET", (state) => {
|
|
1445
|
-
Object.assign(state, initialState$
|
|
1445
|
+
Object.assign(state, initialState$s);
|
|
1446
1446
|
}),
|
|
1447
1447
|
reducers: {
|
|
1448
1448
|
initializeIssues: issueAdapter.initialize,
|
|
@@ -1639,12 +1639,12 @@ const selectRecentIssuesAsSearchResults = createSelector(
|
|
|
1639
1639
|
);
|
|
1640
1640
|
const issueReducer = issueSlice.reducer;
|
|
1641
1641
|
const issueTypeAdapter = createModelAdapter((issueType) => issueType.offline_id);
|
|
1642
|
-
const initialState$
|
|
1642
|
+
const initialState$r = issueTypeAdapter.getInitialState({});
|
|
1643
1643
|
const issueTypeSlice = createSlice({
|
|
1644
1644
|
name: "issueTypes",
|
|
1645
|
-
initialState: initialState$
|
|
1645
|
+
initialState: initialState$r,
|
|
1646
1646
|
extraReducers: (builder) => builder.addCase("RESET", (state) => {
|
|
1647
|
-
Object.assign(state, initialState$
|
|
1647
|
+
Object.assign(state, initialState$r);
|
|
1648
1648
|
}),
|
|
1649
1649
|
reducers: {
|
|
1650
1650
|
initializeIssueTypes: issueTypeAdapter.initialize,
|
|
@@ -1693,15 +1693,15 @@ const selectIssuesOfIssueTypeCount = (issueTypeId) => (state) => {
|
|
|
1693
1693
|
return ((_a2 = selectIssuesOfIssueType(issueTypeId)(state)) == null ? void 0 : _a2.length) ?? 0;
|
|
1694
1694
|
};
|
|
1695
1695
|
const issueTypeReducer = issueTypeSlice.reducer;
|
|
1696
|
-
const initialState$
|
|
1696
|
+
const initialState$q = {
|
|
1697
1697
|
s3Urls: {}
|
|
1698
1698
|
};
|
|
1699
1699
|
const msPerHour = 1e3 * 60 * 60;
|
|
1700
1700
|
const msPerWeek = msPerHour * 24 * 7;
|
|
1701
1701
|
const fileSlice = createSlice({
|
|
1702
1702
|
name: "file",
|
|
1703
|
-
initialState: initialState$
|
|
1704
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1703
|
+
initialState: initialState$q,
|
|
1704
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$q)),
|
|
1705
1705
|
reducers: {
|
|
1706
1706
|
setUploadUrl: (state, action) => {
|
|
1707
1707
|
const { url, fields, sha1 } = action.payload;
|
|
@@ -1782,7 +1782,7 @@ var LicenseStatus = /* @__PURE__ */ ((LicenseStatus2) => {
|
|
|
1782
1782
|
LicenseStatus2[LicenseStatus2["PAST_DUE"] = 8] = "PAST_DUE";
|
|
1783
1783
|
return LicenseStatus2;
|
|
1784
1784
|
})(LicenseStatus || {});
|
|
1785
|
-
const initialState$
|
|
1785
|
+
const initialState$p = {
|
|
1786
1786
|
users: {},
|
|
1787
1787
|
currentUser: {
|
|
1788
1788
|
id: 0,
|
|
@@ -1793,8 +1793,8 @@ const initialState$o = {
|
|
|
1793
1793
|
};
|
|
1794
1794
|
const userSlice = createSlice({
|
|
1795
1795
|
name: "users",
|
|
1796
|
-
initialState: initialState$
|
|
1797
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1796
|
+
initialState: initialState$p,
|
|
1797
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$p)),
|
|
1798
1798
|
reducers: {
|
|
1799
1799
|
setUsers: (state, action) => {
|
|
1800
1800
|
const usersMapping = {};
|
|
@@ -1859,11 +1859,11 @@ const userReducer = userSlice.reducer;
|
|
|
1859
1859
|
const organizationAccessAdapter = createModelAdapter(
|
|
1860
1860
|
(organizationAccess) => organizationAccess.offline_id
|
|
1861
1861
|
);
|
|
1862
|
-
const initialState$
|
|
1862
|
+
const initialState$o = organizationAccessAdapter.getInitialState({});
|
|
1863
1863
|
const organizationAccessSlice = createSlice({
|
|
1864
1864
|
name: "organizationAccess",
|
|
1865
|
-
initialState: initialState$
|
|
1866
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1865
|
+
initialState: initialState$o,
|
|
1866
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$o)),
|
|
1867
1867
|
reducers: {
|
|
1868
1868
|
initializeOrganizationAccesses: organizationAccessAdapter.initialize,
|
|
1869
1869
|
updateOrganizationAccess: organizationAccessAdapter.updateOne,
|
|
@@ -1900,11 +1900,11 @@ const selectOrganizationAccessUserMapping = (state) => {
|
|
|
1900
1900
|
};
|
|
1901
1901
|
const organizationAccessReducer = organizationAccessSlice.reducer;
|
|
1902
1902
|
const licenseAdapter = createModelAdapter((license) => license.offline_id);
|
|
1903
|
-
const initialState$
|
|
1903
|
+
const initialState$n = licenseAdapter.getInitialState({});
|
|
1904
1904
|
const licenseSlice = createSlice({
|
|
1905
1905
|
name: "license",
|
|
1906
|
-
initialState: initialState$
|
|
1907
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1906
|
+
initialState: initialState$n,
|
|
1907
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$n)),
|
|
1908
1908
|
reducers: {
|
|
1909
1909
|
setLicenses: licenseAdapter.initialize,
|
|
1910
1910
|
addLicenses: licenseAdapter.addMany,
|
|
@@ -1930,11 +1930,11 @@ const selectLicensesForProjectsMapping = createSelector(
|
|
|
1930
1930
|
);
|
|
1931
1931
|
const licenseReducer = licenseSlice.reducer;
|
|
1932
1932
|
const projectAccessAdapter = createModelAdapter((projectAccess) => projectAccess.offline_id);
|
|
1933
|
-
const initialState$
|
|
1933
|
+
const initialState$m = projectAccessAdapter.getInitialState({});
|
|
1934
1934
|
const projectAccessSlice = createSlice({
|
|
1935
1935
|
name: "projectAccess",
|
|
1936
|
-
initialState: initialState$
|
|
1937
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1936
|
+
initialState: initialState$m,
|
|
1937
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$m)),
|
|
1938
1938
|
reducers: {
|
|
1939
1939
|
setProjectAccesses: projectAccessAdapter.initialize,
|
|
1940
1940
|
updateProjectAccess: projectAccessAdapter.updateOne,
|
|
@@ -1980,7 +1980,7 @@ const selectProjectAccessUserMapping = (state) => {
|
|
|
1980
1980
|
return projectAccesses;
|
|
1981
1981
|
};
|
|
1982
1982
|
const projectAccessReducer = projectAccessSlice.reducer;
|
|
1983
|
-
const initialState$
|
|
1983
|
+
const initialState$l = {
|
|
1984
1984
|
projects: {},
|
|
1985
1985
|
activeProjectId: null,
|
|
1986
1986
|
recentProjectIds: [],
|
|
@@ -1988,7 +1988,7 @@ const initialState$k = {
|
|
|
1988
1988
|
};
|
|
1989
1989
|
const projectSlice = createSlice({
|
|
1990
1990
|
name: "projects",
|
|
1991
|
-
initialState: initialState$
|
|
1991
|
+
initialState: initialState$l,
|
|
1992
1992
|
reducers: {
|
|
1993
1993
|
setProjects: (state, action) => {
|
|
1994
1994
|
const projectsMap = {};
|
|
@@ -2117,14 +2117,14 @@ const selectSortedProjectUsers = createSelector(
|
|
|
2117
2117
|
});
|
|
2118
2118
|
}
|
|
2119
2119
|
);
|
|
2120
|
-
const initialState$
|
|
2120
|
+
const initialState$k = {
|
|
2121
2121
|
organizations: {},
|
|
2122
2122
|
activeOrganizationId: null
|
|
2123
2123
|
};
|
|
2124
2124
|
const organizationSlice = createSlice({
|
|
2125
2125
|
name: "organizations",
|
|
2126
|
-
initialState: initialState$
|
|
2127
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2126
|
+
initialState: initialState$k,
|
|
2127
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$k)),
|
|
2128
2128
|
reducers: {
|
|
2129
2129
|
setOrganizations: (state, action) => {
|
|
2130
2130
|
for (const org of action.payload) {
|
|
@@ -2244,14 +2244,14 @@ const createOfflineAction = (request2, baseUrl, serviceName) => {
|
|
|
2244
2244
|
}
|
|
2245
2245
|
};
|
|
2246
2246
|
};
|
|
2247
|
-
const initialState$
|
|
2247
|
+
const initialState$j = {
|
|
2248
2248
|
deletedRequests: [],
|
|
2249
2249
|
latestRetryTime: 0
|
|
2250
2250
|
};
|
|
2251
2251
|
const outboxSlice = createSlice({
|
|
2252
2252
|
name: "outbox",
|
|
2253
|
-
initialState: initialState$
|
|
2254
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2253
|
+
initialState: initialState$j,
|
|
2254
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$j)),
|
|
2255
2255
|
reducers: {
|
|
2256
2256
|
// enqueueActions is a reducer that does nothing but enqueue API request to the Redux Offline outbox
|
|
2257
2257
|
// Whenever an issue is being created, a reducer addIssue() is responsible for adding it to the offline store
|
|
@@ -2283,7 +2283,7 @@ const selectDeletedRequests = (state) => state.outboxReducer.deletedRequests;
|
|
|
2283
2283
|
const selectLatestRetryTime = (state) => state.outboxReducer.latestRetryTime;
|
|
2284
2284
|
const { enqueueRequest, markForDeletion, markAsDeleted, _setLatestRetryTime } = outboxSlice.actions;
|
|
2285
2285
|
const outboxReducer = outboxSlice.reducer;
|
|
2286
|
-
const initialState$
|
|
2286
|
+
const initialState$i = {
|
|
2287
2287
|
projectFiles: {},
|
|
2288
2288
|
activeProjectFileId: null,
|
|
2289
2289
|
isImportingProjectFile: false,
|
|
@@ -2291,8 +2291,8 @@ const initialState$h = {
|
|
|
2291
2291
|
};
|
|
2292
2292
|
const projectFileSlice = createSlice({
|
|
2293
2293
|
name: "projectFiles",
|
|
2294
|
-
initialState: initialState$
|
|
2295
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2294
|
+
initialState: initialState$i,
|
|
2295
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$i)),
|
|
2296
2296
|
reducers: {
|
|
2297
2297
|
addOrReplaceProjectFiles: (state, action) => {
|
|
2298
2298
|
for (let fileObj of action.payload) {
|
|
@@ -2394,11 +2394,11 @@ const selectActiveProjectFileId = (state) => state.projectFileReducer.activeProj
|
|
|
2394
2394
|
const selectIsImportingProjectFile = (state) => state.projectFileReducer.isImportingProjectFile;
|
|
2395
2395
|
const projectFileReducer = projectFileSlice.reducer;
|
|
2396
2396
|
const projectAttachmentAdapter = createModelAdapter((attachment) => attachment.offline_id);
|
|
2397
|
-
const initialState$
|
|
2397
|
+
const initialState$h = projectAttachmentAdapter.getInitialState({});
|
|
2398
2398
|
const projectAttachmentSlice = createSlice({
|
|
2399
2399
|
name: "projectAttachments",
|
|
2400
|
-
initialState: initialState$
|
|
2401
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2400
|
+
initialState: initialState$h,
|
|
2401
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$h)),
|
|
2402
2402
|
reducers: {
|
|
2403
2403
|
initializeProjectAttachments: projectAttachmentAdapter.initialize,
|
|
2404
2404
|
addProjectAttachment: projectAttachmentAdapter.addOne,
|
|
@@ -2456,12 +2456,12 @@ const selectAttachmentsOfProjectByType = restructureCreateSelectorWithArgs(
|
|
|
2456
2456
|
)
|
|
2457
2457
|
);
|
|
2458
2458
|
const projectAttachmentReducer = projectAttachmentSlice.reducer;
|
|
2459
|
-
const initialState$
|
|
2459
|
+
const initialState$g = {
|
|
2460
2460
|
isRehydrated: false
|
|
2461
2461
|
};
|
|
2462
2462
|
const rehydratedSlice = createSlice({
|
|
2463
2463
|
name: "rehydrated",
|
|
2464
|
-
initialState: initialState$
|
|
2464
|
+
initialState: initialState$g,
|
|
2465
2465
|
// The `reducers` field lets us define reducers and generate associated actions
|
|
2466
2466
|
reducers: {
|
|
2467
2467
|
setRehydrated: (state, action) => {
|
|
@@ -2472,13 +2472,13 @@ const rehydratedSlice = createSlice({
|
|
|
2472
2472
|
const { setRehydrated } = rehydratedSlice.actions;
|
|
2473
2473
|
const selectRehydrated = (state) => state.rehydratedReducer.isRehydrated;
|
|
2474
2474
|
const rehydratedReducer = rehydratedSlice.reducer;
|
|
2475
|
-
const initialState$
|
|
2475
|
+
const initialState$f = {
|
|
2476
2476
|
isFetchingInitialData: false
|
|
2477
2477
|
};
|
|
2478
2478
|
const settingSlice = createSlice({
|
|
2479
2479
|
name: "settings",
|
|
2480
|
-
initialState: initialState$
|
|
2481
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2480
|
+
initialState: initialState$f,
|
|
2481
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$f)),
|
|
2482
2482
|
reducers: {
|
|
2483
2483
|
setIsFetchingInitialData: (state, action) => {
|
|
2484
2484
|
state.isFetchingInitialData = action.payload;
|
|
@@ -2502,11 +2502,11 @@ const formRevisionSortFn = (formRevisionA, formRevisionB) => {
|
|
|
2502
2502
|
}
|
|
2503
2503
|
};
|
|
2504
2504
|
const formRevisionAdapter = createModelAdapter((revision) => revision.offline_id);
|
|
2505
|
-
const initialState$
|
|
2505
|
+
const initialState$e = formRevisionAdapter.getInitialState({});
|
|
2506
2506
|
const formRevisionsSlice = createSlice({
|
|
2507
2507
|
name: "formRevisions",
|
|
2508
|
-
initialState: initialState$
|
|
2509
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2508
|
+
initialState: initialState$e,
|
|
2509
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$e)),
|
|
2510
2510
|
reducers: {
|
|
2511
2511
|
initializeFormRevisions: formRevisionAdapter.initialize,
|
|
2512
2512
|
setFormRevision: formRevisionAdapter.setOne,
|
|
@@ -2546,7 +2546,8 @@ const _selectLatestFormRevision = (formRevisions, formId) => {
|
|
|
2546
2546
|
};
|
|
2547
2547
|
const selectLatestFormRevisionOfForm = restructureCreateSelectorWithArgs(
|
|
2548
2548
|
createSelector([selectFormRevisions, (_state, formId) => formId], (revisions, formId) => {
|
|
2549
|
-
|
|
2549
|
+
const sortedRevisions = revisions.filter((revision) => revision.form === formId).sort(formRevisionSortFn).reverse();
|
|
2550
|
+
return sortedRevisions.length > 0 ? sortedRevisions[0] : void 0;
|
|
2550
2551
|
})
|
|
2551
2552
|
);
|
|
2552
2553
|
const selectFormRevisionsOfForm = restructureCreateSelectorWithArgs(
|
|
@@ -2598,11 +2599,11 @@ const selectLatestFormRevisionByForm = createSelector([selectFormRevisionMapping
|
|
|
2598
2599
|
});
|
|
2599
2600
|
const formRevisionReducer = formRevisionsSlice.reducer;
|
|
2600
2601
|
const formAdapter = createModelAdapter((form) => form.offline_id);
|
|
2601
|
-
const initialState$
|
|
2602
|
+
const initialState$d = formAdapter.getInitialState({});
|
|
2602
2603
|
const formSlice = createSlice({
|
|
2603
2604
|
name: "forms",
|
|
2604
|
-
initialState: initialState$
|
|
2605
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2605
|
+
initialState: initialState$d,
|
|
2606
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$d)),
|
|
2606
2607
|
reducers: {
|
|
2607
2608
|
setForms: formAdapter.initialize,
|
|
2608
2609
|
setForm: formAdapter.setOne,
|
|
@@ -2684,11 +2685,11 @@ const selectGeneralFormCount = createSelector([selectFormMapping], (userForms) =
|
|
|
2684
2685
|
});
|
|
2685
2686
|
const formReducer = formSlice.reducer;
|
|
2686
2687
|
const submissionAdapter = createModelAdapter((submission) => submission.offline_id);
|
|
2687
|
-
const initialState$
|
|
2688
|
+
const initialState$c = submissionAdapter.getInitialState({});
|
|
2688
2689
|
const formSubmissionSlice = createSlice({
|
|
2689
2690
|
name: "formSubmissions",
|
|
2690
|
-
initialState: initialState$
|
|
2691
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2691
|
+
initialState: initialState$c,
|
|
2692
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$c)),
|
|
2692
2693
|
reducers: {
|
|
2693
2694
|
setFormSubmission: submissionAdapter.setOne,
|
|
2694
2695
|
setFormSubmissions: submissionAdapter.setMany,
|
|
@@ -2826,11 +2827,11 @@ const formSubmissionReducer = formSubmissionSlice.reducer;
|
|
|
2826
2827
|
const formSubmissionAttachmentAdapter = createModelAdapter(
|
|
2827
2828
|
(attachment) => attachment.offline_id
|
|
2828
2829
|
);
|
|
2829
|
-
const initialState$
|
|
2830
|
+
const initialState$b = formSubmissionAttachmentAdapter.getInitialState({});
|
|
2830
2831
|
const formSubmissionAttachmentSlice = createSlice({
|
|
2831
2832
|
name: "formSubmissionAttachments",
|
|
2832
|
-
initialState: initialState$
|
|
2833
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2833
|
+
initialState: initialState$b,
|
|
2834
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$b)),
|
|
2834
2835
|
reducers: {
|
|
2835
2836
|
initializeFormSubmissionAttachments: formSubmissionAttachmentAdapter.initialize,
|
|
2836
2837
|
addFormSubmissionAttachment: formSubmissionAttachmentAdapter.addOne,
|
|
@@ -2869,11 +2870,11 @@ const formSubmissionAttachmentReducer = formSubmissionAttachmentSlice.reducer;
|
|
|
2869
2870
|
const formRevisionAttachmentAdapter = createModelAdapter(
|
|
2870
2871
|
(attachment) => attachment.offline_id
|
|
2871
2872
|
);
|
|
2872
|
-
const initialState$
|
|
2873
|
+
const initialState$a = formRevisionAttachmentAdapter.getInitialState({});
|
|
2873
2874
|
const formRevisionAttachmentSlice = createSlice({
|
|
2874
2875
|
name: "formRevisionAttachments",
|
|
2875
|
-
initialState: initialState$
|
|
2876
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2876
|
+
initialState: initialState$a,
|
|
2877
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$a)),
|
|
2877
2878
|
reducers: {
|
|
2878
2879
|
initializeFormRevisionAttachments: formRevisionAttachmentAdapter.initialize,
|
|
2879
2880
|
addFormRevisionAttachment: formRevisionAttachmentAdapter.addOne,
|
|
@@ -2910,10 +2911,10 @@ const selectAttachmentsOfFormRevision = restructureCreateSelectorWithArgs(
|
|
|
2910
2911
|
);
|
|
2911
2912
|
const formRevisionAttachmentReducer = formRevisionAttachmentSlice.reducer;
|
|
2912
2913
|
const emailDomainAdapter = createModelAdapter((emailDomain) => emailDomain.offline_id);
|
|
2913
|
-
const initialState$
|
|
2914
|
+
const initialState$9 = emailDomainAdapter.getInitialState({});
|
|
2914
2915
|
const emailDomainsSlice = createSlice({
|
|
2915
2916
|
name: "emailDomains",
|
|
2916
|
-
initialState: initialState$
|
|
2917
|
+
initialState: initialState$9,
|
|
2917
2918
|
reducers: {
|
|
2918
2919
|
initializeEmailDomains: emailDomainAdapter.initialize,
|
|
2919
2920
|
addEmailDomain: emailDomainAdapter.addOne,
|
|
@@ -2932,14 +2933,14 @@ const selectEmailDomainsOfOrganization = restructureCreateSelectorWithArgs(
|
|
|
2932
2933
|
)
|
|
2933
2934
|
);
|
|
2934
2935
|
const emailDomainsReducer = emailDomainsSlice.reducer;
|
|
2935
|
-
const initialState$
|
|
2936
|
+
const initialState$8 = {
|
|
2936
2937
|
documents: {}
|
|
2937
2938
|
};
|
|
2938
2939
|
const documentSlice = createSlice({
|
|
2939
2940
|
name: "documents",
|
|
2940
|
-
initialState: initialState$
|
|
2941
|
+
initialState: initialState$8,
|
|
2941
2942
|
extraReducers: (builder) => builder.addCase("RESET", (state) => {
|
|
2942
|
-
Object.assign(state, initialState$
|
|
2943
|
+
Object.assign(state, initialState$8);
|
|
2943
2944
|
}),
|
|
2944
2945
|
reducers: {
|
|
2945
2946
|
setDocuments: (state, action) => {
|
|
@@ -3114,11 +3115,11 @@ const selectRootDocuments = createSelector(
|
|
|
3114
3115
|
);
|
|
3115
3116
|
const documentsReducer = documentSlice.reducer;
|
|
3116
3117
|
const documentAttachmentAdapter = createModelAdapter((attachment) => attachment.offline_id);
|
|
3117
|
-
const initialState$
|
|
3118
|
+
const initialState$7 = documentAttachmentAdapter.getInitialState({});
|
|
3118
3119
|
const documentAttachmentSlice = createSlice({
|
|
3119
3120
|
name: "documentAttachments",
|
|
3120
|
-
initialState: initialState$
|
|
3121
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
3121
|
+
initialState: initialState$7,
|
|
3122
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$7)),
|
|
3122
3123
|
reducers: {
|
|
3123
3124
|
initializeDocumentAttachments: documentAttachmentAdapter.initialize,
|
|
3124
3125
|
addDocumentAttachment: documentAttachmentAdapter.addOne,
|
|
@@ -3177,11 +3178,11 @@ const selectAttachmentsOfDocumentByType = restructureCreateSelectorWithArgs(
|
|
|
3177
3178
|
);
|
|
3178
3179
|
const documentAttachmentReducer = documentAttachmentSlice.reducer;
|
|
3179
3180
|
const teamAdapter = createModelAdapter((team) => team.offline_id);
|
|
3180
|
-
const initialState$
|
|
3181
|
+
const initialState$6 = teamAdapter.getInitialState({});
|
|
3181
3182
|
const teamSlice = createSlice({
|
|
3182
3183
|
name: "teams",
|
|
3183
|
-
initialState: initialState$
|
|
3184
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
3184
|
+
initialState: initialState$6,
|
|
3185
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$6)),
|
|
3185
3186
|
reducers: {
|
|
3186
3187
|
setTeam: teamAdapter.setOne,
|
|
3187
3188
|
setTeams: teamAdapter.initialize,
|
|
@@ -3215,11 +3216,11 @@ const teamReducer = teamSlice.reducer;
|
|
|
3215
3216
|
const agentUserConversationAdapter = createModelAdapter(
|
|
3216
3217
|
(conversation) => conversation.offline_id
|
|
3217
3218
|
);
|
|
3218
|
-
const initialState$
|
|
3219
|
+
const initialState$5 = agentUserConversationAdapter.getInitialState({});
|
|
3219
3220
|
const agentsSlice = createSlice({
|
|
3220
3221
|
name: "agents",
|
|
3221
|
-
initialState: initialState$
|
|
3222
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
3222
|
+
initialState: initialState$5,
|
|
3223
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$5)),
|
|
3223
3224
|
reducers: {
|
|
3224
3225
|
initializeConversations: agentUserConversationAdapter.initialize,
|
|
3225
3226
|
addConversation: agentUserConversationAdapter.addOne,
|
|
@@ -3241,11 +3242,11 @@ const selectConversation = restructureCreateSelectorWithArgs(
|
|
|
3241
3242
|
);
|
|
3242
3243
|
const agentsReducer = agentsSlice.reducer;
|
|
3243
3244
|
const issueCommentAdapter = createModelAdapter((comment) => comment.offline_id);
|
|
3244
|
-
const initialState$
|
|
3245
|
+
const initialState$4 = issueCommentAdapter.getInitialState({});
|
|
3245
3246
|
const issueCommentSlice = createSlice({
|
|
3246
3247
|
name: "issueComments",
|
|
3247
|
-
initialState: initialState$
|
|
3248
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
3248
|
+
initialState: initialState$4,
|
|
3249
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$4)),
|
|
3249
3250
|
reducers: {
|
|
3250
3251
|
addIssueComment: issueCommentAdapter.addOne,
|
|
3251
3252
|
addIssueComments: issueCommentAdapter.addMany,
|
|
@@ -3274,11 +3275,11 @@ const selectCommentsOfIssue = restructureCreateSelectorWithArgs(
|
|
|
3274
3275
|
);
|
|
3275
3276
|
const issueCommentReducer = issueCommentSlice.reducer;
|
|
3276
3277
|
const issueUpdateAdapter = createModelAdapter((issueUpdate) => issueUpdate.offline_id);
|
|
3277
|
-
const initialState$
|
|
3278
|
+
const initialState$3 = issueUpdateAdapter.getInitialState({});
|
|
3278
3279
|
const issueUpdateSlice = createSlice({
|
|
3279
3280
|
name: "issueUpdates",
|
|
3280
|
-
initialState: initialState$
|
|
3281
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
3281
|
+
initialState: initialState$3,
|
|
3282
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$3)),
|
|
3282
3283
|
reducers: {
|
|
3283
3284
|
initializeIssueUpdates: issueUpdateAdapter.setMany,
|
|
3284
3285
|
setIssueUpdate: issueUpdateAdapter.setOne,
|
|
@@ -3307,11 +3308,11 @@ const selectIssueUpdatesOfIssue = restructureCreateSelectorWithArgs(
|
|
|
3307
3308
|
);
|
|
3308
3309
|
const issueUpdateReducer = issueUpdateSlice.reducer;
|
|
3309
3310
|
const issueAttachmentAdapter = createModelAdapter((attachment) => attachment.offline_id);
|
|
3310
|
-
const initialState$
|
|
3311
|
+
const initialState$2 = issueAttachmentAdapter.getInitialState({});
|
|
3311
3312
|
const issueAttachmentSlice = createSlice({
|
|
3312
3313
|
name: "issueAttachments",
|
|
3313
|
-
initialState: initialState$
|
|
3314
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
3314
|
+
initialState: initialState$2,
|
|
3315
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$2)),
|
|
3315
3316
|
reducers: {
|
|
3316
3317
|
initializeIssueAttachments: issueAttachmentAdapter.initialize,
|
|
3317
3318
|
addIssueAttachment: issueAttachmentAdapter.addOne,
|
|
@@ -3369,15 +3370,59 @@ const selectAttachmentsOfIssueByType = restructureCreateSelectorWithArgs(
|
|
|
3369
3370
|
)
|
|
3370
3371
|
);
|
|
3371
3372
|
const issueAttachmentReducer = issueAttachmentSlice.reducer;
|
|
3372
|
-
const initialState = {
|
|
3373
|
+
const initialState$1 = {
|
|
3373
3374
|
version: 0
|
|
3374
3375
|
};
|
|
3375
3376
|
const versioningSlice = createSlice({
|
|
3376
3377
|
name: "versioning",
|
|
3377
|
-
initialState,
|
|
3378
|
+
initialState: initialState$1,
|
|
3378
3379
|
reducers: {}
|
|
3379
3380
|
});
|
|
3380
3381
|
const versioningReducer = versioningSlice.reducer;
|
|
3382
|
+
const geoImageAdapter = createModelAdapter((model) => model.offline_id);
|
|
3383
|
+
const initialState = geoImageAdapter.getInitialState({});
|
|
3384
|
+
const geoImageSlice = createSlice({
|
|
3385
|
+
name: "geoImages",
|
|
3386
|
+
initialState,
|
|
3387
|
+
extraReducers: (builder) => {
|
|
3388
|
+
builder.addCase("RESET", (state) => {
|
|
3389
|
+
Object.assign(state, initialState);
|
|
3390
|
+
});
|
|
3391
|
+
},
|
|
3392
|
+
reducers: {
|
|
3393
|
+
initializeGeoImages: geoImageAdapter.initialize,
|
|
3394
|
+
setGeoImage: geoImageAdapter.setOne,
|
|
3395
|
+
setGeoImages: geoImageAdapter.setMany,
|
|
3396
|
+
addGeoImage: geoImageAdapter.addOne,
|
|
3397
|
+
addGeoImages: geoImageAdapter.addMany,
|
|
3398
|
+
updateGeoImage: geoImageAdapter.updateOne,
|
|
3399
|
+
updateGeoImages: geoImageAdapter.updateMany,
|
|
3400
|
+
deleteGeoImage: geoImageAdapter.deleteOne,
|
|
3401
|
+
deleteGeoImages: geoImageAdapter.deleteMany
|
|
3402
|
+
}
|
|
3403
|
+
});
|
|
3404
|
+
const {
|
|
3405
|
+
initializeGeoImages,
|
|
3406
|
+
setGeoImage,
|
|
3407
|
+
setGeoImages,
|
|
3408
|
+
addGeoImage,
|
|
3409
|
+
addGeoImages,
|
|
3410
|
+
updateGeoImage,
|
|
3411
|
+
updateGeoImages,
|
|
3412
|
+
deleteGeoImage,
|
|
3413
|
+
deleteGeoImages
|
|
3414
|
+
} = geoImageSlice.actions;
|
|
3415
|
+
const selectGeoImageMapping = (state) => state.geoImageReducer.instances;
|
|
3416
|
+
const selectGeoImages = (state) => Object.values(state.geoImageReducer.instances);
|
|
3417
|
+
const selectGeoImageById = restructureCreateSelectorWithArgs(
|
|
3418
|
+
createSelector([selectGeoImageMapping, (_, id) => id], (mapImageMapping, id) => mapImageMapping[id])
|
|
3419
|
+
);
|
|
3420
|
+
const selectGeoImagesOfProject = restructureCreateSelectorWithArgs(
|
|
3421
|
+
createSelector([selectGeoImages, (_, projectId) => projectId], (mapImages, projectId) => {
|
|
3422
|
+
return mapImages.filter((mapImage) => mapImage.project === projectId);
|
|
3423
|
+
})
|
|
3424
|
+
);
|
|
3425
|
+
const geoImageReducer = geoImageSlice.reducer;
|
|
3381
3426
|
const fullAssetMarkerSize = 45;
|
|
3382
3427
|
const DEFAULT_ISSUE_STATUS = IssueStatus.BACKLOG;
|
|
3383
3428
|
const DEFAULT_ISSUE_PRIORITY = IssuePriority.MEDIUM;
|
|
@@ -3449,7 +3494,8 @@ const overmapReducers = {
|
|
|
3449
3494
|
teamReducer,
|
|
3450
3495
|
agentsReducer,
|
|
3451
3496
|
issueCommentReducer,
|
|
3452
|
-
issueUpdateReducer
|
|
3497
|
+
issueUpdateReducer,
|
|
3498
|
+
geoImageReducer
|
|
3453
3499
|
};
|
|
3454
3500
|
const overmapReducer = combineReducers(overmapReducers);
|
|
3455
3501
|
const resetStore = "RESET";
|
|
@@ -4549,39 +4595,7 @@ class AssetStageService extends BaseApiService {
|
|
|
4549
4595
|
this.dispatch(initializeStages(result));
|
|
4550
4596
|
}
|
|
4551
4597
|
}
|
|
4552
|
-
|
|
4553
|
-
[AttachmentModel.Issue]: {
|
|
4554
|
-
name: "issue",
|
|
4555
|
-
attachUrlPrefix: "/issues",
|
|
4556
|
-
deleteUrlPrefix: "/issues",
|
|
4557
|
-
fetchUrlPostfix: "/issue-attachments"
|
|
4558
|
-
},
|
|
4559
|
-
[AttachmentModel.Asset]: {
|
|
4560
|
-
name: "asset",
|
|
4561
|
-
attachUrlPrefix: "/assets",
|
|
4562
|
-
deleteUrlPrefix: "/assets",
|
|
4563
|
-
fetchUrlPostfix: "/asset-attachments"
|
|
4564
|
-
},
|
|
4565
|
-
[AttachmentModel.AssetType]: {
|
|
4566
|
-
name: "asset type",
|
|
4567
|
-
attachUrlPrefix: "/assets/types",
|
|
4568
|
-
deleteUrlPrefix: "/assets/types",
|
|
4569
|
-
fetchUrlPostfix: "/asset-type-attachments"
|
|
4570
|
-
},
|
|
4571
|
-
[AttachmentModel.Project]: {
|
|
4572
|
-
name: "project",
|
|
4573
|
-
attachUrlPrefix: "/projects",
|
|
4574
|
-
deleteUrlPrefix: "/projects",
|
|
4575
|
-
fetchUrlPostfix: "/attachments"
|
|
4576
|
-
},
|
|
4577
|
-
[AttachmentModel.Document]: {
|
|
4578
|
-
name: "document",
|
|
4579
|
-
attachUrlPrefix: "/documents",
|
|
4580
|
-
deleteUrlPrefix: "/documents",
|
|
4581
|
-
fetchUrlPostfix: "/document-attachments"
|
|
4582
|
-
}
|
|
4583
|
-
};
|
|
4584
|
-
class BaseAttachmentService extends BaseApiService {
|
|
4598
|
+
class BaseUploadService extends BaseApiService {
|
|
4585
4599
|
getNumberOfAttachmentsWithSha1(sha1) {
|
|
4586
4600
|
const {
|
|
4587
4601
|
issueAttachmentReducer: issueAttachmentReducer2,
|
|
@@ -4589,8 +4603,9 @@ class BaseAttachmentService extends BaseApiService {
|
|
|
4589
4603
|
assetTypeAttachmentReducer: assetTypeAttachmentReducer2,
|
|
4590
4604
|
documentAttachmentReducer: documentAttachmentReducer2,
|
|
4591
4605
|
projectAttachmentReducer: projectAttachmentReducer2,
|
|
4606
|
+
formRevisionAttachmentReducer: formRevisionAttachmentReducer2,
|
|
4592
4607
|
formSubmissionAttachmentReducer: formSubmissionAttachmentReducer2,
|
|
4593
|
-
|
|
4608
|
+
geoImageReducer: geoImageReducer2
|
|
4594
4609
|
} = this.client.store.getState();
|
|
4595
4610
|
const objectsWithSha1 = [].concat(
|
|
4596
4611
|
Object.values(issueAttachmentReducer2.instances),
|
|
@@ -4599,7 +4614,8 @@ class BaseAttachmentService extends BaseApiService {
|
|
|
4599
4614
|
Object.values(documentAttachmentReducer2.instances),
|
|
4600
4615
|
Object.values(projectAttachmentReducer2.instances),
|
|
4601
4616
|
Object.values(formRevisionAttachmentReducer2.instances),
|
|
4602
|
-
Object.values(formSubmissionAttachmentReducer2.instances)
|
|
4617
|
+
Object.values(formSubmissionAttachmentReducer2.instances),
|
|
4618
|
+
Object.values(geoImageReducer2.instances)
|
|
4603
4619
|
);
|
|
4604
4620
|
return objectsWithSha1.filter((object) => object.file_sha1 === sha1).length;
|
|
4605
4621
|
}
|
|
@@ -4619,6 +4635,40 @@ class BaseAttachmentService extends BaseApiService {
|
|
|
4619
4635
|
});
|
|
4620
4636
|
}
|
|
4621
4637
|
}
|
|
4638
|
+
}
|
|
4639
|
+
const AttachmentModelMeta = {
|
|
4640
|
+
[AttachmentModel.Issue]: {
|
|
4641
|
+
name: "issue",
|
|
4642
|
+
attachUrlPrefix: "/issues",
|
|
4643
|
+
deleteUrlPrefix: "/issues",
|
|
4644
|
+
fetchUrlPostfix: "/issue-attachments"
|
|
4645
|
+
},
|
|
4646
|
+
[AttachmentModel.Asset]: {
|
|
4647
|
+
name: "asset",
|
|
4648
|
+
attachUrlPrefix: "/assets",
|
|
4649
|
+
deleteUrlPrefix: "/assets",
|
|
4650
|
+
fetchUrlPostfix: "/asset-attachments"
|
|
4651
|
+
},
|
|
4652
|
+
[AttachmentModel.AssetType]: {
|
|
4653
|
+
name: "asset type",
|
|
4654
|
+
attachUrlPrefix: "/assets/types",
|
|
4655
|
+
deleteUrlPrefix: "/assets/types",
|
|
4656
|
+
fetchUrlPostfix: "/asset-type-attachments"
|
|
4657
|
+
},
|
|
4658
|
+
[AttachmentModel.Project]: {
|
|
4659
|
+
name: "project",
|
|
4660
|
+
attachUrlPrefix: "/projects",
|
|
4661
|
+
deleteUrlPrefix: "/projects",
|
|
4662
|
+
fetchUrlPostfix: "/attachments"
|
|
4663
|
+
},
|
|
4664
|
+
[AttachmentModel.Document]: {
|
|
4665
|
+
name: "document",
|
|
4666
|
+
attachUrlPrefix: "/documents",
|
|
4667
|
+
deleteUrlPrefix: "/documents",
|
|
4668
|
+
fetchUrlPostfix: "/document-attachments"
|
|
4669
|
+
}
|
|
4670
|
+
};
|
|
4671
|
+
class BaseAttachmentService extends BaseUploadService {
|
|
4622
4672
|
async attachFiles(files, modelId, buildOfflineAttachment) {
|
|
4623
4673
|
const { store } = this.client;
|
|
4624
4674
|
const currentUser = store.getState().userReducer.currentUser;
|
|
@@ -5909,7 +5959,7 @@ const separateFilesFromValues = (values) => {
|
|
|
5909
5959
|
}
|
|
5910
5960
|
return { values: newValues, files };
|
|
5911
5961
|
};
|
|
5912
|
-
class UserFormSubmissionService extends
|
|
5962
|
+
class UserFormSubmissionService extends BaseUploadService {
|
|
5913
5963
|
constructor() {
|
|
5914
5964
|
super(...arguments);
|
|
5915
5965
|
// Attach files to submission, after uploading them to S3
|
|
@@ -5990,7 +6040,6 @@ class UserFormSubmissionService extends BaseApiService {
|
|
|
5990
6040
|
// TODO: adapt the support bulk adding to any model type
|
|
5991
6041
|
async bulkAdd(args, batchSize) {
|
|
5992
6042
|
const { formRevision, commonFieldValues, fieldValuesByAsset } = args;
|
|
5993
|
-
const allFilesRecord = {};
|
|
5994
6043
|
const { values: fileSeperatedCommonFieldValues, files: commonFiles } = separateFilesFromValues(commonFieldValues);
|
|
5995
6044
|
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
5996
6045
|
const transactionId = v4();
|
|
@@ -6032,7 +6081,6 @@ class UserFormSubmissionService extends BaseApiService {
|
|
|
6032
6081
|
file_type: file.type,
|
|
6033
6082
|
size: file.size
|
|
6034
6083
|
};
|
|
6035
|
-
allFilesRecord[sha1] = filePayload;
|
|
6036
6084
|
filePaylods.push(filePayload);
|
|
6037
6085
|
}
|
|
6038
6086
|
return {
|
|
@@ -6068,22 +6116,7 @@ class UserFormSubmissionService extends BaseApiService {
|
|
|
6068
6116
|
blocks
|
|
6069
6117
|
});
|
|
6070
6118
|
void promise.then(({ presigned_urls }) => {
|
|
6071
|
-
|
|
6072
|
-
const file = allFilesRecord[sha1];
|
|
6073
|
-
if (!file)
|
|
6074
|
-
continue;
|
|
6075
|
-
void this.enqueueRequest({
|
|
6076
|
-
url: presignedUrl.url,
|
|
6077
|
-
description: "Upload file",
|
|
6078
|
-
method: HttpMethod.POST,
|
|
6079
|
-
isExternalUrl: true,
|
|
6080
|
-
isAuthNeeded: false,
|
|
6081
|
-
attachmentHash: sha1,
|
|
6082
|
-
blockers: [`s3-${file.sha1}.${file.extension}`],
|
|
6083
|
-
blocks: [sha1],
|
|
6084
|
-
s3url: presignedUrl
|
|
6085
|
-
});
|
|
6086
|
-
}
|
|
6119
|
+
this.processPresignedUrls(presigned_urls);
|
|
6087
6120
|
});
|
|
6088
6121
|
prevBatchId = batchId;
|
|
6089
6122
|
batchPromises.push(promise);
|
|
@@ -7143,6 +7176,178 @@ class UserService extends BaseApiService {
|
|
|
7143
7176
|
this.dispatch(setUsers(Object.values(usersRecord)));
|
|
7144
7177
|
}
|
|
7145
7178
|
}
|
|
7179
|
+
class GeoImageService extends BaseUploadService {
|
|
7180
|
+
async add(payload, file) {
|
|
7181
|
+
const { store } = this.client;
|
|
7182
|
+
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7183
|
+
const currentUser = store.getState().userReducer.currentUser;
|
|
7184
|
+
const projectId = payload.project;
|
|
7185
|
+
const sha1 = await hashFile(file);
|
|
7186
|
+
const filePayload = {
|
|
7187
|
+
sha1,
|
|
7188
|
+
file_type: file.type,
|
|
7189
|
+
extension: file.name.split(".").pop(),
|
|
7190
|
+
size: file.size
|
|
7191
|
+
};
|
|
7192
|
+
const offlineMapImage = offline({
|
|
7193
|
+
...payload,
|
|
7194
|
+
file_name: file.name,
|
|
7195
|
+
file_sha1: sha1,
|
|
7196
|
+
file: URL.createObjectURL(file),
|
|
7197
|
+
submitted_at: submittedAt,
|
|
7198
|
+
created_by: currentUser.id
|
|
7199
|
+
});
|
|
7200
|
+
store.dispatch(addGeoImage(offlineMapImage));
|
|
7201
|
+
const promise = this.enqueueRequest({
|
|
7202
|
+
description: "Add geo image",
|
|
7203
|
+
method: HttpMethod.POST,
|
|
7204
|
+
url: "/geo-images/",
|
|
7205
|
+
payload: {
|
|
7206
|
+
offline_id: offlineMapImage.offline_id,
|
|
7207
|
+
submitted_at: submittedAt,
|
|
7208
|
+
title: offlineMapImage.title,
|
|
7209
|
+
description: offlineMapImage.description,
|
|
7210
|
+
geo_marker: offlineMapImage.geo_marker,
|
|
7211
|
+
canvas_marker: offlineMapImage.canvas_marker,
|
|
7212
|
+
sha1: offlineMapImage.file_sha1,
|
|
7213
|
+
project: offlineMapImage.project,
|
|
7214
|
+
file_name: offlineMapImage.file_name,
|
|
7215
|
+
direction: offlineMapImage.direction,
|
|
7216
|
+
original_date: offlineMapImage.original_date,
|
|
7217
|
+
file: filePayload
|
|
7218
|
+
},
|
|
7219
|
+
blocks: [projectId.toString()],
|
|
7220
|
+
blockers: [projectId.toString()]
|
|
7221
|
+
});
|
|
7222
|
+
promise.then((result) => {
|
|
7223
|
+
this.processPresignedUrls(result.presigned_urls);
|
|
7224
|
+
store.dispatch(setGeoImage(result.geo_image));
|
|
7225
|
+
}).catch(() => {
|
|
7226
|
+
store.dispatch(deleteGeoImage(offlineMapImage.offline_id));
|
|
7227
|
+
});
|
|
7228
|
+
return [offlineMapImage, promise.then((result) => result.geo_image)];
|
|
7229
|
+
}
|
|
7230
|
+
async bulkAdd(payloadAndFiles, projectId) {
|
|
7231
|
+
const { store } = this.client;
|
|
7232
|
+
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7233
|
+
const currentUser = store.getState().userReducer.currentUser;
|
|
7234
|
+
const offlineMapImages = [];
|
|
7235
|
+
const mapImageOfflineIds = [];
|
|
7236
|
+
const mapImagePayloads = [];
|
|
7237
|
+
const filePayloadRecord = {};
|
|
7238
|
+
for (const payloadAndFile of payloadAndFiles) {
|
|
7239
|
+
const { payload, file } = payloadAndFile;
|
|
7240
|
+
const sha1 = await hashFile(file);
|
|
7241
|
+
if (!(sha1 in filePayloadRecord)) {
|
|
7242
|
+
filePayloadRecord[sha1] = {
|
|
7243
|
+
sha1,
|
|
7244
|
+
file_type: file.type,
|
|
7245
|
+
extension: file.name.split(".").pop(),
|
|
7246
|
+
size: file.size
|
|
7247
|
+
};
|
|
7248
|
+
await this.client.files.addCache(file, sha1);
|
|
7249
|
+
}
|
|
7250
|
+
const offlineMapImage = offline({
|
|
7251
|
+
...payload,
|
|
7252
|
+
file_name: file.name,
|
|
7253
|
+
file_sha1: sha1,
|
|
7254
|
+
file: URL.createObjectURL(file),
|
|
7255
|
+
submitted_at: submittedAt,
|
|
7256
|
+
created_by: currentUser.id,
|
|
7257
|
+
project: projectId
|
|
7258
|
+
});
|
|
7259
|
+
offlineMapImages.push(offlineMapImage);
|
|
7260
|
+
mapImageOfflineIds.push(offlineMapImage.offline_id);
|
|
7261
|
+
mapImagePayloads.push({
|
|
7262
|
+
offline_id: offlineMapImage.offline_id,
|
|
7263
|
+
sha1: offlineMapImage.file_sha1,
|
|
7264
|
+
file_name: offlineMapImage.file_name,
|
|
7265
|
+
title: offlineMapImage.title,
|
|
7266
|
+
description: offlineMapImage.description,
|
|
7267
|
+
geo_marker: offlineMapImage.geo_marker,
|
|
7268
|
+
canvas_marker: offlineMapImage.canvas_marker,
|
|
7269
|
+
direction: offlineMapImage.direction,
|
|
7270
|
+
original_date: offlineMapImage.original_date
|
|
7271
|
+
});
|
|
7272
|
+
}
|
|
7273
|
+
store.dispatch(addGeoImages(offlineMapImages));
|
|
7274
|
+
const promise = this.enqueueRequest({
|
|
7275
|
+
description: "Bulk add geo images",
|
|
7276
|
+
method: HttpMethod.POST,
|
|
7277
|
+
url: "/geo-images/bulk/",
|
|
7278
|
+
payload: {
|
|
7279
|
+
submitted_at: submittedAt,
|
|
7280
|
+
project: projectId,
|
|
7281
|
+
geo_images: mapImagePayloads,
|
|
7282
|
+
files: Object.values(filePayloadRecord)
|
|
7283
|
+
},
|
|
7284
|
+
blocks: [projectId.toString()],
|
|
7285
|
+
blockers: mapImageOfflineIds
|
|
7286
|
+
});
|
|
7287
|
+
promise.then((result) => {
|
|
7288
|
+
this.processPresignedUrls(result.presigned_urls);
|
|
7289
|
+
store.dispatch(setGeoImages(result.map_images));
|
|
7290
|
+
}).catch(() => {
|
|
7291
|
+
store.dispatch(deleteGeoImages(mapImageOfflineIds));
|
|
7292
|
+
});
|
|
7293
|
+
return [offlineMapImages, promise.then((result) => result.map_images)];
|
|
7294
|
+
}
|
|
7295
|
+
update(payload) {
|
|
7296
|
+
const { store } = this.client;
|
|
7297
|
+
const state = store.getState();
|
|
7298
|
+
const mapImageToUpdate = selectGeoImageById(payload.offline_id)(state);
|
|
7299
|
+
if (!mapImageToUpdate) {
|
|
7300
|
+
throw new Error(`Map image with offline_id ${payload.offline_id} does not exist in the store`);
|
|
7301
|
+
}
|
|
7302
|
+
const updatedGeoImage = { ...mapImageToUpdate, ...payload };
|
|
7303
|
+
store.dispatch(updateGeoImage(updatedGeoImage));
|
|
7304
|
+
const promise = this.enqueueRequest({
|
|
7305
|
+
description: "Update geo image",
|
|
7306
|
+
method: HttpMethod.PATCH,
|
|
7307
|
+
url: `/geo-images/${payload.offline_id}/`,
|
|
7308
|
+
payload,
|
|
7309
|
+
blocks: [payload.offline_id],
|
|
7310
|
+
blockers: [payload.offline_id]
|
|
7311
|
+
});
|
|
7312
|
+
promise.then((result) => {
|
|
7313
|
+
store.dispatch(setGeoImage(result));
|
|
7314
|
+
}).catch(() => {
|
|
7315
|
+
store.dispatch(setGeoImage(mapImageToUpdate));
|
|
7316
|
+
});
|
|
7317
|
+
return [updatedGeoImage, promise];
|
|
7318
|
+
}
|
|
7319
|
+
async delete(geoImageId) {
|
|
7320
|
+
const { store } = this.client;
|
|
7321
|
+
const state = store.getState();
|
|
7322
|
+
const mapImageToDelete = selectGeoImageById(geoImageId)(state);
|
|
7323
|
+
if (!mapImageToDelete) {
|
|
7324
|
+
throw new Error(`Map image with offline_id ${geoImageId} does not exist in the store`);
|
|
7325
|
+
}
|
|
7326
|
+
store.dispatch(deleteGeoImage(geoImageId));
|
|
7327
|
+
const promise = this.enqueueRequest({
|
|
7328
|
+
description: "Delete geo image",
|
|
7329
|
+
method: HttpMethod.DELETE,
|
|
7330
|
+
url: `/geo-image/${geoImageId}/`,
|
|
7331
|
+
blocks: [geoImageId],
|
|
7332
|
+
blockers: [geoImageId]
|
|
7333
|
+
});
|
|
7334
|
+
promise.catch(() => {
|
|
7335
|
+
store.dispatch(setGeoImage(mapImageToDelete));
|
|
7336
|
+
});
|
|
7337
|
+
return promise;
|
|
7338
|
+
}
|
|
7339
|
+
async refreshStore(projectId) {
|
|
7340
|
+
const { store } = this.client;
|
|
7341
|
+
const result = await this.enqueueRequest({
|
|
7342
|
+
description: "Get geo images",
|
|
7343
|
+
method: HttpMethod.GET,
|
|
7344
|
+
url: `/projects/${projectId}/geo-images/`,
|
|
7345
|
+
blocks: [projectId.toString()],
|
|
7346
|
+
blockers: []
|
|
7347
|
+
});
|
|
7348
|
+
store.dispatch(initializeGeoImages(result));
|
|
7349
|
+
}
|
|
7350
|
+
}
|
|
7146
7351
|
export {
|
|
7147
7352
|
APIError,
|
|
7148
7353
|
AgentService,
|
|
@@ -7167,6 +7372,7 @@ export {
|
|
|
7167
7372
|
EmailVerificationService,
|
|
7168
7373
|
FileService,
|
|
7169
7374
|
GREEN,
|
|
7375
|
+
GeoImageService,
|
|
7170
7376
|
HttpMethod,
|
|
7171
7377
|
IssueAttachmentService,
|
|
7172
7378
|
IssueCommentService,
|
|
@@ -7228,6 +7434,8 @@ export {
|
|
|
7228
7434
|
addFormSubmissionAttachments,
|
|
7229
7435
|
addFormSubmissions,
|
|
7230
7436
|
addForms,
|
|
7437
|
+
addGeoImage,
|
|
7438
|
+
addGeoImages,
|
|
7231
7439
|
addIssue,
|
|
7232
7440
|
addIssueAttachment,
|
|
7233
7441
|
addIssueAttachments,
|
|
@@ -7303,6 +7511,8 @@ export {
|
|
|
7303
7511
|
deleteFormSubmissionAttachment,
|
|
7304
7512
|
deleteFormSubmissionAttachments,
|
|
7305
7513
|
deleteFormSubmissions,
|
|
7514
|
+
deleteGeoImage,
|
|
7515
|
+
deleteGeoImages,
|
|
7306
7516
|
deleteIssue,
|
|
7307
7517
|
deleteIssueAttachment,
|
|
7308
7518
|
deleteIssueAttachments,
|
|
@@ -7350,6 +7560,8 @@ export {
|
|
|
7350
7560
|
fullAssetMarkerSize,
|
|
7351
7561
|
generateBadgeColors,
|
|
7352
7562
|
genericMemo,
|
|
7563
|
+
geoImageReducer,
|
|
7564
|
+
geoImageSlice,
|
|
7353
7565
|
getFileIdentifier,
|
|
7354
7566
|
getFileS3Key,
|
|
7355
7567
|
getLocalDateString,
|
|
@@ -7372,6 +7584,7 @@ export {
|
|
|
7372
7584
|
initializeFormRevisionAttachments,
|
|
7373
7585
|
initializeFormRevisions,
|
|
7374
7586
|
initializeFormSubmissionAttachments,
|
|
7587
|
+
initializeGeoImages,
|
|
7375
7588
|
initializeIssueAttachments,
|
|
7376
7589
|
initializeIssueTypes,
|
|
7377
7590
|
initializeIssueUpdates,
|
|
@@ -7534,6 +7747,10 @@ export {
|
|
|
7534
7747
|
selectFormsCount,
|
|
7535
7748
|
selectFormsMapping,
|
|
7536
7749
|
selectGeneralFormCount,
|
|
7750
|
+
selectGeoImageById,
|
|
7751
|
+
selectGeoImageMapping,
|
|
7752
|
+
selectGeoImages,
|
|
7753
|
+
selectGeoImagesOfProject,
|
|
7537
7754
|
selectHiddenAssetTypeIds,
|
|
7538
7755
|
selectHiddenCategoryCount,
|
|
7539
7756
|
selectIsFetchingInitialData,
|
|
@@ -7645,6 +7862,8 @@ export {
|
|
|
7645
7862
|
setFormSubmissionAttachments,
|
|
7646
7863
|
setFormSubmissions,
|
|
7647
7864
|
setForms,
|
|
7865
|
+
setGeoImage,
|
|
7866
|
+
setGeoImages,
|
|
7648
7867
|
setIsFetchingInitialData,
|
|
7649
7868
|
setIsImportingProjectFile,
|
|
7650
7869
|
setIssueAttachment,
|
|
@@ -7707,6 +7926,8 @@ export {
|
|
|
7707
7926
|
updateFormSubmissionAttachment,
|
|
7708
7927
|
updateFormSubmissionAttachments,
|
|
7709
7928
|
updateFormSubmissions,
|
|
7929
|
+
updateGeoImage,
|
|
7930
|
+
updateGeoImages,
|
|
7710
7931
|
updateIssue,
|
|
7711
7932
|
updateIssueAttachment,
|
|
7712
7933
|
updateIssueAttachments,
|