From 20fda9aeb90305d929f24419ed933c20b3c0322f Mon Sep 17 00:00:00 2001 From: Simon Bear Date: Thu, 8 Nov 2018 18:22:04 +1100 Subject: [PATCH 01/32] #634 Use updated ALA Map plugin --- grails-app/conf/BuildConfig.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grails-app/conf/BuildConfig.groovy b/grails-app/conf/BuildConfig.groovy index 6efc69f0..5fad7c85 100644 --- a/grails-app/conf/BuildConfig.groovy +++ b/grails-app/conf/BuildConfig.groovy @@ -85,7 +85,7 @@ grails.project.dependency.resolution = { compile ":cache:1.1.8" compile ":cors:1.1.6" compile ":csv:0.3.1" - compile(":ala-map:2.0.4") { + compile(":ala-map:2.1.8-SNAPSHOT") { excludes "resources" } compile(":ala-ws-plugin:1.6.1") { From daed0cf611da1933970b74d2bf506ba3a00dde75 Mon Sep 17 00:00:00 2001 From: temi Date: Fri, 9 Nov 2018 10:39:14 +1100 Subject: [PATCH 02/32] #627 - fixed a bug with ng-ckeditor - event listener wrongly configured. --- grails-app/assets/thirdparty/ckeditor/ng-ckeditor-0.2.1.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/grails-app/assets/thirdparty/ckeditor/ng-ckeditor-0.2.1.js b/grails-app/assets/thirdparty/ckeditor/ng-ckeditor-0.2.1.js index 05e7355b..c57e3662 100644 --- a/grails-app/assets/thirdparty/ckeditor/ng-ckeditor-0.2.1.js +++ b/grails-app/assets/thirdparty/ckeditor/ng-ckeditor-0.2.1.js @@ -140,7 +140,10 @@ onUpdateModelData(true); }); - instance.document.on('keyup', setModelData); + // This fixes a bug in ng-ckeditor that caused #627. + // Previously listener was incorrectly configured. Function setModelData was called on a keystroke + // anywhere on the page. + instance.on('key', setModelData); }); instance.on('customConfigLoaded', function() { configLoaderDef.resolve(); From 5dfd6a0ac31b323a33e42fd554eb5b3a1cc46775 Mon Sep 17 00:00:00 2001 From: Simon Bear Date: Fri, 9 Nov 2018 12:02:12 +1100 Subject: [PATCH 03/32] #634 attempt to fix unit tests --- karma.conf.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/karma.conf.js b/karma.conf.js index 0dd069cb..0d530385 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -45,15 +45,16 @@ module.exports = function (config) { // list of files / patterns to load in the browser files: [ 'node_modules/jasmine-data_driven_tests/src/all.js', - 'https://rawgit.com/AtlasOfLivingAustralia/ala-map-plugin/master/web-app/vendor/jquery-2.1.4/jquery-2.1.4.min.js', - 'https://rawgit.com/AtlasOfLivingAustralia/ala-map-plugin/master/web-app/vendor/leaflet-0.7.7/leaflet.js', - 'https://rawgit.com/AtlasOfLivingAustralia/ala-map-plugin/master/web-app/vendor/Leaflet.Coordinates-0.1.5/Leaflet.Coordinates-0.1.5.min.js', - 'https://rawgit.com/AtlasOfLivingAustralia/ala-map-plugin/master/web-app/vendor/Leaflet.loading-0.1.16/Control.Loading.js', - 'https://rawgit.com/AtlasOfLivingAustralia/ala-map-plugin/master/web-app/vendor/Leaflet.EasyButton-1.2.0/easy-button.js', - 'https://rawgit.com/AtlasOfLivingAustralia/ala-map-plugin/master/web-app/vendor/urijs-1.18.0/URI.js', - 'https://rawgit.com/AtlasOfLivingAustralia/ala-map-plugin/master/web-app/js/layers/SmartWmsLayer.js', - 'https://rawgit.com/AtlasOfLivingAustralia/ala-map-plugin/master/web-app/js/Map.js', - 'https://rawgit.com/AtlasOfLivingAustralia/ala-map-plugin/master/web-app/js/OccurrenceMap.js', + 'https://raw.githubusercontent.com/AtlasOfLivingAustralia/ala-map-plugin/master/web-app/vendor/jquery-2.1.4/jquery-2.1.4.min.js', + 'https://raw.githubusercontent.com/AtlasOfLivingAustralia/ala-map-plugin/master/web-app/vendor/leaflet-0.7.7/leaflet.js', + 'https://raw.githubusercontent.com/AtlasOfLivingAustralia/ala-map-plugin/master/web-app/vendor/Leaflet.Coordinates-0.1.5/Leaflet.Coordinates-0.1.5.min.js', + 'https://raw.githubusercontent.com/AtlasOfLivingAustralia/ala-map-plugin/master/web-app/vendor/Leaflet.loading-0.1.16/Control.Loading.js', + 'https://raw.githubusercontent.com/AtlasOfLivingAustralia/ala-map-plugin/master/web-app/vendor/Leaflet.EasyButton-1.2.0/easy-button.js', + 'https://raw.githubusercontent.com/AtlasOfLivingAustralia/ala-map-plugin/master/web-app/vendor/urijs-1.18.0/URI.js', + 'https://raw.githubusercontent.com/AtlasOfLivingAustralia/ala-map-plugin/master/web-app/js/layers/SmartWmsLayer.js', + 'https://raw.githubusercontent.com/AtlasOfLivingAustralia/ala-map-plugin/master/web-app/js/Map.js', + 'https://raw.githubusercontent.com/AtlasOfLivingAustralia/ala-map-plugin/master/web-app/js/OccurrenceMap.js', + 'https://raw.githubusercontent.com/AtlasOfLivingAustralia/ala-map-plugin/master/web-app/js/OccurrenceMap.js', 'grails-app/assets/thirdparty/modernizr/modernizer.js', 'grails-app/assets/thirdparty/angular/angular-1.3.20.js', 'grails-app/assets/thirdparty/angular/angular-sanitize-1.3.20.js', From 44be59f0f2c5408bdd4cdc71d84b857c76828a24 Mon Sep 17 00:00:00 2001 From: Simon Bear Date: Tue, 13 Nov 2018 15:26:09 +1100 Subject: [PATCH 04/32] Fix karma tests --- karma.conf.js | 1 - 1 file changed, 1 deletion(-) diff --git a/karma.conf.js b/karma.conf.js index 0d530385..7a136006 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -54,7 +54,6 @@ module.exports = function (config) { 'https://raw.githubusercontent.com/AtlasOfLivingAustralia/ala-map-plugin/master/web-app/js/layers/SmartWmsLayer.js', 'https://raw.githubusercontent.com/AtlasOfLivingAustralia/ala-map-plugin/master/web-app/js/Map.js', 'https://raw.githubusercontent.com/AtlasOfLivingAustralia/ala-map-plugin/master/web-app/js/OccurrenceMap.js', - 'https://raw.githubusercontent.com/AtlasOfLivingAustralia/ala-map-plugin/master/web-app/js/OccurrenceMap.js', 'grails-app/assets/thirdparty/modernizr/modernizer.js', 'grails-app/assets/thirdparty/angular/angular-1.3.20.js', 'grails-app/assets/thirdparty/angular/angular-sanitize-1.3.20.js', From aa3084d6ea0ed3fa02fbba72aff9196aebea52d3 Mon Sep 17 00:00:00 2001 From: Simon Bear Date: Wed, 14 Nov 2018 15:47:50 +1100 Subject: [PATCH 05/32] Fix karma unit tests --- karma.conf.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/karma.conf.js b/karma.conf.js index 7a136006..ef042a77 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -45,15 +45,15 @@ module.exports = function (config) { // list of files / patterns to load in the browser files: [ 'node_modules/jasmine-data_driven_tests/src/all.js', - 'https://raw.githubusercontent.com/AtlasOfLivingAustralia/ala-map-plugin/master/web-app/vendor/jquery-2.1.4/jquery-2.1.4.min.js', - 'https://raw.githubusercontent.com/AtlasOfLivingAustralia/ala-map-plugin/master/web-app/vendor/leaflet-0.7.7/leaflet.js', - 'https://raw.githubusercontent.com/AtlasOfLivingAustralia/ala-map-plugin/master/web-app/vendor/Leaflet.Coordinates-0.1.5/Leaflet.Coordinates-0.1.5.min.js', - 'https://raw.githubusercontent.com/AtlasOfLivingAustralia/ala-map-plugin/master/web-app/vendor/Leaflet.loading-0.1.16/Control.Loading.js', - 'https://raw.githubusercontent.com/AtlasOfLivingAustralia/ala-map-plugin/master/web-app/vendor/Leaflet.EasyButton-1.2.0/easy-button.js', - 'https://raw.githubusercontent.com/AtlasOfLivingAustralia/ala-map-plugin/master/web-app/vendor/urijs-1.18.0/URI.js', - 'https://raw.githubusercontent.com/AtlasOfLivingAustralia/ala-map-plugin/master/web-app/js/layers/SmartWmsLayer.js', - 'https://raw.githubusercontent.com/AtlasOfLivingAustralia/ala-map-plugin/master/web-app/js/Map.js', - 'https://raw.githubusercontent.com/AtlasOfLivingAustralia/ala-map-plugin/master/web-app/js/OccurrenceMap.js', + 'https://cdn.jsdelivr.net/gh/AtlasOfLivingAustralia/ala-map-plugin/web-app/vendor/jquery-2.1.4/jquery-2.1.4.min.js', + 'https://cdn.jsdelivr.net/gh/AtlasOfLivingAustralia/ala-map-plugin/web-app/vendor/leaflet-0.7.7/leaflet.js', + 'https://cdn.jsdelivr.net/gh/AtlasOfLivingAustralia/ala-map-plugin/web-app/vendor/Leaflet.Coordinates-0.1.5/Leaflet.Coordinates-0.1.5.min.js', + 'https://cdn.jsdelivr.net/gh/AtlasOfLivingAustralia/ala-map-plugin/web-app/vendor/Leaflet.loading-0.1.16/Control.Loading.js', + 'https://cdn.jsdelivr.net/gh/AtlasOfLivingAustralia/ala-map-plugin/web-app/vendor/Leaflet.EasyButton-1.2.0/easy-button.js', + 'https://cdn.jsdelivr.net/gh/AtlasOfLivingAustralia/ala-map-plugin/web-app/vendor/urijs-1.18.0/URI.js', + 'https://cdn.jsdelivr.net/gh/AtlasOfLivingAustralia/ala-map-plugin/web-app/js/layers/SmartWmsLayer.js', + 'https://cdn.jsdelivr.net/gh/AtlasOfLivingAustralia/ala-map-plugin/web-app/js/Map.js', + 'https://cdn.jsdelivr.net/gh/AtlasOfLivingAustralia/ala-map-plugin/web-app/js/OccurrenceMap.js', 'grails-app/assets/thirdparty/modernizr/modernizer.js', 'grails-app/assets/thirdparty/angular/angular-1.3.20.js', 'grails-app/assets/thirdparty/angular/angular-sanitize-1.3.20.js', @@ -85,6 +85,7 @@ module.exports = function (config) { 'test/js/specs/MockConfigModule.js', 'test/js/specs/**/*.js' ], + crossOriginAttribute: true, // list of files to exclude From e57b41181900df24512bde90fc1b438f2a1526ab Mon Sep 17 00:00:00 2001 From: Simon Bear Date: Wed, 14 Nov 2018 16:59:20 +1100 Subject: [PATCH 06/32] AtlasOfLivingAustralia/profile-hub#636 - Don't crash at the end of a nullable call chain --- grails-app/services/au/org/ala/profile/hub/ExportService.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grails-app/services/au/org/ala/profile/hub/ExportService.groovy b/grails-app/services/au/org/ala/profile/hub/ExportService.groovy index 1b9c5947..899d9aec 100644 --- a/grails-app/services/au/org/ala/profile/hub/ExportService.groovy +++ b/grails-app/services/au/org/ala/profile/hub/ExportService.groovy @@ -522,7 +522,7 @@ class ExportService { } if (nslNameIdentifier) { - def nslNameDetails = nslService.getNameDetails(nslNameIdentifier)?.resp?.name?.primaryInstance[0] ?: null + def nslNameDetails = nslService.getNameDetails(nslNameIdentifier)?.resp?.name?.primaryInstance?.get(0) ?: null String nslProtologue = nslNameDetails?.citationHtml?: null if (nslProtologue && nslNameDetails?.page) { nslProtologue += ": " + nslNameDetails.page From 2f09d101f08dbe5d65cd8ef7db196214bdb8a23c Mon Sep 17 00:00:00 2001 From: Simon Bear Date: Thu, 15 Nov 2018 01:45:53 +1100 Subject: [PATCH 07/32] Bump version number to next SNAPSHOT --- application.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application.properties b/application.properties index ad2bb6b4..7321e819 100644 --- a/application.properties +++ b/application.properties @@ -2,4 +2,4 @@ #Wed Dec 21 11:09:46 AEDT 2016 app.grails.version=2.5.6 app.name=profile-hub -app.version=2.3 +app.version=2.4-SNAPSHOT From 09ff6b2ff8b6255e33da99e4c75ee8631990afb4 Mon Sep 17 00:00:00 2001 From: Rita Chen Date: Thu, 15 Nov 2018 14:41:32 +1100 Subject: [PATCH 08/32] #652, removed deleted term from the replacement candidate list. --- .../profileEditor/directives/vocabularyEditor.js | 15 +++++++++++---- .../templates/removeTermPopup.tpl.htm | 6 +++++- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/grails-app/assets/javascripts/profileEditor/directives/vocabularyEditor.js b/grails-app/assets/javascripts/profileEditor/directives/vocabularyEditor.js index c8190eca..f5df8df2 100644 --- a/grails-app/assets/javascripts/profileEditor/directives/vocabularyEditor.js +++ b/grails-app/assets/javascripts/profileEditor/directives/vocabularyEditor.js @@ -49,7 +49,8 @@ profileEditor.directive('vocabularyEditor', function ($browser) { $scope.removeVocabTerm = function (index, form) { var promise = profileService.findUsagesOfVocabTerm($scope.opusId, $scope.vocabId, $scope.vocabulary.terms[index].termId); promise.then(function (data) { - if (data.usageCount == 0) { + if (data.usageCount == 0 && + $filter('filter')($scope.replacements, {'newTermName':$scope.vocabulary.terms[index].name}).length == 0) { var deletedItemOrder = $scope.vocabulary.terms[index].order; $scope.vocabulary.terms.splice(index, 1); @@ -85,9 +86,15 @@ profileEditor.directive('vocabularyEditor', function ($browser) { return $scope.vocabulary.terms[existingTermIndex]; }, terms: function() { - var terms = angular.copy($scope.vocabulary.terms); - var deletedItemOrder = terms[existingTermIndex].order; - terms.splice(existingTermIndex, 1); + var terms = [];//angular.copy($scope.vocabulary.terms); + var itemToDel = $scope.vocabulary.terms[existingTermIndex]; + var deletedItemOrder = $scope.vocabulary.terms[existingTermIndex].order; + angular.forEach($scope.vocabulary.terms, function(term) { + if ($filter('filter')($scope.replacements, {'existingTermId':term.termId}).length == 0 && + term.termId != itemToDel.termId) { + terms.push(term); + } + }); angular.forEach(terms, function(term) { if (term.order > deletedItemOrder) { diff --git a/grails-app/assets/javascripts/profileEditor/templates/removeTermPopup.tpl.htm b/grails-app/assets/javascripts/profileEditor/templates/removeTermPopup.tpl.htm index 094dfa92..37787056 100644 --- a/grails-app/assets/javascripts/profileEditor/templates/removeTermPopup.tpl.htm +++ b/grails-app/assets/javascripts/profileEditor/templates/removeTermPopup.tpl.htm @@ -4,12 +4,16 @@