FEAT #16648 TIME 0:10 display the docs of the mode concerned after indexing
... | @@ -28,6 +28,7 @@ export class SidebarComponent implements OnInit, AfterViewInit { | ... | @@ -28,6 +28,7 @@ export class SidebarComponent implements OnInit, AfterViewInit { |
loadingList: boolean = false; | loadingList: boolean = false; | ||
searchMode: boolean = false; | searchMode: boolean = false; | ||
indexed: boolean = false; | |||
searchTerm: FormControl = new FormControl(); | searchTerm: FormControl = new FormControl(); | ||
... | @@ -58,8 +59,8 @@ export class SidebarComponent implements OnInit, AfterViewInit { | ... | @@ -58,8 +59,8 @@ export class SidebarComponent implements OnInit, AfterViewInit { |
this.subscription = this.actionsService.catchEvent().subscribe((result: any[]) => { | this.subscription = this.actionsService.catchEvent().subscribe((result: any[]) => { | ||
let mode: any = result.filter((item: any) => item.userId === this.authService.user.id).map((el: any) => el.mode); | let mode: any = result.filter((item: any) => item.userId === this.authService.user.id).map((el: any) => el.mode); | ||
mode = [... new Set(mode)].toString(); | mode = [... new Set(mode)].toString(); | ||
this.indexed = true; | |||
|
|||
this.filter(mode); | this.filter(mode); | ||
this.signaturesService.mode = mode; | |||
}); | }); | ||
} | } | ||
... | @@ -121,7 +122,11 @@ export class SidebarComponent implements OnInit, AfterViewInit { | ... | @@ -121,7 +122,11 @@ export class SidebarComponent implements OnInit, AfterViewInit { |
} | } | ||
this.loadingList = true; | this.loadingList = true; | ||
this.signaturesService.mode === mode ? this.signaturesService.mode = '' : this.signaturesService.mode = mode; | if (this.indexed) { | ||
this.signaturesService.mode = mode; | |||
} else { | |||
this.signaturesService.mode === mode ? this.signaturesService.mode = '' : this.signaturesService.mode = mode; | |||
} | |||
this.filterService.offset = 0; | this.filterService.offset = 0; | ||
this.http.get('../rest/documents?limit=' + this.filterService.limit + '&offset=' + this.filterService.offset + '&mode=' + this.signaturesService.mode) | this.http.get('../rest/documents?limit=' + this.filterService.limit + '&offset=' + this.filterService.offset + '&mode=' + this.signaturesService.mode) | ||
.pipe( | .pipe( | ||
... | ... |