Skip to content

Commit 97800a9

Browse files
author
Adam Collins
committed
addPoints UI changes
1 parent 07113bc commit 97800a9

File tree

9 files changed

+47
-11
lines changed

9 files changed

+47
-11
lines changed

_Events.groovy

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def build(String baseDir) {
2828
'angular-ui-bootstrap/dist/ui-bootstrap-csp.css', 'bootbox/dist/bootbox.min.js', 'jquery/dist/jquery.min.js',
2929
'ng-file-upload/dist/ng-file-upload.js', 'ngbootbox/dist/ngBootbox.min.js',
3030
'bootstrap/dist/', 'leaflet/dist/', 'leaflet-draw/dist/', 'leaflet-measure/dist/', 'proj4/dist/proj4.js',
31-
'proj4leaflet/src/proj4leaflet.js', 'lz-string/libs/lz-string.min.js']
31+
'proj4leaflet/src/proj4leaflet.js', 'lz-string/libs/lz-string.min.js', 'angular-sanitize/angular-sanitize.min.js']
3232
files.each { name ->
3333
def dst = new File(baseDir + '/grails-app/assets/node_modules/' + name)
3434
dst.getParentFile().mkdirs()

grails-app/assets/javascripts/application.js

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
//= require angular-slider/slider.js
3434
//= require angular-sortable/sortable.js
3535
//= require ng-file-upload/dist/ng-file-upload.min.js
36+
//= require angular-sanitize/angular-sanitize.min.js
3637

3738
//bootbox
3839
//= require ngbootbox/dist/ngBootbox.min.js

grails-app/assets/javascripts/spApp/controller/addPointsCtrl.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @description
88
* Add points to the map using spatial-service's sandbox services
99
*/
10-
angular.module('add-points-ctrl', ['map-service', 'layers-service', 'predefined-areas-service'])
10+
angular.module('add-points-ctrl', ['map-service', 'layers-service', 'predefined-areas-service', 'ngSanitize'])
1111
.controller('AddPointsCtrl', ['LayoutService', '$scope', 'MapService', '$timeout', 'LayersService',
1212
'$uibModalInstance', 'PredefinedAreasService', 'BiocacheService', 'LoggerService', 'data',
1313
function (LayoutService, $scope, MapService, $timeout, LayersService, $uibModalInstance, PredefinedAreasService, BiocacheService, LoggerService, inputData) {
@@ -37,6 +37,8 @@
3737
$scope.sortType = 'date';
3838
$scope.sortReverse = true;
3939

40+
$scope.instructions = $i18n(551, "Select a CSV or zipped CSV file.");
41+
4042
LayoutService.addToSave($scope);
4143

4244
$scope.init = function () {

grails-app/assets/javascripts/spApp/templates/addPointsContent.tpl.htm

+4-6
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ <h3 i18n="558" class="panel-title">Select method</h3>
2020
ng-change="method='upload'">Upload CSV</label></div>
2121
<div class="checkbox"><label><input type="radio" ng-model="method"
2222
value="existing" name="addPoints_method"
23-
ng-change="method='existing'">Previous upload</label></div>
23+
ng-change="method='existing'; file=null">Previous upload</label></div>
2424
</div>
2525
<br/>
2626
</div>
@@ -95,13 +95,11 @@ <h3 i18n="561" class="panel-title">Your uploads</h3>
9595
<div class="panel panel-default" ng-show="step == 'default' && method == 'upload'">
9696
<div class="panel-default">
9797
<div class="panel-heading">
98-
<h3 i18n="550" class="panel-title">Upload a CSV file with occurrences.</h3>
98+
<h3 i18n="550" class="panel-title">Upload a CSV file with occurrences</h3>
9999
</div>
100100

101101
<div class="panel-body">
102-
<div i18n="551">
103-
Select a CSV or zipped CSV file. Please note that for the records in a data set to be effectively discoverable and able to be mapped it needs to meet a minimum set of standards. Data needs to include, at a minimum: scientificName/vernacularName to identify the organism and eventDate, decimalLatitude and decimalLongitude to indicate where and when the occurrence happened. The data needs to have a unique identifier column - either catalogNumber or occurrenceID with a unique value for each record. The number of columns must match the number of column headers (problems with this often indicate commas and/or line breaks in the fields). Additional fields will increase the usability of the data.
104-
</div>
102+
<div id="pointsUploadInstructions" ng-bind-html="instructions"></div>
105103
<br/>
106104
<div>
107105
<div class="btn-group btn-group-sm">
@@ -144,7 +142,7 @@ <h3 i18n="556" class="panel-title">Importing</h3>
144142
</div>
145143

146144
<div class="panel-body">
147-
<div>{{status}} : {{message}}</div>
145+
<div style="display: flex"><div class="inline-spinner" style="margin-right:10px" ng-show="status != 'finished' && status != ''"></div>{{message}}</div>
148146

149147
<div ng-show="errorMsg" style="color: red">{{ errorMsg }}</div>
150148
<br/>

grails-app/assets/stylesheets/spatial-hub-generic.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -3331,4 +3331,4 @@ img.map-icon {
33313331

33323332
ul.errors {
33333333
padding-top: 150px
3334-
}
3334+
}

grails-app/assets/stylesheets/spatial-hub.css

+8
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,14 @@ form.banner {
560560
left: 50%;
561561
}
562562

563+
.inline-spinner {
564+
background: url(../images/spinner.gif);
565+
background-repeat: no-repeat;
566+
background-size: 16px 16px;
567+
height: 16px;
568+
width: 16px;
569+
}
570+
563571
#legend {
564572
margin-right:0px;
565573
}

grails-app/i18n/messages.properties

+15-2
Original file line numberDiff line numberDiff line change
@@ -584,8 +584,21 @@ Area\ Report\ -\ interactive=Area Report - interactive
584584
544=Select mapped species.
585585
545=Annotate your workflow
586586
546=Export points.
587-
550=CSV file with occurrences.
588-
551=Select a CSV or zipped CSV file. Please note that for the records in a data set to be effectively discoverable and able to be mapped it needs to meet a minimum set of standards. Data needs to include, at a minimum: scientificName/vernacularName to identify the organism and eventDate, decimalLatitude and decimalLongitude to indicate where and when the occurrence happened. The data needs to have a unique identifier column - either catalogNumber or occurrenceID with a unique value for each record. The number of columns must match the number of column headers (problems with this often indicate commas and/or line breaks in the fields). Additional fields will increase the usability of the data.
587+
550=CSV file with occurrences
588+
551=<p>Select a CSV or zipped CSV file. Please note that for the records in a data set to be effectively discoverable and able to be mapped it needs to meet a minimum set of standards.</p>\
589+
<p>Data needs to include, at a minimum:</p>\
590+
<ul>\
591+
<li><code>scientificName</code>/<code>vernacularName</code> to identify the organism</li>\
592+
<li><code>eventDate</code> to indicate when the occurrence happened</li>\
593+
<li><code>decimalLatitude</code> and <code>decimalLongitude</code> to indicate where the occurrence happened</li>\
594+
<li>A unique identifier column - either <code>catalogNumber</code> or <code>occurrenceID</code>, with a unique value for each record</li>\
595+
</ul>\
596+
\
597+
<p>Also note:</p>\
598+
<ul>\
599+
<li>The number of columns must match the number of column headers (problems with this often indicate commas and/or line breaks in the fields).</li>\
600+
<li>Additional fields will increase the usability of the data.</li>\
601+
</ul>
589602
552=Dataset name
590603
553=Prior uploads
591604
554=List of prior uploads

package-lock.json

+13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"angular-route": "1.5.8",
3838
"angular-touch": "1.5.8",
3939
"angular-ui-bootstrap": "^1.3.3",
40+
"angular-sanitize": "1.5.8",
4041
"bootbox": "^5.0.1",
4142
"bootstrap": "3.4.1",
4243
"chromedriver": "89.0.0",

0 commit comments

Comments
 (0)