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
GéoContrib
Géocontrib Frontend
Commits
54c031db
Commit
54c031db
authored
3 years ago
by
Timothee P
Browse files
Options
Downloads
Patches
Plain Diff
WIP: buildFilterParams automatic
parent
3e9b65cb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!213
2.3.2-rc1
,
!198
REDMINE_ISSUE-12567
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/components/feature/FeatureListTable.vue
+11
-11
11 additions, 11 deletions
src/components/feature/FeatureListTable.vue
src/views/feature/Feature_list.vue
+21
-15
21 additions, 15 deletions
src/views/feature/Feature_list.vue
with
32 additions
and
26 deletions
src/components/feature/FeatureListTable.vue
+
11
−
11
View file @
54c031db
...
@@ -10,33 +10,33 @@
...
@@ -10,33 +10,33 @@
Statut
Statut
<i
<i
:class=
"
{
:class=
"
{
down: isSortedAsc('statu
t
'),
down: isSortedAsc('statu
s
'),
up: isSortedDesc('statu
t
'),
up: isSortedDesc('statu
s
'),
}"
}"
class="icon sort"
class="icon sort"
@click="changeSort('statu
t
')"
@click="changeSort('statu
s
')"
/>
/>
</th>
</th>
<th
class=
"center"
>
<th
class=
"center"
>
Type
Type
<i
<i
:class=
"
{
:class=
"
{
down: isSortedAsc('type'),
down: isSortedAsc('
feature_
type'),
up: isSortedDesc('type'),
up: isSortedDesc('
feature_
type'),
}"
}"
class="icon sort"
class="icon sort"
@click="changeSort('type')"
@click="changeSort('
feature_
type')"
/>
/>
</th>
</th>
<th
class=
"center"
>
<th
class=
"center"
>
Nom
Nom
<i
<i
:class=
"
{
:class=
"
{
down: isSortedAsc('
nom
'),
down: isSortedAsc('
title
'),
up: isSortedDesc('
nom
'),
up: isSortedDesc('
title
'),
}"
}"
class="icon sort"
class="icon sort"
@click="changeSort('
nom
')"
@click="changeSort('
title
')"
/>
/>
</th>
</th>
<th
class=
"center"
>
<th
class=
"center"
>
...
@@ -267,10 +267,10 @@ export default {
...
@@ -267,10 +267,10 @@ export default {
sortedFeatures
=
sortedFeatures
.
sort
((
a
,
b
)
=>
{
sortedFeatures
=
sortedFeatures
.
sort
((
a
,
b
)
=>
{
let
aProp
=
this
.
getFeatureDisplayName
(
a
);
let
aProp
=
this
.
getFeatureDisplayName
(
a
);
let
bProp
=
this
.
getFeatureDisplayName
(
b
);
let
bProp
=
this
.
getFeatureDisplayName
(
b
);
if
(
this
.
sort
.
column
===
"
statu
t
"
)
{
if
(
this
.
sort
.
column
===
"
statu
s
"
)
{
aProp
=
a
.
properties
.
status
.
value
;
aProp
=
a
.
properties
.
status
.
value
;
bProp
=
b
.
properties
.
status
.
value
;
bProp
=
b
.
properties
.
status
.
value
;
}
else
if
(
this
.
sort
.
column
===
"
type
"
)
{
}
else
if
(
this
.
sort
.
column
===
"
feature_
type
"
)
{
aProp
=
a
.
properties
.
feature_type
.
title
;
aProp
=
a
.
properties
.
feature_type
.
title
;
bProp
=
b
.
properties
.
feature_type
.
title
;
bProp
=
b
.
properties
.
feature_type
.
title
;
}
else
if
(
this
.
sort
.
column
===
"
updated_on
"
)
{
}
else
if
(
this
.
sort
.
column
===
"
updated_on
"
)
{
...
...
This diff is collapsed.
Click to expand it.
src/views/feature/Feature_list.vue
+
21
−
15
View file @
54c031db
...
@@ -234,6 +234,10 @@ export default {
...
@@ -234,6 +234,10 @@ export default {
},
},
title
:
null
,
title
:
null
,
},
},
/* filters: {
type: "",
value: "",
}, */
paginatedFeatures
:
[],
paginatedFeatures
:
[],
baseUrl
:
this
.
$store
.
state
.
configuration
.
BASE_URL
,
baseUrl
:
this
.
$store
.
state
.
configuration
.
BASE_URL
,
map
:
null
,
map
:
null
,
...
@@ -389,7 +393,8 @@ export default {
...
@@ -389,7 +393,8 @@ export default {
return
featureType
?
featureType
.
slug
:
null
;
return
featureType
?
featureType
.
slug
:
null
;
},
},
buildFilterParams
({
filterType
,
filterValue
})
{
buildFilterParams
()
{
const
{
filterType
,
filterValue
}
=
this
.
filters
;
let
params
=
""
;
let
params
=
""
;
let
typeFilter
,
statusFilter
;
let
typeFilter
,
statusFilter
;
//*** feature type ***//
//*** feature type ***//
...
@@ -444,30 +449,31 @@ export default {
...
@@ -444,30 +449,31 @@ export default {
return
params
;
return
params
;
},
},
updateTypeFeatures
(
filterV
alue
)
{
updateTypeFeatures
(
v
alue
)
{
//* only update:selection custom event can trigger the filter update,
//* only update:selection custom event can trigger the filter update,
//* but it happens before the value is updated, thus using selected value from event to update query
//* but it happens before the value is updated, thus using selected value from event to update query
this
.
fetchPagedFeatures
({
filterType
:
"
featureType
"
,
filterValue
});
//this.fetchPagedFeatures({ filterType: "featureType", filterValue });
this
.
filters
=
{
type
:
"
featureType
"
,
value
};
this
.
fetchPagedFeatures
();
},
},
updateStatusFeatures
(
filterValue
)
{
updateStatusFeatures
(
value
)
{
this
.
fetchPagedFeatures
({
filterType
:
"
status
"
,
filterValue
});
//this.fetchPagedFeatures({ filterType: "status", filterValue });
this
.
filters
=
{
type
:
"
status
"
,
value
};
this
.
fetchPagedFeatures
();
},
},
fetchPagedFeatures
(
params
)
{
fetchPagedFeatures
(
params
)
{
this
.
onFilterChange
();
//* temporary, use paginated event to watch change in filters, to modify geojson on map
this
.
onFilterChange
();
//* temporary, use paginated event to watch change in filters, to modify geojson on map
let
url
=
`
${
this
.
API_BASE_URL
}
projects/
${
this
.
$route
.
params
.
slug
}
/feature-paginated/?output=geojson&limit=
${
this
.
pagination
.
pagesize
}
&offset=
${
this
.
pagination
.
start
}
`
;
let
url
=
`
${
this
.
API_BASE_URL
}
projects/
${
this
.
$route
.
params
.
slug
}
/feature-paginated/?output=geojson&limit=
${
this
.
pagination
.
pagesize
}
&offset=
${
this
.
pagination
.
start
}
`
;
const
filterParams
=
this
.
buildFilterParams
(
params
);
if
(
filterParams
===
"
abort
"
)
return
;
// ? to adapt ???
url
+=
filterParams
;
if
(
params
)
{
if
(
params
)
{
if
(
typeof
params
===
"
object
"
)
{
//console.error("ONLY FOR DEV !!!!!!!!!!!!!");
const
filterParams
=
this
.
buildFilterParams
(
params
);
//params = params.replace("8000", "8010"); //* for dev uncomment to use proxy link
if
(
filterParams
===
"
abort
"
)
return
;
url
=
params
;
url
+=
filterParams
;
}
else
{
//console.error("ONLY FOR DEV !!!!!!!!!!!!!");
//params = params.replace("8000", "8010"); //* for dev uncomment to use proxy link
url
=
params
;
}
}
}
this
.
$store
.
commit
(
this
.
$store
.
commit
(
...
@@ -499,7 +505,7 @@ export default {
...
@@ -499,7 +505,7 @@ export default {
},
},
handleSortChange
(
ordering
)
{
handleSortChange
(
ordering
)
{
console
.
log
(
"
ORDERING
"
,
ordering
)
console
.
log
(
"
ORDERING
"
,
ordering
)
;
},
},
toPage
(
pageNumber
)
{
toPage
(
pageNumber
)
{
...
...
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