@overmap-ai/core 1.0.65-bulk-form-submit.0 → 1.0.65-error-message-fix.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.
|
@@ -217,13 +217,16 @@ var __publicField = (obj, key, value) => {
|
|
|
217
217
|
const MAX_ERROR_MESSAGE_LENGTH = 500;
|
|
218
218
|
const _SPECIAL_KEYS = ["non_field_errors", "detail"];
|
|
219
219
|
function extractErrorMessage(errorRes, err) {
|
|
220
|
+
console.debug("extracting error message from response", errorRes, err);
|
|
220
221
|
let ret;
|
|
221
222
|
if (errorRes == null ? void 0 : errorRes.body) {
|
|
222
223
|
if (typeof errorRes.body === "object") {
|
|
223
224
|
const responseBody = errorRes.body;
|
|
224
225
|
if (typeof responseBody.error === "string") {
|
|
226
|
+
console.debug("body.error is string", responseBody.error);
|
|
225
227
|
ret = responseBody.error;
|
|
226
228
|
} else if (typeof responseBody.message === "string") {
|
|
229
|
+
console.debug("body.message is string", responseBody.message);
|
|
227
230
|
ret = responseBody.message;
|
|
228
231
|
} else if (responseBody.body) {
|
|
229
232
|
try {
|
|
@@ -240,11 +243,13 @@ var __publicField = (obj, key, value) => {
|
|
|
240
243
|
}
|
|
241
244
|
return `${key}: ${JSON.stringify(value)}`;
|
|
242
245
|
}).join("\n");
|
|
246
|
+
console.debug("parsing error body", ret);
|
|
243
247
|
} catch (e) {
|
|
244
248
|
console.error("Failed to extract error message from response body", e);
|
|
245
249
|
}
|
|
246
250
|
}
|
|
247
251
|
} else if (typeof errorRes.body === "string") {
|
|
252
|
+
console.debug("error body is string", errorRes.body);
|
|
248
253
|
ret = errorRes.body;
|
|
249
254
|
}
|
|
250
255
|
} else if (errorRes == null ? void 0 : errorRes.text) {
|
|
@@ -645,7 +650,7 @@ var __publicField = (obj, key, value) => {
|
|
|
645
650
|
const fullAssetMarkerSize = 45;
|
|
646
651
|
const DEFAULT_ISSUE_STATUS = IssueStatus.BACKLOG;
|
|
647
652
|
const DEFAULT_ISSUE_PRIORITY = IssuePriority.MEDIUM;
|
|
648
|
-
const OUTBOX_RETRY_DELAY =
|
|
653
|
+
const OUTBOX_RETRY_DELAY = 6e4;
|
|
649
654
|
const EMPTY_ARRAY = Object.freeze([]);
|
|
650
655
|
let debug = false;
|
|
651
656
|
const REACT_APP_DEBUG_MEMOIZATION = {}.REACT_APP_DEBUG_MEMOIZATION || "";
|
|
@@ -6211,22 +6216,50 @@ var __publicField = (obj, key, value) => {
|
|
|
6211
6216
|
}
|
|
6212
6217
|
}
|
|
6213
6218
|
async refreshStore(projectId) {
|
|
6214
|
-
const
|
|
6215
|
-
|
|
6219
|
+
const formSubmissions = {};
|
|
6220
|
+
const modelSubmissions = await this.enqueueRequest({
|
|
6221
|
+
description: "Fetch model submissions",
|
|
6216
6222
|
method: HttpMethod.GET,
|
|
6217
|
-
url: `/forms/in-project/${projectId}/submissions/`,
|
|
6223
|
+
url: `/forms/in-project/${projectId}/submissions/model/latest/`,
|
|
6218
6224
|
blockers: [],
|
|
6219
6225
|
blocks: []
|
|
6220
6226
|
});
|
|
6221
|
-
|
|
6222
|
-
|
|
6223
|
-
|
|
6227
|
+
for (const modelSubmission of modelSubmissions) {
|
|
6228
|
+
formSubmissions[modelSubmission.offline_id] = modelSubmission;
|
|
6229
|
+
}
|
|
6230
|
+
const standaloneSubmissions = await this.enqueueRequest({
|
|
6231
|
+
description: "Fetch standalone submissions",
|
|
6232
|
+
method: HttpMethod.GET,
|
|
6233
|
+
url: `/forms/in-project/${projectId}/submissions/standalone/`,
|
|
6234
|
+
blockers: [],
|
|
6235
|
+
blocks: []
|
|
6236
|
+
});
|
|
6237
|
+
for (const standaloneSubmission of standaloneSubmissions) {
|
|
6238
|
+
formSubmissions[standaloneSubmission.offline_id] = standaloneSubmission;
|
|
6239
|
+
}
|
|
6240
|
+
this.dispatch(initializeFormSubmissions(Object.values(formSubmissions)));
|
|
6241
|
+
const attachments = {};
|
|
6242
|
+
const modelAttachments = await this.enqueueRequest({
|
|
6243
|
+
description: "Fetch model submission attachments",
|
|
6224
6244
|
method: HttpMethod.GET,
|
|
6225
|
-
url: `/forms/in-project/${projectId}/attachments/`,
|
|
6245
|
+
url: `/forms/in-project/${projectId}/attachments/model/latest/`,
|
|
6226
6246
|
blockers: [],
|
|
6227
6247
|
blocks: []
|
|
6228
6248
|
});
|
|
6229
|
-
|
|
6249
|
+
for (const modelAttachment of modelAttachments) {
|
|
6250
|
+
attachments[modelAttachment.offline_id] = modelAttachment;
|
|
6251
|
+
}
|
|
6252
|
+
const standaloneAttachments = await this.enqueueRequest({
|
|
6253
|
+
description: "Fetch standalone submission attachments",
|
|
6254
|
+
method: HttpMethod.GET,
|
|
6255
|
+
url: `/forms/in-project/${projectId}/attachments/standalone/`,
|
|
6256
|
+
blockers: [],
|
|
6257
|
+
blocks: []
|
|
6258
|
+
});
|
|
6259
|
+
for (const standaloneAttachent of standaloneAttachments) {
|
|
6260
|
+
attachments[standaloneAttachent.offline_id] = standaloneAttachent;
|
|
6261
|
+
}
|
|
6262
|
+
this.dispatch(initializeFormSubmissionAttachments(Object.values(attachments)));
|
|
6230
6263
|
}
|
|
6231
6264
|
}
|
|
6232
6265
|
class WorkspaceService extends BaseApiService {
|