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:
@@ -0,0 +1,22 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { Route, extract } from '../core';
|
||||
import { SettingsComponent } from './settings.component';
|
||||
|
||||
const routes: Routes = [
|
||||
Route.withShell([
|
||||
{
|
||||
path: 'settings',
|
||||
component: SettingsComponent,
|
||||
data: { title: extract('Settings'), breadcrumb: 'Settings' }
|
||||
}
|
||||
])
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
providers: []
|
||||
})
|
||||
export class SettingsRoutingModule { }
|
||||
@@ -0,0 +1,118 @@
|
||||
<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">
|
||||
|
||||
Theme <mifosx-theme-picker></mifosx-theme-picker> <!-- TODO: Replace or Change to Show More Detail -->
|
||||
|
||||
<mat-form-field>
|
||||
<mat-select placeholder="Default Font">
|
||||
<mat-option *ngFor="let font of fonts" [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 { SettingsComponent } from './settings.component';
|
||||
|
||||
describe('SettingsComponent', () => {
|
||||
let component: SettingsComponent;
|
||||
let fixture: ComponentFixture<SettingsComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ SettingsComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(SettingsComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,19 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'mifosx-settings',
|
||||
templateUrl: './settings.component.html',
|
||||
styleUrls: ['./settings.component.scss']
|
||||
})
|
||||
export class SettingsComponent implements OnInit {
|
||||
|
||||
languages: string[];
|
||||
dateFormats: string[];
|
||||
fonts: string[];
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import { SettingsModule } from './settings.module';
|
||||
|
||||
describe('SettingsModule', () => {
|
||||
let settingsModule: SettingsModule;
|
||||
|
||||
beforeEach(() => {
|
||||
settingsModule = new SettingsModule();
|
||||
});
|
||||
|
||||
it('should create an instance', () => {
|
||||
expect(settingsModule).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,18 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
|
||||
import { CoreModule } from '../core';
|
||||
import { SettingsRoutingModule } from './settings-routing.module';
|
||||
import { SettingsComponent } from './settings.component';
|
||||
import { SharedModule } from '../shared/shared.module';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
CoreModule,
|
||||
SharedModule,
|
||||
SettingsRoutingModule
|
||||
],
|
||||
declarations: [SettingsComponent]
|
||||
})
|
||||
export class SettingsModule { }
|
||||
Reference in New Issue
Block a user