Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
web-app
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
web-et-numerique
web-et-numerique-internet
data.grandlyon.com
web-portal
components
custom-apps
web-app
Commits
5998329d
Commit
5998329d
authored
5 years ago
by
FORESTIER Fabien
Browse files
Options
Downloads
Patches
Plain Diff
Fix bug in dataset-table-map component
parent
d68963ab
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!48
Version 2.3.0
Pipeline
#1709
passed
5 years ago
Stage: build
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/app/geosource/components/dataset-detail/dataset-table-map/dataset-table-map.component.ts
+25
-12
25 additions, 12 deletions
...t-detail/dataset-table-map/dataset-table-map.component.ts
with
25 additions
and
12 deletions
src/app/geosource/components/dataset-detail/dataset-table-map/dataset-table-map.component.ts
+
25
−
12
View file @
5998329d
import
{
Component
,
OnInit
,
ViewChild
}
from
'
@angular/core
'
;
import
{
Component
,
OnInit
,
ViewChild
,
OnDestroy
}
from
'
@angular/core
'
;
import
{
DatasetDetailService
}
from
'
../../../services
'
;
import
{
DatasetDetailService
}
from
'
../../../services
'
;
import
{
DatasetMapComponent
}
from
'
../dataset-map/dataset-map.component
'
;
import
{
DatasetMapComponent
}
from
'
../dataset-map/dataset-map.component
'
;
import
{
FormControl
}
from
'
@angular/forms
'
;
import
{
FormControl
}
from
'
@angular/forms
'
;
import
{
Router
,
ActivatedRoute
}
from
'
@angular/router
'
;
import
{
Router
,
ActivatedRoute
}
from
'
@angular/router
'
;
import
{
AppRoutes
}
from
'
../../../../routes
'
;
import
{
AppRoutes
}
from
'
../../../../routes
'
;
import
{
Data
}
from
'
../../../models
'
;
import
{
Data
}
from
'
../../../models
'
;
import
{
Subscription
}
from
'
rxjs
'
;
@
Component
({
@
Component
({
selector
:
'
app-dataset-table-map
'
,
selector
:
'
app-dataset-table-map
'
,
templateUrl
:
'
./dataset-table-map.component.html
'
,
templateUrl
:
'
./dataset-table-map.component.html
'
,
styleUrls
:
[
'
./dataset-table-map.component.scss
'
],
styleUrls
:
[
'
./dataset-table-map.component.scss
'
],
})
})
export
class
DatasetTableMapComponent
implements
OnInit
{
export
class
DatasetTableMapComponent
implements
OnInit
,
OnDestroy
{
@
ViewChild
(
DatasetMapComponent
)
datasetMapComponent
:
DatasetMapComponent
;
@
ViewChild
(
DatasetMapComponent
)
datasetMapComponent
:
DatasetMapComponent
;
...
@@ -27,6 +28,8 @@ export class DatasetTableMapComponent implements OnInit {
...
@@ -27,6 +28,8 @@ export class DatasetTableMapComponent implements OnInit {
selectedData
:
Data
|
mapboxgl
.
MapboxGeoJSONFeature
=
null
;
// Contains the properties of the selected feature
selectedData
:
Data
|
mapboxgl
.
MapboxGeoJSONFeature
=
null
;
// Contains the properties of the selected feature
dataDetailsShouldBeAnimated
=
false
;
// Used to prevent animation on first load of the component
dataDetailsShouldBeAnimated
=
false
;
// Used to prevent animation on first load of the component
subscriptions
:
Subscription
[]
=
[];
// search
// search
searchInput
=
new
FormControl
(
''
);
searchInput
=
new
FormControl
(
''
);
...
@@ -37,16 +40,26 @@ export class DatasetTableMapComponent implements OnInit {
...
@@ -37,16 +40,26 @@ export class DatasetTableMapComponent implements OnInit {
)
{
}
)
{
}
ngOnInit
()
{
ngOnInit
()
{
// If the dataset has at least a table or a map then initialize the component
this
.
subscriptions
.
push
(
// else redirect to the info tab
// If the dataset has at least a table or a map then initialize the component
if
(
this
.
hasTable
||
this
.
hasMap
)
{
// else redirect to the info tab
this
.
properties
=
this
.
_datasetDetailService
.
dataset
.
fields
.
list
;
this
.
_datasetDetailService
.
dataset$
.
subscribe
(()
=>
{
this
.
selectedProperties
=
Array
.
from
(
this
.
properties
);
if
(
this
.
hasTable
||
this
.
hasMap
)
{
// Intialize the search value with the value from the service in order to keep it when navigating in tabs
this
.
properties
=
this
.
_datasetDetailService
.
dataset
.
fields
.
list
;
this
.
searchInput
.
setValue
(
this
.
_datasetDetailService
.
searchString
);
this
.
selectedProperties
=
Array
.
from
(
this
.
properties
);
}
else
{
// Intialize the search value with the value from the service in order to keep it when navigating in tabs
this
.
_router
.
navigate
([
`./
${
AppRoutes
.
info
.
uri
}
`
],
{
relativeTo
:
this
.
_route
.
parent
});
this
.
searchInput
.
setValue
(
this
.
_datasetDetailService
.
searchString
);
}
}
else
{
this
.
_router
.
navigate
([
`./
${
AppRoutes
.
info
.
uri
}
`
],
{
relativeTo
:
this
.
_route
.
parent
});
}
}),
);
}
ngOnDestroy
()
{
this
.
subscriptions
.
forEach
((
sub
)
=>
{
sub
.
unsubscribe
();
});
}
}
get
isSample
():
boolean
{
get
isSample
():
boolean
{
...
...
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