Skip to content

Commit

Permalink
[ATL-58] Implemented copying of annotations along with ConceptSet
Browse files Browse the repository at this point in the history
  • Loading branch information
oleg-odysseus authored and alex-odysseus committed Oct 29, 2024
1 parent f677cb0 commit ad1ed68
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions js/pages/concept-sets/conceptset-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,7 @@ define([
const current = this.conceptSetStore.current();
current.modifiedBy = savedConceptSet.data.modifiedBy;
current.modifiedDate = savedConceptSet.data.modifiedDate;
current.id=savedConceptSet.data.id;
this.conceptSetStore.current(current);

this.previewVersion(null);
Expand Down Expand Up @@ -582,11 +583,17 @@ define([
}

async copy() {
let sourceConceptSetId = this.currentConceptSet().id;
const responseWithName = await conceptSetService.getCopyName(this.currentConceptSet().id);
this.currentConceptSet().name(responseWithName.copyName);
this.currentConceptSet().id = 0;
this.currentConceptSetDirtyFlag().reset();
await this.saveConceptSet(this.currentConceptSet(), "#txtConceptSetName");
let copyAnnotationsRequest = {
sourceConceptSetId: sourceConceptSetId,
targetConceptSetId: this.currentConceptSet().id
};
await conceptSetService.copyAnnotations(copyAnnotationsRequest);
}

async optimize() {
Expand Down
7 changes: 7 additions & 0 deletions js/services/ConceptSet.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ define(function (require) {
.then(({ data }) => data);
}

function copyAnnotations(copyAnnotationsRequest) {
return httpService
.doPost(`${config.webAPIRoot}conceptset/copy-annotations`, copyAnnotationsRequest)
.then(({ data }) => data);
}

function runDiagnostics(conceptSet) {
return httpService
.doPost(`${config.webAPIRoot}conceptset/check`, conceptSet)
Expand Down Expand Up @@ -144,6 +150,7 @@ define(function (require) {
lookupIdentifiers,
getInclusionCount,
getCopyName,
copyAnnotations,
getConceptSet,
getGenerationInfo,
deleteConceptSet,
Expand Down

0 comments on commit ad1ed68

Please sign in to comment.