feat: add view adhoc query component (#548)

Fixes: #538
This commit is contained in:
Rishabh Verma
2020-01-06 07:07:16 +05:30
committed by Jivjyot Singh
parent df12a6b4ba
commit 24dd42ec37
9 changed files with 231 additions and 1 deletions
@@ -0,0 +1,31 @@
/** Angular Imports */
import { Injectable } from '@angular/core';
import { Resolve, ActivatedRouteSnapshot } from '@angular/router';
/** rxjs Imports */
import { Observable } from 'rxjs';
/** Custom Services */
import { OrganizationService } from 'app/organization/organization.service';
/**
* Adhoc Query data resolver.
*/
@Injectable()
export class AdhocQueryResolver implements Resolve<Object> {
/**
* @param {OrganizationService} organizationService Organization service.
*/
constructor(private organizationService: OrganizationService) {}
/**
* Returns the adhoc query data.
* @returns {Observable<any>}
*/
resolve(route: ActivatedRouteSnapshot): Observable<any> {
const adhocQueryId = route.paramMap.get('id');
return this.organizationService.getAdhocQuery(adhocQueryId);
}
}