@overmap-ai/core 1.0.70-depend-on-forms.0 → 1.0.71-active-project-state.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/dist/overmap-core.js +59 -163
- package/dist/overmap-core.js.map +1 -1
- package/dist/overmap-core.umd.cjs +59 -163
- package/dist/overmap-core.umd.cjs.map +1 -1
- package/dist/sdk/services/AgentService.d.ts +2 -7
- package/dist/sdk/services/FormService.d.ts +1 -1
- package/dist/sdk/services/FormSubmissionService.d.ts +1 -1
- package/dist/sdk/services/GeoImageService.d.ts +1 -1
- package/dist/sdk/services/TeamService.d.ts +1 -1
- package/dist/sdk/services/WorkspaceService.d.ts +1 -1
- package/dist/store/slices/projectAccessSlice.d.ts +0 -1
- package/dist/store/slices/projectFileSlice.d.ts +1 -1
- package/dist/store/slices/projectSlice.d.ts +3 -18
- package/dist/typings/models/base.d.ts +1 -2
- package/dist/typings/models/license.d.ts +2 -2
- package/dist/typings/models/projects.d.ts +2 -4
- package/package.json +1 -1
package/dist/overmap-core.js
CHANGED
|
@@ -1587,13 +1587,6 @@ const selectProjectAccesses = createSelector(
|
|
|
1587
1587
|
const selectProjectAccessById = (id) => (state) => {
|
|
1588
1588
|
return state.projectAccessReducer.instances[id];
|
|
1589
1589
|
};
|
|
1590
|
-
const selectActiveProjectAccess = (state) => {
|
|
1591
|
-
const currentUser = state.userReducer.currentUser;
|
|
1592
|
-
const activeProjectId = state.projectReducer.activeProjectId;
|
|
1593
|
-
return Object.values(state.projectAccessReducer.instances).find((projectAccess) => {
|
|
1594
|
-
return projectAccess.user === (currentUser == null ? void 0 : currentUser.id) && projectAccess.project === activeProjectId;
|
|
1595
|
-
}) ?? null;
|
|
1596
|
-
};
|
|
1597
1590
|
const selectProjectAccessForUser = (user) => (state) => {
|
|
1598
1591
|
return Object.values(state.projectAccessReducer.instances).find(
|
|
1599
1592
|
(projectAccess) => projectAccess.user === user.id
|
|
@@ -1608,8 +1601,7 @@ const selectProjectAccessUserMapping = (state) => {
|
|
|
1608
1601
|
};
|
|
1609
1602
|
const projectAccessReducer = projectAccessSlice.reducer;
|
|
1610
1603
|
const initialState$m = {
|
|
1611
|
-
projects: {}
|
|
1612
|
-
activeProjectId: null
|
|
1604
|
+
projects: {}
|
|
1613
1605
|
};
|
|
1614
1606
|
const projectSlice = createSlice({
|
|
1615
1607
|
name: "projects",
|
|
@@ -1623,19 +1615,9 @@ const projectSlice = createSlice({
|
|
|
1623
1615
|
});
|
|
1624
1616
|
state.projects = projectsMap;
|
|
1625
1617
|
},
|
|
1626
|
-
|
|
1627
|
-
state.activeProjectId = action.payload;
|
|
1628
|
-
},
|
|
1629
|
-
updateOrCreateProject: (state, action) => {
|
|
1618
|
+
updateProject: (state, action) => {
|
|
1630
1619
|
state.projects[action.payload.id] = action.payload;
|
|
1631
1620
|
},
|
|
1632
|
-
// Takes a list of Projects and updates existing ones to match the payload, or adds them
|
|
1633
|
-
// to the store if they are not already present
|
|
1634
|
-
updateOrCreateProjects: (state, action) => {
|
|
1635
|
-
action.payload.forEach((project) => {
|
|
1636
|
-
state.projects[project.id] = project;
|
|
1637
|
-
});
|
|
1638
|
-
},
|
|
1639
1621
|
deleteProject: (state, action) => {
|
|
1640
1622
|
delete state.projects[action.payload.id];
|
|
1641
1623
|
},
|
|
@@ -1645,50 +1627,12 @@ const projectSlice = createSlice({
|
|
|
1645
1627
|
} else {
|
|
1646
1628
|
throw new Error("Accept project invite: user is not in this project");
|
|
1647
1629
|
}
|
|
1648
|
-
},
|
|
1649
|
-
addActiveProjectIssuesCount: (state, action) => {
|
|
1650
|
-
if (!state.activeProjectId || !(state.activeProjectId in state.projects)) {
|
|
1651
|
-
throw new Error("Update issues count: no active project");
|
|
1652
|
-
}
|
|
1653
|
-
if (!state.projects[state.activeProjectId].issues_count) {
|
|
1654
|
-
state.projects[state.activeProjectId].issues_count = action.payload;
|
|
1655
|
-
} else {
|
|
1656
|
-
state.projects[state.activeProjectId].issues_count += action.payload;
|
|
1657
|
-
}
|
|
1658
|
-
},
|
|
1659
|
-
addActiveProjectFormSubmissionsCount: (state, action) => {
|
|
1660
|
-
if (state.activeProjectId && state.activeProjectId in state.projects) {
|
|
1661
|
-
if (!state.projects[state.activeProjectId].form_submissions_count) {
|
|
1662
|
-
state.projects[state.activeProjectId].form_submissions_count = action.payload;
|
|
1663
|
-
} else {
|
|
1664
|
-
state.projects[state.activeProjectId].form_submissions_count += action.payload;
|
|
1665
|
-
}
|
|
1666
|
-
} else {
|
|
1667
|
-
throw new Error("Update form submissions count: no active project");
|
|
1668
|
-
}
|
|
1669
1630
|
}
|
|
1670
1631
|
}
|
|
1671
1632
|
});
|
|
1672
|
-
const {
|
|
1673
|
-
setProjects,
|
|
1674
|
-
updateOrCreateProject,
|
|
1675
|
-
updateOrCreateProjects: addOrReplaceProjects,
|
|
1676
|
-
setActiveProjectId,
|
|
1677
|
-
deleteProject,
|
|
1678
|
-
acceptProjectInvite,
|
|
1679
|
-
addActiveProjectIssuesCount,
|
|
1680
|
-
addActiveProjectFormSubmissionsCount
|
|
1681
|
-
} = projectSlice.actions;
|
|
1633
|
+
const { setProjects, updateProject, deleteProject, acceptProjectInvite } = projectSlice.actions;
|
|
1682
1634
|
const projectReducer = projectSlice.reducer;
|
|
1683
1635
|
const selectProjectMapping = (state) => state.projectReducer.projects;
|
|
1684
|
-
const selectActiveProjectId = (state) => state.projectReducer.activeProjectId;
|
|
1685
|
-
const selectActiveProject = (state) => {
|
|
1686
|
-
const activeProjectId = selectActiveProjectId(state);
|
|
1687
|
-
if (!activeProjectId) {
|
|
1688
|
-
return null;
|
|
1689
|
-
}
|
|
1690
|
-
return state.projectReducer.projects[activeProjectId] ?? null;
|
|
1691
|
-
};
|
|
1692
1636
|
const selectProjectById = (id) => (state) => {
|
|
1693
1637
|
return state.projectReducer.projects[id];
|
|
1694
1638
|
};
|
|
@@ -1937,14 +1881,9 @@ const {
|
|
|
1937
1881
|
resetProjectFileObjectUrls
|
|
1938
1882
|
} = projectFileSlice.actions;
|
|
1939
1883
|
const selectProjectFileMapping = (state) => state.projectFileReducer.projectFiles;
|
|
1940
|
-
const selectProjectFiles = createSelector(
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
return fallbackToEmptyArray(
|
|
1944
|
-
Object.values(mapping).filter((file) => file.project === activeProjectId).sort((a, b) => a.z_index - b.z_index)
|
|
1945
|
-
);
|
|
1946
|
-
}
|
|
1947
|
-
);
|
|
1884
|
+
const selectProjectFiles = createSelector([selectProjectFileMapping], (mapping) => {
|
|
1885
|
+
return fallbackToEmptyArray(Object.values(mapping).sort((a, b) => a.z_index - b.z_index));
|
|
1886
|
+
});
|
|
1948
1887
|
const selectActiveProjectFileId = (state) => state.projectFileReducer.activeProjectFileId;
|
|
1949
1888
|
const selectIsImportingProjectFile = (state) => state.projectFileReducer.isImportingProjectFile;
|
|
1950
1889
|
const selectProjectFileById = (id) => (state) => {
|
|
@@ -4814,7 +4753,6 @@ class IssueService extends BaseApiService {
|
|
|
4814
4753
|
created_by: createdBy
|
|
4815
4754
|
});
|
|
4816
4755
|
this.dispatch(addIssue(offlineIssue));
|
|
4817
|
-
this.dispatch(addActiveProjectIssuesCount(1));
|
|
4818
4756
|
const promise = this.enqueueRequest({
|
|
4819
4757
|
description: "Create issue",
|
|
4820
4758
|
method: HttpMethod.POST,
|
|
@@ -4831,7 +4769,6 @@ class IssueService extends BaseApiService {
|
|
|
4831
4769
|
this.dispatch(updateIssue(result));
|
|
4832
4770
|
}).catch((error) => {
|
|
4833
4771
|
this.dispatch(deleteIssue(offlineIssue.offline_id));
|
|
4834
|
-
this.dispatch(addActiveProjectIssuesCount(-1));
|
|
4835
4772
|
throw error;
|
|
4836
4773
|
});
|
|
4837
4774
|
return [offlineIssue, promise];
|
|
@@ -4947,7 +4884,6 @@ class IssueService extends BaseApiService {
|
|
|
4947
4884
|
issueAssociationsRecord[issueAssociation.offline_id] = issueAssociation;
|
|
4948
4885
|
const issueAssociations = Object.values(issueAssociationsRecord);
|
|
4949
4886
|
this.dispatch(deleteIssue(id));
|
|
4950
|
-
this.dispatch(addActiveProjectIssuesCount(-1));
|
|
4951
4887
|
if (attachmentsOfIssue.length > 0)
|
|
4952
4888
|
this.dispatch(deleteIssueAttachments(attachmentsOfIssue.map(({ offline_id }) => offline_id)));
|
|
4953
4889
|
if (updatesOfIssue.length > 0)
|
|
@@ -4968,7 +4904,6 @@ class IssueService extends BaseApiService {
|
|
|
4968
4904
|
this.dispatch(addIssue(backup));
|
|
4969
4905
|
this.dispatch(addIssueAttachments(attachmentsOfIssue));
|
|
4970
4906
|
this.dispatch(addIssueUpdates(updatesOfIssue));
|
|
4971
|
-
this.dispatch(addActiveProjectIssuesCount(1));
|
|
4972
4907
|
this.dispatch(addFormSubmissions(formSubmissionsOfIssue));
|
|
4973
4908
|
this.dispatch(addIssueAssociations(issueAssociations));
|
|
4974
4909
|
throw e;
|
|
@@ -5136,13 +5071,9 @@ class ProjectFileService extends BaseApiService {
|
|
|
5136
5071
|
const { store } = this.client;
|
|
5137
5072
|
const state = store.getState();
|
|
5138
5073
|
const activeProjectFileId = state.projectFileReducer.activeProjectFileId;
|
|
5139
|
-
const activeProjectId = state.projectReducer.activeProjectId;
|
|
5140
5074
|
if (!activeProjectFileId) {
|
|
5141
5075
|
throw new Error("No active project file");
|
|
5142
5076
|
}
|
|
5143
|
-
if (!activeProjectId) {
|
|
5144
|
-
throw new Error("No active project");
|
|
5145
|
-
}
|
|
5146
5077
|
const activeProjectFile = state.projectFileReducer.projectFiles[activeProjectFileId];
|
|
5147
5078
|
if (!activeProjectFile) {
|
|
5148
5079
|
throw new Error("No active project file");
|
|
@@ -5167,7 +5098,7 @@ class ProjectFileService extends BaseApiService {
|
|
|
5167
5098
|
this.client.files.uploadFileToS3(activeProjectFile.file_sha1).then(([fileProps]) => {
|
|
5168
5099
|
resolve({
|
|
5169
5100
|
method: HttpMethod.POST,
|
|
5170
|
-
url: `/projects/${
|
|
5101
|
+
url: `/projects/${activeProjectFile.project}/files/`,
|
|
5171
5102
|
payload: {
|
|
5172
5103
|
...activeProjectFile,
|
|
5173
5104
|
...fileProps
|
|
@@ -5243,23 +5174,17 @@ class ProjectAttachmentService extends BaseAttachmentService {
|
|
|
5243
5174
|
}
|
|
5244
5175
|
class ProjectService extends BaseApiService {
|
|
5245
5176
|
async add(payload) {
|
|
5246
|
-
if (!payload.organization_owner && !payload.user_owner) {
|
|
5247
|
-
throw new Error("Project type was not chosen when trying to create a project");
|
|
5248
|
-
}
|
|
5249
5177
|
if (!payload.bounds && !payload.canvas_bounds) {
|
|
5250
5178
|
throw new Error("Project must either have bounds or canvas_bounds set");
|
|
5251
5179
|
}
|
|
5252
|
-
const isOrganizationProject = !!payload.organization_owner;
|
|
5253
|
-
const url = isOrganizationProject ? `/organizations/${payload.organization_owner}/projects/` : "/projects/";
|
|
5254
|
-
const projectType = isOrganizationProject ? { organization_owner: payload.organization_owner } : { user_owner: payload.user_owner };
|
|
5255
5180
|
return await this.enqueueRequest({
|
|
5256
5181
|
description: "Create project",
|
|
5257
5182
|
method: HttpMethod.POST,
|
|
5258
|
-
url,
|
|
5183
|
+
url: "/projects/",
|
|
5259
5184
|
payload: {
|
|
5260
5185
|
name: payload.name,
|
|
5261
5186
|
bounds: payload.bounds,
|
|
5262
|
-
|
|
5187
|
+
organization_owner: payload.organization_owner
|
|
5263
5188
|
},
|
|
5264
5189
|
blockers: [],
|
|
5265
5190
|
blocks: []
|
|
@@ -5269,7 +5194,7 @@ class ProjectService extends BaseApiService {
|
|
|
5269
5194
|
if (!project.bounds && !project.canvas_bounds) {
|
|
5270
5195
|
throw new Error("Project must either have bounds or canvas_bounds set");
|
|
5271
5196
|
}
|
|
5272
|
-
this.dispatch(
|
|
5197
|
+
this.dispatch(updateProject(project));
|
|
5273
5198
|
return await this.enqueueRequest({
|
|
5274
5199
|
description: "Update project",
|
|
5275
5200
|
method: HttpMethod.PATCH,
|
|
@@ -5583,28 +5508,28 @@ class FormService extends BaseUploadService {
|
|
|
5583
5508
|
});
|
|
5584
5509
|
return [fullRevision, offlineFormRevisionAttachments, promise, attachmentsPromise];
|
|
5585
5510
|
}
|
|
5586
|
-
async delete(
|
|
5511
|
+
async delete(id) {
|
|
5587
5512
|
const { store } = this.client;
|
|
5588
5513
|
const state = store.getState();
|
|
5589
|
-
const form = selectFormById(
|
|
5514
|
+
const form = selectFormById(id)(state);
|
|
5590
5515
|
if (!form) {
|
|
5591
5516
|
throw new Error("Expected form to exist");
|
|
5592
5517
|
}
|
|
5593
|
-
const formSubmissions = selectFormSubmissionsOfForm(
|
|
5518
|
+
const formSubmissions = selectFormSubmissionsOfForm(id)(state);
|
|
5594
5519
|
if (formSubmissions.length > 0) {
|
|
5595
5520
|
this.dispatch(deleteFormSubmissions(formSubmissions.map(({ offline_id }) => offline_id)));
|
|
5596
5521
|
}
|
|
5597
|
-
const formRevisions = selectFormRevisionsOfForm(
|
|
5522
|
+
const formRevisions = selectFormRevisionsOfForm(id)(state);
|
|
5598
5523
|
if (formRevisions.length > 0) {
|
|
5599
5524
|
this.dispatch(deleteFormRevisions(formRevisions.map(({ offline_id }) => offline_id)));
|
|
5600
5525
|
}
|
|
5601
|
-
this.dispatch(deleteForm(
|
|
5526
|
+
this.dispatch(deleteForm(id));
|
|
5602
5527
|
try {
|
|
5603
5528
|
return await this.enqueueRequest({
|
|
5604
5529
|
description: "Delete form",
|
|
5605
5530
|
method: HttpMethod.DELETE,
|
|
5606
|
-
url: `/forms/${
|
|
5607
|
-
blockers: [
|
|
5531
|
+
url: `/forms/${id}/`,
|
|
5532
|
+
blockers: [id],
|
|
5608
5533
|
blocks: []
|
|
5609
5534
|
});
|
|
5610
5535
|
} catch (e) {
|
|
@@ -5809,12 +5734,10 @@ class FormSubmissionService extends BaseUploadService {
|
|
|
5809
5734
|
files
|
|
5810
5735
|
);
|
|
5811
5736
|
promise.then((result) => {
|
|
5812
|
-
this.dispatch(addActiveProjectFormSubmissionsCount(1));
|
|
5813
5737
|
this.dispatch(setFormSubmission(result));
|
|
5814
5738
|
return result;
|
|
5815
5739
|
}).catch(() => {
|
|
5816
5740
|
this.dispatch(deleteFormSubmission(offlineSubmission.offline_id));
|
|
5817
|
-
this.dispatch(addActiveProjectFormSubmissionsCount(-1));
|
|
5818
5741
|
});
|
|
5819
5742
|
return [offlineSubmission, offlineFormSubmissionAttachments, promise, attachmentsPromise];
|
|
5820
5743
|
}
|
|
@@ -5972,27 +5895,25 @@ class FormSubmissionService extends BaseUploadService {
|
|
|
5972
5895
|
deleteAttachmentsPromise
|
|
5973
5896
|
];
|
|
5974
5897
|
}
|
|
5975
|
-
async delete(
|
|
5898
|
+
async delete(id) {
|
|
5976
5899
|
const { store } = this.client;
|
|
5977
5900
|
const state = store.getState();
|
|
5978
|
-
const submissionToBeDeleted = selectFormSubmissionById(
|
|
5901
|
+
const submissionToBeDeleted = selectFormSubmissionById(id)(state);
|
|
5979
5902
|
if (!submissionToBeDeleted) {
|
|
5980
|
-
throw new Error(`Expected submission with offline_id ${
|
|
5903
|
+
throw new Error(`Expected submission with offline_id ${id} to exist`);
|
|
5981
5904
|
}
|
|
5982
|
-
const submissionAttachments = selectAttachmentsOfFormSubmission(
|
|
5983
|
-
this.dispatch(deleteFormSubmission(
|
|
5984
|
-
this.dispatch(addActiveProjectFormSubmissionsCount(-1));
|
|
5905
|
+
const submissionAttachments = selectAttachmentsOfFormSubmission(id)(state);
|
|
5906
|
+
this.dispatch(deleteFormSubmission(id));
|
|
5985
5907
|
this.dispatch(deleteFormSubmissionAttachments(submissionAttachments.map((x) => x.offline_id)));
|
|
5986
5908
|
try {
|
|
5987
5909
|
return await this.enqueueRequest({
|
|
5988
5910
|
description: "Delete user form submissions",
|
|
5989
5911
|
method: HttpMethod.DELETE,
|
|
5990
|
-
url: `/forms/submissions/${
|
|
5991
|
-
blockers: [
|
|
5912
|
+
url: `/forms/submissions/${id}/`,
|
|
5913
|
+
blockers: [id],
|
|
5992
5914
|
blocks: []
|
|
5993
5915
|
});
|
|
5994
5916
|
} catch (e) {
|
|
5995
|
-
this.dispatch(addActiveProjectFormSubmissionsCount(1));
|
|
5996
5917
|
this.dispatch(addFormSubmission(submissionToBeDeleted));
|
|
5997
5918
|
this.dispatch(addFormSubmissionAttachments(submissionAttachments));
|
|
5998
5919
|
throw e;
|
|
@@ -6094,22 +6015,22 @@ class WorkspaceService extends BaseApiService {
|
|
|
6094
6015
|
});
|
|
6095
6016
|
return [workspace, promise];
|
|
6096
6017
|
}
|
|
6097
|
-
delete(
|
|
6018
|
+
delete(id) {
|
|
6098
6019
|
const { store } = this.client;
|
|
6099
|
-
const originalWorkspace = selectWorkspaceById(
|
|
6100
|
-
|
|
6020
|
+
const originalWorkspace = selectWorkspaceById(id)(store.getState());
|
|
6021
|
+
if (!originalWorkspace) {
|
|
6022
|
+
throw new Error(`Expected an existing workspace with id ${id}`);
|
|
6023
|
+
}
|
|
6024
|
+
this.dispatch(deleteWorkspace(id));
|
|
6101
6025
|
const promise = this.enqueueRequest({
|
|
6102
6026
|
description: "Delete Workspace",
|
|
6103
6027
|
method: HttpMethod.DELETE,
|
|
6104
|
-
url: `/workspaces/${
|
|
6105
|
-
blockers: [
|
|
6028
|
+
url: `/workspaces/${id}/`,
|
|
6029
|
+
blockers: [id],
|
|
6106
6030
|
blocks: []
|
|
6107
6031
|
});
|
|
6108
|
-
void promise.
|
|
6109
|
-
|
|
6110
|
-
if (originalWorkspace) {
|
|
6111
|
-
this.dispatch(addWorkspace(originalWorkspace));
|
|
6112
|
-
}
|
|
6032
|
+
void promise.catch((reason) => {
|
|
6033
|
+
this.dispatch(addWorkspace(originalWorkspace));
|
|
6113
6034
|
throw reason;
|
|
6114
6035
|
});
|
|
6115
6036
|
return promise;
|
|
@@ -6487,9 +6408,7 @@ class LicenseService extends BaseApiService {
|
|
|
6487
6408
|
method: HttpMethod.GET,
|
|
6488
6409
|
url: `/billing/${license.offline_id}/`,
|
|
6489
6410
|
isAuthNeeded: true,
|
|
6490
|
-
blockers: [
|
|
6491
|
-
license.organization_owner ? license.organization_owner.toString() : license.user_owner ? license.user_owner.toString() : ""
|
|
6492
|
-
],
|
|
6411
|
+
blockers: [license.organization_owner ? license.organization_owner.toString() : ""],
|
|
6493
6412
|
blocks: []
|
|
6494
6413
|
});
|
|
6495
6414
|
this.dispatch(updateLicense(result));
|
|
@@ -6501,9 +6420,7 @@ class LicenseService extends BaseApiService {
|
|
|
6501
6420
|
method: HttpMethod.DELETE,
|
|
6502
6421
|
url: `/billing/${license.offline_id}/suspend/`,
|
|
6503
6422
|
isAuthNeeded: true,
|
|
6504
|
-
blockers: [
|
|
6505
|
-
license.organization_owner ? license.organization_owner.toString() : license.user_owner ? license.user_owner.toString() : ""
|
|
6506
|
-
],
|
|
6423
|
+
blockers: [license.organization_owner ? license.organization_owner.toString() : ""],
|
|
6507
6424
|
blocks: []
|
|
6508
6425
|
});
|
|
6509
6426
|
this.dispatch(updateLicense(result));
|
|
@@ -6515,9 +6432,7 @@ class LicenseService extends BaseApiService {
|
|
|
6515
6432
|
method: HttpMethod.PATCH,
|
|
6516
6433
|
url: `/billing/${license.offline_id}/suspend/`,
|
|
6517
6434
|
isAuthNeeded: true,
|
|
6518
|
-
blockers: [
|
|
6519
|
-
license.organization_owner ? license.organization_owner.toString() : license.user_owner ? license.user_owner.toString() : ""
|
|
6520
|
-
],
|
|
6435
|
+
blockers: [license.organization_owner ? license.organization_owner.toString() : ""],
|
|
6521
6436
|
blocks: []
|
|
6522
6437
|
});
|
|
6523
6438
|
this.dispatch(updateLicense(result));
|
|
@@ -6529,9 +6444,7 @@ class LicenseService extends BaseApiService {
|
|
|
6529
6444
|
method: HttpMethod.DELETE,
|
|
6530
6445
|
url: `/billing/${license.offline_id}/`,
|
|
6531
6446
|
isAuthNeeded: true,
|
|
6532
|
-
blockers: [
|
|
6533
|
-
license.organization_owner ? license.organization_owner.toString() : license.user_owner ? license.user_owner.toString() : ""
|
|
6534
|
-
],
|
|
6447
|
+
blockers: [license.organization_owner ? license.organization_owner.toString() : ""],
|
|
6535
6448
|
blocks: []
|
|
6536
6449
|
});
|
|
6537
6450
|
this.dispatch(updateLicense(result));
|
|
@@ -6545,7 +6458,7 @@ class LicenseService extends BaseApiService {
|
|
|
6545
6458
|
isAuthNeeded: true,
|
|
6546
6459
|
payload: { project: project.id },
|
|
6547
6460
|
blockers: [
|
|
6548
|
-
license.organization_owner ? license.organization_owner.toString() :
|
|
6461
|
+
license.organization_owner ? license.organization_owner.toString() : "",
|
|
6549
6462
|
project.id ? project.id.toString() : ""
|
|
6550
6463
|
],
|
|
6551
6464
|
blocks: ["add-issue", "add-form-entry", "change-access-level", "add-workspace"]
|
|
@@ -6559,9 +6472,7 @@ class LicenseService extends BaseApiService {
|
|
|
6559
6472
|
method: HttpMethod.DELETE,
|
|
6560
6473
|
url: `/billing/${license.offline_id}/project/`,
|
|
6561
6474
|
isAuthNeeded: true,
|
|
6562
|
-
blockers: [
|
|
6563
|
-
license.organization_owner ? license.organization_owner.toString() : license.user_owner ? license.user_owner.toString() : ""
|
|
6564
|
-
],
|
|
6475
|
+
blockers: [license.organization_owner ? license.organization_owner.toString() : ""],
|
|
6565
6476
|
blocks: ["add-issue", "add-form-entry", "change-access-level", "add-workspace"]
|
|
6566
6477
|
});
|
|
6567
6478
|
this.dispatch(updateLicense(result));
|
|
@@ -6879,15 +6790,14 @@ class DocumentAttachmentService extends BaseAttachmentService {
|
|
|
6879
6790
|
}
|
|
6880
6791
|
}
|
|
6881
6792
|
class AgentService extends BaseApiService {
|
|
6882
|
-
async startConversation(prompt) {
|
|
6883
|
-
const activeProjectId = this.client.store.getState().projectReducer.activeProjectId;
|
|
6793
|
+
async startConversation(prompt, projectId) {
|
|
6884
6794
|
return this.enqueueRequest({
|
|
6885
6795
|
description: "Start agent conversation",
|
|
6886
6796
|
method: HttpMethod.POST,
|
|
6887
6797
|
url: "/agents/prompt/",
|
|
6888
6798
|
payload: {
|
|
6889
6799
|
prompt,
|
|
6890
|
-
active_project:
|
|
6800
|
+
active_project: projectId
|
|
6891
6801
|
},
|
|
6892
6802
|
blockers: ["prompt"],
|
|
6893
6803
|
blocks: ["prompt"]
|
|
@@ -6896,21 +6806,14 @@ class AgentService extends BaseApiService {
|
|
|
6896
6806
|
return response;
|
|
6897
6807
|
});
|
|
6898
6808
|
}
|
|
6899
|
-
|
|
6900
|
-
* Prompt the agent with a message.
|
|
6901
|
-
* @param prompt The message to prompt the agent with.
|
|
6902
|
-
* @param conversationId If continuing an existing message, the UUID of that conversation.
|
|
6903
|
-
*/
|
|
6904
|
-
async continueConversation(prompt, conversationId) {
|
|
6905
|
-
const { store } = this.client;
|
|
6906
|
-
const activeProjectId = store.getState().projectReducer.activeProjectId;
|
|
6809
|
+
async continueConversation(prompt, conversationId, projectId) {
|
|
6907
6810
|
return this.enqueueRequest({
|
|
6908
6811
|
description: "Prompt agent",
|
|
6909
6812
|
method: HttpMethod.POST,
|
|
6910
6813
|
url: "/agents/prompt/",
|
|
6911
6814
|
payload: {
|
|
6912
6815
|
prompt,
|
|
6913
|
-
active_project:
|
|
6816
|
+
active_project: projectId
|
|
6914
6817
|
},
|
|
6915
6818
|
blockers: ["prompt"],
|
|
6916
6819
|
blocks: ["prompt"],
|
|
@@ -7002,21 +6905,21 @@ class TeamService extends BaseApiService {
|
|
|
7002
6905
|
});
|
|
7003
6906
|
return [offlineUpdatedTeam, promise];
|
|
7004
6907
|
}
|
|
7005
|
-
async delete(
|
|
6908
|
+
async delete(id) {
|
|
7006
6909
|
const { store } = this.client;
|
|
7007
6910
|
const state = store.getState();
|
|
7008
|
-
const team = selectTeamById(
|
|
6911
|
+
const team = selectTeamById(id)(state);
|
|
7009
6912
|
if (!team) {
|
|
7010
|
-
throw new Error(`Expected team with id ${
|
|
6913
|
+
throw new Error(`Expected team with id ${id} to exist`);
|
|
7011
6914
|
}
|
|
7012
|
-
this.dispatch(deleteTeam(
|
|
6915
|
+
this.dispatch(deleteTeam(id));
|
|
7013
6916
|
try {
|
|
7014
6917
|
return await this.enqueueRequest({
|
|
7015
6918
|
description: "Delete team",
|
|
7016
6919
|
method: HttpMethod.DELETE,
|
|
7017
|
-
url: `/organizations/teams/${
|
|
7018
|
-
blockers: [
|
|
7019
|
-
blocks: [
|
|
6920
|
+
url: `/organizations/teams/${id}/`,
|
|
6921
|
+
blockers: [id],
|
|
6922
|
+
blocks: [id]
|
|
7020
6923
|
});
|
|
7021
6924
|
} catch (e) {
|
|
7022
6925
|
this.dispatch(setTeam(team));
|
|
@@ -7246,20 +7149,20 @@ class GeoImageService extends BaseUploadService {
|
|
|
7246
7149
|
});
|
|
7247
7150
|
return [updatedGeoImage, promise];
|
|
7248
7151
|
}
|
|
7249
|
-
async delete(
|
|
7152
|
+
async delete(id) {
|
|
7250
7153
|
const { store } = this.client;
|
|
7251
7154
|
const state = store.getState();
|
|
7252
|
-
const geoImageToDelete = selectGeoImageById(
|
|
7155
|
+
const geoImageToDelete = selectGeoImageById(id)(state);
|
|
7253
7156
|
if (!geoImageToDelete) {
|
|
7254
|
-
throw new Error(`Map image with offline_id ${
|
|
7157
|
+
throw new Error(`Map image with offline_id ${id} does not exist in the store`);
|
|
7255
7158
|
}
|
|
7256
|
-
this.dispatch(deleteGeoImage(
|
|
7159
|
+
this.dispatch(deleteGeoImage(id));
|
|
7257
7160
|
const promise = this.enqueueRequest({
|
|
7258
7161
|
description: "Delete geo image",
|
|
7259
7162
|
method: HttpMethod.DELETE,
|
|
7260
|
-
url: `/geo-images/${
|
|
7261
|
-
blocks: [
|
|
7262
|
-
blockers: [
|
|
7163
|
+
url: `/geo-images/${id}/`,
|
|
7164
|
+
blocks: [id],
|
|
7165
|
+
blockers: [id]
|
|
7263
7166
|
});
|
|
7264
7167
|
promise.catch(() => {
|
|
7265
7168
|
this.dispatch(setGeoImage(geoImageToDelete));
|
|
@@ -7413,8 +7316,6 @@ export {
|
|
|
7413
7316
|
_selectLatestFormRevision,
|
|
7414
7317
|
_setLatestRetryTime,
|
|
7415
7318
|
acceptProjectInvite,
|
|
7416
|
-
addActiveProjectFormSubmissionsCount,
|
|
7417
|
-
addActiveProjectIssuesCount,
|
|
7418
7319
|
addAsset,
|
|
7419
7320
|
addAssetAttachment,
|
|
7420
7321
|
addAssetAttachments,
|
|
@@ -7459,7 +7360,6 @@ export {
|
|
|
7459
7360
|
addLicenses,
|
|
7460
7361
|
addOrReplaceProjectFile,
|
|
7461
7362
|
addOrReplaceProjectFiles,
|
|
7462
|
-
addOrReplaceProjects,
|
|
7463
7363
|
addProjectAttachment,
|
|
7464
7364
|
addProjectAttachments,
|
|
7465
7365
|
addTeam,
|
|
@@ -7668,10 +7568,7 @@ export {
|
|
|
7668
7568
|
saveActiveProjectFileBounds,
|
|
7669
7569
|
selectAccessToken,
|
|
7670
7570
|
selectActiveOrganizationAccess,
|
|
7671
|
-
selectActiveProject,
|
|
7672
|
-
selectActiveProjectAccess,
|
|
7673
7571
|
selectActiveProjectFileId,
|
|
7674
|
-
selectActiveProjectId,
|
|
7675
7572
|
selectActiveStatusLicenses,
|
|
7676
7573
|
selectAllDocumentAttachments,
|
|
7677
7574
|
selectAllProjectAttachments,
|
|
@@ -7846,7 +7743,6 @@ export {
|
|
|
7846
7743
|
selectWorkspaceMapping,
|
|
7847
7744
|
selectWorkspaces,
|
|
7848
7745
|
setActiveProjectFileId,
|
|
7849
|
-
setActiveProjectId,
|
|
7850
7746
|
setAsset,
|
|
7851
7747
|
setAssetAttachment,
|
|
7852
7748
|
setAssetAttachments,
|
|
@@ -7935,8 +7831,8 @@ export {
|
|
|
7935
7831
|
updateIssueAttachments,
|
|
7936
7832
|
updateIssueType,
|
|
7937
7833
|
updateLicense,
|
|
7938
|
-
updateOrCreateProject,
|
|
7939
7834
|
updateOrganizationAccess,
|
|
7835
|
+
updateProject,
|
|
7940
7836
|
updateProjectAccess,
|
|
7941
7837
|
updateProjectAttachment,
|
|
7942
7838
|
updateProjectAttachments,
|