@overmap-ai/core 1.0.63-org-doc-improvements.2 → 1.0.63-selector-standardization.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 +412 -282
- package/dist/overmap-core.js.map +1 -1
- package/dist/overmap-core.umd.cjs +412 -282
- package/dist/overmap-core.umd.cjs.map +1 -1
- package/dist/sdk/services/FormSubmissionService.d.ts +9 -1
- package/dist/sdk/services/IssueTypeService.d.ts +1 -1
- package/dist/store/slices/assetSlice.d.ts +2 -1
- package/dist/store/slices/assetStageSlice.d.ts +9 -5
- package/dist/store/slices/assetTypeSlice.d.ts +4 -10
- package/dist/store/slices/categorySlice.d.ts +2 -1
- package/dist/store/slices/documentSlice.d.ts +3 -2
- package/dist/store/slices/formRevisionSlice.d.ts +1 -1
- package/dist/store/slices/formSlice.d.ts +1 -1
- package/dist/store/slices/formSubmissionAttachmentSlice.d.ts +2 -1
- package/dist/store/slices/formSubmissionSlice.d.ts +1 -1
- package/dist/store/slices/index.d.ts +0 -1
- package/dist/store/slices/issueAssociationSlice.d.ts +5 -0
- package/dist/store/slices/issueSlice.d.ts +2 -1
- package/dist/store/slices/issueTypeSlice.d.ts +2 -1
- package/dist/store/slices/projectAccessSlice.d.ts +2 -2
- package/dist/store/slices/projectSlice.d.ts +3 -3
- package/dist/store/slices/teamSlice.d.ts +1 -1
- package/dist/store/slices/userSlice.d.ts +4 -2
- package/dist/store/store.d.ts +1 -2
- package/dist/typings/models/forms.d.ts +1 -0
- package/dist/typings/models/store.d.ts +1 -2
- package/package.json +1 -1
- package/dist/store/slices/settingsSlice.d.ts +0 -11
|
@@ -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;
|
|
@@ -845,11 +845,11 @@ var __publicField = (obj, key, value) => {
|
|
|
845
845
|
};
|
|
846
846
|
}
|
|
847
847
|
const categoryAdapter = createModelAdapter((category) => category.offline_id);
|
|
848
|
-
const initialState$
|
|
848
|
+
const initialState$A = categoryAdapter.getInitialState({});
|
|
849
849
|
const categorySlice = toolkit.createSlice({
|
|
850
850
|
name: "categories",
|
|
851
|
-
initialState: initialState$
|
|
852
|
-
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)),
|
|
853
853
|
reducers: {
|
|
854
854
|
initializeCategories: categoryAdapter.initialize,
|
|
855
855
|
addCategory: categoryAdapter.addOne,
|
|
@@ -862,28 +862,131 @@ var __publicField = (obj, key, value) => {
|
|
|
862
862
|
const selectCategories = toolkit.createSelector([selectCategoryMapping], (categoryMapping) => {
|
|
863
863
|
return Object.values(categoryMapping);
|
|
864
864
|
});
|
|
865
|
-
const
|
|
865
|
+
const selectCategoryById = (id) => (state) => {
|
|
866
|
+
return state.categoryReducer.instances[id];
|
|
867
|
+
};
|
|
868
|
+
const selectCategoriesByIds = restructureCreateSelectorWithArgs(
|
|
866
869
|
toolkit.createSelector(
|
|
867
|
-
[
|
|
868
|
-
(
|
|
870
|
+
[selectCategoryMapping, (_state, categoryIds) => categoryIds],
|
|
871
|
+
(categoryMapping, categoryIds) => {
|
|
872
|
+
const categories = [];
|
|
873
|
+
for (const categoryId of categoryIds) {
|
|
874
|
+
const category = categoryMapping[categoryId];
|
|
875
|
+
if (category) {
|
|
876
|
+
categories.push(category);
|
|
877
|
+
} else {
|
|
878
|
+
console.warn("selectCategoryByIds: No category exists with the id", categoryId);
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
return categories;
|
|
882
|
+
}
|
|
869
883
|
)
|
|
870
884
|
);
|
|
871
|
-
const
|
|
885
|
+
const selectCategoriesOfWorkspace = restructureCreateSelectorWithArgs(
|
|
872
886
|
toolkit.createSelector(
|
|
873
|
-
[
|
|
874
|
-
(
|
|
887
|
+
[selectCategories, (_state, workspaceId) => workspaceId],
|
|
888
|
+
(categories, workspaceId) => categories.filter((category) => category.workspace === workspaceId)
|
|
875
889
|
)
|
|
876
890
|
);
|
|
877
891
|
const selectIssueCountOfCategory = (categoryId) => (state) => {
|
|
878
892
|
return Object.values(state.issueReducer.instances).filter((issue) => issue.category === categoryId).length;
|
|
879
893
|
};
|
|
880
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;
|
|
881
984
|
const assetTypeAdapter = createModelAdapter((assetType) => assetType.offline_id);
|
|
882
|
-
const initialState$
|
|
985
|
+
const initialState$y = assetTypeAdapter.getInitialState({});
|
|
883
986
|
const assetTypeSlice = toolkit.createSlice({
|
|
884
987
|
name: "assetTypes",
|
|
885
|
-
initialState: initialState$
|
|
886
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
988
|
+
initialState: initialState$y,
|
|
989
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$y)),
|
|
887
990
|
reducers: {
|
|
888
991
|
initializeAssetTypes: assetTypeAdapter.initialize,
|
|
889
992
|
addAssetType: assetTypeAdapter.addOne,
|
|
@@ -896,43 +999,33 @@ var __publicField = (obj, key, value) => {
|
|
|
896
999
|
[selectAssetTypesMapping],
|
|
897
1000
|
(mapping) => Object.values(mapping)
|
|
898
1001
|
);
|
|
899
|
-
const
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
)
|
|
904
|
-
);
|
|
905
|
-
const selectNumberOfAssetTypesMatchingCaseInsensitiveName = restructureCreateSelectorWithArgs(
|
|
1002
|
+
const selectAssetTypeId = (id) => (state) => {
|
|
1003
|
+
return state.assetTypeReducer.instances[id];
|
|
1004
|
+
};
|
|
1005
|
+
const selectAssetTypesByIds = restructureCreateSelectorWithArgs(
|
|
906
1006
|
toolkit.createSelector(
|
|
907
|
-
[
|
|
908
|
-
(
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
(
|
|
913
|
-
|
|
914
|
-
|
|
1007
|
+
[selectStageMapping, (_state, assetTypeIds) => assetTypeIds],
|
|
1008
|
+
(assetTypeMapping, assetTypeIds) => {
|
|
1009
|
+
const assetTypes = [];
|
|
1010
|
+
for (const stageId of assetTypeIds) {
|
|
1011
|
+
const stage = assetTypeMapping[stageId];
|
|
1012
|
+
if (stage) {
|
|
1013
|
+
assetTypes.push(stage);
|
|
1014
|
+
} else {
|
|
1015
|
+
console.warn("selectAssetTypesByIds: No stage exists with the id", stageId);
|
|
915
1016
|
}
|
|
916
|
-
|
|
1017
|
+
}
|
|
1018
|
+
return assetTypes;
|
|
917
1019
|
}
|
|
918
1020
|
)
|
|
919
1021
|
);
|
|
920
|
-
const selectAssetTypesByName = restructureCreateSelectorWithArgs(
|
|
921
|
-
toolkit.createSelector([selectAssetTypesMapping, (_state, name) => name], (mapping, name) => {
|
|
922
|
-
name = (name == null ? void 0 : name.toLowerCase()) ?? null;
|
|
923
|
-
return Object.values(mapping).filter((assetType) => {
|
|
924
|
-
var _a2;
|
|
925
|
-
return (((_a2 = assetType.name) == null ? void 0 : _a2.toLowerCase()) ?? null) === name;
|
|
926
|
-
});
|
|
927
|
-
})
|
|
928
|
-
);
|
|
929
1022
|
const assetTypeReducer = assetTypeSlice.reducer;
|
|
930
1023
|
const assetAdapter = createModelAdapter((asset) => asset.offline_id);
|
|
931
|
-
const initialState$
|
|
1024
|
+
const initialState$x = assetAdapter.getInitialState({});
|
|
932
1025
|
const assetSlice = toolkit.createSlice({
|
|
933
1026
|
name: "assets",
|
|
934
|
-
initialState: initialState$
|
|
935
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1027
|
+
initialState: initialState$x,
|
|
1028
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$x)),
|
|
936
1029
|
reducers: {
|
|
937
1030
|
initializeAssets: (state, action) => {
|
|
938
1031
|
assetAdapter.initialize(state, action);
|
|
@@ -996,9 +1089,20 @@ var __publicField = (obj, key, value) => {
|
|
|
996
1089
|
return components.filter((asset) => asset.asset_type === assetTypeId);
|
|
997
1090
|
})
|
|
998
1091
|
);
|
|
999
|
-
const
|
|
1092
|
+
const selectAssetById = (assetId) => (state) => {
|
|
1000
1093
|
return state.assetReducer.instances[assetId];
|
|
1001
1094
|
};
|
|
1095
|
+
const selectAssetsByIds = restructureCreateSelectorWithArgs(
|
|
1096
|
+
toolkit.createSelector([selectAssetsMapping, (_, assetIds) => assetIds], (assetsMapping, assetIds) => {
|
|
1097
|
+
const assets = [];
|
|
1098
|
+
for (const assetId of assetIds) {
|
|
1099
|
+
const asset = assetsMapping[assetId];
|
|
1100
|
+
if (asset)
|
|
1101
|
+
assets.push(asset);
|
|
1102
|
+
}
|
|
1103
|
+
return assets;
|
|
1104
|
+
})
|
|
1105
|
+
);
|
|
1002
1106
|
const selectAssetToAssetTypeMapping = toolkit.createSelector(
|
|
1003
1107
|
[selectAssets, selectAssetTypesMapping],
|
|
1004
1108
|
(assets, assetTypeMapping) => {
|
|
@@ -1035,11 +1139,11 @@ var __publicField = (obj, key, value) => {
|
|
|
1035
1139
|
};
|
|
1036
1140
|
const assetReducer = assetSlice.reducer;
|
|
1037
1141
|
const assetAttachmentAdapter = createModelAdapter((attachment) => attachment.offline_id);
|
|
1038
|
-
const initialState$
|
|
1142
|
+
const initialState$w = assetAttachmentAdapter.getInitialState({});
|
|
1039
1143
|
const assetAttachmentSlice = toolkit.createSlice({
|
|
1040
1144
|
name: "assetAttachments",
|
|
1041
|
-
initialState: initialState$
|
|
1042
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1145
|
+
initialState: initialState$w,
|
|
1146
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$w)),
|
|
1043
1147
|
reducers: {
|
|
1044
1148
|
initializeAssetAttachments: assetAttachmentAdapter.initialize,
|
|
1045
1149
|
addAssetAttachment: assetAttachmentAdapter.addOne,
|
|
@@ -1097,13 +1201,13 @@ var __publicField = (obj, key, value) => {
|
|
|
1097
1201
|
)
|
|
1098
1202
|
);
|
|
1099
1203
|
const assetAttachmentReducer = assetAttachmentSlice.reducer;
|
|
1100
|
-
const initialState$
|
|
1204
|
+
const initialState$v = {
|
|
1101
1205
|
completionsByAssetId: {}
|
|
1102
1206
|
};
|
|
1103
1207
|
const assetStageCompletionSlice = toolkit.createSlice({
|
|
1104
1208
|
name: "assetStageCompletions",
|
|
1105
|
-
initialState: initialState$
|
|
1106
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1209
|
+
initialState: initialState$v,
|
|
1210
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$v)),
|
|
1107
1211
|
reducers: {
|
|
1108
1212
|
addStageCompletion: (state, action) => {
|
|
1109
1213
|
let stageToCompletionDateMapping = state.completionsByAssetId[action.payload.asset];
|
|
@@ -1154,97 +1258,14 @@ var __publicField = (obj, key, value) => {
|
|
|
1154
1258
|
})
|
|
1155
1259
|
);
|
|
1156
1260
|
const assetStageCompletionReducer = assetStageCompletionSlice.reducer;
|
|
1157
|
-
const assetStageAdapter = createModelAdapter((assetStage) => assetStage.offline_id);
|
|
1158
|
-
const initialState$w = assetStageAdapter.getInitialState({});
|
|
1159
|
-
const assetStageSlice = toolkit.createSlice({
|
|
1160
|
-
name: "assetStages",
|
|
1161
|
-
initialState: initialState$w,
|
|
1162
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$w)),
|
|
1163
|
-
reducers: {
|
|
1164
|
-
initializeStages: assetStageAdapter.initialize,
|
|
1165
|
-
setStage: assetStageAdapter.setOne,
|
|
1166
|
-
addStages: assetStageAdapter.addMany,
|
|
1167
|
-
updateStage: assetStageAdapter.updateOne,
|
|
1168
|
-
updateStages: assetStageAdapter.updateMany,
|
|
1169
|
-
removeStages: assetStageAdapter.deleteMany
|
|
1170
|
-
}
|
|
1171
|
-
});
|
|
1172
|
-
const selectStageMapping = (state) => state.assetStageReducer.instances;
|
|
1173
|
-
const selectStage = restructureCreateSelectorWithArgs(
|
|
1174
|
-
toolkit.createSelector([selectStageMapping, (_state, stageId) => stageId], (stageMapping, stageId) => {
|
|
1175
|
-
return stageMapping[stageId];
|
|
1176
|
-
})
|
|
1177
|
-
);
|
|
1178
|
-
const selectStages = toolkit.createSelector(
|
|
1179
|
-
[selectStageMapping],
|
|
1180
|
-
(stageMapping) => {
|
|
1181
|
-
return Object.values(stageMapping);
|
|
1182
|
-
}
|
|
1183
|
-
);
|
|
1184
|
-
const selectStagesFromAssetTypeIds = restructureCreateSelectorWithArgs(
|
|
1185
|
-
toolkit.createSelector([selectStages, (_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([selectStages, (_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 selectStagesFromStageIds = restructureCreateSelectorWithArgs(
|
|
1219
|
-
toolkit.createSelector([selectStageMapping, (_state, stageIds) => stageIds], (stageMapping, stageIds) => {
|
|
1220
|
-
return stageIds.map((offline_id) => stageMapping[offline_id]).filter((stage) => !!stage);
|
|
1221
|
-
})
|
|
1222
|
-
);
|
|
1223
|
-
const selectStageFormIdsFromStageIds = restructureCreateSelectorWithArgs(
|
|
1224
|
-
toolkit.createSelector([selectStageMapping, (_state, stageIds) => stageIds], (stageMapping, stageIds) => {
|
|
1225
|
-
const ret = {};
|
|
1226
|
-
for (const stageId of stageIds) {
|
|
1227
|
-
const stage = stageMapping[stageId];
|
|
1228
|
-
if (!stage) {
|
|
1229
|
-
throw new Error("No stage exists with the id " + stageId);
|
|
1230
|
-
}
|
|
1231
|
-
if (stage.form) {
|
|
1232
|
-
ret[stageId] = stage.form;
|
|
1233
|
-
}
|
|
1234
|
-
}
|
|
1235
|
-
return ret;
|
|
1236
|
-
})
|
|
1237
|
-
);
|
|
1238
|
-
const { initializeStages, setStage, addStages, updateStages, removeStages, updateStage } = assetStageSlice.actions;
|
|
1239
|
-
const assetStageReducer = assetStageSlice.reducer;
|
|
1240
1261
|
const assetTypeAttachmentAdapter = createModelAdapter(
|
|
1241
1262
|
(attachment) => attachment.offline_id
|
|
1242
1263
|
);
|
|
1243
|
-
const initialState$
|
|
1264
|
+
const initialState$u = assetTypeAttachmentAdapter.getInitialState({});
|
|
1244
1265
|
const assetTypeAttachmentSlice = toolkit.createSlice({
|
|
1245
1266
|
name: "assetTypeAttachments",
|
|
1246
|
-
initialState: initialState$
|
|
1247
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1267
|
+
initialState: initialState$u,
|
|
1268
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$u)),
|
|
1248
1269
|
reducers: {
|
|
1249
1270
|
initializeAssetTypeAttachments: assetTypeAttachmentAdapter.initialize,
|
|
1250
1271
|
addAssetTypeAttachment: assetTypeAttachmentAdapter.addOne,
|
|
@@ -1303,10 +1324,10 @@ var __publicField = (obj, key, value) => {
|
|
|
1303
1324
|
);
|
|
1304
1325
|
const assetTypeAttachmentReducer = assetTypeAttachmentSlice.reducer;
|
|
1305
1326
|
const workspaceAdapter = createModelAdapter((workspace) => workspace.offline_id);
|
|
1306
|
-
const initialState$
|
|
1327
|
+
const initialState$t = workspaceAdapter.getInitialState({});
|
|
1307
1328
|
const workspaceSlice = toolkit.createSlice({
|
|
1308
1329
|
name: "workspace",
|
|
1309
|
-
initialState: initialState$
|
|
1330
|
+
initialState: initialState$t,
|
|
1310
1331
|
reducers: {
|
|
1311
1332
|
initializeWorkspaces: workspaceAdapter.initialize,
|
|
1312
1333
|
setWorkspaces: workspaceAdapter.setMany,
|
|
@@ -1338,14 +1359,14 @@ var __publicField = (obj, key, value) => {
|
|
|
1338
1359
|
const workspaceReducer = workspaceSlice.reducer;
|
|
1339
1360
|
const maxRecentIssues = 10;
|
|
1340
1361
|
const issueAdapter = createModelAdapter((issue) => issue.offline_id);
|
|
1341
|
-
const initialState$
|
|
1362
|
+
const initialState$s = issueAdapter.getInitialState({
|
|
1342
1363
|
recentIssueIds: []
|
|
1343
1364
|
});
|
|
1344
1365
|
const issueSlice = toolkit.createSlice({
|
|
1345
1366
|
name: "issues",
|
|
1346
|
-
initialState: initialState$
|
|
1367
|
+
initialState: initialState$s,
|
|
1347
1368
|
extraReducers: (builder) => builder.addCase("RESET", (state) => {
|
|
1348
|
-
Object.assign(state, initialState$
|
|
1369
|
+
Object.assign(state, initialState$s);
|
|
1349
1370
|
}),
|
|
1350
1371
|
reducers: {
|
|
1351
1372
|
initializeIssues: issueAdapter.initialize,
|
|
@@ -1393,11 +1414,9 @@ var __publicField = (obj, key, value) => {
|
|
|
1393
1414
|
} = issueSlice.actions;
|
|
1394
1415
|
const selectIssueMapping = (state) => state.issueReducer.instances;
|
|
1395
1416
|
const selectRecentIssueIds = (state) => state.issueReducer.recentIssueIds;
|
|
1396
|
-
const
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
})
|
|
1400
|
-
);
|
|
1417
|
+
const selectIssueById = (id) => (state) => {
|
|
1418
|
+
return state.issueReducer.instances[id];
|
|
1419
|
+
};
|
|
1401
1420
|
const searchIssues = restructureCreateSelectorWithArgs(
|
|
1402
1421
|
toolkit.createSelector(
|
|
1403
1422
|
[selectIssueMapping, selectWorkspaceMapping, (_state, searchArgs) => searchArgs],
|
|
@@ -1453,6 +1472,20 @@ var __publicField = (obj, key, value) => {
|
|
|
1453
1472
|
}
|
|
1454
1473
|
)
|
|
1455
1474
|
);
|
|
1475
|
+
const selectIssuesByIds = restructureCreateSelectorWithArgs(
|
|
1476
|
+
toolkit.createSelector([selectIssueMapping, (_, issueIds) => issueIds], (issuesMapping, issueIds) => {
|
|
1477
|
+
const issues = [];
|
|
1478
|
+
for (const issueId of issueIds) {
|
|
1479
|
+
const issue = issuesMapping[issueId];
|
|
1480
|
+
if (issue) {
|
|
1481
|
+
issues.push(issue);
|
|
1482
|
+
} else {
|
|
1483
|
+
console.warn("selectIssuesByIds: No issue exists with the id", issueId);
|
|
1484
|
+
}
|
|
1485
|
+
}
|
|
1486
|
+
return issues;
|
|
1487
|
+
})
|
|
1488
|
+
);
|
|
1456
1489
|
const selectRecentIssuesAsSearchResults = toolkit.createSelector(
|
|
1457
1490
|
[selectIssueMapping, selectRecentIssueIds, selectWorkspaceMapping],
|
|
1458
1491
|
(issueMapping, recentIssueIds, workspaceMapping) => {
|
|
@@ -1489,12 +1522,12 @@ var __publicField = (obj, key, value) => {
|
|
|
1489
1522
|
);
|
|
1490
1523
|
const issueReducer = issueSlice.reducer;
|
|
1491
1524
|
const issueTypeAdapter = createModelAdapter((issueType) => issueType.offline_id);
|
|
1492
|
-
const initialState$
|
|
1525
|
+
const initialState$r = issueTypeAdapter.getInitialState({});
|
|
1493
1526
|
const issueTypeSlice = toolkit.createSlice({
|
|
1494
1527
|
name: "issueTypes",
|
|
1495
|
-
initialState: initialState$
|
|
1528
|
+
initialState: initialState$r,
|
|
1496
1529
|
extraReducers: (builder) => builder.addCase("RESET", (state) => {
|
|
1497
|
-
Object.assign(state, initialState$
|
|
1530
|
+
Object.assign(state, initialState$r);
|
|
1498
1531
|
}),
|
|
1499
1532
|
reducers: {
|
|
1500
1533
|
initializeIssueTypes: issueTypeAdapter.initialize,
|
|
@@ -1514,14 +1547,21 @@ var __publicField = (obj, key, value) => {
|
|
|
1514
1547
|
return Object.values(issueTypes);
|
|
1515
1548
|
}
|
|
1516
1549
|
);
|
|
1517
|
-
const
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1550
|
+
const selectIssueTypeById = (issueTypeId) => (state) => {
|
|
1551
|
+
return state.issueTypeReducer.instances[issueTypeId];
|
|
1552
|
+
};
|
|
1553
|
+
const selectIssueTypesByIds = (issueTypeIds) => (state) => {
|
|
1554
|
+
const issueTypes = [];
|
|
1555
|
+
for (const issueTypeId of issueTypeIds) {
|
|
1556
|
+
const issueType = state.issueTypeReducer.instances[issueTypeId];
|
|
1557
|
+
if (issueType) {
|
|
1558
|
+
issueTypes.push(issueType);
|
|
1559
|
+
} else {
|
|
1560
|
+
console.warn("selectIssueTypesByIds: No issue type exists with the id", issueTypeId);
|
|
1522
1561
|
}
|
|
1523
|
-
|
|
1524
|
-
|
|
1562
|
+
}
|
|
1563
|
+
return issueTypes;
|
|
1564
|
+
};
|
|
1525
1565
|
const selectIssueTypesOfOrganization = restructureCreateSelectorWithArgs(
|
|
1526
1566
|
toolkit.createSelector(
|
|
1527
1567
|
[selectIssueTypes, (_, organizationId) => organizationId],
|
|
@@ -1543,15 +1583,15 @@ var __publicField = (obj, key, value) => {
|
|
|
1543
1583
|
return ((_a2 = selectIssuesOfIssueType(issueTypeId)(state)) == null ? void 0 : _a2.length) ?? 0;
|
|
1544
1584
|
};
|
|
1545
1585
|
const issueTypeReducer = issueTypeSlice.reducer;
|
|
1546
|
-
const initialState$
|
|
1586
|
+
const initialState$q = {
|
|
1547
1587
|
s3Urls: {}
|
|
1548
1588
|
};
|
|
1549
1589
|
const msPerHour = 1e3 * 60 * 60;
|
|
1550
1590
|
const msPerWeek = msPerHour * 24 * 7;
|
|
1551
1591
|
const fileSlice = toolkit.createSlice({
|
|
1552
1592
|
name: "file",
|
|
1553
|
-
initialState: initialState$
|
|
1554
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1593
|
+
initialState: initialState$q,
|
|
1594
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$q)),
|
|
1555
1595
|
reducers: {
|
|
1556
1596
|
setUploadUrl: (state, action) => {
|
|
1557
1597
|
const { url, fields, sha1 } = action.payload;
|
|
@@ -1632,7 +1672,7 @@ var __publicField = (obj, key, value) => {
|
|
|
1632
1672
|
LicenseStatus2[LicenseStatus2["PAST_DUE"] = 8] = "PAST_DUE";
|
|
1633
1673
|
return LicenseStatus2;
|
|
1634
1674
|
})(LicenseStatus || {});
|
|
1635
|
-
const initialState$
|
|
1675
|
+
const initialState$p = {
|
|
1636
1676
|
users: {},
|
|
1637
1677
|
currentUser: {
|
|
1638
1678
|
id: 0,
|
|
@@ -1643,8 +1683,8 @@ var __publicField = (obj, key, value) => {
|
|
|
1643
1683
|
};
|
|
1644
1684
|
const userSlice = toolkit.createSlice({
|
|
1645
1685
|
name: "users",
|
|
1646
|
-
initialState: initialState$
|
|
1647
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1686
|
+
initialState: initialState$p,
|
|
1687
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$p)),
|
|
1648
1688
|
reducers: {
|
|
1649
1689
|
setUsers: (state, action) => {
|
|
1650
1690
|
const usersMapping = {};
|
|
@@ -1697,23 +1737,40 @@ var __publicField = (obj, key, value) => {
|
|
|
1697
1737
|
setTourStep,
|
|
1698
1738
|
removeUser
|
|
1699
1739
|
} = userSlice.actions;
|
|
1740
|
+
const userReducer = userSlice.reducer;
|
|
1700
1741
|
const selectCurrentUser = (state) => state.userReducer.currentUser;
|
|
1742
|
+
const selectUsersMapping = (state) => state.userReducer.users;
|
|
1701
1743
|
const selectUser = (userId) => (state) => {
|
|
1702
1744
|
if (userId === null)
|
|
1703
1745
|
return void 0;
|
|
1704
1746
|
return state.userReducer.users[userId];
|
|
1705
1747
|
};
|
|
1706
|
-
const
|
|
1748
|
+
const selectUserById = (userId) => (state) => {
|
|
1749
|
+
return state.userReducer.users[userId];
|
|
1750
|
+
};
|
|
1751
|
+
const selectUsersByIds = restructureCreateSelectorWithArgs(
|
|
1752
|
+
toolkit.createSelector([selectUsersMapping, (_state, userIds) => userIds], (usersMapping, userIds) => {
|
|
1753
|
+
const users = [];
|
|
1754
|
+
for (const userId of userIds) {
|
|
1755
|
+
const user = usersMapping[userId];
|
|
1756
|
+
if (user) {
|
|
1757
|
+
users.push(user);
|
|
1758
|
+
} else {
|
|
1759
|
+
console.warn("selectUsersByIds: No user exists with the id", userId);
|
|
1760
|
+
}
|
|
1761
|
+
}
|
|
1762
|
+
return users;
|
|
1763
|
+
})
|
|
1764
|
+
);
|
|
1707
1765
|
const selectFavouriteProjects = (state) => state.userReducer.currentUser.profile.favourite_project_ids;
|
|
1708
|
-
const userReducer = userSlice.reducer;
|
|
1709
1766
|
const organizationAccessAdapter = createModelAdapter(
|
|
1710
1767
|
(organizationAccess) => organizationAccess.offline_id
|
|
1711
1768
|
);
|
|
1712
|
-
const initialState$
|
|
1769
|
+
const initialState$o = organizationAccessAdapter.getInitialState({});
|
|
1713
1770
|
const organizationAccessSlice = toolkit.createSlice({
|
|
1714
1771
|
name: "organizationAccess",
|
|
1715
|
-
initialState: initialState$
|
|
1716
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1772
|
+
initialState: initialState$o,
|
|
1773
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$o)),
|
|
1717
1774
|
reducers: {
|
|
1718
1775
|
initializeOrganizationAccesses: organizationAccessAdapter.initialize,
|
|
1719
1776
|
updateOrganizationAccess: organizationAccessAdapter.updateOne,
|
|
@@ -1750,11 +1807,11 @@ var __publicField = (obj, key, value) => {
|
|
|
1750
1807
|
};
|
|
1751
1808
|
const organizationAccessReducer = organizationAccessSlice.reducer;
|
|
1752
1809
|
const licenseAdapter = createModelAdapter((license) => license.offline_id);
|
|
1753
|
-
const initialState$
|
|
1810
|
+
const initialState$n = licenseAdapter.getInitialState({});
|
|
1754
1811
|
const licenseSlice = toolkit.createSlice({
|
|
1755
1812
|
name: "license",
|
|
1756
|
-
initialState: initialState$
|
|
1757
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1813
|
+
initialState: initialState$n,
|
|
1814
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$n)),
|
|
1758
1815
|
reducers: {
|
|
1759
1816
|
initializeLicences: licenseAdapter.initialize,
|
|
1760
1817
|
addLicenses: licenseAdapter.addMany,
|
|
@@ -1780,11 +1837,11 @@ var __publicField = (obj, key, value) => {
|
|
|
1780
1837
|
);
|
|
1781
1838
|
const licenseReducer = licenseSlice.reducer;
|
|
1782
1839
|
const projectAccessAdapter = createModelAdapter((projectAccess) => projectAccess.offline_id);
|
|
1783
|
-
const initialState$
|
|
1840
|
+
const initialState$m = projectAccessAdapter.getInitialState({});
|
|
1784
1841
|
const projectAccessSlice = toolkit.createSlice({
|
|
1785
1842
|
name: "projectAccess",
|
|
1786
|
-
initialState: initialState$
|
|
1787
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1843
|
+
initialState: initialState$m,
|
|
1844
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$m)),
|
|
1788
1845
|
reducers: {
|
|
1789
1846
|
initializeProjectAccesses: projectAccessAdapter.initialize,
|
|
1790
1847
|
updateProjectAccess: projectAccessAdapter.updateOne,
|
|
@@ -1802,14 +1859,9 @@ var __publicField = (obj, key, value) => {
|
|
|
1802
1859
|
return Object.values(projectAccesses);
|
|
1803
1860
|
}
|
|
1804
1861
|
);
|
|
1805
|
-
const
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
(projectAccesses, projectAccessId) => {
|
|
1809
|
-
return projectAccesses[projectAccessId];
|
|
1810
|
-
}
|
|
1811
|
-
)
|
|
1812
|
-
);
|
|
1862
|
+
const selectProjectAccessById = (projectAccessId) => (state) => {
|
|
1863
|
+
return state.projectAccessReducer.instances[projectAccessId];
|
|
1864
|
+
};
|
|
1813
1865
|
const selectActiveProjectAccess = (state) => {
|
|
1814
1866
|
const currentUser = state.userReducer.currentUser;
|
|
1815
1867
|
const activeProjectId = state.projectReducer.activeProjectId;
|
|
@@ -1830,14 +1882,14 @@ var __publicField = (obj, key, value) => {
|
|
|
1830
1882
|
return projectAccesses;
|
|
1831
1883
|
};
|
|
1832
1884
|
const projectAccessReducer = projectAccessSlice.reducer;
|
|
1833
|
-
const initialState$
|
|
1885
|
+
const initialState$l = {
|
|
1834
1886
|
projects: {},
|
|
1835
1887
|
activeProjectId: null
|
|
1836
1888
|
};
|
|
1837
1889
|
const projectSlice = toolkit.createSlice({
|
|
1838
1890
|
name: "projects",
|
|
1839
|
-
initialState: initialState$
|
|
1840
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1891
|
+
initialState: initialState$l,
|
|
1892
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$l)),
|
|
1841
1893
|
reducers: {
|
|
1842
1894
|
setProjects: (state, action) => {
|
|
1843
1895
|
const projectsMap = {};
|
|
@@ -1902,6 +1954,7 @@ var __publicField = (obj, key, value) => {
|
|
|
1902
1954
|
addActiveProjectIssuesCount,
|
|
1903
1955
|
addActiveProjectFormSubmissionsCount
|
|
1904
1956
|
} = projectSlice.actions;
|
|
1957
|
+
const projectReducer = projectSlice.reducer;
|
|
1905
1958
|
const selectProjects = (state) => state.projectReducer.projects;
|
|
1906
1959
|
const selectActiveProjectId = (state) => state.projectReducer.activeProjectId;
|
|
1907
1960
|
const selectActiveProject = (state) => {
|
|
@@ -1911,19 +1964,15 @@ var __publicField = (obj, key, value) => {
|
|
|
1911
1964
|
}
|
|
1912
1965
|
return state.projectReducer.projects[activeProjectId] ?? null;
|
|
1913
1966
|
};
|
|
1914
|
-
const
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
(projects, projectId) => projects[projectId]
|
|
1918
|
-
)
|
|
1919
|
-
);
|
|
1920
|
-
const projectReducer = projectSlice.reducer;
|
|
1967
|
+
const selectProjectById = (projectId) => (state) => {
|
|
1968
|
+
return state.projectReducer.projects[projectId];
|
|
1969
|
+
};
|
|
1921
1970
|
const selectProjectUsersIds = toolkit.createSelector(
|
|
1922
1971
|
[selectProjectAccessMapping],
|
|
1923
1972
|
(projectAccesses) => Object.values(projectAccesses).map((projectAccess) => projectAccess.user)
|
|
1924
1973
|
);
|
|
1925
1974
|
const selectProjectUsersAsMapping = toolkit.createSelector(
|
|
1926
|
-
[selectProjectUsersIds,
|
|
1975
|
+
[selectProjectUsersIds, selectUsersMapping],
|
|
1927
1976
|
(projectUserIds, users) => projectUserIds.reduce((accum, userId) => ({ ...accum, [userId]: users[userId] }), {})
|
|
1928
1977
|
);
|
|
1929
1978
|
const selectProjectsWithAccess = toolkit.createSelector(
|
|
@@ -1951,13 +2000,13 @@ var __publicField = (obj, key, value) => {
|
|
|
1951
2000
|
});
|
|
1952
2001
|
}
|
|
1953
2002
|
);
|
|
1954
|
-
const initialState$
|
|
2003
|
+
const initialState$k = {
|
|
1955
2004
|
organizations: {}
|
|
1956
2005
|
};
|
|
1957
2006
|
const organizationSlice = toolkit.createSlice({
|
|
1958
2007
|
name: "organizations",
|
|
1959
|
-
initialState: initialState$
|
|
1960
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2008
|
+
initialState: initialState$k,
|
|
2009
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$k)),
|
|
1961
2010
|
reducers: {
|
|
1962
2011
|
setOrganizations: (state, action) => {
|
|
1963
2012
|
for (const org of action.payload) {
|
|
@@ -1995,7 +2044,7 @@ var __publicField = (obj, key, value) => {
|
|
|
1995
2044
|
})
|
|
1996
2045
|
);
|
|
1997
2046
|
const selectOrganizationUsersAsMapping = toolkit.createSelector(
|
|
1998
|
-
[selectOrganizationUsersIds,
|
|
2047
|
+
[selectOrganizationUsersIds, selectUsersMapping],
|
|
1999
2048
|
(organizationUserIds, users) => organizationUserIds.reduce((accum, userId) => ({ ...accum, [userId]: users[userId] }), {})
|
|
2000
2049
|
);
|
|
2001
2050
|
const selectSortedOrganizationUsers = toolkit.createSelector(
|
|
@@ -2040,14 +2089,14 @@ var __publicField = (obj, key, value) => {
|
|
|
2040
2089
|
}
|
|
2041
2090
|
};
|
|
2042
2091
|
};
|
|
2043
|
-
const initialState$
|
|
2092
|
+
const initialState$j = {
|
|
2044
2093
|
deletedRequests: [],
|
|
2045
2094
|
latestRetryTime: 0
|
|
2046
2095
|
};
|
|
2047
2096
|
const outboxSlice = toolkit.createSlice({
|
|
2048
2097
|
name: "outbox",
|
|
2049
|
-
initialState: initialState$
|
|
2050
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2098
|
+
initialState: initialState$j,
|
|
2099
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$j)),
|
|
2051
2100
|
reducers: {
|
|
2052
2101
|
// enqueueActions is a reducer that does nothing but enqueue API request to the Redux Offline outbox
|
|
2053
2102
|
// Whenever an issue is being created, a reducer addIssue() is responsible for adding it to the offline store
|
|
@@ -2079,15 +2128,15 @@ var __publicField = (obj, key, value) => {
|
|
|
2079
2128
|
const selectLatestRetryTime = (state) => state.outboxReducer.latestRetryTime;
|
|
2080
2129
|
const { enqueueRequest, markForDeletion, markAsDeleted, _setLatestRetryTime } = outboxSlice.actions;
|
|
2081
2130
|
const outboxReducer = outboxSlice.reducer;
|
|
2082
|
-
const initialState$
|
|
2131
|
+
const initialState$i = {
|
|
2083
2132
|
projectFiles: {},
|
|
2084
2133
|
activeProjectFileId: null,
|
|
2085
2134
|
isImportingProjectFile: false
|
|
2086
2135
|
};
|
|
2087
2136
|
const projectFileSlice = toolkit.createSlice({
|
|
2088
2137
|
name: "projectFiles",
|
|
2089
|
-
initialState: initialState$
|
|
2090
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2138
|
+
initialState: initialState$i,
|
|
2139
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$i)),
|
|
2091
2140
|
reducers: {
|
|
2092
2141
|
addOrReplaceProjectFiles: (state, action) => {
|
|
2093
2142
|
for (let fileObj of action.payload) {
|
|
@@ -2172,11 +2221,11 @@ var __publicField = (obj, key, value) => {
|
|
|
2172
2221
|
};
|
|
2173
2222
|
const projectFileReducer = projectFileSlice.reducer;
|
|
2174
2223
|
const projectAttachmentAdapter = createModelAdapter((attachment) => attachment.offline_id);
|
|
2175
|
-
const initialState$
|
|
2224
|
+
const initialState$h = projectAttachmentAdapter.getInitialState({});
|
|
2176
2225
|
const projectAttachmentSlice = toolkit.createSlice({
|
|
2177
2226
|
name: "projectAttachments",
|
|
2178
|
-
initialState: initialState$
|
|
2179
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2227
|
+
initialState: initialState$h,
|
|
2228
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$h)),
|
|
2180
2229
|
reducers: {
|
|
2181
2230
|
initializeProjectAttachments: projectAttachmentAdapter.initialize,
|
|
2182
2231
|
addProjectAttachment: projectAttachmentAdapter.addOne,
|
|
@@ -2234,12 +2283,12 @@ var __publicField = (obj, key, value) => {
|
|
|
2234
2283
|
)
|
|
2235
2284
|
);
|
|
2236
2285
|
const projectAttachmentReducer = projectAttachmentSlice.reducer;
|
|
2237
|
-
const initialState$
|
|
2286
|
+
const initialState$g = {
|
|
2238
2287
|
isRehydrated: false
|
|
2239
2288
|
};
|
|
2240
2289
|
const rehydratedSlice = toolkit.createSlice({
|
|
2241
2290
|
name: "rehydrated",
|
|
2242
|
-
initialState: initialState$
|
|
2291
|
+
initialState: initialState$g,
|
|
2243
2292
|
// The `reducers` field lets us define reducers and generate associated actions
|
|
2244
2293
|
reducers: {
|
|
2245
2294
|
setRehydrated: (state, action) => {
|
|
@@ -2250,22 +2299,6 @@ var __publicField = (obj, key, value) => {
|
|
|
2250
2299
|
const { setRehydrated } = rehydratedSlice.actions;
|
|
2251
2300
|
const selectRehydrated = (state) => state.rehydratedReducer.isRehydrated;
|
|
2252
2301
|
const rehydratedReducer = rehydratedSlice.reducer;
|
|
2253
|
-
const initialState$g = {
|
|
2254
|
-
isFetchingInitialData: false
|
|
2255
|
-
};
|
|
2256
|
-
const settingSlice = toolkit.createSlice({
|
|
2257
|
-
name: "settings",
|
|
2258
|
-
initialState: initialState$g,
|
|
2259
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$g)),
|
|
2260
|
-
reducers: {
|
|
2261
|
-
setIsFetchingInitialData: (state, action) => {
|
|
2262
|
-
state.isFetchingInitialData = action.payload;
|
|
2263
|
-
}
|
|
2264
|
-
}
|
|
2265
|
-
});
|
|
2266
|
-
const { setIsFetchingInitialData } = settingSlice.actions;
|
|
2267
|
-
const settingReducer = settingSlice.reducer;
|
|
2268
|
-
const selectIsFetchingInitialData = (state) => state.settingReducer.isFetchingInitialData;
|
|
2269
2302
|
const formRevisionSortFn = (formRevisionA, formRevisionB) => {
|
|
2270
2303
|
const revisionA = formRevisionA.revision;
|
|
2271
2304
|
const revisionB = formRevisionB.revision;
|
|
@@ -2307,7 +2340,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2307
2340
|
[selectFormRevisionMapping],
|
|
2308
2341
|
(formRevisions) => Object.values(formRevisions)
|
|
2309
2342
|
);
|
|
2310
|
-
const
|
|
2343
|
+
const selectFormRevisionId = (formRevisionId) => (state) => {
|
|
2311
2344
|
return state.formRevisionReducer.instances[formRevisionId];
|
|
2312
2345
|
};
|
|
2313
2346
|
const _selectLatestFormRevision = (formRevisions, formId) => {
|
|
@@ -2438,12 +2471,12 @@ var __publicField = (obj, key, value) => {
|
|
|
2438
2471
|
{ memoizeOptions: { equalityCheck: shallowEqual } }
|
|
2439
2472
|
)
|
|
2440
2473
|
);
|
|
2441
|
-
const selectForm = (formId) => (state) => {
|
|
2442
|
-
return state.formReducer.instances[formId];
|
|
2443
|
-
};
|
|
2444
2474
|
const selectFormMapping = (state) => {
|
|
2445
2475
|
return state.formReducer.instances;
|
|
2446
2476
|
};
|
|
2477
|
+
const selectFormById = (formId) => (state) => {
|
|
2478
|
+
return state.formReducer.instances[formId];
|
|
2479
|
+
};
|
|
2447
2480
|
const selectFormOfAssetType = restructureCreateSelectorWithArgs(
|
|
2448
2481
|
toolkit.createSelector(
|
|
2449
2482
|
[selectFormMapping, (_state, assetTypeId) => assetTypeId],
|
|
@@ -2505,7 +2538,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2505
2538
|
return Object.values(submissions);
|
|
2506
2539
|
}
|
|
2507
2540
|
);
|
|
2508
|
-
const
|
|
2541
|
+
const selectFormSubmissionById = (submissionId) => (state) => {
|
|
2509
2542
|
return state.formSubmissionReducer.instances[submissionId];
|
|
2510
2543
|
};
|
|
2511
2544
|
const selectFormSubmissionsOfForm = restructureCreateSelectorWithArgs(
|
|
@@ -2711,6 +2744,15 @@ var __publicField = (obj, key, value) => {
|
|
|
2711
2744
|
const selectFormSubmissionAttachmentsMapping = (state) => {
|
|
2712
2745
|
return state.formSubmissionAttachmentReducer.instances;
|
|
2713
2746
|
};
|
|
2747
|
+
const selectFormSubmissionAttachemntsByIds = restructureCreateSelectorWithArgs(
|
|
2748
|
+
toolkit.createSelector(
|
|
2749
|
+
[selectFormSubmissionAttachmentsMapping, (_, attachmentIds) => attachmentIds],
|
|
2750
|
+
(mapping, attachmentIds) => {
|
|
2751
|
+
const attachmentIdsSet = new Set(attachmentIds);
|
|
2752
|
+
return Object.values(mapping).filter((attachment) => attachmentIdsSet.has(attachment.offline_id));
|
|
2753
|
+
}
|
|
2754
|
+
)
|
|
2755
|
+
);
|
|
2714
2756
|
const selectAttachmentsOfFormSubmission = restructureCreateSelectorWithArgs(
|
|
2715
2757
|
toolkit.createSelector(
|
|
2716
2758
|
[selectFormSubmissionAttachmentsMapping, (_state, submissionId) => submissionId],
|
|
@@ -2942,10 +2984,24 @@ var __publicField = (obj, key, value) => {
|
|
|
2942
2984
|
[selectDocumentsMapping],
|
|
2943
2985
|
(mapping) => Object.values(mapping)
|
|
2944
2986
|
);
|
|
2945
|
-
const
|
|
2987
|
+
const selectDocumentById = (documentId) => (state) => {
|
|
2988
|
+
return state.documentsReducer.documents[documentId];
|
|
2989
|
+
};
|
|
2990
|
+
const selectDocumentsByIds = restructureCreateSelectorWithArgs(
|
|
2946
2991
|
toolkit.createSelector(
|
|
2947
|
-
[selectDocumentsMapping, (_state,
|
|
2948
|
-
(mapping,
|
|
2992
|
+
[selectDocumentsMapping, (_state, documentIds) => documentIds],
|
|
2993
|
+
(mapping, documentIds) => {
|
|
2994
|
+
const documents = [];
|
|
2995
|
+
for (const documentId of documentIds) {
|
|
2996
|
+
const document2 = mapping[documentId];
|
|
2997
|
+
if (document2) {
|
|
2998
|
+
documents.push(document2);
|
|
2999
|
+
} else {
|
|
3000
|
+
console.warn("selectDocumentByIds: No document exists with the id", documentId);
|
|
3001
|
+
}
|
|
3002
|
+
}
|
|
3003
|
+
return documents;
|
|
3004
|
+
}
|
|
2949
3005
|
)
|
|
2950
3006
|
);
|
|
2951
3007
|
const selectAncestorIdsOfDocument = restructureCreateSelectorWithArgs(
|
|
@@ -3049,7 +3105,7 @@ var __publicField = (obj, key, value) => {
|
|
|
3049
3105
|
const selectTeams = toolkit.createSelector([selectTeamsMapping], (teams) => {
|
|
3050
3106
|
return Object.values(teams);
|
|
3051
3107
|
});
|
|
3052
|
-
const
|
|
3108
|
+
const selectTeamById = (teamId) => (state) => {
|
|
3053
3109
|
return state.teamReducer.instances[teamId];
|
|
3054
3110
|
};
|
|
3055
3111
|
const selectTeamsOfOrganization = restructureCreateSelectorWithArgs(
|
|
@@ -3306,6 +3362,9 @@ var __publicField = (obj, key, value) => {
|
|
|
3306
3362
|
deleteIssueAssociations
|
|
3307
3363
|
} = issueAssociationSlice.actions;
|
|
3308
3364
|
const selectIssueAssociationMapping = (state) => state.issueAssociationReducer.instances;
|
|
3365
|
+
const selectIssueAssociations = toolkit.createSelector([selectIssueAssociationMapping], (associations) => {
|
|
3366
|
+
return Object.values(associations);
|
|
3367
|
+
});
|
|
3309
3368
|
const selectIssueAssociationById = (id) => (state) => {
|
|
3310
3369
|
return state.issueAssociationReducer.instances[id];
|
|
3311
3370
|
};
|
|
@@ -3390,7 +3449,6 @@ var __publicField = (obj, key, value) => {
|
|
|
3390
3449
|
organizationAccessReducer,
|
|
3391
3450
|
projectFileReducer,
|
|
3392
3451
|
rehydratedReducer,
|
|
3393
|
-
settingReducer,
|
|
3394
3452
|
formReducer,
|
|
3395
3453
|
formRevisionReducer,
|
|
3396
3454
|
formRevisionAttachmentReducer,
|
|
@@ -4199,7 +4257,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4199
4257
|
async remove(assetId) {
|
|
4200
4258
|
const { store } = this.client;
|
|
4201
4259
|
const state = store.getState();
|
|
4202
|
-
const assetToBeDeleted =
|
|
4260
|
+
const assetToBeDeleted = selectAssetById(assetId)(state);
|
|
4203
4261
|
if (!assetToBeDeleted)
|
|
4204
4262
|
throw new Error(`No asset with id ${assetId} found in the store`);
|
|
4205
4263
|
const attachmentsOfAssets = selectAttachmentsOfAsset(assetId)(state);
|
|
@@ -4315,7 +4373,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4315
4373
|
add(assetId, stageId) {
|
|
4316
4374
|
var _a2;
|
|
4317
4375
|
const { store } = this.client;
|
|
4318
|
-
const assetTypeId = (_a2 =
|
|
4376
|
+
const assetTypeId = (_a2 = selectAssetById(assetId)(store.getState())) == null ? void 0 : _a2.asset_type;
|
|
4319
4377
|
if (!assetTypeId) {
|
|
4320
4378
|
throw new Error(`Asset with offline_id ${assetId} not found`);
|
|
4321
4379
|
}
|
|
@@ -4421,12 +4479,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4421
4479
|
async bulkUpdateStages(stagesToUpdate, assetTypeId) {
|
|
4422
4480
|
const store = this.client.store;
|
|
4423
4481
|
const state = store.getState();
|
|
4424
|
-
const prevStages =
|
|
4425
|
-
stagesToUpdate.map(({ offline_id }) => offline_id)
|
|
4426
|
-
)(state);
|
|
4427
|
-
if (!prevStages) {
|
|
4428
|
-
throw new Error("Could not find the desired stages to update within the store");
|
|
4429
|
-
}
|
|
4482
|
+
const prevStages = selectAssetStagesByIds(stagesToUpdate.map(({ offline_id }) => offline_id))(state);
|
|
4430
4483
|
this.dispatch(updateStages(stagesToUpdate));
|
|
4431
4484
|
return this.enqueueRequest({
|
|
4432
4485
|
description: "Edit asset stages",
|
|
@@ -4749,7 +4802,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4749
4802
|
async delete(assetTypeId) {
|
|
4750
4803
|
const { store } = this.client;
|
|
4751
4804
|
const state = store.getState();
|
|
4752
|
-
const assetType =
|
|
4805
|
+
const assetType = selectAssetTypeId(assetTypeId)(state);
|
|
4753
4806
|
if (!assetType) {
|
|
4754
4807
|
throw new Error(`Expected asset type with offline_id ${assetTypeId} to exist`);
|
|
4755
4808
|
}
|
|
@@ -5003,7 +5056,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5003
5056
|
}
|
|
5004
5057
|
update(issue) {
|
|
5005
5058
|
const state = this.client.store.getState();
|
|
5006
|
-
const issueToBeUpdated =
|
|
5059
|
+
const issueToBeUpdated = selectIssueById(issue.offline_id)(state);
|
|
5007
5060
|
if (!issueToBeUpdated) {
|
|
5008
5061
|
throw new Error(
|
|
5009
5062
|
`Attempting to update an issue with offline_id ${issue.offline_id} that doesn't exist in the store`
|
|
@@ -5097,7 +5150,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5097
5150
|
async remove(id) {
|
|
5098
5151
|
const { store } = this.client;
|
|
5099
5152
|
const state = store.getState();
|
|
5100
|
-
const backup =
|
|
5153
|
+
const backup = selectIssueById(id)(state);
|
|
5101
5154
|
if (!backup) {
|
|
5102
5155
|
throw new Error(`No issue with id ${id} found in the store`);
|
|
5103
5156
|
}
|
|
@@ -5178,7 +5231,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5178
5231
|
offline_id: offlineIssueType.offline_id,
|
|
5179
5232
|
submitted_at: offlineIssueType.submitted_at,
|
|
5180
5233
|
icon: offlineIssueType.icon,
|
|
5181
|
-
|
|
5234
|
+
color: offlineIssueType.color,
|
|
5182
5235
|
name: offlineIssueType.name,
|
|
5183
5236
|
description: offlineIssueType.description
|
|
5184
5237
|
},
|
|
@@ -5192,24 +5245,24 @@ var __publicField = (obj, key, value) => {
|
|
|
5192
5245
|
});
|
|
5193
5246
|
return [offlineIssueType, promise];
|
|
5194
5247
|
}
|
|
5195
|
-
update(
|
|
5248
|
+
update(payload) {
|
|
5196
5249
|
const { store } = this.client;
|
|
5197
5250
|
const state = store.getState();
|
|
5198
|
-
const issueTypeToBeUpdated =
|
|
5251
|
+
const issueTypeToBeUpdated = selectIssueTypeById(payload.offline_id)(state);
|
|
5199
5252
|
if (!issueTypeToBeUpdated) {
|
|
5200
|
-
throw new Error(`IssueType with offline_id ${
|
|
5253
|
+
throw new Error(`IssueType with offline_id ${payload.offline_id} does not exist in the store.`);
|
|
5201
5254
|
}
|
|
5202
5255
|
const offlineUpdatedIssueType = {
|
|
5203
5256
|
...issueTypeToBeUpdated,
|
|
5204
|
-
...
|
|
5257
|
+
...payload
|
|
5205
5258
|
};
|
|
5206
5259
|
this.dispatch(updateIssueType(offlineUpdatedIssueType));
|
|
5207
5260
|
const promise = this.enqueueRequest({
|
|
5208
5261
|
method: HttpMethod.PATCH,
|
|
5209
|
-
url: `/issues/types/${
|
|
5210
|
-
payload
|
|
5211
|
-
blockers: [
|
|
5212
|
-
blocks: [
|
|
5262
|
+
url: `/issues/types/${payload.offline_id}/`,
|
|
5263
|
+
payload,
|
|
5264
|
+
blockers: [payload.offline_id],
|
|
5265
|
+
blocks: [payload.offline_id]
|
|
5213
5266
|
});
|
|
5214
5267
|
promise.then((updatedIssueType) => {
|
|
5215
5268
|
this.dispatch(setIssueType(updatedIssueType));
|
|
@@ -5221,7 +5274,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5221
5274
|
delete(issueTypeId) {
|
|
5222
5275
|
const { store } = this.client;
|
|
5223
5276
|
const state = store.getState();
|
|
5224
|
-
const issueTypeToDelete =
|
|
5277
|
+
const issueTypeToDelete = selectIssueTypeById(issueTypeId)(state);
|
|
5225
5278
|
if (!issueTypeToDelete) {
|
|
5226
5279
|
throw new Error(`IssueType with offline_id ${issueTypeId} does not exist in the store.`);
|
|
5227
5280
|
}
|
|
@@ -5812,7 +5865,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5812
5865
|
async delete(formId) {
|
|
5813
5866
|
const { store } = this.client;
|
|
5814
5867
|
const state = store.getState();
|
|
5815
|
-
const form =
|
|
5868
|
+
const form = selectFormById(formId)(state);
|
|
5816
5869
|
if (!form) {
|
|
5817
5870
|
throw new Error("Expected form to exist");
|
|
5818
5871
|
}
|
|
@@ -5989,6 +6042,25 @@ var __publicField = (obj, key, value) => {
|
|
|
5989
6042
|
});
|
|
5990
6043
|
return [offlineFormSubmissionAttachments, promise.then(({ attachments }) => attachments)];
|
|
5991
6044
|
}
|
|
6045
|
+
async bulkDeleteSubmissionAttachments(submissionId, attachmentsIds) {
|
|
6046
|
+
const { store } = this.client;
|
|
6047
|
+
const state = store.getState();
|
|
6048
|
+
const formSubmissionAttachments = selectFormSubmissionAttachemntsByIds(attachmentsIds)(state);
|
|
6049
|
+
this.dispatch(deleteFormSubmissionAttachments(attachmentsIds));
|
|
6050
|
+
try {
|
|
6051
|
+
await this.enqueueRequest({
|
|
6052
|
+
description: "Delete form submission attachments",
|
|
6053
|
+
method: HttpMethod.DELETE,
|
|
6054
|
+
url: `/forms/submissions/${submissionId}/attachments/bulk/`,
|
|
6055
|
+
payload: { attachments: attachmentsIds },
|
|
6056
|
+
blockers: [submissionId, ...attachmentsIds],
|
|
6057
|
+
blocks: []
|
|
6058
|
+
});
|
|
6059
|
+
} catch (e) {
|
|
6060
|
+
this.dispatch(addFormSubmissionAttachments(formSubmissionAttachments));
|
|
6061
|
+
throw e;
|
|
6062
|
+
}
|
|
6063
|
+
}
|
|
5992
6064
|
// Outer promise is for hashing and caching files for submission attachments
|
|
5993
6065
|
async add(payload) {
|
|
5994
6066
|
const { store } = this.client;
|
|
@@ -6128,10 +6200,64 @@ var __publicField = (obj, key, value) => {
|
|
|
6128
6200
|
});
|
|
6129
6201
|
return batchPromises;
|
|
6130
6202
|
}
|
|
6203
|
+
async update(payload) {
|
|
6204
|
+
const { store } = this.client;
|
|
6205
|
+
const state = store.getState();
|
|
6206
|
+
const submissionToBeUpdated = selectFormSubmissionById(payload.offline_id)(state);
|
|
6207
|
+
if (!submissionToBeUpdated) {
|
|
6208
|
+
throw new Error(`Expected submission with offline_id ${payload.offline_id} to exist`);
|
|
6209
|
+
}
|
|
6210
|
+
const { values, files } = separateFilesFromValues(payload.values ?? {});
|
|
6211
|
+
const updatedSubmission = {
|
|
6212
|
+
...submissionToBeUpdated,
|
|
6213
|
+
...payload,
|
|
6214
|
+
// values could also have a partial update
|
|
6215
|
+
values: {
|
|
6216
|
+
...submissionToBeUpdated.values,
|
|
6217
|
+
...values
|
|
6218
|
+
}
|
|
6219
|
+
};
|
|
6220
|
+
this.dispatch(updateFormSubmission(updatedSubmission));
|
|
6221
|
+
const promise = this.enqueueRequest({
|
|
6222
|
+
description: "Delete user form submissions",
|
|
6223
|
+
method: HttpMethod.PATCH,
|
|
6224
|
+
url: `/forms/submissions/${updatedSubmission.offline_id}/`,
|
|
6225
|
+
payload: updatedSubmission,
|
|
6226
|
+
blockers: [updatedSubmission.offline_id],
|
|
6227
|
+
blocks: [updatedSubmission.offline_id]
|
|
6228
|
+
});
|
|
6229
|
+
const formSubmissionAttachments = selectAttachmentsOfFormSubmission(payload.offline_id)(state);
|
|
6230
|
+
const formSubmissionAttachmentIdsToBeDeleted = [];
|
|
6231
|
+
for (const attachment of formSubmissionAttachments) {
|
|
6232
|
+
if (attachment.field_identifier in files) {
|
|
6233
|
+
formSubmissionAttachmentIdsToBeDeleted.push(attachment.offline_id);
|
|
6234
|
+
}
|
|
6235
|
+
}
|
|
6236
|
+
const [offlineFormSubmissionAttachments, attachmentsPromise] = await this.bulkAddSubmissionAttachments(
|
|
6237
|
+
payload.offline_id,
|
|
6238
|
+
files
|
|
6239
|
+
);
|
|
6240
|
+
const deleteAttachmentsPromise = this.bulkDeleteSubmissionAttachments(
|
|
6241
|
+
payload.offline_id,
|
|
6242
|
+
formSubmissionAttachmentIdsToBeDeleted
|
|
6243
|
+
);
|
|
6244
|
+
promise.then((result) => {
|
|
6245
|
+
this.dispatch(setFormSubmission(result));
|
|
6246
|
+
}).catch(() => {
|
|
6247
|
+
this.dispatch(setFormSubmission(submissionToBeUpdated));
|
|
6248
|
+
});
|
|
6249
|
+
return [
|
|
6250
|
+
updatedSubmission,
|
|
6251
|
+
offlineFormSubmissionAttachments,
|
|
6252
|
+
promise,
|
|
6253
|
+
attachmentsPromise,
|
|
6254
|
+
deleteAttachmentsPromise
|
|
6255
|
+
];
|
|
6256
|
+
}
|
|
6131
6257
|
async delete(submissionId) {
|
|
6132
6258
|
const { store } = this.client;
|
|
6133
6259
|
const state = store.getState();
|
|
6134
|
-
const submissionToBeDeleted =
|
|
6260
|
+
const submissionToBeDeleted = selectFormSubmissionById(submissionId)(state);
|
|
6135
6261
|
if (!submissionToBeDeleted) {
|
|
6136
6262
|
throw new Error(`Expected submission with offline_id ${submissionId} to exist`);
|
|
6137
6263
|
}
|
|
@@ -7021,7 +7147,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7021
7147
|
// TODO: @Audiopolis / Magnus - should we pass a offline_id as one arg and a UpdatedTeamProps as a second arg instead of this set up?
|
|
7022
7148
|
update(team) {
|
|
7023
7149
|
const { store } = this.client;
|
|
7024
|
-
const teamToBeUpdated =
|
|
7150
|
+
const teamToBeUpdated = selectTeamById(team.offline_id)(store.getState());
|
|
7025
7151
|
if (!teamToBeUpdated) {
|
|
7026
7152
|
throw new Error(`Expected team with offline_id ${team.offline_id} to exist`);
|
|
7027
7153
|
}
|
|
@@ -7048,7 +7174,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7048
7174
|
async delete(teamId) {
|
|
7049
7175
|
const { store } = this.client;
|
|
7050
7176
|
const state = store.getState();
|
|
7051
|
-
const team =
|
|
7177
|
+
const team = selectTeamById(teamId)(state);
|
|
7052
7178
|
if (!team) {
|
|
7053
7179
|
throw new Error(`Expected team with id ${teamId} to exist`);
|
|
7054
7180
|
}
|
|
@@ -7068,7 +7194,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7068
7194
|
}
|
|
7069
7195
|
async setMembers(teamId, members) {
|
|
7070
7196
|
const { store } = this.client;
|
|
7071
|
-
const team =
|
|
7197
|
+
const team = selectTeamById(teamId)(store.getState());
|
|
7072
7198
|
if (!team) {
|
|
7073
7199
|
throw new Error(`Expected team with id ${teamId} to exist`);
|
|
7074
7200
|
}
|
|
@@ -7093,7 +7219,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7093
7219
|
}
|
|
7094
7220
|
async addMembers(teamId, members) {
|
|
7095
7221
|
const { store } = this.client;
|
|
7096
|
-
const team =
|
|
7222
|
+
const team = selectTeamById(teamId)(store.getState());
|
|
7097
7223
|
if (!team) {
|
|
7098
7224
|
throw new Error(`Expected team with id ${teamId} to exist`);
|
|
7099
7225
|
}
|
|
@@ -7102,7 +7228,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7102
7228
|
}
|
|
7103
7229
|
async removeMembers(teamId, members) {
|
|
7104
7230
|
const { store } = this.client;
|
|
7105
|
-
const team =
|
|
7231
|
+
const team = selectTeamById(teamId)(store.getState());
|
|
7106
7232
|
if (!team) {
|
|
7107
7233
|
throw new Error(`Expected team with id ${teamId} to exist`);
|
|
7108
7234
|
}
|
|
@@ -7714,21 +7840,25 @@ var __publicField = (obj, key, value) => {
|
|
|
7714
7840
|
exports2.selectAllDocumentAttachments = selectAllDocumentAttachments;
|
|
7715
7841
|
exports2.selectAllProjectAttachments = selectAllProjectAttachments;
|
|
7716
7842
|
exports2.selectAncestorIdsOfDocument = selectAncestorIdsOfDocument;
|
|
7717
|
-
exports2.selectAsset = selectAsset;
|
|
7718
7843
|
exports2.selectAssetAttachment = selectAssetAttachment;
|
|
7719
7844
|
exports2.selectAssetAttachmentMapping = selectAssetAttachmentMapping;
|
|
7720
7845
|
exports2.selectAssetAttachments = selectAssetAttachments;
|
|
7846
|
+
exports2.selectAssetById = selectAssetById;
|
|
7847
|
+
exports2.selectAssetStageById = selectAssetStageById;
|
|
7848
|
+
exports2.selectAssetStages = selectAssetStages;
|
|
7849
|
+
exports2.selectAssetStagesByIds = selectAssetStagesByIds;
|
|
7721
7850
|
exports2.selectAssetToAssetTypeMapping = selectAssetToAssetTypeMapping;
|
|
7722
|
-
exports2.selectAssetType = selectAssetType;
|
|
7723
7851
|
exports2.selectAssetTypeAttachment = selectAssetTypeAttachment;
|
|
7724
7852
|
exports2.selectAssetTypeAttachmentMapping = selectAssetTypeAttachmentMapping;
|
|
7725
7853
|
exports2.selectAssetTypeAttachments = selectAssetTypeAttachments;
|
|
7854
|
+
exports2.selectAssetTypeId = selectAssetTypeId;
|
|
7726
7855
|
exports2.selectAssetTypeStagesMapping = selectAssetTypeStagesMapping;
|
|
7727
7856
|
exports2.selectAssetTypes = selectAssetTypes;
|
|
7728
|
-
exports2.
|
|
7857
|
+
exports2.selectAssetTypesByIds = selectAssetTypesByIds;
|
|
7729
7858
|
exports2.selectAssetTypesFromIds = selectAssetTypesFromIds;
|
|
7730
7859
|
exports2.selectAssetTypesMapping = selectAssetTypesMapping;
|
|
7731
7860
|
exports2.selectAssets = selectAssets;
|
|
7861
|
+
exports2.selectAssetsByIds = selectAssetsByIds;
|
|
7732
7862
|
exports2.selectAssetsMapping = selectAssetsMapping;
|
|
7733
7863
|
exports2.selectAssetsOfAssetType = selectAssetsOfAssetType;
|
|
7734
7864
|
exports2.selectAttachedFormSubmissionsOfAsset = selectAttachedFormSubmissionsOfAsset;
|
|
@@ -7746,6 +7876,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7746
7876
|
exports2.selectAttachmentsOfProject = selectAttachmentsOfProject;
|
|
7747
7877
|
exports2.selectAttachmentsOfProjectByType = selectAttachmentsOfProjectByType;
|
|
7748
7878
|
exports2.selectCategories = selectCategories;
|
|
7879
|
+
exports2.selectCategoriesByIds = selectCategoriesByIds;
|
|
7749
7880
|
exports2.selectCategoriesOfWorkspace = selectCategoriesOfWorkspace;
|
|
7750
7881
|
exports2.selectCategoryById = selectCategoryById;
|
|
7751
7882
|
exports2.selectCategoryMapping = selectCategoryMapping;
|
|
@@ -7757,27 +7888,29 @@ var __publicField = (obj, key, value) => {
|
|
|
7757
7888
|
exports2.selectConversations = selectConversations;
|
|
7758
7889
|
exports2.selectCurrentUser = selectCurrentUser;
|
|
7759
7890
|
exports2.selectDeletedRequests = selectDeletedRequests;
|
|
7760
|
-
exports2.selectDocument = selectDocument;
|
|
7761
7891
|
exports2.selectDocumentAttachment = selectDocumentAttachment;
|
|
7762
7892
|
exports2.selectDocumentAttachmentMapping = selectDocumentAttachmentMapping;
|
|
7893
|
+
exports2.selectDocumentById = selectDocumentById;
|
|
7763
7894
|
exports2.selectDocuments = selectDocuments;
|
|
7895
|
+
exports2.selectDocumentsByIds = selectDocumentsByIds;
|
|
7764
7896
|
exports2.selectDocumentsMapping = selectDocumentsMapping;
|
|
7765
7897
|
exports2.selectEmailDomains = selectEmailDomains;
|
|
7766
7898
|
exports2.selectEmailDomainsAsMapping = selectEmailDomainsAsMapping;
|
|
7767
7899
|
exports2.selectEmailDomainsOfOrganization = selectEmailDomainsOfOrganization;
|
|
7768
7900
|
exports2.selectFavouriteProjects = selectFavouriteProjects;
|
|
7769
7901
|
exports2.selectFilteredForms = selectFilteredForms;
|
|
7770
|
-
exports2.
|
|
7902
|
+
exports2.selectFormById = selectFormById;
|
|
7771
7903
|
exports2.selectFormMapping = selectFormMapping;
|
|
7772
7904
|
exports2.selectFormOfAssetType = selectFormOfAssetType;
|
|
7773
7905
|
exports2.selectFormOfIssueType = selectFormOfIssueType;
|
|
7774
|
-
exports2.selectFormRevision = selectFormRevision;
|
|
7775
7906
|
exports2.selectFormRevisionAttachmentsMapping = selectFormRevisionAttachmentsMapping;
|
|
7907
|
+
exports2.selectFormRevisionId = selectFormRevisionId;
|
|
7776
7908
|
exports2.selectFormRevisionMapping = selectFormRevisionMapping;
|
|
7777
7909
|
exports2.selectFormRevisions = selectFormRevisions;
|
|
7778
7910
|
exports2.selectFormRevisionsOfForm = selectFormRevisionsOfForm;
|
|
7779
|
-
exports2.
|
|
7911
|
+
exports2.selectFormSubmissionAttachemntsByIds = selectFormSubmissionAttachemntsByIds;
|
|
7780
7912
|
exports2.selectFormSubmissionAttachmentsMapping = selectFormSubmissionAttachmentsMapping;
|
|
7913
|
+
exports2.selectFormSubmissionById = selectFormSubmissionById;
|
|
7781
7914
|
exports2.selectFormSubmissions = selectFormSubmissions;
|
|
7782
7915
|
exports2.selectFormSubmissionsByAssets = selectFormSubmissionsByAssets;
|
|
7783
7916
|
exports2.selectFormSubmissionsByFormRevisions = selectFormSubmissionsByFormRevisions;
|
|
@@ -7793,27 +7926,29 @@ var __publicField = (obj, key, value) => {
|
|
|
7793
7926
|
exports2.selectGeoImageMapping = selectGeoImageMapping;
|
|
7794
7927
|
exports2.selectGeoImages = selectGeoImages;
|
|
7795
7928
|
exports2.selectGeoImagesOfProject = selectGeoImagesOfProject;
|
|
7796
|
-
exports2.selectIsFetchingInitialData = selectIsFetchingInitialData;
|
|
7797
7929
|
exports2.selectIsImportingProjectFile = selectIsImportingProjectFile;
|
|
7798
7930
|
exports2.selectIsLoggedIn = selectIsLoggedIn;
|
|
7799
|
-
exports2.selectIssue = selectIssue;
|
|
7800
7931
|
exports2.selectIssueAssociationById = selectIssueAssociationById;
|
|
7801
7932
|
exports2.selectIssueAssociationMapping = selectIssueAssociationMapping;
|
|
7933
|
+
exports2.selectIssueAssociations = selectIssueAssociations;
|
|
7802
7934
|
exports2.selectIssueAssociationsOfAsset = selectIssueAssociationsOfAsset;
|
|
7803
7935
|
exports2.selectIssueAssociationsOfIssue = selectIssueAssociationsOfIssue;
|
|
7804
7936
|
exports2.selectIssueAssociationsToIssue = selectIssueAssociationsToIssue;
|
|
7805
7937
|
exports2.selectIssueAttachment = selectIssueAttachment;
|
|
7806
7938
|
exports2.selectIssueAttachmentMapping = selectIssueAttachmentMapping;
|
|
7807
7939
|
exports2.selectIssueAttachments = selectIssueAttachments;
|
|
7940
|
+
exports2.selectIssueById = selectIssueById;
|
|
7808
7941
|
exports2.selectIssueCommentMapping = selectIssueCommentMapping;
|
|
7809
7942
|
exports2.selectIssueCountOfCategory = selectIssueCountOfCategory;
|
|
7810
7943
|
exports2.selectIssueMapping = selectIssueMapping;
|
|
7811
|
-
exports2.
|
|
7944
|
+
exports2.selectIssueTypeById = selectIssueTypeById;
|
|
7812
7945
|
exports2.selectIssueTypeMapping = selectIssueTypeMapping;
|
|
7813
7946
|
exports2.selectIssueTypes = selectIssueTypes;
|
|
7947
|
+
exports2.selectIssueTypesByIds = selectIssueTypesByIds;
|
|
7814
7948
|
exports2.selectIssueTypesOfOrganization = selectIssueTypesOfOrganization;
|
|
7815
7949
|
exports2.selectIssueUpdateMapping = selectIssueUpdateMapping;
|
|
7816
7950
|
exports2.selectIssueUpdatesOfIssue = selectIssueUpdatesOfIssue;
|
|
7951
|
+
exports2.selectIssuesByIds = selectIssuesByIds;
|
|
7817
7952
|
exports2.selectIssuesOfIssueType = selectIssuesOfIssueType;
|
|
7818
7953
|
exports2.selectIssuesOfIssueTypeCount = selectIssuesOfIssueTypeCount;
|
|
7819
7954
|
exports2.selectLatestFormRevisionByForm = selectLatestFormRevisionByForm;
|
|
@@ -7826,7 +7961,6 @@ var __publicField = (obj, key, value) => {
|
|
|
7826
7961
|
exports2.selectLicensesForProjectsMapping = selectLicensesForProjectsMapping;
|
|
7827
7962
|
exports2.selectLicensesOfOrganization = selectLicensesOfOrganization;
|
|
7828
7963
|
exports2.selectMainWorkspace = selectMainWorkspace;
|
|
7829
|
-
exports2.selectNumberOfAssetTypesMatchingCaseInsensitiveName = selectNumberOfAssetTypesMatchingCaseInsensitiveName;
|
|
7830
7964
|
exports2.selectNumberOfAssetsOfAssetType = selectNumberOfAssetsOfAssetType;
|
|
7831
7965
|
exports2.selectOrganization = selectOrganization;
|
|
7832
7966
|
exports2.selectOrganizationAccess = selectOrganizationAccess;
|
|
@@ -7840,14 +7974,14 @@ var __publicField = (obj, key, value) => {
|
|
|
7840
7974
|
exports2.selectOrganizationsMapping = selectOrganizationsMapping;
|
|
7841
7975
|
exports2.selectOrganizationsWithAccess = selectOrganizationsWithAccess;
|
|
7842
7976
|
exports2.selectPermittedWorkspaceIds = selectPermittedWorkspaceIds;
|
|
7843
|
-
exports2.
|
|
7844
|
-
exports2.selectProjectAccess = selectProjectAccess;
|
|
7977
|
+
exports2.selectProjectAccessById = selectProjectAccessById;
|
|
7845
7978
|
exports2.selectProjectAccessForUser = selectProjectAccessForUser;
|
|
7846
7979
|
exports2.selectProjectAccessMapping = selectProjectAccessMapping;
|
|
7847
7980
|
exports2.selectProjectAccessUserMapping = selectProjectAccessUserMapping;
|
|
7848
7981
|
exports2.selectProjectAccesses = selectProjectAccesses;
|
|
7849
7982
|
exports2.selectProjectAttachment = selectProjectAttachment;
|
|
7850
7983
|
exports2.selectProjectAttachmentMapping = selectProjectAttachmentMapping;
|
|
7984
|
+
exports2.selectProjectById = selectProjectById;
|
|
7851
7985
|
exports2.selectProjectFileById = selectProjectFileById;
|
|
7852
7986
|
exports2.selectProjectFileMapping = selectProjectFileMapping;
|
|
7853
7987
|
exports2.selectProjectFiles = selectProjectFiles;
|
|
@@ -7863,21 +7997,20 @@ var __publicField = (obj, key, value) => {
|
|
|
7863
7997
|
exports2.selectSortedFormSubmissionsOfForm = selectSortedFormSubmissionsOfForm;
|
|
7864
7998
|
exports2.selectSortedOrganizationUsers = selectSortedOrganizationUsers;
|
|
7865
7999
|
exports2.selectSortedProjectUsers = selectSortedProjectUsers;
|
|
7866
|
-
exports2.selectStage = selectStage;
|
|
7867
8000
|
exports2.selectStageFormIdsFromStageIds = selectStageFormIdsFromStageIds;
|
|
7868
8001
|
exports2.selectStageMapping = selectStageMapping;
|
|
7869
|
-
exports2.selectStages = selectStages;
|
|
7870
8002
|
exports2.selectStagesFromAssetTypeIds = selectStagesFromAssetTypeIds;
|
|
7871
|
-
exports2.selectStagesFromStageIds = selectStagesFromStageIds;
|
|
7872
8003
|
exports2.selectStagesOfAssetType = selectStagesOfAssetType;
|
|
7873
|
-
exports2.
|
|
8004
|
+
exports2.selectTeamById = selectTeamById;
|
|
7874
8005
|
exports2.selectTeams = selectTeams;
|
|
7875
8006
|
exports2.selectTeamsMapping = selectTeamsMapping;
|
|
7876
8007
|
exports2.selectTeamsOfOrganization = selectTeamsOfOrganization;
|
|
7877
8008
|
exports2.selectTeamsOfUser = selectTeamsOfUser;
|
|
7878
8009
|
exports2.selectUploadUrl = selectUploadUrl;
|
|
7879
8010
|
exports2.selectUser = selectUser;
|
|
7880
|
-
exports2.
|
|
8011
|
+
exports2.selectUserById = selectUserById;
|
|
8012
|
+
exports2.selectUsersByIds = selectUsersByIds;
|
|
8013
|
+
exports2.selectUsersMapping = selectUsersMapping;
|
|
7881
8014
|
exports2.selectWorkspaceById = selectWorkspaceById;
|
|
7882
8015
|
exports2.selectWorkspaceMapping = selectWorkspaceMapping;
|
|
7883
8016
|
exports2.selectWorkspaces = selectWorkspaces;
|
|
@@ -7904,7 +8037,6 @@ var __publicField = (obj, key, value) => {
|
|
|
7904
8037
|
exports2.setFormSubmissions = setFormSubmissions;
|
|
7905
8038
|
exports2.setGeoImage = setGeoImage;
|
|
7906
8039
|
exports2.setGeoImages = setGeoImages;
|
|
7907
|
-
exports2.setIsFetchingInitialData = setIsFetchingInitialData;
|
|
7908
8040
|
exports2.setIsImportingProjectFile = setIsImportingProjectFile;
|
|
7909
8041
|
exports2.setIssueAssociation = setIssueAssociation;
|
|
7910
8042
|
exports2.setIssueAssociations = setIssueAssociations;
|
|
@@ -7929,8 +8061,6 @@ var __publicField = (obj, key, value) => {
|
|
|
7929
8061
|
exports2.setUploadUrl = setUploadUrl;
|
|
7930
8062
|
exports2.setUsers = setUsers;
|
|
7931
8063
|
exports2.setWorkspaces = setWorkspaces;
|
|
7932
|
-
exports2.settingReducer = settingReducer;
|
|
7933
|
-
exports2.settingSlice = settingSlice;
|
|
7934
8064
|
exports2.shallowEqual = shallowEqual;
|
|
7935
8065
|
exports2.slugify = slugify;
|
|
7936
8066
|
exports2.spacesToDashesLower = spacesToDashesLower;
|