@overmap-ai/core 1.0.58-asset-description.8 → 1.0.58-no-hardcoding-api-urls.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/README.md +4 -4
- package/dist/contexts/overmap.d.ts +1 -1
- package/dist/contexts/sdk/sdk.d.ts +2 -2
- package/dist/forms/fields/BaseField/BaseField.d.ts +1 -3
- package/dist/forms/fields/MultiStringField/MultiStringField.d.ts +6 -6
- package/dist/forms/fields/typings.d.ts +1 -1
- package/dist/forms/fields/utils.d.ts +0 -2
- package/dist/forms/index.d.ts +0 -1
- package/dist/overmap-core.js +115 -250
- package/dist/overmap-core.js.map +1 -1
- package/dist/overmap-core.umd.cjs +115 -250
- package/dist/overmap-core.umd.cjs.map +1 -1
- package/dist/sdk/services/AssetService.d.ts +2 -2
- package/dist/sdk/services/UserFormSubmissionService.d.ts +5 -5
- package/dist/store/slices/assetSlice.d.ts +1 -3
- package/dist/typings/models/components.d.ts +0 -1
- package/package.json +1 -1
- package/dist/utils/array.d.ts +0 -1
|
@@ -1728,16 +1728,6 @@ var __publicField = (obj, key, value) => {
|
|
|
1728
1728
|
}
|
|
1729
1729
|
prevAssets = null;
|
|
1730
1730
|
},
|
|
1731
|
-
updateAssets: (state, action) => {
|
|
1732
|
-
for (const asset of action.payload) {
|
|
1733
|
-
if (asset.offline_id in state.assets) {
|
|
1734
|
-
state.assets[asset.offline_id] = asset;
|
|
1735
|
-
} else {
|
|
1736
|
-
throw new Error(`Tried to update asset with ID that doesn't exist: ${asset.offline_id}`);
|
|
1737
|
-
}
|
|
1738
|
-
}
|
|
1739
|
-
prevAssets = null;
|
|
1740
|
-
},
|
|
1741
1731
|
removeAsset: (state, action) => {
|
|
1742
1732
|
if (action.payload in state.assets) {
|
|
1743
1733
|
delete state.assets[action.payload];
|
|
@@ -1746,16 +1736,6 @@ var __publicField = (obj, key, value) => {
|
|
|
1746
1736
|
}
|
|
1747
1737
|
prevAssets = null;
|
|
1748
1738
|
},
|
|
1749
|
-
removeAssets: (state, action) => {
|
|
1750
|
-
for (const assetId of action.payload) {
|
|
1751
|
-
if (assetId in state.assets) {
|
|
1752
|
-
delete state.assets[assetId];
|
|
1753
|
-
} else {
|
|
1754
|
-
throw new Error(`Failed to remove asset because ID doesn't exist: ${assetId}`);
|
|
1755
|
-
}
|
|
1756
|
-
}
|
|
1757
|
-
prevAssets = null;
|
|
1758
|
-
},
|
|
1759
1739
|
removeAllAssetsOfType: (state, action) => {
|
|
1760
1740
|
var _a2;
|
|
1761
1741
|
for (const componentId in state.assets) {
|
|
@@ -1779,9 +1759,7 @@ var __publicField = (obj, key, value) => {
|
|
|
1779
1759
|
const {
|
|
1780
1760
|
addAsset,
|
|
1781
1761
|
updateAsset,
|
|
1782
|
-
updateAssets,
|
|
1783
1762
|
removeAsset,
|
|
1784
|
-
removeAssets,
|
|
1785
1763
|
addAssetsInBatches,
|
|
1786
1764
|
setAssets,
|
|
1787
1765
|
removeAllAssetsOfType,
|
|
@@ -5390,16 +5368,6 @@ var __publicField = (obj, key, value) => {
|
|
|
5390
5368
|
store.dispatch(setCategories(result));
|
|
5391
5369
|
}
|
|
5392
5370
|
}
|
|
5393
|
-
function chunkArray(arr, chunkSize) {
|
|
5394
|
-
const chunks = [];
|
|
5395
|
-
let index2 = 0;
|
|
5396
|
-
const arrLength = arr.length;
|
|
5397
|
-
while (index2 < arrLength) {
|
|
5398
|
-
chunks.push(arr.slice(index2, index2 += chunkSize));
|
|
5399
|
-
}
|
|
5400
|
-
return chunks;
|
|
5401
|
-
}
|
|
5402
|
-
const BULK_ADD_ASSET_BATCH_SIZE = 1e3;
|
|
5403
5371
|
class AssetService extends BaseApiService {
|
|
5404
5372
|
// Basic CRUD functions
|
|
5405
5373
|
add(asset, workspaceId) {
|
|
@@ -5476,45 +5444,36 @@ var __publicField = (obj, key, value) => {
|
|
|
5476
5444
|
throw err;
|
|
5477
5445
|
});
|
|
5478
5446
|
}
|
|
5479
|
-
|
|
5480
|
-
const { store } = this.client;
|
|
5447
|
+
async addBatch(assetsToCreate, workspaceId, assetTypeId) {
|
|
5481
5448
|
const fullAssets = assetsToCreate.map((asset) => {
|
|
5482
5449
|
return { ...offline(asset), submitted_at: (/* @__PURE__ */ new Date()).toISOString() };
|
|
5483
5450
|
});
|
|
5484
|
-
const
|
|
5485
|
-
return {
|
|
5486
|
-
batchId: uuid.v4(),
|
|
5487
|
-
payload: {
|
|
5488
|
-
assets: assetBatch
|
|
5489
|
-
}
|
|
5490
|
-
};
|
|
5491
|
-
});
|
|
5451
|
+
const { store } = this.client;
|
|
5492
5452
|
store.dispatch(addAssetsInBatches(fullAssets));
|
|
5493
|
-
|
|
5494
|
-
|
|
5495
|
-
|
|
5496
|
-
|
|
5497
|
-
|
|
5498
|
-
|
|
5499
|
-
|
|
5500
|
-
|
|
5501
|
-
|
|
5502
|
-
|
|
5503
|
-
|
|
5504
|
-
|
|
5505
|
-
|
|
5506
|
-
|
|
5507
|
-
|
|
5508
|
-
|
|
5509
|
-
|
|
5510
|
-
|
|
5511
|
-
|
|
5512
|
-
|
|
5513
|
-
|
|
5514
|
-
|
|
5515
|
-
|
|
5516
|
-
|
|
5517
|
-
return [fullAssets, batchPromises.then((result) => result)];
|
|
5453
|
+
const promise = this.client.enqueueRequest({
|
|
5454
|
+
description: "Batch create assets",
|
|
5455
|
+
method: HttpMethod.POST,
|
|
5456
|
+
url: `/assets/types/${assetTypeId}/add-assets/`,
|
|
5457
|
+
queryParams: {
|
|
5458
|
+
workspace_id: workspaceId.toString()
|
|
5459
|
+
},
|
|
5460
|
+
payload: {
|
|
5461
|
+
assets: fullAssets
|
|
5462
|
+
},
|
|
5463
|
+
blockers: [assetTypeId],
|
|
5464
|
+
blocks: fullAssets.map((c) => c.offline_id)
|
|
5465
|
+
});
|
|
5466
|
+
void promise.then((result) => {
|
|
5467
|
+
for (const assets of Object.values(result)) {
|
|
5468
|
+
store.dispatch(updateAsset(assets));
|
|
5469
|
+
}
|
|
5470
|
+
}).catch((e) => {
|
|
5471
|
+
for (const asset of fullAssets) {
|
|
5472
|
+
store.dispatch(removeAsset(asset.offline_id));
|
|
5473
|
+
}
|
|
5474
|
+
throw e;
|
|
5475
|
+
});
|
|
5476
|
+
return promise;
|
|
5518
5477
|
}
|
|
5519
5478
|
async refreshStore() {
|
|
5520
5479
|
const { store } = this.client;
|
|
@@ -7300,7 +7259,6 @@ var __publicField = (obj, key, value) => {
|
|
|
7300
7259
|
}
|
|
7301
7260
|
return { values: newValues, files };
|
|
7302
7261
|
};
|
|
7303
|
-
const MAX_BULK_ADD_SUBMISSIONS = 1e3;
|
|
7304
7262
|
class UserFormSubmissionService extends BaseApiService {
|
|
7305
7263
|
constructor() {
|
|
7306
7264
|
super(...arguments);
|
|
@@ -7382,134 +7340,99 @@ var __publicField = (obj, key, value) => {
|
|
|
7382
7340
|
// Note currently the bulkAdd method is specific to form submissions for assets
|
|
7383
7341
|
// TODO: adapt the support bulk adding to any model type
|
|
7384
7342
|
async bulkAdd(args) {
|
|
7385
|
-
const { formRevision,
|
|
7343
|
+
const { formRevision, values: argsValues, assetOfflineIds } = args;
|
|
7386
7344
|
const { store } = this.client;
|
|
7387
7345
|
const offlineSubmissions = [];
|
|
7388
7346
|
const offlineAttachments = [];
|
|
7389
7347
|
const submissionOfflineIds = [];
|
|
7390
|
-
const
|
|
7391
|
-
const
|
|
7348
|
+
const submissionsPayload = [];
|
|
7349
|
+
const attachmentsPayload = [];
|
|
7350
|
+
const { values, files } = separateFilesFromValues(argsValues);
|
|
7392
7351
|
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7393
7352
|
const createdBy = store.getState().userReducer.currentUser.id;
|
|
7394
|
-
const
|
|
7395
|
-
|
|
7396
|
-
|
|
7397
|
-
|
|
7398
|
-
|
|
7399
|
-
|
|
7400
|
-
|
|
7401
|
-
|
|
7402
|
-
|
|
7403
|
-
|
|
7404
|
-
|
|
7405
|
-
|
|
7406
|
-
|
|
7407
|
-
};
|
|
7408
|
-
const submission = offline({
|
|
7409
|
-
form_revision: formRevision,
|
|
7410
|
-
values: submissionValues,
|
|
7411
|
-
created_by: createdBy,
|
|
7412
|
-
submitted_at: submittedAt,
|
|
7413
|
-
asset: assetId
|
|
7414
|
-
});
|
|
7415
|
-
submissionOfflineIds.push(submission.offline_id);
|
|
7416
|
-
submissionsPayload.push({
|
|
7417
|
-
offline_id: submission.offline_id,
|
|
7418
|
-
asset_id: assetId,
|
|
7419
|
-
form_data: fileSeperatedSubmissionSpecificValues
|
|
7420
|
-
});
|
|
7421
|
-
offlineSubmissions.push(submission);
|
|
7422
|
-
for (const [fieldIdentifier, fileArray] of Object.entries(files)) {
|
|
7423
|
-
for (const file of fileArray) {
|
|
7424
|
-
const sha1 = await hashFile(file);
|
|
7425
|
-
await this.client.files.addCache(file, sha1);
|
|
7426
|
-
const offlineAttachment = offline({
|
|
7427
|
-
file_name: file.name,
|
|
7428
|
-
file_sha1: sha1,
|
|
7429
|
-
file: URL.createObjectURL(file),
|
|
7430
|
-
submission: submission.offline_id,
|
|
7431
|
-
field_identifier: fieldIdentifier
|
|
7432
|
-
});
|
|
7433
|
-
offlineAttachments.push(offlineAttachment);
|
|
7434
|
-
attachmentsPayload.push({
|
|
7435
|
-
offline_id: offlineAttachment.offline_id,
|
|
7436
|
-
submission_id: submission.offline_id,
|
|
7437
|
-
sha1,
|
|
7438
|
-
name: file.name,
|
|
7439
|
-
field_identifier: fieldIdentifier
|
|
7440
|
-
});
|
|
7441
|
-
}
|
|
7442
|
-
}
|
|
7443
|
-
}
|
|
7444
|
-
const filePaylods = [];
|
|
7445
|
-
for (const file of Object.values(files).flat()) {
|
|
7353
|
+
for (const assetId of assetOfflineIds) {
|
|
7354
|
+
const submission = offline({
|
|
7355
|
+
form_revision: formRevision,
|
|
7356
|
+
values,
|
|
7357
|
+
created_by: createdBy,
|
|
7358
|
+
submitted_at: submittedAt,
|
|
7359
|
+
asset: assetId
|
|
7360
|
+
});
|
|
7361
|
+
submissionOfflineIds.push(submission.offline_id);
|
|
7362
|
+
submissionsPayload.push({ offline_id: submission.offline_id, asset_id: assetId });
|
|
7363
|
+
offlineSubmissions.push(submission);
|
|
7364
|
+
for (const [fieldIdentifier, fileArray] of Object.entries(files)) {
|
|
7365
|
+
for (const file of fileArray) {
|
|
7446
7366
|
const sha1 = await hashFile(file);
|
|
7447
|
-
|
|
7367
|
+
await this.client.files.addCache(file, sha1);
|
|
7368
|
+
const offlineAttachment = offline({
|
|
7369
|
+
file_name: file.name,
|
|
7370
|
+
file_sha1: sha1,
|
|
7371
|
+
file: URL.createObjectURL(file),
|
|
7372
|
+
submission: submission.offline_id,
|
|
7373
|
+
field_identifier: fieldIdentifier
|
|
7374
|
+
});
|
|
7375
|
+
offlineAttachments.push(offlineAttachment);
|
|
7376
|
+
attachmentsPayload.push({
|
|
7377
|
+
offline_id: offlineAttachment.offline_id,
|
|
7378
|
+
submission_id: submission.offline_id,
|
|
7448
7379
|
sha1,
|
|
7449
|
-
|
|
7450
|
-
|
|
7451
|
-
|
|
7452
|
-
};
|
|
7453
|
-
allFilesRecord[sha1] = filePayload;
|
|
7454
|
-
filePaylods.push(filePayload);
|
|
7380
|
+
name: file.name,
|
|
7381
|
+
field_identifier: fieldIdentifier
|
|
7382
|
+
});
|
|
7455
7383
|
}
|
|
7456
|
-
|
|
7457
|
-
|
|
7458
|
-
|
|
7459
|
-
|
|
7460
|
-
|
|
7461
|
-
|
|
7462
|
-
|
|
7463
|
-
|
|
7464
|
-
|
|
7465
|
-
|
|
7466
|
-
}
|
|
7467
|
-
|
|
7384
|
+
}
|
|
7385
|
+
}
|
|
7386
|
+
const filesRecord = {};
|
|
7387
|
+
for (const file of Object.values(files).flat()) {
|
|
7388
|
+
const sha1 = await hashFile(file);
|
|
7389
|
+
filesRecord[sha1] = {
|
|
7390
|
+
sha1,
|
|
7391
|
+
extension: file.name.split(".").pop() || "",
|
|
7392
|
+
file_type: file.type,
|
|
7393
|
+
size: file.size
|
|
7394
|
+
};
|
|
7395
|
+
}
|
|
7468
7396
|
store.dispatch(addFormSubmissions(offlineSubmissions));
|
|
7469
7397
|
store.dispatch(addFormSubmissionAttachments(offlineAttachments));
|
|
7470
|
-
|
|
7471
|
-
|
|
7472
|
-
|
|
7473
|
-
|
|
7474
|
-
|
|
7475
|
-
|
|
7476
|
-
|
|
7477
|
-
|
|
7478
|
-
|
|
7398
|
+
const promise = this.client.enqueueRequest({
|
|
7399
|
+
description: "Bulk add form submissions",
|
|
7400
|
+
method: HttpMethod.POST,
|
|
7401
|
+
url: `/forms/revisions/${formRevision}/bulk-respond/`,
|
|
7402
|
+
payload: {
|
|
7403
|
+
form_data: values,
|
|
7404
|
+
submitted_at: submittedAt,
|
|
7405
|
+
submissions: submissionsPayload,
|
|
7406
|
+
attachments: attachmentsPayload,
|
|
7407
|
+
files: Object.values(filesRecord)
|
|
7408
|
+
},
|
|
7409
|
+
blockers: assetOfflineIds,
|
|
7410
|
+
blocks: submissionOfflineIds
|
|
7411
|
+
});
|
|
7412
|
+
promise.then(({ submissions, attachments, presigned_urls }) => {
|
|
7413
|
+
store.dispatch(updateFormSubmissions(submissions));
|
|
7414
|
+
store.dispatch(updateFormSubmissionAttachments(attachments));
|
|
7415
|
+
for (const [sha1, presigned_url] of Object.entries(presigned_urls)) {
|
|
7416
|
+
const file = filesRecord[sha1];
|
|
7417
|
+
if (!file)
|
|
7418
|
+
continue;
|
|
7419
|
+
void this.client.enqueueRequest({
|
|
7420
|
+
url: presigned_url.url,
|
|
7421
|
+
description: "Upload file",
|
|
7479
7422
|
method: HttpMethod.POST,
|
|
7480
|
-
|
|
7481
|
-
|
|
7482
|
-
|
|
7483
|
-
|
|
7484
|
-
|
|
7485
|
-
|
|
7486
|
-
store.dispatch(updateFormSubmissions(submissions));
|
|
7487
|
-
store.dispatch(updateFormSubmissionAttachments(attachments));
|
|
7488
|
-
for (const [sha1, presigned_url] of Object.entries(presigned_urls)) {
|
|
7489
|
-
const file = allFilesRecord[sha1];
|
|
7490
|
-
if (!file)
|
|
7491
|
-
continue;
|
|
7492
|
-
void this.client.enqueueRequest({
|
|
7493
|
-
url: presigned_url.url,
|
|
7494
|
-
description: "Upload file",
|
|
7495
|
-
method: HttpMethod.POST,
|
|
7496
|
-
isExternalUrl: true,
|
|
7497
|
-
isAuthNeeded: false,
|
|
7498
|
-
attachmentHash: sha1,
|
|
7499
|
-
blockers: [`s3-${file.sha1}.${file.extension}`],
|
|
7500
|
-
blocks: [sha1],
|
|
7501
|
-
s3url: presigned_url
|
|
7502
|
-
});
|
|
7503
|
-
}
|
|
7504
|
-
}).catch(() => {
|
|
7505
|
-
store.dispatch(deleteFormSubmissions(batchSubmissionOfflineIds));
|
|
7506
|
-
store.dispatch(deleteFormSubmissionAttachments(batchAttachmentsOfflineIds));
|
|
7423
|
+
isExternalUrl: true,
|
|
7424
|
+
isAuthNeeded: false,
|
|
7425
|
+
attachmentHash: sha1,
|
|
7426
|
+
blockers: [`s3-${file.sha1}.${file.extension}`],
|
|
7427
|
+
blocks: [sha1],
|
|
7428
|
+
s3url: presigned_url
|
|
7507
7429
|
});
|
|
7508
|
-
|
|
7509
|
-
|
|
7510
|
-
|
|
7511
|
-
|
|
7512
|
-
|
|
7430
|
+
}
|
|
7431
|
+
}).catch(() => {
|
|
7432
|
+
store.dispatch(deleteFormSubmissions(submissionOfflineIds));
|
|
7433
|
+
store.dispatch(deleteFormSubmissionAttachments(offlineAttachments.map((x) => x.offline_id)));
|
|
7434
|
+
});
|
|
7435
|
+
return [offlineSubmissions, promise.then(({ submissions }) => submissions)];
|
|
7513
7436
|
}
|
|
7514
7437
|
update(submission) {
|
|
7515
7438
|
const { store } = this.client;
|
|
@@ -8719,8 +8642,8 @@ var __publicField = (obj, key, value) => {
|
|
|
8719
8642
|
}
|
|
8720
8643
|
const makeClient = (apiUrl, store) => new OvermapSDK(apiUrl, store);
|
|
8721
8644
|
const SDKContext = React.createContext({});
|
|
8722
|
-
const SDKProvider = React.memo(({ children,
|
|
8723
|
-
const client = React.useMemo(() => makeClient(
|
|
8645
|
+
const SDKProvider = React.memo(({ children, apiUrl, store }) => {
|
|
8646
|
+
const client = React.useMemo(() => makeClient(apiUrl, store), [apiUrl, store]);
|
|
8724
8647
|
React.useEffect(() => {
|
|
8725
8648
|
setClientStore(store);
|
|
8726
8649
|
}, [store]);
|
|
@@ -8731,11 +8654,9 @@ var __publicField = (obj, key, value) => {
|
|
|
8731
8654
|
return React.useContext(SDKContext);
|
|
8732
8655
|
};
|
|
8733
8656
|
const OvermapContext = React.createContext(null);
|
|
8734
|
-
const PRODUCTION_URL = "https://api.wordn.io";
|
|
8735
|
-
const STAGING_URL = "https://test-api.hemora.ca";
|
|
8736
8657
|
const OvermapProvider = (props) => {
|
|
8737
|
-
const { children,
|
|
8738
|
-
let ret = /* @__PURE__ */ jsxRuntime.jsx(blocks.AlertDialogProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(blocks.ToastProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(SDKProvider, {
|
|
8658
|
+
const { children, disableDefaultTheme = false, store, apiUrl } = props;
|
|
8659
|
+
let ret = /* @__PURE__ */ jsxRuntime.jsx(blocks.AlertDialogProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(blocks.ToastProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(SDKProvider, { store, apiUrl, children }) }) });
|
|
8739
8660
|
if (!disableDefaultTheme) {
|
|
8740
8661
|
ret = /* @__PURE__ */ jsxRuntime.jsx(blocks.DefaultTheme, { children: ret });
|
|
8741
8662
|
}
|
|
@@ -8864,12 +8785,6 @@ var __publicField = (obj, key, value) => {
|
|
|
8864
8785
|
getFormValidators() {
|
|
8865
8786
|
return [...this.formValidators];
|
|
8866
8787
|
}
|
|
8867
|
-
encodeValueToJson(value) {
|
|
8868
|
-
return JSON.stringify(value);
|
|
8869
|
-
}
|
|
8870
|
-
decodeJsonToValue(json) {
|
|
8871
|
-
return JSON.parse(json);
|
|
8872
|
-
}
|
|
8873
8788
|
}
|
|
8874
8789
|
__publicField(BaseField, "fieldTypeName");
|
|
8875
8790
|
__publicField(BaseField, "fieldTypeDescription");
|
|
@@ -13143,7 +13058,7 @@ var __publicField = (obj, key, value) => {
|
|
|
13143
13058
|
);
|
|
13144
13059
|
const handleChange = React.useCallback(
|
|
13145
13060
|
(e) => {
|
|
13146
|
-
if (value.findIndex((option) => option === e.target.value.trim()) >= 0) {
|
|
13061
|
+
if (value.findIndex((option) => option.value === e.target.value.trim()) >= 0) {
|
|
13147
13062
|
setInternalError("All options must be unique");
|
|
13148
13063
|
} else if (!e.target.value) {
|
|
13149
13064
|
setInternalError("Option cannot be empty");
|
|
@@ -13162,7 +13077,7 @@ var __publicField = (obj, key, value) => {
|
|
|
13162
13077
|
return;
|
|
13163
13078
|
}
|
|
13164
13079
|
const trimmedValue = intermediateValue.trim();
|
|
13165
|
-
setValueAndTouched([...value, trimmedValue]);
|
|
13080
|
+
setValueAndTouched([...value, { value: trimmedValue, label: trimmedValue }]);
|
|
13166
13081
|
setIntermediateValue("");
|
|
13167
13082
|
}, [intermediateValue, internalError, setValueAndTouched, value]);
|
|
13168
13083
|
const handleKeyDown = React.useCallback(
|
|
@@ -13232,7 +13147,7 @@ var __publicField = (obj, key, value) => {
|
|
|
13232
13147
|
value.map((option, index2) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
13233
13148
|
dnd.Draggable,
|
|
13234
13149
|
{
|
|
13235
|
-
draggableId: `${option}-draggable`,
|
|
13150
|
+
draggableId: `${option.value}-draggable`,
|
|
13236
13151
|
index: index2,
|
|
13237
13152
|
isDragDisabled: disabled,
|
|
13238
13153
|
children: ({ draggableProps, dragHandleProps, innerRef }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -13247,7 +13162,7 @@ var __publicField = (obj, key, value) => {
|
|
|
13247
13162
|
mb: "1",
|
|
13248
13163
|
asChild: true,
|
|
13249
13164
|
children: /* @__PURE__ */ jsxRuntime.jsxs(blocks.Badge, { color: "gray", size: "2", children: [
|
|
13250
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: option }),
|
|
13165
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: option.label }),
|
|
13251
13166
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13252
13167
|
blocks.IconButton,
|
|
13253
13168
|
{
|
|
@@ -13267,7 +13182,7 @@ var __publicField = (obj, key, value) => {
|
|
|
13267
13182
|
}
|
|
13268
13183
|
)
|
|
13269
13184
|
},
|
|
13270
|
-
option
|
|
13185
|
+
option.value
|
|
13271
13186
|
)),
|
|
13272
13187
|
droppableProvided.placeholder
|
|
13273
13188
|
] }) })
|
|
@@ -14942,46 +14857,6 @@ var __publicField = (obj, key, value) => {
|
|
|
14942
14857
|
meta: { readonly }
|
|
14943
14858
|
};
|
|
14944
14859
|
}
|
|
14945
|
-
function decodeFormValues(schema, values) {
|
|
14946
|
-
let allFields = [];
|
|
14947
|
-
for (const field of schema.fields) {
|
|
14948
|
-
if (field instanceof FieldSection) {
|
|
14949
|
-
allFields = allFields.concat(field.fields);
|
|
14950
|
-
} else {
|
|
14951
|
-
if (!(field instanceof BaseField)) {
|
|
14952
|
-
throw new Error("Invalid field type");
|
|
14953
|
-
}
|
|
14954
|
-
allFields.push(field);
|
|
14955
|
-
}
|
|
14956
|
-
}
|
|
14957
|
-
const result = {};
|
|
14958
|
-
for (const field of allFields) {
|
|
14959
|
-
if (!(field.identifier in values))
|
|
14960
|
-
;
|
|
14961
|
-
const value = values[field.identifier];
|
|
14962
|
-
result[field.identifier] = field.decodeJsonToValue(value);
|
|
14963
|
-
}
|
|
14964
|
-
return result;
|
|
14965
|
-
}
|
|
14966
|
-
function encodeFormValues(schema, values) {
|
|
14967
|
-
let allFields = [];
|
|
14968
|
-
for (const field of schema.fields) {
|
|
14969
|
-
if (field instanceof FieldSection) {
|
|
14970
|
-
allFields = allFields.concat(field.fields);
|
|
14971
|
-
} else {
|
|
14972
|
-
if (!(field instanceof BaseField)) {
|
|
14973
|
-
throw new Error("Invalid field type");
|
|
14974
|
-
}
|
|
14975
|
-
allFields.push(field);
|
|
14976
|
-
}
|
|
14977
|
-
}
|
|
14978
|
-
const result = {};
|
|
14979
|
-
for (const field of allFields) {
|
|
14980
|
-
const value = values[field.identifier];
|
|
14981
|
-
result[field.identifier] = field.encodeValueToJson(value);
|
|
14982
|
-
}
|
|
14983
|
-
return result;
|
|
14984
|
-
}
|
|
14985
14860
|
function valueIsFile(v) {
|
|
14986
14861
|
return Array.isArray(v) && v.some((v2) => v2 instanceof File || v2 instanceof Promise);
|
|
14987
14862
|
}
|
|
@@ -16763,7 +16638,6 @@ var __publicField = (obj, key, value) => {
|
|
|
16763
16638
|
StringInput,
|
|
16764
16639
|
TextField,
|
|
16765
16640
|
TextInput,
|
|
16766
|
-
decodeFormValues,
|
|
16767
16641
|
deserialize,
|
|
16768
16642
|
deserializeField,
|
|
16769
16643
|
emptyBaseField,
|
|
@@ -16776,14 +16650,11 @@ var __publicField = (obj, key, value) => {
|
|
|
16776
16650
|
emptySelectField,
|
|
16777
16651
|
emptyStringField,
|
|
16778
16652
|
emptyTextField,
|
|
16779
|
-
encodeFormValues,
|
|
16780
16653
|
formRevisionToSchema,
|
|
16781
|
-
initialFormValues,
|
|
16782
16654
|
isConditionMet,
|
|
16783
16655
|
useFieldInput,
|
|
16784
16656
|
useFieldInputs,
|
|
16785
16657
|
useFormikInput,
|
|
16786
|
-
validateForm,
|
|
16787
16658
|
valueIsFile
|
|
16788
16659
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
16789
16660
|
exports2.APIError = APIError;
|
|
@@ -16974,7 +16845,6 @@ var __publicField = (obj, key, value) => {
|
|
|
16974
16845
|
exports2.coordinatesToUrlText = coordinatesToUrlText;
|
|
16975
16846
|
exports2.createOfflineAction = createOfflineAction;
|
|
16976
16847
|
exports2.createPointMarker = createPointMarker;
|
|
16977
|
-
exports2.decodeFormValues = decodeFormValues;
|
|
16978
16848
|
exports2.defaultBadgeColor = defaultBadgeColor;
|
|
16979
16849
|
exports2.defaultStore = defaultStore;
|
|
16980
16850
|
exports2.deleteAssetType = deleteAssetType;
|
|
@@ -17010,7 +16880,6 @@ var __publicField = (obj, key, value) => {
|
|
|
17010
16880
|
exports2.emptySelectField = emptySelectField;
|
|
17011
16881
|
exports2.emptyStringField = emptyStringField;
|
|
17012
16882
|
exports2.emptyTextField = emptyTextField;
|
|
17013
|
-
exports2.encodeFormValues = encodeFormValues;
|
|
17014
16883
|
exports2.enqueue = enqueue;
|
|
17015
16884
|
exports2.enqueueRequest = enqueueRequest;
|
|
17016
16885
|
exports2.errorColor = errorColor;
|
|
@@ -17041,7 +16910,6 @@ var __publicField = (obj, key, value) => {
|
|
|
17041
16910
|
exports2.hashFile = hashFile;
|
|
17042
16911
|
exports2.hideAllCategories = hideAllCategories;
|
|
17043
16912
|
exports2.hideCategory = hideCategory;
|
|
17044
|
-
exports2.initialFormValues = initialFormValues;
|
|
17045
16913
|
exports2.isConditionMet = isConditionMet;
|
|
17046
16914
|
exports2.isToday = isToday;
|
|
17047
16915
|
exports2.issueReducer = issueReducer;
|
|
@@ -17095,7 +16963,6 @@ var __publicField = (obj, key, value) => {
|
|
|
17095
16963
|
exports2.removeAssetAttachments = removeAssetAttachments;
|
|
17096
16964
|
exports2.removeAssetTypeAttachment = removeAssetTypeAttachment;
|
|
17097
16965
|
exports2.removeAssetTypeAttachments = removeAssetTypeAttachments;
|
|
17098
|
-
exports2.removeAssets = removeAssets;
|
|
17099
16966
|
exports2.removeAttachmentsOfIssue = removeAttachmentsOfIssue;
|
|
17100
16967
|
exports2.removeCategory = removeCategory;
|
|
17101
16968
|
exports2.removeColor = removeColor;
|
|
@@ -17413,7 +17280,6 @@ var __publicField = (obj, key, value) => {
|
|
|
17413
17280
|
exports2.updateAssetAttachments = updateAssetAttachments;
|
|
17414
17281
|
exports2.updateAssetTypeAttachment = updateAssetTypeAttachment;
|
|
17415
17282
|
exports2.updateAssetTypeAttachments = updateAssetTypeAttachments;
|
|
17416
|
-
exports2.updateAssets = updateAssets;
|
|
17417
17283
|
exports2.updateConversation = updateConversation;
|
|
17418
17284
|
exports2.updateDocumentAttachment = updateDocumentAttachment;
|
|
17419
17285
|
exports2.updateDocumentAttachments = updateDocumentAttachments;
|
|
@@ -17444,7 +17310,6 @@ var __publicField = (obj, key, value) => {
|
|
|
17444
17310
|
exports2.useSDK = useSDK;
|
|
17445
17311
|
exports2.userReducer = userReducer;
|
|
17446
17312
|
exports2.userSlice = userSlice;
|
|
17447
|
-
exports2.validateForm = validateForm;
|
|
17448
17313
|
exports2.valueIsFile = valueIsFile;
|
|
17449
17314
|
exports2.warningColor = warningColor;
|
|
17450
17315
|
exports2.workspaceReducer = workspaceReducer;
|