3
3
<dl >
4
4
<dd >Region Kind</dd >
5
5
<dt ><input v-model =" regionKind" /></dt >
6
+ <dd >GeoRegion Kind Detail</dd >
7
+ <dt >
8
+ <input v-model =" regionKindDetail" />
9
+ </dt >
6
10
<dd >Ancestor GeoRegion</dd >
7
11
<dt >
8
12
<input v-model =" ancestor" @change =" ancestorChanged" />
12
16
<dt >
13
17
<input v-model =" category" @change =" categoryChanged" />
14
18
{{ categoryName }}
19
+ <label ><input type =" checkbox" v-model =" useCategoryForSearch" />Use for search</label >
15
20
</dt >
16
21
<dd >Jurisdiction</dd >
17
22
<dt >
48
53
</template >
49
54
50
55
<script >
51
- import { getAllData , FroideAPI , getData , postData } from ' ../../lib/api.js'
56
+ import { FroideAPI , getAllData , getData , postData } from ' ../../lib/api.js'
52
57
53
58
import GeoMatcherRow from ' ./geo-matcher-row.vue'
54
59
@@ -67,10 +72,12 @@ export default {
67
72
return {
68
73
georegions: [],
69
74
regionKind: ' ' ,
75
+ regionKindDetail: ' ' ,
70
76
ancestor: ' ' ,
71
77
ancestorName: ' ' ,
72
78
jurisdiction: ' ' ,
73
79
jurisdictionName: ' ' ,
80
+ useCategoryForSearch: true ,
74
81
category: ' ' ,
75
82
categoryName: ' ' ,
76
83
searchHint: ' ' ,
@@ -114,6 +121,7 @@ export default {
114
121
115
122
this .ancestor = entries .get (' ancestor' ) || ' '
116
123
this .regionKind = entries .get (' kind' ) || ' '
124
+ this .regionKindDetail = entries .get (' kind_detail' ) || ' '
117
125
this .category = entries .get (' category' ) || ' '
118
126
this .jurisdiction = entries .get (' jurisdiction' ) || ' '
119
127
this .searchHint = entries .get (' searchhint' ) || ' '
@@ -195,6 +203,9 @@ export default {
195
203
},
196
204
loadGeoRegions () {
197
205
let apiUrl = ` ${ this .config .url .listGeoregion } ?kind=${ this .regionKind } `
206
+ if (this .regionKindDetail ) {
207
+ apiUrl += ` &kind_detail=${ encodeURIComponent (this .regionKindDetail )} `
208
+ }
198
209
if (this .ancestor ) {
199
210
apiUrl += ` &ancestor=${ this .ancestor } `
200
211
}
@@ -261,7 +272,7 @@ export default {
261
272
}
262
273
263
274
const filter = {}
264
- if (this .category ) {
275
+ if (this .category && this . useCategoryForSearch ) {
265
276
filter .categories = this .category
266
277
}
267
278
if (this .jurisdiction ) {
@@ -275,7 +286,11 @@ export default {
275
286
connectPublicBody (payload ) {
276
287
const data = {
277
288
georegion: payload .georegionId ,
278
- publicbody: payload .publicbodyId
289
+ publicbody: payload .publicbodyId ,
290
+ }
291
+ if (this .category && ! this .useCategoryForSearch ) {
292
+ // Add category to public body
293
+ data .category = this .category
279
294
}
280
295
postData (' ' , data, this .csrfToken ).then (() => {
281
296
const gr = this .georegions [this .georegionMapping [payload .georegionUrl ]]
0 commit comments