build: Use prettier for typescript
Stop ignoring .ts files in prettier and fix existing issues.
This commit is contained in:
@@ -8,9 +8,8 @@ describe('NotificationsPageComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ NotificationsPageComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [NotificationsPageComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
@@ -14,11 +14,13 @@ import { ActivatedRoute } from '@angular/router';
|
||||
styleUrls: ['./notifications-page.component.scss']
|
||||
})
|
||||
export class NotificationsPageComponent implements OnInit {
|
||||
|
||||
/** Notifications data. */
|
||||
notificationsData: any;
|
||||
/** Columns to be displayed in notifications table. */
|
||||
displayedColumns: string[] = ['notification', 'createdAt'];
|
||||
displayedColumns: string[] = [
|
||||
'notification',
|
||||
'createdAt'
|
||||
];
|
||||
/** Data source for notifications table. */
|
||||
dataSource: MatTableDataSource<any>;
|
||||
|
||||
@@ -27,16 +29,16 @@ export class NotificationsPageComponent implements OnInit {
|
||||
* Shares, Savings, Deposits, Loans routes inaccessible because of dependency on entity ID.
|
||||
*/
|
||||
routeMap: any = {
|
||||
'client' : '/clients/',
|
||||
'group' : '/groups/',
|
||||
'loan': '/loans-accounts/',
|
||||
'center' : '/centers/',
|
||||
'shareAccount' : '/shares-accounts/',
|
||||
'fixedDeposit' : '/fixed-deposits-accounts/',
|
||||
'recurringDepositAccount': '/recurring-deposits-accounts/',
|
||||
'savingsAccount' : '/savings-accounts/',
|
||||
'shareProduct': '/products/share-products/',
|
||||
'loanProduct' : '/products/loan-products/'
|
||||
client: '/clients/',
|
||||
group: '/groups/',
|
||||
loan: '/loans-accounts/',
|
||||
center: '/centers/',
|
||||
shareAccount: '/shares-accounts/',
|
||||
fixedDeposit: '/fixed-deposits-accounts/',
|
||||
recurringDepositAccount: '/recurring-deposits-accounts/',
|
||||
savingsAccount: '/savings-accounts/',
|
||||
shareProduct: '/products/share-products/',
|
||||
loanProduct: '/products/loan-products/'
|
||||
};
|
||||
|
||||
/** Paginator for notifications table. */
|
||||
@@ -49,7 +51,7 @@ export class NotificationsPageComponent implements OnInit {
|
||||
* @param {ActivatedRoute} route Activated Route.
|
||||
*/
|
||||
constructor(private route: ActivatedRoute) {
|
||||
this.route.data.subscribe(( data: { notifications: any }) => {
|
||||
this.route.data.subscribe((data: { notifications: any }) => {
|
||||
this.notificationsData = data.notifications.pageItems;
|
||||
});
|
||||
}
|
||||
@@ -69,5 +71,4 @@ export class NotificationsPageComponent implements OnInit {
|
||||
this.dataSource.paginator = this.paginator;
|
||||
this.dataSource.sort = this.sort;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ const routes: Routes = [
|
||||
}
|
||||
}
|
||||
])
|
||||
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
@@ -30,4 +31,4 @@ const routes: Routes = [
|
||||
providers: [NotificationsResolver],
|
||||
exports: [RouterModule]
|
||||
})
|
||||
export class NotificationsRoutingModule { }
|
||||
export class NotificationsRoutingModule {}
|
||||
|
||||
@@ -22,4 +22,4 @@ import { NotificationsPageComponent } from './notifications-page/notifications-p
|
||||
NotificationsRoutingModule
|
||||
]
|
||||
})
|
||||
export class NotificationsModule { }
|
||||
export class NotificationsModule {}
|
||||
|
||||
@@ -13,7 +13,6 @@ import { NotificationsService } from './notifications.service';
|
||||
*/
|
||||
@Injectable()
|
||||
export class NotificationsResolver implements Resolve<Object> {
|
||||
|
||||
/**
|
||||
* @param {NotificationsService} notificationsService Notifications service.
|
||||
*/
|
||||
@@ -26,5 +25,4 @@ export class NotificationsResolver implements Resolve<Object> {
|
||||
resolve(): Observable<any> {
|
||||
return this.notificationsService.getNotifications(true, 50);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -12,11 +12,10 @@ import { Observable, of } from 'rxjs';
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class NotificationsService {
|
||||
|
||||
/**
|
||||
* @param {HttpClient} http Http Client to send requests.
|
||||
*/
|
||||
constructor(private http: HttpClient) { }
|
||||
constructor(private http: HttpClient) {}
|
||||
|
||||
/**
|
||||
* @returns {Observable<any>} Notifications.
|
||||
@@ -30,7 +29,7 @@ export class NotificationsService {
|
||||
* @returns {Observable<any>} Notifications.
|
||||
*/
|
||||
updateNotifications(): Observable<any> {
|
||||
return this.http.put('/notifications', { });
|
||||
return this.http.put('/notifications', {});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -39,20 +38,20 @@ export class NotificationsService {
|
||||
getMockUnreadNotification(): Observable<any> {
|
||||
const date = new Date();
|
||||
return of({
|
||||
'totalFilteredRecords': 1,
|
||||
'pageItems': [
|
||||
{ 'id': Math.floor(Math.random() * 100),
|
||||
'objectType': 'client',
|
||||
'objectId': Math.floor(Math.random() * 10),
|
||||
'action': 'clientCreated',
|
||||
'actorId': 2,
|
||||
'content': 'Client Created',
|
||||
'isRead': false,
|
||||
'isSystemGenerated': false,
|
||||
'createdAt': `${date.toLocaleDateString()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`
|
||||
totalFilteredRecords: 1,
|
||||
pageItems: [
|
||||
{
|
||||
id: Math.floor(Math.random() * 100),
|
||||
objectType: 'client',
|
||||
objectId: Math.floor(Math.random() * 10),
|
||||
action: 'clientCreated',
|
||||
actorId: 2,
|
||||
content: 'Client Created',
|
||||
isRead: false,
|
||||
isSystemGenerated: false,
|
||||
createdAt: `${date.toLocaleDateString()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user