@overmap-ai/core 1.0.60-forms-removal.9 → 1.0.60-geo-images.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/overmap-core.js +381 -161
- package/dist/overmap-core.js.map +1 -1
- package/dist/overmap-core.umd.cjs +381 -161
- 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 +12 -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,
|
|
@@ -2599,11 +2599,11 @@ const selectLatestFormRevisionByForm = createSelector([selectFormRevisionMapping
|
|
|
2599
2599
|
});
|
|
2600
2600
|
const formRevisionReducer = formRevisionsSlice.reducer;
|
|
2601
2601
|
const formAdapter = createModelAdapter((form) => form.offline_id);
|
|
2602
|
-
const initialState$
|
|
2602
|
+
const initialState$d = formAdapter.getInitialState({});
|
|
2603
2603
|
const formSlice = createSlice({
|
|
2604
2604
|
name: "forms",
|
|
2605
|
-
initialState: initialState$
|
|
2606
|
-
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)),
|
|
2607
2607
|
reducers: {
|
|
2608
2608
|
setForms: formAdapter.initialize,
|
|
2609
2609
|
setForm: formAdapter.setOne,
|
|
@@ -2685,11 +2685,11 @@ const selectGeneralFormCount = createSelector([selectFormMapping], (userForms) =
|
|
|
2685
2685
|
});
|
|
2686
2686
|
const formReducer = formSlice.reducer;
|
|
2687
2687
|
const submissionAdapter = createModelAdapter((submission) => submission.offline_id);
|
|
2688
|
-
const initialState$
|
|
2688
|
+
const initialState$c = submissionAdapter.getInitialState({});
|
|
2689
2689
|
const formSubmissionSlice = createSlice({
|
|
2690
2690
|
name: "formSubmissions",
|
|
2691
|
-
initialState: initialState$
|
|
2692
|
-
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)),
|
|
2693
2693
|
reducers: {
|
|
2694
2694
|
setFormSubmission: submissionAdapter.setOne,
|
|
2695
2695
|
setFormSubmissions: submissionAdapter.setMany,
|
|
@@ -2827,11 +2827,11 @@ const formSubmissionReducer = formSubmissionSlice.reducer;
|
|
|
2827
2827
|
const formSubmissionAttachmentAdapter = createModelAdapter(
|
|
2828
2828
|
(attachment) => attachment.offline_id
|
|
2829
2829
|
);
|
|
2830
|
-
const initialState$
|
|
2830
|
+
const initialState$b = formSubmissionAttachmentAdapter.getInitialState({});
|
|
2831
2831
|
const formSubmissionAttachmentSlice = createSlice({
|
|
2832
2832
|
name: "formSubmissionAttachments",
|
|
2833
|
-
initialState: initialState$
|
|
2834
|
-
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)),
|
|
2835
2835
|
reducers: {
|
|
2836
2836
|
initializeFormSubmissionAttachments: formSubmissionAttachmentAdapter.initialize,
|
|
2837
2837
|
addFormSubmissionAttachment: formSubmissionAttachmentAdapter.addOne,
|
|
@@ -2870,11 +2870,11 @@ const formSubmissionAttachmentReducer = formSubmissionAttachmentSlice.reducer;
|
|
|
2870
2870
|
const formRevisionAttachmentAdapter = createModelAdapter(
|
|
2871
2871
|
(attachment) => attachment.offline_id
|
|
2872
2872
|
);
|
|
2873
|
-
const initialState$
|
|
2873
|
+
const initialState$a = formRevisionAttachmentAdapter.getInitialState({});
|
|
2874
2874
|
const formRevisionAttachmentSlice = createSlice({
|
|
2875
2875
|
name: "formRevisionAttachments",
|
|
2876
|
-
initialState: initialState$
|
|
2877
|
-
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)),
|
|
2878
2878
|
reducers: {
|
|
2879
2879
|
initializeFormRevisionAttachments: formRevisionAttachmentAdapter.initialize,
|
|
2880
2880
|
addFormRevisionAttachment: formRevisionAttachmentAdapter.addOne,
|
|
@@ -2911,10 +2911,10 @@ const selectAttachmentsOfFormRevision = restructureCreateSelectorWithArgs(
|
|
|
2911
2911
|
);
|
|
2912
2912
|
const formRevisionAttachmentReducer = formRevisionAttachmentSlice.reducer;
|
|
2913
2913
|
const emailDomainAdapter = createModelAdapter((emailDomain) => emailDomain.offline_id);
|
|
2914
|
-
const initialState$
|
|
2914
|
+
const initialState$9 = emailDomainAdapter.getInitialState({});
|
|
2915
2915
|
const emailDomainsSlice = createSlice({
|
|
2916
2916
|
name: "emailDomains",
|
|
2917
|
-
initialState: initialState$
|
|
2917
|
+
initialState: initialState$9,
|
|
2918
2918
|
reducers: {
|
|
2919
2919
|
initializeEmailDomains: emailDomainAdapter.initialize,
|
|
2920
2920
|
addEmailDomain: emailDomainAdapter.addOne,
|
|
@@ -2933,14 +2933,14 @@ const selectEmailDomainsOfOrganization = restructureCreateSelectorWithArgs(
|
|
|
2933
2933
|
)
|
|
2934
2934
|
);
|
|
2935
2935
|
const emailDomainsReducer = emailDomainsSlice.reducer;
|
|
2936
|
-
const initialState$
|
|
2936
|
+
const initialState$8 = {
|
|
2937
2937
|
documents: {}
|
|
2938
2938
|
};
|
|
2939
2939
|
const documentSlice = createSlice({
|
|
2940
2940
|
name: "documents",
|
|
2941
|
-
initialState: initialState$
|
|
2941
|
+
initialState: initialState$8,
|
|
2942
2942
|
extraReducers: (builder) => builder.addCase("RESET", (state) => {
|
|
2943
|
-
Object.assign(state, initialState$
|
|
2943
|
+
Object.assign(state, initialState$8);
|
|
2944
2944
|
}),
|
|
2945
2945
|
reducers: {
|
|
2946
2946
|
setDocuments: (state, action) => {
|
|
@@ -3115,11 +3115,11 @@ const selectRootDocuments = createSelector(
|
|
|
3115
3115
|
);
|
|
3116
3116
|
const documentsReducer = documentSlice.reducer;
|
|
3117
3117
|
const documentAttachmentAdapter = createModelAdapter((attachment) => attachment.offline_id);
|
|
3118
|
-
const initialState$
|
|
3118
|
+
const initialState$7 = documentAttachmentAdapter.getInitialState({});
|
|
3119
3119
|
const documentAttachmentSlice = createSlice({
|
|
3120
3120
|
name: "documentAttachments",
|
|
3121
|
-
initialState: initialState$
|
|
3122
|
-
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)),
|
|
3123
3123
|
reducers: {
|
|
3124
3124
|
initializeDocumentAttachments: documentAttachmentAdapter.initialize,
|
|
3125
3125
|
addDocumentAttachment: documentAttachmentAdapter.addOne,
|
|
@@ -3178,11 +3178,11 @@ const selectAttachmentsOfDocumentByType = restructureCreateSelectorWithArgs(
|
|
|
3178
3178
|
);
|
|
3179
3179
|
const documentAttachmentReducer = documentAttachmentSlice.reducer;
|
|
3180
3180
|
const teamAdapter = createModelAdapter((team) => team.offline_id);
|
|
3181
|
-
const initialState$
|
|
3181
|
+
const initialState$6 = teamAdapter.getInitialState({});
|
|
3182
3182
|
const teamSlice = createSlice({
|
|
3183
3183
|
name: "teams",
|
|
3184
|
-
initialState: initialState$
|
|
3185
|
-
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)),
|
|
3186
3186
|
reducers: {
|
|
3187
3187
|
setTeam: teamAdapter.setOne,
|
|
3188
3188
|
setTeams: teamAdapter.initialize,
|
|
@@ -3216,11 +3216,11 @@ const teamReducer = teamSlice.reducer;
|
|
|
3216
3216
|
const agentUserConversationAdapter = createModelAdapter(
|
|
3217
3217
|
(conversation) => conversation.offline_id
|
|
3218
3218
|
);
|
|
3219
|
-
const initialState$
|
|
3219
|
+
const initialState$5 = agentUserConversationAdapter.getInitialState({});
|
|
3220
3220
|
const agentsSlice = createSlice({
|
|
3221
3221
|
name: "agents",
|
|
3222
|
-
initialState: initialState$
|
|
3223
|
-
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)),
|
|
3224
3224
|
reducers: {
|
|
3225
3225
|
initializeConversations: agentUserConversationAdapter.initialize,
|
|
3226
3226
|
addConversation: agentUserConversationAdapter.addOne,
|
|
@@ -3242,11 +3242,11 @@ const selectConversation = restructureCreateSelectorWithArgs(
|
|
|
3242
3242
|
);
|
|
3243
3243
|
const agentsReducer = agentsSlice.reducer;
|
|
3244
3244
|
const issueCommentAdapter = createModelAdapter((comment) => comment.offline_id);
|
|
3245
|
-
const initialState$
|
|
3245
|
+
const initialState$4 = issueCommentAdapter.getInitialState({});
|
|
3246
3246
|
const issueCommentSlice = createSlice({
|
|
3247
3247
|
name: "issueComments",
|
|
3248
|
-
initialState: initialState$
|
|
3249
|
-
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)),
|
|
3250
3250
|
reducers: {
|
|
3251
3251
|
addIssueComment: issueCommentAdapter.addOne,
|
|
3252
3252
|
addIssueComments: issueCommentAdapter.addMany,
|
|
@@ -3275,11 +3275,11 @@ const selectCommentsOfIssue = restructureCreateSelectorWithArgs(
|
|
|
3275
3275
|
);
|
|
3276
3276
|
const issueCommentReducer = issueCommentSlice.reducer;
|
|
3277
3277
|
const issueUpdateAdapter = createModelAdapter((issueUpdate) => issueUpdate.offline_id);
|
|
3278
|
-
const initialState$
|
|
3278
|
+
const initialState$3 = issueUpdateAdapter.getInitialState({});
|
|
3279
3279
|
const issueUpdateSlice = createSlice({
|
|
3280
3280
|
name: "issueUpdates",
|
|
3281
|
-
initialState: initialState$
|
|
3282
|
-
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)),
|
|
3283
3283
|
reducers: {
|
|
3284
3284
|
initializeIssueUpdates: issueUpdateAdapter.setMany,
|
|
3285
3285
|
setIssueUpdate: issueUpdateAdapter.setOne,
|
|
@@ -3308,11 +3308,11 @@ const selectIssueUpdatesOfIssue = restructureCreateSelectorWithArgs(
|
|
|
3308
3308
|
);
|
|
3309
3309
|
const issueUpdateReducer = issueUpdateSlice.reducer;
|
|
3310
3310
|
const issueAttachmentAdapter = createModelAdapter((attachment) => attachment.offline_id);
|
|
3311
|
-
const initialState$
|
|
3311
|
+
const initialState$2 = issueAttachmentAdapter.getInitialState({});
|
|
3312
3312
|
const issueAttachmentSlice = createSlice({
|
|
3313
3313
|
name: "issueAttachments",
|
|
3314
|
-
initialState: initialState$
|
|
3315
|
-
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)),
|
|
3316
3316
|
reducers: {
|
|
3317
3317
|
initializeIssueAttachments: issueAttachmentAdapter.initialize,
|
|
3318
3318
|
addIssueAttachment: issueAttachmentAdapter.addOne,
|
|
@@ -3370,15 +3370,59 @@ const selectAttachmentsOfIssueByType = restructureCreateSelectorWithArgs(
|
|
|
3370
3370
|
)
|
|
3371
3371
|
);
|
|
3372
3372
|
const issueAttachmentReducer = issueAttachmentSlice.reducer;
|
|
3373
|
-
const initialState = {
|
|
3373
|
+
const initialState$1 = {
|
|
3374
3374
|
version: 0
|
|
3375
3375
|
};
|
|
3376
3376
|
const versioningSlice = createSlice({
|
|
3377
3377
|
name: "versioning",
|
|
3378
|
-
initialState,
|
|
3378
|
+
initialState: initialState$1,
|
|
3379
3379
|
reducers: {}
|
|
3380
3380
|
});
|
|
3381
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;
|
|
3382
3426
|
const fullAssetMarkerSize = 45;
|
|
3383
3427
|
const DEFAULT_ISSUE_STATUS = IssueStatus.BACKLOG;
|
|
3384
3428
|
const DEFAULT_ISSUE_PRIORITY = IssuePriority.MEDIUM;
|
|
@@ -3450,7 +3494,8 @@ const overmapReducers = {
|
|
|
3450
3494
|
teamReducer,
|
|
3451
3495
|
agentsReducer,
|
|
3452
3496
|
issueCommentReducer,
|
|
3453
|
-
issueUpdateReducer
|
|
3497
|
+
issueUpdateReducer,
|
|
3498
|
+
geoImageReducer
|
|
3454
3499
|
};
|
|
3455
3500
|
const overmapReducer = combineReducers(overmapReducers);
|
|
3456
3501
|
const resetStore = "RESET";
|
|
@@ -4550,39 +4595,7 @@ class AssetStageService extends BaseApiService {
|
|
|
4550
4595
|
this.dispatch(initializeStages(result));
|
|
4551
4596
|
}
|
|
4552
4597
|
}
|
|
4553
|
-
|
|
4554
|
-
[AttachmentModel.Issue]: {
|
|
4555
|
-
name: "issue",
|
|
4556
|
-
attachUrlPrefix: "/issues",
|
|
4557
|
-
deleteUrlPrefix: "/issues",
|
|
4558
|
-
fetchUrlPostfix: "/issue-attachments"
|
|
4559
|
-
},
|
|
4560
|
-
[AttachmentModel.Asset]: {
|
|
4561
|
-
name: "asset",
|
|
4562
|
-
attachUrlPrefix: "/assets",
|
|
4563
|
-
deleteUrlPrefix: "/assets",
|
|
4564
|
-
fetchUrlPostfix: "/asset-attachments"
|
|
4565
|
-
},
|
|
4566
|
-
[AttachmentModel.AssetType]: {
|
|
4567
|
-
name: "asset type",
|
|
4568
|
-
attachUrlPrefix: "/assets/types",
|
|
4569
|
-
deleteUrlPrefix: "/assets/types",
|
|
4570
|
-
fetchUrlPostfix: "/asset-type-attachments"
|
|
4571
|
-
},
|
|
4572
|
-
[AttachmentModel.Project]: {
|
|
4573
|
-
name: "project",
|
|
4574
|
-
attachUrlPrefix: "/projects",
|
|
4575
|
-
deleteUrlPrefix: "/projects",
|
|
4576
|
-
fetchUrlPostfix: "/attachments"
|
|
4577
|
-
},
|
|
4578
|
-
[AttachmentModel.Document]: {
|
|
4579
|
-
name: "document",
|
|
4580
|
-
attachUrlPrefix: "/documents",
|
|
4581
|
-
deleteUrlPrefix: "/documents",
|
|
4582
|
-
fetchUrlPostfix: "/document-attachments"
|
|
4583
|
-
}
|
|
4584
|
-
};
|
|
4585
|
-
class BaseAttachmentService extends BaseApiService {
|
|
4598
|
+
class BaseUploadService extends BaseApiService {
|
|
4586
4599
|
getNumberOfAttachmentsWithSha1(sha1) {
|
|
4587
4600
|
const {
|
|
4588
4601
|
issueAttachmentReducer: issueAttachmentReducer2,
|
|
@@ -4590,8 +4603,9 @@ class BaseAttachmentService extends BaseApiService {
|
|
|
4590
4603
|
assetTypeAttachmentReducer: assetTypeAttachmentReducer2,
|
|
4591
4604
|
documentAttachmentReducer: documentAttachmentReducer2,
|
|
4592
4605
|
projectAttachmentReducer: projectAttachmentReducer2,
|
|
4606
|
+
formRevisionAttachmentReducer: formRevisionAttachmentReducer2,
|
|
4593
4607
|
formSubmissionAttachmentReducer: formSubmissionAttachmentReducer2,
|
|
4594
|
-
|
|
4608
|
+
geoImageReducer: geoImageReducer2
|
|
4595
4609
|
} = this.client.store.getState();
|
|
4596
4610
|
const objectsWithSha1 = [].concat(
|
|
4597
4611
|
Object.values(issueAttachmentReducer2.instances),
|
|
@@ -4600,7 +4614,8 @@ class BaseAttachmentService extends BaseApiService {
|
|
|
4600
4614
|
Object.values(documentAttachmentReducer2.instances),
|
|
4601
4615
|
Object.values(projectAttachmentReducer2.instances),
|
|
4602
4616
|
Object.values(formRevisionAttachmentReducer2.instances),
|
|
4603
|
-
Object.values(formSubmissionAttachmentReducer2.instances)
|
|
4617
|
+
Object.values(formSubmissionAttachmentReducer2.instances),
|
|
4618
|
+
Object.values(geoImageReducer2.instances)
|
|
4604
4619
|
);
|
|
4605
4620
|
return objectsWithSha1.filter((object) => object.file_sha1 === sha1).length;
|
|
4606
4621
|
}
|
|
@@ -4620,6 +4635,40 @@ class BaseAttachmentService extends BaseApiService {
|
|
|
4620
4635
|
});
|
|
4621
4636
|
}
|
|
4622
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 {
|
|
4623
4672
|
async attachFiles(files, modelId, buildOfflineAttachment) {
|
|
4624
4673
|
const { store } = this.client;
|
|
4625
4674
|
const currentUser = store.getState().userReducer.currentUser;
|
|
@@ -5910,7 +5959,7 @@ const separateFilesFromValues = (values) => {
|
|
|
5910
5959
|
}
|
|
5911
5960
|
return { values: newValues, files };
|
|
5912
5961
|
};
|
|
5913
|
-
class UserFormSubmissionService extends
|
|
5962
|
+
class UserFormSubmissionService extends BaseUploadService {
|
|
5914
5963
|
constructor() {
|
|
5915
5964
|
super(...arguments);
|
|
5916
5965
|
// Attach files to submission, after uploading them to S3
|
|
@@ -5991,7 +6040,6 @@ class UserFormSubmissionService extends BaseApiService {
|
|
|
5991
6040
|
// TODO: adapt the support bulk adding to any model type
|
|
5992
6041
|
async bulkAdd(args, batchSize) {
|
|
5993
6042
|
const { formRevision, commonFieldValues, fieldValuesByAsset } = args;
|
|
5994
|
-
const allFilesRecord = {};
|
|
5995
6043
|
const { values: fileSeperatedCommonFieldValues, files: commonFiles } = separateFilesFromValues(commonFieldValues);
|
|
5996
6044
|
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
5997
6045
|
const transactionId = v4();
|
|
@@ -6033,7 +6081,6 @@ class UserFormSubmissionService extends BaseApiService {
|
|
|
6033
6081
|
file_type: file.type,
|
|
6034
6082
|
size: file.size
|
|
6035
6083
|
};
|
|
6036
|
-
allFilesRecord[sha1] = filePayload;
|
|
6037
6084
|
filePaylods.push(filePayload);
|
|
6038
6085
|
}
|
|
6039
6086
|
return {
|
|
@@ -6069,22 +6116,7 @@ class UserFormSubmissionService extends BaseApiService {
|
|
|
6069
6116
|
blocks
|
|
6070
6117
|
});
|
|
6071
6118
|
void promise.then(({ presigned_urls }) => {
|
|
6072
|
-
|
|
6073
|
-
const file = allFilesRecord[sha1];
|
|
6074
|
-
if (!file)
|
|
6075
|
-
continue;
|
|
6076
|
-
void this.enqueueRequest({
|
|
6077
|
-
url: presignedUrl.url,
|
|
6078
|
-
description: "Upload file",
|
|
6079
|
-
method: HttpMethod.POST,
|
|
6080
|
-
isExternalUrl: true,
|
|
6081
|
-
isAuthNeeded: false,
|
|
6082
|
-
attachmentHash: sha1,
|
|
6083
|
-
blockers: [`s3-${file.sha1}.${file.extension}`],
|
|
6084
|
-
blocks: [sha1],
|
|
6085
|
-
s3url: presignedUrl
|
|
6086
|
-
});
|
|
6087
|
-
}
|
|
6119
|
+
this.processPresignedUrls(presigned_urls);
|
|
6088
6120
|
});
|
|
6089
6121
|
prevBatchId = batchId;
|
|
6090
6122
|
batchPromises.push(promise);
|
|
@@ -7144,6 +7176,178 @@ class UserService extends BaseApiService {
|
|
|
7144
7176
|
this.dispatch(setUsers(Object.values(usersRecord)));
|
|
7145
7177
|
}
|
|
7146
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
|
+
}
|
|
7147
7351
|
export {
|
|
7148
7352
|
APIError,
|
|
7149
7353
|
AgentService,
|
|
@@ -7168,6 +7372,7 @@ export {
|
|
|
7168
7372
|
EmailVerificationService,
|
|
7169
7373
|
FileService,
|
|
7170
7374
|
GREEN,
|
|
7375
|
+
GeoImageService,
|
|
7171
7376
|
HttpMethod,
|
|
7172
7377
|
IssueAttachmentService,
|
|
7173
7378
|
IssueCommentService,
|
|
@@ -7229,6 +7434,8 @@ export {
|
|
|
7229
7434
|
addFormSubmissionAttachments,
|
|
7230
7435
|
addFormSubmissions,
|
|
7231
7436
|
addForms,
|
|
7437
|
+
addGeoImage,
|
|
7438
|
+
addGeoImages,
|
|
7232
7439
|
addIssue,
|
|
7233
7440
|
addIssueAttachment,
|
|
7234
7441
|
addIssueAttachments,
|
|
@@ -7304,6 +7511,8 @@ export {
|
|
|
7304
7511
|
deleteFormSubmissionAttachment,
|
|
7305
7512
|
deleteFormSubmissionAttachments,
|
|
7306
7513
|
deleteFormSubmissions,
|
|
7514
|
+
deleteGeoImage,
|
|
7515
|
+
deleteGeoImages,
|
|
7307
7516
|
deleteIssue,
|
|
7308
7517
|
deleteIssueAttachment,
|
|
7309
7518
|
deleteIssueAttachments,
|
|
@@ -7351,6 +7560,8 @@ export {
|
|
|
7351
7560
|
fullAssetMarkerSize,
|
|
7352
7561
|
generateBadgeColors,
|
|
7353
7562
|
genericMemo,
|
|
7563
|
+
geoImageReducer,
|
|
7564
|
+
geoImageSlice,
|
|
7354
7565
|
getFileIdentifier,
|
|
7355
7566
|
getFileS3Key,
|
|
7356
7567
|
getLocalDateString,
|
|
@@ -7373,6 +7584,7 @@ export {
|
|
|
7373
7584
|
initializeFormRevisionAttachments,
|
|
7374
7585
|
initializeFormRevisions,
|
|
7375
7586
|
initializeFormSubmissionAttachments,
|
|
7587
|
+
initializeGeoImages,
|
|
7376
7588
|
initializeIssueAttachments,
|
|
7377
7589
|
initializeIssueTypes,
|
|
7378
7590
|
initializeIssueUpdates,
|
|
@@ -7535,6 +7747,10 @@ export {
|
|
|
7535
7747
|
selectFormsCount,
|
|
7536
7748
|
selectFormsMapping,
|
|
7537
7749
|
selectGeneralFormCount,
|
|
7750
|
+
selectGeoImageById,
|
|
7751
|
+
selectGeoImageMapping,
|
|
7752
|
+
selectGeoImages,
|
|
7753
|
+
selectGeoImagesOfProject,
|
|
7538
7754
|
selectHiddenAssetTypeIds,
|
|
7539
7755
|
selectHiddenCategoryCount,
|
|
7540
7756
|
selectIsFetchingInitialData,
|
|
@@ -7646,6 +7862,8 @@ export {
|
|
|
7646
7862
|
setFormSubmissionAttachments,
|
|
7647
7863
|
setFormSubmissions,
|
|
7648
7864
|
setForms,
|
|
7865
|
+
setGeoImage,
|
|
7866
|
+
setGeoImages,
|
|
7649
7867
|
setIsFetchingInitialData,
|
|
7650
7868
|
setIsImportingProjectFile,
|
|
7651
7869
|
setIssueAttachment,
|
|
@@ -7708,6 +7926,8 @@ export {
|
|
|
7708
7926
|
updateFormSubmissionAttachment,
|
|
7709
7927
|
updateFormSubmissionAttachments,
|
|
7710
7928
|
updateFormSubmissions,
|
|
7929
|
+
updateGeoImage,
|
|
7930
|
+
updateGeoImages,
|
|
7711
7931
|
updateIssue,
|
|
7712
7932
|
updateIssueAttachment,
|
|
7713
7933
|
updateIssueAttachments,
|