Skip to content

Commit

Permalink
Merge pull request #2004 from openhealthcare/merge-branch-for-v0.23
Browse files Browse the repository at this point in the history
Merge branch for v0.23
  • Loading branch information
davidmiller authored Jun 14, 2022
2 parents 0676bef + 655fecf commit fdb71fc
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
8 changes: 7 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
### 0.23.0 (Major Release)


### 0.22.1 (Minor Release)

#### Exclude many to one relationships from the advanced search

Many to one fields are no longer visible in the advanced search screen.


### 0.22.0 (Major Release)

Expand All @@ -13,11 +19,11 @@ A list of functions attached to the application object that
enable the application to add, remove or alter files in an
advanced search extract.


#### Include ID in the extract

The model ID will no longer be excluded from its csv extract. If present, id will appear first, then patient id, then episode id.


### 0.21.0 (Major Release)

#### Celery upgrade and Django Celery library change.
Expand Down
2 changes: 1 addition & 1 deletion doc/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ dev_addr: 0.0.0.0:8965
include_next_prev: false

extra:
version: v0.21.0
version: v0.23.0

markdown_extensions:
- fenced_code
8 changes: 5 additions & 3 deletions opal/core/search/static/js/search/controllers/extract.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,8 @@ angular.module('opal.controllers').controller(

return criteria;
};

$scope.searchableFields = function(columnName){
var column = $scope.findColumn(columnName);
// TODO - don't hard-code this
if(column){
return _.map(
_.reject(
Expand All @@ -97,8 +95,9 @@ angular.module('opal.controllers').controller(
if(_.contains(NOT_ADVANCED_SEARCHABLE, c.name)){
return true;
}
return c.type == 'token' || c.type == 'list';
return c.type == 'token' || c.type == 'list' || c.type == "many_to_o";;
}),

function(c){ return c; }
).sort();
}
Expand Down Expand Up @@ -144,6 +143,9 @@ angular.module('opal.controllers').controller(
};

$scope.getChoices = function(column, field){
if(!field){
return []
}
var modelField = $scope.findField(column, field);

if(modelField.lookup_list && modelField.lookup_list.length){
Expand Down
11 changes: 11 additions & 0 deletions opal/core/search/static/js/test/extract.controller.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ describe('ExtractCtrl', function(){
"name":"consistency_token",
"type":"token"
},
{
"title":"A Many To One",
"lookup_list":null,
"name":"a many to one",
"type":"many_to_o"
},
{
"title":"Created",
"lookup_list":null,
Expand Down Expand Up @@ -375,6 +381,11 @@ describe('ExtractCtrl', function(){
var result = $scope.getChoices("some", "field");
expect(result).toEqual([1, 2, 3]);
});

it('should error if there is no field', function(){
var result = $scope.getChoices("some", null);
expect(result).toEqual([]);
});
});

describe('refresh', function(){
Expand Down

0 comments on commit fdb71fc

Please sign in to comment.