Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Géocontrib Frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor 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
externe Matthieu
Géocontrib Frontend
Commits
83cedddc
Commit
83cedddc
authored
3 years ago
by
Timothee P
Browse files
Options
Downloads
Patches
Plain Diff
fix error project undefined and remove feature fetch
parent
202f5912
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/views/feature/Feature_list.vue
+13
-41
13 additions, 41 deletions
src/views/feature/Feature_list.vue
with
13 additions
and
41 deletions
src/views/feature/Feature_list.vue
+
13
−
41
View file @
83cedddc
...
@@ -191,7 +191,7 @@ import { mapUtil } from "@/assets/js/map-util.js";
...
@@ -191,7 +191,7 @@ import { mapUtil } from "@/assets/js/map-util.js";
import
SidebarLayers
from
"
@/components/map-layers/SidebarLayers
"
;
import
SidebarLayers
from
"
@/components/map-layers/SidebarLayers
"
;
import
FeatureListTable
from
"
@/components/feature/FeatureListTable
"
;
import
FeatureListTable
from
"
@/components/feature/FeatureListTable
"
;
import
Dropdown
from
"
@/components/Dropdown.vue
"
;
import
Dropdown
from
"
@/components/Dropdown.vue
"
;
import
axios
from
'
@/axios-client.js
'
;
import
axios
from
"
@/axios-client.js
"
;
// axios.defaults.headers.common['X-CSRFToken'] = (name => {
// axios.defaults.headers.common['X-CSRFToken'] = (name => {
// var re = new RegExp(name + "=([^;]+)");
// var re = new RegExp(name + "=([^;]+)");
...
@@ -280,7 +280,7 @@ export default {
...
@@ -280,7 +280,7 @@ export default {
statusChoices
()
{
statusChoices
()
{
//* if project is not moderate, remove pending status
//* if project is not moderate, remove pending status
return
this
.
form
.
status
.
choices
.
filter
((
el
)
=>
return
this
.
form
.
status
.
choices
.
filter
((
el
)
=>
this
.
project
.
moderation
?
true
:
el
.
value
!==
"
pending
"
this
.
project
&&
this
.
project
.
moderation
?
true
:
el
.
value
!==
"
pending
"
);
);
},
},
...
@@ -293,17 +293,6 @@ export default {
...
@@ -293,17 +293,6 @@ export default {
return
pageNumb
;
return
pageNumb
;
});
});
},
},
/* displayedPageNumbers() {
return this.pageNumbers;
//return [...this.pageNumbers].splice(0, 4);
}, */
/* displayedPageEnd() {
return this.featuresCount <= this.pagination.end
? this.featuresCount
: this.pagination.end;
}, */
},
},
methods
:
{
methods
:
{
...
@@ -318,11 +307,9 @@ export default {
...
@@ -318,11 +307,9 @@ export default {
.
then
(()
=>
{
.
then
(()
=>
{
if
(
!
this
.
modalAllDeleteOpen
)
{
if
(
!
this
.
modalAllDeleteOpen
)
{
this
.
$store
this
.
$store
.
dispatch
(
"
feature/GET_PROJECT_FEATURES
"
,
.
dispatch
(
"
feature/GET_PROJECT_FEATURES
"
,
{
{
project_slug
:
this
.
project
.
slug
,
project_slug
:
this
.
project
.
slug
})
}
)
.
then
(()
=>
{
.
then
(()
=>
{
this
.
updateFeatures
();
this
.
updateFeatures
();
this
.
checkedFeatures
.
splice
(
feature_id
);
this
.
checkedFeatures
.
splice
(
feature_id
);
...
@@ -343,7 +330,8 @@ export default {
...
@@ -343,7 +330,8 @@ export default {
this
.
modalAllDelete
();
this
.
modalAllDelete
();
},
},
updateFeaturesOnMap
()
{
onFilterChange
()
{
console
.
log
(
"
onFilterChange
"
,
this
.
featureGroup
);
if
(
this
.
featureGroup
)
{
if
(
this
.
featureGroup
)
{
const
features
=
this
.
geojsonFeatures
;
const
features
=
this
.
geojsonFeatures
;
this
.
featureGroup
.
clearLayers
();
this
.
featureGroup
.
clearLayers
();
...
@@ -370,13 +358,12 @@ export default {
...
@@ -370,13 +358,12 @@ export default {
this
.
zoom
=
this
.
$route
.
query
.
zoom
||
""
;
this
.
zoom
=
this
.
$route
.
query
.
zoom
||
""
;
this
.
lat
=
this
.
$route
.
query
.
lat
||
""
;
this
.
lat
=
this
.
$route
.
query
.
lat
||
""
;
this
.
lng
=
this
.
$route
.
query
.
lng
||
""
;
this
.
lng
=
this
.
$route
.
query
.
lng
||
""
;
var
mapDefaultViewCenter
=
var
mapDefaultViewCenter
=
this
.
$store
.
state
.
configuration
.
DEFAULT_MAP_VIEW
.
center
;
this
.
$store
.
state
.
configuration
.
DEFAULT_MAP_VIEW
.
center
;
var
mapDefaultViewZoom
=
var
mapDefaultViewZoom
=
this
.
$store
.
state
.
configuration
.
DEFAULT_MAP_VIEW
.
zoom
;
this
.
$store
.
state
.
configuration
.
DEFAULT_MAP_VIEW
.
zoom
;
this
.
map
=
mapUtil
.
createMap
(
this
.
$refs
.
map
,
{
this
.
map
=
mapUtil
.
createMap
(
this
.
$refs
.
map
,
{
zoom
:
this
.
zoom
,
zoom
:
this
.
zoom
,
lat
:
this
.
lat
,
lat
:
this
.
lat
,
...
@@ -408,7 +395,7 @@ export default {
...
@@ -408,7 +395,7 @@ export default {
},
},
handlePageChange
(
page
)
{
handlePageChange
(
page
)
{
console
.
log
(
"
handlePageChange
"
,
page
,
typeof
page
)
console
.
log
(
"
handlePageChange
"
,
page
,
typeof
page
)
;
if
(
page
===
"
next
"
)
{
if
(
page
===
"
next
"
)
{
this
.
toNextPage
();
this
.
toNextPage
();
}
else
if
(
page
===
"
previous
"
)
{
}
else
if
(
page
===
"
previous
"
)
{
...
@@ -553,7 +540,7 @@ export default {
...
@@ -553,7 +540,7 @@ export default {
this
.
geojsonFeatures
=
response
.
data
.
results
.
features
;
this
.
geojsonFeatures
=
response
.
data
.
results
.
features
;
//if (response.data.results.features.length > 0) {
//if (response.data.results.features.length > 0) {
this
.
loadFeatures
();
this
.
loadFeatures
();
this
.
updateFeaturesOnMap
();
this
.
onFilterChange
();
//}
//}
}
}
this
.
$store
.
commit
(
"
DISCARD_LOADER
"
);
this
.
$store
.
commit
(
"
DISCARD_LOADER
"
);
...
@@ -597,32 +584,17 @@ export default {
...
@@ -597,32 +584,17 @@ export default {
},
},
},
},
/* created() {
if (!this.project) {
this.$store.dispatch(
"GET_PROJECT_INFO",
this.$route.params.slug,
"noFeatures" //* not fetching classic features, too heavy, using paginated features instead
);
}
}, */
mounted
()
{
mounted
()
{
if
(
!
this
.
project
)
{
if
(
!
this
.
project
)
{
// Chargements des features et infos projet en cas d'arrivée directe sur la page ou de refresh
// Chargements des features et infos projet en cas d'arrivée directe sur la page ou de refresh
axios
.
all
([
this
.
$store
this
.
$store
.
dispatch
(
"
GET_PROJECT_INFO
"
,
this
.
$route
.
params
.
slug
),
.
dispatch
(
"
GET_PROJECT_INFO
"
,
this
.
$route
.
params
.
slug
)
this
.
$store
.
dispatch
(
'
feature/GET_PROJECT_FEATURES
'
,
{
project_slug
:
this
.
$route
.
params
.
slug
})])
.
then
(()
=>
{
.
then
(()
=>
{
this
.
initMap
();
this
.
initMap
();
});
});
}
}
else
{
else
{
this
.
initMap
();
this
.
initMap
();
}
}
},
},
destroyed
()
{
destroyed
()
{
...
...
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