Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
VIPSLogic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VIPS
VIPSLogic
Commits
b0834749
Commit
b0834749
authored
1 month ago
by
Lene Wasskog
Browse files
Options
Downloads
Patches
Plain Diff
fix: Ensure observation data is stored and displayed for timeseries obs
parent
a04d5f54
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/webapp/js/objectGISInfoMap.js
+3
-0
3 additions, 0 deletions
src/main/webapp/js/objectGISInfoMap.js
src/main/webapp/templates/observationForm.ftl
+12
-12
12 additions, 12 deletions
src/main/webapp/templates/observationForm.ftl
with
15 additions
and
12 deletions
src/main/webapp/js/objectGISInfoMap.js
+
3
−
0
View file @
b0834749
...
@@ -662,6 +662,9 @@ var app = window.app;
...
@@ -662,6 +662,9 @@ var app = window.app;
* @return {GEOJson} returns all features currently on the map in GEOJson format
* @return {GEOJson} returns all features currently on the map in GEOJson format
*/
*/
function
getFeatures
()
{
function
getFeatures
()
{
if
(
!
featureOverlay
){
return
null
;
}
var
features
=
featureOverlay
.
getSource
().
getFeatures
();
var
features
=
featureOverlay
.
getSource
().
getFeatures
();
var
format
=
new
ol
.
format
.
GeoJSON
();
var
format
=
new
ol
.
format
.
GeoJSON
();
// write features to GeoJSON format using projection EPSG:4326
// write features to GeoJSON format using projection EPSG:4326
...
...
This diff is collapsed.
Click to expand it.
src/main/webapp/templates/observationForm.ftl
+
12
−
12
View file @
b0834749
...
@@ -44,7 +44,6 @@
...
@@ -44,7 +44,6 @@
var organizationId = $
{
user
.organizationId.organizationId
}
;
var organizationId = $
{
user
.organizationId.organizationId
}
;
var selectedCropId = <#if observation.cropOrganism?has_content>$
{
observation
.cropOrganism.organismId
?
c
}
<#else>null</#if>;
var selectedCropId = <#if observation.cropOrganism?has_content>$
{
observation
.cropOrganism.organismId
?
c
}
<#else>null</#if>;
$(document).ready(function ()
{
$(document).ready(function ()
{
//
L
oad
main
form
definition
(
for
validation
)
//
L
oad
main
form
definition
(
for
validation
)
...
@@ -54,11 +53,9 @@
...
@@ -54,11 +53,9 @@
//
I
f
observation
already
registered
center
on
location
//
I
f
observation
already
registered
center
on
location
//
O
therwise
,
center
and
zoom
to
organizations
'
s
default
//
O
therwise
,
center
and
zoom
to
organizations
'
s
default
<#
if
observation
.location
?
has_content
>
<#
if
observation
.location
?
has_content
>
initGisInfoMap
(
[$
{(
observation
.location.x
?
c
)
!
""
},
$
{(
observation
.location.y
?
c
)
!
""
}
]
,
10
,
true
)
;
initGisInfoMap
(
[$
{(
observation
.location.x
?
c
)
!
""
},
$
{(
observation
.location.y
?
c
)
!
""
}
]
,
10
,
true
)
;
<#
elseif
!
observation
.observationTimeSeries
?
has_content
>
<#
elseif
!
observation
.observationTimeSeries
?
has_content
>
var
geoInfo
=
<#
if
observation
.geoinfo
?
has_content
>$
{
observation
.geoinfo
}
<#
else
>
var
geoInfo
=
<#
if
observation
.geoinfo
?
has_content
>$
{
observation
.geoinfo
}
<#
else
>
{}
{
}
</#
if
>;
</#
if
>;
var
chooseFromMapLayers
=
{
"chooseFromMapLayers"
:
<#
if
mapLayers
?
has_content
>$
{
mapLayers
}
<#
else
>[]</#
if
>
}
;
var
chooseFromMapLayers
=
{
"chooseFromMapLayers"
:
<#
if
mapLayers
?
has_content
>$
{
mapLayers
}
<#
else
>[]</#
if
>
}
;
initGisInfoMap
(
"observationFormMap"
,
[$
{
defaultMapCenter
.x
?
c
},
$
{
defaultMapCenter
.y
?
c
}
]
,
$
{
defaultMapZoom
},
false
,
geoInfo
,
chooseFromMapLayers
)
;
initGisInfoMap
(
"observationFormMap"
,
[$
{
defaultMapCenter
.x
?
c
},
$
{
defaultMapCenter
.y
?
c
}
]
,
$
{
defaultMapZoom
},
false
,
geoInfo
,
chooseFromMapLayers
)
;
...
@@ -71,8 +68,9 @@
...
@@ -71,8 +68,9 @@
observationData
=
$
{
observation
.observationData
}
;
observationData
=
$
{
observation
.observationData
}
;
getDataSchema
(
$
{
observation
.organism.organismId
},
organizationId
)
;
getDataSchema
(
$
{
observation
.organism.organismId
},
organizationId
)
;
<#
elseif
observation
.organism
?
has_content
>
<#
elseif
observation
.organism
?
has_content
>
//
S
etting
initObservationData
(
$
{
observation
.organism.organismId
},
organizationId
)
;
initObservationData
(
$
{
observation
.organism.organismId
},
organizationId
)
;
<#
elseif
observation
.observationTimeSeries
?
has_content
>
initObservationData
(
$
{
observation
.observationTimeSeries.organismId
},
organizationId
)
;
</#
if
>
</#
if
>
<#
if
observation
.observationTimeSeries
?
has_content
>
<#
if
observation
.observationTimeSeries
?
has_content
>
displayObservationTimeSeriesInfo
(
"${observation.observationTimeSeries.cropOrganismId}"
,
"${observation.observationTimeSeries.organismId}"
,
"${observation.observationTimeSeries.locationPointOfInterestId}"
)
displayObservationTimeSeriesInfo
(
"${observation.observationTimeSeries.cropOrganismId}"
,
"${observation.observationTimeSeries.organismId}"
,
"${observation.observationTimeSeries.locationPointOfInterestId}"
)
...
@@ -139,7 +137,6 @@
...
@@ -139,7 +137,6 @@
document
.getElementById
(
"locationDisplayName"
)
.innerHTML
=
locationName
||
null
;
document
.getElementById
(
"locationDisplayName"
)
.innerHTML
=
locationName
||
null
;
})
;
})
;
initLocationMap
(
locationPointOfInterestId
)
;
initLocationMap
(
locationPointOfInterestId
)
;
initObservationData
(
organismId
,
organizationId
)
;
}
}
function getDataSchema(organismId, organizationId)
{
function getDataSchema(organismId, organizationId)
{
...
@@ -490,8 +487,6 @@
...
@@ -490,8 +487,6 @@
*
Does all the ifs and buts before form can potentially be submitted
*
Does all the ifs and buts before form can potentially be submitted
*
/
*
/
function prepareFormSubmit(theForm)
{
function prepareFormSubmit(theForm)
{
//
E
xtract
GIS
info
from
O
penLayers
theForm
['
geoInfo
']
.value
=
getFeatures
()
;
try
{
try
{
//
I
f
the
form
is
quantified
:
I
nspect
the
fields
and
write
//
I
f
the
form
is
quantified
:
I
nspect
the
fields
and
write
//
JSON
string
to
the
generic
form
field
"observationData"
;
//
JSON
string
to
the
generic
form
field
"observationData"
;
...
@@ -503,10 +498,15 @@
...
@@ -503,10 +498,15 @@
}
}
theForm
['
observationData
']
.value
=
JSON
.stringify
(
editor
.getValue
())
;
theForm
['
observationData
']
.value
=
JSON
.stringify
(
editor
.getValue
())
;
}
}
validateGIS
(
theForm
)
;
//
E
xtract
GIS
info
from
O
penLayers
let
theFeatures
=
getFeatures
()
;
if
(
theFeatures
)
{
theForm
['
geoInfo
']
.value
=
theFeatures
;
return
validateForm
(
theForm
)
&&
validateGIS
(
theForm
)
;
}
return
validateForm
(
theForm
)
;
//
console
.info
(
'
validateGIS
=
'
+
(
validateGIS
(
this
)))
;
//
console
.info
(
'
validateGIS
=
'
+
(
validateGIS
(
this
)))
;
//
return
false
;
//
DEBUG
setting
//
return
false
;
//
DEBUG
setting
return
validateForm
(
theForm
)
&&
validateGIS
(
theForm
)
;
//
PROD
setting
}
catch
(
e
)
{
}
catch
(
e
)
{
console
.log
(
e
.message
)
;
console
.log
(
e
.message
)
;
console
.log
(
e
)
;
console
.log
(
e
)
;
...
@@ -519,7 +519,7 @@
...
@@ -519,7 +519,7 @@
<div class="singleBlockContainer">
<div class="singleBlockContainer">
<p><a href="$
{
returnPath
}
" class="btn btn-default back" role="button">$
{
i18nBundle
.back
}
</a>
<p><a href="$
{
returnPath
}
" class="btn btn-default back" role="button">$
{
i18nBundle
.back
}
</a>
<#if observation.observationId?has_content><a
<#if observation.observationId?has_content><a
href="/observation?action=newObservationForm" class="btn btn-default"
href="/observation?action=newObservationForm
<#if observation.observationTimeSeriesId?has_content>&observationTimeSeriesId=$
{
observation
.observationTimeSeriesId
}
</#if>
" class="btn btn-default"
role="button">$
{
i18nBundle
.addNew
}
</a></#if></p>
role="button">$
{
i18nBundle
.addNew
}
</a></#if></p>
<h1><#if observation.observationId?has_content>$
{
i18nBundle
.editObservation
}
<#else>$
{
i18nBundle
.newObservation
}
</#if><#if observation.observationTimeSeriesId?has_content> $
{
i18nBundle
.forTimeSeries
}
</#if><#if shortcut?has_content> - $
{
shortcut
.getLocalLabel
(
currentLocale
.language
)
?
lower_case
}
</#if></h1>
<h1><#if observation.observationId?has_content>$
{
i18nBundle
.editObservation
}
<#else>$
{
i18nBundle
.newObservation
}
</#if><#if observation.observationTimeSeriesId?has_content> $
{
i18nBundle
.forTimeSeries
}
</#if><#if shortcut?has_content> - $
{
shortcut
.getLocalLabel
(
currentLocale
.language
)
?
lower_case
}
</#if></h1>
<div id="errorMsgEl" class="alert alert-danger" <#if !formValidation?has_content> style="display:none;"</#if>>
<div id="errorMsgEl" class="alert alert-danger" <#if !formValidation?has_content> style="display:none;"</#if>>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment