File tree Expand file tree Collapse file tree 2 files changed +20
-6
lines changed
src/Umbraco.Cms.Integrations.Search.Algolia/App_Plugins/UmbracoCms.Integrations/Search/Algolia Expand file tree Collapse file tree 2 files changed +20
-6
lines changed Original file line number Diff line number Diff line change 15
15
vm . saveIndex = saveIndex ;
16
16
vm . viewIndex = viewIndex ;
17
17
vm . buildIndex = buildIndex ;
18
- vm . search = search ;
18
+ vm . searchIndex = searchIndex ;
19
19
vm . deleteIndex = deleteIndex ;
20
+ vm . search = search ;
20
21
21
22
function init ( ) {
22
23
92
93
else {
93
94
const propertyIndex = this . contentData . find ( p => p . contentType === this . selectedContentType ) . properties . indexOf ( property . alias ) ;
94
95
if ( propertyIndex > - 1 ) this . contentData . find ( p => p . contentType === this . selectedContentType ) . properties . splice ( propertyIndex , 1 ) ;
96
+
97
+ this . properties . find ( p => p . alias == property . alias ) . checked = false ;
95
98
}
96
99
} ,
97
100
reset : function ( ) {
127
130
return false ;
128
131
}
129
132
133
+ if ( vm . manageIndex . contentData . filter ( p => p . properties . length == 0 ) . length > 0 ) {
134
+ notificationsService . error ( "Selected content types must have at least one property." ) ;
135
+ return false ;
136
+ }
137
+
130
138
vm . loading = true ;
131
139
132
140
umbracoCmsIntegrationsSearchAlgoliaResource
189
197
overlayService . open ( dialogOptions ) ;
190
198
}
191
199
192
- function search ( ) {
193
- umbracoCmsIntegrationsSearchAlgoliaResource . search ( vm . searchIndex . id , vm . searchQuery ) . then ( function ( response ) {
194
- vm . searchResults = response ;
195
- } ) ;
200
+ function searchIndex ( index ) {
201
+ vm . viewState = "search" ;
202
+ vm . searchIndex = index ;
196
203
}
197
204
198
205
function deleteIndex ( index ) {
199
206
umbracoCmsIntegrationsSearchAlgoliaResource . deleteIndex ( index . id ) . then ( function ( response ) {
200
207
getIndices ( ) ;
201
208
} ) ;
202
209
}
210
+
211
+ function search ( ) {
212
+ umbracoCmsIntegrationsSearchAlgoliaResource . search ( vm . searchIndex . id , vm . searchQuery ) . then ( function ( response ) {
213
+ vm . searchResults = response ;
214
+ } ) ;
215
+ }
203
216
}
204
217
205
218
angular . module ( "umbraco" )
Original file line number Diff line number Diff line change 51
51
</ umb-button >
52
52
< umb-button label ="search "
53
53
type ="button "
54
- button-style ="success ">
54
+ button-style ="success "
55
+ action ="vm.searchIndex(index) ">
55
56
</ umb-button >
56
57
< umb-button label ="delete "
57
58
type ="button "
You can’t perform that action at this time.
0 commit comments