Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save vijayksingh/5f0f148414e8e99962dd9be1b46c6349 to your computer and use it in GitHub Desktop.
Save vijayksingh/5f0f148414e8e99962dd9be1b46c6349 to your computer and use it in GitHub Desktop.
import { Component, OnInit, ChangeDetectionStrategy, Input } from '@angular/core';
import { BaseGraphqlService } from '@otalio/modules';
import { DatePipe } from '@angular/common';
import { MaintenenceRequestsApiService, MaintenenceRequestDto } from '@otalio/api';
import { ServiceItemsTreeStructureService } from '../../services/service-items-tree-structure.service';
import { Observable } from 'rxjs';
import { MenuTreeItem } from '@otalio/components';
import { ServiceRequestsTreeSelected } from '../service-requests-tree/entities/service-requests-tree-selected';
@Component({
selector: 'otalio-service-request-maintenance-tree',
changeDetection: ChangeDetectionStrategy.OnPush,
viewProviders: [DatePipe],
template: `
<otalio-menu-tree-list
[selected]="selectedSubject | async"
[primaryItems]="primaryItemsSubject | async"
[secondaryItemsMap]="secondaryItemsMapSubject | async"
(selectEvent)="onSelect($event)"
></otalio-menu-tree-list>
`,
})
export class ServiceRequestMaintenanceTreeComponent implements OnInit {
@Input() set selected(selected: ServiceRequestsTreeSelected) {
if (selected) {
this.setSelected(selected);
}
}
maintenanceItemSubject: Observable<MenuTreeItem[]>;
ngOnInit(): void {
this.initListeners();
}
private initListeners(): void {
this.maintenanceItemSubject = this.serviceItemsTreeStructureService.listenMaintenanceServiceItemChange();
}
private load(reqIds: string): void {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment