Skip to content

Commit

Permalink
Merge pull request #1270 from girder/annotation-update-user
Browse files Browse the repository at this point in the history
Set annotation update user in client so it appears faster
  • Loading branch information
manthey authored Aug 21, 2023
2 parents 52fd387 + 02353ea commit a178eaa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
Original file line number Diff line number Diff line change
@@ -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';

Expand Down Expand Up @@ -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'),
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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'
Expand Down

0 comments on commit a178eaa

Please sign in to comment.