Compliance done field added to hearings.
Also the compliance list is not based on it and not the compliance date.
This commit is contained in:
@ -4,3 +4,12 @@
|
||||
.right-align {
|
||||
text-align: right;
|
||||
}
|
||||
.checkbox-align {
|
||||
align-self: center;
|
||||
}
|
||||
.not-complied {
|
||||
background-color: #f8cbad;
|
||||
}
|
||||
.complied {
|
||||
background-color: #c6e0b4;
|
||||
}
|
||||
|
||||
@ -417,6 +417,20 @@
|
||||
autocomplete="off"
|
||||
/>
|
||||
</mat-form-field>
|
||||
<mat-form-field fxFlex>
|
||||
<mat-label>Next Hearing Date</mat-label>
|
||||
<input
|
||||
matInput
|
||||
[matDatepicker]="nextHearingDate"
|
||||
placeholder="Next Hearing Date"
|
||||
formControlName="nextHearingDate"
|
||||
autocomplete="off"
|
||||
#nextHearingDateElement
|
||||
(focus)="nextHearingDateElement.select()"
|
||||
/>
|
||||
<mat-datepicker-toggle matSuffix [for]="nextHearingDate"></mat-datepicker-toggle>
|
||||
<mat-datepicker #nextHearingDate></mat-datepicker>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div
|
||||
fxLayout="row"
|
||||
@ -488,20 +502,9 @@
|
||||
<mat-datepicker-toggle matSuffix [for]="complianceDate"></mat-datepicker-toggle>
|
||||
<mat-datepicker #complianceDate></mat-datepicker>
|
||||
</mat-form-field>
|
||||
<mat-form-field fxFlex="40%">
|
||||
<mat-label>Next Hearing Date</mat-label>
|
||||
<input
|
||||
matInput
|
||||
[matDatepicker]="nextHearingDate"
|
||||
placeholder="Next Hearing Date"
|
||||
formControlName="nextHearingDate"
|
||||
autocomplete="off"
|
||||
#nextHearingDateElement
|
||||
(focus)="nextHearingDateElement.select()"
|
||||
/>
|
||||
<mat-datepicker-toggle matSuffix [for]="nextHearingDate"></mat-datepicker-toggle>
|
||||
<mat-datepicker #nextHearingDate></mat-datepicker>
|
||||
</mat-form-field>
|
||||
<mat-checkbox formControlName="complianceDone" class="checkbox-align" fxFlex="40%"
|
||||
>Compliance Done?</mat-checkbox
|
||||
>
|
||||
<button mat-raised-button color="primary" (click)="addHearing()" fxFlex="20%">Add</button>
|
||||
</div>
|
||||
<mat-table #table [dataSource]="dataSource" matSort aria-label="Elements">
|
||||
@ -555,7 +558,11 @@
|
||||
</ng-container>
|
||||
|
||||
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
||||
<mat-row *matRowDef="let row; columns: displayedColumns"></mat-row>
|
||||
<mat-row
|
||||
*matRowDef="let row; columns: displayedColumns"
|
||||
[class.complied]="row.complianceDate && row.complianceDone"
|
||||
[class.not-complied]="row.complianceDate && !row.complianceDone"
|
||||
></mat-row>
|
||||
</mat-table>
|
||||
</mat-card-content>
|
||||
<mat-card-actions>
|
||||
|
||||
@ -102,6 +102,7 @@ export class CaseDetailComponent implements OnInit, AfterViewInit {
|
||||
latestStatus: '',
|
||||
proceedings: '',
|
||||
complianceDate: '',
|
||||
complianceDone: '',
|
||||
nextHearingDate: '',
|
||||
}),
|
||||
});
|
||||
@ -360,6 +361,7 @@ export class CaseDetailComponent implements OnInit, AfterViewInit {
|
||||
const complianceDate = formValue.complianceDate
|
||||
? moment(formValue.complianceDate).format('DD-MMM-YYYY')
|
||||
: null;
|
||||
const complianceDone = formValue.complianceDone;
|
||||
const nextHearingDate = formValue.nextHearingDate
|
||||
? moment(formValue.nextHearingDate).format('DD-MMM-YYYY')
|
||||
: null;
|
||||
@ -372,6 +374,7 @@ export class CaseDetailComponent implements OnInit, AfterViewInit {
|
||||
courtStatus: latestStatus,
|
||||
proceedings,
|
||||
complianceDate,
|
||||
complianceDone,
|
||||
nextHearingDate,
|
||||
}),
|
||||
);
|
||||
@ -387,6 +390,7 @@ export class CaseDetailComponent implements OnInit, AfterViewInit {
|
||||
courtStatus: '',
|
||||
proceedings: '',
|
||||
complianceDate: '',
|
||||
complianceDone: '',
|
||||
nextHearingDate: '',
|
||||
});
|
||||
}
|
||||
|
||||
@ -28,6 +28,20 @@
|
||||
autocomplete="off"
|
||||
/>
|
||||
</mat-form-field>
|
||||
<mat-form-field fxFlex>
|
||||
<mat-label>Next Hearing Date</mat-label>
|
||||
<input
|
||||
matInput
|
||||
[matDatepicker]="nextHearingDate"
|
||||
placeholder="Next Hearing Date"
|
||||
formControlName="nextHearingDate"
|
||||
autocomplete="off"
|
||||
#nextHearingDateElement
|
||||
(focus)="nextHearingDateElement.select()"
|
||||
/>
|
||||
<mat-datepicker-toggle matSuffix [for]="nextHearingDate"></mat-datepicker-toggle>
|
||||
<mat-datepicker #nextHearingDate></mat-datepicker>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div
|
||||
fxLayout="row"
|
||||
@ -83,7 +97,7 @@
|
||||
fxLayoutGap="20px"
|
||||
fxLayoutGap.lt-md="0px"
|
||||
>
|
||||
<mat-form-field fxFlex="40%">
|
||||
<mat-form-field fxFlex>
|
||||
<mat-label>Compliance Date</mat-label>
|
||||
<input
|
||||
matInput
|
||||
@ -97,20 +111,9 @@
|
||||
<mat-datepicker-toggle matSuffix [for]="complianceDate"></mat-datepicker-toggle>
|
||||
<mat-datepicker #complianceDate></mat-datepicker>
|
||||
</mat-form-field>
|
||||
<mat-form-field fxFlex="40%">
|
||||
<mat-label>Next Hearing Date</mat-label>
|
||||
<input
|
||||
matInput
|
||||
[matDatepicker]="nextHearingDate"
|
||||
placeholder="Next Hearing Date"
|
||||
formControlName="nextHearingDate"
|
||||
autocomplete="off"
|
||||
#nextHearingDateElement
|
||||
(focus)="nextHearingDateElement.select()"
|
||||
/>
|
||||
<mat-datepicker-toggle matSuffix [for]="nextHearingDate"></mat-datepicker-toggle>
|
||||
<mat-datepicker #nextHearingDate></mat-datepicker>
|
||||
</mat-form-field>
|
||||
<mat-checkbox formControlName="complianceDone" class="checkbox-align" fxFlex
|
||||
>Compliance Done?</mat-checkbox
|
||||
>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@ -26,6 +26,7 @@ export class HearingDialogComponent implements OnInit {
|
||||
latestStatus: '',
|
||||
proceedings: '',
|
||||
complianceDate: '',
|
||||
complianceDone: '',
|
||||
nextHearingDate: '',
|
||||
});
|
||||
}
|
||||
@ -40,6 +41,7 @@ export class HearingDialogComponent implements OnInit {
|
||||
complianceDate: this.data.hearing.complianceDate
|
||||
? moment(this.data.hearing.complianceDate, 'DD-MMM-YYYY').toDate()
|
||||
: '',
|
||||
complianceDone: this.data.hearing.complianceDone,
|
||||
nextHearingDate: this.data.hearing.nextHearingDate
|
||||
? moment(this.data.hearing.nextHearingDate, 'DD-MMM-YYYY').toDate()
|
||||
: '',
|
||||
@ -61,6 +63,7 @@ export class HearingDialogComponent implements OnInit {
|
||||
this.data.hearing.complianceDate = formValue.complianceDate
|
||||
? moment(formValue.complianceDate).format('DD-MMM-YYYY')
|
||||
: null;
|
||||
this.data.hearing.complianceDone = formValue.complianceDone;
|
||||
this.data.hearing.nextHearingDate = formValue.nextHearingDate
|
||||
? moment(formValue.nextHearingDate).format('DD-MMM-YYYY')
|
||||
: null;
|
||||
|
||||
@ -6,6 +6,7 @@ import { ReactiveFormsModule } from '@angular/forms';
|
||||
import { MomentDateAdapter } from '@angular/material-moment-adapter';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
import { MatCheckboxModule } from '@angular/material/checkbox';
|
||||
import {
|
||||
DateAdapter,
|
||||
MAT_DATE_FORMATS,
|
||||
@ -55,6 +56,7 @@ export const MY_FORMATS = {
|
||||
MatPaginatorModule,
|
||||
MatDatepickerModule,
|
||||
MatDialogModule,
|
||||
MatCheckboxModule,
|
||||
],
|
||||
declarations: [CaseListComponent, CaseDetailComponent, HearingDialogComponent],
|
||||
providers: [
|
||||
|
||||
@ -4,15 +4,15 @@ import { MatPaginator, PageEvent } from '@angular/material/paginator';
|
||||
import { merge, Observable, of as observableOf } from 'rxjs';
|
||||
import { map, tap } from 'rxjs/operators';
|
||||
|
||||
import { ComplianceListItem } from './compliance-list-item';
|
||||
import { ComplianceList } from './compliance-list';
|
||||
|
||||
export class ComplianceListDatasource extends DataSource<ComplianceListItem> {
|
||||
constructor(public data: ComplianceListItem[], private paginator?: MatPaginator) {
|
||||
export class ComplianceListDatasource extends DataSource<ComplianceList> {
|
||||
constructor(public data: ComplianceList[], private paginator?: MatPaginator) {
|
||||
super();
|
||||
}
|
||||
|
||||
connect(): Observable<ComplianceListItem[]> {
|
||||
const dataMutations: (Observable<ComplianceListItem[]> | EventEmitter<PageEvent>)[] = [
|
||||
connect(): Observable<ComplianceList[]> {
|
||||
const dataMutations: (Observable<ComplianceList[]> | EventEmitter<PageEvent>)[] = [
|
||||
observableOf(this.data),
|
||||
];
|
||||
if (this.paginator) {
|
||||
@ -21,18 +21,18 @@ export class ComplianceListDatasource extends DataSource<ComplianceListItem> {
|
||||
|
||||
return merge(...dataMutations)
|
||||
.pipe(
|
||||
tap((x: ComplianceListItem[]) => {
|
||||
tap((x: ComplianceList[]) => {
|
||||
if (this.paginator) {
|
||||
this.paginator.length = x.length;
|
||||
}
|
||||
}),
|
||||
)
|
||||
.pipe(map((x: ComplianceListItem[]) => this.getPagedData(this.data)));
|
||||
.pipe(map((x: ComplianceList[]) => this.getPagedData(this.data)));
|
||||
}
|
||||
|
||||
disconnect() {}
|
||||
|
||||
private getPagedData(data: ComplianceListItem[]) {
|
||||
private getPagedData(data: ComplianceList[]) {
|
||||
if (this.paginator === undefined) {
|
||||
return data;
|
||||
}
|
||||
|
||||
@ -1,20 +0,0 @@
|
||||
export class ComplianceListItem {
|
||||
id: string;
|
||||
officeFileNumber: string;
|
||||
courtNumber: string;
|
||||
itemNumber: string;
|
||||
title: string;
|
||||
proceedings: string;
|
||||
complianceDate: string;
|
||||
|
||||
public constructor(init?: Partial<ComplianceListItem>) {
|
||||
this.id = '';
|
||||
this.officeFileNumber = '';
|
||||
this.courtNumber = '';
|
||||
this.itemNumber = '';
|
||||
this.title = '';
|
||||
this.proceedings = '';
|
||||
this.complianceDate = '';
|
||||
Object.assign(this, init);
|
||||
}
|
||||
}
|
||||
@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ActivatedRouteSnapshot, Resolve } from '@angular/router';
|
||||
import { Resolve } from '@angular/router';
|
||||
import { Observable } from 'rxjs/internal/Observable';
|
||||
|
||||
import { ComplianceList } from './compliance-list';
|
||||
@ -11,8 +11,7 @@ import { ComplianceListService } from './compliance-list.service';
|
||||
export class ComplianceListResolver implements Resolve<ComplianceList> {
|
||||
constructor(private ser: ComplianceListService) {}
|
||||
|
||||
resolve(route: ActivatedRouteSnapshot): Observable<ComplianceList> {
|
||||
const date = route.queryParamMap.get('date') || null;
|
||||
return this.ser.list(date);
|
||||
resolve(): Observable<ComplianceList> {
|
||||
return this.ser.list();
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,29 +3,6 @@
|
||||
<mat-card-title>Compliances</mat-card-title>
|
||||
</mat-card-title-group>
|
||||
<mat-card-content>
|
||||
<form [formGroup]="form" fxLayout="column">
|
||||
<div
|
||||
fxLayout="row"
|
||||
fxLayout.lt-md="column"
|
||||
fxLayoutGap="20px"
|
||||
fxLayoutGap.lt-md="0px"
|
||||
fxLayoutAlign="space-around start"
|
||||
>
|
||||
<mat-form-field fxFlex="60%">
|
||||
<input
|
||||
matInput
|
||||
[matDatepicker]="date"
|
||||
(focus)="date.open()"
|
||||
placeholder="Date"
|
||||
formControlName="date"
|
||||
autocomplete="off"
|
||||
/>
|
||||
<mat-datepicker-toggle matSuffix [for]="date"></mat-datepicker-toggle>
|
||||
<mat-datepicker #date></mat-datepicker>
|
||||
</mat-form-field>
|
||||
<button mat-raised-button color="primary" (click)="show()" fxFlex="40%">Show</button>
|
||||
</div>
|
||||
</form>
|
||||
<mat-table #table [dataSource]="dataSource" aria-label="Elements">
|
||||
<!-- Office File Number Column -->
|
||||
<ng-container matColumnDef="officeFileNumber">
|
||||
|
||||
@ -14,45 +14,19 @@ import { ComplianceListDatasource } from './compliance-list-datasource';
|
||||
})
|
||||
export class ComplianceListComponent implements OnInit {
|
||||
@ViewChild(MatPaginator, { static: true }) paginator?: MatPaginator;
|
||||
form: FormGroup;
|
||||
info: ComplianceList = new ComplianceList();
|
||||
dataSource: ComplianceListDatasource = new ComplianceListDatasource(this.info.items);
|
||||
info: ComplianceList[] = [];
|
||||
dataSource: ComplianceListDatasource = new ComplianceListDatasource(this.info);
|
||||
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
|
||||
displayedColumns = ['officeFileNumber', 'title', 'proceedings', 'complianceDate'];
|
||||
|
||||
constructor(private route: ActivatedRoute, private router: Router, private fb: FormBuilder) {
|
||||
// Create form
|
||||
this.form = this.fb.group({
|
||||
date: '',
|
||||
});
|
||||
}
|
||||
constructor(private route: ActivatedRoute) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.route.data.subscribe((value) => {
|
||||
const data = value as { info: ComplianceList };
|
||||
const data = value as { info: ComplianceList[] };
|
||||
|
||||
this.info = data.info;
|
||||
this.form.setValue({
|
||||
date: moment(this.info.date, 'DD-MMM-YYYY').toDate(),
|
||||
});
|
||||
this.dataSource = new ComplianceListDatasource(this.info.items, this.paginator);
|
||||
});
|
||||
}
|
||||
|
||||
show() {
|
||||
const info = this.getInfo();
|
||||
this.router.navigate(['compliance-list'], {
|
||||
queryParams: {
|
||||
date: info.date,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
getInfo(): ComplianceList {
|
||||
const formModel = this.form.value;
|
||||
|
||||
return new ComplianceList({
|
||||
date: moment(formModel.date).format('DD-MMM-YYYY'),
|
||||
this.dataSource = new ComplianceListDatasource(this.info, this.paginator);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,23 +2,12 @@ import { CdkTableModule } from '@angular/cdk/table';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { FlexLayoutModule } from '@angular/flex-layout';
|
||||
import { ReactiveFormsModule } from '@angular/forms';
|
||||
import { MomentDateAdapter } from '@angular/material-moment-adapter';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
import {
|
||||
DateAdapter,
|
||||
MAT_DATE_FORMATS,
|
||||
MAT_DATE_LOCALE,
|
||||
MatNativeDateModule,
|
||||
} from '@angular/material/core';
|
||||
import { MatDatepickerModule } from '@angular/material/datepicker';
|
||||
import { MatDialogModule } from '@angular/material/dialog';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatInputModule } from '@angular/material/input';
|
||||
import { MatPaginatorModule } from '@angular/material/paginator';
|
||||
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
||||
import { MatSelectModule } from '@angular/material/select';
|
||||
import { MatTableModule } from '@angular/material/table';
|
||||
|
||||
import { ComplianceListRoutingModule } from './compliance-list-routing.module';
|
||||
@ -47,17 +36,9 @@ export const MY_FORMATS = {
|
||||
MatInputModule,
|
||||
MatProgressSpinnerModule,
|
||||
MatTableModule,
|
||||
ReactiveFormsModule,
|
||||
ComplianceListRoutingModule,
|
||||
MatSelectModule,
|
||||
MatPaginatorModule,
|
||||
MatDatepickerModule,
|
||||
MatDialogModule,
|
||||
],
|
||||
declarations: [ComplianceListComponent],
|
||||
providers: [
|
||||
{ provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE] },
|
||||
{ provide: MAT_DATE_FORMATS, useValue: MY_FORMATS },
|
||||
],
|
||||
})
|
||||
export class ComplianceListModule {}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { HttpClient, HttpParams } from '@angular/common/http';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs/internal/Observable';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
@ -16,13 +16,9 @@ const serviceName = 'ComplianceListService';
|
||||
export class ComplianceListService {
|
||||
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
|
||||
|
||||
list(date: string | null): Observable<ComplianceList> {
|
||||
const options = { params: new HttpParams() };
|
||||
if (date !== null) {
|
||||
options.params = options.params.set('d', date);
|
||||
}
|
||||
list(): Observable<ComplianceList> {
|
||||
return this.http
|
||||
.get<ComplianceList>(url, options)
|
||||
.get<ComplianceList>(url)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'list'))) as Observable<ComplianceList>;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,12 +1,20 @@
|
||||
import { ComplianceListItem } from './compliance-list-item';
|
||||
|
||||
export class ComplianceList {
|
||||
date: string;
|
||||
items: ComplianceListItem[];
|
||||
id: string;
|
||||
officeFileNumber: string;
|
||||
courtNumber: string;
|
||||
itemNumber: string;
|
||||
title: string;
|
||||
proceedings: string;
|
||||
complianceDate: string;
|
||||
|
||||
public constructor(init?: Partial<ComplianceList>) {
|
||||
this.date = '';
|
||||
this.items = [];
|
||||
this.id = '';
|
||||
this.officeFileNumber = '';
|
||||
this.courtNumber = '';
|
||||
this.itemNumber = '';
|
||||
this.title = '';
|
||||
this.proceedings = '';
|
||||
this.complianceDate = '';
|
||||
Object.assign(this, init);
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,6 +8,7 @@ export class Hearing {
|
||||
courtStatus: CourtStatus;
|
||||
proceedings: string;
|
||||
complianceDate: string | null;
|
||||
complianceDone: boolean;
|
||||
nextHearingDate: string | null;
|
||||
|
||||
public constructor(init?: Partial<Hearing>) {
|
||||
@ -18,6 +19,7 @@ export class Hearing {
|
||||
this.courtStatus = new CourtStatus();
|
||||
this.proceedings = '';
|
||||
this.complianceDate = null;
|
||||
this.complianceDone = true;
|
||||
this.nextHearingDate = null;
|
||||
Object.assign(this, init);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user