@overmap-ai/core 1.0.44-tiptap.4 → 1.0.44-tiptap.6
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 +41 -18
- package/dist/overmap-core.js.map +1 -1
- package/dist/overmap-core.umd.cjs +41 -18
- package/dist/overmap-core.umd.cjs.map +1 -1
- package/package.json +1 -1
package/dist/overmap-core.js
CHANGED
|
@@ -1684,8 +1684,14 @@ const selectAttachmentsOfComponentByType = restructureCreateSelectorWithArgs(
|
|
|
1684
1684
|
[selectAllComponentAttachments, (_state, componentId) => componentId],
|
|
1685
1685
|
(attachments, componentId) => {
|
|
1686
1686
|
const attachmentsOfComponent = attachments.filter(({ component_id }) => componentId === component_id);
|
|
1687
|
-
const fileAttachments = attachmentsOfComponent.filter(
|
|
1688
|
-
|
|
1687
|
+
const fileAttachments = attachmentsOfComponent.filter(
|
|
1688
|
+
// this null check here is necessary, there are cases where file_type is null or undefined
|
|
1689
|
+
({ file_type }) => !file_type || !file_type.startsWith("image/")
|
|
1690
|
+
);
|
|
1691
|
+
const imageAttachments = attachmentsOfComponent.filter(
|
|
1692
|
+
// this null check here is necessary, there are cases where file_type is null or undefined
|
|
1693
|
+
({ file_type }) => file_type && file_type.startsWith("image/")
|
|
1694
|
+
);
|
|
1689
1695
|
return { fileAttachments, imageAttachments };
|
|
1690
1696
|
}
|
|
1691
1697
|
)
|
|
@@ -1950,8 +1956,14 @@ const selectAttachmentsOfComponentTypeByType = restructureCreateSelectorWithArgs
|
|
|
1950
1956
|
const attachmentsOfComponent = attachments.filter(
|
|
1951
1957
|
({ component_type_id }) => component_type_id === componentTypeId
|
|
1952
1958
|
);
|
|
1953
|
-
const fileAttachments = attachmentsOfComponent.filter(
|
|
1954
|
-
|
|
1959
|
+
const fileAttachments = attachmentsOfComponent.filter(
|
|
1960
|
+
// this null check here is necessary, there are cases where file_type is null or undefined
|
|
1961
|
+
({ file_type }) => !file_type || !file_type.startsWith("image/")
|
|
1962
|
+
);
|
|
1963
|
+
const imageAttachments = attachmentsOfComponent.filter(
|
|
1964
|
+
// this null check here is necessary, there are cases where file_type is null or undefined
|
|
1965
|
+
({ file_type }) => file_type && file_type.startsWith("image/")
|
|
1966
|
+
);
|
|
1955
1967
|
return { fileAttachments, imageAttachments };
|
|
1956
1968
|
}
|
|
1957
1969
|
)
|
|
@@ -2251,8 +2263,14 @@ const selectAttachmentsOfIssueByType = restructureCreateSelectorWithArgs(
|
|
|
2251
2263
|
[selectIssueAttachments, (_state, issueId) => issueId],
|
|
2252
2264
|
(attachments, issueId) => {
|
|
2253
2265
|
const attachmentsOfComponent = attachments.filter(({ issue_id }) => issue_id === issueId);
|
|
2254
|
-
const fileAttachments = attachmentsOfComponent.filter(
|
|
2255
|
-
|
|
2266
|
+
const fileAttachments = attachmentsOfComponent.filter(
|
|
2267
|
+
// this null check here is necessary, there are cases where file_type is null or undefined
|
|
2268
|
+
({ file_type }) => !file_type || !file_type.startsWith("image/")
|
|
2269
|
+
);
|
|
2270
|
+
const imageAttachments = attachmentsOfComponent.filter(
|
|
2271
|
+
// this null check here is necessary, there are cases where file_type is null or undefined
|
|
2272
|
+
({ file_type }) => file_type && file_type.startsWith("image/")
|
|
2273
|
+
);
|
|
2256
2274
|
return { fileAttachments, imageAttachments };
|
|
2257
2275
|
}
|
|
2258
2276
|
)
|
|
@@ -6522,18 +6540,23 @@ class FileService extends BaseApiService {
|
|
|
6522
6540
|
let promise = cachedRequestPromises[requestCacheKey];
|
|
6523
6541
|
let isFirstRequest = true;
|
|
6524
6542
|
if (!promise) {
|
|
6525
|
-
promise =
|
|
6526
|
-
|
|
6527
|
-
|
|
6528
|
-
|
|
6529
|
-
|
|
6530
|
-
|
|
6531
|
-
|
|
6532
|
-
|
|
6533
|
-
|
|
6534
|
-
|
|
6535
|
-
|
|
6536
|
-
|
|
6543
|
+
promise = new Promise((resolve) => {
|
|
6544
|
+
void this.enqueueRequest({
|
|
6545
|
+
description: "Download file",
|
|
6546
|
+
method: HttpMethod.GET,
|
|
6547
|
+
url,
|
|
6548
|
+
// If in development, we should assume the files are saved at localhost by the Django development server.
|
|
6549
|
+
// Setting this to true will lead to localhost:8000 being prepended to the URL.
|
|
6550
|
+
isExternalUrl: true,
|
|
6551
|
+
isResponseBlob: true,
|
|
6552
|
+
isAuthNeeded: false,
|
|
6553
|
+
blockers: [expectedSha1],
|
|
6554
|
+
blocks: [expectedSha1]
|
|
6555
|
+
}).then((blob) => {
|
|
6556
|
+
const blobToFile = new File([blob], downloadedName ?? expectedSha1, { type: blob.type });
|
|
6557
|
+
resolve(blobToFile);
|
|
6558
|
+
});
|
|
6559
|
+
});
|
|
6537
6560
|
cachedRequestPromises[requestCacheKey] = promise;
|
|
6538
6561
|
} else {
|
|
6539
6562
|
isFirstRequest = false;
|