feat: add components for external services (#376)
- Add sms and edit-sms component - Add notification and edit-notification component - Add email and edit-email component - Add amazon-s3 and edit-amazon-s3 component Fixes: #182 and Fixes: #183
This commit is contained in:
committed by
Abhay Chawla
parent
cbd8a5a44f
commit
fbb7a1583a
@@ -0,0 +1,51 @@
|
||||
/** Angular Imports */
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { MatTableDataSource, MatSort } from '@angular/material';
|
||||
|
||||
/**
|
||||
* Notification Configuration Component.
|
||||
*/
|
||||
@Component({
|
||||
selector: 'mifosx-notification',
|
||||
templateUrl: './notification.component.html',
|
||||
styleUrls: ['./notification.component.scss']
|
||||
})
|
||||
export class NotificationComponent implements OnInit {
|
||||
|
||||
/** Notification configuration data. */
|
||||
notificationConfigurationData: any;
|
||||
/** Columns to be displayed in Notification configuration table. */
|
||||
displayedColumns: string[] = ['name', 'value'];
|
||||
/** Data source for Notification configuration table. */
|
||||
dataSource: MatTableDataSource<any>;
|
||||
|
||||
/** Sorter for Notification configuration table. */
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
|
||||
/**
|
||||
* Retrieves the Notification configuration data from `resolve`.
|
||||
* @param {ActivatedRoute} route Activated Route.
|
||||
*/
|
||||
constructor(private route: ActivatedRoute) {
|
||||
this.route.data.subscribe((data: { notificationConfiguration: any }) => {
|
||||
this.notificationConfigurationData = data.notificationConfiguration;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the Notification Configuration table.
|
||||
*/
|
||||
ngOnInit() {
|
||||
this.setNotificationConfiguration();
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the data source and sorter for Notification configuration table.
|
||||
*/
|
||||
setNotificationConfiguration() {
|
||||
this.dataSource = new MatTableDataSource(this.notificationConfigurationData);
|
||||
this.dataSource.sort = this.sort;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user