From 0209219465e12f9e4bc87d92d16b172a7136ac7a Mon Sep 17 00:00:00 2001 From: Qifeng Date: Tue, 7 Dec 2021 13:19:24 +1100 Subject: [PATCH 01/15] improve (tests) --- src/integration-test/groovy/AddAreaSpec.groovy | 3 ++- src/integration-test/groovy/ToolAooEooSpec.groovy | 1 + src/integration-test/groovy/ToolClassifySpec.groovy | 1 + src/integration-test/groovy/ToolCompareAreaSpec.groovy | 1 + src/integration-test/groovy/ToolDoubleGridingSpec.groovy | 1 + src/integration-test/groovy/ToolGeneratePointsSpec.groovy | 1 + .../groovy/ToolPhylogeneticDiversitySpec.groovy | 1 + src/integration-test/groovy/ToolPointsToGridSpec.groovy | 1 + src/integration-test/groovy/ToolPredictSpec.groovy | 1 + src/integration-test/groovy/ToolReportSpec.groovy | 1 + src/integration-test/groovy/ToolScatterPlotSpec.groovy | 2 ++ src/integration-test/groovy/page/ModalModule.groovy | 2 +- 12 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/integration-test/groovy/AddAreaSpec.groovy b/src/integration-test/groovy/AddAreaSpec.groovy index 317a5329..fa6f5f3a 100644 --- a/src/integration-test/groovy/AddAreaSpec.groovy +++ b/src/integration-test/groovy/AddAreaSpec.groovy @@ -148,6 +148,7 @@ class AddAreaSpec extends GebSpec { addAreaModule.gazAutoList("Ben Lomond").click() and: + waitFor 10, {addAreaModule.isNextBtnEnabled()} addAreaModule.nextBtn.click() then: @@ -233,7 +234,7 @@ class AddAreaSpec extends GebSpec { addAreaModule.wktAreaDataTextarea.value(wkt) then: - waitFor 20, { addAreaModule.nextBtn.displayed } + waitFor 10, {addAreaModule.isNextBtnEnabled()} addAreaModule.nextBtn.click() then: diff --git a/src/integration-test/groovy/ToolAooEooSpec.groovy b/src/integration-test/groovy/ToolAooEooSpec.groovy index ce2bfb58..53d3e1fa 100644 --- a/src/integration-test/groovy/ToolAooEooSpec.groovy +++ b/src/integration-test/groovy/ToolAooEooSpec.groovy @@ -45,6 +45,7 @@ class ToolAooEooSpec extends GebSpec { addAreaModule.gazAutoList("Tasmania").click() and: + waitFor 10, {addAreaModule.isNextBtnEnabled()} addAreaModule.nextBtn.click() then: diff --git a/src/integration-test/groovy/ToolClassifySpec.groovy b/src/integration-test/groovy/ToolClassifySpec.groovy index 2b964f00..3f576795 100644 --- a/src/integration-test/groovy/ToolClassifySpec.groovy +++ b/src/integration-test/groovy/ToolClassifySpec.groovy @@ -45,6 +45,7 @@ class ToolClassifySpec extends GebSpec { addAreaModule.gazAutoList("Tasmania").click() and: + waitFor 10, {addAreaModule.isNextBtnEnabled()} addAreaModule.nextBtn.click() then: diff --git a/src/integration-test/groovy/ToolCompareAreaSpec.groovy b/src/integration-test/groovy/ToolCompareAreaSpec.groovy index efe24421..9e0be438 100644 --- a/src/integration-test/groovy/ToolCompareAreaSpec.groovy +++ b/src/integration-test/groovy/ToolCompareAreaSpec.groovy @@ -46,6 +46,7 @@ class ToolCompareAreaSpec extends GebSpec { addAreaModule.gazAutoList("Ben Lomond").click() and: + waitFor 10, {addAreaModule.isNextBtnEnabled()} addAreaModule.nextBtn.click() then: diff --git a/src/integration-test/groovy/ToolDoubleGridingSpec.groovy b/src/integration-test/groovy/ToolDoubleGridingSpec.groovy index 75f7147c..654602de 100644 --- a/src/integration-test/groovy/ToolDoubleGridingSpec.groovy +++ b/src/integration-test/groovy/ToolDoubleGridingSpec.groovy @@ -44,6 +44,7 @@ class ToolDoubleGridingSpec extends GebSpec { addAreaModule.gazAutoList("Tasmania").click() and: + waitFor 10, {addAreaModule.isNextBtnEnabled()} addAreaModule.nextBtn.click() then: diff --git a/src/integration-test/groovy/ToolGeneratePointsSpec.groovy b/src/integration-test/groovy/ToolGeneratePointsSpec.groovy index 9fb5aa19..2cd82341 100644 --- a/src/integration-test/groovy/ToolGeneratePointsSpec.groovy +++ b/src/integration-test/groovy/ToolGeneratePointsSpec.groovy @@ -46,6 +46,7 @@ class ToolGeneratePointsSpec extends GebSpec { addAreaModule.gazAutoList("Ben Lomond").click() and: + waitFor 10, {addAreaModule.isNextBtnEnabled()} addAreaModule.nextBtn.click() then: diff --git a/src/integration-test/groovy/ToolPhylogeneticDiversitySpec.groovy b/src/integration-test/groovy/ToolPhylogeneticDiversitySpec.groovy index c0879ced..24d037a6 100644 --- a/src/integration-test/groovy/ToolPhylogeneticDiversitySpec.groovy +++ b/src/integration-test/groovy/ToolPhylogeneticDiversitySpec.groovy @@ -45,6 +45,7 @@ class ToolPhylogeneticDiversitySpec extends GebSpec { addAreaModule.gazAutoList("Tasmania").click() and: + waitFor 10, {addAreaModule.isNextBtnEnabled()} addAreaModule.nextBtn.click() then: diff --git a/src/integration-test/groovy/ToolPointsToGridSpec.groovy b/src/integration-test/groovy/ToolPointsToGridSpec.groovy index e864000d..5fa9e247 100644 --- a/src/integration-test/groovy/ToolPointsToGridSpec.groovy +++ b/src/integration-test/groovy/ToolPointsToGridSpec.groovy @@ -44,6 +44,7 @@ class ToolPointsToGridSpec extends GebSpec { addAreaModule.gazAutoList("Tasmania").click() and: + waitFor 10, {addAreaModule.isNextBtnEnabled()} addAreaModule.nextBtn.click() then: diff --git a/src/integration-test/groovy/ToolPredictSpec.groovy b/src/integration-test/groovy/ToolPredictSpec.groovy index e7d6c355..f4a19b4c 100644 --- a/src/integration-test/groovy/ToolPredictSpec.groovy +++ b/src/integration-test/groovy/ToolPredictSpec.groovy @@ -47,6 +47,7 @@ class ToolPredictSpec extends GebSpec { addAreaModule.gazAutoList("Tasmania").click() and: + waitFor 10, {addAreaModule.isNextBtnEnabled()} addAreaModule.nextBtn.click() then: diff --git a/src/integration-test/groovy/ToolReportSpec.groovy b/src/integration-test/groovy/ToolReportSpec.groovy index 3ab57a8c..761f6745 100644 --- a/src/integration-test/groovy/ToolReportSpec.groovy +++ b/src/integration-test/groovy/ToolReportSpec.groovy @@ -67,6 +67,7 @@ class ToolReportSpec extends GebSpec { addAreaModule.gazAutoList("Tasmania").click() and: + waitFor 10, {addAreaModule.isNextBtnEnabled()} addAreaModule.nextBtn.click() then: diff --git a/src/integration-test/groovy/ToolScatterPlotSpec.groovy b/src/integration-test/groovy/ToolScatterPlotSpec.groovy index a5ea3e31..6cfcb3b4 100644 --- a/src/integration-test/groovy/ToolScatterPlotSpec.groovy +++ b/src/integration-test/groovy/ToolScatterPlotSpec.groovy @@ -46,6 +46,7 @@ class ToolScatterPlotSpec extends GebSpec { addAreaModule.gazAutoList("Tasmania").click() and: + waitFor 10, {addAreaModule.isNextBtnEnabled()} addAreaModule.nextBtn.click() then: @@ -122,6 +123,7 @@ class ToolScatterPlotSpec extends GebSpec { addAreaModule.gazAutoList("Tasmania").click() and: + waitFor 10, {addAreaModule.isNextBtnEnabled()} addAreaModule.nextBtn.click() then: diff --git a/src/integration-test/groovy/page/ModalModule.groovy b/src/integration-test/groovy/page/ModalModule.groovy index 1573e996..f9f53199 100644 --- a/src/integration-test/groovy/page/ModalModule.groovy +++ b/src/integration-test/groovy/page/ModalModule.groovy @@ -142,7 +142,7 @@ class ModalModule extends Module { } def isNextBtnEnabled() { - return !nextBtn.is(":disabled") + return !nextBtn.attr('disabled') } //Get cell in CSV report table From b7143cb792734d2362de764a473dcc9a51aa6675 Mon Sep 17 00:00:00 2001 From: Qifeng Date: Wed, 8 Dec 2021 11:15:54 +1100 Subject: [PATCH 02/15] impl (error handling in create species list) --- .../spApp/controller/createSpeciesListCtrl.js | 2 +- .../spApp/service/layersService.js | 2 +- .../javascripts/spApp/service/listsService.js | 4 +- grails-app/assets/javascripts/spApp/spApp.js | 39 ++++++++++--------- .../spatial/portal/PortalController.groovy | 13 ++++--- 5 files changed, 31 insertions(+), 29 deletions(-) diff --git a/grails-app/assets/javascripts/spApp/controller/createSpeciesListCtrl.js b/grails-app/assets/javascripts/spApp/controller/createSpeciesListCtrl.js index 75565c73..094aa5bc 100644 --- a/grails-app/assets/javascripts/spApp/controller/createSpeciesListCtrl.js +++ b/grails-app/assets/javascripts/spApp/controller/createSpeciesListCtrl.js @@ -155,7 +155,7 @@ $scope.addNewSpecies = function () { ListsService.createList($scope.newListName, $scope.newListDescription, $scope.matchedGuids(), $scope.makePrivate, $scope.newListType.id).then(function (resp) { - if (resp.status === 200) { + if (resp.status >= 200 && resp.status < 300) { var json = JSON.parse(resp.data.text); var druid = json.druid; diff --git a/grails-app/assets/javascripts/spApp/service/layersService.js b/grails-app/assets/javascripts/spApp/service/layersService.js index 1d181480..2faa6705 100644 --- a/grails-app/assets/javascripts/spApp/service/layersService.js +++ b/grails-app/assets/javascripts/spApp/service/layersService.js @@ -241,7 +241,7 @@ name: name, description: description, user_id: $SH.userId - }, _httpDescription('createFromWkt')) + }) }, /** * Get object information diff --git a/grails-app/assets/javascripts/spApp/service/listsService.js b/grails-app/assets/javascripts/spApp/service/listsService.js index 9c57826f..11405462 100644 --- a/grails-app/assets/javascripts/spApp/service/listsService.js +++ b/grails-app/assets/javascripts/spApp/service/listsService.js @@ -57,8 +57,8 @@ }; return $http.post($SH.baseUrl + "/portal/postSpeciesList", list, _httpDescription('createList', {withCredentials: true})).then(function (resp) { return resp; - }, function (resp) { - return resp; + }, function (error) { + return error; }); }, items: function (listId, params) { diff --git a/grails-app/assets/javascripts/spApp/spApp.js b/grails-app/assets/javascripts/spApp/spApp.js index 245c0712..14a337a8 100644 --- a/grails-app/assets/javascripts/spApp/spApp.js +++ b/grails-app/assets/javascripts/spApp/spApp.js @@ -104,27 +104,28 @@ spApp.config(['$httpProvider', function ($httpProvider) { var $http = angular.element(document.querySelector('sp-app')).injector().get('$http'); rejection.config.retried = true; return $http(rejection.config); - } - - var httpService = angular.element(document.querySelector('sp-app')).injector().get('HttpService'); - if (httpService) httpService.pop(rejection, 'responseError'); - - if ( rejection.status == 403 || rejection.status == 401) { - bootbox.alert("Authentication failed or login session expired, Please login again!") - rejection.handled = true; - } else if (rejection.status == -1) { - // urls not accessible are ignored. - // Mainly caused by network/connection, or CORS - console.log("Cannot connect to: " + rejection.config.url +" due to network/connection problems, for example: CORS") - } else if (rejection.status === 0) { - if (window.isInWrapper) { - //Logout if in an app; - window.location.href = 'ios:logout'; - } else { - window.location.reload(); + } else { + var httpService = angular.element(document.querySelector('sp-app')).injector().get('HttpService'); + if (httpService) httpService.pop(rejection, 'responseError'); + + if ( rejection.status == 403 || rejection.status == 401) { + bootbox.alert("Authentication failed or login session expired, Please login again!") + rejection.handled = true; + } else if (rejection.status == -1) { + // urls not accessible are ignored. + // Mainly caused by network/connection, or CORS + console.log("Cannot connect to: " + rejection.config.url +" due to network/connection problems, for example: CORS") + } else if (rejection.status === 0) { + if (window.isInWrapper) { + //Logout if in an app; + window.location.href = 'ios:logout'; + } else { + window.location.reload(); + } } + return $q.reject(rejection); } - return $q.reject(rejection); + } }; }); diff --git a/grails-app/controllers/au/org/ala/spatial/portal/PortalController.groovy b/grails-app/controllers/au/org/ala/spatial/portal/PortalController.groovy index 40b5f487..50f2eebb 100644 --- a/grails-app/controllers/au/org/ala/spatial/portal/PortalController.groovy +++ b/grails-app/controllers/au/org/ala/spatial/portal/PortalController.groovy @@ -322,7 +322,7 @@ class PortalController { if (!userId) { notAuthorised() } else { - Map headers = [apiKey: grailsApplication.config.api_key] + Map headers = [apiKey: grailsApplication.config.api_key, Accept: 'application/json'] def json = request.JSON as Map def url = "${grailsApplication.config.layersService.url}/shape/upload/wkt" def r = hubWebService.urlResponse(HttpPost.METHOD_NAME, url, null, headers, @@ -453,13 +453,14 @@ class PortalController { if (r == null) { def status = response.setStatus(HttpURLConnection.HTTP_INTERNAL_ERROR) r = [status: status, error: 'Unknown error when creating list'] - } else if (r.error) { - response.setStatus((int) r.statusCode) - } else { - response.setStatus(HttpURLConnection.HTTP_OK) } - render r as JSON + def status = r.statusCode + if (r.statusCode < 200 || r.statusCode > 300) { + r = [error: r.text ] + } + + render status: status, r as JSON } } From 61ca0817296f34ca51845a269983396374a108c1 Mon Sep 17 00:00:00 2001 From: Qifeng Date: Tue, 4 Jan 2022 08:53:55 +1100 Subject: [PATCH 03/15] Fixing alaAdmin plugin --- grails-app/conf/application.yml | 6 +++--- src/integration-test/groovy/AddSpeciesSpec.groovy | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/grails-app/conf/application.yml b/grails-app/conf/application.yml index 3cfd8379..90de3099 100644 --- a/grails-app/conf/application.yml +++ b/grails-app/conf/application.yml @@ -127,9 +127,9 @@ endpoints: security: cas: casServerName: 'https://auth.ala.org.au' - uriFilterPattern: '/alaAdmin,/alaAdmin.*' - uriExclusionFilterPattern: '/portal/q.*,/portal/messages.*,/portal/sessionCache.*,/static.*,/assets.*' - authenticateOnlyIfLoggedInPattern: '/portal.*,/,/portal/config.*,/portal/i18n.*,/hub/[a-zA-Z0-9]+' + uriFilterPattern: ['/alaAdmin','/alaAdmin/*'] + uriExclusionFilterPattern: ['/portal/q/*','/portal/messages/*','/portal/sessionCache/*','/static/*','/assets/*'] + authenticateOnlyIfLoggedInPattern: ['/portal/*','/','/portal/config/*','/portal/i18n/*','/hub/[a-zA-Z0-9]+'] loginUrl: 'https://auth.ala.org.au/cas/login' logoutUrl: 'https://auth.ala.org.au/cas/logout' gateway: false diff --git a/src/integration-test/groovy/AddSpeciesSpec.groovy b/src/integration-test/groovy/AddSpeciesSpec.groovy index e29ab5a5..a3112c9e 100644 --- a/src/integration-test/groovy/AddSpeciesSpec.groovy +++ b/src/integration-test/groovy/AddSpeciesSpec.groovy @@ -86,7 +86,7 @@ class AddSpeciesSpec extends GebSpec { addSpeciesModule.importSpeciesListRadioBtn.click() then: - waitFor 10, {addSpeciesModule.speciesListForm.displayed} + waitFor 15, {addSpeciesModule.speciesListForm.displayed} when: addSpeciesModule.speciesListInput.value('Eucalyptus gunnii, red kangaroo') @@ -97,6 +97,7 @@ class AddSpeciesSpec extends GebSpec { then: waitFor 10, { addSpeciesModule.speciesListTable.displayed } + Thread.sleep(pause) addSpeciesModule.findSpeciesInTable("Eucalyptus gunnii",1).displayed addSpeciesModule.findSpeciesInTable("Osphranter rufus",1).displayed From a847b092f6286b8eeef38e8199c63a9fbc0a3520 Mon Sep 17 00:00:00 2001 From: Qifeng Date: Tue, 4 Jan 2022 09:38:07 +1100 Subject: [PATCH 04/15] fixed maven war publish --- build.gradle | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index 39a5176f..ec338aca 100644 --- a/build.gradle +++ b/build.gradle @@ -208,9 +208,9 @@ publishing { } } } - publications { - mavenJar(MavenPublication) { + publications { + MavenPublication(MavenPublication) { pom.withXml { def pomNode = asNode() pomNode.dependencyManagement.replaceNode {} @@ -224,7 +224,7 @@ publishing { it.replaceNode {} } } - artifact bootJar + artifact bootWar } } } From 413f5e9ec6ff0d2e309f83d9bfbe11948fdbe9de Mon Sep 17 00:00:00 2001 From: Qifeng Date: Tue, 4 Jan 2022 09:46:56 +1100 Subject: [PATCH 05/15] add gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 23f94237..7ac277b0 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ out/ /node_modules/ /grails-app/assets/node_modules/ /grails-app/assets/node_modules/ +/package-lock.json From 7c8219650ddac6704e63ec7d36571123d25614e2 Mon Sep 17 00:00:00 2001 From: Qifeng Date: Tue, 4 Jan 2022 12:26:09 +1100 Subject: [PATCH 06/15] Fix alaAdmin config --- build.gradle | 2 +- grails-app/conf/application.yml | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index ec338aca..ebda6933 100644 --- a/build.gradle +++ b/build.gradle @@ -11,7 +11,7 @@ buildscript { } } -version "1.0.1-SNAPSHOT" +version "1.0.2-SNAPSHOT" group "au.org.ala" apply plugin:"eclipse" diff --git a/grails-app/conf/application.yml b/grails-app/conf/application.yml index 90de3099..41f84215 100644 --- a/grails-app/conf/application.yml +++ b/grails-app/conf/application.yml @@ -127,16 +127,14 @@ endpoints: security: cas: casServerName: 'https://auth.ala.org.au' - uriFilterPattern: ['/alaAdmin','/alaAdmin/*'] + uriFilterPattern: ['/alaAdmin/?.*'] uriExclusionFilterPattern: ['/portal/q/*','/portal/messages/*','/portal/sessionCache/*','/static/*','/assets/*'] authenticateOnlyIfLoggedInPattern: ['/portal/*','/','/portal/config/*','/portal/i18n/*','/hub/[a-zA-Z0-9]+'] loginUrl: 'https://auth.ala.org.au/cas/login' logoutUrl: 'https://auth.ala.org.au/cas/logout' - gateway: false casServerUrlPrefix: 'https://auth.ala.org.au/cas' bypass: false # set to true for non-ALA deployment disableCAS: false - roleAttribute: authority ignoreCase: true authCookieName: ALA-Auth From 59a1e63b128a4ce6a72aa7015e2b77bd944fd027 Mon Sep 17 00:00:00 2001 From: Qifeng Date: Fri, 18 Feb 2022 12:12:54 +1100 Subject: [PATCH 07/15] #433 fix(missing lang properties) --- grails-app/conf/application.yml | 2 ++ .../au/org/ala/spatial/portal/PortalController.groovy | 6 +++++- .../org/ala/spatial/portal/PropertiesService.groovy | 11 +++++++++++ grails-app/views/portal/index.gsp | 2 +- 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/grails-app/conf/application.yml b/grails-app/conf/application.yml index 41f84215..1109c246 100644 --- a/grails-app/conf/application.yml +++ b/grails-app/conf/application.yml @@ -22,6 +22,8 @@ grails: upload: maxFileSize: 10000000 maxRequestSize: 10000000 +i18n: + region: 'default' layersService: url: 'https://spatial.ala.org.au/ws' diff --git a/grails-app/controllers/au/org/ala/spatial/portal/PortalController.groovy b/grails-app/controllers/au/org/ala/spatial/portal/PortalController.groovy index 50f2eebb..39a46316 100644 --- a/grails-app/controllers/au/org/ala/spatial/portal/PortalController.groovy +++ b/grails-app/controllers/au/org/ala/spatial/portal/PortalController.groovy @@ -151,7 +151,11 @@ class PortalController { config.spApp.each { k, v -> spApp.put(k, v.class.newInstance(params.get(k, v))) } - config.spApp = spApp + if (params.get("lang")) { + config.i18n?.currentRegion = params.get("lang") + } else { + config.i18n?.currentRegion = config.i18n?.region + } render(view: 'index', model: [config : config, diff --git a/grails-app/services/au/org/ala/spatial/portal/PropertiesService.groovy b/grails-app/services/au/org/ala/spatial/portal/PropertiesService.groovy index 45cf8b88..fbacf680 100644 --- a/grails-app/services/au/org/ala/spatial/portal/PropertiesService.groovy +++ b/grails-app/services/au/org/ala/spatial/portal/PropertiesService.groovy @@ -16,6 +16,7 @@ package au.org.ala.spatial.portal import org.apache.commons.io.FileUtils +import org.apache.logging.log4j.util.Strings /** * Helper class for invoking other ALA web services. @@ -29,6 +30,10 @@ class PropertiesService { def defaultFile = "${name}.properties"; def properties = new Properties() + //Load default English properties + def defaultProperties = new Properties() + defaultProperties.load(new StringReader(PortalController.classLoader.getResourceAsStream("messages.properties")?.text)) + def text = PortalController.classLoader.getResourceAsStream("$defaultFile")?.text if (text) { properties.load(new StringReader(text)) @@ -54,6 +59,12 @@ class PropertiesService { if (file.exists()) { properties.load(new FileReader(file)) } + //Use default English properties if the required lang is not available + defaultProperties.each{ + if (!properties.getProperty(it.key)){ + properties.setProperty(it.key, it.value) + } + } if (properties.size() == 0 && type != 'messages') { get('messages') diff --git a/grails-app/views/portal/index.gsp b/grails-app/views/portal/index.gsp index 006b2276..c4d05547 100644 --- a/grails-app/views/portal/index.gsp +++ b/grails-app/views/portal/index.gsp @@ -144,7 +144,7 @@ , '${config.doiService.url}/**' ], - i18n: '${config.i18n?.region?:"default"}', + i18n: '${config.i18n?.currentRegion?:"default"}', editable: ${params.edit?:'false'}, wmsIntersect: ${config.wms.intersect}, projections: ${(config.projections as grails.converters.JSON).toString().encodeAsRaw()}, From 1dfd427af43ec7af4eff4d558434c47f84cb010a Mon Sep 17 00:00:00 2001 From: Qifeng Date: Mon, 21 Feb 2022 12:33:40 +1100 Subject: [PATCH 08/15] #433 fix(support case-insensitive when select lang) --- grails-app/assets/stylesheets/application.css | 1 + grails-app/assets/stylesheets/spatial-hub.css | 6 ++++++ .../au/org/ala/spatial/portal/PropertiesService.groovy | 2 +- grails-app/views/layouts/portal.gsp | 9 ++++++++- 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/grails-app/assets/stylesheets/application.css b/grails-app/assets/stylesheets/application.css index 9772b6dc..8e1eef82 100644 --- a/grails-app/assets/stylesheets/application.css +++ b/grails-app/assets/stylesheets/application.css @@ -21,4 +21,5 @@ *= require commonui-bs3-2019/css/ala-styles.css *= require spatial-hub.css *= require commonui-bs3-2019.css +*= require flag-icons-master/css/flag-icon.css */ diff --git a/grails-app/assets/stylesheets/spatial-hub.css b/grails-app/assets/stylesheets/spatial-hub.css index 8671aa4c..57087f9c 100644 --- a/grails-app/assets/stylesheets/spatial-hub.css +++ b/grails-app/assets/stylesheets/spatial-hub.css @@ -1116,3 +1116,9 @@ ul.errors { padding-top: 20px; font-style: italic; } + +#lang { + color: #FFFFFF; + background-color: #000000; + border-width: 0; +} diff --git a/grails-app/services/au/org/ala/spatial/portal/PropertiesService.groovy b/grails-app/services/au/org/ala/spatial/portal/PropertiesService.groovy index fbacf680..ac482f31 100644 --- a/grails-app/services/au/org/ala/spatial/portal/PropertiesService.groovy +++ b/grails-app/services/au/org/ala/spatial/portal/PropertiesService.groovy @@ -26,7 +26,7 @@ class PropertiesService { def grailsApplication def get(type) { - def name = "messages" + (type == "default" ? "" : "_" + type) + def name = "messages" + (type == "default" ? "" : "_" + type.toLowerCase()) def defaultFile = "${name}.properties"; def properties = new Properties() diff --git a/grails-app/views/layouts/portal.gsp b/grails-app/views/layouts/portal.gsp index c063e284..8ee83a02 100644 --- a/grails-app/views/layouts/portal.gsp +++ b/grails-app/views/layouts/portal.gsp @@ -118,6 +118,10 @@
+ @@ -311,6 +315,7 @@ + - diff --git a/grails-app/views/portal/index.gsp b/grails-app/views/portal/index.gsp index c4d05547..b6dc6ae8 100644 --- a/grails-app/views/portal/index.gsp +++ b/grails-app/views/portal/index.gsp @@ -74,6 +74,10 @@ baseLayers: ${(config.startup.baselayers as grails.converters.JSON).toString().encodeAsRaw()}, defaultBaseLayer: '${config.startup.baselayer.default}', + + i18n: '${config.i18n?.currentRegion}', + + flickrUrl: '${config.flickr.url}', flickrLicensesData: ${(config.flickr.licensesData as grails.converters.JSON).toString().encodeAsRaw()}, @@ -94,6 +98,8 @@ presetWMSServers: ${(config.presetWMSServers as grails.converters.JSON).toString().encodeAsRaw()}, getMapExamples: ${(config.getMapExamples as grails.converters.JSON).toString().encodeAsRaw()}, + + doiServiceUrl: '${config.doiService.url}', @@ -144,7 +150,7 @@ , '${config.doiService.url}/**' ], - i18n: '${config.i18n?.currentRegion?:"default"}', + editable: ${params.edit?:'false'}, wmsIntersect: ${config.wms.intersect}, projections: ${(config.projections as grails.converters.JSON).toString().encodeAsRaw()}, @@ -212,6 +218,17 @@ , maxUploadSize: ${config.grails.controllers.upload.maxFileSize} }; + if (!$SH.i18n) { + if (( navigator.language || navigator.browserLanguage).startsWith('en')) { + $SH.i18n = 'default'; + } else if ((navigator.language || navigator.browserLanguage).startsWith('de')) { + $SH.i18n = 'de'; + } else { + $SH.i18n = navigator.language || navigator.browserLanguage; + } + } + + BIE_VARS = { autocompleteUrl: '${config.autocompleteUrl}' }; From 4c56dad5a466254ec16db5dc76336f57810d53d1 Mon Sep 17 00:00:00 2001 From: Qifeng Date: Mon, 28 Feb 2022 11:23:45 +1100 Subject: [PATCH 10/15] Bump to 1.0.4 fix(add pdf libs) --- src/integration-test/groovy/ToolTabulateSpec.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/integration-test/groovy/ToolTabulateSpec.groovy b/src/integration-test/groovy/ToolTabulateSpec.groovy index a5d66097..25a0d21e 100644 --- a/src/integration-test/groovy/ToolTabulateSpec.groovy +++ b/src/integration-test/groovy/ToolTabulateSpec.groovy @@ -62,7 +62,7 @@ class ToolTabulateSpec extends GebSpec { modalModule.getSizeOfCSVTable() > 2 modalModule.getCellByName("layer",1) == "Koppen Climate Classification (Major Classes)" - Float.parseFloat(modalModule.getCellByName("Temperate",2)) >= 1600 + Float.parseFloat(modalModule.getCellByName("Temperate",2)) >= 1500 Thread.sleep(pause) } From 0b38131f1f7fb946fdd5c68e6728cf8b4e6e5bab Mon Sep 17 00:00:00 2001 From: Qifeng Date: Thu, 3 Mar 2022 13:38:33 +1100 Subject: [PATCH 11/15] #433 fix(incorrect i18n number) --- .../assets/javascripts/spApp/service/toolExportSampleService.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grails-app/assets/javascripts/spApp/service/toolExportSampleService.js b/grails-app/assets/javascripts/spApp/service/toolExportSampleService.js index 9ade4f8e..4e702026 100644 --- a/grails-app/assets/javascripts/spApp/service/toolExportSampleService.js +++ b/grails-app/assets/javascripts/spApp/service/toolExportSampleService.js @@ -23,7 +23,7 @@ "input": [ { "name": "area", - "description": $i18n(382,"Select area."), + "description": $i18n(420,"Select area."), "type": "area", "constraints": { "min": 1, From 4417478793d2de64b39ea6d1ff1acce64460721d Mon Sep 17 00:00:00 2001 From: Qifeng Date: Wed, 9 Mar 2022 15:47:19 +1100 Subject: [PATCH 12/15] #436 impl(query on authoritative species list ) --- .../javascripts/spApp/directive/listsList.js | 27 ++++++++++-- .../spApp/templates/listsList.tpl.htm | 6 +-- .../groovy/AddSpeciesSpec.groovy | 41 +++++++++++++++++++ .../groovy/page/AddSpeciesModule.groovy | 19 +++++++++ 4 files changed, 87 insertions(+), 6 deletions(-) diff --git a/grails-app/assets/javascripts/spApp/directive/listsList.js b/grails-app/assets/javascripts/spApp/directive/listsList.js index 2c5b3e8d..daf3a30d 100644 --- a/grails-app/assets/javascripts/spApp/directive/listsList.js +++ b/grails-app/assets/javascripts/spApp/directive/listsList.js @@ -32,6 +32,7 @@ lastUpdated: data[i].lastUpdated, itemCount: data[i].itemCount, fullName: data[i].fullName, + isAuthoritative:data[i].isAuthoritative, selected: false }) } @@ -79,13 +80,33 @@ found.selected = true; scope.selection = found; - ListsService.getItemsQ(found.dataResourceUid).then(function (data) { + //If the list is authoritative, Biocache builds index against species_list_uid (over night) + //We should use q=species_list_uid:drxxxx + if (found.isAuthoritative) { + scope._custom()({ - q: [data], + q: ["species_list_uid:" + found.dataResourceUid], name: found.listName, species_list: found.dataResourceUid }) - }) + } else { + //q=qid:xxxxxxxxxx + ListsService.getItemsQ(found.dataResourceUid).then(function (data) { + //example: (lsid:xxxx OR lsid:xxxx) + var items = data.split(" OR "); + var query = data; + var limit = 200; + if (items.length > limit ) { + alert("Biocache only returns the occurrences of the first 200 names in non-authoritative list."); + query = items.slice(0,limit).join(" OR ") +")"; + } + scope._custom()({ + q: [query], + name: found.listName, + species_list: found.dataResourceUid + }) + }) + } } }; diff --git a/grails-app/assets/javascripts/spApp/templates/listsList.tpl.htm b/grails-app/assets/javascripts/spApp/templates/listsList.tpl.htm index fed68db5..08213a22 100644 --- a/grails-app/assets/javascripts/spApp/templates/listsList.tpl.htm +++ b/grails-app/assets/javascripts/spApp/templates/listsList.tpl.htm @@ -1,13 +1,13 @@
- +
-
+ ng-model="searchLists" name="searchInSpeciesList">
@@ -47,7 +47,7 @@
{{ item.listName }} {{ item.lastUpdated | date: short}} diff --git a/src/integration-test/groovy/AddSpeciesSpec.groovy b/src/integration-test/groovy/AddSpeciesSpec.groovy index a3112c9e..fe3edf37 100644 --- a/src/integration-test/groovy/AddSpeciesSpec.groovy +++ b/src/integration-test/groovy/AddSpeciesSpec.groovy @@ -130,4 +130,45 @@ class AddSpeciesSpec extends GebSpec { waitFor 10, {legendModule.title == "my test species (Australia)"} Thread.sleep(pause) } + + def "Add authoritative speciesList to Australia"() { + when: + menuModule.clickMenu("Add to map ") //NOTICE: space + menuModule.clickMenuitem("Species") + + then: + waitFor 20, { addSpeciesModule.title == "Add a species layer to the map"} + + and: + addSpeciesModule.chooseListInputOption.click() + + then: + waitFor 15, {addSpeciesModule.searchInSpeciesListInput.displayed} + + when: + addSpeciesModule.searchInSpeciesListInput.value('GRIIS') + + then: + waitFor 10, { addSpeciesModule.speciesListTable.displayed } + Thread.sleep(pause) + addSpeciesModule.findSpeciesInTable("GRIIS - Global Register of Introduced and Invasive Species - Australia",1).displayed + assert addSpeciesModule.isAuthoritative("GRIIS - Global Register of Introduced and Invasive Species - Australia",1) == true + + and: + addSpeciesModule.selectSpeciesInTable("GRIIS - Global Register of Introduced and Invasive Species - Australia", 0) + + when: + interact { + modalModule.moveToStep(3) + modalModule.selectArea("Australia") + } + + and: + addSpeciesModule.nextBtn.click() + + then: + waitFor 30, { layerListModule.getLayer("GRIIS - Global Register of Introduced and Invasive Species - Australia (Australia)").displayed } + waitFor 100, {legendModule.title == "GRIIS - Global Register of Introduced and Invasive Species - Australia (Australia)"} + Thread.sleep(pause*3) + } } \ No newline at end of file diff --git a/src/integration-test/groovy/page/AddSpeciesModule.groovy b/src/integration-test/groovy/page/AddSpeciesModule.groovy index cdd7db81..87ae0d3a 100644 --- a/src/integration-test/groovy/page/AddSpeciesModule.groovy +++ b/src/integration-test/groovy/page/AddSpeciesModule.groovy @@ -10,6 +10,9 @@ class AddSpeciesModule extends ModalModule { parseSpeciesListBtn(required:false){ $('button[name=parseSpeciesList]') } speciesListTable(required:false){ $('table[name=speciesList]') } newListNameInput(required:false){ $('input[name=newListName]') } + + chooseListInputOption(required:false){ $('input[value="speciesList"]') } + searchInSpeciesListInput(required:false){ $('input[name="searchInSpeciesList"]') } } /** @@ -22,4 +25,20 @@ class AddSpeciesModule extends ModalModule { def rols = speciesListTable.find("tr td", text: name).parent() return rols.find("td")[col] } + + def isAuthoritative(String name, int col) { + def rols = speciesListTable.find("tr td", text: name).parent() + return rols.find("td")[col].has("span[title='Authoritative list']").size() == 1 + } + + /** + * Select/deselect the species. + * @param name + * @param col of checkbox + * @return + */ + def selectSpeciesInTable(String name, int col) { + def rols = speciesListTable.find("tr td", text: name).parent() + return rols.find("td")[col].click() + } } From ae08f7f59d7fb041864e04e15df0d9f9284311a7 Mon Sep 17 00:00:00 2001 From: Qifeng Date: Thu, 10 Mar 2022 10:17:34 +1100 Subject: [PATCH 13/15] #436 refactor(reword warning info) --- grails-app/assets/javascripts/spApp/directive/listsList.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grails-app/assets/javascripts/spApp/directive/listsList.js b/grails-app/assets/javascripts/spApp/directive/listsList.js index daf3a30d..6f6a83ea 100644 --- a/grails-app/assets/javascripts/spApp/directive/listsList.js +++ b/grails-app/assets/javascripts/spApp/directive/listsList.js @@ -97,7 +97,7 @@ var query = data; var limit = 200; if (items.length > limit ) { - alert("Biocache only returns the occurrences of the first 200 names in non-authoritative list."); + alert("Note: only the first 200 names will be used when when adding species to the map (for user-uploaded checklists)"); query = items.slice(0,limit).join(" OR ") +")"; } scope._custom()({ From bb79fad0507c5d6f90b3895d7ed291a8523320f3 Mon Sep 17 00:00:00 2001 From: Qifeng Date: Fri, 1 Apr 2022 12:52:46 +1100 Subject: [PATCH 14/15] #427 fix(highlight dropdown list before click) --- README.md | 1 + grails-app/conf/application.yml | 2 -- src/integration-test/groovy/AddAreaSpec.groovy | 8 ++++++++ src/integration-test/groovy/ToolAooEooSpec.groovy | 8 ++++++++ .../groovy/ToolClassifySpec.groovy | 7 +++++++ .../groovy/ToolCompareAreaSpec.groovy | 7 +++++++ .../groovy/ToolComparePointsSpec.groovy | 2 +- .../groovy/ToolDoubleGridingSpec.groovy | 6 ++++++ .../groovy/ToolGeneratePointsSpec.groovy | 7 +++++++ .../groovy/ToolPhylogeneticDiversitySpec.groovy | 7 +++++++ .../groovy/ToolPointsToGridSpec.groovy | 7 +++++++ src/integration-test/groovy/ToolPredictSpec.groovy | 8 ++++++++ src/integration-test/groovy/ToolReportSpec.groovy | 6 ++++++ .../groovy/ToolScatterPlotSpec.groovy | 14 +++++++++++++- 14 files changed, 86 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0d2640fa..fe3b457f 100644 --- a/README.md +++ b/README.md @@ -254,6 +254,7 @@ Layers required to be imported to Spatial Service: Temperature - annual mean (Bio01) GEOMACS - geometric mean ASGS Australian States and Territories + IBRA 7 Subregions Williams 2030 best 5 - for predict and classify diff --git a/grails-app/conf/application.yml b/grails-app/conf/application.yml index 1109c246..0a4f8941 100644 --- a/grails-app/conf/application.yml +++ b/grails-app/conf/application.yml @@ -178,8 +178,6 @@ skin: orgNameLong: 'Atlas of Living Australia' favicon: 'https://www.ala.org.au/app/uploads/2019/01/cropped-favicon-32x32.png' -layersService: - url: 'https://spatial.ala.org.au/ws/' lists: url: 'https://lists.ala.org.au' diff --git a/src/integration-test/groovy/AddAreaSpec.groovy b/src/integration-test/groovy/AddAreaSpec.groovy index fa6f5f3a..35ccd1e6 100644 --- a/src/integration-test/groovy/AddAreaSpec.groovy +++ b/src/integration-test/groovy/AddAreaSpec.groovy @@ -145,6 +145,14 @@ class AddAreaSpec extends GebSpec { addAreaModule.gazAutoListCheckbox("IBRA 7 Subregions").click() waitFor 10, {addAreaModule.gazAutoList("Ben Lomond").displayed} + + when: + //Avoid possibility of 'not clickable' + interact { + moveToElement(addAreaModule.gazAutoList("Ben Lomond")) + } + + then: addAreaModule.gazAutoList("Ben Lomond").click() and: diff --git a/src/integration-test/groovy/ToolAooEooSpec.groovy b/src/integration-test/groovy/ToolAooEooSpec.groovy index 53d3e1fa..9e3f0c64 100644 --- a/src/integration-test/groovy/ToolAooEooSpec.groovy +++ b/src/integration-test/groovy/ToolAooEooSpec.groovy @@ -41,7 +41,15 @@ class ToolAooEooSpec extends GebSpec { waitFor 10, {addAreaModule.gazAutoListCheckbox("ASGS").displayed} addAreaModule.gazAutoListCheckbox("ASGS").click() + then: waitFor 10, {addAreaModule.gazAutoList("Tasmania").displayed} + + when: + interact { + moveToElement(addAreaModule.gazAutoList("Tasmania")) + } + + then: addAreaModule.gazAutoList("Tasmania").click() and: diff --git a/src/integration-test/groovy/ToolClassifySpec.groovy b/src/integration-test/groovy/ToolClassifySpec.groovy index 3f576795..a2ae1fd1 100644 --- a/src/integration-test/groovy/ToolClassifySpec.groovy +++ b/src/integration-test/groovy/ToolClassifySpec.groovy @@ -41,7 +41,14 @@ class ToolClassifySpec extends GebSpec { then: waitFor 10, {addAreaModule.gazAutoListCheckbox("ASGS").displayed} addAreaModule.gazAutoListCheckbox("ASGS").click() + waitFor 10, {addAreaModule.gazAutoList("Tasmania").displayed} + + when: + interact { + moveToElement(addAreaModule.gazAutoList("Tasmania")) + } + then: addAreaModule.gazAutoList("Tasmania").click() and: diff --git a/src/integration-test/groovy/ToolCompareAreaSpec.groovy b/src/integration-test/groovy/ToolCompareAreaSpec.groovy index 9e0be438..90512f64 100644 --- a/src/integration-test/groovy/ToolCompareAreaSpec.groovy +++ b/src/integration-test/groovy/ToolCompareAreaSpec.groovy @@ -43,8 +43,15 @@ class ToolCompareAreaSpec extends GebSpec { waitFor 10, {addAreaModule.gazAutoListCheckbox("IBRA 7 Subregions").displayed} addAreaModule.gazAutoListCheckbox("IBRA 7 Subregions").click() waitFor 10, {addAreaModule.gazAutoList("Ben Lomond").displayed} + + when: + interact { + moveToElement(addAreaModule.gazAutoList("Ben Lomond")) + } + then: addAreaModule.gazAutoList("Ben Lomond").click() + and: waitFor 10, {addAreaModule.isNextBtnEnabled()} addAreaModule.nextBtn.click() diff --git a/src/integration-test/groovy/ToolComparePointsSpec.groovy b/src/integration-test/groovy/ToolComparePointsSpec.groovy index 9ed6950f..2c02bf28 100644 --- a/src/integration-test/groovy/ToolComparePointsSpec.groovy +++ b/src/integration-test/groovy/ToolComparePointsSpec.groovy @@ -39,7 +39,7 @@ class ToolComparePointsSpec extends GebSpec { toolComparePointsModule.compare() then: - waitFor 20, {toolComparePointsModule.comparisonResult.displayed} + waitFor 120, {toolComparePointsModule.comparisonResult.displayed} // toolComparePointsModule.getComparisonResult(5,0) == "ASGS Australian States and Territories" Thread.sleep(pause) diff --git a/src/integration-test/groovy/ToolDoubleGridingSpec.groovy b/src/integration-test/groovy/ToolDoubleGridingSpec.groovy index 654602de..be003bd7 100644 --- a/src/integration-test/groovy/ToolDoubleGridingSpec.groovy +++ b/src/integration-test/groovy/ToolDoubleGridingSpec.groovy @@ -41,6 +41,12 @@ class ToolDoubleGridingSpec extends GebSpec { waitFor 10, {addAreaModule.gazAutoListCheckbox("ASGS").displayed} addAreaModule.gazAutoListCheckbox("ASGS").click() waitFor 10, {addAreaModule.gazAutoList("Tasmania").displayed} + when: + //Avoid possibility of 'not clickable' + interact { + moveToElement(addAreaModule.gazAutoList("Tasmania")) + } + then: addAreaModule.gazAutoList("Tasmania").click() and: diff --git a/src/integration-test/groovy/ToolGeneratePointsSpec.groovy b/src/integration-test/groovy/ToolGeneratePointsSpec.groovy index 2cd82341..da2a729d 100644 --- a/src/integration-test/groovy/ToolGeneratePointsSpec.groovy +++ b/src/integration-test/groovy/ToolGeneratePointsSpec.groovy @@ -43,6 +43,13 @@ class ToolGeneratePointsSpec extends GebSpec { waitFor 10, {addAreaModule.gazAutoListCheckbox("IBRA 7 Subregions").displayed} addAreaModule.gazAutoListCheckbox("IBRA 7 Subregions").click() waitFor 10, {addAreaModule.gazAutoList("Ben Lomond").displayed} + + when: + interact { + moveToElement(addAreaModule.gazAutoList("Ben Lomond")) + } + + then: addAreaModule.gazAutoList("Ben Lomond").click() and: diff --git a/src/integration-test/groovy/ToolPhylogeneticDiversitySpec.groovy b/src/integration-test/groovy/ToolPhylogeneticDiversitySpec.groovy index 24d037a6..72602877 100644 --- a/src/integration-test/groovy/ToolPhylogeneticDiversitySpec.groovy +++ b/src/integration-test/groovy/ToolPhylogeneticDiversitySpec.groovy @@ -42,6 +42,13 @@ class ToolPhylogeneticDiversitySpec extends GebSpec { waitFor 10, {addAreaModule.gazAutoListCheckbox("ASGS").displayed} addAreaModule.gazAutoListCheckbox("ASGS").click() waitFor 10, {addAreaModule.gazAutoList("Tasmania").displayed} + + when: + interact { + moveToElement(addAreaModule.gazAutoList("Tasmania")) + } + + then: addAreaModule.gazAutoList("Tasmania").click() and: diff --git a/src/integration-test/groovy/ToolPointsToGridSpec.groovy b/src/integration-test/groovy/ToolPointsToGridSpec.groovy index 5fa9e247..ce8e6784 100644 --- a/src/integration-test/groovy/ToolPointsToGridSpec.groovy +++ b/src/integration-test/groovy/ToolPointsToGridSpec.groovy @@ -41,6 +41,13 @@ class ToolPointsToGridSpec extends GebSpec { waitFor 10, {addAreaModule.gazAutoListCheckbox("ASGS").displayed} addAreaModule.gazAutoListCheckbox("ASGS").click() waitFor 10, {addAreaModule.gazAutoList("Tasmania").displayed} + + when: + interact { + moveToElement(addAreaModule.gazAutoList("Tasmania")) + } + + then: addAreaModule.gazAutoList("Tasmania").click() and: diff --git a/src/integration-test/groovy/ToolPredictSpec.groovy b/src/integration-test/groovy/ToolPredictSpec.groovy index f4a19b4c..104052e5 100644 --- a/src/integration-test/groovy/ToolPredictSpec.groovy +++ b/src/integration-test/groovy/ToolPredictSpec.groovy @@ -44,6 +44,14 @@ class ToolPredictSpec extends GebSpec { waitFor 10, {addAreaModule.gazAutoListCheckbox("ASGS").displayed} addAreaModule.gazAutoListCheckbox("ASGS").click() waitFor 10, {addAreaModule.gazAutoList("Tasmania").displayed} + + when: + interact { + moveToElement(addAreaModule.gazAutoList("Tasmania")) + } + + then: + addAreaModule.gazAutoList("Tasmania").click() and: diff --git a/src/integration-test/groovy/ToolReportSpec.groovy b/src/integration-test/groovy/ToolReportSpec.groovy index 761f6745..301c970d 100644 --- a/src/integration-test/groovy/ToolReportSpec.groovy +++ b/src/integration-test/groovy/ToolReportSpec.groovy @@ -64,6 +64,12 @@ class ToolReportSpec extends GebSpec { waitFor 10, {addAreaModule.gazAutoListCheckbox("ASGS").displayed} addAreaModule.gazAutoListCheckbox("ASGS").click() waitFor 10, {addAreaModule.gazAutoList("Tasmania").displayed} + when: + interact { + moveToElement(addAreaModule.gazAutoList("Tasmania")) + } + + then: addAreaModule.gazAutoList("Tasmania").click() and: diff --git a/src/integration-test/groovy/ToolScatterPlotSpec.groovy b/src/integration-test/groovy/ToolScatterPlotSpec.groovy index 6cfcb3b4..ee0fada8 100644 --- a/src/integration-test/groovy/ToolScatterPlotSpec.groovy +++ b/src/integration-test/groovy/ToolScatterPlotSpec.groovy @@ -43,6 +43,13 @@ class ToolScatterPlotSpec extends GebSpec { waitFor 10, {addAreaModule.gazAutoListCheckbox("ASGS").displayed} addAreaModule.gazAutoListCheckbox("ASGS").click() waitFor 10, {addAreaModule.gazAutoList("Tasmania").displayed} + + when: + interact { + moveToElement(addAreaModule.gazAutoList("Tasmania")) + } + + then: addAreaModule.gazAutoList("Tasmania").click() and: @@ -120,6 +127,12 @@ class ToolScatterPlotSpec extends GebSpec { waitFor 20, {addAreaModule.gazAutoListCheckbox("ASGS").displayed} addAreaModule.gazAutoListCheckbox("ASGS").click() waitFor 20, {addAreaModule.gazAutoList("Tasmania").displayed} + when: + interact { + moveToElement(addAreaModule.gazAutoList("Tasmania")) + } + + then: addAreaModule.gazAutoList("Tasmania").click() and: @@ -127,7 +140,6 @@ class ToolScatterPlotSpec extends GebSpec { addAreaModule.nextBtn.click() then: - waitFor 10, { layerListModule.getLayer("Tasmania").displayed } addAreaModule.nextBtn.click() waitFor 5, { modalModule.title == "Scatterplot list." } From 34448a1b383e565034d73dd9e8b2449c93f28600 Mon Sep 17 00:00:00 2001 From: Qifeng Date: Thu, 7 Apr 2022 14:03:40 +1000 Subject: [PATCH 15/15] #191 fix(redirect to login if permission denied) --- src/integration-test/groovy/AddLayerSpec.groovy | 3 +-- src/integration-test/groovy/page/LegendModule.groovy | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/integration-test/groovy/AddLayerSpec.groovy b/src/integration-test/groovy/AddLayerSpec.groovy index 9a2779ab..b3f74f53 100644 --- a/src/integration-test/groovy/AddLayerSpec.groovy +++ b/src/integration-test/groovy/AddLayerSpec.groovy @@ -44,11 +44,10 @@ class AddLayerSpec extends GebSpec { when: legendModule.styleSelection.click() - legendModule.selectStyle("non-linear") + legendModule.selectStyle("default") then: Thread.sleep(pause) } - } \ No newline at end of file diff --git a/src/integration-test/groovy/page/LegendModule.groovy b/src/integration-test/groovy/page/LegendModule.groovy index 331d2e2d..98a313f6 100644 --- a/src/integration-test/groovy/page/LegendModule.groovy +++ b/src/integration-test/groovy/page/LegendModule.groovy @@ -30,7 +30,7 @@ class LegendModule extends Module { } void selectStyle (String name) { - $("select[testTag='layerStyleInLegend'] option" , text : name).click() + $("select[testTag='layerStyleInLegend'] option").find{it.value()== name}.click() } def selectFacet(name) {