Skip to content

Commit c5497a9

Browse files
committed
Merges #526 Closes #526 Fixes #521
2 parents 412e6a3 + 59cb350 commit c5497a9

File tree

6 files changed

+72
-34
lines changed

6 files changed

+72
-34
lines changed

ui/src/components/IndividualsTable.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
value: 'profile__name'
5151
}
5252
]"
53+
:set-filters="setFilters"
5354
/>
5455
<v-tooltip bottom transition="expand-y-transition" open-delay="200">
5556
<template v-slot:activator="{ on }">
@@ -293,6 +294,10 @@ export default {
293294
withdraw: {
294295
type: Function,
295296
required: true
297+
},
298+
setFilters: {
299+
type: String,
300+
required: false
296301
}
297302
},
298303
data() {

ui/src/components/OrganizationEntry.vue

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,19 @@
88
>
99
<td class="font-weight-medium">{{ name }}</td>
1010
<td class="text-right text--secondary">
11-
{{ enrollments }}
1211
<v-tooltip bottom transition="expand-y-transition" open-delay="200">
1312
<template v-slot:activator="{ on }">
14-
<v-icon v-on="on" small right>
15-
mdi-account-multiple
16-
</v-icon>
13+
<v-btn
14+
depressed
15+
color="transparent"
16+
v-on="on"
17+
@click.stop="$emit('getEnrollments')"
18+
>
19+
{{ enrollments }}
20+
<v-icon small right>
21+
mdi-account-multiple
22+
</v-icon>
23+
</v-btn>
1724
</template>
1825
<span>Enrollments</span>
1926
</v-tooltip>

ui/src/components/OrganizationsTable.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
@enroll="confirmEnroll"
4848
@edit="openModal(item)"
4949
@delete="confirmDelete(item.name)"
50+
@getEnrollments="$emit('getEnrollments', item.name)"
5051
/>
5152
</template>
5253
<template v-slot:expanded-item="{ item }">

ui/src/components/Search.vue

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ export default {
113113
required: false,
114114
default: false
115115
},
116+
setFilters: {
117+
type: String,
118+
required: false
119+
},
116120
validFilters: {
117121
type: Array,
118122
required: false,
@@ -316,6 +320,12 @@ export default {
316320
this.search();
317321
}
318322
}
323+
},
324+
watch: {
325+
setFilters(value) {
326+
this.inputValue = value;
327+
this.search();
328+
}
319329
}
320330
};
321331
</script>

ui/src/views/Dashboard.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
:enroll="enroll"
3030
:get-countries="getCountries"
3131
:lock-individual="lockIndividual"
32+
:set-filters="filters"
3233
:unlock-individual="unlockIndividual"
3334
:withdraw="withdraw"
3435
:update-enrollment="updateEnrollment"
@@ -50,6 +51,7 @@
5051
:add-domain="addDomain"
5152
:delete-domain="deleteDomain"
5253
:delete-organization="deleteOrganization"
54+
@getEnrollments="getEnrollments"
5355
@updateIndividuals="updateTable"
5456
@updateWorkspace="updateWorkspace"
5557
ref="organizations"
@@ -101,6 +103,7 @@ export default {
101103
},
102104
data() {
103105
return {
106+
filters: null,
104107
highlightInTable: undefined,
105108
highlightInWorkspace: undefined,
106109
savedIndividuals: [],
@@ -260,6 +263,9 @@ export default {
260263
clearWorkspace() {
261264
this.emptyWorkspace();
262265
this.savedIndividuals = [];
266+
},
267+
getEnrollments(organization) {
268+
this.filters = `enrollment:"${organization}"`;
263269
}
264270
},
265271
async mounted() {

ui/tests/unit/__snapshots__/storybook.spec.js.snap

Lines changed: 39 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6510,18 +6510,27 @@ exports[`Storyshots OrganizationEntry Default 1`] = `
65106510
<td
65116511
class="text-right text--secondary"
65126512
>
6513-
6514-
280
6515-
65166513
<span
65176514
class="v-tooltip v-tooltip--bottom"
65186515
>
65196516
<!---->
6520-
<i
6521-
aria-hidden="true"
6522-
class="v-icon notranslate v-icon--right mdi mdi-account-multiple theme--light"
6523-
style="font-size: 16px;"
6524-
/>
6517+
<button
6518+
class="v-btn v-btn--depressed theme--light v-size--default transparent"
6519+
type="button"
6520+
>
6521+
<span
6522+
class="v-btn__content"
6523+
>
6524+
6525+
280
6526+
6527+
<i
6528+
aria-hidden="true"
6529+
class="v-icon notranslate v-icon--right mdi mdi-account-multiple theme--light"
6530+
style="font-size: 16px;"
6531+
/>
6532+
</span>
6533+
</button>
65256534
</span>
65266535
</td>
65276536
@@ -6739,13 +6748,13 @@ exports[`Storyshots OrganizationsTable Default 1`] = `
67396748
>
67406749
<label
67416750
class="v-label theme--light"
6742-
for="input-1013"
6751+
for="input-1014"
67436752
style="left: 0px; position: absolute;"
67446753
>
67456754
Search
67466755
</label>
67476756
<input
6748-
id="input-1013"
6757+
id="input-1014"
67496758
type="text"
67506759
/>
67516760
</div>
@@ -6872,13 +6881,13 @@ exports[`Storyshots OrganizationsTable Default 1`] = `
68726881
>
68736882
<label
68746883
class="v-label v-label--active theme--light"
6875-
for="input-1024"
6884+
for="input-1025"
68766885
style="left: 0px; position: absolute;"
68776886
>
68786887
Items per page
68796888
</label>
68806889
<input
6881-
id="input-1024"
6890+
id="input-1025"
68826891
max="0"
68836892
min="1"
68846893
type="number"
@@ -7234,13 +7243,13 @@ exports[`Storyshots Search Default 1`] = `
72347243
>
72357244
<label
72367245
class="v-label theme--light"
7237-
for="input-1101"
7246+
for="input-1105"
72387247
style="left: 0px; position: absolute;"
72397248
>
72407249
Search
72417250
</label>
72427251
<input
7243-
id="input-1101"
7252+
id="input-1105"
72447253
type="text"
72457254
/>
72467255
</div>
@@ -7368,13 +7377,13 @@ exports[`Storyshots Search Filter Selector 1`] = `
73687377
>
73697378
<label
73707379
class="v-label theme--light"
7371-
for="input-1111"
7380+
for="input-1115"
73727381
style="left: 0px; position: absolute;"
73737382
>
73747383
Search
73757384
</label>
73767385
<input
7377-
id="input-1111"
7386+
id="input-1115"
73787387
type="text"
73797388
/>
73807389
</div>
@@ -7472,13 +7481,13 @@ exports[`Storyshots Search Order Selector 1`] = `
74727481
>
74737482
<label
74747483
class="v-label theme--light"
7475-
for="input-1124"
7484+
for="input-1128"
74767485
style="left: 0px; position: absolute;"
74777486
>
74787487
Search
74797488
</label>
74807489
<input
7481-
id="input-1124"
7490+
id="input-1128"
74827491
type="text"
74837492
/>
74847493
</div>
@@ -7550,7 +7559,7 @@ exports[`Storyshots Search Order Selector 1`] = `
75507559
<div
75517560
aria-expanded="false"
75527561
aria-haspopup="listbox"
7553-
aria-owns="list-1129"
7562+
aria-owns="list-1133"
75547563
class="v-input__slot"
75557564
role="button"
75567565
>
@@ -7568,7 +7577,7 @@ exports[`Storyshots Search Order Selector 1`] = `
75687577
>
75697578
<label
75707579
class="v-label theme--light"
7571-
for="input-1129"
7580+
for="input-1133"
75727581
style="left: 0px; position: absolute;"
75737582
>
75747583
Order by
@@ -7579,7 +7588,7 @@ exports[`Storyshots Search Order Selector 1`] = `
75797588
<input
75807589
aria-readonly="false"
75817590
autocomplete="off"
7582-
id="input-1129"
7591+
id="input-1133"
75837592
readonly="readonly"
75847593
type="text"
75857594
/>
@@ -8154,7 +8163,7 @@ exports[`Storyshots WorkSpace Drag And Drop 1`] = `
81548163
/>
81558164
<input
81568165
aria-checked="false"
8157-
id="input-1220"
8166+
id="input-1224"
81588167
role="checkbox"
81598168
type="checkbox"
81608169
value=""
@@ -8165,7 +8174,7 @@ exports[`Storyshots WorkSpace Drag And Drop 1`] = `
81658174
</div>
81668175
<label
81678176
class="v-label theme--light"
8168-
for="input-1220"
8177+
for="input-1224"
81698178
style="left: 0px; position: relative;"
81708179
>
81718180
Select all
@@ -8251,13 +8260,13 @@ exports[`Storyshots WorkSpace Drag And Drop 1`] = `
82518260
>
82528261
<label
82538262
class="v-label theme--light"
8254-
for="input-1225"
8263+
for="input-1229"
82558264
style="left: 0px; position: absolute;"
82568265
>
82578266
Search
82588267
</label>
82598268
<input
8260-
id="input-1225"
8269+
id="input-1229"
82618270
type="text"
82628271
/>
82638272
</div>
@@ -8329,7 +8338,7 @@ exports[`Storyshots WorkSpace Drag And Drop 1`] = `
83298338
<div
83308339
aria-expanded="false"
83318340
aria-haspopup="listbox"
8332-
aria-owns="list-1233"
8341+
aria-owns="list-1237"
83338342
class="v-input__slot"
83348343
role="button"
83358344
>
@@ -8347,7 +8356,7 @@ exports[`Storyshots WorkSpace Drag And Drop 1`] = `
83478356
>
83488357
<label
83498358
class="v-label theme--light"
8350-
for="input-1233"
8359+
for="input-1237"
83518360
style="left: 0px; position: absolute;"
83528361
>
83538362
Order by
@@ -8358,7 +8367,7 @@ exports[`Storyshots WorkSpace Drag And Drop 1`] = `
83588367
<input
83598368
aria-readonly="false"
83608369
autocomplete="off"
8361-
id="input-1233"
8370+
id="input-1237"
83628371
readonly="readonly"
83638372
type="text"
83648373
/>
@@ -8535,13 +8544,13 @@ exports[`Storyshots WorkSpace Drag And Drop 1`] = `
85358544
>
85368545
<label
85378546
class="v-label v-label--active theme--light"
8538-
for="input-1253"
8547+
for="input-1257"
85398548
style="left: 0px; position: absolute;"
85408549
>
85418550
Items per page
85428551
</label>
85438552
<input
8544-
id="input-1253"
8553+
id="input-1257"
85458554
max="0"
85468555
min="1"
85478556
type="number"

0 commit comments

Comments
 (0)