diff --git a/CHANGELOG.md b/CHANGELOG.md index c7a2b5ea8..dcb3c5dfe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Improvements - Harden when the bioformats reader claims it has a zero sized image ([#1268](../../pull/1268)) - Harden internal retiling. This sometimes affected histograms ([#1269](../../pull/1269)) +- Set annotation update user in client so it appears faster ([#1270](../../pull/1270)) ### Changes - Adjust tifffile log level ([#1265](../../pull/1265)) diff --git a/girder_annotation/girder_large_image_annotation/web_client/models/AnnotationModel.js b/girder_annotation/girder_large_image_annotation/web_client/models/AnnotationModel.js index 7fabfa868..c89d516a5 100644 --- a/girder_annotation/girder_large_image_annotation/web_client/models/AnnotationModel.js +++ b/girder_annotation/girder_large_image_annotation/web_client/models/AnnotationModel.js @@ -1,5 +1,6 @@ import _ from 'underscore'; import AccessControlledModel from '@girder/core/models/AccessControlledModel'; +import {getCurrentUser} from '@girder/core/auth'; import {restRequest} from '@girder/core/rest'; import MetadataMixin from '@girder/core/models/MetadataMixin'; @@ -33,6 +34,7 @@ const AnnotationModel = AccessControlledModel.extend({ initialize() { if (!this.get('updated')) { this.attributes.updated = '' + Date.now(); // eslint-disable-line backbone/no-model-attributes + this.attributes.updatedId = getCurrentUser().id; // eslint-disable-line backbone/no-model-attributes } this._region = { maxDetails: this.get('maxDetails'), @@ -294,6 +296,7 @@ const AnnotationModel = AccessControlledModel.extend({ url = `annotation/${this.id}`; method = 'PUT'; this.attributes.updated = '' + Date.now(); // eslint-disable-line backbone/no-model-attributes + this.attributes.updatedId = getCurrentUser().id; // eslint-disable-line backbone/no-model-attributes } if (this._pageElements === false || isNew) { @@ -354,6 +357,7 @@ const AnnotationModel = AccessControlledModel.extend({ let xhr = false; if (!this.isNew()) { this.attributes.updated = '' + Date.now(); // eslint-disable-line backbone/no-model-attributes + this.attributes.updatedId = getCurrentUser().id; // eslint-disable-line backbone/no-model-attributes xhr = restRequest({ url: `annotation/${this.id}`, method: 'DELETE'