Skip to content

Commit

Permalink
Merge pull request #594 from AtlasOfLivingAustralia/grails6
Browse files Browse the repository at this point in the history
Grails6
  • Loading branch information
adam-collins committed Jan 29, 2024
2 parents a3c30c6 + 4399717 commit 28b7bd2
Show file tree
Hide file tree
Showing 21 changed files with 96 additions and 123 deletions.
9 changes: 1 addition & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,8 @@ sudo: false
branches:
only:
- master
- data-quality
- hotfix
- EYA-enhancements
- develop
- /^epic\/.*\/develop$/
- /^release\/.*$/
- /^hotfix\/.*$/
- /^feature\/.*$/
- /^bug\/.*$/
- grails6
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
Expand Down
46 changes: 23 additions & 23 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,28 +1,19 @@
buildscript {
repositories {
maven { url "https://plugins.gradle.org/m2/" }
maven { url "https://repo.grails.org/grails/core" }
maven { url "https://nexus.ala.org.au/content/groups/public/" }
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion"
classpath "com.bertramlabs.plugins:asset-pipeline-gradle:3.4.7"
}
version "7.0.0-SNAPSHOT"
group "au.org.ala.plugins.grails"
}

version "6.2.0-SNAPSHOT"
group "au.org.ala.plugins.grails"
plugins {
id "groovy"
id "org.grails.grails-gsp"
id "org.grails.grails-web"
id "war"
id "idea"
id "com.bertramlabs.asset-pipeline"
id "eclipse"

apply plugin:"eclipse"
apply plugin:"idea"
apply plugin:"war"
apply plugin:"org.grails.grails-web"
apply plugin:"org.grails.grails-gsp"
apply plugin:"com.bertramlabs.asset-pipeline"
apply plugin:"maven-publish"

//sourceCompatibility = 1.8
//targetCompatibility = 1.8
id "maven-publish"
}

repositories {
mavenLocal()
Expand All @@ -37,6 +28,15 @@ configurations {
}
}

bootWar {
launchScript()
dependsOn(compileGroovyPages)
}

war {
dependsOn(compileGroovyPages)
}

// Set to true it needed only for development
// Inplace plugins ala-charts-plugin and images-client-plugin are defined in ala-hub configuration

Expand Down Expand Up @@ -80,13 +80,13 @@ dependencies {

implementation 'dk.glasius:external-config:3.1.1'
//jars
implementation "org.apache.httpcomponents:httpclient:4.5.6"
implementation 'org.apache.httpcomponents:httpclient:4.5.13'
implementation 'com.maxmind.geoip2:geoip2:2.9.0'
implementation "org.apache.commons:commons-lang3:3.7"
implementation "org.apache.commons:commons-text:1.3"
implementation "net.sf.supercsv:super-csv:2.1.0"
implementation group: 'org.apache.lucene', name: 'lucene-queryparser', version: '8.5.1'
implementation "com.googlecode.owasp-java-html-sanitizer:owasp-java-html-sanitizer:20180219.1"
implementation 'com.googlecode.owasp-java-html-sanitizer:owasp-java-html-sanitizer:20211018.2'

implementation "au.org.ala:data-quality-filter-service-client:1.0.0", noCache
implementation 'xml-apis:xml-apis:1.4.01'
Expand Down
5 changes: 3 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
grailsVersion=5.3.2
grailsGradlePluginVersion=5.3.0
grailsVersion=6.0.0
grailsGradlePluginVersion=6.0.0
groovyVersion=3.0.11
org.gradle.caching=true
org.gradle.daemon=true
org.gradle.parallel=true
org.gradle.jvmargs=-Dfile.encoding=UTF-8 -Xmx1024M
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\:https://services.gradle.org/distributions/gradle-7.4-all.zip
distributionUrl=https\:https://services.gradle.org/distributions/gradle-7.6.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
16 changes: 0 additions & 16 deletions grails-app/assets/javascripts/biocache-hubs.js

This file was deleted.

12 changes: 11 additions & 1 deletion grails-app/assets/javascripts/exploreYourArea.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

/*
* // require jquery
//= require jquery_i18n.js
//= require purl.js
//= require leaflet/leaflet.js
//= require leaflet-plugins/layer/tile/Google.js
Expand All @@ -24,7 +25,6 @@
//= require leaflet-plugins/EasyButton/easy-button.js
//= require magellan.js
//= require jquery.qtip.min.js
//= require biocache-hubs.js
//= require map.common.js
//= require_self
*/
Expand All @@ -48,6 +48,16 @@ var radiusForZoom = {
* Document onLoad event using JQuery
*/
$(document).ready(function() {
if (typeof BC_CONF != 'undefined' && BC_CONF.hasOwnProperty('contextPath')) {
jQuery.i18n.properties({
name: 'messages',
path: BC_CONF.contextPath + '/messages/i18n/',
mode: 'map',
async: true,
cache: true,
language: BC_CONF.locale // default is to use browser specified locale
});
}

// initialise Google Geocoder
geocoder = new google.maps.Geocoder();
Expand Down
1 change: 0 additions & 1 deletion grails-app/assets/javascripts/jquery_i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@
//= require jquery.i18n.properties



16 changes: 0 additions & 16 deletions grails-app/assets/javascripts/map.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,6 @@

/* Common map (Leaflet) functions */

/**
* Load Spring i18n messages into JS
*/
if (!(jQuery.i18n.properties && jQuery.i18n.properties.path) && typeof BC_CONF != 'undefined' && BC_CONF.hasOwnProperty('contextPath')) {
//console.log("loading Query.i18n");
jQuery.i18n.properties({
name: 'messages',
path: BC_CONF.contextPath + '/messages/i18n/',
mode: 'map',
async: true,
cache: true,
language: BC_CONF.locale // default is to use browser specified locale
//callback: function(){} //alert( "facet.conservationStatus = " + jQuery.i18n.prop('facet.conservationStatus')); }
});
}

// used to generate unique handler name for user drawn areas.
var areaCounter = 0;

Expand Down
10 changes: 10 additions & 0 deletions grails-app/assets/javascripts/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@

// Jquery Document.onLoad equivalent
$(document).ready(function() {
if (typeof BC_CONF != 'undefined' && BC_CONF.hasOwnProperty('contextPath')) {
jQuery.i18n.properties({
name: 'messages',
path: BC_CONF.contextPath + '/messages/i18n/',
mode: 'map',
async: true,
cache: true,
language: BC_CONF.locale // default is to use browser specified locale
});
}

// jQuery.i18n.properties was removed, as it already loaded on the seach page via 'biocache-hubs.js' file
// which requires jQuery.i18n.properties to be loaded earlier for leaflet plugin. NdR Nov 2018.
Expand Down
4 changes: 1 addition & 3 deletions grails-app/assets/javascripts/show.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* // require jquery
//= require jquery_i18n
//= require audiojs/audio.js
//= require jquery.i18n.properties.js
//= require charts2.js
//= require wms2.js
//= require amplify.js
Expand Down Expand Up @@ -34,8 +33,7 @@ $(document).ready(function() {
mode: 'map',
async: true,
cache: true,
language: BC_CONF.locale, // default is to use browser specified locale
callback: updatei18n
language: BC_CONF.locale // default is to use browser specified locale
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,6 @@
http:https://leafletjs.com
https://github.com/jacobtoye
*/

/**
************************************************************\
* i18n
\************************************************************/
jQuery.i18n.properties({
name: 'messages',
path: BC_CONF.contextPath + '/messages/i18n/',
mode: 'map',
language: BC_CONF.locale // default is to use browser specified locale
});
(function (window, document, undefined) {/*
* Leaflet.draw assumes that you have already included the Leaflet library.
*/
Expand Down Expand Up @@ -2896,4 +2885,4 @@ jQuery.i18n.properties({
});


}(window, document));
}(window, document));
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
jQuery.i18n.properties({
name: 'messages',
path: BC_CONF.contextPath + '/messages/i18n/',
mode: 'map',
language: BC_CONF.locale // default is to use browser specified locale
});
(function() {

L.Control.FullScreen = L.Control.extend({
Expand All @@ -13,21 +7,21 @@ L.Control.FullScreen = L.Control.extend({
forceSeparateButton: false,
forcePseudoFullscreen: false
},

onAdd: function (map) {
var className = 'leaflet-control-zoom-fullscreen', container;

if (map.zoomControl && !this.options.forceSeparateButton) {
container = map.zoomControl._container;
} else {
container = L.DomUtil.create('div', 'leaflet-bar');
}

this._createButton(this.options.title, className, container, this.toogleFullScreen, map);

return container;
},

_createButton: function (title, className, container, fn, context) {
var link = L.DomUtil.create('a', className, container);
link.href = '#';
Expand All @@ -37,20 +31,20 @@ L.Control.FullScreen = L.Control.extend({
.addListener(link, 'click', L.DomEvent.stopPropagation)
.addListener(link, 'click', L.DomEvent.preventDefault)
.addListener(link, 'click', fn, context);

L.DomEvent
.addListener(container, fullScreenApi.fullScreenEventName, L.DomEvent.stopPropagation)
.addListener(container, fullScreenApi.fullScreenEventName, L.DomEvent.preventDefault)
.addListener(container, fullScreenApi.fullScreenEventName, this._handleEscKey, context);

L.DomEvent
.addListener(document, fullScreenApi.fullScreenEventName, L.DomEvent.stopPropagation)
.addListener(document, fullScreenApi.fullScreenEventName, L.DomEvent.preventDefault)
.addListener(document, fullScreenApi.fullScreenEventName, this._handleEscKey, context);

return link;
},

toogleFullScreen: function () {
this._exitFired = false;
var container = this._container;
Expand All @@ -76,7 +70,7 @@ L.Control.FullScreen = L.Control.extend({
this._isFullscreen = true;
}
},

_handleEscKey: function () {
if (!fullScreenApi.isFullScreen(this) && !this._exitFired) {
this.fire('exitFullscreen');
Expand All @@ -97,7 +91,7 @@ L.control.fullscreen = function (options) {
return new L.Control.FullScreen(options);
};

/*
/*
Native FullScreen JavaScript API
-------------
Assumes Mozilla naming conventions instead of W3C for now
Expand All @@ -106,17 +100,17 @@ source : http:https://johndyer.name/native-fullscreen-javascript-api-plus-jquery-plugi
*/

var
fullScreenApi = {
var
fullScreenApi = {
supportsFullScreen: false,
isFullScreen: function() { return false; },
requestFullScreen: function() {},
isFullScreen: function() { return false; },
requestFullScreen: function() {},
cancelFullScreen: function() {},
fullScreenEventName: '',
prefix: ''
},
browserPrefixes = 'webkit moz o ms khtml'.split(' ');

// check for native support
if (typeof document.exitFullscreen != 'undefined') {
fullScreenApi.supportsFullScreen = true;
Expand All @@ -130,12 +124,12 @@ source : http:https://johndyer.name/native-fullscreen-javascript-api-plus-jquery-plugi
}
}
}

// update methods to do something useful
if (fullScreenApi.supportsFullScreen) {
fullScreenApi.fullScreenEventName = fullScreenApi.prefix + 'fullscreenchange';
fullScreenApi.isFullScreen = function() {
switch (this.prefix) {
switch (this.prefix) {
case '':
return document.fullScreen;
case 'webkit':
Expand Down
6 changes: 0 additions & 6 deletions grails-app/assets/vendor/leaflet/leaflet-src.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@
(c) 2010-2013, Vladimir Agafonkin
(c) 2010-2011, CloudMade
*/
jQuery.i18n.properties({
name: 'messages',
path: BC_CONF.contextPath + '/messages/i18n/',
mode: 'map',
language: BC_CONF.locale // default is to use browser specified locale
});
(function (window, document, undefined) {
var oldL = window.L,
L = {};
Expand Down
11 changes: 11 additions & 0 deletions grails-app/views/home/index.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,17 @@
<asset:script type="text/javascript">
$(document).ready(function() {
if (typeof BC_CONF != 'undefined' && BC_CONF.hasOwnProperty('contextPath')) {
jQuery.i18n.properties({
name: 'messages',
path: BC_CONF.contextPath + '/messages/i18n/',
mode: 'map',
async: true,
cache: true,
language: BC_CONF.locale // default is to use browser specified locale
});
}
var mapInit = false;
$('a[data-toggle="tab"]').on('shown.bs.tab', function(e) {
// console.log("this", $(this).attr('id'));
Expand Down
Loading

0 comments on commit 28b7bd2

Please sign in to comment.