@overmap-ai/core 1.0.48-form-submission-view.0 → 1.0.48-issue-attachment-bug.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 +44 -9
- package/dist/overmap-core.js.map +1 -1
- package/dist/overmap-core.umd.cjs +44 -9
- package/dist/overmap-core.umd.cjs.map +1 -1
- package/dist/store/slices/componentSlice.d.ts +1 -0
- package/dist/store/slices/componentStageSlice.d.ts +1 -0
- package/dist/store/slices/userFormSlice.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1601,6 +1601,7 @@ var __publicField = (obj, key, value) => {
|
|
|
1601
1601
|
}
|
|
1602
1602
|
return prevComponents;
|
|
1603
1603
|
};
|
|
1604
|
+
const selectComponentsMapping = (state) => state.componentReducer.components;
|
|
1604
1605
|
const selectComponentsFromComponentType = (componentTypeId) => (state) => {
|
|
1605
1606
|
if (!componentTypeId)
|
|
1606
1607
|
return [];
|
|
@@ -1631,16 +1632,14 @@ var __publicField = (obj, key, value) => {
|
|
|
1631
1632
|
}
|
|
1632
1633
|
return ret;
|
|
1633
1634
|
};
|
|
1634
|
-
const selectComponentsByType = (
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
componentsOfType.push(component);
|
|
1635
|
+
const selectComponentsByType = restructureCreateSelectorWithArgs(
|
|
1636
|
+
toolkit.createSelector(
|
|
1637
|
+
[selectComponents, (_state, componentTypeId) => componentTypeId],
|
|
1638
|
+
(components, componentTypeId) => {
|
|
1639
|
+
return components.filter((component) => component.component_type === componentTypeId);
|
|
1640
1640
|
}
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
};
|
|
1641
|
+
)
|
|
1642
|
+
);
|
|
1644
1643
|
const selectNumberOfComponentsOfComponentType = (componentTypeId) => (state) => {
|
|
1645
1644
|
var _a2;
|
|
1646
1645
|
if (!componentTypeId)
|
|
@@ -1830,6 +1829,20 @@ var __publicField = (obj, key, value) => {
|
|
|
1830
1829
|
}
|
|
1831
1830
|
)
|
|
1832
1831
|
);
|
|
1832
|
+
const selectComponentTypeStagesMapping = restructureCreateSelectorWithArgs(
|
|
1833
|
+
toolkit.createSelector(
|
|
1834
|
+
[selectStageMapping, (_state, componentTypeId) => componentTypeId],
|
|
1835
|
+
(stagesMapping, componentTypeId) => {
|
|
1836
|
+
const stagesMappingCopy = { ...stagesMapping };
|
|
1837
|
+
for (const stage in stagesMappingCopy) {
|
|
1838
|
+
if (stagesMappingCopy[stage].component_type !== componentTypeId) {
|
|
1839
|
+
delete stagesMappingCopy[stage];
|
|
1840
|
+
}
|
|
1841
|
+
}
|
|
1842
|
+
return stagesMappingCopy;
|
|
1843
|
+
}
|
|
1844
|
+
)
|
|
1845
|
+
);
|
|
1833
1846
|
const selectStagesFromComponentType = restructureCreateSelectorWithArgs(
|
|
1834
1847
|
toolkit.createSelector(
|
|
1835
1848
|
[selectStages, (_state, componentTypeId) => componentTypeId],
|
|
@@ -3691,6 +3704,23 @@ var __publicField = (obj, key, value) => {
|
|
|
3691
3704
|
}
|
|
3692
3705
|
)
|
|
3693
3706
|
);
|
|
3707
|
+
const selectComponentSubmissionMapping = toolkit.createSelector(
|
|
3708
|
+
[selectSubmissionMapping, selectComponentsMapping],
|
|
3709
|
+
(submissions, components) => {
|
|
3710
|
+
var _a2;
|
|
3711
|
+
const componentSubmissionMapping = {};
|
|
3712
|
+
for (const componentId in components) {
|
|
3713
|
+
componentSubmissionMapping[componentId] = [];
|
|
3714
|
+
}
|
|
3715
|
+
for (const submissionId in submissions) {
|
|
3716
|
+
const submission = submissions[submissionId];
|
|
3717
|
+
if (submission.component) {
|
|
3718
|
+
(_a2 = componentSubmissionMapping[submission.component]) == null ? void 0 : _a2.push(submission);
|
|
3719
|
+
}
|
|
3720
|
+
}
|
|
3721
|
+
return componentSubmissionMapping;
|
|
3722
|
+
}
|
|
3723
|
+
);
|
|
3694
3724
|
const selectUserFormMapping = (state) => {
|
|
3695
3725
|
return state.userFormReducer.userForms;
|
|
3696
3726
|
};
|
|
@@ -4551,6 +4581,8 @@ var __publicField = (obj, key, value) => {
|
|
|
4551
4581
|
await this.client.files.addCache(attachmentPayload.file, file_sha1);
|
|
4552
4582
|
this.client.store.dispatch(addIssueAttachment(offlineAttachment));
|
|
4553
4583
|
const [fileProps] = await this.client.files.uploadFileToS3(file_sha1);
|
|
4584
|
+
console.debug("fileProps", fileProps);
|
|
4585
|
+
console.debug("offlineAttachment", offlineAttachment);
|
|
4554
4586
|
const promise = this.enqueueRequest({
|
|
4555
4587
|
description: "Create attachment",
|
|
4556
4588
|
method: HttpMethod.POST,
|
|
@@ -15788,11 +15820,13 @@ var __publicField = (obj, key, value) => {
|
|
|
15788
15820
|
exports2.selectCompletedStages = selectCompletedStages;
|
|
15789
15821
|
exports2.selectComponent = selectComponent;
|
|
15790
15822
|
exports2.selectComponentAttachmentMapping = selectComponentAttachmentMapping;
|
|
15823
|
+
exports2.selectComponentSubmissionMapping = selectComponentSubmissionMapping;
|
|
15791
15824
|
exports2.selectComponentType = selectComponentType;
|
|
15792
15825
|
exports2.selectComponentTypeAttachmentMapping = selectComponentTypeAttachmentMapping;
|
|
15793
15826
|
exports2.selectComponentTypeForm = selectComponentTypeForm;
|
|
15794
15827
|
exports2.selectComponentTypeFromComponent = selectComponentTypeFromComponent;
|
|
15795
15828
|
exports2.selectComponentTypeFromComponents = selectComponentTypeFromComponents;
|
|
15829
|
+
exports2.selectComponentTypeStagesMapping = selectComponentTypeStagesMapping;
|
|
15796
15830
|
exports2.selectComponentTypes = selectComponentTypes;
|
|
15797
15831
|
exports2.selectComponentTypesByName = selectComponentTypesByName;
|
|
15798
15832
|
exports2.selectComponentTypesFromIds = selectComponentTypesFromIds;
|
|
@@ -15800,6 +15834,7 @@ var __publicField = (obj, key, value) => {
|
|
|
15800
15834
|
exports2.selectComponents = selectComponents;
|
|
15801
15835
|
exports2.selectComponentsByType = selectComponentsByType;
|
|
15802
15836
|
exports2.selectComponentsFromComponentType = selectComponentsFromComponentType;
|
|
15837
|
+
exports2.selectComponentsMapping = selectComponentsMapping;
|
|
15803
15838
|
exports2.selectCreateProjectType = selectCreateProjectType;
|
|
15804
15839
|
exports2.selectCurrentUser = selectCurrentUser;
|
|
15805
15840
|
exports2.selectDeletedRequests = selectDeletedRequests;
|