Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
# Conflicts:
#	build.gradle
  • Loading branch information
qifeng-bai committed Apr 10, 2022
2 parents 5c2ab47 + 34448a1 commit 20f3619
Show file tree
Hide file tree
Showing 36 changed files with 367 additions and 62 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ out/
/node_modules/
/grails-app/assets/node_modules/
/grails-app/assets/node_modules/
/package-lock.json
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 1 addition & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ buildscript {
}
}

plugins {
id 'war'
}

version "1.0.1"
version "1.0.2"
group "au.org.ala"

apply plugin:"eclipse"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
27 changes: 24 additions & 3 deletions grails-app/assets/javascripts/spApp/directive/listsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
lastUpdated: data[i].lastUpdated,
itemCount: data[i].itemCount,
fullName: data[i].fullName,
isAuthoritative:data[i].isAuthoritative,
selected: false
})
}
Expand Down Expand Up @@ -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("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()({
q: [query],
name: found.listName,
species_list: found.dataResourceUid
})
})
}

}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@
name: name,
description: description,
user_id: $SH.userId
}, _httpDescription('createFromWkt'))
})
},
/**
* Get object information
Expand Down
4 changes: 2 additions & 2 deletions grails-app/assets/javascripts/spApp/service/listsService.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"input": [
{
"name": "area",
"description": $i18n(382,"Select area."),
"description": $i18n(420,"Select area."),
"type": "area",
"constraints": {
"min": 1,
Expand Down
39 changes: 20 additions & 19 deletions grails-app/assets/javascripts/spApp/spApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

}
};
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<div class="">
<div class="">
<div class="">
<table class="table table-striped fixed-head layers-table" style="width:430px">
<table class="table table-striped fixed-head layers-table" style="width:480px" name="speciesList">
<caption>
<div class="row">
<div class="col-sm-6">
<div class="input-group">
<input type="text" class="form-control" placeholder="Filter"
ng-model="searchLists">
ng-model="searchLists" name="searchInSpeciesList">
<div class="input-group-addon"><i class="fa fa-search"></i></div>
</div>
</div>
Expand Down Expand Up @@ -47,7 +47,7 @@
<td style="width:10px" class="td-vertical-align text-center"><input type="checkbox"
ng-model="item.selected"
ng-click="select(item)"></td>
<td class="td-vertical-align table-text-ellipsis" style="width:300px"><a target="_blank"
<td class="td-vertical-align table-text-ellipsis" style="width:300px"><span title="Authoritative list" ng-show="item.isAuthoritative" class="glyphicon glyphicon-ok-circle"></span><a target="_blank"
href="{{ itemUrl(item) }}">{{
item.listName }}</a></td>
<td style="width:100px" class="td-vertical-align text-right">{{ item.lastUpdated | date: short}}
Expand Down
1 change: 1 addition & 0 deletions grails-app/assets/stylesheets/application.css
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
6 changes: 6 additions & 0 deletions grails-app/assets/stylesheets/spatial-hub.css
Original file line number Diff line number Diff line change
Expand Up @@ -1116,3 +1116,9 @@ ul.errors {
padding-top: 20px;
font-style: italic;
}

#lang {
color: #FFFFFF;
background-color: #000000;
border-width: 0;
}
12 changes: 5 additions & 7 deletions grails-app/conf/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ grails:
upload:
maxFileSize: 10000000
maxRequestSize: 10000000
i18n:
region: 'default'

layersService:
url: 'https://spatial.ala.org.au/ws'
Expand Down Expand Up @@ -127,16 +129,14 @@ 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/?.*']
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

Expand Down Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,12 @@ 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 = null;
}


render(view: 'index',
model: [config : config,
Expand Down Expand Up @@ -322,7 +327,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,
Expand Down Expand Up @@ -453,13 +458,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
}
}

Expand Down
90 changes: 89 additions & 1 deletion grails-app/i18n/messages_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,10 @@ typeMismatch.java.math.BigInteger=Die Eigenschaft {0} muss eine gültige Zahl se
354=Gebiet
355=Die Befehl konnte nicht gefunden werden
356=Wissenschaftliche Verbreitung
357=JournalMap articles
358=Checklist species distributions
359=Checklist areas
360=Gazetteer Points
361=Sehenswürdigkeiten
362=https\://www.ala.org.au/spatial-portal-help/note-area-sq-km/
363=Info
Expand Down Expand Up @@ -432,7 +436,9 @@ typeMismatch.java.math.BigInteger=Die Eigenschaft {0} muss eine gültige Zahl se
390=Oktober
391=November
392=Dezember
393=expert distribution(s)
394=Checkliste(n)
395=track(s)
396=gefunden
397=Metadaten-URL
398=Sammlung von Flächen aus Layer
Expand Down Expand Up @@ -461,6 +467,7 @@ typeMismatch.java.math.BigInteger=Die Eigenschaft {0} muss eine gültige Zahl se
421=Dateityp.
422=Flächen zum Exportieren auswählen.
423=Dateityp auswählen.
424=Number of groups and Shapefile generation
425=Flächen exportieren.
426=Eine Artenliste exportieren.
427=Endemisch
Expand All @@ -470,4 +477,85 @@ typeMismatch.java.math.BigInteger=Die Eigenschaft {0} muss eine gültige Zahl se
431=Datum
432=Aktionstyp
433=Daten
434=Anzahl der Aktionen
434=Anzahl der Aktionen
435=Suche im ALA DOI-Dienst nach Datensätzen für Arten
436=Nach Lizenz
450=(ausgewählt)
451=Slider help
452=Use the slider to select facet classes. All facet classes falling in between the range selector are selected. Selections falling outside the range are cleared.
453=Diagramme
454=view in larger window
455=Diagramm
456=Tabelle
457=Facet classes for
458=Aktualisieren
459=My workflow
460=Workflow Saved
461=Aus DOI hinzufügen
462=Kein Datensatz ausgewählt
463=Search returned with no results
464=Metadaten anzeigen
465=DOI
466=Arten
467=Datenanzahl
468=Department
469=Modeller
470=Datum
471=SDM available
472=No data was able to be extracted from the selected DOI
473=Select by clicking label or bar
474=Nicht angegeben
475=No occurrences mapped for this layer and applied filters.
476=Die hochgeladene Datei ist zu groß. Maximale Dateigröße\:
477=Upload fehlgeschlagen.
478=Failed to register query. Try again later.
479=Ungültiger WKT
480=Display facet class in
481=Auswahl löschen
482=Search CSDM dataset by species, department or modeller
483=Absenden
484=Workflow Name
485=ist privat
486=Id
487=Ist privat
488=bearbeiten
489=Anhand eines Zeitraums begrenzen
490=Zeitraum
491=TO
492=Listentyp\:
493=Radius (km)&nbsp;
494=Draw polyline with buffer
495=Datenprovider\:
496=Add occurrences to adhoc
497=Artenmerkmale mit einschließen (falls verfügbar)
498=Annotating your workflow will allow other users to assess the suitability of the dataset for their purposes and make it reusable.
499=User
500=Organsation
501=General annotation of the dataset
502=Workflow annotation
503=Search facets...
504=--- Aktive Filter ---
505=Facet begins with (case sensitive)\:
506=Available Workflows
507=Laden
508=Bearbeitung läuft...
509=Speichern
510=Ausführen
511=Kartenprojektion
512=Filter entfernen
513=Räumlich-unbekannte Daten berücksichtigen
514=Abwesenheiten (Absences) berücksichtigen
515=Verlauf
516=Actions
517=Sessions
518=Zoom to Localities
519=Select Facet
520=Filter löschen
521=Aktiviert
522=Kategorie
523=facets selected
524=Weiter
525=Räumlich-undefinierte Daten berücksichtigen
526=(kann Artenmerkmale enthalten)
527=Keine weiteren Arten
528=Lebensform
Loading

0 comments on commit 20f3619

Please sign in to comment.