feat(settings): Only display settings in Agent-electron (#358)

close #252
This commit is contained in:
Róbert Kiss
2017-07-17 01:01:29 +02:00
committed by László Monda
parent 3db019812a
commit db8a4413de
5 changed files with 7 additions and 12 deletions

View File

@@ -4,11 +4,7 @@
<span class="macro__name pane-title__name">Settings</span>
</h1>
</div>
<div *ngIf="!runInElectron">
To be done...
</div>
<auto-update-settings *ngIf="runInElectron"
[version]="version"
<auto-update-settings [version]="version"
[settings]="autoUpdateSettings$ | async"
[checkingForUpdate]="checkingForUpdate$ | async"
(toggleCheckForUpdateOnStartUp)="toogleCheckForUpdateOnStartUp($event)"

View File

@@ -2,7 +2,6 @@ import { Component } from '@angular/core';
import { Store } from '@ngrx/store';
import { Observable } from 'rxjs/Observable';
import { runInElectron } from '../../util/index';
import { AppState, getAutoUpdateSettings, getCheckingForUpdate } from '../../store';
import {
CheckForUpdateNowAction,
@@ -20,7 +19,6 @@ import { AutoUpdateSettings } from '../../models/auto-update-settings';
}
})
export class SettingsComponent {
runInElectron = runInElectron();
// TODO: From where do we get the version number? The electron gives back in main process, but the web...
version = '1.0.0';
autoUpdateSettings$: Observable<AutoUpdateSettings>;

View File

@@ -61,10 +61,10 @@
</ul>
</li>
</ul>
<ul class="menu--bottom">
<ul class="menu--bottom" *ngIf="runInElectron">
<li class="sidebar__level-1--item" [routerLinkActive]="['active']">
<a class="sidebar__level-1" [routerLink]="['/settings']">
<i class="fa fa-gear"></i> Settings
</a>
</li>
</ul>
</ul>

View File

@@ -8,6 +8,7 @@ import 'rxjs/add/operator/do';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/let';
import { runInElectron } from '../../util/index';
import { Keymap } from '../../config-serializer/config-items/keymap';
import { Macro } from '../../config-serializer/config-items/macro';
@@ -32,6 +33,8 @@ import { getKeymaps, getMacros } from '../../store/reducers/user-configuration';
styleUrls: ['./side-menu.component.scss']
})
export class SideMenuComponent {
runInElectron = runInElectron();
private keymaps$: Observable<Keymap[]>;
private macros$: Observable<Macro[]>;
private animation: { [key: string]: 'active' | 'inactive' };

View File

@@ -4,13 +4,11 @@ import { RouterModule, Routes } from '@angular/router';
import { addOnRoutes } from '../shared/components/add-on';
import { keymapRoutes } from '../components/keymap';
import { macroRoutes } from '../shared/components/macro';
import { settingsRoutes } from '../shared/components/settings';
const appRoutes: Routes = [
...keymapRoutes,
...macroRoutes,
...addOnRoutes,
...settingsRoutes
...addOnRoutes
];
export const appRoutingProviders: any[] = [];