@overmap-ai/core 1.0.65-procedures.1 → 1.0.65-procedures.3
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 +122 -366
- package/dist/overmap-core.js.map +1 -1
- package/dist/overmap-core.umd.cjs +122 -366
- package/dist/overmap-core.umd.cjs.map +1 -1
- package/dist/sdk/services/AssetStageService.d.ts +1 -1
- package/dist/sdk/services/index.d.ts +0 -1
- package/dist/store/slices/assetStageCompletionSlice.d.ts +0 -6
- package/dist/store/slices/assetStageSlice.d.ts +0 -1
- package/dist/store/slices/index.d.ts +0 -1
- package/dist/store/store.d.ts +3 -4
- package/dist/typings/models/assets.d.ts +2 -5
- package/dist/typings/models/store.d.ts +1 -2
- package/package.json +1 -1
- package/dist/sdk/services/AssetProcedureCompletionService.d.ts +0 -11
- package/dist/store/slices/assetProcedureCompletionSlice.d.ts +0 -54
package/dist/overmap-core.js
CHANGED
|
@@ -826,15 +826,15 @@ class BaseService {
|
|
|
826
826
|
this.client.store.dispatch(action);
|
|
827
827
|
}
|
|
828
828
|
}
|
|
829
|
-
const initialState$
|
|
829
|
+
const initialState$D = {
|
|
830
830
|
accessToken: "",
|
|
831
831
|
refreshToken: "",
|
|
832
832
|
isLoggedIn: false
|
|
833
833
|
};
|
|
834
834
|
const authSlice = createSlice({
|
|
835
835
|
name: "auth",
|
|
836
|
-
initialState: initialState$
|
|
837
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
836
|
+
initialState: initialState$D,
|
|
837
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$D)),
|
|
838
838
|
reducers: {
|
|
839
839
|
setTokens: (state, action) => {
|
|
840
840
|
state.accessToken = action.payload.accessToken;
|
|
@@ -922,11 +922,11 @@ function createModelAdapter(computeModelId) {
|
|
|
922
922
|
};
|
|
923
923
|
}
|
|
924
924
|
const categoryAdapter = createModelAdapter((category) => category.offline_id);
|
|
925
|
-
const initialState$
|
|
925
|
+
const initialState$C = categoryAdapter.getInitialState({});
|
|
926
926
|
const categorySlice = createSlice({
|
|
927
927
|
name: "categories",
|
|
928
|
-
initialState: initialState$
|
|
929
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
928
|
+
initialState: initialState$C,
|
|
929
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$C)),
|
|
930
930
|
reducers: {
|
|
931
931
|
initializeCategories: categoryAdapter.initialize,
|
|
932
932
|
addCategory: categoryAdapter.addOne,
|
|
@@ -970,11 +970,11 @@ const selectIssueCountOfCategory = (categoryId) => (state) => {
|
|
|
970
970
|
};
|
|
971
971
|
const categoryReducer = categorySlice.reducer;
|
|
972
972
|
const assetAdapter = createModelAdapter((asset) => asset.offline_id);
|
|
973
|
-
const initialState$
|
|
973
|
+
const initialState$B = assetAdapter.getInitialState({});
|
|
974
974
|
const assetSlice = createSlice({
|
|
975
975
|
name: "assets",
|
|
976
|
-
initialState: initialState$
|
|
977
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
976
|
+
initialState: initialState$B,
|
|
977
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$B)),
|
|
978
978
|
reducers: {
|
|
979
979
|
initializeAssets: assetAdapter.initialize,
|
|
980
980
|
addAsset: assetAdapter.addOne,
|
|
@@ -1026,11 +1026,11 @@ const selectNumberOfAssetsOfAssetType = (assetTypeId) => (state) => {
|
|
|
1026
1026
|
};
|
|
1027
1027
|
const assetReducer = assetSlice.reducer;
|
|
1028
1028
|
const assetAttachmentAdapter = createModelAdapter((attachment) => attachment.offline_id);
|
|
1029
|
-
const initialState$
|
|
1029
|
+
const initialState$A = assetAttachmentAdapter.getInitialState({});
|
|
1030
1030
|
const assetAttachmentSlice = createSlice({
|
|
1031
1031
|
name: "assetAttachments",
|
|
1032
|
-
initialState: initialState$
|
|
1033
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1032
|
+
initialState: initialState$A,
|
|
1033
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$A)),
|
|
1034
1034
|
reducers: {
|
|
1035
1035
|
initializeAssetAttachments: assetAttachmentAdapter.initialize,
|
|
1036
1036
|
addAssetAttachment: assetAttachmentAdapter.addOne,
|
|
@@ -1091,11 +1091,11 @@ const assetAttachmentReducer = assetAttachmentSlice.reducer;
|
|
|
1091
1091
|
const assetStageCompletionAdapter = createModelAdapter(
|
|
1092
1092
|
(stageCompletion) => stageCompletion.offline_id
|
|
1093
1093
|
);
|
|
1094
|
-
const initialState$
|
|
1094
|
+
const initialState$z = assetStageCompletionAdapter.getInitialState({});
|
|
1095
1095
|
const assetStageCompletionSlice = createSlice({
|
|
1096
1096
|
name: "assetStageCompletions",
|
|
1097
|
-
initialState: initialState$
|
|
1098
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1097
|
+
initialState: initialState$z,
|
|
1098
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$z)),
|
|
1099
1099
|
reducers: {
|
|
1100
1100
|
initializeAssetStageCompletions: assetStageCompletionAdapter.initialize,
|
|
1101
1101
|
addAssetStageCompletion: assetStageCompletionAdapter.addOne,
|
|
@@ -1119,24 +1119,6 @@ const assetStageCompletionReducer = assetStageCompletionSlice.reducer;
|
|
|
1119
1119
|
const selectAssetStageCompletionMapping = (state) => {
|
|
1120
1120
|
return state.assetStageCompletionReducer.instances;
|
|
1121
1121
|
};
|
|
1122
|
-
const selectCompletedStagesByAssetProcedureCompletion = createSelector(
|
|
1123
|
-
[selectAssetStageCompletionMapping],
|
|
1124
|
-
(completedStagesMapping) => {
|
|
1125
|
-
const completedStagesByAsset = {};
|
|
1126
|
-
for (const stageCompletion of Object.values(completedStagesMapping)) {
|
|
1127
|
-
const { asset_procedure_completion, stage, submitted_at } = stageCompletion;
|
|
1128
|
-
if (!completedStagesByAsset[asset_procedure_completion])
|
|
1129
|
-
completedStagesByAsset[asset_procedure_completion] = {};
|
|
1130
|
-
completedStagesByAsset[asset_procedure_completion][stage] = submitted_at;
|
|
1131
|
-
}
|
|
1132
|
-
return completedStagesByAsset;
|
|
1133
|
-
}
|
|
1134
|
-
);
|
|
1135
|
-
const selectCompletedStageIdsOfAssetProcedureCompletion = restructureCreateSelectorWithArgs(
|
|
1136
|
-
createSelector([selectAssetStageCompletionMapping, (_state, id) => id], (completedStages, id) => {
|
|
1137
|
-
return Object.keys(completedStages[id] ?? {});
|
|
1138
|
-
})
|
|
1139
|
-
);
|
|
1140
1122
|
const selectAssetStageCompletionById = (id) => (state) => {
|
|
1141
1123
|
return state.assetStageCompletionReducer.instances[id];
|
|
1142
1124
|
};
|
|
@@ -1151,11 +1133,11 @@ const selectAssetStageCompletionsByIds = restructureCreateSelectorWithArgs(
|
|
|
1151
1133
|
})
|
|
1152
1134
|
);
|
|
1153
1135
|
const assetStageAdapter = createModelAdapter((assetStage) => assetStage.offline_id);
|
|
1154
|
-
const initialState$
|
|
1136
|
+
const initialState$y = assetStageAdapter.getInitialState({});
|
|
1155
1137
|
const assetStageSlice = createSlice({
|
|
1156
1138
|
name: "assetStages",
|
|
1157
|
-
initialState: initialState$
|
|
1158
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1139
|
+
initialState: initialState$y,
|
|
1140
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$y)),
|
|
1159
1141
|
reducers: {
|
|
1160
1142
|
initializeAssetStages: assetStageAdapter.initialize,
|
|
1161
1143
|
setAssetStage: assetStageAdapter.setOne,
|
|
@@ -1217,27 +1199,12 @@ const selectAssetStagesByIds = restructureCreateSelectorWithArgs(
|
|
|
1217
1199
|
return fallbackToEmptyArray(assetStages);
|
|
1218
1200
|
})
|
|
1219
1201
|
);
|
|
1220
|
-
const selectStageFormIdsFromStageIds = restructureCreateSelectorWithArgs(
|
|
1221
|
-
createSelector([selectStageMapping, (_state, stageIds) => stageIds], (stageMapping, stageIds) => {
|
|
1222
|
-
const ret = {};
|
|
1223
|
-
for (const stageId of stageIds) {
|
|
1224
|
-
const stage = stageMapping[stageId];
|
|
1225
|
-
if (!stage) {
|
|
1226
|
-
throw new Error("No stage exists with the id " + stageId);
|
|
1227
|
-
}
|
|
1228
|
-
if (stage.form) {
|
|
1229
|
-
ret[stageId] = stage.form;
|
|
1230
|
-
}
|
|
1231
|
-
}
|
|
1232
|
-
return ret;
|
|
1233
|
-
})
|
|
1234
|
-
);
|
|
1235
1202
|
const assetTypeAdapter = createModelAdapter((assetType) => assetType.offline_id);
|
|
1236
|
-
const initialState$
|
|
1203
|
+
const initialState$x = assetTypeAdapter.getInitialState({});
|
|
1237
1204
|
const assetTypeSlice = createSlice({
|
|
1238
1205
|
name: "assetTypes",
|
|
1239
|
-
initialState: initialState$
|
|
1240
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1206
|
+
initialState: initialState$x,
|
|
1207
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$x)),
|
|
1241
1208
|
reducers: {
|
|
1242
1209
|
initializeAssetTypes: assetTypeAdapter.initialize,
|
|
1243
1210
|
setAssetType: assetTypeAdapter.setOne,
|
|
@@ -1290,11 +1257,11 @@ const assetTypeReducer = assetTypeSlice.reducer;
|
|
|
1290
1257
|
const assetTypeAttachmentAdapter = createModelAdapter(
|
|
1291
1258
|
(attachment) => attachment.offline_id
|
|
1292
1259
|
);
|
|
1293
|
-
const initialState$
|
|
1260
|
+
const initialState$w = assetTypeAttachmentAdapter.getInitialState({});
|
|
1294
1261
|
const assetTypeAttachmentSlice = createSlice({
|
|
1295
1262
|
name: "assetTypeAttachments",
|
|
1296
|
-
initialState: initialState$
|
|
1297
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1263
|
+
initialState: initialState$w,
|
|
1264
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$w)),
|
|
1298
1265
|
reducers: {
|
|
1299
1266
|
initializeAssetTypeAttachments: assetTypeAttachmentAdapter.initialize,
|
|
1300
1267
|
addAssetTypeAttachment: assetTypeAttachmentAdapter.addOne,
|
|
@@ -1353,10 +1320,10 @@ const selectAttachmentsOfAssetTypeByType = restructureCreateSelectorWithArgs(
|
|
|
1353
1320
|
);
|
|
1354
1321
|
const assetTypeAttachmentReducer = assetTypeAttachmentSlice.reducer;
|
|
1355
1322
|
const workspaceAdapter = createModelAdapter((workspace) => workspace.offline_id);
|
|
1356
|
-
const initialState$
|
|
1323
|
+
const initialState$v = workspaceAdapter.getInitialState({});
|
|
1357
1324
|
const workspaceSlice = createSlice({
|
|
1358
1325
|
name: "workspace",
|
|
1359
|
-
initialState: initialState$
|
|
1326
|
+
initialState: initialState$v,
|
|
1360
1327
|
reducers: {
|
|
1361
1328
|
initializeWorkspaces: workspaceAdapter.initialize,
|
|
1362
1329
|
setWorkspaces: workspaceAdapter.setMany,
|
|
@@ -1388,14 +1355,14 @@ const selectPermittedWorkspaceIds = createSelector(
|
|
|
1388
1355
|
const workspaceReducer = workspaceSlice.reducer;
|
|
1389
1356
|
const maxRecentIssues = 10;
|
|
1390
1357
|
const issueAdapter = createModelAdapter((issue) => issue.offline_id);
|
|
1391
|
-
const initialState$
|
|
1358
|
+
const initialState$u = issueAdapter.getInitialState({
|
|
1392
1359
|
recentIssueIds: []
|
|
1393
1360
|
});
|
|
1394
1361
|
const issueSlice = createSlice({
|
|
1395
1362
|
name: "issues",
|
|
1396
|
-
initialState: initialState$
|
|
1363
|
+
initialState: initialState$u,
|
|
1397
1364
|
extraReducers: (builder) => builder.addCase("RESET", (state) => {
|
|
1398
|
-
Object.assign(state, initialState$
|
|
1365
|
+
Object.assign(state, initialState$u);
|
|
1399
1366
|
}),
|
|
1400
1367
|
reducers: {
|
|
1401
1368
|
initializeIssues: issueAdapter.initialize,
|
|
@@ -1551,12 +1518,12 @@ const selectRecentIssuesAsSearchResults = createSelector(
|
|
|
1551
1518
|
);
|
|
1552
1519
|
const issueReducer = issueSlice.reducer;
|
|
1553
1520
|
const issueTypeAdapter = createModelAdapter((issueType) => issueType.offline_id);
|
|
1554
|
-
const initialState$
|
|
1521
|
+
const initialState$t = issueTypeAdapter.getInitialState({});
|
|
1555
1522
|
const issueTypeSlice = createSlice({
|
|
1556
1523
|
name: "issueTypes",
|
|
1557
|
-
initialState: initialState$
|
|
1524
|
+
initialState: initialState$t,
|
|
1558
1525
|
extraReducers: (builder) => builder.addCase("RESET", (state) => {
|
|
1559
|
-
Object.assign(state, initialState$
|
|
1526
|
+
Object.assign(state, initialState$t);
|
|
1560
1527
|
}),
|
|
1561
1528
|
reducers: {
|
|
1562
1529
|
initializeIssueTypes: issueTypeAdapter.initialize,
|
|
@@ -1613,15 +1580,15 @@ const selectIssuesOfIssueTypeCount = (issueTypeId) => (state) => {
|
|
|
1613
1580
|
return selectIssuesOfIssueType(issueTypeId)(state).length;
|
|
1614
1581
|
};
|
|
1615
1582
|
const issueTypeReducer = issueTypeSlice.reducer;
|
|
1616
|
-
const initialState$
|
|
1583
|
+
const initialState$s = {
|
|
1617
1584
|
s3Urls: {}
|
|
1618
1585
|
};
|
|
1619
1586
|
const msPerHour = 1e3 * 60 * 60;
|
|
1620
1587
|
const msPerWeek = msPerHour * 24 * 7;
|
|
1621
1588
|
const fileSlice = createSlice({
|
|
1622
1589
|
name: "file",
|
|
1623
|
-
initialState: initialState$
|
|
1624
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1590
|
+
initialState: initialState$s,
|
|
1591
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$s)),
|
|
1625
1592
|
reducers: {
|
|
1626
1593
|
setUploadUrl: (state, action) => {
|
|
1627
1594
|
const { url, fields, sha1 } = action.payload;
|
|
@@ -1648,14 +1615,14 @@ const selectUploadUrl = (sha1) => (state) => {
|
|
|
1648
1615
|
return url;
|
|
1649
1616
|
};
|
|
1650
1617
|
const fileReducer = fileSlice.reducer;
|
|
1651
|
-
const initialState$
|
|
1618
|
+
const initialState$r = {
|
|
1652
1619
|
users: {},
|
|
1653
1620
|
currentUser: null
|
|
1654
1621
|
};
|
|
1655
1622
|
const userSlice = createSlice({
|
|
1656
1623
|
name: "users",
|
|
1657
|
-
initialState: initialState$
|
|
1658
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1624
|
+
initialState: initialState$r,
|
|
1625
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$r)),
|
|
1659
1626
|
reducers: {
|
|
1660
1627
|
setUsers: (state, action) => {
|
|
1661
1628
|
const usersMapping = {};
|
|
@@ -1713,11 +1680,11 @@ const selectUsersByIds = restructureCreateSelectorWithArgs(
|
|
|
1713
1680
|
const organizationAccessAdapter = createModelAdapter(
|
|
1714
1681
|
(organizationAccess) => organizationAccess.offline_id
|
|
1715
1682
|
);
|
|
1716
|
-
const initialState$
|
|
1683
|
+
const initialState$q = organizationAccessAdapter.getInitialState({});
|
|
1717
1684
|
const organizationAccessSlice = createSlice({
|
|
1718
1685
|
name: "organizationAccess",
|
|
1719
|
-
initialState: initialState$
|
|
1720
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1686
|
+
initialState: initialState$q,
|
|
1687
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$q)),
|
|
1721
1688
|
reducers: {
|
|
1722
1689
|
initializeOrganizationAccesses: organizationAccessAdapter.initialize,
|
|
1723
1690
|
updateOrganizationAccess: organizationAccessAdapter.updateOne,
|
|
@@ -1754,11 +1721,11 @@ const selectOrganizationAccessUserMapping = (state) => {
|
|
|
1754
1721
|
};
|
|
1755
1722
|
const organizationAccessReducer = organizationAccessSlice.reducer;
|
|
1756
1723
|
const licenseAdapter = createModelAdapter((license) => license.offline_id);
|
|
1757
|
-
const initialState$
|
|
1724
|
+
const initialState$p = licenseAdapter.getInitialState({});
|
|
1758
1725
|
const licenseSlice = createSlice({
|
|
1759
1726
|
name: "license",
|
|
1760
|
-
initialState: initialState$
|
|
1761
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1727
|
+
initialState: initialState$p,
|
|
1728
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$p)),
|
|
1762
1729
|
reducers: {
|
|
1763
1730
|
initializeLicences: licenseAdapter.initialize,
|
|
1764
1731
|
addLicenses: licenseAdapter.addMany,
|
|
@@ -1783,11 +1750,11 @@ const selectLicensesForProjectsMapping = createSelector(
|
|
|
1783
1750
|
);
|
|
1784
1751
|
const licenseReducer = licenseSlice.reducer;
|
|
1785
1752
|
const projectAccessAdapter = createModelAdapter((projectAccess) => projectAccess.offline_id);
|
|
1786
|
-
const initialState$
|
|
1753
|
+
const initialState$o = projectAccessAdapter.getInitialState({});
|
|
1787
1754
|
const projectAccessSlice = createSlice({
|
|
1788
1755
|
name: "projectAccess",
|
|
1789
|
-
initialState: initialState$
|
|
1790
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1756
|
+
initialState: initialState$o,
|
|
1757
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$o)),
|
|
1791
1758
|
reducers: {
|
|
1792
1759
|
initializeProjectAccesses: projectAccessAdapter.initialize,
|
|
1793
1760
|
updateProjectAccess: projectAccessAdapter.updateOne,
|
|
@@ -1828,14 +1795,14 @@ const selectProjectAccessUserMapping = (state) => {
|
|
|
1828
1795
|
return projectAccesses;
|
|
1829
1796
|
};
|
|
1830
1797
|
const projectAccessReducer = projectAccessSlice.reducer;
|
|
1831
|
-
const initialState$
|
|
1798
|
+
const initialState$n = {
|
|
1832
1799
|
projects: {},
|
|
1833
1800
|
activeProjectId: null
|
|
1834
1801
|
};
|
|
1835
1802
|
const projectSlice = createSlice({
|
|
1836
1803
|
name: "projects",
|
|
1837
|
-
initialState: initialState$
|
|
1838
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1804
|
+
initialState: initialState$n,
|
|
1805
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$n)),
|
|
1839
1806
|
reducers: {
|
|
1840
1807
|
setProjects: (state, action) => {
|
|
1841
1808
|
const projectsMap = {};
|
|
@@ -1942,13 +1909,13 @@ const selectSortedProjectUsers = createSelector(
|
|
|
1942
1909
|
});
|
|
1943
1910
|
}
|
|
1944
1911
|
);
|
|
1945
|
-
const initialState$
|
|
1912
|
+
const initialState$m = {
|
|
1946
1913
|
organizations: {}
|
|
1947
1914
|
};
|
|
1948
1915
|
const organizationSlice = createSlice({
|
|
1949
1916
|
name: "organizations",
|
|
1950
|
-
initialState: initialState$
|
|
1951
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1917
|
+
initialState: initialState$m,
|
|
1918
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$m)),
|
|
1952
1919
|
reducers: {
|
|
1953
1920
|
setOrganizations: (state, action) => {
|
|
1954
1921
|
for (const org of action.payload) {
|
|
@@ -2039,14 +2006,14 @@ const createOfflineAction = (request2, baseUrl, serviceName) => {
|
|
|
2039
2006
|
}
|
|
2040
2007
|
};
|
|
2041
2008
|
};
|
|
2042
|
-
const initialState$
|
|
2009
|
+
const initialState$l = {
|
|
2043
2010
|
deletedRequests: [],
|
|
2044
2011
|
latestRetryTime: 0
|
|
2045
2012
|
};
|
|
2046
2013
|
const outboxSlice = createSlice({
|
|
2047
2014
|
name: "outbox",
|
|
2048
|
-
initialState: initialState$
|
|
2049
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2015
|
+
initialState: initialState$l,
|
|
2016
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$l)),
|
|
2050
2017
|
reducers: {
|
|
2051
2018
|
// enqueueActions is a reducer that does nothing but enqueue API request to the Redux Offline outbox
|
|
2052
2019
|
// Whenever an issue is being created, a reducer addIssue() is responsible for adding it to the offline store
|
|
@@ -2078,15 +2045,15 @@ const selectDeletedRequests = (state) => state.outboxReducer.deletedRequests;
|
|
|
2078
2045
|
const selectLatestRetryTime = (state) => state.outboxReducer.latestRetryTime;
|
|
2079
2046
|
const { enqueueRequest, markForDeletion, markAsDeleted, _setLatestRetryTime } = outboxSlice.actions;
|
|
2080
2047
|
const outboxReducer = outboxSlice.reducer;
|
|
2081
|
-
const initialState$
|
|
2048
|
+
const initialState$k = {
|
|
2082
2049
|
projectFiles: {},
|
|
2083
2050
|
activeProjectFileId: null,
|
|
2084
2051
|
isImportingProjectFile: false
|
|
2085
2052
|
};
|
|
2086
2053
|
const projectFileSlice = createSlice({
|
|
2087
2054
|
name: "projectFiles",
|
|
2088
|
-
initialState: initialState$
|
|
2089
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2055
|
+
initialState: initialState$k,
|
|
2056
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$k)),
|
|
2090
2057
|
reducers: {
|
|
2091
2058
|
addOrReplaceProjectFiles: (state, action) => {
|
|
2092
2059
|
for (let fileObj of action.payload) {
|
|
@@ -2173,11 +2140,11 @@ const selectProjectFileById = (id) => (state) => {
|
|
|
2173
2140
|
};
|
|
2174
2141
|
const projectFileReducer = projectFileSlice.reducer;
|
|
2175
2142
|
const projectAttachmentAdapter = createModelAdapter((attachment) => attachment.offline_id);
|
|
2176
|
-
const initialState$
|
|
2143
|
+
const initialState$j = projectAttachmentAdapter.getInitialState({});
|
|
2177
2144
|
const projectAttachmentSlice = createSlice({
|
|
2178
2145
|
name: "projectAttachments",
|
|
2179
|
-
initialState: initialState$
|
|
2180
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2146
|
+
initialState: initialState$j,
|
|
2147
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$j)),
|
|
2181
2148
|
reducers: {
|
|
2182
2149
|
initializeProjectAttachments: projectAttachmentAdapter.initialize,
|
|
2183
2150
|
addProjectAttachment: projectAttachmentAdapter.addOne,
|
|
@@ -2232,12 +2199,12 @@ const selectAttachmentsOfProjectByType = restructureCreateSelectorWithArgs(
|
|
|
2232
2199
|
)
|
|
2233
2200
|
);
|
|
2234
2201
|
const projectAttachmentReducer = projectAttachmentSlice.reducer;
|
|
2235
|
-
const initialState$
|
|
2202
|
+
const initialState$i = {
|
|
2236
2203
|
isRehydrated: false
|
|
2237
2204
|
};
|
|
2238
2205
|
const rehydratedSlice = createSlice({
|
|
2239
2206
|
name: "rehydrated",
|
|
2240
|
-
initialState: initialState$
|
|
2207
|
+
initialState: initialState$i,
|
|
2241
2208
|
// The `reducers` field lets us define reducers and generate associated actions
|
|
2242
2209
|
reducers: {
|
|
2243
2210
|
setRehydrated: (state, action) => {
|
|
@@ -2262,11 +2229,11 @@ const formRevisionSortFn = (formRevisionA, formRevisionB) => {
|
|
|
2262
2229
|
}
|
|
2263
2230
|
};
|
|
2264
2231
|
const formRevisionAdapter = createModelAdapter((revision) => revision.offline_id);
|
|
2265
|
-
const initialState$
|
|
2232
|
+
const initialState$h = formRevisionAdapter.getInitialState({});
|
|
2266
2233
|
const formRevisionsSlice = createSlice({
|
|
2267
2234
|
name: "formRevisions",
|
|
2268
|
-
initialState: initialState$
|
|
2269
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2235
|
+
initialState: initialState$h,
|
|
2236
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$h)),
|
|
2270
2237
|
reducers: {
|
|
2271
2238
|
initializeFormRevisions: formRevisionAdapter.initialize,
|
|
2272
2239
|
setFormRevision: formRevisionAdapter.setOne,
|
|
@@ -2338,11 +2305,11 @@ const selectLatestFormRevisionByForm = createSelector([selectFormRevisionMapping
|
|
|
2338
2305
|
});
|
|
2339
2306
|
const formRevisionReducer = formRevisionsSlice.reducer;
|
|
2340
2307
|
const formAdapter = createModelAdapter((form) => form.offline_id);
|
|
2341
|
-
const initialState$
|
|
2308
|
+
const initialState$g = formAdapter.getInitialState({});
|
|
2342
2309
|
const formSlice = createSlice({
|
|
2343
2310
|
name: "forms",
|
|
2344
|
-
initialState: initialState$
|
|
2345
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2311
|
+
initialState: initialState$g,
|
|
2312
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$g)),
|
|
2346
2313
|
reducers: {
|
|
2347
2314
|
initializeForms: formAdapter.initialize,
|
|
2348
2315
|
setForm: formAdapter.setOne,
|
|
@@ -2422,11 +2389,11 @@ const selectGeneralFormCount = createSelector([selectFormMapping], (formsMapping
|
|
|
2422
2389
|
return Object.values(formsMapping).filter((form) => !form.asset_type).length;
|
|
2423
2390
|
});
|
|
2424
2391
|
const submissionAdapter = createModelAdapter((submission) => submission.offline_id);
|
|
2425
|
-
const initialState$
|
|
2392
|
+
const initialState$f = submissionAdapter.getInitialState({});
|
|
2426
2393
|
const formSubmissionSlice = createSlice({
|
|
2427
2394
|
name: "formSubmissions",
|
|
2428
|
-
initialState: initialState$
|
|
2429
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2395
|
+
initialState: initialState$f,
|
|
2396
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$f)),
|
|
2430
2397
|
reducers: {
|
|
2431
2398
|
initializeFormSubmissions: submissionAdapter.initialize,
|
|
2432
2399
|
setFormSubmission: submissionAdapter.setOne,
|
|
@@ -2638,11 +2605,11 @@ const formSubmissionReducer = formSubmissionSlice.reducer;
|
|
|
2638
2605
|
const formSubmissionAttachmentAdapter = createModelAdapter(
|
|
2639
2606
|
(attachment) => attachment.offline_id
|
|
2640
2607
|
);
|
|
2641
|
-
const initialState$
|
|
2608
|
+
const initialState$e = formSubmissionAttachmentAdapter.getInitialState({});
|
|
2642
2609
|
const formSubmissionAttachmentSlice = createSlice({
|
|
2643
2610
|
name: "formSubmissionAttachments",
|
|
2644
|
-
initialState: initialState$
|
|
2645
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2611
|
+
initialState: initialState$e,
|
|
2612
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$e)),
|
|
2646
2613
|
reducers: {
|
|
2647
2614
|
initializeFormSubmissionAttachments: formSubmissionAttachmentAdapter.initialize,
|
|
2648
2615
|
addFormSubmissionAttachment: formSubmissionAttachmentAdapter.addOne,
|
|
@@ -2694,11 +2661,11 @@ const formSubmissionAttachmentReducer = formSubmissionAttachmentSlice.reducer;
|
|
|
2694
2661
|
const formRevisionAttachmentAdapter = createModelAdapter(
|
|
2695
2662
|
(attachment) => attachment.offline_id
|
|
2696
2663
|
);
|
|
2697
|
-
const initialState$
|
|
2664
|
+
const initialState$d = formRevisionAttachmentAdapter.getInitialState({});
|
|
2698
2665
|
const formRevisionAttachmentSlice = createSlice({
|
|
2699
2666
|
name: "formRevisionAttachments",
|
|
2700
|
-
initialState: initialState$
|
|
2701
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2667
|
+
initialState: initialState$d,
|
|
2668
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$d)),
|
|
2702
2669
|
reducers: {
|
|
2703
2670
|
initializeFormRevisionAttachments: formRevisionAttachmentAdapter.initialize,
|
|
2704
2671
|
addFormRevisionAttachment: formRevisionAttachmentAdapter.addOne,
|
|
@@ -2737,10 +2704,10 @@ const selectAttachmentsOfFormRevision = restructureCreateSelectorWithArgs(
|
|
|
2737
2704
|
);
|
|
2738
2705
|
const formRevisionAttachmentReducer = formRevisionAttachmentSlice.reducer;
|
|
2739
2706
|
const emailDomainAdapter = createModelAdapter((emailDomain) => emailDomain.offline_id);
|
|
2740
|
-
const initialState$
|
|
2707
|
+
const initialState$c = emailDomainAdapter.getInitialState({});
|
|
2741
2708
|
const emailDomainsSlice = createSlice({
|
|
2742
2709
|
name: "emailDomains",
|
|
2743
|
-
initialState: initialState$
|
|
2710
|
+
initialState: initialState$c,
|
|
2744
2711
|
reducers: {
|
|
2745
2712
|
initializeEmailDomains: emailDomainAdapter.initialize,
|
|
2746
2713
|
addEmailDomain: emailDomainAdapter.addOne,
|
|
@@ -2761,14 +2728,14 @@ const selectEmailDomainsOfOrganization = restructureCreateSelectorWithArgs(
|
|
|
2761
2728
|
)
|
|
2762
2729
|
);
|
|
2763
2730
|
const emailDomainsReducer = emailDomainsSlice.reducer;
|
|
2764
|
-
const initialState$
|
|
2731
|
+
const initialState$b = {
|
|
2765
2732
|
documents: {}
|
|
2766
2733
|
};
|
|
2767
2734
|
const documentSlice = createSlice({
|
|
2768
2735
|
name: "documents",
|
|
2769
|
-
initialState: initialState$
|
|
2736
|
+
initialState: initialState$b,
|
|
2770
2737
|
extraReducers: (builder) => builder.addCase("RESET", (state) => {
|
|
2771
|
-
Object.assign(state, initialState$
|
|
2738
|
+
Object.assign(state, initialState$b);
|
|
2772
2739
|
}),
|
|
2773
2740
|
reducers: {
|
|
2774
2741
|
setDocuments: (state, action) => {
|
|
@@ -2957,11 +2924,11 @@ const selectRootDocuments = createSelector(
|
|
|
2957
2924
|
);
|
|
2958
2925
|
const documentsReducer = documentSlice.reducer;
|
|
2959
2926
|
const documentAttachmentAdapter = createModelAdapter((attachment) => attachment.offline_id);
|
|
2960
|
-
const initialState$
|
|
2927
|
+
const initialState$a = documentAttachmentAdapter.getInitialState({});
|
|
2961
2928
|
const documentAttachmentSlice = createSlice({
|
|
2962
2929
|
name: "documentAttachments",
|
|
2963
|
-
initialState: initialState$
|
|
2964
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2930
|
+
initialState: initialState$a,
|
|
2931
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$a)),
|
|
2965
2932
|
reducers: {
|
|
2966
2933
|
initializeDocumentAttachments: documentAttachmentAdapter.initialize,
|
|
2967
2934
|
addDocumentAttachment: documentAttachmentAdapter.addOne,
|
|
@@ -3020,11 +2987,11 @@ const selectAttachmentsOfDocumentByType = restructureCreateSelectorWithArgs(
|
|
|
3020
2987
|
);
|
|
3021
2988
|
const documentAttachmentReducer = documentAttachmentSlice.reducer;
|
|
3022
2989
|
const teamAdapter = createModelAdapter((team) => team.offline_id);
|
|
3023
|
-
const initialState$
|
|
2990
|
+
const initialState$9 = teamAdapter.getInitialState({});
|
|
3024
2991
|
const teamSlice = createSlice({
|
|
3025
2992
|
name: "teams",
|
|
3026
|
-
initialState: initialState$
|
|
3027
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2993
|
+
initialState: initialState$9,
|
|
2994
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$9)),
|
|
3028
2995
|
reducers: {
|
|
3029
2996
|
setTeam: teamAdapter.setOne,
|
|
3030
2997
|
initializeTeams: teamAdapter.initialize,
|
|
@@ -3075,11 +3042,11 @@ const teamReducer = teamSlice.reducer;
|
|
|
3075
3042
|
const agentUserConversationAdapter = createModelAdapter(
|
|
3076
3043
|
(conversation) => conversation.offline_id
|
|
3077
3044
|
);
|
|
3078
|
-
const initialState$
|
|
3045
|
+
const initialState$8 = agentUserConversationAdapter.getInitialState({});
|
|
3079
3046
|
const agentsSlice = createSlice({
|
|
3080
3047
|
name: "agents",
|
|
3081
|
-
initialState: initialState$
|
|
3082
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
3048
|
+
initialState: initialState$8,
|
|
3049
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$8)),
|
|
3083
3050
|
reducers: {
|
|
3084
3051
|
initializeConversations: agentUserConversationAdapter.initialize,
|
|
3085
3052
|
addConversation: agentUserConversationAdapter.addOne,
|
|
@@ -3101,11 +3068,11 @@ const selectConversation = restructureCreateSelectorWithArgs(
|
|
|
3101
3068
|
);
|
|
3102
3069
|
const agentsReducer = agentsSlice.reducer;
|
|
3103
3070
|
const issueCommentAdapter = createModelAdapter((comment) => comment.offline_id);
|
|
3104
|
-
const initialState$
|
|
3071
|
+
const initialState$7 = issueCommentAdapter.getInitialState({});
|
|
3105
3072
|
const issueCommentSlice = createSlice({
|
|
3106
3073
|
name: "issueComments",
|
|
3107
|
-
initialState: initialState$
|
|
3108
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
3074
|
+
initialState: initialState$7,
|
|
3075
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$7)),
|
|
3109
3076
|
reducers: {
|
|
3110
3077
|
addIssueComment: issueCommentAdapter.addOne,
|
|
3111
3078
|
addIssueComments: issueCommentAdapter.addMany,
|
|
@@ -3134,11 +3101,11 @@ const selectCommentsOfIssue = restructureCreateSelectorWithArgs(
|
|
|
3134
3101
|
);
|
|
3135
3102
|
const issueCommentReducer = issueCommentSlice.reducer;
|
|
3136
3103
|
const issueUpdateAdapter = createModelAdapter((issueUpdate) => issueUpdate.offline_id);
|
|
3137
|
-
const initialState$
|
|
3104
|
+
const initialState$6 = issueUpdateAdapter.getInitialState({});
|
|
3138
3105
|
const issueUpdateSlice = createSlice({
|
|
3139
3106
|
name: "issueUpdates",
|
|
3140
|
-
initialState: initialState$
|
|
3141
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
3107
|
+
initialState: initialState$6,
|
|
3108
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$6)),
|
|
3142
3109
|
reducers: {
|
|
3143
3110
|
initializeIssueUpdates: issueUpdateAdapter.setMany,
|
|
3144
3111
|
setIssueUpdate: issueUpdateAdapter.setOne,
|
|
@@ -3167,11 +3134,11 @@ const selectIssueUpdatesOfIssue = restructureCreateSelectorWithArgs(
|
|
|
3167
3134
|
);
|
|
3168
3135
|
const issueUpdateReducer = issueUpdateSlice.reducer;
|
|
3169
3136
|
const issueAttachmentAdapter = createModelAdapter((attachment) => attachment.offline_id);
|
|
3170
|
-
const initialState$
|
|
3137
|
+
const initialState$5 = issueAttachmentAdapter.getInitialState({});
|
|
3171
3138
|
const issueAttachmentSlice = createSlice({
|
|
3172
3139
|
name: "issueAttachments",
|
|
3173
|
-
initialState: initialState$
|
|
3174
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
3140
|
+
initialState: initialState$5,
|
|
3141
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$5)),
|
|
3175
3142
|
reducers: {
|
|
3176
3143
|
initializeIssueAttachments: issueAttachmentAdapter.initialize,
|
|
3177
3144
|
addIssueAttachment: issueAttachmentAdapter.addOne,
|
|
@@ -3229,23 +3196,23 @@ const selectAttachmentsOfIssueByType = restructureCreateSelectorWithArgs(
|
|
|
3229
3196
|
)
|
|
3230
3197
|
);
|
|
3231
3198
|
const issueAttachmentReducer = issueAttachmentSlice.reducer;
|
|
3232
|
-
const initialState$
|
|
3199
|
+
const initialState$4 = {
|
|
3233
3200
|
version: 0
|
|
3234
3201
|
};
|
|
3235
3202
|
const versioningSlice = createSlice({
|
|
3236
3203
|
name: "versioning",
|
|
3237
|
-
initialState: initialState$
|
|
3204
|
+
initialState: initialState$4,
|
|
3238
3205
|
reducers: {}
|
|
3239
3206
|
});
|
|
3240
3207
|
const versioningReducer = versioningSlice.reducer;
|
|
3241
3208
|
const geoImageAdapter = createModelAdapter((model) => model.offline_id);
|
|
3242
|
-
const initialState$
|
|
3209
|
+
const initialState$3 = geoImageAdapter.getInitialState({});
|
|
3243
3210
|
const geoImageSlice = createSlice({
|
|
3244
3211
|
name: "geoImages",
|
|
3245
|
-
initialState: initialState$
|
|
3212
|
+
initialState: initialState$3,
|
|
3246
3213
|
extraReducers: (builder) => {
|
|
3247
3214
|
builder.addCase("RESET", (state) => {
|
|
3248
|
-
Object.assign(state, initialState$
|
|
3215
|
+
Object.assign(state, initialState$3);
|
|
3249
3216
|
});
|
|
3250
3217
|
},
|
|
3251
3218
|
reducers: {
|
|
@@ -3283,11 +3250,11 @@ const selectGeoImagesOfProject = restructureCreateSelectorWithArgs(
|
|
|
3283
3250
|
);
|
|
3284
3251
|
const geoImageReducer = geoImageSlice.reducer;
|
|
3285
3252
|
const issueAssociationAdapter = createModelAdapter((assoc) => assoc.offline_id);
|
|
3286
|
-
const initialState$
|
|
3253
|
+
const initialState$2 = issueAssociationAdapter.getInitialState({});
|
|
3287
3254
|
const issueAssociationSlice = createSlice({
|
|
3288
3255
|
name: "issueAssociations",
|
|
3289
|
-
initialState: initialState$
|
|
3290
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
3256
|
+
initialState: initialState$2,
|
|
3257
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$2)),
|
|
3291
3258
|
reducers: {
|
|
3292
3259
|
initializeIssueAssociations: issueAssociationAdapter.initialize,
|
|
3293
3260
|
addIssueAssociation: issueAssociationAdapter.addOne,
|
|
@@ -3346,11 +3313,11 @@ const selectIssueAssociationsOfAsset = restructureCreateSelectorWithArgs(
|
|
|
3346
3313
|
);
|
|
3347
3314
|
const issueAssociationReducer = issueAssociationSlice.reducer;
|
|
3348
3315
|
const assetProcedureAdapter = createModelAdapter((assetProcedure) => assetProcedure.offline_id);
|
|
3349
|
-
const initialState$
|
|
3316
|
+
const initialState$1 = assetProcedureAdapter.getInitialState({});
|
|
3350
3317
|
const assetProcedureSlice = createSlice({
|
|
3351
3318
|
name: "assetProcedures",
|
|
3352
|
-
initialState: initialState$
|
|
3353
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
3319
|
+
initialState: initialState$1,
|
|
3320
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$1)),
|
|
3354
3321
|
reducers: {
|
|
3355
3322
|
initializeAssetProcedures: assetProcedureAdapter.initialize,
|
|
3356
3323
|
addAssetProcedure: assetProcedureAdapter.addOne,
|
|
@@ -3409,11 +3376,11 @@ const assetProcedureReducer = assetProcedureSlice.reducer;
|
|
|
3409
3376
|
const assetProcedureInstanceAdapter = createModelAdapter(
|
|
3410
3377
|
(assetProcedureInstance) => assetProcedureInstance.offline_id
|
|
3411
3378
|
);
|
|
3412
|
-
const initialState
|
|
3379
|
+
const initialState = assetProcedureInstanceAdapter.getInitialState({});
|
|
3413
3380
|
const assetProcedureInstanceSlice = createSlice({
|
|
3414
3381
|
name: "assetProcedureInstances",
|
|
3415
|
-
initialState
|
|
3416
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState
|
|
3382
|
+
initialState,
|
|
3383
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState)),
|
|
3417
3384
|
reducers: {
|
|
3418
3385
|
initializeAssetProcedureInstances: assetProcedureInstanceAdapter.initialize,
|
|
3419
3386
|
addAssetProcedureInstance: assetProcedureInstanceAdapter.addOne,
|
|
@@ -3486,83 +3453,6 @@ const selectAssetProcedureInstancesByIds = restructureCreateSelectorWithArgs(
|
|
|
3486
3453
|
)
|
|
3487
3454
|
);
|
|
3488
3455
|
const assetProcedureInstanceReducer = assetProcedureInstanceSlice.reducer;
|
|
3489
|
-
const assetProcedureCompletionAdapter = createModelAdapter(
|
|
3490
|
-
(assetProcedureCompletion) => assetProcedureCompletion.offline_id
|
|
3491
|
-
);
|
|
3492
|
-
const initialState = assetProcedureCompletionAdapter.getInitialState({});
|
|
3493
|
-
const assetProcedureCompletionSlice = createSlice({
|
|
3494
|
-
name: "assetProcedureCompletions",
|
|
3495
|
-
initialState,
|
|
3496
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState)),
|
|
3497
|
-
reducers: {
|
|
3498
|
-
initializeAssetProcedureCompletions: assetProcedureCompletionAdapter.initialize,
|
|
3499
|
-
addAssetProcedureCompletion: assetProcedureCompletionAdapter.addOne,
|
|
3500
|
-
addAssetProcedureCompletions: assetProcedureCompletionAdapter.addMany,
|
|
3501
|
-
setAssetProcedureCompletion: assetProcedureCompletionAdapter.setOne,
|
|
3502
|
-
setAssetProcedureCompletions: assetProcedureCompletionAdapter.setMany,
|
|
3503
|
-
updateAssetProcedureCompletion: assetProcedureCompletionAdapter.updateOne,
|
|
3504
|
-
updateAssetProcedureCompletions: assetProcedureCompletionAdapter.updateMany,
|
|
3505
|
-
deleteAssetProcedureCompletion: assetProcedureCompletionAdapter.deleteOne,
|
|
3506
|
-
deleteAssetProcedureCompletions: assetProcedureCompletionAdapter.deleteMany
|
|
3507
|
-
}
|
|
3508
|
-
});
|
|
3509
|
-
const {
|
|
3510
|
-
initializeAssetProcedureCompletions,
|
|
3511
|
-
addAssetProcedureCompletion,
|
|
3512
|
-
addAssetProcedureCompletions,
|
|
3513
|
-
updateAssetProcedureCompletion,
|
|
3514
|
-
updateAssetProcedureCompletions,
|
|
3515
|
-
deleteAssetProcedureCompletion,
|
|
3516
|
-
deleteAssetProcedureCompletions,
|
|
3517
|
-
setAssetProcedureCompletion,
|
|
3518
|
-
setAssetProcedureCompletions
|
|
3519
|
-
} = assetProcedureCompletionSlice.actions;
|
|
3520
|
-
const assetProcedureCompletionReducer = assetProcedureCompletionSlice.reducer;
|
|
3521
|
-
const selectAssetProcedureCompletionsMapping = (state) => state.assetProcedureCompletionReducer.instances;
|
|
3522
|
-
const selectAssetProcedureCompletions = createSelector(
|
|
3523
|
-
[selectAssetProcedureCompletionsMapping],
|
|
3524
|
-
(assetProcedureCompletionsMapping) => {
|
|
3525
|
-
return Object.values(assetProcedureCompletionsMapping);
|
|
3526
|
-
}
|
|
3527
|
-
);
|
|
3528
|
-
const selectAssetProcedureCompletionsOfAsset = restructureCreateSelectorWithArgs(
|
|
3529
|
-
createSelector(
|
|
3530
|
-
[selectAssetProcedureCompletions, (_state, id) => id],
|
|
3531
|
-
(assetProcedureCompletions, id) => {
|
|
3532
|
-
return fallbackToEmptyArray(
|
|
3533
|
-
assetProcedureCompletions.filter(
|
|
3534
|
-
(assetProcedureCompletion) => assetProcedureCompletion.asset === id
|
|
3535
|
-
)
|
|
3536
|
-
);
|
|
3537
|
-
}
|
|
3538
|
-
)
|
|
3539
|
-
);
|
|
3540
|
-
const selectAssetProcedureCompletionsOfAssetProcedureInstance = restructureCreateSelectorWithArgs(
|
|
3541
|
-
createSelector([selectAssetProcedureCompletions, (_state, id) => id], (assetProcedureCompletions, id) => {
|
|
3542
|
-
return fallbackToEmptyArray(
|
|
3543
|
-
assetProcedureCompletions.filter(
|
|
3544
|
-
(assetProcedureCompletion) => assetProcedureCompletion.asset_procedure_instance === id
|
|
3545
|
-
)
|
|
3546
|
-
);
|
|
3547
|
-
})
|
|
3548
|
-
);
|
|
3549
|
-
const selectAssetProcedureCompletionById = (assetProcedureCompletionId) => (state) => {
|
|
3550
|
-
return state.assetProcedureCompletionReducer.instances[assetProcedureCompletionId];
|
|
3551
|
-
};
|
|
3552
|
-
const selectAssetProcedureCompletionsByIds = restructureCreateSelectorWithArgs(
|
|
3553
|
-
createSelector(
|
|
3554
|
-
[selectAssetProcedureCompletionsMapping, (_, ids) => ids],
|
|
3555
|
-
(assetProcedureCompletionsMapping, ids) => {
|
|
3556
|
-
const assetProcedureCompletions = [];
|
|
3557
|
-
for (const assetProcedureCompletionId of ids) {
|
|
3558
|
-
const assetProcedureCompletion = assetProcedureCompletionsMapping[assetProcedureCompletionId];
|
|
3559
|
-
if (assetProcedureCompletion)
|
|
3560
|
-
assetProcedureCompletions.push(assetProcedureCompletion);
|
|
3561
|
-
}
|
|
3562
|
-
return fallbackToEmptyArray(assetProcedureCompletions);
|
|
3563
|
-
}
|
|
3564
|
-
)
|
|
3565
|
-
);
|
|
3566
3456
|
const VERSION_REDUCER_KEY = "versioning";
|
|
3567
3457
|
const overmapReducers = {
|
|
3568
3458
|
// TODO: attachmentReducer,
|
|
@@ -3603,7 +3493,9 @@ const overmapReducers = {
|
|
|
3603
3493
|
issueCommentReducer,
|
|
3604
3494
|
issueUpdateReducer,
|
|
3605
3495
|
geoImageReducer,
|
|
3606
|
-
issueAssociationReducer
|
|
3496
|
+
issueAssociationReducer,
|
|
3497
|
+
assetProcedureReducer,
|
|
3498
|
+
assetProcedureInstanceReducer
|
|
3607
3499
|
};
|
|
3608
3500
|
const overmapReducer = combineReducers(overmapReducers);
|
|
3609
3501
|
const resetStore = "RESET";
|
|
@@ -4529,10 +4421,10 @@ class AssetStageCompletionService extends BaseApiService {
|
|
|
4529
4421
|
payload: {
|
|
4530
4422
|
offline_id: offlineStageCompletion.offline_id,
|
|
4531
4423
|
submitted_at: submittedAt,
|
|
4532
|
-
|
|
4424
|
+
asset_procedure_instance: payload.asset_procedure_instance,
|
|
4533
4425
|
stage: payload.stage
|
|
4534
4426
|
},
|
|
4535
|
-
blockers: [payload.
|
|
4427
|
+
blockers: [payload.asset_procedure_instance, payload.stage],
|
|
4536
4428
|
blocks: [offlineStageCompletion.offline_id]
|
|
4537
4429
|
});
|
|
4538
4430
|
promise.then((result) => {
|
|
@@ -4583,7 +4475,7 @@ class AssetStageCompletionService extends BaseApiService {
|
|
|
4583
4475
|
submitted_at: submittedAt,
|
|
4584
4476
|
completions: payload
|
|
4585
4477
|
},
|
|
4586
|
-
blockers: [...payloads.map((c) => c.
|
|
4478
|
+
blockers: [...payloads.map((c) => c.asset_procedure_instance), ...payloads.map((c) => c.stage)],
|
|
4587
4479
|
blocks: offlineIds
|
|
4588
4480
|
});
|
|
4589
4481
|
promise.then((result) => {
|
|
@@ -7837,121 +7729,6 @@ class IssueAssociationService extends BaseUploadService {
|
|
|
7837
7729
|
this.dispatch(initializeIssueAssociations(issueAssociations));
|
|
7838
7730
|
}
|
|
7839
7731
|
}
|
|
7840
|
-
class AssetProcedureCompletionService extends BaseApiService {
|
|
7841
|
-
add(payload) {
|
|
7842
|
-
const { store } = this.client;
|
|
7843
|
-
const createdBy = store.getState().userReducer.currentUser.id;
|
|
7844
|
-
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7845
|
-
const offlineProcedureCompletion = offline({
|
|
7846
|
-
...payload,
|
|
7847
|
-
created_by: createdBy,
|
|
7848
|
-
submitted_at: submittedAt
|
|
7849
|
-
});
|
|
7850
|
-
this.dispatch(addAssetProcedureCompletion(offlineProcedureCompletion));
|
|
7851
|
-
const promise = this.enqueueRequest({
|
|
7852
|
-
description: "Add asset procedure completion",
|
|
7853
|
-
method: HttpMethod.POST,
|
|
7854
|
-
url: "/asset-procedure-completions/",
|
|
7855
|
-
payload: {
|
|
7856
|
-
offline_id: offlineProcedureCompletion.offline_id,
|
|
7857
|
-
submitted_at: submittedAt,
|
|
7858
|
-
asset: payload.asset,
|
|
7859
|
-
asset_procedure_instance: payload.asset_procedure_instance
|
|
7860
|
-
},
|
|
7861
|
-
blockers: [payload.asset, payload.asset_procedure_instance],
|
|
7862
|
-
blocks: [offlineProcedureCompletion.offline_id]
|
|
7863
|
-
});
|
|
7864
|
-
promise.then((result) => {
|
|
7865
|
-
this.dispatch(updateAssetProcedureCompletion(result));
|
|
7866
|
-
}).catch(() => {
|
|
7867
|
-
this.dispatch(deleteAssetProcedureCompletion(offlineProcedureCompletion.offline_id));
|
|
7868
|
-
});
|
|
7869
|
-
return [offlineProcedureCompletion, promise];
|
|
7870
|
-
}
|
|
7871
|
-
bulkAdd(payloads) {
|
|
7872
|
-
const { store } = this.client;
|
|
7873
|
-
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7874
|
-
const createdBy = store.getState().userReducer.currentUser.id;
|
|
7875
|
-
const completionPayloads = payloads.map((payload) => offline(payload));
|
|
7876
|
-
const offlineProcedureCompletions = completionPayloads.map((completion) => {
|
|
7877
|
-
return {
|
|
7878
|
-
...completion,
|
|
7879
|
-
created_by: createdBy,
|
|
7880
|
-
submitted_at: submittedAt
|
|
7881
|
-
};
|
|
7882
|
-
});
|
|
7883
|
-
const offlineIds = offlineProcedureCompletions.map(({ offline_id }) => offline_id);
|
|
7884
|
-
this.dispatch(addAssetProcedureCompletions(offlineProcedureCompletions));
|
|
7885
|
-
const promise = this.enqueueRequest({
|
|
7886
|
-
description: "Bulk create asset procedure completions",
|
|
7887
|
-
method: HttpMethod.POST,
|
|
7888
|
-
url: "/asset-procedure-completions/bulk/",
|
|
7889
|
-
payload: {
|
|
7890
|
-
submitted_at: submittedAt,
|
|
7891
|
-
asset_procedure_completions: completionPayloads
|
|
7892
|
-
},
|
|
7893
|
-
blockers: [...payloads.map((c) => c.asset), ...payloads.map((c) => c.asset_procedure_instance)],
|
|
7894
|
-
blocks: offlineIds
|
|
7895
|
-
});
|
|
7896
|
-
promise.then((result) => {
|
|
7897
|
-
this.dispatch(updateAssetProcedureCompletions(result));
|
|
7898
|
-
}).catch(() => {
|
|
7899
|
-
this.dispatch(deleteAssetProcedureCompletions(offlineIds));
|
|
7900
|
-
});
|
|
7901
|
-
return [offlineProcedureCompletions, promise];
|
|
7902
|
-
}
|
|
7903
|
-
async delete(id) {
|
|
7904
|
-
const { store } = this.client;
|
|
7905
|
-
const assetProcedureCompletion = selectAssetProcedureCompletionById(id)(store.getState());
|
|
7906
|
-
if (!assetProcedureCompletion) {
|
|
7907
|
-
throw new Error(`Expected asset procedure completion with id ${id} to exist`);
|
|
7908
|
-
}
|
|
7909
|
-
this.dispatch(deleteAssetProcedureCompletion(id));
|
|
7910
|
-
const promise = this.enqueueRequest({
|
|
7911
|
-
description: "Delete asset procedure completion",
|
|
7912
|
-
method: HttpMethod.DELETE,
|
|
7913
|
-
url: `/asset-procedure-completions/${id}/`,
|
|
7914
|
-
blockers: [id],
|
|
7915
|
-
blocks: []
|
|
7916
|
-
});
|
|
7917
|
-
promise.catch(() => {
|
|
7918
|
-
this.dispatch(addAssetProcedureCompletion(assetProcedureCompletion));
|
|
7919
|
-
});
|
|
7920
|
-
return promise;
|
|
7921
|
-
}
|
|
7922
|
-
async bulkDelete(ids) {
|
|
7923
|
-
const { store } = this.client;
|
|
7924
|
-
const assetProcedureCompletions = selectAssetProcedureCompletionsByIds(ids)(store.getState());
|
|
7925
|
-
this.dispatch(deleteAssetProcedureCompletions(ids));
|
|
7926
|
-
const promise = this.enqueueRequest({
|
|
7927
|
-
description: "Deleting asset procedure completions",
|
|
7928
|
-
method: HttpMethod.DELETE,
|
|
7929
|
-
url: "/asset-procedure-completions/bulk/",
|
|
7930
|
-
payload: {
|
|
7931
|
-
completion_ids: ids
|
|
7932
|
-
},
|
|
7933
|
-
blockers: ids,
|
|
7934
|
-
blocks: []
|
|
7935
|
-
});
|
|
7936
|
-
promise.catch(() => {
|
|
7937
|
-
this.dispatch(addAssetProcedureCompletions(assetProcedureCompletions));
|
|
7938
|
-
});
|
|
7939
|
-
return promise;
|
|
7940
|
-
}
|
|
7941
|
-
async refreshStore(projectId) {
|
|
7942
|
-
const result = await this.enqueueRequest({
|
|
7943
|
-
description: "Get asset procedure completions",
|
|
7944
|
-
method: HttpMethod.GET,
|
|
7945
|
-
url: "/asset-procedure-completions/",
|
|
7946
|
-
queryParams: {
|
|
7947
|
-
project_id: projectId.toString()
|
|
7948
|
-
},
|
|
7949
|
-
blockers: [],
|
|
7950
|
-
blocks: []
|
|
7951
|
-
});
|
|
7952
|
-
this.dispatch(initializeAssetProcedureCompletions(result));
|
|
7953
|
-
}
|
|
7954
|
-
}
|
|
7955
7732
|
class AssetProcedureInstanceService extends BaseApiService {
|
|
7956
7733
|
add(payload) {
|
|
7957
7734
|
const { store } = this.client;
|
|
@@ -8149,7 +7926,6 @@ export {
|
|
|
8149
7926
|
APIError,
|
|
8150
7927
|
AgentService,
|
|
8151
7928
|
AssetAttachmentService,
|
|
8152
|
-
AssetProcedureCompletionService,
|
|
8153
7929
|
AssetProcedureInstanceService,
|
|
8154
7930
|
AssetProcedureService,
|
|
8155
7931
|
AssetService,
|
|
@@ -8215,8 +7991,6 @@ export {
|
|
|
8215
7991
|
addAssetAttachment,
|
|
8216
7992
|
addAssetAttachments,
|
|
8217
7993
|
addAssetProcedure,
|
|
8218
|
-
addAssetProcedureCompletion,
|
|
8219
|
-
addAssetProcedureCompletions,
|
|
8220
7994
|
addAssetProcedureInstance,
|
|
8221
7995
|
addAssetProcedureInstances,
|
|
8222
7996
|
addAssetProcedures,
|
|
@@ -8273,8 +8047,6 @@ export {
|
|
|
8273
8047
|
areArraysEqual,
|
|
8274
8048
|
assetAttachmentReducer,
|
|
8275
8049
|
assetAttachmentSlice,
|
|
8276
|
-
assetProcedureCompletionReducer,
|
|
8277
|
-
assetProcedureCompletionSlice,
|
|
8278
8050
|
assetProcedureInstanceReducer,
|
|
8279
8051
|
assetProcedureInstanceSlice,
|
|
8280
8052
|
assetProcedureReducer,
|
|
@@ -8311,8 +8083,6 @@ export {
|
|
|
8311
8083
|
deleteAssetAttachment,
|
|
8312
8084
|
deleteAssetAttachments,
|
|
8313
8085
|
deleteAssetProcedure,
|
|
8314
|
-
deleteAssetProcedureCompletion,
|
|
8315
|
-
deleteAssetProcedureCompletions,
|
|
8316
8086
|
deleteAssetProcedureInstance,
|
|
8317
8087
|
deleteAssetProcedureInstances,
|
|
8318
8088
|
deleteAssetProcedures,
|
|
@@ -8402,7 +8172,6 @@ export {
|
|
|
8402
8172
|
hashFile,
|
|
8403
8173
|
initSDK,
|
|
8404
8174
|
initializeAssetAttachments,
|
|
8405
|
-
initializeAssetProcedureCompletions,
|
|
8406
8175
|
initializeAssetProcedureInstances,
|
|
8407
8176
|
initializeAssetProcedures,
|
|
8408
8177
|
initializeAssetStageCompletions,
|
|
@@ -8507,12 +8276,6 @@ export {
|
|
|
8507
8276
|
selectAssetAttachments,
|
|
8508
8277
|
selectAssetById,
|
|
8509
8278
|
selectAssetProcedureById,
|
|
8510
|
-
selectAssetProcedureCompletionById,
|
|
8511
|
-
selectAssetProcedureCompletions,
|
|
8512
|
-
selectAssetProcedureCompletionsByIds,
|
|
8513
|
-
selectAssetProcedureCompletionsMapping,
|
|
8514
|
-
selectAssetProcedureCompletionsOfAsset,
|
|
8515
|
-
selectAssetProcedureCompletionsOfAssetProcedureInstance,
|
|
8516
8279
|
selectAssetProcedureInstanceById,
|
|
8517
8280
|
selectAssetProcedureInstances,
|
|
8518
8281
|
selectAssetProcedureInstancesByIds,
|
|
@@ -8562,8 +8325,6 @@ export {
|
|
|
8562
8325
|
selectCategoryById,
|
|
8563
8326
|
selectCategoryMapping,
|
|
8564
8327
|
selectCommentsOfIssue,
|
|
8565
|
-
selectCompletedStageIdsOfAssetProcedureCompletion,
|
|
8566
|
-
selectCompletedStagesByAssetProcedureCompletion,
|
|
8567
8328
|
selectConversation,
|
|
8568
8329
|
selectConversationMapping,
|
|
8569
8330
|
selectConversations,
|
|
@@ -8674,7 +8435,6 @@ export {
|
|
|
8674
8435
|
selectSortedFormSubmissionsOfForm,
|
|
8675
8436
|
selectSortedOrganizationUsers,
|
|
8676
8437
|
selectSortedProjectUsers,
|
|
8677
|
-
selectStageFormIdsFromStageIds,
|
|
8678
8438
|
selectStageMapping,
|
|
8679
8439
|
selectTeamById,
|
|
8680
8440
|
selectTeams,
|
|
@@ -8695,8 +8455,6 @@ export {
|
|
|
8695
8455
|
setAssetAttachment,
|
|
8696
8456
|
setAssetAttachments,
|
|
8697
8457
|
setAssetProcedure,
|
|
8698
|
-
setAssetProcedureCompletion,
|
|
8699
|
-
setAssetProcedureCompletions,
|
|
8700
8458
|
setAssetProcedureInstance,
|
|
8701
8459
|
setAssetProcedureInstances,
|
|
8702
8460
|
setAssetProcedures,
|
|
@@ -8756,8 +8514,6 @@ export {
|
|
|
8756
8514
|
updateAssetAttachment,
|
|
8757
8515
|
updateAssetAttachments,
|
|
8758
8516
|
updateAssetProcedure,
|
|
8759
|
-
updateAssetProcedureCompletion,
|
|
8760
|
-
updateAssetProcedureCompletions,
|
|
8761
8517
|
updateAssetProcedureInstance,
|
|
8762
8518
|
updateAssetProcedureInstances,
|
|
8763
8519
|
updateAssetProcedures,
|