Strict done!!
This commit is contained in:
1 parent
af343cb7f9
commit
afe746ecdc
142 files changed
+1258
-907
No files matched your search
@@ -16,7 +16,7 @@ import { ClientService } from '../client.service';
|
||||
export class ClientDetailComponent implements OnInit, AfterViewInit {
|
||||
@ViewChild('nameElement', { static: true }) nameElement?: ElementRef;
|
||||
form: FormGroup;
|
||||
item: Client;
|
||||
item: Client = new Client();
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
@@ -54,7 +54,7 @@ export class ClientDetailComponent implements OnInit, AfterViewInit {
|
||||
|
||||
ngAfterViewInit() {
|
||||
setTimeout(() => {
|
||||
this.nameElement.nativeElement.focus();
|
||||
if (this.nameElement) this.nameElement.nativeElement.focus();
|
||||
}, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@ import { ClientListDataSource } from './client-list-datasource';
|
||||
export class ClientListComponent implements OnInit {
|
||||
@ViewChild(MatPaginator, { static: true }) paginator?: MatPaginator;
|
||||
@ViewChild(MatSort, { static: true }) sort?: MatSort;
|
||||
dataSource: ClientListDataSource;
|
||||
list: Client[];
|
||||
list: Client[] = [];
|
||||
dataSource: ClientListDataSource = new ClientListDataSource(this.list);
|
||||
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
|
||||
displayedColumns = ['code', 'name', 'enabled', 'otp', 'created', 'lastLogin'];
|
||||
|
||||
@@ -28,6 +28,6 @@ export class ClientListComponent implements OnInit {
|
||||
|
||||
this.list = data.list;
|
||||
});
|
||||
this.dataSource = new ClientListDataSource(this.paginator, this.sort, this.list);
|
||||
this.dataSource = new ClientListDataSource(this.list, this.paginator, this.sort);
|
||||
}
|
||||
}
|
||||
@@ -19,7 +19,7 @@ const serviceName = 'ClientService';
|
||||
export class ClientService {
|
||||
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
|
||||
|
||||
get(id: string): Observable<Client> {
|
||||
get(id: string | null): Observable<Client> {
|
||||
const getUrl: string = id === null ? url : `${url}/${id}`;
|
||||
return <Observable<Client>>(
|
||||
this.http
|
||||
|
||||
@@ -6,4 +6,15 @@ export class Client {
|
||||
otp: number;
|
||||
creationDate: string;
|
||||
lastLogin: string;
|
||||
|
||||
public constructor(init?: Partial<Client>) {
|
||||
this.id = '';
|
||||
this.name = '';
|
||||
this.code = 0;
|
||||
this.enabled = true;
|
||||
this.otp = 0;
|
||||
this.creationDate = '';
|
||||
this.lastLogin = '';
|
||||
Object.assign(this, init);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user