@overmap-ai/core 1.0.63-selector-standardization.1 → 1.0.63-selector-standardization.4
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 +143 -160
- package/dist/overmap-core.js.map +1 -1
- package/dist/overmap-core.umd.cjs +143 -160
- package/dist/overmap-core.umd.cjs.map +1 -1
- package/dist/sdk/services/AssetAttachmentService.d.ts +1 -1
- package/dist/sdk/services/AssetTypeAttachmentService.d.ts +1 -1
- package/dist/sdk/services/BaseAttachmentService.d.ts +1 -1
- package/dist/sdk/services/DocumentAttachmentService.d.ts +1 -1
- package/dist/sdk/services/IssueAttachmentService.d.ts +1 -1
- package/dist/sdk/services/ProjectAttachmentService.d.ts +1 -1
- package/dist/store/slices/assetAttachmentSlice.d.ts +1 -1
- package/dist/store/slices/assetSlice.d.ts +2 -3
- package/dist/store/slices/assetTypeAttachmentSlice.d.ts +1 -1
- package/dist/store/slices/assetTypeSlice.d.ts +3 -3
- package/dist/store/slices/categorySlice.d.ts +1 -1
- package/dist/store/slices/documentAttachmentSlice.d.ts +1 -1
- package/dist/store/slices/documentSlice.d.ts +1 -1
- package/dist/store/slices/fileSlice.d.ts +1 -1
- package/dist/store/slices/formRevisionSlice.d.ts +2 -2
- package/dist/store/slices/formSlice.d.ts +3 -3
- package/dist/store/slices/formSubmissionSlice.d.ts +1 -1
- package/dist/store/slices/issueAssociationSlice.d.ts +1 -1
- package/dist/store/slices/issueAttachmentSlice.d.ts +1 -1
- package/dist/store/slices/issueSlice.d.ts +1 -1
- package/dist/store/slices/issueTypeSlice.d.ts +1 -1
- package/dist/store/slices/licenseSlice.d.ts +1 -1
- package/dist/store/slices/organizationAccessSlice.d.ts +1 -1
- package/dist/store/slices/organizationSlice.d.ts +1 -1
- package/dist/store/slices/projectAccessSlice.d.ts +1 -1
- package/dist/store/slices/projectAttachmentSlice.d.ts +2 -2
- package/dist/store/slices/projectFileSlice.d.ts +1 -1
- package/dist/store/slices/projectSlice.d.ts +1 -1
- package/dist/store/slices/teamSlice.d.ts +1 -1
- package/dist/store/slices/userSlice.d.ts +2 -2
- package/dist/store/slices/workspaceSlice.d.ts +1 -1
- package/dist/typings/store.d.ts +1 -1
- package/package.json +1 -1
|
@@ -892,101 +892,12 @@ var __publicField = (obj, key, value) => {
|
|
|
892
892
|
return Object.values(state.issueReducer.instances).filter((issue) => issue.category === categoryId).length;
|
|
893
893
|
};
|
|
894
894
|
const categoryReducer = categorySlice.reducer;
|
|
895
|
-
const assetStageAdapter = createModelAdapter((assetStage) => assetStage.offline_id);
|
|
896
|
-
const initialState$z = assetStageAdapter.getInitialState({});
|
|
897
|
-
const assetStageSlice = toolkit.createSlice({
|
|
898
|
-
name: "assetStages",
|
|
899
|
-
initialState: initialState$z,
|
|
900
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$z)),
|
|
901
|
-
reducers: {
|
|
902
|
-
initializeStages: assetStageAdapter.initialize,
|
|
903
|
-
setStage: assetStageAdapter.setOne,
|
|
904
|
-
addStages: assetStageAdapter.addMany,
|
|
905
|
-
updateStage: assetStageAdapter.updateOne,
|
|
906
|
-
updateStages: assetStageAdapter.updateMany,
|
|
907
|
-
removeStages: assetStageAdapter.deleteMany
|
|
908
|
-
}
|
|
909
|
-
});
|
|
910
|
-
const selectStageMapping = (state) => state.assetStageReducer.instances;
|
|
911
|
-
const selectAssetStageById = restructureCreateSelectorWithArgs(
|
|
912
|
-
toolkit.createSelector([selectStageMapping, (_state, stageId) => stageId], (stageMapping, stageId) => {
|
|
913
|
-
return stageMapping[stageId];
|
|
914
|
-
})
|
|
915
|
-
);
|
|
916
|
-
const selectAssetStages = toolkit.createSelector([selectStageMapping], (stageMapping) => {
|
|
917
|
-
return Object.values(stageMapping);
|
|
918
|
-
});
|
|
919
|
-
const selectStagesFromAssetTypeIds = restructureCreateSelectorWithArgs(
|
|
920
|
-
toolkit.createSelector([selectAssetStages, (_state, assetTypeIds) => assetTypeIds], (stages, assetTypeIds) => {
|
|
921
|
-
const assetTypeIdsSet = new Set(assetTypeIds);
|
|
922
|
-
const ret = {};
|
|
923
|
-
for (const stage of stages) {
|
|
924
|
-
if (assetTypeIdsSet.has(stage.asset_type)) {
|
|
925
|
-
if (!ret[stage.asset_type]) {
|
|
926
|
-
ret[stage.asset_type] = [];
|
|
927
|
-
}
|
|
928
|
-
ret[stage.asset_type].push(stage);
|
|
929
|
-
}
|
|
930
|
-
}
|
|
931
|
-
for (const key in ret) {
|
|
932
|
-
ret[key] = ret[key].sort((a, b) => a.priority - b.priority);
|
|
933
|
-
}
|
|
934
|
-
return ret;
|
|
935
|
-
})
|
|
936
|
-
);
|
|
937
|
-
const selectAssetTypeStagesMapping = restructureCreateSelectorWithArgs(
|
|
938
|
-
toolkit.createSelector([selectStageMapping, (_state, assetTypeId) => assetTypeId], (stagesMapping, assetTypeId) => {
|
|
939
|
-
const assetTypeStagesMapping = {};
|
|
940
|
-
for (const [stageId, stage] of Object.entries(stagesMapping)) {
|
|
941
|
-
if (stage.asset_type === assetTypeId) {
|
|
942
|
-
assetTypeStagesMapping[stageId] = stage;
|
|
943
|
-
}
|
|
944
|
-
}
|
|
945
|
-
return assetTypeStagesMapping;
|
|
946
|
-
})
|
|
947
|
-
);
|
|
948
|
-
const selectStagesOfAssetType = restructureCreateSelectorWithArgs(
|
|
949
|
-
toolkit.createSelector([selectAssetStages, (_state, assetTypeId) => assetTypeId], (stages, assetTypeId) => {
|
|
950
|
-
return stages.filter((stage) => stage.asset_type === assetTypeId).sort((a, b) => a.priority - b.priority);
|
|
951
|
-
})
|
|
952
|
-
);
|
|
953
|
-
const selectAssetStagesByIds = restructureCreateSelectorWithArgs(
|
|
954
|
-
toolkit.createSelector([selectStageMapping, (_state, stageIds) => stageIds], (stageMapping, stageIds) => {
|
|
955
|
-
const assetStages = [];
|
|
956
|
-
for (const stageId of stageIds) {
|
|
957
|
-
const stage = stageMapping[stageId];
|
|
958
|
-
if (stage) {
|
|
959
|
-
assetStages.push(stage);
|
|
960
|
-
} else {
|
|
961
|
-
console.warn("selectStagesFromStageIds: No stage exists with the id", stageId);
|
|
962
|
-
}
|
|
963
|
-
}
|
|
964
|
-
return assetStages;
|
|
965
|
-
})
|
|
966
|
-
);
|
|
967
|
-
const selectStageFormIdsFromStageIds = restructureCreateSelectorWithArgs(
|
|
968
|
-
toolkit.createSelector([selectStageMapping, (_state, stageIds) => stageIds], (stageMapping, stageIds) => {
|
|
969
|
-
const ret = {};
|
|
970
|
-
for (const stageId of stageIds) {
|
|
971
|
-
const stage = stageMapping[stageId];
|
|
972
|
-
if (!stage) {
|
|
973
|
-
throw new Error("No stage exists with the id " + stageId);
|
|
974
|
-
}
|
|
975
|
-
if (stage.form) {
|
|
976
|
-
ret[stageId] = stage.form;
|
|
977
|
-
}
|
|
978
|
-
}
|
|
979
|
-
return ret;
|
|
980
|
-
})
|
|
981
|
-
);
|
|
982
|
-
const { initializeStages, setStage, addStages, updateStages, removeStages, updateStage } = assetStageSlice.actions;
|
|
983
|
-
const assetStageReducer = assetStageSlice.reducer;
|
|
984
895
|
const assetTypeAdapter = createModelAdapter((assetType) => assetType.offline_id);
|
|
985
|
-
const initialState$
|
|
896
|
+
const initialState$z = assetTypeAdapter.getInitialState({});
|
|
986
897
|
const assetTypeSlice = toolkit.createSlice({
|
|
987
898
|
name: "assetTypes",
|
|
988
|
-
initialState: initialState$
|
|
989
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
899
|
+
initialState: initialState$z,
|
|
900
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$z)),
|
|
990
901
|
reducers: {
|
|
991
902
|
initializeAssetTypes: assetTypeAdapter.initialize,
|
|
992
903
|
addAssetType: assetTypeAdapter.addOne,
|
|
@@ -1004,15 +915,15 @@ var __publicField = (obj, key, value) => {
|
|
|
1004
915
|
};
|
|
1005
916
|
const selectAssetTypesByIds = restructureCreateSelectorWithArgs(
|
|
1006
917
|
toolkit.createSelector(
|
|
1007
|
-
[
|
|
918
|
+
[selectAssetTypesMapping, (_state, assetTypeIds) => assetTypeIds],
|
|
1008
919
|
(assetTypeMapping, assetTypeIds) => {
|
|
1009
920
|
const assetTypes = [];
|
|
1010
|
-
for (const
|
|
1011
|
-
const
|
|
1012
|
-
if (
|
|
1013
|
-
assetTypes.push(
|
|
921
|
+
for (const assetTypeId of assetTypeIds) {
|
|
922
|
+
const assetType = assetTypeMapping[assetTypeId];
|
|
923
|
+
if (assetType) {
|
|
924
|
+
assetTypes.push(assetType);
|
|
1014
925
|
} else {
|
|
1015
|
-
console.warn("selectAssetTypesByIds: No
|
|
926
|
+
console.warn("selectAssetTypesByIds: No assetType exists with the id", assetTypeId);
|
|
1016
927
|
}
|
|
1017
928
|
}
|
|
1018
929
|
return assetTypes;
|
|
@@ -1021,11 +932,11 @@ var __publicField = (obj, key, value) => {
|
|
|
1021
932
|
);
|
|
1022
933
|
const assetTypeReducer = assetTypeSlice.reducer;
|
|
1023
934
|
const assetAdapter = createModelAdapter((asset) => asset.offline_id);
|
|
1024
|
-
const initialState$
|
|
935
|
+
const initialState$y = assetAdapter.getInitialState({});
|
|
1025
936
|
const assetSlice = toolkit.createSlice({
|
|
1026
937
|
name: "assets",
|
|
1027
|
-
initialState: initialState$
|
|
1028
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
938
|
+
initialState: initialState$y,
|
|
939
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$y)),
|
|
1029
940
|
reducers: {
|
|
1030
941
|
initializeAssets: (state, action) => {
|
|
1031
942
|
assetAdapter.initialize(state, action);
|
|
@@ -1123,27 +1034,15 @@ var __publicField = (obj, key, value) => {
|
|
|
1123
1034
|
}
|
|
1124
1035
|
);
|
|
1125
1036
|
const selectNumberOfAssetsOfAssetType = (assetTypeId) => (state) => {
|
|
1126
|
-
|
|
1127
|
-
if (!assetTypeId)
|
|
1128
|
-
return 0;
|
|
1129
|
-
return (_a2 = selectAssetsOfAssetType(assetTypeId)(state)) == null ? void 0 : _a2.length;
|
|
1130
|
-
};
|
|
1131
|
-
const selectAssetTypesFromIds = (assetTypeIds) => (state) => {
|
|
1132
|
-
return assetTypeIds.reduce((acc, assetTypeId) => {
|
|
1133
|
-
const assetType = state.assetTypeReducer.instances[assetTypeId];
|
|
1134
|
-
if (assetType) {
|
|
1135
|
-
acc.push(assetType);
|
|
1136
|
-
}
|
|
1137
|
-
return acc;
|
|
1138
|
-
}, []);
|
|
1037
|
+
return selectAssetsOfAssetType(assetTypeId)(state).length;
|
|
1139
1038
|
};
|
|
1140
1039
|
const assetReducer = assetSlice.reducer;
|
|
1141
1040
|
const assetAttachmentAdapter = createModelAdapter((attachment) => attachment.offline_id);
|
|
1142
|
-
const initialState$
|
|
1041
|
+
const initialState$x = assetAttachmentAdapter.getInitialState({});
|
|
1143
1042
|
const assetAttachmentSlice = toolkit.createSlice({
|
|
1144
1043
|
name: "assetAttachments",
|
|
1145
|
-
initialState: initialState$
|
|
1146
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1044
|
+
initialState: initialState$x,
|
|
1045
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$x)),
|
|
1147
1046
|
reducers: {
|
|
1148
1047
|
initializeAssetAttachments: assetAttachmentAdapter.initialize,
|
|
1149
1048
|
addAssetAttachment: assetAttachmentAdapter.addOne,
|
|
@@ -1201,13 +1100,13 @@ var __publicField = (obj, key, value) => {
|
|
|
1201
1100
|
)
|
|
1202
1101
|
);
|
|
1203
1102
|
const assetAttachmentReducer = assetAttachmentSlice.reducer;
|
|
1204
|
-
const initialState$
|
|
1103
|
+
const initialState$w = {
|
|
1205
1104
|
completionsByAssetId: {}
|
|
1206
1105
|
};
|
|
1207
1106
|
const assetStageCompletionSlice = toolkit.createSlice({
|
|
1208
1107
|
name: "assetStageCompletions",
|
|
1209
|
-
initialState: initialState$
|
|
1210
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1108
|
+
initialState: initialState$w,
|
|
1109
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$w)),
|
|
1211
1110
|
reducers: {
|
|
1212
1111
|
addStageCompletion: (state, action) => {
|
|
1213
1112
|
let stageToCompletionDateMapping = state.completionsByAssetId[action.payload.asset];
|
|
@@ -1258,6 +1157,95 @@ var __publicField = (obj, key, value) => {
|
|
|
1258
1157
|
})
|
|
1259
1158
|
);
|
|
1260
1159
|
const assetStageCompletionReducer = assetStageCompletionSlice.reducer;
|
|
1160
|
+
const assetStageAdapter = createModelAdapter((assetStage) => assetStage.offline_id);
|
|
1161
|
+
const initialState$v = assetStageAdapter.getInitialState({});
|
|
1162
|
+
const assetStageSlice = toolkit.createSlice({
|
|
1163
|
+
name: "assetStages",
|
|
1164
|
+
initialState: initialState$v,
|
|
1165
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$v)),
|
|
1166
|
+
reducers: {
|
|
1167
|
+
initializeStages: assetStageAdapter.initialize,
|
|
1168
|
+
setStage: assetStageAdapter.setOne,
|
|
1169
|
+
addStages: assetStageAdapter.addMany,
|
|
1170
|
+
updateStage: assetStageAdapter.updateOne,
|
|
1171
|
+
updateStages: assetStageAdapter.updateMany,
|
|
1172
|
+
removeStages: assetStageAdapter.deleteMany
|
|
1173
|
+
}
|
|
1174
|
+
});
|
|
1175
|
+
const selectStageMapping = (state) => state.assetStageReducer.instances;
|
|
1176
|
+
const selectAssetStageById = restructureCreateSelectorWithArgs(
|
|
1177
|
+
toolkit.createSelector([selectStageMapping, (_state, stageId) => stageId], (stageMapping, stageId) => {
|
|
1178
|
+
return stageMapping[stageId];
|
|
1179
|
+
})
|
|
1180
|
+
);
|
|
1181
|
+
const selectAssetStages = toolkit.createSelector([selectStageMapping], (stageMapping) => {
|
|
1182
|
+
return Object.values(stageMapping);
|
|
1183
|
+
});
|
|
1184
|
+
const selectStagesFromAssetTypeIds = restructureCreateSelectorWithArgs(
|
|
1185
|
+
toolkit.createSelector([selectAssetStages, (_state, assetTypeIds) => assetTypeIds], (stages, assetTypeIds) => {
|
|
1186
|
+
const assetTypeIdsSet = new Set(assetTypeIds);
|
|
1187
|
+
const ret = {};
|
|
1188
|
+
for (const stage of stages) {
|
|
1189
|
+
if (assetTypeIdsSet.has(stage.asset_type)) {
|
|
1190
|
+
if (!ret[stage.asset_type]) {
|
|
1191
|
+
ret[stage.asset_type] = [];
|
|
1192
|
+
}
|
|
1193
|
+
ret[stage.asset_type].push(stage);
|
|
1194
|
+
}
|
|
1195
|
+
}
|
|
1196
|
+
for (const key in ret) {
|
|
1197
|
+
ret[key] = ret[key].sort((a, b) => a.priority - b.priority);
|
|
1198
|
+
}
|
|
1199
|
+
return ret;
|
|
1200
|
+
})
|
|
1201
|
+
);
|
|
1202
|
+
const selectAssetTypeStagesMapping = restructureCreateSelectorWithArgs(
|
|
1203
|
+
toolkit.createSelector([selectStageMapping, (_state, assetTypeId) => assetTypeId], (stagesMapping, assetTypeId) => {
|
|
1204
|
+
const assetTypeStagesMapping = {};
|
|
1205
|
+
for (const [stageId, stage] of Object.entries(stagesMapping)) {
|
|
1206
|
+
if (stage.asset_type === assetTypeId) {
|
|
1207
|
+
assetTypeStagesMapping[stageId] = stage;
|
|
1208
|
+
}
|
|
1209
|
+
}
|
|
1210
|
+
return assetTypeStagesMapping;
|
|
1211
|
+
})
|
|
1212
|
+
);
|
|
1213
|
+
const selectStagesOfAssetType = restructureCreateSelectorWithArgs(
|
|
1214
|
+
toolkit.createSelector([selectAssetStages, (_state, assetTypeId) => assetTypeId], (stages, assetTypeId) => {
|
|
1215
|
+
return stages.filter((stage) => stage.asset_type === assetTypeId).sort((a, b) => a.priority - b.priority);
|
|
1216
|
+
})
|
|
1217
|
+
);
|
|
1218
|
+
const selectAssetStagesByIds = restructureCreateSelectorWithArgs(
|
|
1219
|
+
toolkit.createSelector([selectStageMapping, (_state, stageIds) => stageIds], (stageMapping, stageIds) => {
|
|
1220
|
+
const assetStages = [];
|
|
1221
|
+
for (const stageId of stageIds) {
|
|
1222
|
+
const stage = stageMapping[stageId];
|
|
1223
|
+
if (stage) {
|
|
1224
|
+
assetStages.push(stage);
|
|
1225
|
+
} else {
|
|
1226
|
+
console.warn("selectStagesFromStageIds: No stage exists with the id", stageId);
|
|
1227
|
+
}
|
|
1228
|
+
}
|
|
1229
|
+
return assetStages;
|
|
1230
|
+
})
|
|
1231
|
+
);
|
|
1232
|
+
const selectStageFormIdsFromStageIds = restructureCreateSelectorWithArgs(
|
|
1233
|
+
toolkit.createSelector([selectStageMapping, (_state, stageIds) => stageIds], (stageMapping, stageIds) => {
|
|
1234
|
+
const ret = {};
|
|
1235
|
+
for (const stageId of stageIds) {
|
|
1236
|
+
const stage = stageMapping[stageId];
|
|
1237
|
+
if (!stage) {
|
|
1238
|
+
throw new Error("No stage exists with the id " + stageId);
|
|
1239
|
+
}
|
|
1240
|
+
if (stage.form) {
|
|
1241
|
+
ret[stageId] = stage.form;
|
|
1242
|
+
}
|
|
1243
|
+
}
|
|
1244
|
+
return ret;
|
|
1245
|
+
})
|
|
1246
|
+
);
|
|
1247
|
+
const { initializeStages, setStage, addStages, updateStages, removeStages, updateStage } = assetStageSlice.actions;
|
|
1248
|
+
const assetStageReducer = assetStageSlice.reducer;
|
|
1261
1249
|
const assetTypeAttachmentAdapter = createModelAdapter(
|
|
1262
1250
|
(attachment) => attachment.offline_id
|
|
1263
1251
|
);
|
|
@@ -1345,8 +1333,8 @@ var __publicField = (obj, key, value) => {
|
|
|
1345
1333
|
return workspaces.find((workspace) => workspace.name.toLowerCase() === "main");
|
|
1346
1334
|
}
|
|
1347
1335
|
);
|
|
1348
|
-
const selectWorkspaceById = (
|
|
1349
|
-
return state.workspaceReducer.instances[
|
|
1336
|
+
const selectWorkspaceById = (id) => (state) => {
|
|
1337
|
+
return state.workspaceReducer.instances[id];
|
|
1350
1338
|
};
|
|
1351
1339
|
const selectPermittedWorkspaceIds = toolkit.createSelector(
|
|
1352
1340
|
[selectWorkspaceMapping],
|
|
@@ -1547,8 +1535,8 @@ var __publicField = (obj, key, value) => {
|
|
|
1547
1535
|
return Object.values(issueTypes);
|
|
1548
1536
|
}
|
|
1549
1537
|
);
|
|
1550
|
-
const selectIssueTypeById = (
|
|
1551
|
-
return state.issueTypeReducer.instances[
|
|
1538
|
+
const selectIssueTypeById = (id) => (state) => {
|
|
1539
|
+
return state.issueTypeReducer.instances[id];
|
|
1552
1540
|
};
|
|
1553
1541
|
const selectIssueTypesByIds = (issueTypeIds) => (state) => {
|
|
1554
1542
|
const issueTypes = [];
|
|
@@ -1579,8 +1567,7 @@ var __publicField = (obj, key, value) => {
|
|
|
1579
1567
|
)
|
|
1580
1568
|
);
|
|
1581
1569
|
const selectIssuesOfIssueTypeCount = (issueTypeId) => (state) => {
|
|
1582
|
-
|
|
1583
|
-
return ((_a2 = selectIssuesOfIssueType(issueTypeId)(state)) == null ? void 0 : _a2.length) ?? 0;
|
|
1570
|
+
return selectIssuesOfIssueType(issueTypeId)(state).length;
|
|
1584
1571
|
};
|
|
1585
1572
|
const issueTypeReducer = issueTypeSlice.reducer;
|
|
1586
1573
|
const initialState$q = {
|
|
@@ -1745,8 +1732,8 @@ var __publicField = (obj, key, value) => {
|
|
|
1745
1732
|
return void 0;
|
|
1746
1733
|
return state.userReducer.users[userId];
|
|
1747
1734
|
};
|
|
1748
|
-
const selectUserById = (
|
|
1749
|
-
return state.userReducer.users[
|
|
1735
|
+
const selectUserById = (id) => (state) => {
|
|
1736
|
+
return state.userReducer.users[id];
|
|
1750
1737
|
};
|
|
1751
1738
|
const selectUsersByIds = restructureCreateSelectorWithArgs(
|
|
1752
1739
|
toolkit.createSelector([selectUsersMapping, (_state, userIds) => userIds], (usersMapping, userIds) => {
|
|
@@ -1781,8 +1768,8 @@ var __publicField = (obj, key, value) => {
|
|
|
1781
1768
|
const selectOrganizationAccesses = (state) => {
|
|
1782
1769
|
return state.organizationAccessReducer.instances;
|
|
1783
1770
|
};
|
|
1784
|
-
const selectOrganizationAccessById = (
|
|
1785
|
-
return state.organizationAccessReducer.instances[
|
|
1771
|
+
const selectOrganizationAccessById = (id) => (state) => {
|
|
1772
|
+
return state.organizationAccessReducer.instances[id];
|
|
1786
1773
|
};
|
|
1787
1774
|
const selectActiveOrganizationAccess = toolkit.createSelector(
|
|
1788
1775
|
[selectCurrentUser, selectOrganizationAccesses],
|
|
@@ -1822,7 +1809,7 @@ var __publicField = (obj, key, value) => {
|
|
|
1822
1809
|
const selectLicenses = (state) => {
|
|
1823
1810
|
return state.licenseReducer.instances;
|
|
1824
1811
|
};
|
|
1825
|
-
const selectLicense = (
|
|
1812
|
+
const selectLicense = (id) => (state) => state.licenseReducer.instances[id];
|
|
1826
1813
|
const selectActiveLicense = (state) => Object.values(state.licenseReducer.instances).find(
|
|
1827
1814
|
(license) => license.project === state.projectReducer.activeProjectId
|
|
1828
1815
|
) ?? null;
|
|
@@ -1859,8 +1846,8 @@ var __publicField = (obj, key, value) => {
|
|
|
1859
1846
|
return Object.values(projectAccesses);
|
|
1860
1847
|
}
|
|
1861
1848
|
);
|
|
1862
|
-
const selectProjectAccessById = (
|
|
1863
|
-
return state.projectAccessReducer.instances[
|
|
1849
|
+
const selectProjectAccessById = (id) => (state) => {
|
|
1850
|
+
return state.projectAccessReducer.instances[id];
|
|
1864
1851
|
};
|
|
1865
1852
|
const selectActiveProjectAccess = (state) => {
|
|
1866
1853
|
const currentUser = state.userReducer.currentUser;
|
|
@@ -1964,8 +1951,8 @@ var __publicField = (obj, key, value) => {
|
|
|
1964
1951
|
}
|
|
1965
1952
|
return state.projectReducer.projects[activeProjectId] ?? null;
|
|
1966
1953
|
};
|
|
1967
|
-
const selectProjectById = (
|
|
1968
|
-
return state.projectReducer.projects[
|
|
1954
|
+
const selectProjectById = (id) => (state) => {
|
|
1955
|
+
return state.projectReducer.projects[id];
|
|
1969
1956
|
};
|
|
1970
1957
|
const selectProjectUsersIds = toolkit.createSelector(
|
|
1971
1958
|
[selectProjectAccessMapping],
|
|
@@ -2026,8 +2013,8 @@ var __publicField = (obj, key, value) => {
|
|
|
2026
2013
|
[selectOrganizations],
|
|
2027
2014
|
(organizations) => Object.values(organizations).filter((organization) => organization.has_access)
|
|
2028
2015
|
);
|
|
2029
|
-
const selectOrganizationById = (
|
|
2030
|
-
return state.organizationReducer.organizations[
|
|
2016
|
+
const selectOrganizationById = (id) => (state) => {
|
|
2017
|
+
return state.organizationReducer.organizations[id];
|
|
2031
2018
|
};
|
|
2032
2019
|
const selectOrganizationUsersIds = toolkit.createSelector(
|
|
2033
2020
|
[selectOrganizationAccesses],
|
|
@@ -2257,16 +2244,13 @@ var __publicField = (obj, key, value) => {
|
|
|
2257
2244
|
[selectProjectAttachmentMapping],
|
|
2258
2245
|
(mapping) => Object.values(mapping)
|
|
2259
2246
|
);
|
|
2260
|
-
const selectProjectAttachment = (
|
|
2261
|
-
return state.projectAttachmentReducer.instances[
|
|
2247
|
+
const selectProjectAttachment = (id) => (state) => {
|
|
2248
|
+
return state.projectAttachmentReducer.instances[id];
|
|
2262
2249
|
};
|
|
2263
2250
|
const selectAttachmentsOfProject = restructureCreateSelectorWithArgs(
|
|
2264
|
-
toolkit.createSelector(
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
return attachments.filter(({ project }) => projectId === project);
|
|
2268
|
-
}
|
|
2269
|
-
)
|
|
2251
|
+
toolkit.createSelector([selectAllProjectAttachments, (_, projectId) => projectId], (attachments, projectId) => {
|
|
2252
|
+
return attachments.filter(({ project }) => projectId === project);
|
|
2253
|
+
})
|
|
2270
2254
|
);
|
|
2271
2255
|
const selectAttachmentsOfProjectByType = restructureCreateSelectorWithArgs(
|
|
2272
2256
|
toolkit.createSelector(
|
|
@@ -3108,8 +3092,8 @@ var __publicField = (obj, key, value) => {
|
|
|
3108
3092
|
const selectTeams = toolkit.createSelector([selectTeamsMapping], (teams) => {
|
|
3109
3093
|
return Object.values(teams);
|
|
3110
3094
|
});
|
|
3111
|
-
const selectTeamById = (
|
|
3112
|
-
return state.teamReducer.instances[
|
|
3095
|
+
const selectTeamById = (id) => (state) => {
|
|
3096
|
+
return state.teamReducer.instances[id];
|
|
3113
3097
|
};
|
|
3114
3098
|
const selectTeamsOfOrganization = restructureCreateSelectorWithArgs(
|
|
3115
3099
|
toolkit.createSelector(
|
|
@@ -3261,8 +3245,8 @@ var __publicField = (obj, key, value) => {
|
|
|
3261
3245
|
}
|
|
3262
3246
|
)
|
|
3263
3247
|
);
|
|
3264
|
-
const
|
|
3265
|
-
return root.issueAttachmentReducer.instances[
|
|
3248
|
+
const selectIssueAttachmentById = (id) => (root) => {
|
|
3249
|
+
return root.issueAttachmentReducer.instances[id];
|
|
3266
3250
|
};
|
|
3267
3251
|
const selectAttachmentsOfIssueByType = restructureCreateSelectorWithArgs(
|
|
3268
3252
|
toolkit.createSelector(
|
|
@@ -3485,7 +3469,7 @@ var __publicField = (obj, key, value) => {
|
|
|
3485
3469
|
throw new Error("Tried to delete main workspace");
|
|
3486
3470
|
}
|
|
3487
3471
|
const categoriesInThisWorkspace = new Set(
|
|
3488
|
-
|
|
3472
|
+
selectCategoriesOfWorkspace(workspaceId)(draft).map((category) => category.offline_id)
|
|
3489
3473
|
);
|
|
3490
3474
|
for (const issue of issuesVisibleInWorkspace) {
|
|
3491
3475
|
if (issue.category && categoriesInThisWorkspace.has(issue.category)) {
|
|
@@ -4296,7 +4280,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4296
4280
|
async deleteAllAssetsOfAssetType(assetTypeId) {
|
|
4297
4281
|
const { store } = this.client;
|
|
4298
4282
|
const state = store.getState();
|
|
4299
|
-
const allAssetsOfAssetType = selectAssetsOfAssetType(assetTypeId)(state)
|
|
4283
|
+
const allAssetsOfAssetType = selectAssetsOfAssetType(assetTypeId)(state);
|
|
4300
4284
|
const allAssetsOfAssetTypeIds = allAssetsOfAssetType.map((c) => c.offline_id);
|
|
4301
4285
|
const affectedOfflineIds = [assetTypeId, ...allAssetsOfAssetTypeIds];
|
|
4302
4286
|
store.dispatch(deleteAssets(allAssetsOfAssetTypeIds));
|
|
@@ -4809,7 +4793,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4809
4793
|
if (!assetType) {
|
|
4810
4794
|
throw new Error(`Expected asset type with offline_id ${assetTypeId} to exist`);
|
|
4811
4795
|
}
|
|
4812
|
-
const stagesOfAssetType = selectStagesOfAssetType(assetTypeId)(state)
|
|
4796
|
+
const stagesOfAssetType = selectStagesOfAssetType(assetTypeId)(state);
|
|
4813
4797
|
const attachmentsOfAssetType = selectAttachmentsOfAssetType(assetTypeId)(state);
|
|
4814
4798
|
this.dispatch(deleteAssetType(assetTypeId));
|
|
4815
4799
|
if (stagesOfAssetType.length > 0) {
|
|
@@ -4978,7 +4962,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4978
4962
|
__publicField(this, "removeAttachments", deleteIssueAttachments);
|
|
4979
4963
|
__publicField(this, "removeAttachment", deleteIssueAttachment);
|
|
4980
4964
|
__publicField(this, "setAttachment", setIssueAttachment);
|
|
4981
|
-
__publicField(this, "selectAttachment",
|
|
4965
|
+
__publicField(this, "selectAttachment", selectIssueAttachmentById);
|
|
4982
4966
|
}
|
|
4983
4967
|
buildOfflineAttachment(data) {
|
|
4984
4968
|
return offline({
|
|
@@ -5281,7 +5265,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5281
5265
|
if (!issueTypeToDelete) {
|
|
5282
5266
|
throw new Error(`IssueType with offline_id ${issueTypeId} does not exist in the store.`);
|
|
5283
5267
|
}
|
|
5284
|
-
const issuesOfIssueType = selectIssuesOfIssueType(issueTypeId)(state)
|
|
5268
|
+
const issuesOfIssueType = selectIssuesOfIssueType(issueTypeId)(state);
|
|
5285
5269
|
this.dispatch(removeIssueType(issueTypeId));
|
|
5286
5270
|
this.dispatch(deleteIssues(issuesOfIssueType.map((issue) => issue.offline_id)));
|
|
5287
5271
|
const promise = this.enqueueRequest({
|
|
@@ -5873,11 +5857,11 @@ var __publicField = (obj, key, value) => {
|
|
|
5873
5857
|
throw new Error("Expected form to exist");
|
|
5874
5858
|
}
|
|
5875
5859
|
const formSubmissions = selectFormSubmissionsOfForm(formId)(state);
|
|
5876
|
-
if (formSubmissions
|
|
5860
|
+
if (formSubmissions.length > 0) {
|
|
5877
5861
|
this.dispatch(deleteFormSubmissions(formSubmissions.map(({ offline_id }) => offline_id)));
|
|
5878
5862
|
}
|
|
5879
5863
|
const formRevisions = selectFormRevisionsOfForm(formId)(state);
|
|
5880
|
-
if (formRevisions
|
|
5864
|
+
if (formRevisions.length > 0) {
|
|
5881
5865
|
this.dispatch(deleteFormRevisions(formRevisions.map(({ offline_id }) => offline_id)));
|
|
5882
5866
|
}
|
|
5883
5867
|
this.dispatch(deleteForm(formId));
|
|
@@ -5891,10 +5875,10 @@ var __publicField = (obj, key, value) => {
|
|
|
5891
5875
|
});
|
|
5892
5876
|
} catch (e) {
|
|
5893
5877
|
this.dispatch(addForm(form));
|
|
5894
|
-
if (formRevisions
|
|
5878
|
+
if (formRevisions.length > 0) {
|
|
5895
5879
|
this.dispatch(addFormRevisions(formRevisions));
|
|
5896
5880
|
}
|
|
5897
|
-
if (formSubmissions
|
|
5881
|
+
if (formSubmissions.length > 0) {
|
|
5898
5882
|
this.dispatch(addFormSubmissions(formSubmissions));
|
|
5899
5883
|
}
|
|
5900
5884
|
throw e;
|
|
@@ -7858,7 +7842,6 @@ var __publicField = (obj, key, value) => {
|
|
|
7858
7842
|
exports2.selectAssetTypeStagesMapping = selectAssetTypeStagesMapping;
|
|
7859
7843
|
exports2.selectAssetTypes = selectAssetTypes;
|
|
7860
7844
|
exports2.selectAssetTypesByIds = selectAssetTypesByIds;
|
|
7861
|
-
exports2.selectAssetTypesFromIds = selectAssetTypesFromIds;
|
|
7862
7845
|
exports2.selectAssetTypesMapping = selectAssetTypesMapping;
|
|
7863
7846
|
exports2.selectAssets = selectAssets;
|
|
7864
7847
|
exports2.selectAssetsByIds = selectAssetsByIds;
|
|
@@ -7937,7 +7920,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7937
7920
|
exports2.selectIssueAssociationsOfAsset = selectIssueAssociationsOfAsset;
|
|
7938
7921
|
exports2.selectIssueAssociationsOfIssue = selectIssueAssociationsOfIssue;
|
|
7939
7922
|
exports2.selectIssueAssociationsToIssue = selectIssueAssociationsToIssue;
|
|
7940
|
-
exports2.
|
|
7923
|
+
exports2.selectIssueAttachmentById = selectIssueAttachmentById;
|
|
7941
7924
|
exports2.selectIssueAttachmentMapping = selectIssueAttachmentMapping;
|
|
7942
7925
|
exports2.selectIssueAttachments = selectIssueAttachments;
|
|
7943
7926
|
exports2.selectIssueById = selectIssueById;
|