refactore: create feature modules (#387)

* add @angular/cli to the project

* increase nodejs version -> 8.2.1

* add lerna

* merge web and shared module

* move electron module into packages as uhk-agent

Electron agent functionality is not working

* delete symlinker

* convert private properties to public of component if used in html

* revert uhk-message.component

* fix component path

* fix the correct name of the uhk-message.component.scss

* building web and electron module

* delete uhk-renderer package

* handle device connect disconnect state

* add privilege detection

* fix set privilege functionality

* turn back download keymap functionality

* add bootstrap, select2 js and fix null pointer exception

* turn back upload data to keyboard

* fix send keymap

* fix test-serializer

* add missing package.json

* merging

* fix appveyor build

* fix linting

* turn back electron storage service

* commit the missing electron-datastorage-repository

* update node to 8.3.0 in .nvmrc and log node version in appveyor build

* set exact version number in appveyor build

* vertical align privilege and missing device components

* set back node version to 8 in appveyor

* move node-usb dependency from usb dir to root

maybe it is fix the appveyor build

* revert usb to root

* fix electron builder script

* fix electron builder script

* turn off electron devtools

* remove CTRL+U functionality

* fix CTRL+o

* fix lint error

* turnoff store freeze

* start process when got `Error: EPERM: operation not permitted` error

* move files from root usb dir -> packages/usb
This commit is contained in:
Róbert Kiss
2017-08-19 20:02:17 +02:00
committed by László Monda
parent 97770f67c0
commit 0f558e4132
524 changed files with 25606 additions and 5036 deletions
@@ -0,0 +1 @@
export * from './undoable-notifier.component';
@@ -0,0 +1,12 @@
<div class="pull-right">
<div class="alert alert-warning alert-dismissible" role="alert" [@slideInOut]="slideInOut">
<button type="button"
class="close"
aria-label="Close"
(click)="clickOnClose()">
<span aria-hidden="true">&times;</span>
</button>
{{text}}
<a *ngIf="undoable" (click)="clickOnUndo()" class="undo-button">Undo</a>
</div>
</div>
@@ -0,0 +1,13 @@
.alert {
padding: 5px 10px 5px 5px;
margin-bottom: 0.25em;
margin-top: -2em;
.close {
right: -5px;
}
.undo-button {
cursor: pointer;
}
}
@@ -0,0 +1,52 @@
import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnChanges, Output, SimpleChanges } from '@angular/core';
import { animate, state, style, transition, trigger } from '@angular/animations';
import { Notification } from 'uhk-common';
@Component({
selector: 'undoable-notifier',
templateUrl: './undoable-notifier.component.html',
styleUrls: ['./undoable-notifier.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
animations: [
trigger('slideInOut', [
state('in', style({
transform: 'translate3d(0, 0, 0)'
})),
state('out', style({
transform: 'translate3d(200%, 0, 0)'
})),
transition('in => out', animate('400ms ease-in-out')),
transition('out => in', animate('400ms ease-in-out'))
])
]
})
export class UndoableNotifierComponent implements OnChanges {
text: string;
undoable: boolean;
@Input() notification: Notification;
@Output() close = new EventEmitter();
@Output() undo = new EventEmitter();
get slideInOut() {
return this.notification ? 'in' : 'out';
}
ngOnChanges(changes: SimpleChanges): void {
if (changes['notification']) {
const not: Notification = changes['notification'].currentValue;
if (not) {
this.text = not.message;
this.undoable = !!not.extra;
}
}
}
clickOnClose(): void {
this.close.emit();
}
clickOnUndo(): void {
this.undo.emit(this.notification.extra);
}
}