Skip to content
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
3 changes: 2 additions & 1 deletion histomicsui/web_client/dialogs/saveAnnotation.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ var SaveAnnotation = View.extend({
type: 'annotation',
hideRecurseOption: true,
parentView: this,
model: this.annotation
model: this.annotation,
noAccessFlag: true
}).on('g:accessListSaved', () => {
this.annotation.fetch();
});
Expand Down
10 changes: 7 additions & 3 deletions histomicsui/web_client/panels/AnnotationSelector.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import _ from 'underscore';
import $ from 'jquery';

import { restRequest } from '@girder/core/rest';
import { AccessType } from '@girder/core/constants';
import eventStream from '@girder/core/utilities/EventStream';
import { getCurrentUser } from '@girder/core/auth';
Expand Down Expand Up @@ -68,8 +69,11 @@ var AnnotationSelector = Panel.extend({

render() {
this._debounceRenderRequest = null;
if (this.parentItem && this.parentItem.id) {
this.parentItem.getAccessLevel((imageAccessLevel) => {
if (this.parentItem && this.parentItem.get('folderId')) {
restRequest({
type: 'GET',
url: 'annotation/folder/' + this.parentItem.get('folderId') + '/create'
}).done((createResp) => {
const annotationGroups = this._getAnnotationGroups();
if (!this.viewer) {
this.$el.empty();
Expand All @@ -81,7 +85,7 @@ var AnnotationSelector = Panel.extend({
activeAnnotation: this._activeAnnotation ? this._activeAnnotation.id : '',
showLabels: this._showLabels,
user: getCurrentUser() || {},
accessLevel: imageAccessLevel,
creationAccess: createResp,
writeAccessLevel: AccessType.WRITE,
writeAccess: this._writeAccess,
opacity: this._opacity,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ block content
label(title='Highlight annotations when hovering with the mouse.')
input#h-toggle-interactive(type='checkbox', checked=interactiveMode)
| Interactive
if accessLevel >= writeAccessLevel
if creationAccess
button.btn.btn-sm.btn-primary.h-create-annotation(title='Create a new annotation. Keyboard shortcut: space bar')
| #[span.icon-plus-squared] New
.clearfix