Skip to content

Commit f9c0bde

Browse files
authored
Merge branch 'develop' into feature/getFromLocalStorageOrApi
2 parents 9e248ff + e759350 commit f9c0bde

File tree

4 files changed

+52
-103
lines changed

4 files changed

+52
-103
lines changed

package-lock.json

Lines changed: 50 additions & 49 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"coveralls": "3.0.14",
5151
"cross-env": "6.0.3",
5252
"cypress": "6.9.1",
53-
"cypress-cucumber-preprocessor": "4.1.1",
53+
"cypress-cucumber-preprocessor": "4.1.2",
5454
"cypress-failed-log": "2.9.0",
5555
"cypress-intellij-reporter": "0.0.6",
5656
"cypress-junit-reporter": "1.3.1",

src/js/controllers/variableSearchCtrl.js

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -344,58 +344,6 @@ angular.module('starter').controller('VariableSearchCtrl',
344344
function getPluralVariableCategoryName(){
345345
return $filter('wordAliases')(pluralize(getVariableCategoryName(), 1));
346346
}
347-
var checkNameExists = function(item){
348-
if(!item.name){
349-
var message = "variable doesn't have a name! variable: " + JSON.stringify(item);
350-
qmLog.error(message);
351-
qmLog.error(message);
352-
return false;
353-
}
354-
return true;
355-
};
356-
$scope.matchEveryWord = function(){
357-
return function(item){
358-
if($scope.state.variableSearchParameters.barcode){
359-
return true;
360-
} // Name's not going to match the number
361-
if(!checkNameExists(item)){
362-
return false;
363-
}
364-
if(item.variableCategoryName){
365-
if($scope.state.variableSearchParameters.manualTracking && $scope.state.variableSearchParameters.searchPhrase.length < 5){
366-
if(item.variableCategoryName.indexOf('Location') !== -1 ||
367-
item.variableCategoryName.indexOf('Software') !== -1 ||
368-
item.variableCategoryName.indexOf('Environment') !== -1){
369-
return false;
370-
}
371-
}
372-
}
373-
if($scope.state.excludeDuplicateBloodPressure){
374-
if(item.name.toLowerCase().indexOf('diastolic') !== -1 || item.name.toLowerCase().indexOf('systolic') !== -1){
375-
return false;
376-
}
377-
}
378-
if($scope.state.excludeSingularBloodPressure && item.name.toLowerCase() === 'blood pressure'){
379-
return false;
380-
}
381-
var variableObjectAsString = JSON.stringify(item).toLowerCase();
382-
var lowercaseVariableSearchQuery = $scope.state.variableSearchParameters.searchPhrase.toLowerCase();
383-
var filterBy = lowercaseVariableSearchQuery.split(/\s+/);
384-
if(lowercaseVariableSearchQuery){
385-
if(!filterBy.length){
386-
return true;
387-
}
388-
}else{
389-
return true;
390-
}
391-
return filterBy.every(function(word){
392-
var exists = variableObjectAsString.indexOf(word);
393-
if(exists !== -1){
394-
return true;
395-
}
396-
});
397-
};
398-
};
399347
// https://open.fda.gov/api/reference/ API Key https://open.fda.gov/api/reference/
400348
$scope.scanBarcode = function(){
401349
var params = getVariableSearchParameters();

src/templates/variable-search.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
<ion-list ng-show="state.variableSearchResults.length" class>
4848
<!--<ion-item ng-click="selectVariable(item)" ng-repeat="item in state.variableSearchResults | orderBy:'-latestMeasurementTime' | limitTo:5 | unique:'id' ">-->
4949
<ion-item id="variable-search-result" ng-click="selectVariable(item)"
50-
ng-repeat="item in state.variableSearchResults | filter:matchEveryWord() | unique:'name' track by $index">
50+
ng-repeat="item in state.variableSearchResults | unique:'name' track by $index">
5151
<div>
5252
<!-- For some reason, putting displayName on new line in HTML code also produces new line in rendered HTML even though there's no <br> -->
5353
<p style="font-size:18px; white-space: pre;"><i ng-if="item.ionIcon" class="icon {{item.ionIcon}}"></i>&nbsp {{item.displayName}}</p>

0 commit comments

Comments
 (0)