Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set annotation update user in client so it appears faster #1270

Merged
merged 1 commit into from
Aug 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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