@overmap-ai/core 1.0.48-fix-agent-errors.4 → 1.0.48-form-submission-view.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/README.md +4 -4
- package/dist/components/ImageCard/ImageCard.d.ts +1 -1
- package/dist/forms/builder/hooks.d.ts +2 -1
- package/dist/overmap-core.js +438 -140
- package/dist/overmap-core.js.map +1 -1
- package/dist/overmap-core.umd.cjs +437 -139
- package/dist/overmap-core.umd.cjs.map +1 -1
- package/dist/sdk/sdk.d.ts +2 -1
- package/dist/sdk/services/AgentService.d.ts +1 -0
- package/dist/sdk/services/IssueCommentService.d.ts +2 -2
- package/dist/sdk/services/IssueUpdateService.d.ts +4 -0
- package/dist/sdk/services/index.d.ts +1 -0
- package/dist/store/slices/componentSlice.d.ts +1 -0
- package/dist/store/slices/componentStageSlice.d.ts +2 -0
- package/dist/store/slices/issueSlice.d.ts +21 -3
- package/dist/store/slices/userFormSlice.d.ts +2 -0
- package/dist/typings/models/access.d.ts +1 -1
- package/dist/typings/models/attachments.d.ts +3 -1
- package/dist/typings/models/issues.d.ts +35 -1
- package/package.json +152 -152
|
@@ -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)
|
|
@@ -1798,6 +1797,11 @@ var __publicField = (obj, key, value) => {
|
|
|
1798
1797
|
}
|
|
1799
1798
|
});
|
|
1800
1799
|
const selectStageMapping = (state) => state.componentStageReducer.stages;
|
|
1800
|
+
const selectStage = restructureCreateSelectorWithArgs(
|
|
1801
|
+
toolkit.createSelector([selectStageMapping, (_state, stageId) => stageId], (stageMapping, stageId) => {
|
|
1802
|
+
return stageMapping[stageId];
|
|
1803
|
+
})
|
|
1804
|
+
);
|
|
1801
1805
|
const selectStages = toolkit.createSelector(
|
|
1802
1806
|
[selectStageMapping],
|
|
1803
1807
|
(stageMapping) => {
|
|
@@ -1825,6 +1829,20 @@ var __publicField = (obj, key, value) => {
|
|
|
1825
1829
|
}
|
|
1826
1830
|
)
|
|
1827
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
|
+
);
|
|
1828
1846
|
const selectStagesFromComponentType = restructureCreateSelectorWithArgs(
|
|
1829
1847
|
toolkit.createSelector(
|
|
1830
1848
|
[selectStages, (_state, componentTypeId) => componentTypeId],
|
|
@@ -2038,6 +2056,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2038
2056
|
issues: {},
|
|
2039
2057
|
attachments: {},
|
|
2040
2058
|
comments: {},
|
|
2059
|
+
updates: {},
|
|
2041
2060
|
visibleStatuses: [IssueStatus.BACKLOG, IssueStatus.SELECTED],
|
|
2042
2061
|
visibleUserIds: null,
|
|
2043
2062
|
recentIssueIds: [],
|
|
@@ -2059,6 +2078,16 @@ var __publicField = (obj, key, value) => {
|
|
|
2059
2078
|
});
|
|
2060
2079
|
},
|
|
2061
2080
|
setIssueAttachments: setAttachments,
|
|
2081
|
+
setIssueUpdates: (state, action) => {
|
|
2082
|
+
if (action.payload.filter(onlyUniqueOfflineIds).length !== action.payload.length) {
|
|
2083
|
+
throw new Error("Tried to use setIssues reducer with duplicate ID's");
|
|
2084
|
+
}
|
|
2085
|
+
const newUpdates = {};
|
|
2086
|
+
for (const update of action.payload) {
|
|
2087
|
+
newUpdates[update.offline_id] = update;
|
|
2088
|
+
}
|
|
2089
|
+
state.updates = newUpdates;
|
|
2090
|
+
},
|
|
2062
2091
|
setActiveIssueId: (state, action) => {
|
|
2063
2092
|
state.activeIssueId = action.payload;
|
|
2064
2093
|
},
|
|
@@ -2070,6 +2099,17 @@ var __publicField = (obj, key, value) => {
|
|
|
2070
2099
|
},
|
|
2071
2100
|
addIssueAttachment: addAttachment,
|
|
2072
2101
|
addIssueAttachments: addAttachments,
|
|
2102
|
+
addIssueUpdate: (state, action) => {
|
|
2103
|
+
if (action.payload.offline_id in state.updates) {
|
|
2104
|
+
throw new Error(`Tried to add duplicate issue update with offline_id: ${action.payload.offline_id}`);
|
|
2105
|
+
}
|
|
2106
|
+
state.updates[action.payload.offline_id] = action.payload;
|
|
2107
|
+
},
|
|
2108
|
+
addIssueUpdates: (state, action) => {
|
|
2109
|
+
for (const update of action.payload) {
|
|
2110
|
+
state.updates[update.offline_id] = update;
|
|
2111
|
+
}
|
|
2112
|
+
},
|
|
2073
2113
|
updateIssue: (state, action) => {
|
|
2074
2114
|
if (action.payload.offline_id in state.issues) {
|
|
2075
2115
|
state.issues[action.payload.offline_id] = {
|
|
@@ -2089,6 +2129,18 @@ var __publicField = (obj, key, value) => {
|
|
|
2089
2129
|
}
|
|
2090
2130
|
},
|
|
2091
2131
|
removeIssueAttachment: removeAttachment,
|
|
2132
|
+
removeIssueUpdate: (state, action) => {
|
|
2133
|
+
if (action.payload in state.updates) {
|
|
2134
|
+
delete state.updates[action.payload];
|
|
2135
|
+
} else {
|
|
2136
|
+
throw new Error(`Failed to remove issue update because offline_id doesn't exist: ${action.payload}`);
|
|
2137
|
+
}
|
|
2138
|
+
},
|
|
2139
|
+
removeIssueUpdates: (state, action) => {
|
|
2140
|
+
for (const updateId of action.payload) {
|
|
2141
|
+
delete state.updates[updateId];
|
|
2142
|
+
}
|
|
2143
|
+
},
|
|
2092
2144
|
removeAttachmentsOfIssue: (state, action) => {
|
|
2093
2145
|
const attachments = Object.values(state.attachments).filter((a) => a.issue === action.payload);
|
|
2094
2146
|
for (const attachment of attachments) {
|
|
@@ -2101,20 +2153,55 @@ var __publicField = (obj, key, value) => {
|
|
|
2101
2153
|
setVisibleUserIds: (state, action) => {
|
|
2102
2154
|
state.visibleUserIds = [...new Set(action.payload)];
|
|
2103
2155
|
},
|
|
2104
|
-
|
|
2156
|
+
// Comments
|
|
2157
|
+
addIssueComment: (state, action) => {
|
|
2158
|
+
if (action.payload.offline_id in state.comments) {
|
|
2159
|
+
throw new Error(
|
|
2160
|
+
`Tried to add issue comment with offline_id: ${action.payload.offline_id} that already exists`
|
|
2161
|
+
);
|
|
2162
|
+
}
|
|
2163
|
+
state.comments[action.payload.offline_id] = action.payload;
|
|
2164
|
+
},
|
|
2165
|
+
addIssueComments: (state, action) => {
|
|
2166
|
+
for (const comment of action.payload) {
|
|
2167
|
+
if (comment.offline_id in state.comments) {
|
|
2168
|
+
throw new Error(
|
|
2169
|
+
`Tried to add issue comment with offline_id: ${comment.offline_id} that already exists`
|
|
2170
|
+
);
|
|
2171
|
+
}
|
|
2172
|
+
}
|
|
2105
2173
|
for (const comment of action.payload) {
|
|
2106
2174
|
state.comments[comment.offline_id] = comment;
|
|
2107
2175
|
}
|
|
2108
2176
|
},
|
|
2177
|
+
setIssueComment: (state, action) => {
|
|
2178
|
+
state.comments[action.payload.offline_id] = action.payload;
|
|
2179
|
+
},
|
|
2180
|
+
setIssueComments: (state, action) => {
|
|
2181
|
+
const newComments = {};
|
|
2182
|
+
for (const comment of action.payload) {
|
|
2183
|
+
newComments[comment.offline_id] = comment;
|
|
2184
|
+
}
|
|
2185
|
+
state.comments = newComments;
|
|
2186
|
+
},
|
|
2109
2187
|
addOrReplaceIssueComment: (state, action) => {
|
|
2110
2188
|
state.comments[action.payload.offline_id] = action.payload;
|
|
2111
2189
|
},
|
|
2112
2190
|
removeIssueComment: (state, action) => {
|
|
2113
|
-
if (action.payload in state.comments) {
|
|
2114
|
-
delete state.comments[action.payload];
|
|
2115
|
-
} else {
|
|
2191
|
+
if (!(action.payload in state.comments)) {
|
|
2116
2192
|
throw new Error(`Failed to remove issue comment because ID doesn't exist: ${action.payload}`);
|
|
2117
2193
|
}
|
|
2194
|
+
delete state.comments[action.payload];
|
|
2195
|
+
},
|
|
2196
|
+
removeIssueComments: (state, action) => {
|
|
2197
|
+
for (const commentId of action.payload) {
|
|
2198
|
+
if (!(commentId in state.comments)) {
|
|
2199
|
+
throw new Error(`Failed to remove issue comment because ID doesn't exist: ${commentId}`);
|
|
2200
|
+
}
|
|
2201
|
+
}
|
|
2202
|
+
for (const commentId of action.payload) {
|
|
2203
|
+
delete state.comments[commentId];
|
|
2204
|
+
}
|
|
2118
2205
|
},
|
|
2119
2206
|
cleanRecentIssues: (state) => {
|
|
2120
2207
|
state.recentIssueIds = state.recentIssueIds.filter((recentIssue) => state.issues[recentIssue.offlineId]);
|
|
@@ -2145,23 +2232,33 @@ var __publicField = (obj, key, value) => {
|
|
|
2145
2232
|
addIssueAttachment,
|
|
2146
2233
|
addIssueAttachments,
|
|
2147
2234
|
addIssue,
|
|
2235
|
+
addIssueUpdate,
|
|
2236
|
+
addIssueUpdates,
|
|
2148
2237
|
addOrReplaceIssueComment,
|
|
2149
2238
|
addToRecentIssues,
|
|
2150
2239
|
cleanRecentIssues,
|
|
2151
2240
|
removeIssueAttachment,
|
|
2152
2241
|
removeAttachmentsOfIssue,
|
|
2153
2242
|
removeIssue,
|
|
2154
|
-
|
|
2243
|
+
removeIssueUpdate,
|
|
2244
|
+
removeIssueUpdates,
|
|
2155
2245
|
removeRecentIssue,
|
|
2156
2246
|
resetRecentIssues,
|
|
2157
2247
|
setActiveIssueId,
|
|
2158
2248
|
setIssueAttachments,
|
|
2159
|
-
|
|
2249
|
+
setIssueUpdates,
|
|
2160
2250
|
setIssues,
|
|
2161
2251
|
setVisibleStatuses,
|
|
2162
2252
|
setVisibleUserIds,
|
|
2163
2253
|
updateIssueAttachment,
|
|
2164
|
-
updateIssue
|
|
2254
|
+
updateIssue,
|
|
2255
|
+
// Commments
|
|
2256
|
+
addIssueComment,
|
|
2257
|
+
addIssueComments,
|
|
2258
|
+
setIssueComment,
|
|
2259
|
+
setIssueComments,
|
|
2260
|
+
removeIssueComment,
|
|
2261
|
+
removeIssueComments
|
|
2165
2262
|
} = issueSlice.actions;
|
|
2166
2263
|
const selectIssueMapping = (state) => state.issueReducer.issues;
|
|
2167
2264
|
const selectRecentIssueIds = (state) => state.issueReducer.recentIssueIds;
|
|
@@ -2232,6 +2329,12 @@ var __publicField = (obj, key, value) => {
|
|
|
2232
2329
|
return Object.values(commentMapping).filter((comment) => comment.issue === issueId);
|
|
2233
2330
|
})
|
|
2234
2331
|
);
|
|
2332
|
+
const selectIssueUpdateMapping = (state) => state.issueReducer.updates;
|
|
2333
|
+
const selectIssueUpdatesOfIssue = restructureCreateSelectorWithArgs(
|
|
2334
|
+
toolkit.createSelector([selectIssueUpdateMapping, (_state, issueId) => issueId], (updates, issueId) => {
|
|
2335
|
+
return Object.values(updates).filter((update) => update.issue === issueId);
|
|
2336
|
+
})
|
|
2337
|
+
);
|
|
2235
2338
|
const selectAttachmentsOfIssue = restructureCreateSelectorWithArgs(
|
|
2236
2339
|
toolkit.createSelector(
|
|
2237
2340
|
[selectIssueAttachments, (_state, issueId) => issueId],
|
|
@@ -2440,6 +2543,16 @@ var __publicField = (obj, key, value) => {
|
|
|
2440
2543
|
OrganizationAccessLevel2[OrganizationAccessLevel2["ADMIN"] = 2] = "ADMIN";
|
|
2441
2544
|
return OrganizationAccessLevel2;
|
|
2442
2545
|
})(OrganizationAccessLevel || {});
|
|
2546
|
+
var IssueUpdateChange = /* @__PURE__ */ ((IssueUpdateChange2) => {
|
|
2547
|
+
IssueUpdateChange2["STATUS"] = "status";
|
|
2548
|
+
IssueUpdateChange2["PRIORITY"] = "priority";
|
|
2549
|
+
IssueUpdateChange2["CATEGORY"] = "category";
|
|
2550
|
+
IssueUpdateChange2["DESCRIPTION"] = "description";
|
|
2551
|
+
IssueUpdateChange2["TITLE"] = "title";
|
|
2552
|
+
IssueUpdateChange2["ASSIGNED_TO"] = "assigned_to";
|
|
2553
|
+
IssueUpdateChange2["DUE_DATE"] = "due_date";
|
|
2554
|
+
return IssueUpdateChange2;
|
|
2555
|
+
})(IssueUpdateChange || {});
|
|
2443
2556
|
var ProjectType = /* @__PURE__ */ ((ProjectType2) => {
|
|
2444
2557
|
ProjectType2[ProjectType2["PERSONAL"] = 0] = "PERSONAL";
|
|
2445
2558
|
ProjectType2[ProjectType2["ORGANIZATION"] = 2] = "ORGANIZATION";
|
|
@@ -3542,6 +3655,14 @@ var __publicField = (obj, key, value) => {
|
|
|
3542
3655
|
return state.userFormReducer.userForms[formId2];
|
|
3543
3656
|
};
|
|
3544
3657
|
const selectSubmissionMapping = (state) => state.userFormReducer.submissions;
|
|
3658
|
+
const selectUserFormSubmission = restructureCreateSelectorWithArgs(
|
|
3659
|
+
toolkit.createSelector(
|
|
3660
|
+
[selectSubmissionMapping, (_state, submissionId) => submissionId],
|
|
3661
|
+
(submissions, submissionId) => {
|
|
3662
|
+
return submissions[submissionId];
|
|
3663
|
+
}
|
|
3664
|
+
)
|
|
3665
|
+
);
|
|
3545
3666
|
const selectSubmissions = toolkit.createSelector([selectSubmissionMapping], (submissions) => Object.values(submissions));
|
|
3546
3667
|
const selectRevisionMapping = (state) => state.userFormReducer.revisions;
|
|
3547
3668
|
const selectRevisions = toolkit.createSelector([selectRevisionMapping], (revisions) => Object.values(revisions));
|
|
@@ -3583,6 +3704,23 @@ var __publicField = (obj, key, value) => {
|
|
|
3583
3704
|
}
|
|
3584
3705
|
)
|
|
3585
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
|
+
);
|
|
3586
3724
|
const selectUserFormMapping = (state) => {
|
|
3587
3725
|
return state.userFormReducer.userForms;
|
|
3588
3726
|
};
|
|
@@ -4242,10 +4380,20 @@ var __publicField = (obj, key, value) => {
|
|
|
4242
4380
|
var _a2;
|
|
4243
4381
|
return (_a2 = allMiddleware[0]) == null ? void 0 : _a2.run(action);
|
|
4244
4382
|
}
|
|
4245
|
-
const discardStatuses = [400, 409, 403, 404];
|
|
4383
|
+
const discardStatuses = [400, 409, 403, 404, 405, 500];
|
|
4246
4384
|
const statusMessages = {
|
|
4247
4385
|
403: { title: "Forbidden", description: "You are not authorized to perform this action.", severity: "danger" },
|
|
4248
|
-
404: { title: "Not found", description: "The requested resource was not found.", severity: "danger" }
|
|
4386
|
+
404: { title: "Not found", description: "The requested resource was not found.", severity: "danger" },
|
|
4387
|
+
405: {
|
|
4388
|
+
title: "Not supported",
|
|
4389
|
+
description: "It's not you. It's us. Sorry for the inconvenience.",
|
|
4390
|
+
severity: "danger"
|
|
4391
|
+
},
|
|
4392
|
+
500: {
|
|
4393
|
+
title: "Server error",
|
|
4394
|
+
description: "Our server seems to be experiencing problems at the moment. We have been alerted and will fix the problem as soon as possible.",
|
|
4395
|
+
severity: "danger"
|
|
4396
|
+
}
|
|
4249
4397
|
};
|
|
4250
4398
|
function discard(reason, action, retries = 0) {
|
|
4251
4399
|
var _a2;
|
|
@@ -4418,7 +4566,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4418
4566
|
}
|
|
4419
4567
|
// Attachments aren't models, so we use the OptimisticGenericResult type instead
|
|
4420
4568
|
async addIssueAttachment(attachmentPayload) {
|
|
4421
|
-
const {
|
|
4569
|
+
const { issue, file_sha1, offline_id } = attachmentPayload;
|
|
4422
4570
|
if (!attachmentPayload.file.objectURL) {
|
|
4423
4571
|
throw new Error("Expected attachmentPayload.file.objectURL to be defined.");
|
|
4424
4572
|
}
|
|
@@ -4426,7 +4574,9 @@ var __publicField = (obj, key, value) => {
|
|
|
4426
4574
|
...attachmentPayload,
|
|
4427
4575
|
file: attachmentPayload.file.objectURL,
|
|
4428
4576
|
file_name: attachmentPayload.file.name,
|
|
4429
|
-
file_type: attachmentPayload.file.type
|
|
4577
|
+
file_type: attachmentPayload.file.type,
|
|
4578
|
+
submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4579
|
+
created_by: this.client.store.getState().userReducer.currentUser.id
|
|
4430
4580
|
};
|
|
4431
4581
|
await this.client.files.addCache(attachmentPayload.file, file_sha1);
|
|
4432
4582
|
this.client.store.dispatch(addIssueAttachment(offlineAttachment));
|
|
@@ -4438,10 +4588,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4438
4588
|
blocks: [offline_id, issue],
|
|
4439
4589
|
blockers: [file_sha1],
|
|
4440
4590
|
payload: {
|
|
4441
|
-
|
|
4442
|
-
issue,
|
|
4443
|
-
description: description2 ?? "",
|
|
4444
|
-
submitted_at: (/* @__PURE__ */ new Date()).getTime() / 1e3,
|
|
4591
|
+
...offlineAttachment,
|
|
4445
4592
|
...fileProps
|
|
4446
4593
|
}
|
|
4447
4594
|
});
|
|
@@ -4452,7 +4599,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4452
4599
|
return [offlineAttachment, promise];
|
|
4453
4600
|
}
|
|
4454
4601
|
async addComponentAttachment(attachmentPayload) {
|
|
4455
|
-
const {
|
|
4602
|
+
const { component, file_sha1, offline_id } = attachmentPayload;
|
|
4456
4603
|
if (!attachmentPayload.file.objectURL) {
|
|
4457
4604
|
throw new Error("Expected attachmentPayload.file.objectURL to be defined.");
|
|
4458
4605
|
}
|
|
@@ -4460,7 +4607,9 @@ var __publicField = (obj, key, value) => {
|
|
|
4460
4607
|
...attachmentPayload,
|
|
4461
4608
|
file: attachmentPayload.file.objectURL,
|
|
4462
4609
|
file_name: attachmentPayload.file.name,
|
|
4463
|
-
file_type: attachmentPayload.file.type
|
|
4610
|
+
file_type: attachmentPayload.file.type,
|
|
4611
|
+
submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4612
|
+
created_by: this.client.store.getState().userReducer.currentUser.id
|
|
4464
4613
|
};
|
|
4465
4614
|
await this.client.files.addCache(attachmentPayload.file, file_sha1);
|
|
4466
4615
|
this.client.store.dispatch(addComponentAttachment(offlineAttachment));
|
|
@@ -4472,10 +4621,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4472
4621
|
blocks: [offline_id, component],
|
|
4473
4622
|
blockers: [file_sha1],
|
|
4474
4623
|
payload: {
|
|
4475
|
-
|
|
4476
|
-
component,
|
|
4477
|
-
description: description2 ?? "",
|
|
4478
|
-
submitted_at: (/* @__PURE__ */ new Date()).getTime() / 1e3,
|
|
4624
|
+
...offlineAttachment,
|
|
4479
4625
|
...fileProps
|
|
4480
4626
|
}
|
|
4481
4627
|
});
|
|
@@ -4486,7 +4632,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4486
4632
|
return [offlineAttachment, promise];
|
|
4487
4633
|
}
|
|
4488
4634
|
async addComponentTypeAttachment(attachmentPayload) {
|
|
4489
|
-
const {
|
|
4635
|
+
const { component_type, file_sha1, offline_id } = attachmentPayload;
|
|
4490
4636
|
if (!attachmentPayload.file.objectURL) {
|
|
4491
4637
|
throw new Error("Expected attachmentPayload.file.objectURL to be defined.");
|
|
4492
4638
|
}
|
|
@@ -4494,7 +4640,9 @@ var __publicField = (obj, key, value) => {
|
|
|
4494
4640
|
...attachmentPayload,
|
|
4495
4641
|
file: attachmentPayload.file.objectURL,
|
|
4496
4642
|
file_name: attachmentPayload.file.name,
|
|
4497
|
-
file_type: attachmentPayload.file.type
|
|
4643
|
+
file_type: attachmentPayload.file.type,
|
|
4644
|
+
submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4645
|
+
created_by: this.client.store.getState().userReducer.currentUser.id
|
|
4498
4646
|
};
|
|
4499
4647
|
await this.client.files.addCache(attachmentPayload.file, file_sha1);
|
|
4500
4648
|
this.client.store.dispatch(addComponentTypeAttachment(offlineAttachment));
|
|
@@ -4506,10 +4654,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4506
4654
|
blocks: [offline_id, component_type],
|
|
4507
4655
|
blockers: [file_sha1],
|
|
4508
4656
|
payload: {
|
|
4509
|
-
|
|
4510
|
-
component_type,
|
|
4511
|
-
description: description2 ?? "",
|
|
4512
|
-
submitted_at: (/* @__PURE__ */ new Date()).getTime() / 1e3,
|
|
4657
|
+
...offlineAttachment,
|
|
4513
4658
|
...fileProps
|
|
4514
4659
|
}
|
|
4515
4660
|
});
|
|
@@ -4528,7 +4673,9 @@ var __publicField = (obj, key, value) => {
|
|
|
4528
4673
|
...attachmentPayload,
|
|
4529
4674
|
file: attachmentPayload.file.objectURL,
|
|
4530
4675
|
file_name: attachmentPayload.file.name,
|
|
4531
|
-
file_type: attachmentPayload.file.type
|
|
4676
|
+
file_type: attachmentPayload.file.type,
|
|
4677
|
+
submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4678
|
+
created_by: this.client.store.getState().userReducer.currentUser.id
|
|
4532
4679
|
};
|
|
4533
4680
|
await this.client.files.addCache(attachmentPayload.file, file_sha1);
|
|
4534
4681
|
this.client.store.dispatch(addProjectAttachment(offlineAttachment));
|
|
@@ -4568,7 +4715,9 @@ var __publicField = (obj, key, value) => {
|
|
|
4568
4715
|
file_name: file2.name,
|
|
4569
4716
|
file_type: file2.type,
|
|
4570
4717
|
issue: issueId,
|
|
4571
|
-
file_sha1: hash
|
|
4718
|
+
file_sha1: hash,
|
|
4719
|
+
submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4720
|
+
created_by: this.client.store.getState().userReducer.currentUser.id
|
|
4572
4721
|
});
|
|
4573
4722
|
return this.addIssueAttachment(attachment);
|
|
4574
4723
|
};
|
|
@@ -4587,7 +4736,9 @@ var __publicField = (obj, key, value) => {
|
|
|
4587
4736
|
file_name: file2.name,
|
|
4588
4737
|
file_type: file2.type,
|
|
4589
4738
|
component: componentId,
|
|
4590
|
-
file_sha1: hash
|
|
4739
|
+
file_sha1: hash,
|
|
4740
|
+
submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4741
|
+
created_by: this.client.store.getState().userReducer.currentUser.id
|
|
4591
4742
|
});
|
|
4592
4743
|
return this.addComponentAttachment(attachment);
|
|
4593
4744
|
};
|
|
@@ -4606,7 +4757,9 @@ var __publicField = (obj, key, value) => {
|
|
|
4606
4757
|
file_name: file2.name,
|
|
4607
4758
|
file_type: file2.type,
|
|
4608
4759
|
component_type: componentTypeId,
|
|
4609
|
-
file_sha1: hash
|
|
4760
|
+
file_sha1: hash,
|
|
4761
|
+
submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4762
|
+
created_by: this.client.store.getState().userReducer.currentUser.id
|
|
4610
4763
|
});
|
|
4611
4764
|
return this.addComponentTypeAttachment(attachment);
|
|
4612
4765
|
};
|
|
@@ -4625,7 +4778,9 @@ var __publicField = (obj, key, value) => {
|
|
|
4625
4778
|
file_name: file2.name,
|
|
4626
4779
|
file_type: file2.type,
|
|
4627
4780
|
project: projectId,
|
|
4628
|
-
file_sha1: hash
|
|
4781
|
+
file_sha1: hash,
|
|
4782
|
+
submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4783
|
+
created_by: this.client.store.getState().userReducer.currentUser.id
|
|
4629
4784
|
});
|
|
4630
4785
|
return this.addProjectAttachment(attachment);
|
|
4631
4786
|
};
|
|
@@ -5702,49 +5857,35 @@ var __publicField = (obj, key, value) => {
|
|
|
5702
5857
|
}
|
|
5703
5858
|
}
|
|
5704
5859
|
class IssueCommentService extends BaseApiService {
|
|
5860
|
+
// Omit author and submitted_at since these will always be set internally
|
|
5705
5861
|
add(comment) {
|
|
5706
|
-
const offlinePayload = offline(comment);
|
|
5707
|
-
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
5708
5862
|
const { store } = this.client;
|
|
5709
|
-
const offlineComment = {
|
|
5710
|
-
...
|
|
5863
|
+
const offlineComment = offline({
|
|
5864
|
+
...comment,
|
|
5711
5865
|
author: store.getState().userReducer.currentUser.id,
|
|
5712
|
-
|
|
5713
|
-
};
|
|
5714
|
-
store.dispatch(
|
|
5866
|
+
submitted_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
5867
|
+
});
|
|
5868
|
+
store.dispatch(addIssueComment(offlineComment));
|
|
5715
5869
|
const promise = this.enqueueRequest({
|
|
5716
5870
|
description: `${truncate(comment.content, 80)}`,
|
|
5717
5871
|
method: HttpMethod.POST,
|
|
5718
5872
|
url: `/issues/${comment.issue}/comment/`,
|
|
5719
|
-
payload:
|
|
5873
|
+
payload: offlineComment,
|
|
5720
5874
|
blockers: [comment.issue],
|
|
5721
|
-
blocks: [
|
|
5875
|
+
blocks: [offlineComment.offline_id]
|
|
5876
|
+
});
|
|
5877
|
+
promise.catch(() => {
|
|
5878
|
+
store.dispatch(removeIssueComment(offlineComment.offline_id));
|
|
5722
5879
|
});
|
|
5723
5880
|
return [offlineComment, promise];
|
|
5724
5881
|
}
|
|
5725
|
-
|
|
5882
|
+
update(comment) {
|
|
5726
5883
|
const { store } = this.client;
|
|
5727
|
-
const
|
|
5728
|
-
|
|
5729
|
-
|
|
5730
|
-
// TODO: Choose between /issues/comments/in-project/${projectId}/ and /projects/${projectId}/issue-comments/
|
|
5731
|
-
url: `/projects/${store.getState().projectReducer.activeProjectId}/comments/`,
|
|
5732
|
-
blockers: [],
|
|
5733
|
-
blocks: []
|
|
5734
|
-
});
|
|
5735
|
-
let filteredResult = result.filter(onlyUniqueOfflineIds);
|
|
5736
|
-
filteredResult = filteredResult.map((comment) => {
|
|
5737
|
-
return { ...comment };
|
|
5738
|
-
});
|
|
5739
|
-
if (result.length !== filteredResult.length) {
|
|
5740
|
-
console.error(
|
|
5741
|
-
`Received duplicate comments from the API (new length ${filteredResult.length}); filtered in browser.`
|
|
5742
|
-
);
|
|
5884
|
+
const commentToUpdate = store.getState().issueReducer.comments[comment.offline_id];
|
|
5885
|
+
if (!commentToUpdate) {
|
|
5886
|
+
throw new Error(`Comment with offline_id ${comment.offline_id} not found in store`);
|
|
5743
5887
|
}
|
|
5744
|
-
store.dispatch(
|
|
5745
|
-
}
|
|
5746
|
-
update(comment) {
|
|
5747
|
-
this.client.store.dispatch(addOrReplaceIssueComment(comment));
|
|
5888
|
+
store.dispatch(setIssueComment(comment));
|
|
5748
5889
|
const promise = this.enqueueRequest({
|
|
5749
5890
|
description: `Edit comment: ${truncate(comment.content, 80)}`,
|
|
5750
5891
|
method: HttpMethod.PATCH,
|
|
@@ -5753,17 +5894,62 @@ var __publicField = (obj, key, value) => {
|
|
|
5753
5894
|
blockers: [comment.issue],
|
|
5754
5895
|
blocks: [comment.offline_id]
|
|
5755
5896
|
});
|
|
5897
|
+
promise.catch(() => {
|
|
5898
|
+
store.dispatch(setIssueComment(commentToUpdate));
|
|
5899
|
+
});
|
|
5756
5900
|
return [comment, promise];
|
|
5757
5901
|
}
|
|
5758
5902
|
remove(offline_id) {
|
|
5903
|
+
const commentToRemove = this.client.store.getState().issueReducer.comments[offline_id];
|
|
5904
|
+
if (!commentToRemove) {
|
|
5905
|
+
throw new Error(`Comment with offline_id ${offline_id} not found in store`);
|
|
5906
|
+
}
|
|
5759
5907
|
this.client.store.dispatch(removeIssueComment(offline_id));
|
|
5760
|
-
|
|
5908
|
+
const promise = this.enqueueRequest({
|
|
5761
5909
|
description: "Delete comment",
|
|
5762
5910
|
method: HttpMethod.DELETE,
|
|
5763
5911
|
url: `/issues/comments/${offline_id}/`,
|
|
5764
5912
|
blockers: [offline_id],
|
|
5765
5913
|
blocks: []
|
|
5766
5914
|
});
|
|
5915
|
+
promise.catch(() => {
|
|
5916
|
+
this.client.store.dispatch(addIssueComment(commentToRemove));
|
|
5917
|
+
});
|
|
5918
|
+
return promise;
|
|
5919
|
+
}
|
|
5920
|
+
async refreshStore() {
|
|
5921
|
+
const { store } = this.client;
|
|
5922
|
+
const result = await this.enqueueRequest({
|
|
5923
|
+
description: "Get comments",
|
|
5924
|
+
method: HttpMethod.GET,
|
|
5925
|
+
// TODO: Choose between /issues/comments/in-project/${projectId}/ and /projects/${projectId}/issue-comments/
|
|
5926
|
+
url: `/projects/${store.getState().projectReducer.activeProjectId}/comments/`,
|
|
5927
|
+
blockers: [],
|
|
5928
|
+
blocks: []
|
|
5929
|
+
});
|
|
5930
|
+
store.dispatch(setIssueComments(result));
|
|
5931
|
+
}
|
|
5932
|
+
}
|
|
5933
|
+
class IssueUpdateService extends BaseApiService {
|
|
5934
|
+
async refreshStore() {
|
|
5935
|
+
const { store } = this.client;
|
|
5936
|
+
const result = await this.enqueueRequest({
|
|
5937
|
+
description: "Get issue updates",
|
|
5938
|
+
method: HttpMethod.GET,
|
|
5939
|
+
url: `/projects/${store.getState().projectReducer.activeProjectId}/issues/updates/`,
|
|
5940
|
+
blockers: [],
|
|
5941
|
+
blocks: []
|
|
5942
|
+
});
|
|
5943
|
+
let filteredResult = result.filter(onlyUniqueOfflineIds);
|
|
5944
|
+
filteredResult = filteredResult.map((comment) => {
|
|
5945
|
+
return { ...comment };
|
|
5946
|
+
});
|
|
5947
|
+
if (result.length !== filteredResult.length) {
|
|
5948
|
+
console.error(
|
|
5949
|
+
`Received duplicate comments from the API (new length ${filteredResult.length}); filtered in browser.`
|
|
5950
|
+
);
|
|
5951
|
+
}
|
|
5952
|
+
store.dispatch(setIssueUpdates(filteredResult));
|
|
5767
5953
|
}
|
|
5768
5954
|
}
|
|
5769
5955
|
class IssueService extends BaseApiService {
|
|
@@ -5844,7 +6030,83 @@ var __publicField = (obj, key, value) => {
|
|
|
5844
6030
|
return [offlineIssues, promise];
|
|
5845
6031
|
}
|
|
5846
6032
|
update(issue) {
|
|
6033
|
+
const state = this.client.store.getState();
|
|
6034
|
+
const issueToBeUpdated = state.issueReducer.issues[issue.offline_id];
|
|
6035
|
+
if (!issueToBeUpdated) {
|
|
6036
|
+
throw new Error(
|
|
6037
|
+
`Attempting to update an issue with offline_id ${issue.offline_id} that doesn't exist in the store`
|
|
6038
|
+
);
|
|
6039
|
+
}
|
|
5847
6040
|
this.client.store.dispatch(updateIssue(issue));
|
|
6041
|
+
const changes = {};
|
|
6042
|
+
for (const issueUpdateChange of [
|
|
6043
|
+
IssueUpdateChange.TITLE,
|
|
6044
|
+
IssueUpdateChange.DESCRIPTION,
|
|
6045
|
+
IssueUpdateChange.STATUS,
|
|
6046
|
+
IssueUpdateChange.CATEGORY,
|
|
6047
|
+
IssueUpdateChange.PRIORITY,
|
|
6048
|
+
IssueUpdateChange.ASSIGNED_TO,
|
|
6049
|
+
IssueUpdateChange.DUE_DATE
|
|
6050
|
+
]) {
|
|
6051
|
+
if (issueUpdateChange in issue && issue[issueUpdateChange] !== issueToBeUpdated[issueUpdateChange]) {
|
|
6052
|
+
switch (issueUpdateChange) {
|
|
6053
|
+
case "category": {
|
|
6054
|
+
let categoryOrNull = null;
|
|
6055
|
+
const categoryIdOrNull = issue[issueUpdateChange];
|
|
6056
|
+
if (categoryIdOrNull) {
|
|
6057
|
+
categoryOrNull = state.categoryReducer.categories[categoryIdOrNull] ?? null;
|
|
6058
|
+
if (!categoryOrNull)
|
|
6059
|
+
throw new Error(
|
|
6060
|
+
`Trying to update issue category to ${categoryIdOrNull} which does not exist in store`
|
|
6061
|
+
);
|
|
6062
|
+
}
|
|
6063
|
+
changes[issueUpdateChange] = categoryOrNull ? {
|
|
6064
|
+
name: categoryOrNull.name,
|
|
6065
|
+
color: categoryOrNull.color,
|
|
6066
|
+
offline_id: categoryOrNull.offline_id
|
|
6067
|
+
} : null;
|
|
6068
|
+
break;
|
|
6069
|
+
}
|
|
6070
|
+
case "assigned_to": {
|
|
6071
|
+
let userOrNull = null;
|
|
6072
|
+
const userIdOrNull = issue[issueUpdateChange];
|
|
6073
|
+
if (userIdOrNull) {
|
|
6074
|
+
userOrNull = state.userReducer.users[userIdOrNull] ?? null;
|
|
6075
|
+
if (!userOrNull)
|
|
6076
|
+
throw new Error(
|
|
6077
|
+
`Trying to update issue assigned_to to ${userIdOrNull} which does not exist in store`
|
|
6078
|
+
);
|
|
6079
|
+
}
|
|
6080
|
+
changes[issueUpdateChange] = userOrNull ? {
|
|
6081
|
+
full_name: userOrNull.username,
|
|
6082
|
+
id: userOrNull.id
|
|
6083
|
+
} : null;
|
|
6084
|
+
break;
|
|
6085
|
+
}
|
|
6086
|
+
case "description":
|
|
6087
|
+
changes[issueUpdateChange] = issue[issueUpdateChange] ?? null;
|
|
6088
|
+
break;
|
|
6089
|
+
case "title":
|
|
6090
|
+
changes[issueUpdateChange] = issue[issueUpdateChange] ?? null;
|
|
6091
|
+
break;
|
|
6092
|
+
case "priority":
|
|
6093
|
+
changes[issueUpdateChange] = issue[issueUpdateChange];
|
|
6094
|
+
break;
|
|
6095
|
+
case "status":
|
|
6096
|
+
changes[issueUpdateChange] = issue[issueUpdateChange];
|
|
6097
|
+
break;
|
|
6098
|
+
case "due_date":
|
|
6099
|
+
changes[issueUpdateChange] = issue[issueUpdateChange] ? issue[issueUpdateChange] : null;
|
|
6100
|
+
}
|
|
6101
|
+
}
|
|
6102
|
+
}
|
|
6103
|
+
const offlineIssueUpdate = offline({
|
|
6104
|
+
created_by: state.userReducer.currentUser.id,
|
|
6105
|
+
submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
6106
|
+
issue: issueToBeUpdated.offline_id,
|
|
6107
|
+
changes
|
|
6108
|
+
});
|
|
6109
|
+
this.client.store.dispatch(addIssueUpdate(offlineIssueUpdate));
|
|
5848
6110
|
const promise = this.enqueueRequest({
|
|
5849
6111
|
description: "Edit issue",
|
|
5850
6112
|
method: HttpMethod.PATCH,
|
|
@@ -5853,23 +6115,30 @@ var __publicField = (obj, key, value) => {
|
|
|
5853
6115
|
blockers: [issue.offline_id],
|
|
5854
6116
|
blocks: [issue.offline_id]
|
|
5855
6117
|
});
|
|
6118
|
+
promise.catch(() => {
|
|
6119
|
+
this.client.store.dispatch(updateIssue(issueToBeUpdated));
|
|
6120
|
+
this.client.store.dispatch(removeIssueUpdate(offlineIssueUpdate.offline_id));
|
|
6121
|
+
});
|
|
5856
6122
|
const fullIssue = this.client.store.getState().issueReducer.issues[issue.offline_id];
|
|
5857
6123
|
return [fullIssue, promise];
|
|
5858
6124
|
}
|
|
5859
6125
|
async remove(id) {
|
|
5860
6126
|
const { store } = this.client;
|
|
5861
6127
|
const state = store.getState();
|
|
6128
|
+
const dispatch = store.dispatch;
|
|
5862
6129
|
const backup = state.issueReducer.issues[id];
|
|
5863
6130
|
if (!backup) {
|
|
5864
6131
|
throw new Error(`No issue with id ${id} found in the store`);
|
|
5865
6132
|
}
|
|
5866
6133
|
const attachments = Object.values(state.issueReducer.attachments).filter((a) => a.issue === id);
|
|
5867
6134
|
const attachmentsOfIssue = selectAttachmentsOfIssue(id)(state);
|
|
5868
|
-
|
|
5869
|
-
|
|
5870
|
-
|
|
5871
|
-
|
|
5872
|
-
|
|
6135
|
+
const updatesOfIssue = selectIssueUpdatesOfIssue(id)(state);
|
|
6136
|
+
dispatch(removeIssue(id));
|
|
6137
|
+
dispatch(addActiveProjectIssuesCount(-1));
|
|
6138
|
+
if (attachmentsOfIssue.length > 0)
|
|
6139
|
+
dispatch(removeAttachmentsOfIssue(id));
|
|
6140
|
+
if (updatesOfIssue.length > 0)
|
|
6141
|
+
dispatch(removeIssueUpdates(updatesOfIssue.map(({ offline_id }) => offline_id)));
|
|
5873
6142
|
try {
|
|
5874
6143
|
return await this.enqueueRequest({
|
|
5875
6144
|
description: "Delete issue",
|
|
@@ -5879,9 +6148,10 @@ var __publicField = (obj, key, value) => {
|
|
|
5879
6148
|
blocks: []
|
|
5880
6149
|
});
|
|
5881
6150
|
} catch (e) {
|
|
5882
|
-
|
|
5883
|
-
|
|
5884
|
-
|
|
6151
|
+
dispatch(addIssue(backup));
|
|
6152
|
+
dispatch(addIssueAttachments(attachments));
|
|
6153
|
+
dispatch(addIssueUpdates(updatesOfIssue));
|
|
6154
|
+
dispatch(addActiveProjectIssuesCount(1));
|
|
5885
6155
|
throw e;
|
|
5886
6156
|
}
|
|
5887
6157
|
}
|
|
@@ -6063,6 +6333,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6063
6333
|
store.dispatch(setProjectAttachments(project_attachments));
|
|
6064
6334
|
});
|
|
6065
6335
|
void this.client.documents.refreshStore();
|
|
6336
|
+
void this.client.issueUpdates.refreshStore();
|
|
6066
6337
|
}
|
|
6067
6338
|
store.dispatch(setIsFetchingInitialData(false));
|
|
6068
6339
|
if (overwrite) {
|
|
@@ -7490,7 +7761,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7490
7761
|
* @param request The message to prompt the agent with.
|
|
7491
7762
|
* @param conversationId If continuing an existing message, the UUID of that conversation.
|
|
7492
7763
|
*/
|
|
7493
|
-
prompt(request2, conversationId) {
|
|
7764
|
+
async prompt(request2, conversationId) {
|
|
7494
7765
|
const activeProjectId = this.client.store.getState().projectReducer.activeProjectId;
|
|
7495
7766
|
return this.enqueueRequest({
|
|
7496
7767
|
description: "Prompt agent",
|
|
@@ -7505,6 +7776,16 @@ var __publicField = (obj, key, value) => {
|
|
|
7505
7776
|
queryParams: conversationId ? { conversation_id: conversationId } : {}
|
|
7506
7777
|
});
|
|
7507
7778
|
}
|
|
7779
|
+
async rate(responseId, rating) {
|
|
7780
|
+
return this.enqueueRequest({
|
|
7781
|
+
description: "Rate agent response",
|
|
7782
|
+
method: HttpMethod.PUT,
|
|
7783
|
+
url: `/agents/responses/${responseId}/rate/`,
|
|
7784
|
+
payload: { rating },
|
|
7785
|
+
blockers: ["rate"],
|
|
7786
|
+
blocks: ["rate"]
|
|
7787
|
+
});
|
|
7788
|
+
}
|
|
7508
7789
|
}
|
|
7509
7790
|
class OvermapSDK {
|
|
7510
7791
|
constructor(apiUrl, store) {
|
|
@@ -7520,6 +7801,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7520
7801
|
__publicField(this, "organizationAccess", new OrganizationAccessService(this));
|
|
7521
7802
|
__publicField(this, "issues", new IssueService(this));
|
|
7522
7803
|
__publicField(this, "issueComments", new IssueCommentService(this));
|
|
7804
|
+
__publicField(this, "issueUpdates", new IssueUpdateService(this));
|
|
7523
7805
|
__publicField(this, "workspaces", new WorkspaceService(this));
|
|
7524
7806
|
__publicField(this, "main", new MainService(this));
|
|
7525
7807
|
__publicField(this, "components", new ComponentService(this));
|
|
@@ -12993,52 +13275,54 @@ var __publicField = (obj, key, value) => {
|
|
|
12993
13275
|
Footer,
|
|
12994
13276
|
Loading
|
|
12995
13277
|
};
|
|
12996
|
-
const ImageCard = React.memo(
|
|
12997
|
-
|
|
12998
|
-
|
|
12999
|
-
|
|
13000
|
-
|
|
13001
|
-
|
|
13002
|
-
|
|
13003
|
-
|
|
13004
|
-
|
|
13005
|
-
|
|
13006
|
-
|
|
13007
|
-
|
|
13008
|
-
|
|
13009
|
-
|
|
13010
|
-
|
|
13011
|
-
|
|
13012
|
-
|
|
13013
|
-
|
|
13014
|
-
|
|
13015
|
-
|
|
13016
|
-
|
|
13017
|
-
|
|
13018
|
-
|
|
13019
|
-
|
|
13020
|
-
|
|
13021
|
-
|
|
13022
|
-
|
|
13023
|
-
|
|
13024
|
-
|
|
13025
|
-
|
|
13026
|
-
|
|
13027
|
-
|
|
13028
|
-
|
|
13029
|
-
|
|
13030
|
-
|
|
13031
|
-
|
|
13032
|
-
|
|
13033
|
-
|
|
13034
|
-
|
|
13035
|
-
|
|
13036
|
-
|
|
13037
|
-
|
|
13038
|
-
|
|
13039
|
-
|
|
13040
|
-
|
|
13041
|
-
|
|
13278
|
+
const ImageCard = React.memo(
|
|
13279
|
+
React.forwardRef((props, forwardedRef) => {
|
|
13280
|
+
const { file, alt, error: error2, size, rightSlot, className, truncateLength, ...rest } = props;
|
|
13281
|
+
const fileCardRef = React.useRef(null);
|
|
13282
|
+
const imageInsetRef = React.useRef(null);
|
|
13283
|
+
const fileCardSize = blocks.useSize(fileCardRef);
|
|
13284
|
+
React.useLayoutEffect(() => {
|
|
13285
|
+
if (!imageInsetRef.current || !fileCardSize)
|
|
13286
|
+
return;
|
|
13287
|
+
imageInsetRef.current.style.height = `${fileCardSize.height * 4}px`;
|
|
13288
|
+
}, [fileCardSize]);
|
|
13289
|
+
const fileName2 = React.useMemo(() => {
|
|
13290
|
+
if (!file)
|
|
13291
|
+
return;
|
|
13292
|
+
return truncateLength !== void 0 ? truncate(file.name, truncateLength) : file.name;
|
|
13293
|
+
}, [file, truncateLength]);
|
|
13294
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
13295
|
+
Flex,
|
|
13296
|
+
{
|
|
13297
|
+
className: classNames$1(className, styles$4.ImageCard),
|
|
13298
|
+
width: "100%",
|
|
13299
|
+
direction: "column",
|
|
13300
|
+
position: "relative",
|
|
13301
|
+
height: "max-content",
|
|
13302
|
+
gap: "0",
|
|
13303
|
+
ref: forwardedRef,
|
|
13304
|
+
...rest,
|
|
13305
|
+
children: [
|
|
13306
|
+
!file && !error2 && /* @__PURE__ */ jsxRuntime.jsx(Flex, { width: "100%", height: "100%", align: "center", justify: "center", position: "absolute", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.Spinner, {}) }),
|
|
13307
|
+
/* @__PURE__ */ jsxRuntime.jsx(Inset, { className: styles$4.ImageInset, ref: imageInsetRef, clip: "padding-box", side: "y", pb: "0", children: file && !error2 && /* @__PURE__ */ jsxRuntime.jsx("img", { className: styles$4.Image, src: URL.createObjectURL(file), alt: alt ?? file.name }) }),
|
|
13308
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13309
|
+
blocks.OvermapItem,
|
|
13310
|
+
{
|
|
13311
|
+
className: classNames$1(styles$4.Footer, {
|
|
13312
|
+
[styles$4.Loading]: !file
|
|
13313
|
+
}),
|
|
13314
|
+
size,
|
|
13315
|
+
ref: fileCardRef,
|
|
13316
|
+
leftSlot: error2 ? /* @__PURE__ */ jsxRuntime.jsx(blocks.RiIcon, { icon: "RiFileWarningLine" }) : file && /* @__PURE__ */ jsxRuntime.jsx(FileIcon, { fileType: file.type }),
|
|
13317
|
+
rightSlot,
|
|
13318
|
+
children: error2 ?? fileName2
|
|
13319
|
+
}
|
|
13320
|
+
)
|
|
13321
|
+
]
|
|
13322
|
+
}
|
|
13323
|
+
);
|
|
13324
|
+
})
|
|
13325
|
+
);
|
|
13042
13326
|
const UploadInput = React.memo((props) => {
|
|
13043
13327
|
var _a2;
|
|
13044
13328
|
const [{ inputId, labelId, size, severity, helpText, showInputOnly, field, fieldProps }, rest] = useFormikInput(props);
|
|
@@ -14175,17 +14459,15 @@ var __publicField = (obj, key, value) => {
|
|
|
14175
14459
|
Action.key
|
|
14176
14460
|
)) }),
|
|
14177
14461
|
/* @__PURE__ */ jsxRuntime.jsx(Box, { display: forMobile(true, "block"), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
14178
|
-
blocks.
|
|
14462
|
+
blocks.OvermapDropdownMenu,
|
|
14179
14463
|
{
|
|
14180
14464
|
trigger: /* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { variant: "ghost", "aria-label": "Actions menu", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.RiIcon, { icon: "RiMore2Line" }) }),
|
|
14181
14465
|
items: actions.map((Action) => {
|
|
14182
14466
|
var _a2;
|
|
14183
14467
|
return {
|
|
14184
|
-
|
|
14185
|
-
|
|
14186
|
-
|
|
14187
|
-
] }, Action.key),
|
|
14188
|
-
onSelect: (_a2 = Action.buttonProps) == null ? void 0 : _a2.onClick
|
|
14468
|
+
leftSlot: /* @__PURE__ */ jsxRuntime.jsx(Action.Icon, {}),
|
|
14469
|
+
children: Action.text,
|
|
14470
|
+
onClick: (_a2 = Action.buttonProps) == null ? void 0 : _a2.onClick
|
|
14189
14471
|
};
|
|
14190
14472
|
})
|
|
14191
14473
|
}
|
|
@@ -14243,10 +14525,8 @@ var __publicField = (obj, key, value) => {
|
|
|
14243
14525
|
const field = FieldTypeToClsMapping[identifier];
|
|
14244
14526
|
const Icon = field.Icon;
|
|
14245
14527
|
return {
|
|
14246
|
-
|
|
14247
|
-
|
|
14248
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.Text, { children: field.fieldTypeName })
|
|
14249
|
-
] }, identifier),
|
|
14528
|
+
children: field.fieldTypeName,
|
|
14529
|
+
leftSlot: /* @__PURE__ */ jsxRuntime.jsx(Icon, {}),
|
|
14250
14530
|
value: identifier,
|
|
14251
14531
|
onSelect: () => {
|
|
14252
14532
|
onSelect(identifier);
|
|
@@ -14450,7 +14730,7 @@ var __publicField = (obj, key, value) => {
|
|
|
14450
14730
|
}
|
|
14451
14731
|
),
|
|
14452
14732
|
/* @__PURE__ */ jsxRuntime.jsxs(blocks.Flex, { align: "center", gap: "3", children: [
|
|
14453
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.Badge, { className: styles.typeBadge, children: (_f = fieldTypeItems.flat().find((item) => item.value === type)) == null ? void 0 : _f.
|
|
14733
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.Badge, { className: styles.typeBadge, children: (_f = fieldTypeItems.flat().find((item) => item.value === type)) == null ? void 0 : _f.children }),
|
|
14454
14734
|
showPopoverInputs && /* @__PURE__ */ jsxRuntime.jsx(FieldSettingsPopover, { popoverInputs, hasError: popoverHasErrors })
|
|
14455
14735
|
] }),
|
|
14456
14736
|
resolvedImage && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
@@ -14811,7 +15091,7 @@ var __publicField = (obj, key, value) => {
|
|
|
14811
15091
|
)),
|
|
14812
15092
|
droppableProvided.placeholder,
|
|
14813
15093
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
14814
|
-
blocks.
|
|
15094
|
+
blocks.OvermapDropdownMenu,
|
|
14815
15095
|
{
|
|
14816
15096
|
trigger: /* @__PURE__ */ jsxRuntime.jsxs(blocks.Button, { type: "button", variant: "soft", children: [
|
|
14817
15097
|
/* @__PURE__ */ jsxRuntime.jsx(blocks.RiIcon, { icon: "RiAddLine" }),
|
|
@@ -15246,6 +15526,8 @@ var __publicField = (obj, key, value) => {
|
|
|
15246
15526
|
exports2.IssuePriority = IssuePriority;
|
|
15247
15527
|
exports2.IssueService = IssueService;
|
|
15248
15528
|
exports2.IssueStatus = IssueStatus;
|
|
15529
|
+
exports2.IssueUpdateChange = IssueUpdateChange;
|
|
15530
|
+
exports2.IssueUpdateService = IssueUpdateService;
|
|
15249
15531
|
exports2.LicenseLevel = LicenseLevel;
|
|
15250
15532
|
exports2.LicenseService = LicenseService;
|
|
15251
15533
|
exports2.LicenseStatus = LicenseStatus;
|
|
@@ -15309,6 +15591,10 @@ var __publicField = (obj, key, value) => {
|
|
|
15309
15591
|
exports2.addIssue = addIssue;
|
|
15310
15592
|
exports2.addIssueAttachment = addIssueAttachment;
|
|
15311
15593
|
exports2.addIssueAttachments = addIssueAttachments;
|
|
15594
|
+
exports2.addIssueComment = addIssueComment;
|
|
15595
|
+
exports2.addIssueComments = addIssueComments;
|
|
15596
|
+
exports2.addIssueUpdate = addIssueUpdate;
|
|
15597
|
+
exports2.addIssueUpdates = addIssueUpdates;
|
|
15312
15598
|
exports2.addLicenses = addLicenses;
|
|
15313
15599
|
exports2.addOrReplaceCategories = addOrReplaceCategories;
|
|
15314
15600
|
exports2.addOrReplaceIssueComment = addOrReplaceIssueComment;
|
|
@@ -15468,6 +15754,9 @@ var __publicField = (obj, key, value) => {
|
|
|
15468
15754
|
exports2.removeIssue = removeIssue;
|
|
15469
15755
|
exports2.removeIssueAttachment = removeIssueAttachment;
|
|
15470
15756
|
exports2.removeIssueComment = removeIssueComment;
|
|
15757
|
+
exports2.removeIssueComments = removeIssueComments;
|
|
15758
|
+
exports2.removeIssueUpdate = removeIssueUpdate;
|
|
15759
|
+
exports2.removeIssueUpdates = removeIssueUpdates;
|
|
15471
15760
|
exports2.removeOrganizationAccess = removeOrganizationAccess;
|
|
15472
15761
|
exports2.removeProjectAccess = removeProjectAccess;
|
|
15473
15762
|
exports2.removeProjectAccessesOfProject = removeProjectAccessesOfProject;
|
|
@@ -15529,11 +15818,13 @@ var __publicField = (obj, key, value) => {
|
|
|
15529
15818
|
exports2.selectCompletedStages = selectCompletedStages;
|
|
15530
15819
|
exports2.selectComponent = selectComponent;
|
|
15531
15820
|
exports2.selectComponentAttachmentMapping = selectComponentAttachmentMapping;
|
|
15821
|
+
exports2.selectComponentSubmissionMapping = selectComponentSubmissionMapping;
|
|
15532
15822
|
exports2.selectComponentType = selectComponentType;
|
|
15533
15823
|
exports2.selectComponentTypeAttachmentMapping = selectComponentTypeAttachmentMapping;
|
|
15534
15824
|
exports2.selectComponentTypeForm = selectComponentTypeForm;
|
|
15535
15825
|
exports2.selectComponentTypeFromComponent = selectComponentTypeFromComponent;
|
|
15536
15826
|
exports2.selectComponentTypeFromComponents = selectComponentTypeFromComponents;
|
|
15827
|
+
exports2.selectComponentTypeStagesMapping = selectComponentTypeStagesMapping;
|
|
15537
15828
|
exports2.selectComponentTypes = selectComponentTypes;
|
|
15538
15829
|
exports2.selectComponentTypesByName = selectComponentTypesByName;
|
|
15539
15830
|
exports2.selectComponentTypesFromIds = selectComponentTypesFromIds;
|
|
@@ -15541,6 +15832,7 @@ var __publicField = (obj, key, value) => {
|
|
|
15541
15832
|
exports2.selectComponents = selectComponents;
|
|
15542
15833
|
exports2.selectComponentsByType = selectComponentsByType;
|
|
15543
15834
|
exports2.selectComponentsFromComponentType = selectComponentsFromComponentType;
|
|
15835
|
+
exports2.selectComponentsMapping = selectComponentsMapping;
|
|
15544
15836
|
exports2.selectCreateProjectType = selectCreateProjectType;
|
|
15545
15837
|
exports2.selectCurrentUser = selectCurrentUser;
|
|
15546
15838
|
exports2.selectDeletedRequests = selectDeletedRequests;
|
|
@@ -15569,6 +15861,8 @@ var __publicField = (obj, key, value) => {
|
|
|
15569
15861
|
exports2.selectIssueAttachmentMapping = selectIssueAttachmentMapping;
|
|
15570
15862
|
exports2.selectIssueAttachments = selectIssueAttachments;
|
|
15571
15863
|
exports2.selectIssueMapping = selectIssueMapping;
|
|
15864
|
+
exports2.selectIssueUpdateMapping = selectIssueUpdateMapping;
|
|
15865
|
+
exports2.selectIssueUpdatesOfIssue = selectIssueUpdatesOfIssue;
|
|
15572
15866
|
exports2.selectIssues = selectIssues;
|
|
15573
15867
|
exports2.selectLatestFormRevision = selectLatestFormRevision;
|
|
15574
15868
|
exports2.selectLatestRetryTime = selectLatestRetryTime;
|
|
@@ -15620,6 +15914,7 @@ var __publicField = (obj, key, value) => {
|
|
|
15620
15914
|
exports2.selectSortedOrganizationUsers = selectSortedOrganizationUsers;
|
|
15621
15915
|
exports2.selectSortedProjectUsers = selectSortedProjectUsers;
|
|
15622
15916
|
exports2.selectSortedProjects = selectSortedProjects;
|
|
15917
|
+
exports2.selectStage = selectStage;
|
|
15623
15918
|
exports2.selectStageFormIdsFromStageIds = selectStageFormIdsFromStageIds;
|
|
15624
15919
|
exports2.selectStageMapping = selectStageMapping;
|
|
15625
15920
|
exports2.selectStages = selectStages;
|
|
@@ -15635,6 +15930,7 @@ var __publicField = (obj, key, value) => {
|
|
|
15635
15930
|
exports2.selectUser = selectUser;
|
|
15636
15931
|
exports2.selectUserForm = selectUserForm;
|
|
15637
15932
|
exports2.selectUserFormMapping = selectUserFormMapping;
|
|
15933
|
+
exports2.selectUserFormSubmission = selectUserFormSubmission;
|
|
15638
15934
|
exports2.selectUsersAsMapping = selectUsersAsMapping;
|
|
15639
15935
|
exports2.selectVisibleStatuses = selectVisibleStatuses;
|
|
15640
15936
|
exports2.selectVisibleUserIds = selectVisibleUserIds;
|
|
@@ -15664,7 +15960,9 @@ var __publicField = (obj, key, value) => {
|
|
|
15664
15960
|
exports2.setIsImportingProjectFile = setIsImportingProjectFile;
|
|
15665
15961
|
exports2.setIsLoading = setIsLoading;
|
|
15666
15962
|
exports2.setIssueAttachments = setIssueAttachments;
|
|
15963
|
+
exports2.setIssueComment = setIssueComment;
|
|
15667
15964
|
exports2.setIssueComments = setIssueComments;
|
|
15965
|
+
exports2.setIssueUpdates = setIssueUpdates;
|
|
15668
15966
|
exports2.setIssues = setIssues;
|
|
15669
15967
|
exports2.setLicenses = setLicenses;
|
|
15670
15968
|
exports2.setLoggedIn = setLoggedIn;
|