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:
Chirag Gupta
2019-04-21 20:07:24 +05:30
committed by Abhay Chawla
parent cbd8a5a44f
commit fbb7a1583a
40 changed files with 1303 additions and 10 deletions
@@ -0,0 +1,51 @@
/** Angular Imports */
import { Component, OnInit, ViewChild } from '@angular/core';
import { MatTableDataSource, MatSort } from '@angular/material';
import { ActivatedRoute } from '@angular/router';
/**
* Amazon S3 Component.
*/
@Component({
selector: 'mifosx-amazon-s3',
templateUrl: './amazon-s3.component.html',
styleUrls: ['./amazon-s3.component.scss']
})
export class AmazonS3Component implements OnInit {
/** Amazon S3 configuration data. */
amazonS3ConfigurationData: any;
/** Columns to be displayed in Amazon S3 configuration table. */
displayedColumns: string[] = ['name', 'value'];
/** Data source for Amazon S3 configuration table. */
dataSource: MatTableDataSource<any>;
/** Sorter for Amazon S3 configuration table. */
@ViewChild(MatSort) sort: MatSort;
/**
* Retrieves the Amazon S3 configuration data from `resolve`.
* @param {ActivatedRoute} route Activated Route.
*/
constructor(private route: ActivatedRoute) {
this.route.data.subscribe((data: { amazonS3Configuration: any }) => {
this.amazonS3ConfigurationData = data.amazonS3Configuration;
});
}
/**
* Sets the Amazon S3 Configuration table.
*/
ngOnInit() {
this.setAmazonS3Configuration();
}
/**
* Initializes the data source and sorter for Amazon S3 configuration table.
*/
setAmazonS3Configuration() {
this.dataSource = new MatTableDataSource(this.amazonS3ConfigurationData);
this.dataSource.sort = this.sort;
}
}