@overmap-ai/core 1.0.43-tiptap.0 → 1.0.43-tiptap.1
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
CHANGED
|
@@ -1675,7 +1675,7 @@ const selectAttachmentsOfComponent = restructureCreateSelectorWithArgs(
|
|
|
1675
1675
|
createSelector(
|
|
1676
1676
|
[selectAllComponentAttachments, (_state, componentId) => componentId],
|
|
1677
1677
|
(attachments, componentId) => {
|
|
1678
|
-
return attachments.filter(({
|
|
1678
|
+
return attachments.filter(({ component }) => componentId === component);
|
|
1679
1679
|
}
|
|
1680
1680
|
)
|
|
1681
1681
|
);
|
|
@@ -1683,7 +1683,7 @@ const selectAttachmentsOfComponentByType = restructureCreateSelectorWithArgs(
|
|
|
1683
1683
|
createSelector(
|
|
1684
1684
|
[selectAllComponentAttachments, (_state, componentId) => componentId],
|
|
1685
1685
|
(attachments, componentId) => {
|
|
1686
|
-
const attachmentsOfComponent = attachments.filter(({
|
|
1686
|
+
const attachmentsOfComponent = attachments.filter(({ component }) => componentId === component);
|
|
1687
1687
|
const fileAttachments = attachmentsOfComponent.filter(
|
|
1688
1688
|
// this null check here is necessary, there are cases where file_type is null or undefined
|
|
1689
1689
|
({ file_type }) => !file_type || !file_type.startsWith("image/")
|
|
@@ -1945,7 +1945,7 @@ const selectAttachmentsOfComponentType = restructureCreateSelectorWithArgs(
|
|
|
1945
1945
|
createSelector(
|
|
1946
1946
|
[selectAllComponentTypeAttachments, (_state, componentTypeId) => componentTypeId],
|
|
1947
1947
|
(attachments, componentTypeId) => {
|
|
1948
|
-
return attachments.filter(({
|
|
1948
|
+
return attachments.filter(({ component_type }) => componentTypeId === component_type);
|
|
1949
1949
|
}
|
|
1950
1950
|
)
|
|
1951
1951
|
);
|
|
@@ -1954,7 +1954,7 @@ const selectAttachmentsOfComponentTypeByType = restructureCreateSelectorWithArgs
|
|
|
1954
1954
|
[selectAllComponentTypeAttachments, (_state, componentTypeId) => componentTypeId],
|
|
1955
1955
|
(attachments, componentTypeId) => {
|
|
1956
1956
|
const attachmentsOfComponent = attachments.filter(
|
|
1957
|
-
({
|
|
1957
|
+
({ component_type }) => component_type === componentTypeId
|
|
1958
1958
|
);
|
|
1959
1959
|
const fileAttachments = attachmentsOfComponent.filter(
|
|
1960
1960
|
// this null check here is necessary, there are cases where file_type is null or undefined
|
|
@@ -2103,7 +2103,7 @@ const issueSlice = createSlice({
|
|
|
2103
2103
|
},
|
|
2104
2104
|
removeIssueAttachment: removeAttachment,
|
|
2105
2105
|
removeAttachmentsOfIssue: (state, action) => {
|
|
2106
|
-
const attachments = Object.values(state.attachments).filter((a) => a.
|
|
2106
|
+
const attachments = Object.values(state.attachments).filter((a) => a.issue === action.payload);
|
|
2107
2107
|
for (const attachment of attachments) {
|
|
2108
2108
|
delete state.attachments[attachment.offline_id];
|
|
2109
2109
|
}
|
|
@@ -2234,7 +2234,7 @@ const selectPhotoAttachmentsOfIssue = restructureCreateSelectorWithArgs(
|
|
|
2234
2234
|
[selectIssueAttachmentMapping, (_state, issueId) => issueId],
|
|
2235
2235
|
(attachmentMapping, issueId) => {
|
|
2236
2236
|
return Object.values(attachmentMapping).filter(
|
|
2237
|
-
(attachment) => attachment.
|
|
2237
|
+
(attachment) => attachment.issue === issueId && attachment.file_type && attachment.file_type.startsWith("image/")
|
|
2238
2238
|
);
|
|
2239
2239
|
}
|
|
2240
2240
|
)
|
|
@@ -2249,7 +2249,7 @@ const selectAttachmentsOfIssue = restructureCreateSelectorWithArgs(
|
|
|
2249
2249
|
createSelector(
|
|
2250
2250
|
[selectIssueAttachments, (_state, issueId) => issueId],
|
|
2251
2251
|
(attachments, issueId) => {
|
|
2252
|
-
return attachments.filter(({
|
|
2252
|
+
return attachments.filter(({ issue }) => issueId === issue);
|
|
2253
2253
|
}
|
|
2254
2254
|
)
|
|
2255
2255
|
);
|
|
@@ -2257,12 +2257,12 @@ const selectAttachmentsOfIssueByType = restructureCreateSelectorWithArgs(
|
|
|
2257
2257
|
createSelector(
|
|
2258
2258
|
[selectIssueAttachments, (_state, issueId) => issueId],
|
|
2259
2259
|
(attachments, issueId) => {
|
|
2260
|
-
const
|
|
2261
|
-
const fileAttachments =
|
|
2260
|
+
const attachmentsOfIssue = attachments.filter(({ issue }) => issue === issueId);
|
|
2261
|
+
const fileAttachments = attachmentsOfIssue.filter(
|
|
2262
2262
|
// this null check here is necessary, there are cases where file_type is null or undefined
|
|
2263
2263
|
({ file_type }) => !file_type || !file_type.startsWith("image/")
|
|
2264
2264
|
);
|
|
2265
|
-
const imageAttachments =
|
|
2265
|
+
const imageAttachments = attachmentsOfIssue.filter(
|
|
2266
2266
|
// this null check here is necessary, there are cases where file_type is null or undefined
|
|
2267
2267
|
({ file_type }) => file_type && file_type.startsWith("image/")
|
|
2268
2268
|
);
|
|
@@ -2279,7 +2279,7 @@ const selectFileAttachmentsOfIssue = restructureCreateSelectorWithArgs(
|
|
|
2279
2279
|
return Object.values(attachmentMapping).filter(
|
|
2280
2280
|
(attachment) => (
|
|
2281
2281
|
// Files with file_type that is null or not an image file
|
|
2282
|
-
attachment.
|
|
2282
|
+
attachment.issue === issueId && (!attachment.file_type || !attachment.file_type.startsWith("image/"))
|
|
2283
2283
|
)
|
|
2284
2284
|
);
|
|
2285
2285
|
}
|
|
@@ -4217,7 +4217,7 @@ class AttachmentService extends BaseApiService {
|
|
|
4217
4217
|
}
|
|
4218
4218
|
// Attachments aren't models, so we use the OptimisticGenericResult type instead
|
|
4219
4219
|
async addIssueAttachment(attachmentPayload) {
|
|
4220
|
-
const { description: description2,
|
|
4220
|
+
const { description: description2, issue, file_sha1, offline_id } = attachmentPayload;
|
|
4221
4221
|
if (!attachmentPayload.file.objectURL) {
|
|
4222
4222
|
throw new Error("Expected attachmentPayload.file.objectURL to be defined.");
|
|
4223
4223
|
}
|
|
@@ -4233,12 +4233,12 @@ class AttachmentService extends BaseApiService {
|
|
|
4233
4233
|
const promise = this.enqueueRequest({
|
|
4234
4234
|
description: "Create attachment",
|
|
4235
4235
|
method: HttpMethod.POST,
|
|
4236
|
-
url: `/issues/${
|
|
4237
|
-
blocks: [offline_id,
|
|
4236
|
+
url: `/issues/${issue}/attach/`,
|
|
4237
|
+
blocks: [offline_id, issue],
|
|
4238
4238
|
blockers: [file_sha1],
|
|
4239
4239
|
payload: {
|
|
4240
4240
|
offline_id,
|
|
4241
|
-
issue
|
|
4241
|
+
issue,
|
|
4242
4242
|
description: description2 ?? "",
|
|
4243
4243
|
submitted_at: (/* @__PURE__ */ new Date()).getTime() / 1e3,
|
|
4244
4244
|
...fileProps
|
|
@@ -4251,7 +4251,7 @@ class AttachmentService extends BaseApiService {
|
|
|
4251
4251
|
return [offlineAttachment, promise];
|
|
4252
4252
|
}
|
|
4253
4253
|
async addComponentAttachment(attachmentPayload) {
|
|
4254
|
-
const { description: description2,
|
|
4254
|
+
const { description: description2, component, file_sha1, offline_id } = attachmentPayload;
|
|
4255
4255
|
if (!attachmentPayload.file.objectURL) {
|
|
4256
4256
|
throw new Error("Expected attachmentPayload.file.objectURL to be defined.");
|
|
4257
4257
|
}
|
|
@@ -4267,12 +4267,12 @@ class AttachmentService extends BaseApiService {
|
|
|
4267
4267
|
const promise = this.enqueueRequest({
|
|
4268
4268
|
description: "Create attachment",
|
|
4269
4269
|
method: HttpMethod.POST,
|
|
4270
|
-
url: `/components/${
|
|
4271
|
-
blocks: [offline_id,
|
|
4270
|
+
url: `/components/${component}/attach/`,
|
|
4271
|
+
blocks: [offline_id, component],
|
|
4272
4272
|
blockers: [file_sha1],
|
|
4273
4273
|
payload: {
|
|
4274
4274
|
offline_id,
|
|
4275
|
-
component
|
|
4275
|
+
component,
|
|
4276
4276
|
description: description2 ?? "",
|
|
4277
4277
|
submitted_at: (/* @__PURE__ */ new Date()).getTime() / 1e3,
|
|
4278
4278
|
...fileProps
|
|
@@ -4285,7 +4285,7 @@ class AttachmentService extends BaseApiService {
|
|
|
4285
4285
|
return [offlineAttachment, promise];
|
|
4286
4286
|
}
|
|
4287
4287
|
async addComponentTypeAttachment(attachmentPayload) {
|
|
4288
|
-
const { description: description2,
|
|
4288
|
+
const { description: description2, component_type, file_sha1, offline_id } = attachmentPayload;
|
|
4289
4289
|
if (!attachmentPayload.file.objectURL) {
|
|
4290
4290
|
throw new Error("Expected attachmentPayload.file.objectURL to be defined.");
|
|
4291
4291
|
}
|
|
@@ -4301,12 +4301,12 @@ class AttachmentService extends BaseApiService {
|
|
|
4301
4301
|
const promise = this.enqueueRequest({
|
|
4302
4302
|
description: "Create attachment",
|
|
4303
4303
|
method: HttpMethod.POST,
|
|
4304
|
-
url: `/components/types/${
|
|
4305
|
-
blocks: [offline_id,
|
|
4304
|
+
url: `/components/types/${component_type}/attach/`,
|
|
4305
|
+
blocks: [offline_id, component_type],
|
|
4306
4306
|
blockers: [file_sha1],
|
|
4307
4307
|
payload: {
|
|
4308
4308
|
offline_id,
|
|
4309
|
-
component_type
|
|
4309
|
+
component_type,
|
|
4310
4310
|
description: description2 ?? "",
|
|
4311
4311
|
submitted_at: (/* @__PURE__ */ new Date()).getTime() / 1e3,
|
|
4312
4312
|
...fileProps
|
|
@@ -4332,7 +4332,7 @@ class AttachmentService extends BaseApiService {
|
|
|
4332
4332
|
file: file2,
|
|
4333
4333
|
file_name: file2.name,
|
|
4334
4334
|
file_type: file2.type,
|
|
4335
|
-
|
|
4335
|
+
issue: issueId,
|
|
4336
4336
|
file_sha1: hash
|
|
4337
4337
|
});
|
|
4338
4338
|
return this.addIssueAttachment(attachment);
|
|
@@ -4351,7 +4351,7 @@ class AttachmentService extends BaseApiService {
|
|
|
4351
4351
|
file: file2,
|
|
4352
4352
|
file_name: file2.name,
|
|
4353
4353
|
file_type: file2.type,
|
|
4354
|
-
|
|
4354
|
+
component: componentId,
|
|
4355
4355
|
file_sha1: hash
|
|
4356
4356
|
});
|
|
4357
4357
|
return this.addComponentAttachment(attachment);
|
|
@@ -4370,7 +4370,7 @@ class AttachmentService extends BaseApiService {
|
|
|
4370
4370
|
file: file2,
|
|
4371
4371
|
file_name: file2.name,
|
|
4372
4372
|
file_type: file2.type,
|
|
4373
|
-
|
|
4373
|
+
component_type: componentTypeId,
|
|
4374
4374
|
file_sha1: hash
|
|
4375
4375
|
});
|
|
4376
4376
|
return this.addComponentTypeAttachment(attachment);
|
|
@@ -5524,7 +5524,7 @@ class IssueService extends BaseApiService {
|
|
|
5524
5524
|
if (!backup) {
|
|
5525
5525
|
throw new Error(`No issue with id ${id} found in the store`);
|
|
5526
5526
|
}
|
|
5527
|
-
const attachments = Object.values(state.issueReducer.attachments).filter((a) => a.
|
|
5527
|
+
const attachments = Object.values(state.issueReducer.attachments).filter((a) => a.issue === id);
|
|
5528
5528
|
const attachmentsOfIssue = selectAttachmentsOfIssue(id)(state);
|
|
5529
5529
|
this.client.store.dispatch(removeIssue(id));
|
|
5530
5530
|
store.dispatch(addActiveProjectIssuesCount(-1));
|
|
@@ -13916,14 +13916,16 @@ const FieldActions = memo((props) => {
|
|
|
13916
13916
|
key: "duplicate",
|
|
13917
13917
|
text: "Duplicate",
|
|
13918
13918
|
buttonProps: { onClick: duplicate }
|
|
13919
|
-
}
|
|
13920
|
-
|
|
13919
|
+
}
|
|
13920
|
+
];
|
|
13921
|
+
if (index2 === 0) {
|
|
13922
|
+
actions2.push({
|
|
13921
13923
|
Icon: TrashIcon,
|
|
13922
13924
|
key: "delete",
|
|
13923
13925
|
text: "Delete",
|
|
13924
13926
|
buttonProps: { onClick: remove2 }
|
|
13925
|
-
}
|
|
13926
|
-
|
|
13927
|
+
});
|
|
13928
|
+
}
|
|
13927
13929
|
if (type !== "section") {
|
|
13928
13930
|
actions2.unshift({
|
|
13929
13931
|
Icon: ImageIcon,
|