Skip to content

Commit

Permalink
Some checks for repeated values in the item lists were wrong
Browse files Browse the repository at this point in the history
`self` was used rather than `this` in some javascript code.
  • Loading branch information
manthey committed Oct 15, 2024
1 parent 4e58f07 commit 929d239
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 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 @@
### Bug Fixes

- Don't use a default for yaml config files except .large_image_config.yaml ([#1685](../../pull/1685))
- Some checks for repeated values in the item lists were wrong ([#1686](../../pull/1686))

## 1.30.0

Expand Down
10 changes: 5 additions & 5 deletions girder/girder_large_image/web_client/views/itemList.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ wrap(ItemListWidget, 'render', function (render) {
return false;
}
if (nav.type === 'itemList') {
if ((nav.name || '') === (self._namedList || '')) {
if ((nav.name || '') === (this._namedList || '')) {
return false;
}
if (!this._liconfig || !this._liconfig.namedItemLists || (nav.name && !this._liconfig.namedItemLists[nav.name])) {
Expand Down Expand Up @@ -461,7 +461,7 @@ wrap(ItemListWidget, 'render', function (render) {
return;
}
if (nav.type === 'itemList') {
if ((nav.name || '') === (self._namedList || '')) {
if ((nav.name || '') === (this._namedList || '')) {
return;
}
if (!this._liconfig || !this._liconfig.namedItemLists || (nav.name && !this._liconfig.namedItemLists[nav.name])) {
Expand Down Expand Up @@ -668,15 +668,15 @@ function itemListMetadataEdit(evt) {
const column = columns[+ctrl.attr('column-idx')];
let tempValue = ctrl.find('.g-widget-metadata-value-input').val();
tempValue = tempValue.trim();
let valResult = validateMetadataValue(column, tempValue, self._lastValidationError || (tempValue === '' && !column.required));
let valResult = validateMetadataValue(column, tempValue, this._lastValidationError || (tempValue === '' && !column.required));
if (tempValue === '' && !column.required) {
valResult = {value: tempValue};
}
if (!valResult) {
self._lastValidationError = true;
this._lastValidationError = true;

Check warning on line 676 in girder/girder_large_image/web_client/views/itemList.js

View check run for this annotation

Codecov / codecov/patch

girder/girder_large_image/web_client/views/itemList.js#L676

Added line #L676 was not covered by tests
return false;
}
self._lastValidationError = false;
this._lastValidationError = false;

Check warning on line 679 in girder/girder_large_image/web_client/views/itemList.js

View check run for this annotation

Codecov / codecov/patch

girder/girder_large_image/web_client/views/itemList.js#L679

Added line #L679 was not covered by tests
const item = this.collection.get(ctrl.closest('[g-item-cid]').attr('g-item-cid'));
let value = item.get('meta') || {};
let meta;
Expand Down

0 comments on commit 929d239

Please sign in to comment.