From d59fa08d6d687eb85f9a0b118d832b3987e8dc86 Mon Sep 17 00:00:00 2001 From: fredkingham Date: Fri, 13 May 2022 09:28:45 +0100 Subject: [PATCH 1/7] Bumps the mkdocs version --- doc/mkdocs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/mkdocs.yml b/doc/mkdocs.yml index b2dc29e5d..2958d93c5 100644 --- a/doc/mkdocs.yml +++ b/doc/mkdocs.yml @@ -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 From 69438bba686a974932d8bcebec8e8443a0eba2f1 Mon Sep 17 00:00:00 2001 From: fredkingham Date: Tue, 14 Jun 2022 13:56:41 +0100 Subject: [PATCH 2/7] Bumps the version to v0.22.1 --- changelog.md | 3 +++ doc/mkdocs.yml | 2 +- opal/_version.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index 3e6e4bdb3..f638b0cd8 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,6 @@ +### 0.22.1 (Minor Release) + + ### 0.22.0 (Major Release) #### Advanced search changes diff --git a/doc/mkdocs.yml b/doc/mkdocs.yml index b2dc29e5d..e09783578 100644 --- a/doc/mkdocs.yml +++ b/doc/mkdocs.yml @@ -121,7 +121,7 @@ dev_addr: 0.0.0.0:8965 include_next_prev: false extra: - version: v0.21.0 + version: v0.22.1 markdown_extensions: - fenced_code diff --git a/opal/_version.py b/opal/_version.py index 6c53606e8..71ced3fb0 100644 --- a/opal/_version.py +++ b/opal/_version.py @@ -1,4 +1,4 @@ """ Declare our current version string """ -__version__ = '0.22.0' +__version__ = '0.22.1' From f0b548dce88d14438161fdf1f0d719976f139813 Mon Sep 17 00:00:00 2001 From: fredkingham Date: Wed, 8 Jun 2022 16:34:14 +0100 Subject: [PATCH 3/7] Remove the hard coded TODO as the line it was referring to were removed in 3ff8e0135a10b41a918f8100204bae9e5f93daf8 --- opal/core/search/static/js/search/controllers/extract.js | 1 - 1 file changed, 1 deletion(-) diff --git a/opal/core/search/static/js/search/controllers/extract.js b/opal/core/search/static/js/search/controllers/extract.js index 13a9462c7..5e5020f89 100644 --- a/opal/core/search/static/js/search/controllers/extract.js +++ b/opal/core/search/static/js/search/controllers/extract.js @@ -88,7 +88,6 @@ angular.module('opal.controllers').controller( $scope.searchableFields = function(columnName){ var column = $scope.findColumn(columnName); - // TODO - don't hard-code this if(column){ return _.map( _.reject( From e4cd145318e16991ca26a1179733bc316af334ad Mon Sep 17 00:00:00 2001 From: fredkingham Date: Wed, 8 Jun 2022 18:02:23 +0100 Subject: [PATCH 4/7] Exclude many to ones from the advanced search --- opal/core/search/static/js/search/controllers/extract.js | 2 +- opal/core/search/static/js/test/extract.controller.test.js | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/opal/core/search/static/js/search/controllers/extract.js b/opal/core/search/static/js/search/controllers/extract.js index 5e5020f89..9ed14176d 100644 --- a/opal/core/search/static/js/search/controllers/extract.js +++ b/opal/core/search/static/js/search/controllers/extract.js @@ -96,7 +96,7 @@ 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(); diff --git a/opal/core/search/static/js/test/extract.controller.test.js b/opal/core/search/static/js/test/extract.controller.test.js index 371138e7b..e3ed37232 100644 --- a/opal/core/search/static/js/test/extract.controller.test.js +++ b/opal/core/search/static/js/test/extract.controller.test.js @@ -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, From 88dc7b6922bf651857ff43ae931068a072e10f29 Mon Sep 17 00:00:00 2001 From: fredkingham Date: Tue, 14 Jun 2022 14:01:31 +0100 Subject: [PATCH 5/7] Updates the change log with the change that many to one relationships are now excluded --- changelog.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index f638b0cd8..bea251c8d 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,9 @@ ### 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) @@ -12,11 +16,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. From 18581ab8d6e1b5880c4330a0a27b9ab0dbf5c79c Mon Sep 17 00:00:00 2001 From: fredkingham Date: Wed, 8 Jun 2022 17:57:40 +0100 Subject: [PATCH 6/7] We were getting errors in the console whenever the extract page loaded as it was looking up the field choices without a field. If we don't have a field, just return an empty array for the choices --- changelog.md | 2 +- opal/core/search/static/js/search/controllers/extract.js | 5 ++++- opal/core/search/static/js/test/extract.controller.test.js | 5 +++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index bea251c8d..a1364a361 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,6 @@ ### 0.22.1 (Minor Release) -#### Exclude many to one relationships from the advanced Search +#### Exclude many to one relationships from the advanced search Many to one fields are no longer visible in the advanced search screen. diff --git a/opal/core/search/static/js/search/controllers/extract.js b/opal/core/search/static/js/search/controllers/extract.js index 9ed14176d..0f4e6b11a 100644 --- a/opal/core/search/static/js/search/controllers/extract.js +++ b/opal/core/search/static/js/search/controllers/extract.js @@ -85,7 +85,6 @@ angular.module('opal.controllers').controller( return criteria; }; - $scope.searchableFields = function(columnName){ var column = $scope.findColumn(columnName); if(column){ @@ -98,6 +97,7 @@ angular.module('opal.controllers').controller( } return c.type == 'token' || c.type == 'list' || c.type == "many_to_o";; }), + function(c){ return c; } ).sort(); } @@ -143,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){ diff --git a/opal/core/search/static/js/test/extract.controller.test.js b/opal/core/search/static/js/test/extract.controller.test.js index e3ed37232..43b844268 100644 --- a/opal/core/search/static/js/test/extract.controller.test.js +++ b/opal/core/search/static/js/test/extract.controller.test.js @@ -381,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(){ From 4175511c07d5df9c9f0a051134ad760e24be8207 Mon Sep 17 00:00:00 2001 From: fredkingham Date: Tue, 14 Jun 2022 14:10:34 +0100 Subject: [PATCH 7/7] Fixes conflicts between the v0.22.1 minor release and the v0.23.0 major release branches --- changelog.md | 3 +++ doc/mkdocs.yml | 2 +- opal/_version.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index a1364a361..9a9399d70 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,6 @@ +### 0.23.0 (Major Release) + + ### 0.22.1 (Minor Release) #### Exclude many to one relationships from the advanced search diff --git a/doc/mkdocs.yml b/doc/mkdocs.yml index e09783578..2958d93c5 100644 --- a/doc/mkdocs.yml +++ b/doc/mkdocs.yml @@ -121,7 +121,7 @@ dev_addr: 0.0.0.0:8965 include_next_prev: false extra: - version: v0.22.1 + version: v0.23.0 markdown_extensions: - fenced_code diff --git a/opal/_version.py b/opal/_version.py index 71ced3fb0..5fe64ae9a 100644 --- a/opal/_version.py +++ b/opal/_version.py @@ -1,4 +1,4 @@ """ Declare our current version string """ -__version__ = '0.22.1' +__version__ = '0.23.0'