feat: add groups view page (datatable-tabs) (#793)
Fixes: #776 Fixes: #777 Fixes: #791
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
/** Angular Imports */
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Resolve, ActivatedRouteSnapshot } from '@angular/router';
|
||||
|
||||
/** rxjs Imports */
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
/** Custom Services */
|
||||
import { GroupsService } from '../groups.service';
|
||||
|
||||
/**
|
||||
* Group Datatable data resolver.
|
||||
*/
|
||||
@Injectable()
|
||||
export class GroupDatatableResolver implements Resolve<Object> {
|
||||
|
||||
/**
|
||||
* @param {GroupsService} GroupsService Groups service.
|
||||
*/
|
||||
constructor(private groupsService: GroupsService) { }
|
||||
|
||||
/**
|
||||
* Returns the Group's Datatable data.
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
resolve(route: ActivatedRouteSnapshot): Observable<any> {
|
||||
const groupId = route.parent.parent.paramMap.get('groupId');
|
||||
const datatableName = route.paramMap.get('datatableName');
|
||||
return this.groupsService.getGroupDatatable(groupId, datatableName);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
/** Angular Imports */
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Resolve, ActivatedRouteSnapshot } from '@angular/router';
|
||||
|
||||
/** rxjs Imports */
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
/** Custom Services */
|
||||
import { GroupsService } from '../groups.service';
|
||||
|
||||
/**
|
||||
* Group Datatables data resolver.
|
||||
*/
|
||||
@Injectable()
|
||||
export class GroupDatatablesResolver implements Resolve<Object> {
|
||||
|
||||
/**
|
||||
* @param {GroupsService} GroupsService Groups service.
|
||||
*/
|
||||
constructor(private groupsService: GroupsService) { }
|
||||
|
||||
/**
|
||||
* Returns the Group's Datatables data.
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
resolve(): Observable<any> {
|
||||
return this.groupsService.getGroupDatatables();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user