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,27 @@
|
||||
<div class="container m-b-20" fxLayout="row" fxLayoutAlign="end" fxLayoutGap="20px">
|
||||
<button mat-raised-button color="primary" [routerLink]="['edit']">
|
||||
<fa-icon icon="edit"></fa-icon>
|
||||
Edit
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="container mat-elevation-z8">
|
||||
|
||||
<table mat-table [dataSource]="dataSource" matSort>
|
||||
|
||||
<ng-container matColumnDef="name">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header> Name </th>
|
||||
<td mat-cell *matCellDef="let configuration"> {{ configuration.name }} </td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="value">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header> Value </th>
|
||||
<td mat-cell *matCellDef="let configuration"> {{ configuration.value }} </td>
|
||||
</ng-container>
|
||||
|
||||
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
||||
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
|
||||
|
||||
</table>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
table {
|
||||
width: 100%;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { AmazonS3Component } from './amazon-s3.component';
|
||||
|
||||
describe('AmazonS3Component', () => {
|
||||
let component: AmazonS3Component;
|
||||
let fixture: ComponentFixture<AmazonS3Component>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ AmazonS3Component ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(AmazonS3Component);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
/** Angular Imports */
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Resolve } from '@angular/router';
|
||||
|
||||
/** rxjs Imports */
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
/** Custom Services */
|
||||
import { SystemService } from '../../system.service';
|
||||
|
||||
/**
|
||||
* Amazon S3 Configuration data resolver.
|
||||
*/
|
||||
@Injectable()
|
||||
export class AmazonS3ConfigurationResolver implements Resolve<Object> {
|
||||
|
||||
/**
|
||||
* @param {SystemService} systemService System service.
|
||||
*/
|
||||
constructor(private systemService: SystemService) {}
|
||||
|
||||
/**
|
||||
* Returns the Amazon S3 Configuration data.
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
resolve(): Observable<any> {
|
||||
return this.systemService.getExternalConfiguration('S3');
|
||||
}
|
||||
|
||||
}
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
<div class="container">
|
||||
|
||||
<mat-card>
|
||||
|
||||
<form [formGroup]="amazonS3ConfigurationForm" (ngSubmit)="submit()">
|
||||
|
||||
<mat-card-content>
|
||||
|
||||
<div fxLayout="column">
|
||||
|
||||
<mat-form-field>
|
||||
<mat-label>S3 Access Key</mat-label>
|
||||
<input matInput required formControlName="s3_access_key">
|
||||
<mat-error *ngIf="amazonS3ConfigurationForm.controls.s3_access_key.hasError('required')">
|
||||
S3 Access Key is <strong>required</strong>
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field>
|
||||
<mat-label>S3 Bucket Name</mat-label>
|
||||
<input matInput required formControlName="s3_bucket_name">
|
||||
<mat-error *ngIf="amazonS3ConfigurationForm.controls.s3_bucket_name.hasError('required')">
|
||||
S3 Bucket Name is <strong>required</strong>
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field>
|
||||
<mat-label>S3 Secret Key</mat-label>
|
||||
<input matInput required formControlName="s3_secret_key">
|
||||
<mat-error *ngIf="amazonS3ConfigurationForm.controls.s3_secret_key.hasError('required')">
|
||||
S3 Secret Key is <strong>required</strong>
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
|
||||
</mat-card-content>
|
||||
|
||||
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
|
||||
<button type="button" mat-raised-button [routerLink]="['../']">Cancel</button>
|
||||
<button mat-raised-button color="primary" [disabled]="!amazonS3ConfigurationForm.valid || amazonS3ConfigurationForm.pristine">Submit</button>
|
||||
</mat-card-actions>
|
||||
|
||||
</form>
|
||||
|
||||
</mat-card>
|
||||
|
||||
</div>
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
.container {
|
||||
max-width: 37rem;
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { EditAmazonS3Component } from './edit-amazon-s3.component';
|
||||
|
||||
describe('EditAmazonS3Component', () => {
|
||||
let component: EditAmazonS3Component;
|
||||
let fixture: ComponentFixture<EditAmazonS3Component>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ EditAmazonS3Component ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(EditAmazonS3Component);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,70 @@
|
||||
/** Angular Imports */
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
|
||||
|
||||
/** Custom Services */
|
||||
import { SystemService } from 'app/system/system.service';
|
||||
|
||||
/**
|
||||
* Edit Amazon S3 Component.
|
||||
*/
|
||||
@Component({
|
||||
selector: 'mifosx-edit-amazon-s3',
|
||||
templateUrl: './edit-amazon-s3.component.html',
|
||||
styleUrls: ['./edit-amazon-s3.component.scss']
|
||||
})
|
||||
export class EditAmazonS3Component implements OnInit {
|
||||
|
||||
/** Amazon S3 Configuration data */
|
||||
amazonS3ConfigurationData: any;
|
||||
/** Amazon S3 Configuration Form */
|
||||
amazonS3ConfigurationForm: FormGroup;
|
||||
|
||||
/**
|
||||
* Retrieves the Amazon S3 configuration data from `resolve`.
|
||||
* @param {FormBuilder} formBuilder Form Builder.
|
||||
* @param {SystemService} systemService Accounting Service.
|
||||
* @param {ActivatedRoute} route Activated Route.
|
||||
* @param {Router} router Router for navigation.
|
||||
*/
|
||||
constructor(private formBuilder: FormBuilder,
|
||||
private systemService: SystemService,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router) {
|
||||
this.route.data.subscribe((data: { amazonS3Configuration: any }) => {
|
||||
this.amazonS3ConfigurationData = data.amazonS3Configuration;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates Amazon S3 configuration form.
|
||||
*/
|
||||
ngOnInit() {
|
||||
this.createAmazonS3ConfigurationForm();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates Amazon S3 configuration form.
|
||||
*/
|
||||
createAmazonS3ConfigurationForm() {
|
||||
this.amazonS3ConfigurationForm = this.formBuilder.group({
|
||||
's3_access_key': [this.amazonS3ConfigurationData[0].value, Validators.required],
|
||||
's3_bucket_name': [this.amazonS3ConfigurationData[1].value, Validators.required],
|
||||
's3_secret_key': [this.amazonS3ConfigurationData[2].value, Validators.required]
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Submits the Amazon S3 configuration and updates the Amazon S3 configuration,
|
||||
* if successful redirects to view Amazon S3 configuration.
|
||||
*/
|
||||
submit() {
|
||||
this.systemService
|
||||
.updateExternalConfiguration('S3', this.amazonS3ConfigurationForm.value)
|
||||
.subscribe((response: any) => {
|
||||
this.router.navigate(['../'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
<div class="container">
|
||||
|
||||
<mat-card>
|
||||
|
||||
<form [formGroup]="emailConfigurationForm" (ngSubmit)="submit()">
|
||||
|
||||
<mat-card-content>
|
||||
|
||||
<div fxLayout="column">
|
||||
|
||||
<mat-form-field>
|
||||
<mat-label>Username</mat-label>
|
||||
<input matInput required formControlName="username">
|
||||
<mat-error *ngIf="emailConfigurationForm.controls.username.hasError('required')">
|
||||
Username is <strong>required</strong>
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field>
|
||||
<mat-label>Password</mat-label>
|
||||
<input matInput required formControlName="password">
|
||||
<mat-error *ngIf="emailConfigurationForm.controls.password.hasError('required')">
|
||||
Password is <strong>required</strong>
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field>
|
||||
<mat-label>Host</mat-label>
|
||||
<input matInput required formControlName="host">
|
||||
<mat-error *ngIf="emailConfigurationForm.controls.host.hasError('required')">
|
||||
Host is <strong>required</strong>
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field>
|
||||
<mat-label>Port</mat-label>
|
||||
<input matInput required formControlName="port">
|
||||
<mat-error *ngIf="emailConfigurationForm.controls.port.hasError('required')">
|
||||
Port is <strong>required</strong>
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field>
|
||||
<mat-label>Use TLS</mat-label>
|
||||
<input matInput required formControlName="useTLS">
|
||||
<mat-error *ngIf="emailConfigurationForm.controls.useTLS.hasError('required')">
|
||||
Use TLS is <strong>required</strong>
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
|
||||
</mat-card-content>
|
||||
|
||||
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
|
||||
<button type="button" mat-raised-button [routerLink]="['../']">Cancel</button>
|
||||
<button mat-raised-button color="primary" [disabled]="!emailConfigurationForm.valid || emailConfigurationForm.pristine">Submit</button>
|
||||
</mat-card-actions>
|
||||
|
||||
</form>
|
||||
|
||||
</mat-card>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
.container {
|
||||
max-width: 37rem;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { EditEmailComponent } from './edit-email.component';
|
||||
|
||||
describe('EditEmailComponent', () => {
|
||||
let component: EditEmailComponent;
|
||||
let fixture: ComponentFixture<EditEmailComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ EditEmailComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(EditEmailComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,72 @@
|
||||
/** Angular Imports */
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
|
||||
|
||||
/** Custom Services */
|
||||
import { SystemService } from 'app/system/system.service';
|
||||
|
||||
/**
|
||||
* Edit Email Configuration Component.
|
||||
*/
|
||||
@Component({
|
||||
selector: 'mifosx-edit-email',
|
||||
templateUrl: './edit-email.component.html',
|
||||
styleUrls: ['./edit-email.component.scss']
|
||||
})
|
||||
export class EditEmailComponent implements OnInit {
|
||||
|
||||
/** Email Configuration data */
|
||||
emailConfigurationData: any;
|
||||
/** Email Configuration Form */
|
||||
emailConfigurationForm: FormGroup;
|
||||
|
||||
/**
|
||||
* Retrieves the Email configuration data from `resolve`.
|
||||
* @param {FormBuilder} formBuilder Form Builder.
|
||||
* @param {SystemService} systemService Accounting Service.
|
||||
* @param {ActivatedRoute} route Activated Route.
|
||||
* @param {Router} router Router for navigation.
|
||||
*/
|
||||
constructor(private formBuilder: FormBuilder,
|
||||
private systemService: SystemService,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router) {
|
||||
this.route.data.subscribe((data: { emailConfiguration: any }) => {
|
||||
this.emailConfigurationData = data.emailConfiguration;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates Email configuration form.
|
||||
*/
|
||||
ngOnInit() {
|
||||
this.setEmailConfigurationForm();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates Email configuration form.
|
||||
*/
|
||||
setEmailConfigurationForm() {
|
||||
this.emailConfigurationForm = this.formBuilder.group({
|
||||
'username': [this.emailConfigurationData[0].value, Validators.required],
|
||||
'password': [this.emailConfigurationData[1].value, Validators.required],
|
||||
'host': [this.emailConfigurationData[2].value, Validators.required],
|
||||
'port': [this.emailConfigurationData[3].value, Validators.required],
|
||||
'useTLS': [this.emailConfigurationData[4].value, Validators.required]
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Submits the Email configuration and updates the Email configuration,
|
||||
* if successful redirects to view Email configuration.
|
||||
*/
|
||||
submit() {
|
||||
this.systemService
|
||||
.updateExternalConfiguration('SMTP', this.emailConfigurationForm.value)
|
||||
.subscribe((response: any) => {
|
||||
this.router.navigate(['../'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<div class="container m-b-20" fxLayout="row" fxLayoutAlign="end" fxLayoutGap="20px">
|
||||
<button mat-raised-button color="primary" [routerLink]="['edit']">
|
||||
<fa-icon icon="edit"></fa-icon>
|
||||
Edit
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="container mat-elevation-z8">
|
||||
|
||||
<table mat-table [dataSource]="dataSource" matSort>
|
||||
|
||||
<ng-container matColumnDef="name">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header> Name </th>
|
||||
<td mat-cell *matCellDef="let configuration"> {{ configuration.name }} </td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="value">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header> Value </th>
|
||||
<td mat-cell *matCellDef="let configuration"> {{ configuration.value }} </td>
|
||||
</ng-container>
|
||||
|
||||
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
||||
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
|
||||
|
||||
</table>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
table {
|
||||
width: 100%;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { EmailComponent } from './email.component';
|
||||
|
||||
describe('EmailComponent', () => {
|
||||
let component: EmailComponent;
|
||||
let fixture: ComponentFixture<EmailComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ EmailComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(EmailComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,51 @@
|
||||
/** Angular Imports */
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { MatTableDataSource, MatSort } from '@angular/material';
|
||||
|
||||
/**
|
||||
* Email Configuration Component.
|
||||
*/
|
||||
@Component({
|
||||
selector: 'mifosx-email',
|
||||
templateUrl: './email.component.html',
|
||||
styleUrls: ['./email.component.scss']
|
||||
})
|
||||
export class EmailComponent implements OnInit {
|
||||
|
||||
/** Email configuration data. */
|
||||
emailConfigurationData: any;
|
||||
/** Columns to be displayed in Email configuration table. */
|
||||
displayedColumns: string[] = ['name', 'value'];
|
||||
/** Data source for Email configuration table. */
|
||||
dataSource: MatTableDataSource<any>;
|
||||
|
||||
/** Sorter for Email configuration table. */
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
|
||||
/**
|
||||
* Retrieves the Email configuration data from `resolve`.
|
||||
* @param {ActivatedRoute} route Activated Route.
|
||||
*/
|
||||
constructor(private route: ActivatedRoute) {
|
||||
this.route.data.subscribe((data: { emailConfiguration: any }) => {
|
||||
this.emailConfigurationData = data.emailConfiguration;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the Email Configuration table.
|
||||
*/
|
||||
ngOnInit() {
|
||||
this.setEmailConfiguration();
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the data source and sorter for Email configuration table.
|
||||
*/
|
||||
setEmailConfiguration() {
|
||||
this.dataSource = new MatTableDataSource(this.emailConfigurationData);
|
||||
this.dataSource.sort = this.sort;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
/** Angular Imports */
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Resolve } from '@angular/router';
|
||||
|
||||
/** rxjs Imports */
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
/** Custom Services */
|
||||
import { SystemService } from '../../system.service';
|
||||
|
||||
/**
|
||||
* Email Configuration data resolver.
|
||||
*/
|
||||
@Injectable()
|
||||
export class EmailConfigurationResolver implements Resolve<Object> {
|
||||
|
||||
/**
|
||||
* @param {SystemService} systemService System service.
|
||||
*/
|
||||
constructor(private systemService: SystemService) {}
|
||||
|
||||
/**
|
||||
* Returns the Email Configuration data.
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
resolve(): Observable<any> {
|
||||
return this.systemService.getExternalConfiguration('SMTP');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
<mat-nav-list>
|
||||
|
||||
<mat-list-item>
|
||||
<mat-list-item [routerLink]="['amazon-s3']">
|
||||
<mat-icon matListIcon>
|
||||
<fa-icon icon="cloud" size="sm"></fa-icon>
|
||||
</mat-icon>
|
||||
@@ -16,7 +16,7 @@
|
||||
<p matLine>S3 Amazon Service Configuration</p>
|
||||
</mat-list-item>
|
||||
|
||||
<mat-list-item>
|
||||
<mat-list-item [routerLink]="['sms']">
|
||||
<mat-icon matListIcon>
|
||||
<fa-icon icon="comment-alt" size="sm"></fa-icon>
|
||||
</mat-icon>
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
<mat-nav-list>
|
||||
|
||||
<mat-list-item>
|
||||
<mat-list-item [routerLink]="['email']">
|
||||
<mat-icon matListIcon>
|
||||
<fa-icon icon="envelope" size="sm"></fa-icon>
|
||||
</mat-icon>
|
||||
@@ -40,7 +40,7 @@
|
||||
<p matLine>Email Service Configuration</p>
|
||||
</mat-list-item>
|
||||
|
||||
<mat-list-item>
|
||||
<mat-list-item [routerLink]="['notification']">
|
||||
<mat-icon matListIcon>
|
||||
<fa-icon icon="bell" size="sm"></fa-icon>
|
||||
</mat-icon>
|
||||
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
<div class="container">
|
||||
|
||||
<mat-card>
|
||||
|
||||
<form [formGroup]="notificationConfigurationForm" (ngSubmit)="submit()">
|
||||
|
||||
<mat-card-content>
|
||||
|
||||
<div fxLayout="column">
|
||||
|
||||
<mat-form-field>
|
||||
<mat-label>Server Key</mat-label>
|
||||
<input matInput required formControlName="server_key">
|
||||
<mat-error *ngIf="notificationConfigurationForm.controls.server_key.hasError('required')">
|
||||
Server Key is <strong>required</strong>
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field>
|
||||
<mat-label>GCM End Point</mat-label>
|
||||
<input matInput required formControlName="gcm_end_point">
|
||||
<mat-error *ngIf="notificationConfigurationForm.controls.gcm_end_point.hasError('required')">
|
||||
GCM End Point is <strong>required</strong>
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field>
|
||||
<mat-label>FCM End Point</mat-label>
|
||||
<input matInput required formControlName="fcm_end_point">
|
||||
<mat-error *ngIf="notificationConfigurationForm.controls.fcm_end_point.hasError('required')">
|
||||
FCM End Point is <strong>required</strong>
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
|
||||
</mat-card-content>
|
||||
|
||||
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
|
||||
<button type="button" mat-raised-button [routerLink]="['../']">Cancel</button>
|
||||
<button mat-raised-button color="primary" [disabled]="!notificationConfigurationForm.valid || notificationConfigurationForm.pristine">Submit</button>
|
||||
</mat-card-actions>
|
||||
|
||||
</form>
|
||||
|
||||
</mat-card>
|
||||
|
||||
</div>
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
.container {
|
||||
max-width: 37rem;
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { EditNotificationComponent } from './edit-notification.component';
|
||||
|
||||
describe('EditNotificationComponent', () => {
|
||||
let component: EditNotificationComponent;
|
||||
let fixture: ComponentFixture<EditNotificationComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ EditNotificationComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(EditNotificationComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
+70
@@ -0,0 +1,70 @@
|
||||
/** Angular Imports */
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
|
||||
|
||||
/** Custom Services */
|
||||
import { SystemService } from 'app/system/system.service';
|
||||
|
||||
/**
|
||||
* Edit Notification Configuration Component.
|
||||
*/
|
||||
@Component({
|
||||
selector: 'mifosx-edit-notification',
|
||||
templateUrl: './edit-notification.component.html',
|
||||
styleUrls: ['./edit-notification.component.scss']
|
||||
})
|
||||
export class EditNotificationComponent implements OnInit {
|
||||
|
||||
/** Notification Configuration data */
|
||||
notificationConfigurationData: any;
|
||||
/** Notification Configuration Form */
|
||||
notificationConfigurationForm: FormGroup;
|
||||
|
||||
/**
|
||||
* Retrieves the Notification configuration data from `resolve`.
|
||||
* @param {FormBuilder} formBuilder Form Builder.
|
||||
* @param {SystemService} systemService Accounting Service.
|
||||
* @param {ActivatedRoute} route Activated Route.
|
||||
* @param {Router} router Router for navigation.
|
||||
*/
|
||||
constructor(private formBuilder: FormBuilder,
|
||||
private systemService: SystemService,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router) {
|
||||
this.route.data.subscribe((data: { notificationConfiguration: any }) => {
|
||||
this.notificationConfigurationData = data.notificationConfiguration;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates Notification configuration form.
|
||||
*/
|
||||
ngOnInit() {
|
||||
this.setNotificationConfigurationForm();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates Notification configuration form.
|
||||
*/
|
||||
setNotificationConfigurationForm() {
|
||||
this.notificationConfigurationForm = this.formBuilder.group({
|
||||
'server_key': [this.notificationConfigurationData[0].value, Validators.required],
|
||||
'gcm_end_point': [this.notificationConfigurationData[1].value, Validators.required],
|
||||
'fcm_end_point': [this.notificationConfigurationData[2].value, Validators.required]
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Submits the Notification configuration and updates the Notification configuration,
|
||||
* if successful redirects to view Notification configuration.
|
||||
*/
|
||||
submit() {
|
||||
this.systemService
|
||||
.updateExternalConfiguration('NOTIFICATION', this.notificationConfigurationForm.value)
|
||||
.subscribe((response: any) => {
|
||||
this.router.navigate(['../'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<div class="container m-b-20" fxLayout="row" fxLayoutAlign="end" fxLayoutGap="20px">
|
||||
<button mat-raised-button color="primary" [routerLink]="['edit']">
|
||||
<fa-icon icon="edit"></fa-icon>
|
||||
Edit
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="container mat-elevation-z8">
|
||||
|
||||
<table mat-table [dataSource]="dataSource" matSort>
|
||||
|
||||
<ng-container matColumnDef="name">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header> Name </th>
|
||||
<td mat-cell *matCellDef="let configuration"> {{ configuration.name }} </td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="value">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header> Value </th>
|
||||
<td mat-cell *matCellDef="let configuration"> {{ configuration.value }} </td>
|
||||
</ng-container>
|
||||
|
||||
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
||||
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
|
||||
|
||||
</table>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
table {
|
||||
width: 100%;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { NotificationComponent } from './notification.component';
|
||||
|
||||
describe('NotificationComponent', () => {
|
||||
let component: NotificationComponent;
|
||||
let fixture: ComponentFixture<NotificationComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ NotificationComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(NotificationComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
/** Angular Imports */
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Resolve } from '@angular/router';
|
||||
|
||||
/** rxjs Imports */
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
/** Custom Services */
|
||||
import { SystemService } from '../../system.service';
|
||||
|
||||
/**
|
||||
* Notification Configuration data resolver.
|
||||
*/
|
||||
@Injectable()
|
||||
export class NotificationConfigurationResolver implements Resolve<Object> {
|
||||
|
||||
/**
|
||||
* @param {SystemService} systemService System service.
|
||||
*/
|
||||
constructor(private systemService: SystemService) {}
|
||||
|
||||
/**
|
||||
* Returns the Notification Configuration data.
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
resolve(): Observable<any> {
|
||||
return this.systemService.getExternalConfiguration('NOTIFICATION');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
<div class="container">
|
||||
|
||||
<mat-card>
|
||||
|
||||
<form [formGroup]="smsConfigurationForm" (ngSubmit)="submit()">
|
||||
|
||||
<mat-card-content>
|
||||
|
||||
<div fxLayout="column">
|
||||
|
||||
<mat-form-field>
|
||||
<mat-label>Host Name</mat-label>
|
||||
<input matInput required formControlName="host_name">
|
||||
<mat-error *ngIf="smsConfigurationForm.controls.host_name.hasError('required')">
|
||||
Host Name is <strong>required</strong>
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field>
|
||||
<mat-label>Port Number</mat-label>
|
||||
<input matInput required formControlName="port_number">
|
||||
<mat-error *ngIf="smsConfigurationForm.controls.port_number.hasError('required')">
|
||||
Port Number is <strong>required</strong>
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field>
|
||||
<mat-label>End Point</mat-label>
|
||||
<input matInput required formControlName="end_point">
|
||||
<mat-error *ngIf="smsConfigurationForm.controls.end_point.hasError('required')">
|
||||
End Point is <strong>required</strong>
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field>
|
||||
<mat-label>Tenant App Key</mat-label>
|
||||
<input matInput required formControlName="tenant_app_key">
|
||||
<mat-error *ngIf="smsConfigurationForm.controls.tenant_app_key.hasError('required')">
|
||||
Tenant App Key is <strong>required</strong>
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
|
||||
</mat-card-content>
|
||||
|
||||
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
|
||||
<button type="button" mat-raised-button [routerLink]="['../']">Cancel</button>
|
||||
<button mat-raised-button color="primary" [disabled]="!smsConfigurationForm.valid || smsConfigurationForm.pristine">Submit</button>
|
||||
</mat-card-actions>
|
||||
|
||||
</form>
|
||||
|
||||
</mat-card>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
.container {
|
||||
max-width: 37rem;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { EditSmsComponent } from './edit-sms.component';
|
||||
|
||||
describe('EditSmsComponent', () => {
|
||||
let component: EditSmsComponent;
|
||||
let fixture: ComponentFixture<EditSmsComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ EditSmsComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(EditSmsComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,71 @@
|
||||
/** Angular Imports */
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
|
||||
|
||||
/** Custom Services */
|
||||
import { SystemService } from 'app/system/system.service';
|
||||
|
||||
/**
|
||||
* Edit SMS Configuration Component.
|
||||
*/
|
||||
@Component({
|
||||
selector: 'mifosx-edit-sms',
|
||||
templateUrl: './edit-sms.component.html',
|
||||
styleUrls: ['./edit-sms.component.scss']
|
||||
})
|
||||
export class EditSMSComponent implements OnInit {
|
||||
|
||||
/** SMS Configuration data */
|
||||
smsConfigurationData: any;
|
||||
/** SMS Configuration Form */
|
||||
smsConfigurationForm: FormGroup;
|
||||
|
||||
/**
|
||||
* Retrieves the SMS configuration data from `resolve`.
|
||||
* @param {FormBuilder} formBuilder Form Builder.
|
||||
* @param {SystemService} systemService Accounting Service.
|
||||
* @param {ActivatedRoute} route Activated Route.
|
||||
* @param {Router} router Router for navigation.
|
||||
*/
|
||||
constructor(private formBuilder: FormBuilder,
|
||||
private systemService: SystemService,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router) {
|
||||
this.route.data.subscribe((data: { smsConfiguration: any }) => {
|
||||
this.smsConfigurationData = data.smsConfiguration;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates SMS configuration form.
|
||||
*/
|
||||
ngOnInit() {
|
||||
this.setSMSConfigurationForm();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates SMS configuration form.
|
||||
*/
|
||||
setSMSConfigurationForm() {
|
||||
this.smsConfigurationForm = this.formBuilder.group({
|
||||
'host_name': [this.smsConfigurationData[0].value, Validators.required],
|
||||
'port_number': [this.smsConfigurationData[1].value, Validators.required],
|
||||
'end_point': [this.smsConfigurationData[2].value, Validators.required],
|
||||
'tenant_app_key': [this.smsConfigurationData[3].value, Validators.required]
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Submits the SMS configuration and updates the SMS configuration,
|
||||
* if successful redirects to view SMS configuration.
|
||||
*/
|
||||
submit() {
|
||||
this.systemService
|
||||
.updateExternalConfiguration('SMS', this.smsConfigurationForm.value)
|
||||
.subscribe((response: any) => {
|
||||
this.router.navigate(['../'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<div class="container m-b-20" fxLayout="row" fxLayoutAlign="end" fxLayoutGap="20px">
|
||||
<button mat-raised-button color="primary" [routerLink]="['edit']">
|
||||
<fa-icon icon="edit"></fa-icon>
|
||||
Edit
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="container mat-elevation-z8">
|
||||
|
||||
<table mat-table [dataSource]="dataSource" matSort>
|
||||
|
||||
<ng-container matColumnDef="name">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header> Name </th>
|
||||
<td mat-cell *matCellDef="let configuration"> {{ configuration.name }} </td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="value">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header> Value </th>
|
||||
<td mat-cell *matCellDef="let configuration"> {{ configuration.value }} </td>
|
||||
</ng-container>
|
||||
|
||||
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
||||
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
|
||||
|
||||
</table>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
table {
|
||||
width: 100%;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { SMSComponent } from './sms.component';
|
||||
|
||||
describe('SmsComponent', () => {
|
||||
let component: SMSComponent;
|
||||
let fixture: ComponentFixture<SMSComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ SMSComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(SMSComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,51 @@
|
||||
/** Angular Imports */
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { MatTableDataSource, MatSort } from '@angular/material';
|
||||
|
||||
/**
|
||||
* SMS Configuration Component.
|
||||
*/
|
||||
@Component({
|
||||
selector: 'mifosx-sms',
|
||||
templateUrl: './sms.component.html',
|
||||
styleUrls: ['./sms.component.scss']
|
||||
})
|
||||
export class SMSComponent implements OnInit {
|
||||
|
||||
/** SMS configuration data. */
|
||||
smsConfigurationData: any;
|
||||
/** Columns to be displayed in SMS configuration table. */
|
||||
displayedColumns: string[] = ['name', 'value'];
|
||||
/** Data source for SMS configuration table. */
|
||||
dataSource: MatTableDataSource<any>;
|
||||
|
||||
/** Sorter for SMS configuration table. */
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
|
||||
/**
|
||||
* Retrieves the SMS configuration data from `resolve`.
|
||||
* @param {ActivatedRoute} route Activated Route.
|
||||
*/
|
||||
constructor(private route: ActivatedRoute) {
|
||||
this.route.data.subscribe((data: {smsConfiguration: any}) => {
|
||||
this.smsConfigurationData = data.smsConfiguration;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the SMS Configuration table.
|
||||
*/
|
||||
ngOnInit() {
|
||||
this.setSMSConfiguration();
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the data source and sorter for SMS configuration table.
|
||||
*/
|
||||
setSMSConfiguration() {
|
||||
this.dataSource = new MatTableDataSource(this.smsConfigurationData);
|
||||
this.dataSource.sort = this.sort;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
/** Angular Imports */
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Resolve } from '@angular/router';
|
||||
|
||||
/** rxjs Imports */
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
/** Custom Services */
|
||||
import { SystemService } from '../../system.service';
|
||||
|
||||
/**
|
||||
* SMS Configuration data resolver.
|
||||
*/
|
||||
@Injectable()
|
||||
export class SMSConfigurationResolver implements Resolve<Object> {
|
||||
|
||||
/**
|
||||
* @param {SystemService} systemService System service.
|
||||
*/
|
||||
constructor(private systemService: SystemService) {}
|
||||
|
||||
/**
|
||||
* Returns the SMS Configuration data.
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
resolve(): Observable<any> {
|
||||
return this.systemService.getExternalConfiguration('SMS');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -17,6 +17,14 @@ import { ManageSurveysComponent } from './manage-surveys/manage-surveys.componen
|
||||
import { ManageSchedulerJobsComponent } from './manage-scheduler-jobs/manage-scheduler-jobs.component';
|
||||
import { GlobalConfigurationsComponent } from './global-configurations/global-configurations.component';
|
||||
import { EditConfigurationComponent } from './global-configurations/edit-configuration/edit-configuration.component';
|
||||
import { AmazonS3Component } from './external-services/amazon-s3/amazon-s3.component';
|
||||
import { EmailComponent } from './external-services/email/email.component';
|
||||
import { SMSComponent } from './external-services/sms/sms.component';
|
||||
import { NotificationComponent } from './external-services/notification/notification.component';
|
||||
import { EditAmazonS3Component } from './external-services/amazon-s3/edit-amazon-s3/edit-amazon-s3.component';
|
||||
import { EditEmailComponent } from './external-services/email/edit-email/edit-email.component';
|
||||
import { EditNotificationComponent } from './external-services/notification/edit-notification/edit-notification.component';
|
||||
import { EditSMSComponent } from './external-services/sms/edit-sms/edit-sms.component';
|
||||
|
||||
/** Custom Resolvers */
|
||||
import { CodesResolver } from './codes/codes.resolver';
|
||||
@@ -27,6 +35,10 @@ import { ManageSurveysResolver } from './manage-surveys/manage-surveys.resolver'
|
||||
import { ManageSchedulerJobsResolver } from './manage-scheduler-jobs/manage-scheduler-jobs.resolver';
|
||||
import { GlobalConfigurationsResolver } from './global-configurations/global-configurations.resolver';
|
||||
import { GlobalConfigurationResolver } from './global-configurations/global-configuration.resolver';
|
||||
import { AmazonS3ConfigurationResolver } from './external-services/amazon-s3/amazon-s3.resolver';
|
||||
import { EmailConfigurationResolver } from './external-services/email/email.resolver';
|
||||
import { SMSConfigurationResolver } from './external-services/sms/sms.resolver';
|
||||
import { NotificationConfigurationResolver } from './external-services/notification/notification.resolver';
|
||||
|
||||
const routes: Routes = [
|
||||
Route.withShell([
|
||||
@@ -59,10 +71,99 @@ const routes: Routes = [
|
||||
},
|
||||
{
|
||||
path: 'external-services',
|
||||
component: ExternalServicesComponent,
|
||||
data: { title: extract('External Services'), breadcrumb: 'External Services' },
|
||||
},
|
||||
{
|
||||
data: { title: extract('External Services'), breadcrumb: 'External Services' },
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
component: ExternalServicesComponent
|
||||
},
|
||||
{
|
||||
path: 'amazon-s3',
|
||||
data: { title: extract('View Amazon S3 Configuration'), breadcrumb: 'Amazon S3' },
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
component: AmazonS3Component,
|
||||
resolve: {
|
||||
amazonS3Configuration: AmazonS3ConfigurationResolver
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'edit',
|
||||
component: EditAmazonS3Component,
|
||||
data: {title: extract('Edit Amazon S3 Configuration'), breadcrumb: 'Edit'},
|
||||
resolve: {
|
||||
amazonS3Configuration: AmazonS3ConfigurationResolver
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: 'email',
|
||||
data: { title: extract('View Email Configuration'), breadcrumb: 'Email' },
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
component: EmailComponent,
|
||||
resolve: {
|
||||
emailConfiguration: EmailConfigurationResolver
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'edit',
|
||||
component: EditEmailComponent,
|
||||
data: { title: extract('Edit Email Configuration'), breadcrumb: 'Edit' },
|
||||
resolve: {
|
||||
emailConfiguration: EmailConfigurationResolver
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: 'sms',
|
||||
data: { title: extract('View SMS Configuration'), breadcrumb: 'SMS' },
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
component: SMSComponent,
|
||||
resolve: {
|
||||
smsConfiguration: SMSConfigurationResolver
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'edit',
|
||||
data: { title: extract('Edit SMS Configuration'), breadcrumb: 'Edit' },
|
||||
component: EditSMSComponent,
|
||||
resolve: {
|
||||
smsConfiguration: SMSConfigurationResolver
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: 'notification',
|
||||
data: { title: extract('View Notification Configuration'), breadcrumb: 'Notification' },
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
component: NotificationComponent,
|
||||
resolve: {
|
||||
notificationConfiguration: NotificationConfigurationResolver
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'edit',
|
||||
component: EditNotificationComponent,
|
||||
data: { title: extract('Edit Notification Configuration'), breadcrumb: 'Edit' },
|
||||
resolve: {
|
||||
notificationConfiguration: NotificationConfigurationResolver
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: 'data-tables',
|
||||
component: ManageDataTablesComponent,
|
||||
resolve: {
|
||||
@@ -140,7 +241,11 @@ const routes: Routes = [
|
||||
ManageSurveysResolver,
|
||||
ManageSchedulerJobsResolver,
|
||||
GlobalConfigurationsResolver,
|
||||
GlobalConfigurationResolver
|
||||
GlobalConfigurationResolver,
|
||||
AmazonS3ConfigurationResolver,
|
||||
EmailConfigurationResolver,
|
||||
SMSConfigurationResolver,
|
||||
NotificationConfigurationResolver
|
||||
]
|
||||
})
|
||||
export class SystemRoutingModule { }
|
||||
|
||||
@@ -17,6 +17,14 @@ import { ManageSurveysComponent } from './manage-surveys/manage-surveys.componen
|
||||
import { ManageSchedulerJobsComponent } from './manage-scheduler-jobs/manage-scheduler-jobs.component';
|
||||
import { GlobalConfigurationsComponent } from './global-configurations/global-configurations.component';
|
||||
import { EditConfigurationComponent } from './global-configurations/edit-configuration/edit-configuration.component';
|
||||
import { AmazonS3Component } from './external-services/amazon-s3/amazon-s3.component';
|
||||
import { EmailComponent } from './external-services/email/email.component';
|
||||
import { SMSComponent } from './external-services/sms/sms.component';
|
||||
import { NotificationComponent } from './external-services/notification/notification.component';
|
||||
import { EditAmazonS3Component } from './external-services/amazon-s3/edit-amazon-s3/edit-amazon-s3.component';
|
||||
import { EditEmailComponent } from './external-services/email/edit-email/edit-email.component';
|
||||
import { EditNotificationComponent } from './external-services/notification/edit-notification/edit-notification.component';
|
||||
import { EditSMSComponent } from './external-services/sms/edit-sms/edit-sms.component';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
@@ -34,7 +42,15 @@ import { EditConfigurationComponent } from './global-configurations/edit-configu
|
||||
ManageSurveysComponent,
|
||||
ManageSchedulerJobsComponent,
|
||||
GlobalConfigurationsComponent,
|
||||
EditConfigurationComponent
|
||||
EditConfigurationComponent,
|
||||
AmazonS3Component,
|
||||
EmailComponent,
|
||||
SMSComponent,
|
||||
NotificationComponent,
|
||||
EditAmazonS3Component,
|
||||
EditEmailComponent,
|
||||
EditNotificationComponent,
|
||||
EditSMSComponent
|
||||
]
|
||||
})
|
||||
export class SystemModule { }
|
||||
|
||||
@@ -99,4 +99,21 @@ export class SystemService {
|
||||
return this.http.put(`/configurations/${configurationId}`, configuration);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} externalConfigurationName External Configuration Name.
|
||||
* @returns {Observable<any>} External Configuration.
|
||||
*/
|
||||
getExternalConfiguration(externalConfigurationName: string): Observable<any> {
|
||||
return this.http.get(`/externalservice/${externalConfigurationName}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} externalConfigurationName External Configuration Name.
|
||||
* @param {any} externalConfiguration External Configuration.
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
updateExternalConfiguration(externalConfigurationName: string, externalConfiguration: any): Observable<any> {
|
||||
return this.http.put(`/externalservice/${externalConfigurationName}`, externalConfiguration);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user