"**/vscode-extension/**",
"**/.git/**",
"**/vendor/**",
+ "**/webapp/dist/**",
".vscode",
"typings"
],
"graphx",
"Truthy",
"darkviolet",
- "dwnl"
+ "dwnl",
+ "topnav",
+ "leftbar"
],
-
// codelyzer
"tslint.rulesDirectory": "./webapp/node_modules/codelyzer",
"typescript.tsdk": "webapp/node_modules/typescript/lib",
cd $(ROOT_SRCDIR) && rm -rf $(LOCAL_BINDIR) ./tools ./glide.lock ./vendor ./*.zip ./webapp/node_modules ./webapp/dist
webapp: webapp/install
- (cd webapp && gulp build)
+ (cd webapp && npm run build)
webapp/debug:
- (cd webapp && gulp watch &)
+ (cd webapp && npm run watch)
webapp/install:
(cd webapp && npm install)
{
- "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
- "project": {
- "name": "xds-dashboard"
- },
- "apps": [
- {
- "root": "src",
- "outDir": "dist",
- "assets": [
- "assets"
- ],
- "index": "index.html",
- "main": "main.ts",
- "polyfills": "polyfills.ts",
- "test": "test.ts",
- "tsconfig": "tsconfig.app.json",
- "testTsconfig": "tsconfig.spec.json",
- "prefix": "xds",
- "styles": [
- "styles.css",
- "../node_modules/font-awesome/css/font-awesome.min.css",
- "../node_modules/font-awesome-animation/dist/font-awesome-animation.min.css",
- "../node_modules/bootstrap/dist/css/bootstrap.min.css"
- ],
- "scripts": [],
- "environmentSource": "environments/environment.ts",
- "environments": {
- "dev": "environments/environment.ts",
- "prod": "environments/environment.prod.ts"
- }
- }
- ],
- "e2e": {
- "protractor": {
- "config": "./protractor.conf.js"
- }
- },
- "lint": [
- {
- "project": "src/tsconfig.app.json",
- "exclude": "**/node_modules/**"
+ "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
+ "project": {
+ "name": "xds-dashboard"
},
- {
- "project": "src/tsconfig.spec.json",
- "exclude": "**/node_modules/**"
+ "apps": [{
+ "root": "src",
+ "outDir": "dist",
+ "assets": [
+ "assets"
+ ],
+ "index": "index.html",
+ "main": "main.ts",
+ "polyfills": "polyfills.ts",
+ "test": "test.ts",
+ "tsconfig": "tsconfig.app.json",
+ "testTsconfig": "tsconfig.spec.json",
+ "prefix": "xds",
+ "styles": ["styles.css"],
+ "scripts": [],
+ "environmentSource": "environments/environment.ts",
+ "environments": {
+ "dev": "environments/environment.ts",
+ "prod": "environments/environment.prod.ts"
+ }
+ }],
+ "e2e": {
+ "protractor": {
+ "config": "./protractor.conf.js"
+ }
},
- {
- "project": "e2e/tsconfig.e2e.json",
- "exclude": "**/node_modules/**"
- }
- ],
- "test": {
- "karma": {
- "config": "./karma.conf.js"
+ "lint": [{
+ "project": "src/tsconfig.app.json",
+ "exclude": "**/node_modules/**"
+ },
+ {
+ "project": "src/tsconfig.spec.json",
+ "exclude": "**/node_modules/**"
+ },
+ {
+ "project": "e2e/tsconfig.e2e.json",
+ "exclude": "**/node_modules/**"
+ }
+ ],
+ "test": {
+ "karma": {
+ "config": "./karma.conf.js"
+ }
+ },
+ "defaults": {
+ "styleExt": "css",
+ "component": {}
}
- },
- "defaults": {
- "styleExt": "css",
- "component": {}
- }
}
*nodejs* must be installed on your system and the below global node packages must be installed:
-> sudo npm install -g gulp-cli
+> sudo npm install --global @angular/cli
## 2. Installing dependencies
> npm install
-`node_modules` and `typings` directories will be created during the install.
+`node_modules` directory will be created during the install.
## 3. Building the project
The application will be displayed in the browser.
-
## TODO
-- Upgrade to angular 2.4.9 or 2.4.10 AND rxjs 5.2.0
-- Complete README + package.json
-- Add prod mode and use update gulpfile tslint: "./tslint/prod.json"
-- Generate a bundle minified file, using systemjs-builder or find a better way
- http://stackoverflow.com/questions/35280582/angular2-too-many-file-requests-on-load
- Add SASS support
- http://foundation.zurb.com/sites/docs/sass.html
\ No newline at end of file
+ http://foundation.zurb.com/sites/docs/sass.html
"url": "https://github.com/iotbzh/xds-agent/issues"
},
"scripts": {
+ "clean": "rm -rf dist/",
"build": "ng build --prod --verbose",
"start": "ng serve --prod --port=8000",
"watch": "ng build --preserve-symlinks --watch",
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
-import { AlertComponent } from './alert.component';
+import { AppAlertComponent } from './app-alert.component';
-describe('AlertComponent', () => {
- let component: AlertComponent;
- let fixture: ComponentFixture<AlertComponent>;
+describe('AppAlertComponent', () => {
+ let component: AppAlertComponent;
+ let fixture: ComponentFixture<AppAlertComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
- declarations: [ AlertComponent ]
+ declarations: [ AppAlertComponent ]
})
.compileComponents();
}));
beforeEach(() => {
- fixture = TestBed.createComponent(AlertComponent);
+ fixture = TestBed.createComponent(AppAlertComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
`,
})
-export class AlertComponent {
+export class AppAlertComponent {
alerts$: Observable<IAlert[]>;
--- /dev/null
+<nav class="navbar navbar-fixed-top">
+ <!-- navbar-inverse"> -->
+ <div class="container-fluid">
+ <div class="navbar-header">
+ <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#myNavbar"
+ [attr.aria-expanded]="!isCollapsed" (click)="isCollapsed = !isCollapsed;" [ngClass]="{'collapsed': isCollapsed}">
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ </button>
+
+ <img class="navbar-brand" id="logo-iot" src="assets/images/iot-bzh-logo-small.png">
+ <a class="navbar-brand" href="#">X(cross) Development System Dashboard</a>
+ </div>
+
+ <div class="collapse navbar-collapse" [ngClass]="{'in': !isCollapsed}" id="myNavbar">
+ <ul class="nav navbar-nav navbar-right">
+ <li><a routerLink="/config"><i class="fa fa-2x fa-cog" title="Open configuration page" (click)="isCollapsed=true;"></i></a></li>
+ <li><a routerLink="/devel"><i class="fa fa-2x fa-play-circle" title="Open build page" (click)="isCollapsed=true;"></i></a></li>
+ <li><a routerLink="/home"><i class="fa fa-2x fa-home" title="Back to home page" (click)="isCollapsed=true;"></i></a></li>
+ </ul>
+ </div>
+ </div>
+</nav>
--- /dev/null
+import { Component, ViewEncapsulation } from '@angular/core';
+
+@Component({
+ selector: 'app-topnav',
+ templateUrl: './app-topnav.component.html',
+ styleUrls: ['./app-topnav.component.css'],
+ encapsulation: ViewEncapsulation.None
+})
+export class AppTopnavComponent {
+ public isCollapsed = false;
+
+ constructor() { }
+}
-<nav class="navbar navbar-fixed-top">
- <!-- navbar-inverse"> -->
- <div class="container-fluid">
- <div class="navbar-header">
- <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#myNavbar"
- [attr.aria-expanded]="!isCollapsed" (click)="isCollapsed = !isCollapsed;" [ngClass]="{'collapsed': isCollapsed}">
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- </button>
-
- <img class="navbar-brand" id="logo-iot" src="assets/images/iot-bzh-logo-small.png">
- <a class="navbar-brand" href="#">X(cross) Development System Dashboard</a>
- </div>
-
- <div class="collapse navbar-collapse" [ngClass]="{'in': !isCollapsed}" id="myNavbar">
- <ul class="nav navbar-nav navbar-right">
- <li><a routerLink="/config"><i class="fa fa-2x fa-cog" title="Open configuration page" (click)="isCollapsed=true;"></i></a></li>
- <li><a routerLink="/devel"><i class="fa fa-2x fa-play-circle" title="Open build page" (click)="isCollapsed=true;"></i></a></li>
- <li><a routerLink="/home"><i class="fa fa-2x fa-home" title="Back to home page" (click)="isCollapsed=true;"></i></a></li>
- </ul>
- </div>
- </div>
-</nav>
+<app-topnav></app-topnav>
<app-alert id="alert"></app-alert>
@Component({
selector: 'app-root',
- templateUrl: 'app.component.html',
- styleUrls: ['app.component.css']
+ templateUrl: 'app.component.html'
})
export class AppComponent implements OnInit, OnDestroy {
// Import the application components and services.
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
-import { AlertComponent } from './alert/alert.component';
+import { AppTopnavComponent } from './app-topnav/app-topnav.component';
+import { AppAlertComponent } from './app-alert/app-alert.component';
import { HomeComponent } from './home/home.component';
import { ConfigComponent } from './config/config.component';
import { DwnlAgentComponent } from './config/downloadXdsAgent.component';
],
declarations: [
AppComponent,
+ AppTopnavComponent,
+ AppAlertComponent,
HomeComponent,
- AlertComponent,
ConfigComponent,
DwnlAgentComponent,
DevelComponent,
SdksListAccordionComponent,
SdkSelectDropdownComponent,
SdkAddModalComponent,
- SafePipe
+ SafePipe,
],
providers: [
{
import { AlertService } from './alert.service';
describe('AlertService', () => {
- beforeEach(() => {
- TestBed.configureTestingModule({
- providers: [AlertService]
+ beforeEach(() => {
+ TestBed.configureTestingModule({
+ providers: [AlertService]
+ });
});
- });
- it('should be created', inject([AlertService], (service: AlertService) => {
- expect(service).toBeTruthy();
- }));
+ it('should be created', inject([AlertService], (service: AlertService) => {
+ expect(service).toBeTruthy();
+ }));
});
--- /dev/null
+import { TestBed, inject } from '@angular/core/testing';
+
+import { ProjectService } from './project.service';
+
+describe('ProjectService', () => {
+ beforeEach(() => {
+ TestBed.configureTestingModule({
+ providers: [ProjectService]
+ });
+ });
+
+ it('should be created', inject([ProjectService], (service: ProjectService) => {
+ expect(service).toBeTruthy();
+ }));
+
+ // FIXME SEB - add more tests, see https://angular.io/guide/http#mocking-philosophy
+});
.subscribe(
res => { },
error => {
- this.alert.error('ERROR while registering to all events: ', error);
+ this.alert.error('ERROR while registering to all events: ' + error);
}
);
}
private _decodeError(err: any) {
let e: string;
if (err instanceof HttpErrorResponse) {
- e = err.error || err.message || 'Unknown error';
+ e = (err.error && err.error.error) ? err.error.error : err.message || 'Unknown error';
} else if (typeof err === 'object') {
if (err.statusText) {
e = err.statusText;
} else {
e = err.message ? err.message : err.toString();
}
+ console.log('xdsagent.service - ERROR: ', e);
return Observable.throw(e);
}
}
+@import '~font-awesome/css/font-awesome.min.css';
+@import '~font-awesome-animation/dist/font-awesome-animation.min.css';
+@import '~bootstrap/dist/css/bootstrap.min.css';