Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Client
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
Factory
Resin
Client
Commits
0aca5b21
Commit
0aca5b21
authored
3 years ago
by
Antonin COQUET
Browse files
Options
Downloads
Patches
Plain Diff
fix auto reload of structure
parent
e2244d3d
No related branches found
No related tags found
3 merge requests
!178
release V1.10.0
,
!135
Dev
,
!122
Feat/structure query param
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/app/carto/carto.component.ts
+13
-5
13 additions, 5 deletions
src/app/carto/carto.component.ts
src/app/structure-list/components/search/search.component.ts
+0
-2
0 additions, 2 deletions
src/app/structure-list/components/search/search.component.ts
with
13 additions
and
7 deletions
src/app/carto/carto.component.ts
+
13
−
5
View file @
0aca5b21
...
...
@@ -8,6 +8,7 @@ import { Filter } from '../structure-list/models/filter.model';
import
{
GeoJson
}
from
'
../map/models/geojson.model
'
;
import
{
GeojsonService
}
from
'
../services/geojson.service
'
;
import
{
CustomRegExp
}
from
'
../utils/CustomRegExp
'
;
import
{
ActivatedRoute
}
from
'
@angular/router
'
;
@
Component
({
selector
:
'
app-carto
'
,
...
...
@@ -26,14 +27,21 @@ export class CartoComponent implements OnInit {
public
isMapPhone
=
false
;
public
searchedValue
=
null
;
public
locate
=
false
;
// Use to sync location between search and map
constructor
(
private
structureService
:
StructureService
,
private
geoJsonService
:
GeojsonService
)
{}
constructor
(
private
structureService
:
StructureService
,
private
geoJsonService
:
GeojsonService
,
private
activatedRoute
:
ActivatedRoute
)
{}
ngOnInit
():
void
{
if
(
navigator
.
geolocation
)
{
this
.
getLocation
();
}
else
{
this
.
getStructures
(
null
);
if
(
!
this
.
activatedRoute
.
snapshot
.
queryParamMap
.
get
(
'
search
'
))
{
if
(
navigator
.
geolocation
)
{
this
.
getLocation
();
}
else
{
this
.
getStructures
(
null
);
}
}
if
(
history
.
state
.
data
)
{
this
.
currentStructure
=
new
Structure
(
history
.
state
.
data
);
}
...
...
This diff is collapsed.
Click to expand it.
src/app/structure-list/components/search/search.component.ts
+
0
−
2
View file @
0aca5b21
...
...
@@ -61,7 +61,6 @@ export class SearchComponent implements OnInit, OnChanges {
this
.
categories
=
[];
this
.
checkedModulesFilter
=
new
Array
();
if
(
this
.
queryString
)
{
console
.
log
(
'
we search
'
,
this
.
queryString
);
const
filters
:
Filter
[]
=
[];
filters
.
push
(
new
Filter
(
'
query
'
,
this
.
queryString
));
this
.
searchEvent
.
emit
(
filters
);
...
...
@@ -97,7 +96,6 @@ export class SearchComponent implements OnInit, OnChanges {
this
.
location
.
go
(
'
/acteurs
'
);
}
this
.
queryString
=
this
.
activatedRoute
.
snapshot
.
queryParamMap
.
get
(
'
search
'
);
console
.
log
(
'
query string is:
'
,
this
.
queryString
);
const
filters
:
Filter
[]
=
[];
if
(
term
)
{
filters
.
push
(
new
Filter
(
'
query
'
,
term
));
...
...
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