1
|
<div page-content>
|
2
|
<div header>
|
3
|
<div class="uk-margin-top">
|
4
|
<a routerLink="../" class="uk-text-secondary uk-text-uppercase uk-text-bold uk-text-small">
|
5
|
<span class="uk-icon-button uk-icon small uk-button-secondary">
|
6
|
<icon name="arrow_left"></icon>
|
7
|
</span>
|
8
|
<span class="space">
|
9
|
Go back to Content Providers
|
10
|
</span>
|
11
|
</a>
|
12
|
</div>
|
13
|
</div>
|
14
|
<div inner>
|
15
|
<div class="uk-card-header">
|
16
|
<div class="uk-flex uk-flex-middle uk-child-width-1-1 uk-child-width-1-2@m uk-grid" uk-grid>
|
17
|
<div>
|
18
|
<div class="uk-text-small uk-text-muted">Filters for</div>
|
19
|
<div>
|
20
|
<span *ngIf="dataProvider" class="uk-text-bold">{{dataProvider.officialname}}</span>
|
21
|
<span *ngIf="dirty"> (unsaved changes)</span>
|
22
|
</div>
|
23
|
</div>
|
24
|
<div class=" uk-flex uk-flex-right">
|
25
|
<button (click)="reset()" [disabled]="loading || !dirty"
|
26
|
class="uk-button uk-button-secondary outlined uk-margin-small-right">Reset
|
27
|
</button>
|
28
|
<button (click)="save()" class="uk-button uk-button-secondary uk-margin-small-right"
|
29
|
[disabled]="loading || !dirty || selectionCriteria.invalid ">Save
|
30
|
</button>
|
31
|
</div>
|
32
|
</div>
|
33
|
</div>
|
34
|
<div class="uk-card uk-card-default uk-position-relative" style="min-height: 60vh">
|
35
|
<div *ngIf="!loading" class="uk-padding-large uk-padding-remove-bottom uk-overflow-auto"
|
36
|
style="max-height: 60vh;">
|
37
|
<div *ngIf="criteria.length == 0" class="uk-padding-large uk-text-center uk-text-bold">
|
38
|
<div *ngIf="dataProvider">No filters for {{dataProvider.officialname}}.</div>
|
39
|
<div>If no filters are specified, all research results of this content provider will be included in your
|
40
|
community.
|
41
|
</div>
|
42
|
</div>
|
43
|
<form *ngIf="criteria.length > 0" [formGroup]="selectionCriteria">
|
44
|
<div formArrayName="criteria" class="uk-margin-bottom">
|
45
|
<no-load-paging (pageChange)="page = $event.value" [page]="page" [totalResults]="criteria.length" [pageSize]="pageSize" [type]="'filter' + (criteria.length > 1?'s':'')">
|
46
|
</no-load-paging>
|
47
|
<div class="uk-margin-top" *ngFor="let criterion of currentPage; let i=index" [formGroupName]="getIndex(i).toString()">
|
48
|
<h6 class="uk-text-bold uk-form-label uk-margin-small-bottom">Filter {{getIndex(i) + 1}}</h6>
|
49
|
<div class="uk-padding criterion" formArrayName="constraint">
|
50
|
<div class="uk-flex uk-flex-middle uk-grid-small uk-margin-small-bottom uk-visible@l" uk-grid>
|
51
|
<div style="width: 50px"></div>
|
52
|
<div class="uk-width-1-4">
|
53
|
<label class="uk-text-uppercase uk-text-bold">Field</label>
|
54
|
</div>
|
55
|
<div class="uk-width-1-4">
|
56
|
<label class="uk-text-uppercase uk-text-bold">Operator</label>
|
57
|
</div>
|
58
|
<div class="uk-width-1-4">
|
59
|
<label class="uk-text-uppercase uk-text-bold">Term</label>
|
60
|
</div>
|
61
|
<div class="uk-width-expand uk-text-truncate">
|
62
|
<label class="uk-text-bold uk-text-uppercase">Match Case</label>
|
63
|
</div>
|
64
|
</div>
|
65
|
<div *ngFor="let constraint of getConstraint(getIndex(i)).controls; let j=index" [formGroupName]="j.toString()"
|
66
|
class="uk-margin-bottom uk-hidden@l">
|
67
|
<div class="uk-flex uk-flex-middle uk-grid-small uk-margin-medium-bottom" uk-grid>
|
68
|
<div class="uk-flex uk-flex-center uk-width-1-1">
|
69
|
<span *ngIf="j > 0">AND</span>
|
70
|
</div>
|
71
|
<div class="uk-flex uk-flex-right uk-width-1-1">
|
72
|
<a class="uk-link-heading" (click)="removeConstraint(getIndex(i), j)">
|
73
|
<icon name="close"
|
74
|
[attr.uk-tooltip]="(getConstraint(getIndex(i)).length === 1?'By removing this constraint, the filter will be removed too':null)"></icon>
|
75
|
</a>
|
76
|
</div>
|
77
|
<div class="uk-width-1-1" dashboard-input type="select" placeholder="Select a field"
|
78
|
[options]="fields" [formInput]="constraint.get('field')">
|
79
|
<label class="uk-text-uppercase uk-text-bold uk-width-1-3 uk-text-truncate">Field:</label>
|
80
|
</div>
|
81
|
<div class="uk-width-1-1" dashboard-input type="select" placeholder="Select an operator"
|
82
|
[options]="verbs" [formInput]="constraint.get('verb')">
|
83
|
<label class="uk-text-uppercase uk-text-bold uk-width-1-3 uk-text-truncate">Operator:</label>
|
84
|
</div>
|
85
|
<div class="uk-width-1-1" dashboard-input placeholder="Write a term"
|
86
|
[formInput]="constraint.get('value')">
|
87
|
<label class="uk-text-uppercase uk-text-bold uk-width-1-3 uk-text-truncate">Term:</label>
|
88
|
</div>
|
89
|
<div class="uk-width-1-1">
|
90
|
<div class="uk-grid" uk-grid>
|
91
|
<label class="uk-text-uppercase uk-text-bold uk-width-1-3 uk-text-truncate">Match Case</label>
|
92
|
<div class="uk-width-expand">
|
93
|
<mat-slide-toggle [checked]="constraint.get('verb_suffix').value === ''"
|
94
|
[attr.uk-tooltip]="(constraint.get('verb_suffix').value === ''?('Only \'\'' + constraint.get('value').value + '\'\' matches'):
|
95
|
('Both \'\'' + constraint.get('value').value.toUpperCase() + '\'\' and \'\'' + constraint.get('value').value.toLowerCase() + '\'\' match'))"
|
96
|
(change)="caseSensitive($event, constraint)"></mat-slide-toggle>
|
97
|
</div>
|
98
|
</div>
|
99
|
</div>
|
100
|
</div>
|
101
|
</div>
|
102
|
<div *ngFor="let constraint of getConstraint(getIndex(i)).controls; let j=index"
|
103
|
[formGroupName]="j.toString()" class="uk-margin-bottom uk-visible@l">
|
104
|
<div class="uk-flex uk-flex-middle uk-grid-small" uk-grid>
|
105
|
<div class="uk-flex uk-flex-center" style="width: 50px">
|
106
|
<span *ngIf="j > 0">AND</span>
|
107
|
</div>
|
108
|
<div class="uk-width-1-4" dashboard-input type="select" placeholder="Select a field"
|
109
|
[options]="fields" [formInput]="constraint.get('field')"></div>
|
110
|
<div class="uk-width-1-4" dashboard-input type="select" placeholder="Select an operator"
|
111
|
[options]="verbs" [formInput]="constraint.get('verb')"></div>
|
112
|
<div class="uk-width-1-4" dashboard-input placeholder="Write a term"
|
113
|
[formInput]="constraint.get('value')"></div>
|
114
|
<div class="uk-width-expand">
|
115
|
<mat-slide-toggle [checked]="constraint.get('verb_suffix').value === ''" class="uk-margin-left"
|
116
|
[attr.uk-tooltip]="(constraint.get('verb_suffix').value === ''?('Only \'\'' + constraint.get('value').value + '\'\' matches'):
|
117
|
('Both \'\'' + constraint.get('value').value.toUpperCase() + '\'\' and \'\'' + constraint.get('value').value.toLowerCase() + '\'\' match'))"
|
118
|
(change)="caseSensitive($event, constraint)"></mat-slide-toggle>
|
119
|
</div>
|
120
|
<div class="uk-flex uk-flex-center">
|
121
|
<a class="uk-link-heading" (click)="removeConstraint(getIndex(i), j)">
|
122
|
<icon name="close"
|
123
|
[attr.uk-tooltip]="(getConstraint(getIndex(i)).length === 1?'By removing this constraint, the filter will be removed too':null)"></icon>
|
124
|
</a>
|
125
|
</div>
|
126
|
</div>
|
127
|
</div>
|
128
|
<div class="uk-margin-top uk-width-1-1 uk-flex uk-flex-center uk-hidden@l">
|
129
|
<a (click)="addConstraint(getIndex(i))" class="uk-flex uk-flex-middle uk-text-uppercase">
|
130
|
<button class="large uk-icon-button uk-button-secondary">
|
131
|
<icon name="add"></icon>
|
132
|
</button>
|
133
|
<button class="uk-button uk-button-link uk-margin-small-left uk-text-secondary">
|
134
|
Add Constraint
|
135
|
</button>
|
136
|
</a>
|
137
|
</div>
|
138
|
<div class="uk-flex uk-flex-middle uk-grid-small uk-visible@l" uk-grid>
|
139
|
<div style="width: 50px"></div>
|
140
|
<a (click)="addConstraint(getIndex(i))" class="uk-flex uk-flex-middle uk-text-uppercase">
|
141
|
<button class="large uk-icon-button uk-button-secondary">
|
142
|
<icon name="add"></icon>
|
143
|
</button>
|
144
|
<button class="uk-button uk-button-link uk-margin-small-left uk-text-secondary">
|
145
|
Add Constraint
|
146
|
</button>
|
147
|
</a>
|
148
|
</div>
|
149
|
</div>
|
150
|
</div>
|
151
|
</div>
|
152
|
</form>
|
153
|
<div class="uk-flex uk-flex-center uk-margin-large-bottom">
|
154
|
<a (click)="addCriteria()" class="uk-flex uk-flex-middle uk-text-uppercase"
|
155
|
uk-tooltip="<div class='uk-padding-small'>Add filter to limit research results.<br>Results which satisfy any of the selected filters will be included in your community.</div>">
|
156
|
<button class="large uk-icon-button uk-button-secondary">
|
157
|
<icon name="add"></icon>
|
158
|
</button>
|
159
|
<button class="uk-button uk-button-link uk-margin-small-left uk-text-secondary">
|
160
|
Add filter
|
161
|
</button>
|
162
|
</a>
|
163
|
</div>
|
164
|
</div>
|
165
|
<div *ngIf="loading" class="uk-position-center">
|
166
|
<loading></loading>
|
167
|
</div>
|
168
|
</div>
|
169
|
</div>
|
170
|
</div>
|