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

Export itemViewWidget. #483

Merged
merged 1 commit into from
Sep 29, 2020
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@

### Features
- Added bioformats tile source (#463)
- Handle OME Tiff files with sub-ifd images (#469)

### Improvements
- Expose more internal metadata (#479)
- Improve how Philips XML internal metadata is reported (#475)
- Show aperio version in internal metadata (#474)
- Add css classes to metadata on the item page (#472)
- The Girder web client exports the ItemViewWidget

### Bug Fixes
- Add a reference to updated time to avoid overcaching associated images (#477)
Expand Down
4 changes: 3 additions & 1 deletion girder/girder_large_image/web_client/views/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import ConfigView from './configView';
import ImageViewerSelectWidget from './imageViewerSelectWidget';
import * as imageViewerWidget from './imageViewerWidget';
import ItemViewWidget from './itemViewWidget';

export {
ConfigView,
ImageViewerSelectWidget,
imageViewerWidget
imageViewerWidget,
ItemViewWidget
};
26 changes: 2 additions & 24 deletions girder/girder_large_image/web_client/views/itemView.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import $ from 'jquery';
import yaml from 'js-yaml';
import { AccessType } from '@girder/core/constants';
import { restRequest, getApiRoot } from '@girder/core/rest';
import { restRequest } from '@girder/core/rest';
import { wrap } from '@girder/core/utilities/PluginUtils';
import ItemView from '@girder/core/views/body/ItemView';
import View from '@girder/core/views/View';

import largeImageConfig from './configView';
import itemViewWidget from '../templates/itemView.pug';
import ItemViewWidget from './itemViewWidget';
import '../stylesheets/itemView.styl';

wrap(ItemView, 'render', function (render) {
Expand Down Expand Up @@ -53,23 +51,3 @@ wrap(ItemView, 'render', function (render) {
}, this);
render.call(this);
});

var ItemViewWidget = View.extend({
initialize: function (settings) {
this.itemId = settings.imageModel.id;
this.model = settings.imageModel;
this.extra = settings.extra;
this.metadata = settings.metadata;
},

render: function () {
this.$el.html(itemViewWidget({
extra: this.extra,
updated: this.model.get('updated'),
largeImageMetadata: this.metadata,
yaml: yaml,
imageUrl: `${getApiRoot()}/item/${this.itemId}/tiles/images/`
}));
return this;
}
});
27 changes: 27 additions & 0 deletions girder/girder_large_image/web_client/views/itemViewWidget.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import yaml from 'js-yaml';
import { getApiRoot } from '@girder/core/rest';
import View from '@girder/core/views/View';

import itemViewWidgetTemplate from '../templates/itemView.pug';

var ItemViewWidget = View.extend({
initialize: function (settings) {
this.itemId = settings.imageModel.id;
this.model = settings.imageModel;
this.extra = settings.extra;
this.metadata = settings.metadata;
},

render: function () {
this.$el.html(itemViewWidgetTemplate({
extra: this.extra,
updated: this.model.get('updated'),
largeImageMetadata: this.metadata,
yaml: yaml,
imageUrl: `${getApiRoot()}/item/${this.itemId}/tiles/images/`
}));
return this;
}
});

export default ItemViewWidget;
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ deps =
pytest-girder>=3.0.4; python_version >= '3.6'
pytest-girder>=3.0.4,<3.1; python_version < '3.6'
pytest-xdist
celery!=4.4.4
celery!=4.4.4,<5
# celery 4.4.4 is broken; avoid it until a new version is released
whitelist_externals =
rm
Expand Down