feat: add UI for settings and app configuration (#90)

Add settings and app configuration UI for web app and self service
applications.
This commit is contained in:
Abhay Chawla
2018-07-03 21:17:58 +05:30
committed by GitHub
parent 4bd7478bac
commit de6a041234
22 changed files with 481 additions and 7 deletions
@@ -0,0 +1,142 @@
<mat-card class="container">
<mat-accordion>
<mat-expansion-panel>
<mat-expansion-panel-header>
<mat-panel-title>
Main Configuration
</mat-panel-title>
</mat-expansion-panel-header>
<div fxLayout="column">
<mat-form-field>
<input matInput placeholder="Name of the Organisation">
</mat-form-field>
<mat-form-field>
<textarea matInput placeholder="Description"></textarea>
</mat-form-field>
<mat-form-field>
<textarea matInput placeholder="Summary"></textarea>
</mat-form-field>
<mat-form-field>
<mat-select placeholder="Default Language">
<mat-option *ngFor="let language of languages" [value]="language.value">
{{ language.viewValue }}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field>
<mat-select placeholder="Default Date Format">
<mat-option *ngFor="let dateFormat of dateFormats" [value]="dateFormat.value">
{{ dateFormat.viewValue }}
</mat-option>
</mat-select>
</mat-form-field>
</div>
</mat-expansion-panel>
<mat-expansion-panel>
<mat-expansion-panel-header>
<mat-panel-title>
Images
</mat-panel-title>
</mat-expansion-panel-header>
<div fxLayout="column">
Favicon <mifosx-file-upload></mifosx-file-upload>
Cover Image <mifosx-file-upload></mifosx-file-upload>
Logo <mifosx-file-upload></mifosx-file-upload>
Logo with Organisation Name <mifosx-file-upload></mifosx-file-upload>
</div>
</mat-expansion-panel>
<mat-expansion-panel>
<mat-expansion-panel-header>
<mat-panel-title>
Theme and Font
</mat-panel-title>
</mat-expansion-panel-header>
<div fxLayout="column">
Mobile Banking App
<mat-form-field>
<mat-select placeholder="Default Theme">
<mat-option *ngFor="let theme of mobileAppThemes" [value]="theme.value">
{{ theme.viewValue }}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field>
<mat-select placeholder="Default Font">
<mat-option *ngFor="let font of mobileAppFonts" [value]="font.value">
{{ font.viewValue }}
</mat-option>
</mat-select>
</mat-form-field>
Online Banking App
<mat-form-field>
<mat-select placeholder="Default Theme">
<mat-option *ngFor="let theme of onlineBankingAppThemes" [value]="theme.value">
{{ theme.viewValue }}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field>
<mat-select placeholder="Default Font">
<mat-option *ngFor="let font of onlineBankingAppFonts" [value]="font.value">
{{ font.viewValue }}
</mat-option>
</mat-select>
</mat-form-field>
</div>
</mat-expansion-panel>
<mat-expansion-panel>
<mat-expansion-panel-header>
<mat-panel-title>
Contact Information
</mat-panel-title>
</mat-expansion-panel-header>
<div fxLayout="column">
<mat-form-field>
<input type="url" matInput placeholder="Website">
</mat-form-field>
<mat-form-field>
<input type="email" matInput placeholder="Email">
</mat-form-field>
<mat-form-field>
<input type="tel" matInput placeholder="Contact No">
</mat-form-field>
</div>
</mat-expansion-panel>
</mat-accordion>
</mat-card>
@@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AppConfigurationComponent } from './app-configuration.component';
describe('AppConfigurationComponent', () => {
let component: AppConfigurationComponent;
let fixture: ComponentFixture<AppConfigurationComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AppConfigurationComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(AppConfigurationComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -0,0 +1,22 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'mifosx-app-configuration',
templateUrl: './app-configuration.component.html',
styleUrls: ['./app-configuration.component.scss']
})
export class AppConfigurationComponent implements OnInit {
languages: string[];
dateFormats: string[];
mobileAppThemes: string[];
mobileAppFonts: string[];
onlineBankingAppThemes: string[];
onlineBankingAppFonts: string[];
constructor() { }
ngOnInit() {
}
}
@@ -6,6 +6,7 @@ import { UserManagementComponent } from './user-management/user-management.compo
import { CreateUserComponent } from './create-user/create-user.component';
import { ViewUserComponent } from './view-user/view-user.component';
import { EditUserComponent } from './edit-user/edit-user.component';
import { AppConfigurationComponent } from './app-configuration/app-configuration.component';
const routes: Routes = [
Route.withShell([
@@ -28,6 +29,11 @@ const routes: Routes = [
path: 'self-service/users/edit',
component: EditUserComponent,
data: { title: extract('Edit Self Service User'), breadcrumb: 'Self Service Users > Edit' },
},
{
path: 'self-service/app-configuration',
component: AppConfigurationComponent,
data: { title: extract('App Configuration'), breadcrumb: 'App Configuration' },
}
])
];
+5 -1
View File
@@ -8,19 +8,23 @@ import { UserManagementComponent } from './user-management/user-management.compo
import { CreateUserComponent } from './create-user/create-user.component';
import { ViewUserComponent } from './view-user/view-user.component';
import { EditUserComponent } from './edit-user/edit-user.component';
import { AppConfigurationComponent } from './app-configuration/app-configuration.component';
import { SharedModule } from '../shared/shared.module';
@NgModule({
imports: [
CommonModule,
CoreModule,
FormsModule,
SharedModule,
SelfServiceRoutingModule
],
declarations: [
UserManagementComponent,
CreateUserComponent,
ViewUserComponent,
EditUserComponent
EditUserComponent,
AppConfigurationComponent
],
schemas: [
CUSTOM_ELEMENTS_SCHEMA