@overmap-ai/core 1.0.60-forms-removal.8 → 1.0.60-forms-refactor-1.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 +451 -470
- package/dist/overmap-core.js.map +1 -1
- package/dist/overmap-core.umd.cjs +451 -470
- 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/FormService.d.ts +18 -0
- package/dist/sdk/services/FormSubmissionService.d.ts +24 -0
- package/dist/sdk/services/GeoImageService.d.ts +11 -0
- package/dist/sdk/services/IssueService.d.ts +1 -1
- package/dist/sdk/services/index.d.ts +3 -2
- package/dist/sdk/typings.d.ts +3 -2
- package/dist/store/slices/assetTypeSlice.d.ts +2 -8
- package/dist/store/slices/categorySlice.d.ts +11 -25
- package/dist/store/slices/formRevisionAttachmentSlice.d.ts +20 -20
- package/dist/store/slices/formRevisionSlice.d.ts +21 -21
- package/dist/store/slices/formSlice.d.ts +19 -19
- package/dist/store/slices/formSubmissionAttachmentSlice.d.ts +20 -20
- package/dist/store/slices/formSubmissionSlice.d.ts +26 -26
- package/dist/store/slices/geoImageSlice.d.ts +48 -0
- package/dist/store/slices/index.d.ts +1 -0
- package/dist/store/slices/issueSlice.d.ts +2 -12
- package/dist/store/slices/organizationSlice.d.ts +6 -17
- package/dist/store/slices/projectFileSlice.d.ts +4 -15
- package/dist/store/slices/projectSlice.d.ts +1 -4
- package/dist/store/slices/workspaceSlice.d.ts +5 -10
- package/dist/store/store.d.ts +2 -1
- package/dist/typings/models/assets.d.ts +1 -1
- package/dist/typings/models/forms.d.ts +11 -11
- package/dist/typings/models/geo.d.ts +2 -1
- package/dist/typings/models/geoImages.d.ts +14 -0
- package/dist/typings/models/index.d.ts +1 -0
- package/dist/typings/models/issues.d.ts +3 -3
- package/dist/typings/models/store.d.ts +2 -2
- package/dist/utils/coordinates.d.ts +2 -1
- package/dist/utils/forms.d.ts +2 -2
- package/package.json +1 -1
- package/dist/sdk/services/UserFormService.d.ts +0 -18
- package/dist/sdk/services/UserFormSubmissionService.d.ts +0 -25
|
@@ -367,15 +367,15 @@ var __publicField = (obj, key, value) => {
|
|
|
367
367
|
};
|
|
368
368
|
const migrations = [initialVersioning, signOut, signOut, createOutboxState];
|
|
369
369
|
const manifest = Object.fromEntries(migrations.map((migration2, i) => [i, wrapMigration(migration2)]));
|
|
370
|
-
const initialState$
|
|
370
|
+
const initialState$B = {
|
|
371
371
|
accessToken: "",
|
|
372
372
|
refreshToken: "",
|
|
373
373
|
isLoggedIn: false
|
|
374
374
|
};
|
|
375
375
|
const authSlice = toolkit.createSlice({
|
|
376
376
|
name: "auth",
|
|
377
|
-
initialState: initialState$
|
|
378
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
377
|
+
initialState: initialState$B,
|
|
378
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$B)),
|
|
379
379
|
reducers: {
|
|
380
380
|
setTokens: (state, action) => {
|
|
381
381
|
state.accessToken = action.payload.accessToken;
|
|
@@ -406,6 +406,9 @@ var __publicField = (obj, key, value) => {
|
|
|
406
406
|
const flipCoordinates = (coordinates) => {
|
|
407
407
|
return [coordinates[1], coordinates[0]];
|
|
408
408
|
};
|
|
409
|
+
const flipBounds = (bounds) => {
|
|
410
|
+
return [flipCoordinates(bounds[0]), flipCoordinates(bounds[1])];
|
|
411
|
+
};
|
|
409
412
|
function offsetPositionByMeters(originalPosition, latMeters, lngMeters) {
|
|
410
413
|
const { lat, lng } = originalPosition;
|
|
411
414
|
const earthRadius = 6378137;
|
|
@@ -842,72 +845,23 @@ var __publicField = (obj, key, value) => {
|
|
|
842
845
|
};
|
|
843
846
|
}
|
|
844
847
|
const categoryAdapter = createModelAdapter((category) => category.offline_id);
|
|
845
|
-
const initialState$
|
|
846
|
-
categoryVisibility: {
|
|
847
|
-
hiddenCategoryIds: [],
|
|
848
|
-
isNullCategoryHidden: false
|
|
849
|
-
}
|
|
850
|
-
});
|
|
848
|
+
const initialState$A = categoryAdapter.getInitialState({});
|
|
851
849
|
const categorySlice = toolkit.createSlice({
|
|
852
850
|
name: "categories",
|
|
853
|
-
initialState: initialState$
|
|
854
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
851
|
+
initialState: initialState$A,
|
|
852
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$A)),
|
|
855
853
|
reducers: {
|
|
856
|
-
initializeCategories:
|
|
857
|
-
categoryAdapter.initialize(state, action);
|
|
858
|
-
state.categoryVisibility.hiddenCategoryIds = state.categoryVisibility.hiddenCategoryIds.filter(
|
|
859
|
-
(categoryId) => action.payload.some((category) => category.offline_id === categoryId)
|
|
860
|
-
);
|
|
861
|
-
},
|
|
854
|
+
initializeCategories: categoryAdapter.initialize,
|
|
862
855
|
addCategory: categoryAdapter.addOne,
|
|
863
856
|
updateCategory: categoryAdapter.updateOne,
|
|
864
|
-
deleteCategory: categoryAdapter.deleteOne
|
|
865
|
-
// Pass in a null value to hide the "No category" category
|
|
866
|
-
hideCategory: (state, action) => {
|
|
867
|
-
const categoryId = action.payload;
|
|
868
|
-
if (categoryId === null) {
|
|
869
|
-
state.categoryVisibility.isNullCategoryHidden = true;
|
|
870
|
-
} else if (!(categoryId in state.categoryVisibility.hiddenCategoryIds)) {
|
|
871
|
-
state.categoryVisibility.hiddenCategoryIds.push(categoryId);
|
|
872
|
-
}
|
|
873
|
-
},
|
|
874
|
-
hideAllCategories: (state) => {
|
|
875
|
-
state.categoryVisibility.hiddenCategoryIds = Object.keys(state.instances);
|
|
876
|
-
state.categoryVisibility.isNullCategoryHidden = true;
|
|
877
|
-
},
|
|
878
|
-
// Pass in a null value to unhide the "No category" category
|
|
879
|
-
unhideCategory: (state, action) => {
|
|
880
|
-
const categoryId = action.payload;
|
|
881
|
-
if (categoryId === null) {
|
|
882
|
-
state.categoryVisibility.isNullCategoryHidden = false;
|
|
883
|
-
} else {
|
|
884
|
-
state.categoryVisibility.hiddenCategoryIds = state.categoryVisibility.hiddenCategoryIds.filter(
|
|
885
|
-
(id) => id !== categoryId
|
|
886
|
-
);
|
|
887
|
-
}
|
|
888
|
-
},
|
|
889
|
-
unhideAllCategories: (state) => {
|
|
890
|
-
state.categoryVisibility.hiddenCategoryIds = [];
|
|
891
|
-
state.categoryVisibility.isNullCategoryHidden = false;
|
|
892
|
-
}
|
|
857
|
+
deleteCategory: categoryAdapter.deleteOne
|
|
893
858
|
}
|
|
894
859
|
});
|
|
895
|
-
const {
|
|
896
|
-
initializeCategories,
|
|
897
|
-
addCategory,
|
|
898
|
-
updateCategory,
|
|
899
|
-
deleteCategory,
|
|
900
|
-
hideCategory,
|
|
901
|
-
hideAllCategories,
|
|
902
|
-
unhideCategory,
|
|
903
|
-
unhideAllCategories
|
|
904
|
-
} = categorySlice.actions;
|
|
860
|
+
const { initializeCategories, addCategory, updateCategory, deleteCategory } = categorySlice.actions;
|
|
905
861
|
const selectCategoryMapping = (state) => state.categoryReducer.instances;
|
|
906
|
-
const
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
(mapping, activeWorkspaceId) => activeWorkspaceId ? Object.values(mapping).filter((category) => category.workspace === activeWorkspaceId) : []
|
|
910
|
-
);
|
|
862
|
+
const selectCategories = toolkit.createSelector([selectCategoryMapping], (categoryMapping) => {
|
|
863
|
+
return Object.values(categoryMapping);
|
|
864
|
+
});
|
|
911
865
|
const selectCategoriesOfWorkspace = restructureCreateSelectorWithArgs(
|
|
912
866
|
toolkit.createSelector(
|
|
913
867
|
[selectCategories, (_state, workspaceId) => workspaceId],
|
|
@@ -920,36 +874,23 @@ var __publicField = (obj, key, value) => {
|
|
|
920
874
|
(mapping, categoryId) => mapping[categoryId]
|
|
921
875
|
)
|
|
922
876
|
);
|
|
923
|
-
const selectCategoryVisibility = (state) => state.categoryReducer.categoryVisibility;
|
|
924
|
-
const selectHiddenCategoryCount = (state) => {
|
|
925
|
-
const { hiddenCategoryIds, isNullCategoryHidden } = state.categoryReducer.categoryVisibility;
|
|
926
|
-
let hiddenCategoryCount = hiddenCategoryIds.length;
|
|
927
|
-
if (isNullCategoryHidden)
|
|
928
|
-
hiddenCategoryCount++;
|
|
929
|
-
return hiddenCategoryCount;
|
|
930
|
-
};
|
|
931
877
|
const selectIssueCountOfCategory = (categoryId) => (state) => {
|
|
932
878
|
return Object.values(state.issueReducer.instances).filter((issue) => issue.category === categoryId).length;
|
|
933
879
|
};
|
|
934
880
|
const categoryReducer = categorySlice.reducer;
|
|
935
881
|
const assetTypeAdapter = createModelAdapter((assetType) => assetType.offline_id);
|
|
936
|
-
const initialState$
|
|
937
|
-
hiddenAssetTypeIds: {}
|
|
938
|
-
});
|
|
882
|
+
const initialState$z = assetTypeAdapter.getInitialState({});
|
|
939
883
|
const assetTypeSlice = toolkit.createSlice({
|
|
940
884
|
name: "assetTypes",
|
|
941
|
-
initialState: initialState$
|
|
942
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
885
|
+
initialState: initialState$z,
|
|
886
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$z)),
|
|
943
887
|
reducers: {
|
|
944
888
|
initializeAssetTypes: assetTypeAdapter.initialize,
|
|
945
889
|
addAssetType: assetTypeAdapter.addOne,
|
|
946
|
-
deleteAssetType: assetTypeAdapter.deleteOne
|
|
947
|
-
toggleAssetTypeVisibility: (state, action) => {
|
|
948
|
-
state.hiddenAssetTypeIds[action.payload] = !state.hiddenAssetTypeIds[action.payload];
|
|
949
|
-
}
|
|
890
|
+
deleteAssetType: assetTypeAdapter.deleteOne
|
|
950
891
|
}
|
|
951
892
|
});
|
|
952
|
-
const { addAssetType, initializeAssetTypes, deleteAssetType
|
|
893
|
+
const { addAssetType, initializeAssetTypes, deleteAssetType } = assetTypeSlice.actions;
|
|
953
894
|
const selectAssetTypesMapping = (state) => state.assetTypeReducer.instances;
|
|
954
895
|
const selectAssetTypes = toolkit.createSelector(
|
|
955
896
|
[selectAssetTypesMapping],
|
|
@@ -985,14 +926,13 @@ var __publicField = (obj, key, value) => {
|
|
|
985
926
|
});
|
|
986
927
|
})
|
|
987
928
|
);
|
|
988
|
-
const selectHiddenAssetTypeIds = (state) => state.assetTypeReducer.hiddenAssetTypeIds;
|
|
989
929
|
const assetTypeReducer = assetTypeSlice.reducer;
|
|
990
930
|
const assetAdapter = createModelAdapter((asset) => asset.offline_id);
|
|
991
|
-
const initialState$
|
|
931
|
+
const initialState$y = assetAdapter.getInitialState({});
|
|
992
932
|
const assetSlice = toolkit.createSlice({
|
|
993
933
|
name: "assets",
|
|
994
|
-
initialState: initialState$
|
|
995
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
934
|
+
initialState: initialState$y,
|
|
935
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$y)),
|
|
996
936
|
reducers: {
|
|
997
937
|
initializeAssets: (state, action) => {
|
|
998
938
|
assetAdapter.initialize(state, action);
|
|
@@ -1095,11 +1035,11 @@ var __publicField = (obj, key, value) => {
|
|
|
1095
1035
|
};
|
|
1096
1036
|
const assetReducer = assetSlice.reducer;
|
|
1097
1037
|
const assetAttachmentAdapter = createModelAdapter((attachment) => attachment.offline_id);
|
|
1098
|
-
const initialState$
|
|
1038
|
+
const initialState$x = assetAttachmentAdapter.getInitialState({});
|
|
1099
1039
|
const assetAttachmentSlice = toolkit.createSlice({
|
|
1100
1040
|
name: "assetAttachments",
|
|
1101
|
-
initialState: initialState$
|
|
1102
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1041
|
+
initialState: initialState$x,
|
|
1042
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$x)),
|
|
1103
1043
|
reducers: {
|
|
1104
1044
|
initializeAssetAttachments: assetAttachmentAdapter.initialize,
|
|
1105
1045
|
addAssetAttachment: assetAttachmentAdapter.addOne,
|
|
@@ -1157,13 +1097,13 @@ var __publicField = (obj, key, value) => {
|
|
|
1157
1097
|
)
|
|
1158
1098
|
);
|
|
1159
1099
|
const assetAttachmentReducer = assetAttachmentSlice.reducer;
|
|
1160
|
-
const initialState$
|
|
1100
|
+
const initialState$w = {
|
|
1161
1101
|
completionsByAssetId: {}
|
|
1162
1102
|
};
|
|
1163
1103
|
const assetStageCompletionSlice = toolkit.createSlice({
|
|
1164
1104
|
name: "assetStageCompletions",
|
|
1165
|
-
initialState: initialState$
|
|
1166
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1105
|
+
initialState: initialState$w,
|
|
1106
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$w)),
|
|
1167
1107
|
reducers: {
|
|
1168
1108
|
addStageCompletion: (state, action) => {
|
|
1169
1109
|
let stageToCompletionDateMapping = state.completionsByAssetId[action.payload.asset];
|
|
@@ -1215,11 +1155,11 @@ var __publicField = (obj, key, value) => {
|
|
|
1215
1155
|
);
|
|
1216
1156
|
const assetStageCompletionReducer = assetStageCompletionSlice.reducer;
|
|
1217
1157
|
const assetStageAdapter = createModelAdapter((assetStage) => assetStage.offline_id);
|
|
1218
|
-
const initialState$
|
|
1158
|
+
const initialState$v = assetStageAdapter.getInitialState({});
|
|
1219
1159
|
const assetStageSlice = toolkit.createSlice({
|
|
1220
1160
|
name: "assetStages",
|
|
1221
|
-
initialState: initialState$
|
|
1222
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1161
|
+
initialState: initialState$v,
|
|
1162
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$v)),
|
|
1223
1163
|
reducers: {
|
|
1224
1164
|
initializeStages: assetStageAdapter.initialize,
|
|
1225
1165
|
setStage: assetStageAdapter.setOne,
|
|
@@ -1288,8 +1228,8 @@ var __publicField = (obj, key, value) => {
|
|
|
1288
1228
|
if (!stage) {
|
|
1289
1229
|
throw new Error("No stage exists with the id " + stageId);
|
|
1290
1230
|
}
|
|
1291
|
-
if (stage.
|
|
1292
|
-
ret[stageId] = stage.
|
|
1231
|
+
if (stage.form) {
|
|
1232
|
+
ret[stageId] = stage.form;
|
|
1293
1233
|
}
|
|
1294
1234
|
}
|
|
1295
1235
|
return ret;
|
|
@@ -1300,11 +1240,11 @@ var __publicField = (obj, key, value) => {
|
|
|
1300
1240
|
const assetTypeAttachmentAdapter = createModelAdapter(
|
|
1301
1241
|
(attachment) => attachment.offline_id
|
|
1302
1242
|
);
|
|
1303
|
-
const initialState$
|
|
1243
|
+
const initialState$u = assetTypeAttachmentAdapter.getInitialState({});
|
|
1304
1244
|
const assetTypeAttachmentSlice = toolkit.createSlice({
|
|
1305
1245
|
name: "assetTypeAttachments",
|
|
1306
|
-
initialState: initialState$
|
|
1307
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1246
|
+
initialState: initialState$u,
|
|
1247
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$u)),
|
|
1308
1248
|
reducers: {
|
|
1309
1249
|
initializeAssetTypeAttachments: assetTypeAttachmentAdapter.initialize,
|
|
1310
1250
|
addAssetTypeAttachment: assetTypeAttachmentAdapter.addOne,
|
|
@@ -1363,31 +1303,19 @@ var __publicField = (obj, key, value) => {
|
|
|
1363
1303
|
);
|
|
1364
1304
|
const assetTypeAttachmentReducer = assetTypeAttachmentSlice.reducer;
|
|
1365
1305
|
const workspaceAdapter = createModelAdapter((workspace) => workspace.offline_id);
|
|
1366
|
-
const initialState$
|
|
1367
|
-
activeWorkspaceId: null
|
|
1368
|
-
});
|
|
1306
|
+
const initialState$t = workspaceAdapter.getInitialState({});
|
|
1369
1307
|
const workspaceSlice = toolkit.createSlice({
|
|
1370
1308
|
name: "workspace",
|
|
1371
|
-
initialState: initialState$
|
|
1309
|
+
initialState: initialState$t,
|
|
1372
1310
|
reducers: {
|
|
1373
1311
|
initializeWorkspaces: workspaceAdapter.initialize,
|
|
1374
1312
|
setWorkspaces: workspaceAdapter.setMany,
|
|
1375
1313
|
addWorkspace: workspaceAdapter.addOne,
|
|
1376
1314
|
updateWorkspace: workspaceAdapter.updateOne,
|
|
1377
|
-
deleteWorkspace: workspaceAdapter.deleteOne
|
|
1378
|
-
setActiveWorkspaceId: (state, action) => {
|
|
1379
|
-
state.activeWorkspaceId = action.payload;
|
|
1380
|
-
}
|
|
1315
|
+
deleteWorkspace: workspaceAdapter.deleteOne
|
|
1381
1316
|
}
|
|
1382
1317
|
});
|
|
1383
|
-
const {
|
|
1384
|
-
initializeWorkspaces,
|
|
1385
|
-
setWorkspaces,
|
|
1386
|
-
addWorkspace,
|
|
1387
|
-
updateWorkspace,
|
|
1388
|
-
setActiveWorkspaceId,
|
|
1389
|
-
deleteWorkspace
|
|
1390
|
-
} = workspaceSlice.actions;
|
|
1318
|
+
const { initializeWorkspaces, setWorkspaces, addWorkspace, updateWorkspace, deleteWorkspace } = workspaceSlice.actions;
|
|
1391
1319
|
const selectWorkspaceMapping = (state) => state.workspaceReducer.instances;
|
|
1392
1320
|
const selectWorkspaces = toolkit.createSelector([selectWorkspaceMapping], (mapping) => Object.values(mapping));
|
|
1393
1321
|
const selectMainWorkspace = toolkit.createSelector(
|
|
@@ -1396,20 +1324,9 @@ var __publicField = (obj, key, value) => {
|
|
|
1396
1324
|
return workspaces.find((workspace) => workspace.name.toLowerCase() === "main");
|
|
1397
1325
|
}
|
|
1398
1326
|
);
|
|
1399
|
-
const
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
})
|
|
1403
|
-
);
|
|
1404
|
-
const selectActiveWorkspaceId = (state) => state.workspaceReducer.activeWorkspaceId;
|
|
1405
|
-
const selectActiveWorkspace = toolkit.createSelector(
|
|
1406
|
-
[selectWorkspaceMapping, selectActiveWorkspaceId],
|
|
1407
|
-
(mapping, activeWorkspaceId) => {
|
|
1408
|
-
if (!activeWorkspaceId)
|
|
1409
|
-
return null;
|
|
1410
|
-
return mapping[activeWorkspaceId];
|
|
1411
|
-
}
|
|
1412
|
-
);
|
|
1327
|
+
const selectWorkspaceById = (workspaceId) => (state) => {
|
|
1328
|
+
return state.workspaceReducer.instances[workspaceId];
|
|
1329
|
+
};
|
|
1413
1330
|
const selectPermittedWorkspaceIds = toolkit.createSelector(
|
|
1414
1331
|
[selectWorkspaceMapping],
|
|
1415
1332
|
(mapping) => {
|
|
@@ -1421,16 +1338,14 @@ var __publicField = (obj, key, value) => {
|
|
|
1421
1338
|
const workspaceReducer = workspaceSlice.reducer;
|
|
1422
1339
|
const maxRecentIssues = 10;
|
|
1423
1340
|
const issueAdapter = createModelAdapter((issue) => issue.offline_id);
|
|
1424
|
-
const initialState$
|
|
1425
|
-
visibleStatuses: [IssueStatus.BACKLOG, IssueStatus.SELECTED],
|
|
1426
|
-
visibleUserIds: null,
|
|
1341
|
+
const initialState$s = issueAdapter.getInitialState({
|
|
1427
1342
|
recentIssueIds: []
|
|
1428
1343
|
});
|
|
1429
1344
|
const issueSlice = toolkit.createSlice({
|
|
1430
1345
|
name: "issues",
|
|
1431
|
-
initialState: initialState$
|
|
1346
|
+
initialState: initialState$s,
|
|
1432
1347
|
extraReducers: (builder) => builder.addCase("RESET", (state) => {
|
|
1433
|
-
Object.assign(state, initialState$
|
|
1348
|
+
Object.assign(state, initialState$s);
|
|
1434
1349
|
}),
|
|
1435
1350
|
reducers: {
|
|
1436
1351
|
initializeIssues: issueAdapter.initialize,
|
|
@@ -1439,12 +1354,6 @@ var __publicField = (obj, key, value) => {
|
|
|
1439
1354
|
updateIssue: issueAdapter.updateOne,
|
|
1440
1355
|
deleteIssue: issueAdapter.deleteOne,
|
|
1441
1356
|
deleteIssues: issueAdapter.deleteMany,
|
|
1442
|
-
setVisibleStatuses: (state, action) => {
|
|
1443
|
-
state.visibleStatuses = action.payload;
|
|
1444
|
-
},
|
|
1445
|
-
setVisibleUserIds: (state, action) => {
|
|
1446
|
-
state.visibleUserIds = [...new Set(action.payload)];
|
|
1447
|
-
},
|
|
1448
1357
|
cleanRecentIssues: (state) => {
|
|
1449
1358
|
state.recentIssueIds = state.recentIssueIds.filter((recentIssue) => state.instances[recentIssue.offlineId]);
|
|
1450
1359
|
},
|
|
@@ -1477,8 +1386,6 @@ var __publicField = (obj, key, value) => {
|
|
|
1477
1386
|
updateIssue,
|
|
1478
1387
|
deleteIssue,
|
|
1479
1388
|
deleteIssues,
|
|
1480
|
-
setVisibleStatuses,
|
|
1481
|
-
setVisibleUserIds,
|
|
1482
1389
|
addToRecentIssues,
|
|
1483
1390
|
cleanRecentIssues,
|
|
1484
1391
|
removeRecentIssue,
|
|
@@ -1486,51 +1393,6 @@ var __publicField = (obj, key, value) => {
|
|
|
1486
1393
|
} = issueSlice.actions;
|
|
1487
1394
|
const selectIssueMapping = (state) => state.issueReducer.instances;
|
|
1488
1395
|
const selectRecentIssueIds = (state) => state.issueReducer.recentIssueIds;
|
|
1489
|
-
const selectVisibleUserIds = (state) => state.issueReducer.visibleUserIds;
|
|
1490
|
-
const selectVisibleStatuses = (state) => state.issueReducer.visibleStatuses;
|
|
1491
|
-
const selectIssues = restructureCreateSelectorWithArgs(
|
|
1492
|
-
toolkit.createSelector(
|
|
1493
|
-
[
|
|
1494
|
-
selectIssueMapping,
|
|
1495
|
-
selectVisibleUserIds,
|
|
1496
|
-
selectVisibleStatuses,
|
|
1497
|
-
selectCategoryVisibility,
|
|
1498
|
-
selectActiveWorkspaceId,
|
|
1499
|
-
(_state, args) => args
|
|
1500
|
-
],
|
|
1501
|
-
(mapping, visibleUserIds, visibleStatuses, categoryVisibility, activeWorkspaceId, args) => {
|
|
1502
|
-
let ret = Object.values(mapping);
|
|
1503
|
-
const visibleUserIdsSet = new Set(visibleUserIds);
|
|
1504
|
-
const visibleStatusesSet = new Set(visibleStatuses);
|
|
1505
|
-
if (args.filterByAssignedTo && (visibleUserIds == null ? void 0 : visibleUserIds.length)) {
|
|
1506
|
-
ret = ret.filter((issue) => {
|
|
1507
|
-
return visibleUserIdsSet.has(issue.assigned_to || null);
|
|
1508
|
-
});
|
|
1509
|
-
}
|
|
1510
|
-
if (args.filterByStatus) {
|
|
1511
|
-
ret = ret.filter((issue) => {
|
|
1512
|
-
return visibleStatusesSet.has(issue.status);
|
|
1513
|
-
});
|
|
1514
|
-
}
|
|
1515
|
-
if (args.filterByCategory) {
|
|
1516
|
-
const isNullCategoryHidden = categoryVisibility.isNullCategoryHidden;
|
|
1517
|
-
const hiddenCategoryIds = categoryVisibility.hiddenCategoryIds;
|
|
1518
|
-
ret = ret.filter((issue) => {
|
|
1519
|
-
if (!issue.category) {
|
|
1520
|
-
return !isNullCategoryHidden;
|
|
1521
|
-
}
|
|
1522
|
-
return !hiddenCategoryIds.includes(issue.category);
|
|
1523
|
-
});
|
|
1524
|
-
if (args.filterByWorkspace) {
|
|
1525
|
-
ret = ret.filter((issue) => {
|
|
1526
|
-
return activeWorkspaceId && issue.visible_in_workspaces.includes(activeWorkspaceId);
|
|
1527
|
-
});
|
|
1528
|
-
}
|
|
1529
|
-
}
|
|
1530
|
-
return ret;
|
|
1531
|
-
}
|
|
1532
|
-
)
|
|
1533
|
-
);
|
|
1534
1396
|
const selectIssue = restructureCreateSelectorWithArgs(
|
|
1535
1397
|
toolkit.createSelector([selectIssueMapping, (_state, id) => id], (mapping, id) => {
|
|
1536
1398
|
return mapping[id];
|
|
@@ -1627,12 +1489,12 @@ var __publicField = (obj, key, value) => {
|
|
|
1627
1489
|
);
|
|
1628
1490
|
const issueReducer = issueSlice.reducer;
|
|
1629
1491
|
const issueTypeAdapter = createModelAdapter((issueType) => issueType.offline_id);
|
|
1630
|
-
const initialState$
|
|
1492
|
+
const initialState$r = issueTypeAdapter.getInitialState({});
|
|
1631
1493
|
const issueTypeSlice = toolkit.createSlice({
|
|
1632
1494
|
name: "issueTypes",
|
|
1633
|
-
initialState: initialState$
|
|
1495
|
+
initialState: initialState$r,
|
|
1634
1496
|
extraReducers: (builder) => builder.addCase("RESET", (state) => {
|
|
1635
|
-
Object.assign(state, initialState$
|
|
1497
|
+
Object.assign(state, initialState$r);
|
|
1636
1498
|
}),
|
|
1637
1499
|
reducers: {
|
|
1638
1500
|
initializeIssueTypes: issueTypeAdapter.initialize,
|
|
@@ -1681,15 +1543,15 @@ var __publicField = (obj, key, value) => {
|
|
|
1681
1543
|
return ((_a2 = selectIssuesOfIssueType(issueTypeId)(state)) == null ? void 0 : _a2.length) ?? 0;
|
|
1682
1544
|
};
|
|
1683
1545
|
const issueTypeReducer = issueTypeSlice.reducer;
|
|
1684
|
-
const initialState$
|
|
1546
|
+
const initialState$q = {
|
|
1685
1547
|
s3Urls: {}
|
|
1686
1548
|
};
|
|
1687
1549
|
const msPerHour = 1e3 * 60 * 60;
|
|
1688
1550
|
const msPerWeek = msPerHour * 24 * 7;
|
|
1689
1551
|
const fileSlice = toolkit.createSlice({
|
|
1690
1552
|
name: "file",
|
|
1691
|
-
initialState: initialState$
|
|
1692
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1553
|
+
initialState: initialState$q,
|
|
1554
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$q)),
|
|
1693
1555
|
reducers: {
|
|
1694
1556
|
setUploadUrl: (state, action) => {
|
|
1695
1557
|
const { url, fields, sha1 } = action.payload;
|
|
@@ -1770,7 +1632,7 @@ var __publicField = (obj, key, value) => {
|
|
|
1770
1632
|
LicenseStatus2[LicenseStatus2["PAST_DUE"] = 8] = "PAST_DUE";
|
|
1771
1633
|
return LicenseStatus2;
|
|
1772
1634
|
})(LicenseStatus || {});
|
|
1773
|
-
const initialState$
|
|
1635
|
+
const initialState$p = {
|
|
1774
1636
|
users: {},
|
|
1775
1637
|
currentUser: {
|
|
1776
1638
|
id: 0,
|
|
@@ -1781,8 +1643,8 @@ var __publicField = (obj, key, value) => {
|
|
|
1781
1643
|
};
|
|
1782
1644
|
const userSlice = toolkit.createSlice({
|
|
1783
1645
|
name: "users",
|
|
1784
|
-
initialState: initialState$
|
|
1785
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1646
|
+
initialState: initialState$p,
|
|
1647
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$p)),
|
|
1786
1648
|
reducers: {
|
|
1787
1649
|
setUsers: (state, action) => {
|
|
1788
1650
|
const usersMapping = {};
|
|
@@ -1847,11 +1709,11 @@ var __publicField = (obj, key, value) => {
|
|
|
1847
1709
|
const organizationAccessAdapter = createModelAdapter(
|
|
1848
1710
|
(organizationAccess) => organizationAccess.offline_id
|
|
1849
1711
|
);
|
|
1850
|
-
const initialState$
|
|
1712
|
+
const initialState$o = organizationAccessAdapter.getInitialState({});
|
|
1851
1713
|
const organizationAccessSlice = toolkit.createSlice({
|
|
1852
1714
|
name: "organizationAccess",
|
|
1853
|
-
initialState: initialState$
|
|
1854
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1715
|
+
initialState: initialState$o,
|
|
1716
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$o)),
|
|
1855
1717
|
reducers: {
|
|
1856
1718
|
initializeOrganizationAccesses: organizationAccessAdapter.initialize,
|
|
1857
1719
|
updateOrganizationAccess: organizationAccessAdapter.updateOne,
|
|
@@ -1888,11 +1750,11 @@ var __publicField = (obj, key, value) => {
|
|
|
1888
1750
|
};
|
|
1889
1751
|
const organizationAccessReducer = organizationAccessSlice.reducer;
|
|
1890
1752
|
const licenseAdapter = createModelAdapter((license) => license.offline_id);
|
|
1891
|
-
const initialState$
|
|
1753
|
+
const initialState$n = licenseAdapter.getInitialState({});
|
|
1892
1754
|
const licenseSlice = toolkit.createSlice({
|
|
1893
1755
|
name: "license",
|
|
1894
|
-
initialState: initialState$
|
|
1895
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1756
|
+
initialState: initialState$n,
|
|
1757
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$n)),
|
|
1896
1758
|
reducers: {
|
|
1897
1759
|
setLicenses: licenseAdapter.initialize,
|
|
1898
1760
|
addLicenses: licenseAdapter.addMany,
|
|
@@ -1918,11 +1780,11 @@ var __publicField = (obj, key, value) => {
|
|
|
1918
1780
|
);
|
|
1919
1781
|
const licenseReducer = licenseSlice.reducer;
|
|
1920
1782
|
const projectAccessAdapter = createModelAdapter((projectAccess) => projectAccess.offline_id);
|
|
1921
|
-
const initialState$
|
|
1783
|
+
const initialState$m = projectAccessAdapter.getInitialState({});
|
|
1922
1784
|
const projectAccessSlice = toolkit.createSlice({
|
|
1923
1785
|
name: "projectAccess",
|
|
1924
|
-
initialState: initialState$
|
|
1925
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1786
|
+
initialState: initialState$m,
|
|
1787
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$m)),
|
|
1926
1788
|
reducers: {
|
|
1927
1789
|
setProjectAccesses: projectAccessAdapter.initialize,
|
|
1928
1790
|
updateProjectAccess: projectAccessAdapter.updateOne,
|
|
@@ -1968,15 +1830,14 @@ var __publicField = (obj, key, value) => {
|
|
|
1968
1830
|
return projectAccesses;
|
|
1969
1831
|
};
|
|
1970
1832
|
const projectAccessReducer = projectAccessSlice.reducer;
|
|
1971
|
-
const initialState$
|
|
1833
|
+
const initialState$l = {
|
|
1972
1834
|
projects: {},
|
|
1973
|
-
activeProjectId: null
|
|
1974
|
-
recentProjectIds: [],
|
|
1975
|
-
recentSearchableQueries: []
|
|
1835
|
+
activeProjectId: null
|
|
1976
1836
|
};
|
|
1977
1837
|
const projectSlice = toolkit.createSlice({
|
|
1978
1838
|
name: "projects",
|
|
1979
|
-
initialState: initialState$
|
|
1839
|
+
initialState: initialState$l,
|
|
1840
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$l)),
|
|
1980
1841
|
reducers: {
|
|
1981
1842
|
setProjects: (state, action) => {
|
|
1982
1843
|
const projectsMap = {};
|
|
@@ -2056,21 +1917,6 @@ var __publicField = (obj, key, value) => {
|
|
|
2056
1917
|
(projects, projectId) => projects[projectId]
|
|
2057
1918
|
)
|
|
2058
1919
|
);
|
|
2059
|
-
const selectSortedProjects = toolkit.createSelector(
|
|
2060
|
-
[selectActiveProject, selectProjects],
|
|
2061
|
-
(activeProject, projects) => {
|
|
2062
|
-
return Object.values(projects).sort((projectA, projectB) => {
|
|
2063
|
-
if (activeProject) {
|
|
2064
|
-
if (activeProject.id === projectA.id) {
|
|
2065
|
-
return -1;
|
|
2066
|
-
} else if (activeProject.id === projectB.id) {
|
|
2067
|
-
return 1;
|
|
2068
|
-
}
|
|
2069
|
-
}
|
|
2070
|
-
return projectA.name.toLowerCase().localeCompare(projectB.name.toLowerCase(), void 0, { numeric: true });
|
|
2071
|
-
});
|
|
2072
|
-
}
|
|
2073
|
-
);
|
|
2074
1920
|
const projectReducer = projectSlice.reducer;
|
|
2075
1921
|
const selectProjectUsersIds = toolkit.createSelector(
|
|
2076
1922
|
[selectProjectAccessMapping],
|
|
@@ -2105,38 +1951,22 @@ var __publicField = (obj, key, value) => {
|
|
|
2105
1951
|
});
|
|
2106
1952
|
}
|
|
2107
1953
|
);
|
|
2108
|
-
const initialState$
|
|
2109
|
-
organizations: {}
|
|
2110
|
-
activeOrganizationId: null
|
|
1954
|
+
const initialState$k = {
|
|
1955
|
+
organizations: {}
|
|
2111
1956
|
};
|
|
2112
1957
|
const organizationSlice = toolkit.createSlice({
|
|
2113
1958
|
name: "organizations",
|
|
2114
|
-
initialState: initialState$
|
|
2115
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1959
|
+
initialState: initialState$k,
|
|
1960
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$k)),
|
|
2116
1961
|
reducers: {
|
|
2117
1962
|
setOrganizations: (state, action) => {
|
|
2118
1963
|
for (const org of action.payload) {
|
|
2119
1964
|
state.organizations[org.id] = org;
|
|
2120
1965
|
}
|
|
2121
|
-
},
|
|
2122
|
-
updateActiveOrganization: (state, action) => {
|
|
2123
|
-
if (!state.activeOrganizationId) {
|
|
2124
|
-
throw new Error("Cannot update name of active organization. Active organization ID does not exist");
|
|
2125
|
-
}
|
|
2126
|
-
if (state.activeOrganizationId !== action.payload.id) {
|
|
2127
|
-
throw new Error("Tried updating active organization with different organization");
|
|
2128
|
-
}
|
|
2129
|
-
state.organizations[state.activeOrganizationId] = action.payload;
|
|
2130
|
-
},
|
|
2131
|
-
setActiveOrganizationId: (state, action) => {
|
|
2132
|
-
state.activeOrganizationId = action.payload;
|
|
2133
1966
|
}
|
|
2134
1967
|
}
|
|
2135
1968
|
});
|
|
2136
|
-
const { setOrganizations
|
|
2137
|
-
const selectActiveOrganizationId = (state) => {
|
|
2138
|
-
return state.organizationReducer.activeOrganizationId;
|
|
2139
|
-
};
|
|
1969
|
+
const { setOrganizations } = organizationSlice.actions;
|
|
2140
1970
|
const selectOrganizations = (state) => {
|
|
2141
1971
|
return Object.values(state.organizationReducer.organizations);
|
|
2142
1972
|
};
|
|
@@ -2147,43 +1977,21 @@ var __publicField = (obj, key, value) => {
|
|
|
2147
1977
|
[selectOrganizations],
|
|
2148
1978
|
(organizations) => Object.values(organizations).filter((organization) => organization.has_access)
|
|
2149
1979
|
);
|
|
2150
|
-
const
|
|
2151
|
-
|
|
2152
|
-
if (!id) {
|
|
2153
|
-
return null;
|
|
2154
|
-
}
|
|
2155
|
-
const organization = state.organizationReducer.organizations[id];
|
|
2156
|
-
if (!organization) {
|
|
2157
|
-
return null;
|
|
2158
|
-
}
|
|
2159
|
-
return organization;
|
|
1980
|
+
const selectOrganizationById = (organizationId) => (state) => {
|
|
1981
|
+
return state.organizationReducer.organizations[organizationId];
|
|
2160
1982
|
};
|
|
2161
1983
|
const selectOrganizationUsersIds = toolkit.createSelector(
|
|
2162
1984
|
[selectOrganizationAccesses],
|
|
2163
1985
|
(organizationAccesses) => Object.values(organizationAccesses).map((organizationAccess) => organizationAccess.user)
|
|
2164
1986
|
);
|
|
2165
|
-
const
|
|
2166
|
-
[selectProjects,
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
const selectActiveOrganizationLicenses = toolkit.createSelector(
|
|
2170
|
-
[selectActiveOrganizationId, selectLicenses],
|
|
2171
|
-
(activeOrganizationId, licenses) => !activeOrganizationId ? [] : Object.values(licenses).filter((license) => license.organization_owner === activeOrganizationId)
|
|
1987
|
+
const selectProjectsOfOrganization = restructureCreateSelectorWithArgs(
|
|
1988
|
+
toolkit.createSelector([selectProjects, (_, organizationId) => organizationId], (projects, organizationId) => {
|
|
1989
|
+
return Object.values(projects).filter((project) => project.owner_organization === organizationId);
|
|
1990
|
+
})
|
|
2172
1991
|
);
|
|
2173
|
-
const
|
|
2174
|
-
[
|
|
2175
|
-
|
|
2176
|
-
if (!licenseA.project) {
|
|
2177
|
-
return 1;
|
|
2178
|
-
}
|
|
2179
|
-
if (!licenseB.project) {
|
|
2180
|
-
return -1;
|
|
2181
|
-
}
|
|
2182
|
-
return projects[licenseA.project].name.toLowerCase().localeCompare(
|
|
2183
|
-
projects[licenseB.project].name.toLowerCase(),
|
|
2184
|
-
void 0,
|
|
2185
|
-
{ numeric: true }
|
|
2186
|
-
);
|
|
1992
|
+
const selectLicensesOfOrganization = restructureCreateSelectorWithArgs(
|
|
1993
|
+
toolkit.createSelector([selectLicenses, (_, organizationId) => organizationId], (licenses, organizationId) => {
|
|
1994
|
+
return Object.values(licenses).filter((license) => license.organization_owner === organizationId);
|
|
2187
1995
|
})
|
|
2188
1996
|
);
|
|
2189
1997
|
const selectOrganizationUsersAsMapping = toolkit.createSelector(
|
|
@@ -2232,14 +2040,14 @@ var __publicField = (obj, key, value) => {
|
|
|
2232
2040
|
}
|
|
2233
2041
|
};
|
|
2234
2042
|
};
|
|
2235
|
-
const initialState$
|
|
2043
|
+
const initialState$j = {
|
|
2236
2044
|
deletedRequests: [],
|
|
2237
2045
|
latestRetryTime: 0
|
|
2238
2046
|
};
|
|
2239
2047
|
const outboxSlice = toolkit.createSlice({
|
|
2240
2048
|
name: "outbox",
|
|
2241
|
-
initialState: initialState$
|
|
2242
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2049
|
+
initialState: initialState$j,
|
|
2050
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$j)),
|
|
2243
2051
|
reducers: {
|
|
2244
2052
|
// enqueueActions is a reducer that does nothing but enqueue API request to the Redux Offline outbox
|
|
2245
2053
|
// Whenever an issue is being created, a reducer addIssue() is responsible for adding it to the offline store
|
|
@@ -2271,16 +2079,15 @@ var __publicField = (obj, key, value) => {
|
|
|
2271
2079
|
const selectLatestRetryTime = (state) => state.outboxReducer.latestRetryTime;
|
|
2272
2080
|
const { enqueueRequest, markForDeletion, markAsDeleted, _setLatestRetryTime } = outboxSlice.actions;
|
|
2273
2081
|
const outboxReducer = outboxSlice.reducer;
|
|
2274
|
-
const initialState$
|
|
2082
|
+
const initialState$i = {
|
|
2275
2083
|
projectFiles: {},
|
|
2276
2084
|
activeProjectFileId: null,
|
|
2277
|
-
isImportingProjectFile: false
|
|
2278
|
-
enabledProjectFiles: {}
|
|
2085
|
+
isImportingProjectFile: false
|
|
2279
2086
|
};
|
|
2280
2087
|
const projectFileSlice = toolkit.createSlice({
|
|
2281
2088
|
name: "projectFiles",
|
|
2282
|
-
initialState: initialState$
|
|
2283
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2089
|
+
initialState: initialState$i,
|
|
2090
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$i)),
|
|
2284
2091
|
reducers: {
|
|
2285
2092
|
addOrReplaceProjectFiles: (state, action) => {
|
|
2286
2093
|
for (let fileObj of action.payload) {
|
|
@@ -2305,9 +2112,6 @@ var __publicField = (obj, key, value) => {
|
|
|
2305
2112
|
}
|
|
2306
2113
|
state.projectFiles[action.payload.offline_id] = action.payload;
|
|
2307
2114
|
},
|
|
2308
|
-
setProjectFileVisible: (state, action) => {
|
|
2309
|
-
state.enabledProjectFiles[action.payload.fileId] = action.payload.visible;
|
|
2310
|
-
},
|
|
2311
2115
|
setIsImportingProjectFile: (state, action) => {
|
|
2312
2116
|
state.isImportingProjectFile = action.payload;
|
|
2313
2117
|
},
|
|
@@ -2327,19 +2131,14 @@ var __publicField = (obj, key, value) => {
|
|
|
2327
2131
|
// TODO: Move to MapContext. Should not be persisted.
|
|
2328
2132
|
setActiveProjectFileId: (state, action) => {
|
|
2329
2133
|
state.activeProjectFileId = action.payload;
|
|
2330
|
-
if (action.payload) {
|
|
2331
|
-
state.enabledProjectFiles[action.payload] = true;
|
|
2332
|
-
}
|
|
2333
2134
|
},
|
|
2334
2135
|
removeProjectFile: (state, action) => {
|
|
2335
2136
|
delete state.projectFiles[action.payload];
|
|
2336
|
-
delete state.enabledProjectFiles[action.payload];
|
|
2337
2137
|
},
|
|
2338
2138
|
removeProjectFilesOfProject: (state, action) => {
|
|
2339
2139
|
const filesToDelete = Object.values(state.projectFiles).filter((file) => file.project === action.payload);
|
|
2340
2140
|
for (const file of filesToDelete) {
|
|
2341
2141
|
delete state.projectFiles[file.offline_id];
|
|
2342
|
-
delete state.enabledProjectFiles[file.offline_id];
|
|
2343
2142
|
}
|
|
2344
2143
|
},
|
|
2345
2144
|
resetProjectFileObjectUrls: (state, ..._args) => {
|
|
@@ -2352,7 +2151,6 @@ var __publicField = (obj, key, value) => {
|
|
|
2352
2151
|
const {
|
|
2353
2152
|
addOrReplaceProjectFiles,
|
|
2354
2153
|
addOrReplaceProjectFile,
|
|
2355
|
-
setProjectFileVisible,
|
|
2356
2154
|
setIsImportingProjectFile,
|
|
2357
2155
|
setActiveProjectFileId,
|
|
2358
2156
|
saveActiveProjectFileBounds,
|
|
@@ -2360,33 +2158,25 @@ var __publicField = (obj, key, value) => {
|
|
|
2360
2158
|
removeProjectFilesOfProject,
|
|
2361
2159
|
resetProjectFileObjectUrls
|
|
2362
2160
|
} = projectFileSlice.actions;
|
|
2363
|
-
const
|
|
2364
|
-
const selectProjectFileVisibility = toolkit.createSelector(
|
|
2365
|
-
[selectEnabledProjectFiles],
|
|
2366
|
-
(enabledProjectFiles) => {
|
|
2367
|
-
const ret = {};
|
|
2368
|
-
for (const [fileId, enabled] of Object.entries(enabledProjectFiles)) {
|
|
2369
|
-
ret[fileId] = enabled === true || enabled === void 0;
|
|
2370
|
-
}
|
|
2371
|
-
return ret;
|
|
2372
|
-
}
|
|
2373
|
-
);
|
|
2374
|
-
const selectEnabledProjectFileMapping = (state) => state.projectFileReducer.projectFiles;
|
|
2161
|
+
const selectProjectFileMapping = (state) => state.projectFileReducer.projectFiles;
|
|
2375
2162
|
const selectProjectFiles = toolkit.createSelector(
|
|
2376
|
-
[
|
|
2163
|
+
[selectProjectFileMapping, selectActiveProjectId],
|
|
2377
2164
|
(mapping, activeProjectId) => {
|
|
2378
2165
|
return Object.values(mapping).filter((file) => file.project === activeProjectId).sort((a, b) => a.z_index - b.z_index);
|
|
2379
2166
|
}
|
|
2380
2167
|
);
|
|
2381
2168
|
const selectActiveProjectFileId = (state) => state.projectFileReducer.activeProjectFileId;
|
|
2382
2169
|
const selectIsImportingProjectFile = (state) => state.projectFileReducer.isImportingProjectFile;
|
|
2170
|
+
const selectProjectFileById = (id) => (state) => {
|
|
2171
|
+
return state.projectFileReducer.projectFiles[id];
|
|
2172
|
+
};
|
|
2383
2173
|
const projectFileReducer = projectFileSlice.reducer;
|
|
2384
2174
|
const projectAttachmentAdapter = createModelAdapter((attachment) => attachment.offline_id);
|
|
2385
|
-
const initialState$
|
|
2175
|
+
const initialState$h = projectAttachmentAdapter.getInitialState({});
|
|
2386
2176
|
const projectAttachmentSlice = toolkit.createSlice({
|
|
2387
2177
|
name: "projectAttachments",
|
|
2388
|
-
initialState: initialState$
|
|
2389
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2178
|
+
initialState: initialState$h,
|
|
2179
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$h)),
|
|
2390
2180
|
reducers: {
|
|
2391
2181
|
initializeProjectAttachments: projectAttachmentAdapter.initialize,
|
|
2392
2182
|
addProjectAttachment: projectAttachmentAdapter.addOne,
|
|
@@ -2444,12 +2234,12 @@ var __publicField = (obj, key, value) => {
|
|
|
2444
2234
|
)
|
|
2445
2235
|
);
|
|
2446
2236
|
const projectAttachmentReducer = projectAttachmentSlice.reducer;
|
|
2447
|
-
const initialState$
|
|
2237
|
+
const initialState$g = {
|
|
2448
2238
|
isRehydrated: false
|
|
2449
2239
|
};
|
|
2450
2240
|
const rehydratedSlice = toolkit.createSlice({
|
|
2451
2241
|
name: "rehydrated",
|
|
2452
|
-
initialState: initialState$
|
|
2242
|
+
initialState: initialState$g,
|
|
2453
2243
|
// The `reducers` field lets us define reducers and generate associated actions
|
|
2454
2244
|
reducers: {
|
|
2455
2245
|
setRehydrated: (state, action) => {
|
|
@@ -2460,13 +2250,13 @@ var __publicField = (obj, key, value) => {
|
|
|
2460
2250
|
const { setRehydrated } = rehydratedSlice.actions;
|
|
2461
2251
|
const selectRehydrated = (state) => state.rehydratedReducer.isRehydrated;
|
|
2462
2252
|
const rehydratedReducer = rehydratedSlice.reducer;
|
|
2463
|
-
const initialState$
|
|
2253
|
+
const initialState$f = {
|
|
2464
2254
|
isFetchingInitialData: false
|
|
2465
2255
|
};
|
|
2466
2256
|
const settingSlice = toolkit.createSlice({
|
|
2467
2257
|
name: "settings",
|
|
2468
|
-
initialState: initialState$
|
|
2469
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2258
|
+
initialState: initialState$f,
|
|
2259
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$f)),
|
|
2470
2260
|
reducers: {
|
|
2471
2261
|
setIsFetchingInitialData: (state, action) => {
|
|
2472
2262
|
state.isFetchingInitialData = action.payload;
|
|
@@ -2490,11 +2280,11 @@ var __publicField = (obj, key, value) => {
|
|
|
2490
2280
|
}
|
|
2491
2281
|
};
|
|
2492
2282
|
const formRevisionAdapter = createModelAdapter((revision) => revision.offline_id);
|
|
2493
|
-
const initialState$
|
|
2283
|
+
const initialState$e = formRevisionAdapter.getInitialState({});
|
|
2494
2284
|
const formRevisionsSlice = toolkit.createSlice({
|
|
2495
2285
|
name: "formRevisions",
|
|
2496
|
-
initialState: initialState$
|
|
2497
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2286
|
+
initialState: initialState$e,
|
|
2287
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$e)),
|
|
2498
2288
|
reducers: {
|
|
2499
2289
|
initializeFormRevisions: formRevisionAdapter.initialize,
|
|
2500
2290
|
setFormRevision: formRevisionAdapter.setOne,
|
|
@@ -2534,7 +2324,8 @@ var __publicField = (obj, key, value) => {
|
|
|
2534
2324
|
};
|
|
2535
2325
|
const selectLatestFormRevisionOfForm = restructureCreateSelectorWithArgs(
|
|
2536
2326
|
toolkit.createSelector([selectFormRevisions, (_state, formId) => formId], (revisions, formId) => {
|
|
2537
|
-
|
|
2327
|
+
const sortedRevisions = revisions.filter((revision) => revision.form === formId).sort(formRevisionSortFn).reverse();
|
|
2328
|
+
return sortedRevisions.length > 0 ? sortedRevisions[0] : void 0;
|
|
2538
2329
|
})
|
|
2539
2330
|
);
|
|
2540
2331
|
const selectFormRevisionsOfForm = restructureCreateSelectorWithArgs(
|
|
@@ -2586,11 +2377,11 @@ var __publicField = (obj, key, value) => {
|
|
|
2586
2377
|
});
|
|
2587
2378
|
const formRevisionReducer = formRevisionsSlice.reducer;
|
|
2588
2379
|
const formAdapter = createModelAdapter((form) => form.offline_id);
|
|
2589
|
-
const initialState$
|
|
2380
|
+
const initialState$d = formAdapter.getInitialState({});
|
|
2590
2381
|
const formSlice = toolkit.createSlice({
|
|
2591
2382
|
name: "forms",
|
|
2592
|
-
initialState: initialState$
|
|
2593
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2383
|
+
initialState: initialState$d,
|
|
2384
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$d)),
|
|
2594
2385
|
reducers: {
|
|
2595
2386
|
setForms: formAdapter.initialize,
|
|
2596
2387
|
setForm: formAdapter.setOne,
|
|
@@ -2672,11 +2463,11 @@ var __publicField = (obj, key, value) => {
|
|
|
2672
2463
|
});
|
|
2673
2464
|
const formReducer = formSlice.reducer;
|
|
2674
2465
|
const submissionAdapter = createModelAdapter((submission) => submission.offline_id);
|
|
2675
|
-
const initialState$
|
|
2466
|
+
const initialState$c = submissionAdapter.getInitialState({});
|
|
2676
2467
|
const formSubmissionSlice = toolkit.createSlice({
|
|
2677
2468
|
name: "formSubmissions",
|
|
2678
|
-
initialState: initialState$
|
|
2679
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2469
|
+
initialState: initialState$c,
|
|
2470
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$c)),
|
|
2680
2471
|
reducers: {
|
|
2681
2472
|
setFormSubmission: submissionAdapter.setOne,
|
|
2682
2473
|
setFormSubmissions: submissionAdapter.setMany,
|
|
@@ -2796,29 +2587,32 @@ var __publicField = (obj, key, value) => {
|
|
|
2796
2587
|
}
|
|
2797
2588
|
)
|
|
2798
2589
|
);
|
|
2799
|
-
const selectFormSubmissionsByAssets = toolkit.createSelector(
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
assetSubmissionMapping
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2590
|
+
const selectFormSubmissionsByAssets = toolkit.createSelector(
|
|
2591
|
+
[selectFormSubmissionsMapping, selectAssetsMapping],
|
|
2592
|
+
(submissions, assets) => {
|
|
2593
|
+
var _a2;
|
|
2594
|
+
const assetSubmissionMapping = {};
|
|
2595
|
+
for (const assetId in assets) {
|
|
2596
|
+
assetSubmissionMapping[assetId] = [];
|
|
2597
|
+
}
|
|
2598
|
+
for (const submissionId in submissions) {
|
|
2599
|
+
const submission = submissions[submissionId];
|
|
2600
|
+
if (submission.asset) {
|
|
2601
|
+
(_a2 = assetSubmissionMapping[submission.asset]) == null ? void 0 : _a2.push(submission);
|
|
2602
|
+
}
|
|
2809
2603
|
}
|
|
2604
|
+
return assetSubmissionMapping;
|
|
2810
2605
|
}
|
|
2811
|
-
|
|
2812
|
-
});
|
|
2606
|
+
);
|
|
2813
2607
|
const formSubmissionReducer = formSubmissionSlice.reducer;
|
|
2814
2608
|
const formSubmissionAttachmentAdapter = createModelAdapter(
|
|
2815
2609
|
(attachment) => attachment.offline_id
|
|
2816
2610
|
);
|
|
2817
|
-
const initialState$
|
|
2611
|
+
const initialState$b = formSubmissionAttachmentAdapter.getInitialState({});
|
|
2818
2612
|
const formSubmissionAttachmentSlice = toolkit.createSlice({
|
|
2819
2613
|
name: "formSubmissionAttachments",
|
|
2820
|
-
initialState: initialState$
|
|
2821
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2614
|
+
initialState: initialState$b,
|
|
2615
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$b)),
|
|
2822
2616
|
reducers: {
|
|
2823
2617
|
initializeFormSubmissionAttachments: formSubmissionAttachmentAdapter.initialize,
|
|
2824
2618
|
addFormSubmissionAttachment: formSubmissionAttachmentAdapter.addOne,
|
|
@@ -2857,11 +2651,11 @@ var __publicField = (obj, key, value) => {
|
|
|
2857
2651
|
const formRevisionAttachmentAdapter = createModelAdapter(
|
|
2858
2652
|
(attachment) => attachment.offline_id
|
|
2859
2653
|
);
|
|
2860
|
-
const initialState$
|
|
2654
|
+
const initialState$a = formRevisionAttachmentAdapter.getInitialState({});
|
|
2861
2655
|
const formRevisionAttachmentSlice = toolkit.createSlice({
|
|
2862
2656
|
name: "formRevisionAttachments",
|
|
2863
|
-
initialState: initialState$
|
|
2864
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2657
|
+
initialState: initialState$a,
|
|
2658
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$a)),
|
|
2865
2659
|
reducers: {
|
|
2866
2660
|
initializeFormRevisionAttachments: formRevisionAttachmentAdapter.initialize,
|
|
2867
2661
|
addFormRevisionAttachment: formRevisionAttachmentAdapter.addOne,
|
|
@@ -2898,10 +2692,10 @@ var __publicField = (obj, key, value) => {
|
|
|
2898
2692
|
);
|
|
2899
2693
|
const formRevisionAttachmentReducer = formRevisionAttachmentSlice.reducer;
|
|
2900
2694
|
const emailDomainAdapter = createModelAdapter((emailDomain) => emailDomain.offline_id);
|
|
2901
|
-
const initialState$
|
|
2695
|
+
const initialState$9 = emailDomainAdapter.getInitialState({});
|
|
2902
2696
|
const emailDomainsSlice = toolkit.createSlice({
|
|
2903
2697
|
name: "emailDomains",
|
|
2904
|
-
initialState: initialState$
|
|
2698
|
+
initialState: initialState$9,
|
|
2905
2699
|
reducers: {
|
|
2906
2700
|
initializeEmailDomains: emailDomainAdapter.initialize,
|
|
2907
2701
|
addEmailDomain: emailDomainAdapter.addOne,
|
|
@@ -2920,14 +2714,14 @@ var __publicField = (obj, key, value) => {
|
|
|
2920
2714
|
)
|
|
2921
2715
|
);
|
|
2922
2716
|
const emailDomainsReducer = emailDomainsSlice.reducer;
|
|
2923
|
-
const initialState$
|
|
2717
|
+
const initialState$8 = {
|
|
2924
2718
|
documents: {}
|
|
2925
2719
|
};
|
|
2926
2720
|
const documentSlice = toolkit.createSlice({
|
|
2927
2721
|
name: "documents",
|
|
2928
|
-
initialState: initialState$
|
|
2722
|
+
initialState: initialState$8,
|
|
2929
2723
|
extraReducers: (builder) => builder.addCase("RESET", (state) => {
|
|
2930
|
-
Object.assign(state, initialState$
|
|
2724
|
+
Object.assign(state, initialState$8);
|
|
2931
2725
|
}),
|
|
2932
2726
|
reducers: {
|
|
2933
2727
|
setDocuments: (state, action) => {
|
|
@@ -3102,11 +2896,11 @@ var __publicField = (obj, key, value) => {
|
|
|
3102
2896
|
);
|
|
3103
2897
|
const documentsReducer = documentSlice.reducer;
|
|
3104
2898
|
const documentAttachmentAdapter = createModelAdapter((attachment) => attachment.offline_id);
|
|
3105
|
-
const initialState$
|
|
2899
|
+
const initialState$7 = documentAttachmentAdapter.getInitialState({});
|
|
3106
2900
|
const documentAttachmentSlice = toolkit.createSlice({
|
|
3107
2901
|
name: "documentAttachments",
|
|
3108
|
-
initialState: initialState$
|
|
3109
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2902
|
+
initialState: initialState$7,
|
|
2903
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$7)),
|
|
3110
2904
|
reducers: {
|
|
3111
2905
|
initializeDocumentAttachments: documentAttachmentAdapter.initialize,
|
|
3112
2906
|
addDocumentAttachment: documentAttachmentAdapter.addOne,
|
|
@@ -3165,11 +2959,11 @@ var __publicField = (obj, key, value) => {
|
|
|
3165
2959
|
);
|
|
3166
2960
|
const documentAttachmentReducer = documentAttachmentSlice.reducer;
|
|
3167
2961
|
const teamAdapter = createModelAdapter((team) => team.offline_id);
|
|
3168
|
-
const initialState$
|
|
2962
|
+
const initialState$6 = teamAdapter.getInitialState({});
|
|
3169
2963
|
const teamSlice = toolkit.createSlice({
|
|
3170
2964
|
name: "teams",
|
|
3171
|
-
initialState: initialState$
|
|
3172
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2965
|
+
initialState: initialState$6,
|
|
2966
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$6)),
|
|
3173
2967
|
reducers: {
|
|
3174
2968
|
setTeam: teamAdapter.setOne,
|
|
3175
2969
|
setTeams: teamAdapter.initialize,
|
|
@@ -3203,11 +2997,11 @@ var __publicField = (obj, key, value) => {
|
|
|
3203
2997
|
const agentUserConversationAdapter = createModelAdapter(
|
|
3204
2998
|
(conversation) => conversation.offline_id
|
|
3205
2999
|
);
|
|
3206
|
-
const initialState$
|
|
3000
|
+
const initialState$5 = agentUserConversationAdapter.getInitialState({});
|
|
3207
3001
|
const agentsSlice = toolkit.createSlice({
|
|
3208
3002
|
name: "agents",
|
|
3209
|
-
initialState: initialState$
|
|
3210
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
3003
|
+
initialState: initialState$5,
|
|
3004
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$5)),
|
|
3211
3005
|
reducers: {
|
|
3212
3006
|
initializeConversations: agentUserConversationAdapter.initialize,
|
|
3213
3007
|
addConversation: agentUserConversationAdapter.addOne,
|
|
@@ -3229,11 +3023,11 @@ var __publicField = (obj, key, value) => {
|
|
|
3229
3023
|
);
|
|
3230
3024
|
const agentsReducer = agentsSlice.reducer;
|
|
3231
3025
|
const issueCommentAdapter = createModelAdapter((comment) => comment.offline_id);
|
|
3232
|
-
const initialState$
|
|
3026
|
+
const initialState$4 = issueCommentAdapter.getInitialState({});
|
|
3233
3027
|
const issueCommentSlice = toolkit.createSlice({
|
|
3234
3028
|
name: "issueComments",
|
|
3235
|
-
initialState: initialState$
|
|
3236
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
3029
|
+
initialState: initialState$4,
|
|
3030
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$4)),
|
|
3237
3031
|
reducers: {
|
|
3238
3032
|
addIssueComment: issueCommentAdapter.addOne,
|
|
3239
3033
|
addIssueComments: issueCommentAdapter.addMany,
|
|
@@ -3262,11 +3056,11 @@ var __publicField = (obj, key, value) => {
|
|
|
3262
3056
|
);
|
|
3263
3057
|
const issueCommentReducer = issueCommentSlice.reducer;
|
|
3264
3058
|
const issueUpdateAdapter = createModelAdapter((issueUpdate) => issueUpdate.offline_id);
|
|
3265
|
-
const initialState$
|
|
3059
|
+
const initialState$3 = issueUpdateAdapter.getInitialState({});
|
|
3266
3060
|
const issueUpdateSlice = toolkit.createSlice({
|
|
3267
3061
|
name: "issueUpdates",
|
|
3268
|
-
initialState: initialState$
|
|
3269
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
3062
|
+
initialState: initialState$3,
|
|
3063
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$3)),
|
|
3270
3064
|
reducers: {
|
|
3271
3065
|
initializeIssueUpdates: issueUpdateAdapter.setMany,
|
|
3272
3066
|
setIssueUpdate: issueUpdateAdapter.setOne,
|
|
@@ -3295,11 +3089,11 @@ var __publicField = (obj, key, value) => {
|
|
|
3295
3089
|
);
|
|
3296
3090
|
const issueUpdateReducer = issueUpdateSlice.reducer;
|
|
3297
3091
|
const issueAttachmentAdapter = createModelAdapter((attachment) => attachment.offline_id);
|
|
3298
|
-
const initialState$
|
|
3092
|
+
const initialState$2 = issueAttachmentAdapter.getInitialState({});
|
|
3299
3093
|
const issueAttachmentSlice = toolkit.createSlice({
|
|
3300
3094
|
name: "issueAttachments",
|
|
3301
|
-
initialState: initialState$
|
|
3302
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
3095
|
+
initialState: initialState$2,
|
|
3096
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$2)),
|
|
3303
3097
|
reducers: {
|
|
3304
3098
|
initializeIssueAttachments: issueAttachmentAdapter.initialize,
|
|
3305
3099
|
addIssueAttachment: issueAttachmentAdapter.addOne,
|
|
@@ -3357,15 +3151,59 @@ var __publicField = (obj, key, value) => {
|
|
|
3357
3151
|
)
|
|
3358
3152
|
);
|
|
3359
3153
|
const issueAttachmentReducer = issueAttachmentSlice.reducer;
|
|
3360
|
-
const initialState = {
|
|
3154
|
+
const initialState$1 = {
|
|
3361
3155
|
version: 0
|
|
3362
3156
|
};
|
|
3363
3157
|
const versioningSlice = toolkit.createSlice({
|
|
3364
3158
|
name: "versioning",
|
|
3365
|
-
initialState,
|
|
3159
|
+
initialState: initialState$1,
|
|
3366
3160
|
reducers: {}
|
|
3367
3161
|
});
|
|
3368
3162
|
const versioningReducer = versioningSlice.reducer;
|
|
3163
|
+
const geoImageAdapter = createModelAdapter((model) => model.offline_id);
|
|
3164
|
+
const initialState = geoImageAdapter.getInitialState({});
|
|
3165
|
+
const geoImageSlice = toolkit.createSlice({
|
|
3166
|
+
name: "geoImages",
|
|
3167
|
+
initialState,
|
|
3168
|
+
extraReducers: (builder) => {
|
|
3169
|
+
builder.addCase("RESET", (state) => {
|
|
3170
|
+
Object.assign(state, initialState);
|
|
3171
|
+
});
|
|
3172
|
+
},
|
|
3173
|
+
reducers: {
|
|
3174
|
+
initializeGeoImages: geoImageAdapter.initialize,
|
|
3175
|
+
setGeoImage: geoImageAdapter.setOne,
|
|
3176
|
+
setGeoImages: geoImageAdapter.setMany,
|
|
3177
|
+
addGeoImage: geoImageAdapter.addOne,
|
|
3178
|
+
addGeoImages: geoImageAdapter.addMany,
|
|
3179
|
+
updateGeoImage: geoImageAdapter.updateOne,
|
|
3180
|
+
updateGeoImages: geoImageAdapter.updateMany,
|
|
3181
|
+
deleteGeoImage: geoImageAdapter.deleteOne,
|
|
3182
|
+
deleteGeoImages: geoImageAdapter.deleteMany
|
|
3183
|
+
}
|
|
3184
|
+
});
|
|
3185
|
+
const {
|
|
3186
|
+
initializeGeoImages,
|
|
3187
|
+
setGeoImage,
|
|
3188
|
+
setGeoImages,
|
|
3189
|
+
addGeoImage,
|
|
3190
|
+
addGeoImages,
|
|
3191
|
+
updateGeoImage,
|
|
3192
|
+
updateGeoImages,
|
|
3193
|
+
deleteGeoImage,
|
|
3194
|
+
deleteGeoImages
|
|
3195
|
+
} = geoImageSlice.actions;
|
|
3196
|
+
const selectGeoImageMapping = (state) => state.geoImageReducer.instances;
|
|
3197
|
+
const selectGeoImages = (state) => Object.values(state.geoImageReducer.instances);
|
|
3198
|
+
const selectGeoImageById = (id) => (state) => {
|
|
3199
|
+
return state.geoImageReducer.instances[id];
|
|
3200
|
+
};
|
|
3201
|
+
const selectGeoImagesOfProject = restructureCreateSelectorWithArgs(
|
|
3202
|
+
toolkit.createSelector([selectGeoImages, (_, projectId) => projectId], (mapImages, projectId) => {
|
|
3203
|
+
return mapImages.filter((mapImage) => mapImage.project === projectId);
|
|
3204
|
+
})
|
|
3205
|
+
);
|
|
3206
|
+
const geoImageReducer = geoImageSlice.reducer;
|
|
3369
3207
|
const fullAssetMarkerSize = 45;
|
|
3370
3208
|
const DEFAULT_ISSUE_STATUS = IssueStatus.BACKLOG;
|
|
3371
3209
|
const DEFAULT_ISSUE_PRIORITY = IssuePriority.MEDIUM;
|
|
@@ -3437,7 +3275,8 @@ var __publicField = (obj, key, value) => {
|
|
|
3437
3275
|
teamReducer,
|
|
3438
3276
|
agentsReducer,
|
|
3439
3277
|
issueCommentReducer,
|
|
3440
|
-
issueUpdateReducer
|
|
3278
|
+
issueUpdateReducer,
|
|
3279
|
+
geoImageReducer
|
|
3441
3280
|
};
|
|
3442
3281
|
const overmapReducer = toolkit.combineReducers(overmapReducers);
|
|
3443
3282
|
const resetStore = "RESET";
|
|
@@ -3993,8 +3832,6 @@ var __publicField = (obj, key, value) => {
|
|
|
3993
3832
|
console.debug(this.constructor.name, "clearing auth;");
|
|
3994
3833
|
this.dispatch(setLoggedIn(false));
|
|
3995
3834
|
this.clearTokens();
|
|
3996
|
-
this.dispatch(setActiveProjectId(null));
|
|
3997
|
-
this.dispatch(setActiveWorkspaceId(null));
|
|
3998
3835
|
this.dispatch({ type: constants.RESET_STATE });
|
|
3999
3836
|
this.dispatch({ type: resetStore });
|
|
4000
3837
|
}
|
|
@@ -4491,13 +4328,13 @@ var __publicField = (obj, key, value) => {
|
|
|
4491
4328
|
if (!stage) {
|
|
4492
4329
|
throw new Error(`No asset stage with id ${stageId} found in the store`);
|
|
4493
4330
|
}
|
|
4494
|
-
this.dispatch(updateStage({ ...stage,
|
|
4331
|
+
this.dispatch(updateStage({ ...stage, form: formId }));
|
|
4495
4332
|
try {
|
|
4496
4333
|
await this.enqueueRequest({
|
|
4497
4334
|
description: "Link asset stage to form",
|
|
4498
4335
|
method: HttpMethod.POST,
|
|
4499
4336
|
url: `/assets/stages/${stageId}/associate-with-form/`,
|
|
4500
|
-
payload: {
|
|
4337
|
+
payload: { form: formId },
|
|
4501
4338
|
blockers: [stageId, formId],
|
|
4502
4339
|
blocks: [stageId]
|
|
4503
4340
|
});
|
|
@@ -4512,7 +4349,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4512
4349
|
if (!stage) {
|
|
4513
4350
|
throw new Error(`No asset stage with id ${stageId} found in the store`);
|
|
4514
4351
|
}
|
|
4515
|
-
this.dispatch(updateStage({ ...stage,
|
|
4352
|
+
this.dispatch(updateStage({ ...stage, form: void 0 }));
|
|
4516
4353
|
try {
|
|
4517
4354
|
await this.enqueueRequest({
|
|
4518
4355
|
description: "Unlink asset stage from form",
|
|
@@ -4537,39 +4374,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4537
4374
|
this.dispatch(initializeStages(result));
|
|
4538
4375
|
}
|
|
4539
4376
|
}
|
|
4540
|
-
|
|
4541
|
-
[AttachmentModel.Issue]: {
|
|
4542
|
-
name: "issue",
|
|
4543
|
-
attachUrlPrefix: "/issues",
|
|
4544
|
-
deleteUrlPrefix: "/issues",
|
|
4545
|
-
fetchUrlPostfix: "/issue-attachments"
|
|
4546
|
-
},
|
|
4547
|
-
[AttachmentModel.Asset]: {
|
|
4548
|
-
name: "asset",
|
|
4549
|
-
attachUrlPrefix: "/assets",
|
|
4550
|
-
deleteUrlPrefix: "/assets",
|
|
4551
|
-
fetchUrlPostfix: "/asset-attachments"
|
|
4552
|
-
},
|
|
4553
|
-
[AttachmentModel.AssetType]: {
|
|
4554
|
-
name: "asset type",
|
|
4555
|
-
attachUrlPrefix: "/assets/types",
|
|
4556
|
-
deleteUrlPrefix: "/assets/types",
|
|
4557
|
-
fetchUrlPostfix: "/asset-type-attachments"
|
|
4558
|
-
},
|
|
4559
|
-
[AttachmentModel.Project]: {
|
|
4560
|
-
name: "project",
|
|
4561
|
-
attachUrlPrefix: "/projects",
|
|
4562
|
-
deleteUrlPrefix: "/projects",
|
|
4563
|
-
fetchUrlPostfix: "/attachments"
|
|
4564
|
-
},
|
|
4565
|
-
[AttachmentModel.Document]: {
|
|
4566
|
-
name: "document",
|
|
4567
|
-
attachUrlPrefix: "/documents",
|
|
4568
|
-
deleteUrlPrefix: "/documents",
|
|
4569
|
-
fetchUrlPostfix: "/document-attachments"
|
|
4570
|
-
}
|
|
4571
|
-
};
|
|
4572
|
-
class BaseAttachmentService extends BaseApiService {
|
|
4377
|
+
class BaseUploadService extends BaseApiService {
|
|
4573
4378
|
getNumberOfAttachmentsWithSha1(sha1) {
|
|
4574
4379
|
const {
|
|
4575
4380
|
issueAttachmentReducer: issueAttachmentReducer2,
|
|
@@ -4577,8 +4382,9 @@ var __publicField = (obj, key, value) => {
|
|
|
4577
4382
|
assetTypeAttachmentReducer: assetTypeAttachmentReducer2,
|
|
4578
4383
|
documentAttachmentReducer: documentAttachmentReducer2,
|
|
4579
4384
|
projectAttachmentReducer: projectAttachmentReducer2,
|
|
4385
|
+
formRevisionAttachmentReducer: formRevisionAttachmentReducer2,
|
|
4580
4386
|
formSubmissionAttachmentReducer: formSubmissionAttachmentReducer2,
|
|
4581
|
-
|
|
4387
|
+
geoImageReducer: geoImageReducer2
|
|
4582
4388
|
} = this.client.store.getState();
|
|
4583
4389
|
const objectsWithSha1 = [].concat(
|
|
4584
4390
|
Object.values(issueAttachmentReducer2.instances),
|
|
@@ -4587,7 +4393,8 @@ var __publicField = (obj, key, value) => {
|
|
|
4587
4393
|
Object.values(documentAttachmentReducer2.instances),
|
|
4588
4394
|
Object.values(projectAttachmentReducer2.instances),
|
|
4589
4395
|
Object.values(formRevisionAttachmentReducer2.instances),
|
|
4590
|
-
Object.values(formSubmissionAttachmentReducer2.instances)
|
|
4396
|
+
Object.values(formSubmissionAttachmentReducer2.instances),
|
|
4397
|
+
Object.values(geoImageReducer2.instances)
|
|
4591
4398
|
);
|
|
4592
4399
|
return objectsWithSha1.filter((object) => object.file_sha1 === sha1).length;
|
|
4593
4400
|
}
|
|
@@ -4607,6 +4414,40 @@ var __publicField = (obj, key, value) => {
|
|
|
4607
4414
|
});
|
|
4608
4415
|
}
|
|
4609
4416
|
}
|
|
4417
|
+
}
|
|
4418
|
+
const AttachmentModelMeta = {
|
|
4419
|
+
[AttachmentModel.Issue]: {
|
|
4420
|
+
name: "issue",
|
|
4421
|
+
attachUrlPrefix: "/issues",
|
|
4422
|
+
deleteUrlPrefix: "/issues",
|
|
4423
|
+
fetchUrlPostfix: "/issue-attachments"
|
|
4424
|
+
},
|
|
4425
|
+
[AttachmentModel.Asset]: {
|
|
4426
|
+
name: "asset",
|
|
4427
|
+
attachUrlPrefix: "/assets",
|
|
4428
|
+
deleteUrlPrefix: "/assets",
|
|
4429
|
+
fetchUrlPostfix: "/asset-attachments"
|
|
4430
|
+
},
|
|
4431
|
+
[AttachmentModel.AssetType]: {
|
|
4432
|
+
name: "asset type",
|
|
4433
|
+
attachUrlPrefix: "/assets/types",
|
|
4434
|
+
deleteUrlPrefix: "/assets/types",
|
|
4435
|
+
fetchUrlPostfix: "/asset-type-attachments"
|
|
4436
|
+
},
|
|
4437
|
+
[AttachmentModel.Project]: {
|
|
4438
|
+
name: "project",
|
|
4439
|
+
attachUrlPrefix: "/projects",
|
|
4440
|
+
deleteUrlPrefix: "/projects",
|
|
4441
|
+
fetchUrlPostfix: "/attachments"
|
|
4442
|
+
},
|
|
4443
|
+
[AttachmentModel.Document]: {
|
|
4444
|
+
name: "document",
|
|
4445
|
+
attachUrlPrefix: "/documents",
|
|
4446
|
+
deleteUrlPrefix: "/documents",
|
|
4447
|
+
fetchUrlPostfix: "/document-attachments"
|
|
4448
|
+
}
|
|
4449
|
+
};
|
|
4450
|
+
class BaseAttachmentService extends BaseUploadService {
|
|
4610
4451
|
async attachFiles(files, modelId, buildOfflineAttachment) {
|
|
4611
4452
|
const { store } = this.client;
|
|
4612
4453
|
const currentUser = store.getState().userReducer.currentUser;
|
|
@@ -4962,11 +4803,10 @@ var __publicField = (obj, key, value) => {
|
|
|
4962
4803
|
// Basic CRUD functions
|
|
4963
4804
|
// TODO: Once all models are represented in `Created<TModel>`, use `Created` in `OptimisticModelResult`, so we don't
|
|
4964
4805
|
// have to repeat it for all optimistic model results (all optimistic results are created).
|
|
4965
|
-
add(issue, issueType = null) {
|
|
4806
|
+
add(issue, workspaceId, issueType = null) {
|
|
4966
4807
|
const { store } = this.client;
|
|
4967
4808
|
const dateWithoutMilliseconds = /* @__PURE__ */ new Date();
|
|
4968
4809
|
const state = store.getState();
|
|
4969
|
-
const workspaceId = state.workspaceReducer.activeWorkspaceId;
|
|
4970
4810
|
const currentUserId = state.userReducer.currentUser.id;
|
|
4971
4811
|
dateWithoutMilliseconds.setMilliseconds(0);
|
|
4972
4812
|
if (!workspaceId) {
|
|
@@ -5477,10 +5317,6 @@ var __publicField = (obj, key, value) => {
|
|
|
5477
5317
|
if (!project) {
|
|
5478
5318
|
throw new Error("Expected project to exist");
|
|
5479
5319
|
}
|
|
5480
|
-
const activeProjectId = state.projectReducer.activeProjectId;
|
|
5481
|
-
if (activeProjectId === projectId) {
|
|
5482
|
-
this.dispatch({ type: "project/setActiveProjectId", payload: null });
|
|
5483
|
-
}
|
|
5484
5320
|
const filesToDelete = selectProjectFiles(state).filter((file) => file.project === projectId);
|
|
5485
5321
|
this.dispatch(removeProjectFilesOfProject(project.id));
|
|
5486
5322
|
const attachmentsOfProject = selectAttachmentsOfProject(project.id)(state);
|
|
@@ -5507,7 +5343,6 @@ var __publicField = (obj, key, value) => {
|
|
|
5507
5343
|
this.dispatch(setProjectAccesses(Object.values(projectAccesses)));
|
|
5508
5344
|
this.dispatch(addOrReplaceProjectFiles(filesToDelete));
|
|
5509
5345
|
this.dispatch(setProjectAttachments(attachmentsOfProject));
|
|
5510
|
-
this.dispatch(setActiveProjectId(activeProjectId));
|
|
5511
5346
|
this.dispatch({ type: "rehydrated/setRehydrated", payload: true });
|
|
5512
5347
|
if (license) {
|
|
5513
5348
|
this.dispatch(updateLicense({ ...license, project: project.id }));
|
|
@@ -5578,7 +5413,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5578
5413
|
}
|
|
5579
5414
|
return { fields: newFields, images };
|
|
5580
5415
|
};
|
|
5581
|
-
class
|
|
5416
|
+
class FormService extends BaseApiService {
|
|
5582
5417
|
constructor() {
|
|
5583
5418
|
super(...arguments);
|
|
5584
5419
|
// Attach images to revision, after uploading them to S3
|
|
@@ -5897,7 +5732,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5897
5732
|
}
|
|
5898
5733
|
return { values: newValues, files };
|
|
5899
5734
|
};
|
|
5900
|
-
class
|
|
5735
|
+
class FormSubmissionService extends BaseUploadService {
|
|
5901
5736
|
constructor() {
|
|
5902
5737
|
super(...arguments);
|
|
5903
5738
|
// Attach files to submission, after uploading them to S3
|
|
@@ -5978,7 +5813,6 @@ var __publicField = (obj, key, value) => {
|
|
|
5978
5813
|
// TODO: adapt the support bulk adding to any model type
|
|
5979
5814
|
async bulkAdd(args, batchSize) {
|
|
5980
5815
|
const { formRevision, commonFieldValues, fieldValuesByAsset } = args;
|
|
5981
|
-
const allFilesRecord = {};
|
|
5982
5816
|
const { values: fileSeperatedCommonFieldValues, files: commonFiles } = separateFilesFromValues(commonFieldValues);
|
|
5983
5817
|
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
5984
5818
|
const transactionId = uuid.v4();
|
|
@@ -6020,7 +5854,6 @@ var __publicField = (obj, key, value) => {
|
|
|
6020
5854
|
file_type: file.type,
|
|
6021
5855
|
size: file.size
|
|
6022
5856
|
};
|
|
6023
|
-
allFilesRecord[sha1] = filePayload;
|
|
6024
5857
|
filePaylods.push(filePayload);
|
|
6025
5858
|
}
|
|
6026
5859
|
return {
|
|
@@ -6056,22 +5889,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6056
5889
|
blocks: blocks2
|
|
6057
5890
|
});
|
|
6058
5891
|
void promise.then(({ presigned_urls }) => {
|
|
6059
|
-
|
|
6060
|
-
const file = allFilesRecord[sha1];
|
|
6061
|
-
if (!file)
|
|
6062
|
-
continue;
|
|
6063
|
-
void this.enqueueRequest({
|
|
6064
|
-
url: presignedUrl.url,
|
|
6065
|
-
description: "Upload file",
|
|
6066
|
-
method: HttpMethod.POST,
|
|
6067
|
-
isExternalUrl: true,
|
|
6068
|
-
isAuthNeeded: false,
|
|
6069
|
-
attachmentHash: sha1,
|
|
6070
|
-
blockers: [`s3-${file.sha1}.${file.extension}`],
|
|
6071
|
-
blocks: [sha1],
|
|
6072
|
-
s3url: presignedUrl
|
|
6073
|
-
});
|
|
6074
|
-
}
|
|
5892
|
+
this.processPresignedUrls(presigned_urls);
|
|
6075
5893
|
});
|
|
6076
5894
|
prevBatchId = batchId;
|
|
6077
5895
|
batchPromises.push(promise);
|
|
@@ -6542,7 +6360,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6542
6360
|
});
|
|
6543
6361
|
}
|
|
6544
6362
|
async update(organization) {
|
|
6545
|
-
|
|
6363
|
+
return this.enqueueRequest({
|
|
6546
6364
|
description: "Edit organization",
|
|
6547
6365
|
method: HttpMethod.PATCH,
|
|
6548
6366
|
url: `/organizations/${organization.id}/`,
|
|
@@ -6550,10 +6368,6 @@ var __publicField = (obj, key, value) => {
|
|
|
6550
6368
|
blockers: [`add-org-${organization.name}`, organization.id.toString()],
|
|
6551
6369
|
blocks: [organization.id.toString()]
|
|
6552
6370
|
});
|
|
6553
|
-
return promise.then((result) => {
|
|
6554
|
-
this.dispatch(updateActiveOrganization(organization));
|
|
6555
|
-
return result;
|
|
6556
|
-
});
|
|
6557
6371
|
}
|
|
6558
6372
|
async invite(organizationId, email) {
|
|
6559
6373
|
return this.enqueueRequest({
|
|
@@ -7131,6 +6945,179 @@ var __publicField = (obj, key, value) => {
|
|
|
7131
6945
|
this.dispatch(setUsers(Object.values(usersRecord)));
|
|
7132
6946
|
}
|
|
7133
6947
|
}
|
|
6948
|
+
class GeoImageService extends BaseUploadService {
|
|
6949
|
+
async add(payload) {
|
|
6950
|
+
const { store } = this.client;
|
|
6951
|
+
const { file, ...payloadWithoutFile } = payload;
|
|
6952
|
+
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
6953
|
+
const currentUser = store.getState().userReducer.currentUser;
|
|
6954
|
+
const projectId = payloadWithoutFile.project;
|
|
6955
|
+
const sha1 = await hashFile(file);
|
|
6956
|
+
const filePayload = {
|
|
6957
|
+
sha1,
|
|
6958
|
+
file_type: file.type,
|
|
6959
|
+
extension: file.name.split(".").pop(),
|
|
6960
|
+
size: file.size
|
|
6961
|
+
};
|
|
6962
|
+
const offlineMapImage = offline({
|
|
6963
|
+
...payloadWithoutFile,
|
|
6964
|
+
file_name: file.name,
|
|
6965
|
+
file_sha1: sha1,
|
|
6966
|
+
file: URL.createObjectURL(file),
|
|
6967
|
+
submitted_at: submittedAt,
|
|
6968
|
+
created_by: currentUser.id
|
|
6969
|
+
});
|
|
6970
|
+
store.dispatch(addGeoImage(offlineMapImage));
|
|
6971
|
+
const promise = this.enqueueRequest({
|
|
6972
|
+
description: "Add geo image",
|
|
6973
|
+
method: HttpMethod.POST,
|
|
6974
|
+
url: "/geo-images/",
|
|
6975
|
+
payload: {
|
|
6976
|
+
offline_id: offlineMapImage.offline_id,
|
|
6977
|
+
submitted_at: submittedAt,
|
|
6978
|
+
title: offlineMapImage.title,
|
|
6979
|
+
description: offlineMapImage.description,
|
|
6980
|
+
geo_marker: offlineMapImage.geo_marker,
|
|
6981
|
+
canvas_marker: offlineMapImage.canvas_marker,
|
|
6982
|
+
sha1: offlineMapImage.file_sha1,
|
|
6983
|
+
project: offlineMapImage.project,
|
|
6984
|
+
file_name: offlineMapImage.file_name,
|
|
6985
|
+
direction: offlineMapImage.direction,
|
|
6986
|
+
original_date: offlineMapImage.original_date,
|
|
6987
|
+
file: filePayload
|
|
6988
|
+
},
|
|
6989
|
+
blocks: [projectId.toString()],
|
|
6990
|
+
blockers: [projectId.toString()]
|
|
6991
|
+
});
|
|
6992
|
+
promise.then((result) => {
|
|
6993
|
+
this.processPresignedUrls(result.presigned_urls);
|
|
6994
|
+
store.dispatch(setGeoImage(result.geo_image));
|
|
6995
|
+
}).catch(() => {
|
|
6996
|
+
store.dispatch(deleteGeoImage(offlineMapImage.offline_id));
|
|
6997
|
+
});
|
|
6998
|
+
return [offlineMapImage, promise.then((result) => result.geo_image)];
|
|
6999
|
+
}
|
|
7000
|
+
async bulkAdd(payloads, projectId) {
|
|
7001
|
+
const { store } = this.client;
|
|
7002
|
+
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7003
|
+
const currentUser = store.getState().userReducer.currentUser;
|
|
7004
|
+
const offlineGeoImages = [];
|
|
7005
|
+
const offlineIds = [];
|
|
7006
|
+
const geoImagePayloads = [];
|
|
7007
|
+
const filePayloadRecord = {};
|
|
7008
|
+
for (const payloadAndFile of payloads) {
|
|
7009
|
+
const { file, ...payload } = payloadAndFile;
|
|
7010
|
+
const sha1 = await hashFile(file);
|
|
7011
|
+
if (!(sha1 in filePayloadRecord)) {
|
|
7012
|
+
filePayloadRecord[sha1] = {
|
|
7013
|
+
sha1,
|
|
7014
|
+
file_type: file.type,
|
|
7015
|
+
extension: file.name.split(".").pop(),
|
|
7016
|
+
size: file.size
|
|
7017
|
+
};
|
|
7018
|
+
await this.client.files.addCache(file, sha1);
|
|
7019
|
+
}
|
|
7020
|
+
const offlineMapImage = offline({
|
|
7021
|
+
...payload,
|
|
7022
|
+
file_name: file.name,
|
|
7023
|
+
file_sha1: sha1,
|
|
7024
|
+
file: URL.createObjectURL(file),
|
|
7025
|
+
submitted_at: submittedAt,
|
|
7026
|
+
created_by: currentUser.id,
|
|
7027
|
+
project: projectId
|
|
7028
|
+
});
|
|
7029
|
+
offlineGeoImages.push(offlineMapImage);
|
|
7030
|
+
offlineIds.push(offlineMapImage.offline_id);
|
|
7031
|
+
geoImagePayloads.push({
|
|
7032
|
+
offline_id: offlineMapImage.offline_id,
|
|
7033
|
+
sha1: offlineMapImage.file_sha1,
|
|
7034
|
+
file_name: offlineMapImage.file_name,
|
|
7035
|
+
title: offlineMapImage.title,
|
|
7036
|
+
description: offlineMapImage.description,
|
|
7037
|
+
geo_marker: offlineMapImage.geo_marker,
|
|
7038
|
+
canvas_marker: offlineMapImage.canvas_marker,
|
|
7039
|
+
direction: offlineMapImage.direction,
|
|
7040
|
+
original_date: offlineMapImage.original_date
|
|
7041
|
+
});
|
|
7042
|
+
}
|
|
7043
|
+
store.dispatch(addGeoImages(offlineGeoImages));
|
|
7044
|
+
const promise = this.enqueueRequest({
|
|
7045
|
+
description: "Bulk add geo images",
|
|
7046
|
+
method: HttpMethod.POST,
|
|
7047
|
+
url: "/geo-images/bulk/",
|
|
7048
|
+
payload: {
|
|
7049
|
+
submitted_at: submittedAt,
|
|
7050
|
+
project: projectId,
|
|
7051
|
+
geo_images: geoImagePayloads,
|
|
7052
|
+
files: Object.values(filePayloadRecord)
|
|
7053
|
+
},
|
|
7054
|
+
blocks: [projectId.toString()],
|
|
7055
|
+
blockers: offlineIds
|
|
7056
|
+
});
|
|
7057
|
+
promise.then((result) => {
|
|
7058
|
+
this.processPresignedUrls(result.presigned_urls);
|
|
7059
|
+
store.dispatch(setGeoImages(result.geo_images));
|
|
7060
|
+
}).catch(() => {
|
|
7061
|
+
store.dispatch(deleteGeoImages(offlineIds));
|
|
7062
|
+
});
|
|
7063
|
+
return [offlineGeoImages, promise.then((result) => result.geo_images)];
|
|
7064
|
+
}
|
|
7065
|
+
update(payload) {
|
|
7066
|
+
const { store } = this.client;
|
|
7067
|
+
const state = store.getState();
|
|
7068
|
+
const geoImageToUpdate = selectGeoImageById(payload.offline_id)(state);
|
|
7069
|
+
if (!geoImageToUpdate) {
|
|
7070
|
+
throw new Error(`Map image with offline_id ${payload.offline_id} does not exist in the store`);
|
|
7071
|
+
}
|
|
7072
|
+
const updatedGeoImage = { ...geoImageToUpdate, ...payload };
|
|
7073
|
+
store.dispatch(updateGeoImage(updatedGeoImage));
|
|
7074
|
+
const promise = this.enqueueRequest({
|
|
7075
|
+
description: "Update geo image",
|
|
7076
|
+
method: HttpMethod.PATCH,
|
|
7077
|
+
url: `/geo-images/${payload.offline_id}/`,
|
|
7078
|
+
payload,
|
|
7079
|
+
blocks: [payload.offline_id],
|
|
7080
|
+
blockers: [payload.offline_id]
|
|
7081
|
+
});
|
|
7082
|
+
promise.then((result) => {
|
|
7083
|
+
store.dispatch(setGeoImage(result));
|
|
7084
|
+
}).catch(() => {
|
|
7085
|
+
store.dispatch(setGeoImage(geoImageToUpdate));
|
|
7086
|
+
});
|
|
7087
|
+
return [updatedGeoImage, promise];
|
|
7088
|
+
}
|
|
7089
|
+
async delete(geoImageId) {
|
|
7090
|
+
const { store } = this.client;
|
|
7091
|
+
const state = store.getState();
|
|
7092
|
+
const geoImageToDelete = selectGeoImageById(geoImageId)(state);
|
|
7093
|
+
if (!geoImageToDelete) {
|
|
7094
|
+
throw new Error(`Map image with offline_id ${geoImageId} does not exist in the store`);
|
|
7095
|
+
}
|
|
7096
|
+
store.dispatch(deleteGeoImage(geoImageId));
|
|
7097
|
+
const promise = this.enqueueRequest({
|
|
7098
|
+
description: "Delete geo image",
|
|
7099
|
+
method: HttpMethod.DELETE,
|
|
7100
|
+
url: `/geo-images/${geoImageId}/`,
|
|
7101
|
+
blocks: [geoImageId],
|
|
7102
|
+
blockers: [geoImageId]
|
|
7103
|
+
});
|
|
7104
|
+
promise.catch(() => {
|
|
7105
|
+
store.dispatch(setGeoImage(geoImageToDelete));
|
|
7106
|
+
});
|
|
7107
|
+
return promise;
|
|
7108
|
+
}
|
|
7109
|
+
async refreshStore(projectId) {
|
|
7110
|
+
const { store } = this.client;
|
|
7111
|
+
const result = await this.enqueueRequest({
|
|
7112
|
+
description: "Get geo images",
|
|
7113
|
+
method: HttpMethod.GET,
|
|
7114
|
+
url: `/projects/${projectId}/geo-images/`,
|
|
7115
|
+
blocks: [projectId.toString()],
|
|
7116
|
+
blockers: []
|
|
7117
|
+
});
|
|
7118
|
+
store.dispatch(initializeGeoImages(result));
|
|
7119
|
+
}
|
|
7120
|
+
}
|
|
7134
7121
|
exports2.APIError = APIError;
|
|
7135
7122
|
exports2.AgentService = AgentService;
|
|
7136
7123
|
exports2.AssetAttachmentService = AssetAttachmentService;
|
|
@@ -7153,7 +7140,10 @@ var __publicField = (obj, key, value) => {
|
|
|
7153
7140
|
exports2.EmailDomainsService = EmailDomainsService;
|
|
7154
7141
|
exports2.EmailVerificationService = EmailVerificationService;
|
|
7155
7142
|
exports2.FileService = FileService;
|
|
7143
|
+
exports2.FormService = FormService;
|
|
7144
|
+
exports2.FormSubmissionService = FormSubmissionService;
|
|
7156
7145
|
exports2.GREEN = GREEN;
|
|
7146
|
+
exports2.GeoImageService = GeoImageService;
|
|
7157
7147
|
exports2.HttpMethod = HttpMethod;
|
|
7158
7148
|
exports2.IssueAttachmentService = IssueAttachmentService;
|
|
7159
7149
|
exports2.IssueCommentService = IssueCommentService;
|
|
@@ -7179,8 +7169,6 @@ var __publicField = (obj, key, value) => {
|
|
|
7179
7169
|
exports2.ProjectFileService = ProjectFileService;
|
|
7180
7170
|
exports2.ProjectService = ProjectService;
|
|
7181
7171
|
exports2.TeamService = TeamService;
|
|
7182
|
-
exports2.UserFormService = UserFormService;
|
|
7183
|
-
exports2.UserFormSubmissionService = UserFormSubmissionService;
|
|
7184
7172
|
exports2.UserService = UserService;
|
|
7185
7173
|
exports2.VERSION_REDUCER_KEY = VERSION_REDUCER_KEY;
|
|
7186
7174
|
exports2.VerificationCodeType = VerificationCodeType;
|
|
@@ -7215,6 +7203,8 @@ var __publicField = (obj, key, value) => {
|
|
|
7215
7203
|
exports2.addFormSubmissionAttachments = addFormSubmissionAttachments;
|
|
7216
7204
|
exports2.addFormSubmissions = addFormSubmissions;
|
|
7217
7205
|
exports2.addForms = addForms;
|
|
7206
|
+
exports2.addGeoImage = addGeoImage;
|
|
7207
|
+
exports2.addGeoImages = addGeoImages;
|
|
7218
7208
|
exports2.addIssue = addIssue;
|
|
7219
7209
|
exports2.addIssueAttachment = addIssueAttachment;
|
|
7220
7210
|
exports2.addIssueAttachments = addIssueAttachments;
|
|
@@ -7290,6 +7280,8 @@ var __publicField = (obj, key, value) => {
|
|
|
7290
7280
|
exports2.deleteFormSubmissionAttachment = deleteFormSubmissionAttachment;
|
|
7291
7281
|
exports2.deleteFormSubmissionAttachments = deleteFormSubmissionAttachments;
|
|
7292
7282
|
exports2.deleteFormSubmissions = deleteFormSubmissions;
|
|
7283
|
+
exports2.deleteGeoImage = deleteGeoImage;
|
|
7284
|
+
exports2.deleteGeoImages = deleteGeoImages;
|
|
7293
7285
|
exports2.deleteIssue = deleteIssue;
|
|
7294
7286
|
exports2.deleteIssueAttachment = deleteIssueAttachment;
|
|
7295
7287
|
exports2.deleteIssueAttachments = deleteIssueAttachments;
|
|
@@ -7323,6 +7315,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7323
7315
|
exports2.fileReducer = fileReducer;
|
|
7324
7316
|
exports2.fileSlice = fileSlice;
|
|
7325
7317
|
exports2.fileToBlob = fileToBlob;
|
|
7318
|
+
exports2.flipBounds = flipBounds;
|
|
7326
7319
|
exports2.flipCoordinates = flipCoordinates;
|
|
7327
7320
|
exports2.formReducer = formReducer;
|
|
7328
7321
|
exports2.formRevisionAttachmentReducer = formRevisionAttachmentReducer;
|
|
@@ -7337,6 +7330,8 @@ var __publicField = (obj, key, value) => {
|
|
|
7337
7330
|
exports2.fullAssetMarkerSize = fullAssetMarkerSize;
|
|
7338
7331
|
exports2.generateBadgeColors = generateBadgeColors;
|
|
7339
7332
|
exports2.genericMemo = genericMemo;
|
|
7333
|
+
exports2.geoImageReducer = geoImageReducer;
|
|
7334
|
+
exports2.geoImageSlice = geoImageSlice;
|
|
7340
7335
|
exports2.getFileIdentifier = getFileIdentifier;
|
|
7341
7336
|
exports2.getFileS3Key = getFileS3Key;
|
|
7342
7337
|
exports2.getLocalDateString = getLocalDateString;
|
|
@@ -7345,8 +7340,6 @@ var __publicField = (obj, key, value) => {
|
|
|
7345
7340
|
exports2.getRenamedFile = getRenamedFile;
|
|
7346
7341
|
exports2.getStageColor = getStageColor;
|
|
7347
7342
|
exports2.hashFile = hashFile;
|
|
7348
|
-
exports2.hideAllCategories = hideAllCategories;
|
|
7349
|
-
exports2.hideCategory = hideCategory;
|
|
7350
7343
|
exports2.initSDK = initSDK;
|
|
7351
7344
|
exports2.initializeAssetAttachments = initializeAssetAttachments;
|
|
7352
7345
|
exports2.initializeAssetTypeAttachments = initializeAssetTypeAttachments;
|
|
@@ -7359,6 +7352,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7359
7352
|
exports2.initializeFormRevisionAttachments = initializeFormRevisionAttachments;
|
|
7360
7353
|
exports2.initializeFormRevisions = initializeFormRevisions;
|
|
7361
7354
|
exports2.initializeFormSubmissionAttachments = initializeFormSubmissionAttachments;
|
|
7355
|
+
exports2.initializeGeoImages = initializeGeoImages;
|
|
7362
7356
|
exports2.initializeIssueAttachments = initializeIssueAttachments;
|
|
7363
7357
|
exports2.initializeIssueTypes = initializeIssueTypes;
|
|
7364
7358
|
exports2.initializeIssueUpdates = initializeIssueUpdates;
|
|
@@ -7431,18 +7425,12 @@ var __publicField = (obj, key, value) => {
|
|
|
7431
7425
|
exports2.searchIssues = searchIssues;
|
|
7432
7426
|
exports2.selectAccessToken = selectAccessToken;
|
|
7433
7427
|
exports2.selectActiveLicense = selectActiveLicense;
|
|
7434
|
-
exports2.selectActiveOrganization = selectActiveOrganization;
|
|
7435
7428
|
exports2.selectActiveOrganizationAccess = selectActiveOrganizationAccess;
|
|
7436
|
-
exports2.selectActiveOrganizationId = selectActiveOrganizationId;
|
|
7437
|
-
exports2.selectActiveOrganizationLicenses = selectActiveOrganizationLicenses;
|
|
7438
|
-
exports2.selectActiveOrganizationProjects = selectActiveOrganizationProjects;
|
|
7439
7429
|
exports2.selectActiveProject = selectActiveProject;
|
|
7440
7430
|
exports2.selectActiveProjectAccess = selectActiveProjectAccess;
|
|
7441
7431
|
exports2.selectActiveProjectFileId = selectActiveProjectFileId;
|
|
7442
7432
|
exports2.selectActiveProjectId = selectActiveProjectId;
|
|
7443
7433
|
exports2.selectActiveStatusLicenses = selectActiveStatusLicenses;
|
|
7444
|
-
exports2.selectActiveWorkspace = selectActiveWorkspace;
|
|
7445
|
-
exports2.selectActiveWorkspaceId = selectActiveWorkspaceId;
|
|
7446
7434
|
exports2.selectAllDocumentAttachments = selectAllDocumentAttachments;
|
|
7447
7435
|
exports2.selectAllProjectAttachments = selectAllProjectAttachments;
|
|
7448
7436
|
exports2.selectAncestorIdsOfDocument = selectAncestorIdsOfDocument;
|
|
@@ -7479,7 +7467,6 @@ var __publicField = (obj, key, value) => {
|
|
|
7479
7467
|
exports2.selectCategoriesOfWorkspace = selectCategoriesOfWorkspace;
|
|
7480
7468
|
exports2.selectCategoryById = selectCategoryById;
|
|
7481
7469
|
exports2.selectCategoryMapping = selectCategoryMapping;
|
|
7482
|
-
exports2.selectCategoryVisibility = selectCategoryVisibility;
|
|
7483
7470
|
exports2.selectCommentsOfIssue = selectCommentsOfIssue;
|
|
7484
7471
|
exports2.selectCompletedStageIdsForAsset = selectCompletedStageIdsForAsset;
|
|
7485
7472
|
exports2.selectCompletedStages = selectCompletedStages;
|
|
@@ -7496,8 +7483,6 @@ var __publicField = (obj, key, value) => {
|
|
|
7496
7483
|
exports2.selectEmailDomains = selectEmailDomains;
|
|
7497
7484
|
exports2.selectEmailDomainsAsMapping = selectEmailDomainsAsMapping;
|
|
7498
7485
|
exports2.selectEmailDomainsOfOrganization = selectEmailDomainsOfOrganization;
|
|
7499
|
-
exports2.selectEnabledProjectFileMapping = selectEnabledProjectFileMapping;
|
|
7500
|
-
exports2.selectEnabledProjectFiles = selectEnabledProjectFiles;
|
|
7501
7486
|
exports2.selectFavouriteProjects = selectFavouriteProjects;
|
|
7502
7487
|
exports2.selectFilteredForms = selectFilteredForms;
|
|
7503
7488
|
exports2.selectForm = selectForm;
|
|
@@ -7521,8 +7506,10 @@ var __publicField = (obj, key, value) => {
|
|
|
7521
7506
|
exports2.selectFormsCount = selectFormsCount;
|
|
7522
7507
|
exports2.selectFormsMapping = selectFormsMapping;
|
|
7523
7508
|
exports2.selectGeneralFormCount = selectGeneralFormCount;
|
|
7524
|
-
exports2.
|
|
7525
|
-
exports2.
|
|
7509
|
+
exports2.selectGeoImageById = selectGeoImageById;
|
|
7510
|
+
exports2.selectGeoImageMapping = selectGeoImageMapping;
|
|
7511
|
+
exports2.selectGeoImages = selectGeoImages;
|
|
7512
|
+
exports2.selectGeoImagesOfProject = selectGeoImagesOfProject;
|
|
7526
7513
|
exports2.selectIsFetchingInitialData = selectIsFetchingInitialData;
|
|
7527
7514
|
exports2.selectIsImportingProjectFile = selectIsImportingProjectFile;
|
|
7528
7515
|
exports2.selectIsLoggedIn = selectIsLoggedIn;
|
|
@@ -7539,7 +7526,6 @@ var __publicField = (obj, key, value) => {
|
|
|
7539
7526
|
exports2.selectIssueTypesOfOrganization = selectIssueTypesOfOrganization;
|
|
7540
7527
|
exports2.selectIssueUpdateMapping = selectIssueUpdateMapping;
|
|
7541
7528
|
exports2.selectIssueUpdatesOfIssue = selectIssueUpdatesOfIssue;
|
|
7542
|
-
exports2.selectIssues = selectIssues;
|
|
7543
7529
|
exports2.selectIssuesOfIssueType = selectIssuesOfIssueType;
|
|
7544
7530
|
exports2.selectIssuesOfIssueTypeCount = selectIssuesOfIssueTypeCount;
|
|
7545
7531
|
exports2.selectLatestFormRevisionByForm = selectLatestFormRevisionByForm;
|
|
@@ -7550,6 +7536,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7550
7536
|
exports2.selectLicenseForProject = selectLicenseForProject;
|
|
7551
7537
|
exports2.selectLicenses = selectLicenses;
|
|
7552
7538
|
exports2.selectLicensesForProjectsMapping = selectLicensesForProjectsMapping;
|
|
7539
|
+
exports2.selectLicensesOfOrganization = selectLicensesOfOrganization;
|
|
7553
7540
|
exports2.selectMainWorkspace = selectMainWorkspace;
|
|
7554
7541
|
exports2.selectNumberOfAssetTypesMatchingCaseInsensitiveName = selectNumberOfAssetTypesMatchingCaseInsensitiveName;
|
|
7555
7542
|
exports2.selectNumberOfAssetsOfAssetType = selectNumberOfAssetsOfAssetType;
|
|
@@ -7558,6 +7545,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7558
7545
|
exports2.selectOrganizationAccessForUser = selectOrganizationAccessForUser;
|
|
7559
7546
|
exports2.selectOrganizationAccessUserMapping = selectOrganizationAccessUserMapping;
|
|
7560
7547
|
exports2.selectOrganizationAccesses = selectOrganizationAccesses;
|
|
7548
|
+
exports2.selectOrganizationById = selectOrganizationById;
|
|
7561
7549
|
exports2.selectOrganizationUsersAsMapping = selectOrganizationUsersAsMapping;
|
|
7562
7550
|
exports2.selectOrganizationUsersIds = selectOrganizationUsersIds;
|
|
7563
7551
|
exports2.selectOrganizations = selectOrganizations;
|
|
@@ -7572,21 +7560,21 @@ var __publicField = (obj, key, value) => {
|
|
|
7572
7560
|
exports2.selectProjectAccesses = selectProjectAccesses;
|
|
7573
7561
|
exports2.selectProjectAttachment = selectProjectAttachment;
|
|
7574
7562
|
exports2.selectProjectAttachmentMapping = selectProjectAttachmentMapping;
|
|
7575
|
-
exports2.
|
|
7563
|
+
exports2.selectProjectFileById = selectProjectFileById;
|
|
7564
|
+
exports2.selectProjectFileMapping = selectProjectFileMapping;
|
|
7576
7565
|
exports2.selectProjectFiles = selectProjectFiles;
|
|
7577
7566
|
exports2.selectProjectUsersAsMapping = selectProjectUsersAsMapping;
|
|
7578
7567
|
exports2.selectProjectUsersIds = selectProjectUsersIds;
|
|
7579
7568
|
exports2.selectProjects = selectProjects;
|
|
7569
|
+
exports2.selectProjectsOfOrganization = selectProjectsOfOrganization;
|
|
7580
7570
|
exports2.selectProjectsWithAccess = selectProjectsWithAccess;
|
|
7581
7571
|
exports2.selectRecentIssueIds = selectRecentIssueIds;
|
|
7582
7572
|
exports2.selectRecentIssuesAsSearchResults = selectRecentIssuesAsSearchResults;
|
|
7583
7573
|
exports2.selectRehydrated = selectRehydrated;
|
|
7584
7574
|
exports2.selectRootDocuments = selectRootDocuments;
|
|
7585
7575
|
exports2.selectSortedFormSubmissionsOfForm = selectSortedFormSubmissionsOfForm;
|
|
7586
|
-
exports2.selectSortedOrganizationLicenses = selectSortedOrganizationLicenses;
|
|
7587
7576
|
exports2.selectSortedOrganizationUsers = selectSortedOrganizationUsers;
|
|
7588
7577
|
exports2.selectSortedProjectUsers = selectSortedProjectUsers;
|
|
7589
|
-
exports2.selectSortedProjects = selectSortedProjects;
|
|
7590
7578
|
exports2.selectStage = selectStage;
|
|
7591
7579
|
exports2.selectStageFormIdsFromStageIds = selectStageFormIdsFromStageIds;
|
|
7592
7580
|
exports2.selectStageMapping = selectStageMapping;
|
|
@@ -7603,15 +7591,11 @@ var __publicField = (obj, key, value) => {
|
|
|
7603
7591
|
exports2.selectUser = selectUser;
|
|
7604
7592
|
exports2.selectUserFormRevisionAttachmentsMapping = selectUserFormRevisionAttachmentsMapping;
|
|
7605
7593
|
exports2.selectUsersAsMapping = selectUsersAsMapping;
|
|
7606
|
-
exports2.
|
|
7607
|
-
exports2.selectVisibleUserIds = selectVisibleUserIds;
|
|
7608
|
-
exports2.selectWorkspace = selectWorkspace;
|
|
7594
|
+
exports2.selectWorkspaceById = selectWorkspaceById;
|
|
7609
7595
|
exports2.selectWorkspaceMapping = selectWorkspaceMapping;
|
|
7610
7596
|
exports2.selectWorkspaces = selectWorkspaces;
|
|
7611
|
-
exports2.setActiveOrganizationId = setActiveOrganizationId;
|
|
7612
7597
|
exports2.setActiveProjectFileId = setActiveProjectFileId;
|
|
7613
7598
|
exports2.setActiveProjectId = setActiveProjectId;
|
|
7614
|
-
exports2.setActiveWorkspaceId = setActiveWorkspaceId;
|
|
7615
7599
|
exports2.setAsset = setAsset;
|
|
7616
7600
|
exports2.setAssetAttachment = setAssetAttachment;
|
|
7617
7601
|
exports2.setAssetAttachments = setAssetAttachments;
|
|
@@ -7632,6 +7616,8 @@ var __publicField = (obj, key, value) => {
|
|
|
7632
7616
|
exports2.setFormSubmissionAttachments = setFormSubmissionAttachments;
|
|
7633
7617
|
exports2.setFormSubmissions = setFormSubmissions;
|
|
7634
7618
|
exports2.setForms = setForms;
|
|
7619
|
+
exports2.setGeoImage = setGeoImage;
|
|
7620
|
+
exports2.setGeoImages = setGeoImages;
|
|
7635
7621
|
exports2.setIsFetchingInitialData = setIsFetchingInitialData;
|
|
7636
7622
|
exports2.setIsImportingProjectFile = setIsImportingProjectFile;
|
|
7637
7623
|
exports2.setIssueAttachment = setIssueAttachment;
|
|
@@ -7647,7 +7633,6 @@ var __publicField = (obj, key, value) => {
|
|
|
7647
7633
|
exports2.setProjectAccesses = setProjectAccesses;
|
|
7648
7634
|
exports2.setProjectAttachment = setProjectAttachment;
|
|
7649
7635
|
exports2.setProjectAttachments = setProjectAttachments;
|
|
7650
|
-
exports2.setProjectFileVisible = setProjectFileVisible;
|
|
7651
7636
|
exports2.setProjects = setProjects;
|
|
7652
7637
|
exports2.setRehydrated = setRehydrated;
|
|
7653
7638
|
exports2.setStage = setStage;
|
|
@@ -7658,8 +7643,6 @@ var __publicField = (obj, key, value) => {
|
|
|
7658
7643
|
exports2.setTourStep = setTourStep;
|
|
7659
7644
|
exports2.setUploadUrl = setUploadUrl;
|
|
7660
7645
|
exports2.setUsers = setUsers;
|
|
7661
|
-
exports2.setVisibleStatuses = setVisibleStatuses;
|
|
7662
|
-
exports2.setVisibleUserIds = setVisibleUserIds;
|
|
7663
7646
|
exports2.setWorkspaces = setWorkspaces;
|
|
7664
7647
|
exports2.settingReducer = settingReducer;
|
|
7665
7648
|
exports2.settingSlice = settingSlice;
|
|
@@ -7671,11 +7654,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7671
7654
|
exports2.teamSlice = teamSlice;
|
|
7672
7655
|
exports2.toFileNameSafeString = toFileNameSafeString;
|
|
7673
7656
|
exports2.toOfflineIdRecord = toOfflineIdRecord;
|
|
7674
|
-
exports2.toggleAssetTypeVisibility = toggleAssetTypeVisibility;
|
|
7675
7657
|
exports2.truncate = truncate;
|
|
7676
|
-
exports2.unhideAllCategories = unhideAllCategories;
|
|
7677
|
-
exports2.unhideCategory = unhideCategory;
|
|
7678
|
-
exports2.updateActiveOrganization = updateActiveOrganization;
|
|
7679
7658
|
exports2.updateAsset = updateAsset;
|
|
7680
7659
|
exports2.updateAssetAttachment = updateAssetAttachment;
|
|
7681
7660
|
exports2.updateAssetAttachments = updateAssetAttachments;
|
|
@@ -7694,6 +7673,8 @@ var __publicField = (obj, key, value) => {
|
|
|
7694
7673
|
exports2.updateFormSubmissionAttachment = updateFormSubmissionAttachment;
|
|
7695
7674
|
exports2.updateFormSubmissionAttachments = updateFormSubmissionAttachments;
|
|
7696
7675
|
exports2.updateFormSubmissions = updateFormSubmissions;
|
|
7676
|
+
exports2.updateGeoImage = updateGeoImage;
|
|
7677
|
+
exports2.updateGeoImages = updateGeoImages;
|
|
7697
7678
|
exports2.updateIssue = updateIssue;
|
|
7698
7679
|
exports2.updateIssueAttachment = updateIssueAttachment;
|
|
7699
7680
|
exports2.updateIssueAttachments = updateIssueAttachments;
|