Skip to content
Snippets Groups Projects
Verified Commit f2ea113c authored by Damien's avatar Damien
Browse files

FEAT #13405 TIME 0:15 Get admin shortcuts numbers

parent 8674bca5
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,7 @@
</java>
<onlyoffice>
<enabled>true</enabled>
<server_uri>onlyoffice.maarchcourrier.com</server_uri>
<server_uri>onlyoffice.local.maarch</server_uri>
<server_port>80</server_port>
<server_ssl>false</server_ssl>
</onlyoffice>
......
......@@ -11,6 +11,7 @@ import { FormControl } from '@angular/forms';
import { startWith, map, tap, catchError, exhaustMap } from 'rxjs/operators';
import { LatinisePipe } from 'ngx-pipes';
import { NotificationService } from '../../notification.service';
import {FunctionsService} from "../../../service/functions.service";
@Component({
templateUrl: "administration.component.html",
......@@ -43,7 +44,8 @@ export class AdministrationComponent implements OnInit {
public appService: AppService,
private privilegeService: PrivilegeService,
private latinisePipe: LatinisePipe,
private notify: NotificationService) { }
private notify: NotificationService,
private functionService: FunctionsService) { }
ngOnInit(): void {
this.headerService.setHeader(this.lang.administration);
......@@ -97,17 +99,17 @@ export class AdministrationComponent implements OnInit {
}
getNbShortcuts() {
this.http.get('../../rest/users').pipe(
this.http.get('../../rest/administration/details').pipe(
tap((data: any) => {
this.shortcutsAdmin.filter(admin => admin.id === 'admin_users')[0].count = data.users.length;
}),
exhaustMap(() => this.http.get('../../rest/groups')),
tap((data: any) => {
this.shortcutsAdmin.filter(admin => admin.id === 'admin_groups')[0].count = data.groups.length;
}),
exhaustMap(() => this.http.get('../../rest/entities')),
tap((data: any) => {
this.shortcutsAdmin.filter(admin => admin.id === 'manage_entities')[0].count = data.entities.length;
if (!this.functionService.empty(data.count.users)) {
this.shortcutsAdmin.filter(admin => admin.id === 'admin_users')[0].count = data.count.users;
}
if (!this.functionService.empty(data.count.groups)) {
this.shortcutsAdmin.filter(admin => admin.id === 'admin_groups')[0].count = data.count.groups;
}
if (!this.functionService.empty(data.count.entities)) {
this.shortcutsAdmin.filter(admin => admin.id === 'manage_entities')[0].count = data.count.entities;
}
}),
catchError((err: any) => {
this.notify.handleSoftErrors(err);
......
......@@ -433,9 +433,7 @@ export class DocumentViewerComponent implements OnInit {
const objFile = JSON.parse(JSON.stringify(this.file));
objFile.content = objFile.contentMode === 'route' ? null : objFile.content;
const myObservable = of(objFile);
return myObservable;
return of(objFile);
}
}
......
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