feat: add edit adhoc query component (#1065)

Fixes: #752
This commit is contained in:
Karan Takalkar
2020-07-12 16:37:39 +05:30
committed by GitHub
parent 3be568b20e
commit 8bec54dfbd
11 changed files with 283 additions and 9 deletions
@@ -0,0 +1,30 @@
/** Angular Imports */
import { Injectable } from '@angular/core';
import { Resolve } from '@angular/router';
/** rxjs Imports */
import { Observable } from 'rxjs';
/** Custom Services */
import { OrganizationService } from '../../organization.service';
/**
* Adhoc Queries data resolver.
*/
@Injectable()
export class AdhocQueriesResolver implements Resolve<Object> {
/**
* @param {OrganizationService} organizationService Organization service.
*/
constructor(private organizationService: OrganizationService) {}
/**
* Returns the adhoc queries data.
* @returns {Observable<any>}
*/
resolve(): Observable<any> {
return this.organizationService.getAdhocQueries();
}
}
@@ -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 and template data resolver.
*/
@Injectable()
export class AdhocQueryAndTemplateResolver implements Resolve<Object> {
/**
* @param {OrganizationService} organizationService Organization service.
*/
constructor(private organizationService: OrganizationService) {}
/**
* Returns the adhoc query and template data.
* @returns {Observable<any>}
*/
resolve(route: ActivatedRouteSnapshot): Observable<any> {
const adhocQueryId = route.paramMap.get('id');
return this.organizationService.getAdhocQueryAndTemplate(adhocQueryId);
}
}
@@ -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);
}
}