Skip to content
Snippets Groups Projects
Commit f6506e80 authored by Hamza HRAMCHI's avatar Hamza HRAMCHI
Browse files

FEAT #16648 TIME 0:10 refresh docs list after indexation

parent e47cf1ec
No related branches found
No related tags found
No related merge requests found
...@@ -178,7 +178,9 @@ export class IndexationComponent implements OnInit { ...@@ -178,7 +178,9 @@ export class IndexationComponent implements OnInit {
const objTosend = this.formatData(data.note); const objTosend = this.formatData(data.note);
for (let index = 0; index < objTosend.length; index++) { for (let index = 0; index < objTosend.length; index++) {
await this.saveDocument(objTosend[index], index); await this.saveDocument(objTosend[index], index);
this.actionsService.setEvent(objTosend[0].workflow); if (objTosend[0].workflow[0].userId === this.authService.user.id) {
this.actionsService.setEvent('refreshList');
}
} }
load.dismiss(); load.dismiss();
if (this.errors.length === 0) { if (this.errors.length === 0) {
......
...@@ -28,7 +28,6 @@ export class SidebarComponent implements OnInit, AfterViewInit { ...@@ -28,7 +28,6 @@ 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();
...@@ -56,11 +55,10 @@ export class SidebarComponent implements OnInit, AfterViewInit { ...@@ -56,11 +55,10 @@ export class SidebarComponent implements OnInit, AfterViewInit {
this.loadingList = false; this.loadingList = false;
}); });
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); if (result === 'refreshList') {
mode = [... new Set(mode)].toString(); this.filter('');
this.indexed = true; }
this.filter(mode);
}); });
} }
...@@ -122,11 +120,7 @@ export class SidebarComponent implements OnInit, AfterViewInit { ...@@ -122,11 +120,7 @@ export class SidebarComponent implements OnInit, AfterViewInit {
} }
this.loadingList = true; this.loadingList = true;
if (this.indexed) { this.signaturesService.mode === mode ? this.signaturesService.mode = '' : this.signaturesService.mode = mode;
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(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment