refactor: initialise settings from config module and persist only the values

Closes #30, #59
This commit is contained in:
Sebastian Lange
2019-04-29 14:04:25 +02:00
parent e1039aa226
commit 235693a9e2
14 changed files with 1673 additions and 256 deletions

View File

@@ -1,20 +1,25 @@
<ion-header>
<ion-toolbar>
<ion-buttons slot="start">
<ion-back-button></ion-back-button>
<ion-menu-button></ion-menu-button>
</ion-buttons>
<ion-title ><div id="title" > {{'settings.title' | translate}}</div></ion-title>
<ion-title>{{'settings.title' | translate}}</ion-title>
</ion-toolbar>
</ion-header>
<ion-content >
<ion-content>
<ion-list *ngFor="let categoryKey of categoriesOrder ">
<div *ngIf="objectKeys(settingsCache).includes(categoryKey)">
<ion-item-divider><h5>{{ meta.getFieldValueTranslation(language, 'categories',
settingsCache[categoryKey].settings[objectKeys(settingsCache[categoryKey].settings)[0]]) }}</h5></ion-item-divider>
<ion-item-divider>
<h5>{{translator.translate(settingsCache[categoryKey].settings[objectKeys(settingsCache[categoryKey].settings)[0]]).categories()[0]}}
</h5>
</ion-item-divider>
<stapps-settings-item *ngFor="let settingKeys of objectKeys(settingsCache[categoryKey].settings)" [setting]="settingsCache[categoryKey].settings[settingKeys]"></stapps-settings-item>
</div>
</ion-list>
<ion-button color="medium" expand="block" fill="outline" (click)="presentResetAlert()">
{{'settings.resetSettings' | translate}}
<ion-icon slot="start" name="undo"></ion-icon>
</ion-button>
</ion-content>