@overmap-ai/core 1.0.60-forms-removal.5 → 1.0.60-forms-removal.7
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 +18 -4
- package/dist/overmap-core.js.map +1 -1
- package/dist/overmap-core.umd.cjs +18 -4
- package/dist/overmap-core.umd.cjs.map +1 -1
- package/dist/typings/models/assets.d.ts +2 -2
- package/dist/typings/models/geo.d.ts +7 -4
- package/dist/typings/models/index.d.ts +0 -1
- package/dist/typings/models/issues.d.ts +2 -2
- package/dist/typings/models/projects.d.ts +3 -3
- package/package.json +1 -1
- package/dist/typings/models/canvas.d.ts +0 -10
|
@@ -2322,7 +2322,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2322
2322
|
doesn't exist.`
|
|
2323
2323
|
);
|
|
2324
2324
|
}
|
|
2325
|
-
state.projectFiles[activeProjectFileId].
|
|
2325
|
+
state.projectFiles[activeProjectFileId].bounds = action.payload;
|
|
2326
2326
|
},
|
|
2327
2327
|
// TODO: Move to MapContext. Should not be persisted.
|
|
2328
2328
|
setActiveProjectFileId: (state, action) => {
|
|
@@ -4187,6 +4187,9 @@ var __publicField = (obj, key, value) => {
|
|
|
4187
4187
|
class AssetService extends BaseApiService {
|
|
4188
4188
|
// Basic CRUD functions
|
|
4189
4189
|
add(asset, workspaceId) {
|
|
4190
|
+
if (!asset.canvas_marker && !asset.geo_marker) {
|
|
4191
|
+
throw new Error("Asset must have either a canvas_marker or geo_marker");
|
|
4192
|
+
}
|
|
4190
4193
|
const offlineAsset = offline(asset);
|
|
4191
4194
|
this.dispatch(addAsset(offlineAsset));
|
|
4192
4195
|
const promise = this.enqueueRequest({
|
|
@@ -4203,6 +4206,9 @@ var __publicField = (obj, key, value) => {
|
|
|
4203
4206
|
return [offlineAsset, promise];
|
|
4204
4207
|
}
|
|
4205
4208
|
update(asset, workspaceId) {
|
|
4209
|
+
if (!asset.canvas_marker && !asset.geo_marker) {
|
|
4210
|
+
throw new Error("Asset must have either a canvas_marker or geo_marker");
|
|
4211
|
+
}
|
|
4206
4212
|
this.client.store.dispatch(updateAsset(asset));
|
|
4207
4213
|
const promise = this.enqueueRequest({
|
|
4208
4214
|
description: "Edit asset",
|
|
@@ -5327,6 +5333,9 @@ var __publicField = (obj, key, value) => {
|
|
|
5327
5333
|
if (!activeProjectFile) {
|
|
5328
5334
|
throw new Error("No active project file");
|
|
5329
5335
|
}
|
|
5336
|
+
if (!activeProjectFile.bounds && !activeProjectFile.canvas_bounds) {
|
|
5337
|
+
throw new Error("Project file must either have bounds or canvas_bounds set");
|
|
5338
|
+
}
|
|
5330
5339
|
let requestDetails;
|
|
5331
5340
|
const existing = typeof activeProjectFile.file === "string" && !activeProjectFile.file.startsWith("blob:");
|
|
5332
5341
|
if (existing) {
|
|
@@ -5347,7 +5356,6 @@ var __publicField = (obj, key, value) => {
|
|
|
5347
5356
|
url: `/projects/${activeProjectId}/files/`,
|
|
5348
5357
|
payload: {
|
|
5349
5358
|
...activeProjectFile,
|
|
5350
|
-
geo_bounds: JSON.stringify(activeProjectFile.geo_bounds),
|
|
5351
5359
|
...fileProps
|
|
5352
5360
|
},
|
|
5353
5361
|
blockers: [activeProjectFileId],
|
|
@@ -5419,6 +5427,9 @@ var __publicField = (obj, key, value) => {
|
|
|
5419
5427
|
if (!project.owner_organization && !project.owner_user) {
|
|
5420
5428
|
throw new Error("Project type was not chosen when trying to create a project");
|
|
5421
5429
|
}
|
|
5430
|
+
if (!project.bounds && !project.canvas_bounds) {
|
|
5431
|
+
throw new Error("Project must either have bounds or canvas_bounds set");
|
|
5432
|
+
}
|
|
5422
5433
|
const isOrganizationProject = !!project.owner_organization;
|
|
5423
5434
|
const url = isOrganizationProject ? `/organizations/${project.owner_organization}/projects/` : "/projects/";
|
|
5424
5435
|
const projectType = isOrganizationProject ? { organization_owner: project.owner_organization } : { user_owner: project.owner_user };
|
|
@@ -5428,7 +5439,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5428
5439
|
url,
|
|
5429
5440
|
payload: {
|
|
5430
5441
|
name: project.name,
|
|
5431
|
-
|
|
5442
|
+
bounds: project.bounds,
|
|
5432
5443
|
...projectType
|
|
5433
5444
|
},
|
|
5434
5445
|
blockers: [],
|
|
@@ -5437,6 +5448,9 @@ var __publicField = (obj, key, value) => {
|
|
|
5437
5448
|
return result;
|
|
5438
5449
|
}
|
|
5439
5450
|
async update(project) {
|
|
5451
|
+
if (!project.bounds || !project.canvas_bounds) {
|
|
5452
|
+
throw new Error("Project must either have bounds or canvas_bounds set");
|
|
5453
|
+
}
|
|
5440
5454
|
this.dispatch(updateOrCreateProject(project));
|
|
5441
5455
|
return await this.enqueueRequest({
|
|
5442
5456
|
description: "Update project",
|
|
@@ -5444,7 +5458,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5444
5458
|
url: `/projects/${project.id}/`,
|
|
5445
5459
|
payload: {
|
|
5446
5460
|
name: project.name,
|
|
5447
|
-
|
|
5461
|
+
bounds: project.bounds
|
|
5448
5462
|
},
|
|
5449
5463
|
blockers: [project.id.toString()],
|
|
5450
5464
|
blocks: [project.id.toString()]
|