Skip to content

Commit

Permalink
Annotations: also add message to revisionDesc if document was changed…
Browse files Browse the repository at this point in the history
… via batch annotations
  • Loading branch information
wolfgangmm committed Oct 10, 2024
1 parent 2ef1cc0 commit f9cc65e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion resources/scripts/annotations/annotations.js
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ window.addEventListener("WebComponentsReady", () => {
if (saveAll) {
saveOccurrences(json);
} else {
review(docs, json);
review(docs, json, strings, currentUser);
}
}).catch(() => window.pbEvents.emit("pb-end-update", "transcription", {}));
}
Expand Down
18 changes: 16 additions & 2 deletions resources/scripts/annotations/review-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
let currentReview = 0;
let reviewDocs = [];
let reviewData = {};
let reviewUser = null;
let reviewStrings = [];
let reviewDialog;
let reviewDocLink;

Expand Down Expand Up @@ -61,12 +63,17 @@ document.addEventListener('DOMContentLoaded', () => {
*
* @param {Array} docs list of documents to review
* @param {Object} data object mapping document paths to annotation list
* @param {string} currentUser name of the currently logged in user
*/
function review(docs, data) {
function review(docs, data, strings, currentUser) {
currentReview = 0;
reviewDocs = docs;
reviewOffsets = data;
reviewData = {};
reviewStrings = strings.filter((value, index, self) => {
return self.indexOf(value) === index;
});
reviewUser = currentUser;
_reviewNext();
}

Expand Down Expand Up @@ -186,7 +193,14 @@ function _saveCurrent() {
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(reviewData[doc]),
body: JSON.stringify({
annotations: reviewData[doc],
log: {
user: reviewUser,
message: `Batch-reviewed and merged annotations for strings: ${reviewStrings.join(", ")}`,
status: "batch-review"
}
})
})
.then((response) => {
window.pbEvents.emit("pb-end-update", "transcription", {});
Expand Down

0 comments on commit f9cc65e

Please sign in to comment.