Bug fixes.
- Change environment variables. - Refactor http getter. - Add custom error state matcher. - Hide create account component.
This commit is contained in:
7
src/app/_helpers/custom-error-state-matcher.spec.ts
Normal file
7
src/app/_helpers/custom-error-state-matcher.spec.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { CustomErrorStateMatcher } from './custom-error-state-matcher';
|
||||
|
||||
describe('CustomErrorStateMatcher', () => {
|
||||
it('should create an instance', () => {
|
||||
expect(new CustomErrorStateMatcher()).toBeTruthy();
|
||||
});
|
||||
});
|
||||
9
src/app/_helpers/custom-error-state-matcher.ts
Normal file
9
src/app/_helpers/custom-error-state-matcher.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import {ErrorStateMatcher} from '@angular/material/core';
|
||||
import {FormControl, FormGroupDirective, NgForm} from '@angular/forms';
|
||||
|
||||
export class CustomErrorStateMatcher implements ErrorStateMatcher{
|
||||
isErrorState(control: FormControl | null, form: FormGroupDirective | NgForm | null): boolean {
|
||||
const isSubmitted = form && form.submitted;
|
||||
return !!(control && control.invalid && (control.dirty || control.touched || isSubmitted));
|
||||
}
|
||||
}
|
||||
@@ -1,34 +1,19 @@
|
||||
// function httpGetter(): any {
|
||||
// }
|
||||
//
|
||||
// httpGetter().prototype.get = (filename: string) => new Promise((whohoo, doh) => {
|
||||
// const xhr = new XMLHttpRequest();
|
||||
// xhr.addEventListener('load', (e) => {
|
||||
// if (xhr.status === 200) {
|
||||
// whohoo(xhr.responseText);
|
||||
// return;
|
||||
// }
|
||||
// doh('failed with status ' + xhr.status + ': ' + xhr.statusText);
|
||||
// });
|
||||
// xhr.open('GET', filename);
|
||||
// xhr.send();
|
||||
// });
|
||||
//
|
||||
// class HttpGetter {
|
||||
// async get(filename: string): Promise<any> {
|
||||
// const xhr = new XMLHttpRequest();
|
||||
// xhr.addEventListener('load', (e) => {
|
||||
// if (xhr.status === 200) {
|
||||
// // whohoo(xhr.responseText);
|
||||
// return;
|
||||
// }
|
||||
// // doh('failed with status ' + xhr.status + ': ' + xhr.statusText);
|
||||
// });
|
||||
// xhr.open('GET', filename);
|
||||
// xhr.send();
|
||||
// }
|
||||
// }
|
||||
// export {
|
||||
// httpGetter,
|
||||
// HttpGetter
|
||||
// };
|
||||
|
||||
|
||||
class HttpGetter {
|
||||
async get(filename: string): Promise<any> {
|
||||
const xhr = new XMLHttpRequest();
|
||||
xhr.addEventListener('load', (e) => {
|
||||
if (xhr.status === 200) {
|
||||
console.log(xhr.responseText);
|
||||
return;
|
||||
}
|
||||
console.log('failed with status ' + xhr.status + ': ' + xhr.statusText);
|
||||
});
|
||||
xhr.open('GET', filename);
|
||||
xhr.send();
|
||||
}
|
||||
}
|
||||
export {
|
||||
HttpGetter
|
||||
};
|
||||
|
||||
@@ -2,3 +2,4 @@ export * from './mock-backend';
|
||||
export * from './array-sum';
|
||||
export * from './accountIndex';
|
||||
export * from './custom-error-state-matcher';
|
||||
export * from './http-getter';
|
||||
|
||||
@@ -3,6 +3,7 @@ import {BehaviorSubject, Observable} from 'rxjs';
|
||||
import {HttpClient, HttpParams} from '@angular/common/http';
|
||||
import {environment} from '../../environments/environment';
|
||||
import {first, map} from 'rxjs/operators';
|
||||
import {} from '../../assets/js/cic-meta/sync';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -108,4 +109,8 @@ export class UserService {
|
||||
return response;
|
||||
}));
|
||||
}
|
||||
|
||||
changeUserCredentials(): void {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ export class AppComponent implements OnInit {
|
||||
private transactionService: TransactionService,
|
||||
private blockSyncService: BlockSyncService
|
||||
) {
|
||||
// this.blockSyncService.blockSync();
|
||||
this.blockSyncService.blockSync();
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
|
||||
@@ -8,7 +8,7 @@ import {AccountDetailsComponent} from './account-details/account-details.compone
|
||||
|
||||
const routes: Routes = [
|
||||
{ path: '', component: AccountsComponent },
|
||||
{ path: 'create', component: CreateAccountComponent },
|
||||
// { path: 'create', component: CreateAccountComponent },
|
||||
{ path: 'export', component: ExportAccountsComponent },
|
||||
{ path: ':id', component: AccountDetailsComponent },
|
||||
{ path: '**', redirectTo: '', pathMatch: 'full' }
|
||||
|
||||
@@ -33,10 +33,10 @@
|
||||
<mat-option value="group">GROUPACCOUNT</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<button mat-raised-button color="primary" routerLink="/accounts/create" type="button" class="btn btn-outline-primary ml-auto">
|
||||
<mat-icon>add</mat-icon>
|
||||
ADD NEW </button>
|
||||
<button mat-raised-button color="primary" routerLink="/accounts/export" type="button" class="btn btn-outline-primary ml-2"> EXPORT </button>
|
||||
<!-- <button mat-raised-button color="primary" routerLink="/accounts/create" type="button" class="btn btn-outline-primary ml-auto">-->
|
||||
<!-- <mat-icon>add</mat-icon>-->
|
||||
<!-- ADD NEW </button>-->
|
||||
<button mat-raised-button color="primary" routerLink="/accounts/export" type="button" class="btn btn-outline-primary ml-auto"> EXPORT </button>
|
||||
</div>
|
||||
<div *ngIf="selection.selected.length" class="row card-header">
|
||||
<p><strong> {{selection.selected.length}} selected </strong></p>
|
||||
|
||||
Reference in New Issue
Block a user