Skip to content

Commit

Permalink
Merge branch 'dev-2.11'
Browse files Browse the repository at this point in the history
  • Loading branch information
laurenwalker committed May 20, 2020
2 parents 8b93d58 + 61f3083 commit 812a18a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


<!-- Pull in correct theme configuration, then use Require.js to manage dependencies -->
<script id="loader" type="text/javascript" src="/metacatui/loader.js?v=2.11.4"
<script id="loader" type="text/javascript" src="/metacatui/loader.js?v=2.11.5"
data-theme="default"
data-metacat-context="metacat"
data-map-key="YOUR-GOOGLE-MAPS-API-KEY"
Expand Down
7 changes: 3 additions & 4 deletions src/js/models/filters/Filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,13 +337,12 @@ define(['jquery', 'underscore', 'backbone'],
//Trim off whitespace
value = value.trim();

//Escape special characters
value = this.escapeSpecialChar(value);


var dateRangeRegEx = /^\[((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d*Z)|\*)( |%20)TO( |%20)((\d{4}-[01]\d-[0-3]\dT[0-2]\d(:|\\:)[0-5]\d(:|\\:)[0-5]\d\.\d*Z)|\*)\]/,
isDateRange = dateRangeRegEx.test(value);

//Escape special characters
value = this.escapeSpecialChar(value);

//If the value is a search phrase (more than one word), and not a date range string, wrap in quotes
if( value.indexOf(" ") > -1 && !isDateRange ){
valuesQueryString += "\"" + value + "\"";
Expand Down
7 changes: 7 additions & 0 deletions src/js/views/filters/FilterGroupsView.js
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,13 @@ define(['jquery', 'underscore', 'backbone',
var modelValues = filterModel.get("values"),
thisValue = $(appliedFilterEl).data("value");

//Numbers that are set on the element `data` are stored as type `number`, but when `number`s are
// set on Backbone models, they are converted to `string`s. So we need to check for this use case.
if( typeof thisValue == "number" ){
//Convert the number to a string
thisValue = thisValue.toString();
}

//Remove the value that was in this applied filter
var newValues = _.without(modelValues, thisValue);

Expand Down
2 changes: 1 addition & 1 deletion src/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ MetacatUI.root = "/metacatui"
MetacatUI.root = MetacatUI.root.replace(/\/$/, "");

//This version of Metacat UI - used for cache busting
MetacatUI.metacatUIVersion = "2.11.4";
MetacatUI.metacatUIVersion = "2.11.5";

MetacatUI.loadTheme = function(theme) {
var script = document.createElement("script");
Expand Down

0 comments on commit 812a18a

Please sign in to comment.