mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-01-18 10:46:35 +00:00
Basic migration to RxJS 6, Ref: #154
This commit is contained in:
parent
b7ef2fe643
commit
06269bf2a2
@ -1,66 +0,0 @@
|
|||||||
{
|
|
||||||
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
|
||||||
"project": {
|
|
||||||
"name": "gns3-web-ui"
|
|
||||||
},
|
|
||||||
"apps": [
|
|
||||||
{
|
|
||||||
"root": "src",
|
|
||||||
"outDir": "dist",
|
|
||||||
"assets": [
|
|
||||||
"assets",
|
|
||||||
"favicon.ico"
|
|
||||||
],
|
|
||||||
"index": "index.html",
|
|
||||||
"main": "main.ts",
|
|
||||||
"polyfills": "polyfills.ts",
|
|
||||||
"test": "test.ts",
|
|
||||||
"tsconfig": "tsconfig.app.json",
|
|
||||||
"testTsconfig": "tsconfig.spec.json",
|
|
||||||
"prefix": "app",
|
|
||||||
"styles": [
|
|
||||||
"../node_modules/bootstrap/dist/css/bootstrap.min.css",
|
|
||||||
"styles.css",
|
|
||||||
"theme.scss"
|
|
||||||
],
|
|
||||||
"scripts": [],
|
|
||||||
"environmentSource": "environments/environment.ts",
|
|
||||||
"environments": {
|
|
||||||
"dev": "environments/environment.ts",
|
|
||||||
"prod": "environments/environment.prod.ts",
|
|
||||||
"electronProd": "environments/environment.electron.prod.ts",
|
|
||||||
"electronDev": "environments/environment.electron.ts",
|
|
||||||
"githubProd": "environments/environment.github.prod.ts"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"e2e": {
|
|
||||||
"protractor": {
|
|
||||||
"config": "./protractor.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": "scss",
|
|
||||||
"component": {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
187
angular.json
Normal file
187
angular.json
Normal file
@ -0,0 +1,187 @@
|
|||||||
|
{
|
||||||
|
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
||||||
|
"version": 1,
|
||||||
|
"newProjectRoot": "projects",
|
||||||
|
"projects": {
|
||||||
|
"gns3-web-ui": {
|
||||||
|
"root": "",
|
||||||
|
"sourceRoot": "src",
|
||||||
|
"projectType": "application",
|
||||||
|
"architect": {
|
||||||
|
"build": {
|
||||||
|
"builder": "@angular-devkit/build-angular:browser",
|
||||||
|
"options": {
|
||||||
|
"outputPath": "dist",
|
||||||
|
"index": "src/index.html",
|
||||||
|
"main": "src/main.ts",
|
||||||
|
"tsConfig": "src/tsconfig.app.json",
|
||||||
|
"polyfills": "src/polyfills.ts",
|
||||||
|
"assets": [
|
||||||
|
"src/assets",
|
||||||
|
"src/favicon.ico"
|
||||||
|
],
|
||||||
|
"styles": [
|
||||||
|
"node_modules/bootstrap/dist/css/bootstrap.min.css",
|
||||||
|
"src/styles.css",
|
||||||
|
"src/theme.scss"
|
||||||
|
],
|
||||||
|
"scripts": []
|
||||||
|
},
|
||||||
|
"configurations": {
|
||||||
|
"production": {
|
||||||
|
"optimization": true,
|
||||||
|
"outputHashing": "all",
|
||||||
|
"sourceMap": false,
|
||||||
|
"extractCss": true,
|
||||||
|
"namedChunks": false,
|
||||||
|
"aot": true,
|
||||||
|
"extractLicenses": true,
|
||||||
|
"vendorChunk": false,
|
||||||
|
"buildOptimizer": true,
|
||||||
|
"fileReplacements": [
|
||||||
|
{
|
||||||
|
"replace": "src/environments/environment.ts",
|
||||||
|
"with": "src/environments/environment.prod.ts"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"electronProd": {
|
||||||
|
"optimization": true,
|
||||||
|
"outputHashing": "all",
|
||||||
|
"sourceMap": false,
|
||||||
|
"extractCss": true,
|
||||||
|
"namedChunks": false,
|
||||||
|
"aot": true,
|
||||||
|
"extractLicenses": true,
|
||||||
|
"vendorChunk": false,
|
||||||
|
"buildOptimizer": true,
|
||||||
|
"fileReplacements": [
|
||||||
|
{
|
||||||
|
"replace": "src/environments/environment.ts",
|
||||||
|
"with": "src/environments/environment.electron.prod.ts"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"electronDev": {
|
||||||
|
"fileReplacements": [
|
||||||
|
{
|
||||||
|
"replace": "src/environments/environment.ts",
|
||||||
|
"with": "src/environments/environment.electron.ts"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"githubProd": {
|
||||||
|
"optimization": true,
|
||||||
|
"outputHashing": "all",
|
||||||
|
"sourceMap": false,
|
||||||
|
"extractCss": true,
|
||||||
|
"namedChunks": false,
|
||||||
|
"aot": true,
|
||||||
|
"extractLicenses": true,
|
||||||
|
"vendorChunk": false,
|
||||||
|
"buildOptimizer": true,
|
||||||
|
"fileReplacements": [
|
||||||
|
{
|
||||||
|
"replace": "src/environments/environment.ts",
|
||||||
|
"with": "src/environments/environment.github.prod.ts"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"serve": {
|
||||||
|
"builder": "@angular-devkit/build-angular:dev-server",
|
||||||
|
"options": {
|
||||||
|
"browserTarget": "gns3-web-ui:build"
|
||||||
|
},
|
||||||
|
"configurations": {
|
||||||
|
"production": {
|
||||||
|
"browserTarget": "gns3-web-ui:build:production"
|
||||||
|
},
|
||||||
|
"electronProd": {
|
||||||
|
"browserTarget": "gns3-web-ui:build:electronProd"
|
||||||
|
},
|
||||||
|
"electronDev": {
|
||||||
|
"browserTarget": "gns3-web-ui:build:electronDev"
|
||||||
|
},
|
||||||
|
"githubProd": {
|
||||||
|
"browserTarget": "gns3-web-ui:build:githubProd"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"extract-i18n": {
|
||||||
|
"builder": "@angular-devkit/build-angular:extract-i18n",
|
||||||
|
"options": {
|
||||||
|
"browserTarget": "gns3-web-ui:build"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"test": {
|
||||||
|
"builder": "@angular-devkit/build-angular:karma",
|
||||||
|
"options": {
|
||||||
|
"main": "src/test.ts",
|
||||||
|
"karmaConfig": "./karma.conf.js",
|
||||||
|
"polyfills": "src/polyfills.ts",
|
||||||
|
"tsConfig": "src/tsconfig.spec.json",
|
||||||
|
"scripts": [],
|
||||||
|
"styles": [
|
||||||
|
"node_modules/bootstrap/dist/css/bootstrap.min.css",
|
||||||
|
"src/styles.css",
|
||||||
|
"src/theme.scss"
|
||||||
|
],
|
||||||
|
"assets": [
|
||||||
|
"src/assets",
|
||||||
|
"src/favicon.ico"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"lint": {
|
||||||
|
"builder": "@angular-devkit/build-angular:tslint",
|
||||||
|
"options": {
|
||||||
|
"tsConfig": [
|
||||||
|
"src/tsconfig.app.json",
|
||||||
|
"src/tsconfig.spec.json"
|
||||||
|
],
|
||||||
|
"exclude": [
|
||||||
|
"**/node_modules/**"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"gns3-web-ui-e2e": {
|
||||||
|
"root": "",
|
||||||
|
"sourceRoot": "e2e",
|
||||||
|
"projectType": "application",
|
||||||
|
"architect": {
|
||||||
|
"e2e": {
|
||||||
|
"builder": "@angular-devkit/build-angular:protractor",
|
||||||
|
"options": {
|
||||||
|
"protractorConfig": "./protractor.conf.js",
|
||||||
|
"devServerTarget": "gns3-web-ui:serve"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"lint": {
|
||||||
|
"builder": "@angular-devkit/build-angular:tslint",
|
||||||
|
"options": {
|
||||||
|
"tsConfig": [
|
||||||
|
"e2e/tsconfig.e2e.json"
|
||||||
|
],
|
||||||
|
"exclude": [
|
||||||
|
"**/node_modules/**"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"defaultProject": "gns3-web-ui",
|
||||||
|
"schematics": {
|
||||||
|
"@schematics/angular:component": {
|
||||||
|
"prefix": "app",
|
||||||
|
"styleext": "scss"
|
||||||
|
},
|
||||||
|
"@schematics/angular:directive": {
|
||||||
|
"prefix": "app"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -4,24 +4,22 @@
|
|||||||
module.exports = function (config) {
|
module.exports = function (config) {
|
||||||
config.set({
|
config.set({
|
||||||
basePath: '',
|
basePath: '',
|
||||||
frameworks: ['jasmine', '@angular/cli'],
|
frameworks: ['jasmine', '@angular-devkit/build-angular'],
|
||||||
plugins: [
|
plugins: [
|
||||||
require('karma-jasmine'),
|
require('karma-jasmine'),
|
||||||
require('karma-chrome-launcher'),
|
require('karma-chrome-launcher'),
|
||||||
require('karma-jasmine-html-reporter'),
|
require('karma-jasmine-html-reporter'),
|
||||||
require('karma-coverage-istanbul-reporter'),
|
require('karma-coverage-istanbul-reporter'),
|
||||||
require('@angular/cli/plugins/karma')
|
require('@angular-devkit/build-angular/plugins/karma')
|
||||||
],
|
],
|
||||||
client:{
|
client:{
|
||||||
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
||||||
},
|
},
|
||||||
coverageIstanbulReporter: {
|
coverageIstanbulReporter: {
|
||||||
reports: [ 'html', 'lcovonly' ],
|
dir: require('path').join(__dirname, 'coverage'), reports: [ 'html', 'lcovonly' ],
|
||||||
fixWebpackSourcePaths: true
|
fixWebpackSourcePaths: true
|
||||||
},
|
},
|
||||||
angularCli: {
|
|
||||||
environment: 'dev'
|
|
||||||
},
|
|
||||||
reporters: ['progress', 'kjhtml'],
|
reporters: ['progress', 'kjhtml'],
|
||||||
port: 9876,
|
port: 9876,
|
||||||
colors: true,
|
colors: true,
|
||||||
|
71
package.json
71
package.json
@ -26,62 +26,63 @@
|
|||||||
},
|
},
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/animations": "^5.2.9",
|
"@angular/animations": "^6.0.7",
|
||||||
"@angular/cdk": "^5.2.4",
|
"@angular/cdk": "^6.3.2",
|
||||||
"@angular/common": "^5.2.9",
|
"@angular/common": "^6.0.7",
|
||||||
"@angular/compiler": "^5.2.9",
|
"@angular/compiler": "^6.0.7",
|
||||||
"@angular/core": "^5.2.9",
|
"@angular/core": "^6.0.7",
|
||||||
"@angular/forms": "^5.2.9",
|
"@angular/forms": "^6.0.7",
|
||||||
"@angular/http": "^5.2.9",
|
"@angular/http": "^6.0.7",
|
||||||
"@angular/material": "^5.2.4",
|
"@angular/material": "^6.3.2",
|
||||||
"@angular/platform-browser": "^5.2.9",
|
"@angular/platform-browser": "^6.0.7",
|
||||||
"@angular/platform-browser-dynamic": "^5.2.9",
|
"@angular/platform-browser-dynamic": "^6.0.7",
|
||||||
"@angular/router": "^5.2.9",
|
"@angular/router": "^6.0.7",
|
||||||
"@ng-bootstrap/ng-bootstrap": "^2.0.0-alpha.0",
|
"@ng-bootstrap/ng-bootstrap": "^2.2.0",
|
||||||
"angular-persistence": "^1.0.1",
|
"angular-persistence": "^1.0.1",
|
||||||
"angular2-hotkeys": "^2.0.4",
|
"angular2-hotkeys": "^2.1.2",
|
||||||
"angular2-indexeddb": "^1.2.2",
|
"angular2-indexeddb": "^1.2.2",
|
||||||
"bootstrap": "4.1.0",
|
"bootstrap": "4.1.1",
|
||||||
"core-js": "^2.5.5",
|
"core-js": "^2.5.7",
|
||||||
"css-tree": "^1.0.0-alpha.28",
|
"css-tree": "^1.0.0-alpha.29",
|
||||||
"d3-ng2-service": "^2.1.0",
|
"d3-ng2-service": "^2.1.0",
|
||||||
"electron-settings": "^3.1.4",
|
"electron-settings": "^3.2.0",
|
||||||
"material-design-icons": "^3.0.1",
|
"material-design-icons": "^3.0.1",
|
||||||
"ngx-electron": "^1.0.4",
|
"ngx-electron": "^1.0.4",
|
||||||
"npm-check-updates": "^2.14.1",
|
"npm-check-updates": "^2.14.1",
|
||||||
"raven-js": "^3.24.1",
|
"raven-js": "^3.24.1",
|
||||||
"rxjs": "^5.5.9",
|
"rxjs": "^6.2.1",
|
||||||
"typeface-roboto": "^0.0.54",
|
"typeface-roboto": "^0.0.54",
|
||||||
"yargs": "^11.0.0",
|
"yargs": "^12.0.1",
|
||||||
"zone.js": "^0.8.26"
|
"zone.js": "^0.8.26"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@angular/cli": "^1.7.4",
|
"@angular/cli": "^6.0.8",
|
||||||
"@angular/compiler-cli": "^5.2.9",
|
"@angular/compiler-cli": "^6.0.7",
|
||||||
"@angular/language-service": "^5.2.9",
|
"@angular/language-service": "^6.0.7",
|
||||||
"@sentry/electron": "^0.5.0",
|
"@sentry/electron": "^0.5.5",
|
||||||
"@types/jasmine": "~2.8.6",
|
"@types/jasmine": "~2.8.8",
|
||||||
"@types/jasminewd2": "~2.0.2",
|
"@types/jasminewd2": "~2.0.2",
|
||||||
"@types/node": "~9.6.4",
|
"@types/node": "~10.5.2",
|
||||||
"codelyzer": "~4.2.1",
|
"codelyzer": "~4.4.2",
|
||||||
"electron": "1.8.4",
|
"electron": "2.0.4",
|
||||||
"electron-builder": "^20.8.1",
|
"electron-builder": "^20.19.2",
|
||||||
"jasmine-core": "~3.1.0",
|
"jasmine-core": "~3.1.0",
|
||||||
"jasmine-spec-reporter": "~4.2.1",
|
"jasmine-spec-reporter": "~4.2.1",
|
||||||
"jquery": "^3.3.1",
|
"jquery": "^3.3.1",
|
||||||
"karma": "~2.0.0",
|
"karma": "~2.0.4",
|
||||||
"karma-chrome-launcher": "~2.2.0",
|
"karma-chrome-launcher": "~2.2.0",
|
||||||
"karma-cli": "~1.0.1",
|
"karma-cli": "~1.0.1",
|
||||||
"karma-coverage-istanbul-reporter": "^1.4.2",
|
"karma-coverage-istanbul-reporter": "^2.0.1",
|
||||||
"karma-jasmine": "~1.1.0",
|
"karma-jasmine": "~1.1.0",
|
||||||
"karma-jasmine-html-reporter": "^1.0.0",
|
"karma-jasmine-html-reporter": "^1.2.0",
|
||||||
"node-sass": "^4.8.3",
|
"node-sass": "^4.9.1",
|
||||||
"popper.js": "^1.14.3",
|
"popper.js": "^1.14.3",
|
||||||
"protractor": "~5.3.1",
|
"protractor": "~5.3.1",
|
||||||
"ts-mockito": "^2.3.0",
|
"ts-mockito": "^2.3.0",
|
||||||
"ts-node": "~5.0.1",
|
"ts-node": "~7.0.0",
|
||||||
"tslint": "~5.9.1",
|
"tslint": "~5.10.0",
|
||||||
"typescript": ">=2.4.2 <2.7.0"
|
"typescript": "^2.9.2",
|
||||||
|
"@angular-devkit/build-angular": "~0.6.8"
|
||||||
},
|
},
|
||||||
"greenkeeper": {
|
"greenkeeper": {
|
||||||
"ignore": [
|
"ignore": [
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { BehaviorSubject } from "rxjs/BehaviorSubject";
|
import { BehaviorSubject } from "rxjs";
|
||||||
|
|
||||||
export abstract class DataSource<T> {
|
export abstract class DataSource<T> {
|
||||||
protected data: T[] = [];
|
protected data: T[] = [];
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Subject} from "rxjs/Subject";
|
import { Subject} from "rxjs";
|
||||||
|
|
||||||
import { Node } from "../models/node";
|
import { Node } from "../models/node";
|
||||||
import { Link } from "../models/link";
|
import { Link } from "../models/link";
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { Injectable } from "@angular/core";
|
import { Injectable } from "@angular/core";
|
||||||
|
|
||||||
import { Subject } from "rxjs/Subject";
|
import { Subject } from "rxjs";
|
||||||
import { Subscription } from "rxjs/Subscription";
|
import { Subscription } from "rxjs";
|
||||||
|
|
||||||
import { NodesDataSource } from "../datasources/nodes-datasource";
|
import { NodesDataSource } from "../datasources/nodes-datasource";
|
||||||
import { LinksDataSource } from "../datasources/links-datasource";
|
import { LinksDataSource } from "../datasources/links-datasource";
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { Injectable } from "@angular/core";
|
import { Injectable } from "@angular/core";
|
||||||
import { mouse, select } from "d3-selection";
|
import { mouse, select } from "d3-selection";
|
||||||
import { Subject } from "rxjs/Subject";
|
import { Subject } from "rxjs";
|
||||||
|
|
||||||
import { SVGSelection } from "../models/types";
|
import { SVGSelection } from "../models/types";
|
||||||
import { Context } from "../models/context";
|
import { Context } from "../models/context";
|
||||||
|
@ -5,7 +5,7 @@ import { MatIconModule, MatProgressSpinnerModule } from "@angular/material";
|
|||||||
import { ProgressService } from "./progress.service";
|
import { ProgressService } from "./progress.service";
|
||||||
import { RouterTestingModule } from "@angular/router/testing";
|
import { RouterTestingModule } from "@angular/router/testing";
|
||||||
import { Router } from "@angular/router";
|
import { Router } from "@angular/router";
|
||||||
import { BehaviorSubject } from "rxjs/BehaviorSubject";
|
import { BehaviorSubject } from "rxjs";
|
||||||
|
|
||||||
|
|
||||||
class MockedRouter {
|
class MockedRouter {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { Component, OnDestroy, OnInit } from '@angular/core';
|
import { Component, OnDestroy, OnInit } from '@angular/core';
|
||||||
import { ProgressService } from "./progress.service";
|
import { ProgressService } from "./progress.service";
|
||||||
import { Router } from "@angular/router";
|
import { Router } from "@angular/router";
|
||||||
import { Subscription } from "rxjs/Subscription";
|
import { Subscription } from "rxjs";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-progress',
|
selector: 'app-progress',
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
|
|
||||||
import { BehaviorSubject } from "rxjs/BehaviorSubject";
|
import { BehaviorSubject } from "rxjs";
|
||||||
|
|
||||||
|
|
||||||
export class State {
|
export class State {
|
||||||
|
@ -1,21 +1,14 @@
|
|||||||
import {Component, ElementRef, Inject, OnInit, ViewChild} from '@angular/core';
|
import { Component, ElementRef, Inject, OnInit, ViewChild } from '@angular/core';
|
||||||
import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material";
|
import { MAT_DIALOG_DATA, MatDialogRef } from "@angular/material";
|
||||||
import {DataSource} from "@angular/cdk/collections";
|
import { DataSource } from "@angular/cdk/collections";
|
||||||
|
|
||||||
import {Observable} from "rxjs/Observable";
|
import { Observable, BehaviorSubject, fromEvent, merge } from "rxjs";
|
||||||
import {BehaviorSubject} from "rxjs/BehaviorSubject";
|
import { debounceTime, distinctUntilChanged, map } from "rxjs/operators";
|
||||||
|
|
||||||
import { Server } from "../../../models/server";
|
import { Server } from "../../../models/server";
|
||||||
import { ApplianceService } from "../../../services/appliance.service";
|
import { ApplianceService } from "../../../services/appliance.service";
|
||||||
import { Appliance } from "../../../models/appliance";
|
import { Appliance } from "../../../models/appliance";
|
||||||
|
|
||||||
import 'rxjs/add/operator/startWith';
|
|
||||||
import 'rxjs/add/observable/merge';
|
|
||||||
import 'rxjs/add/operator/map';
|
|
||||||
import 'rxjs/add/operator/debounceTime';
|
|
||||||
import 'rxjs/add/operator/distinctUntilChanged';
|
|
||||||
import 'rxjs/add/observable/fromEvent';
|
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-appliance-list-dialog',
|
selector: 'app-appliance-list-dialog',
|
||||||
@ -41,9 +34,10 @@ export class ApplianceListDialogComponent implements OnInit {
|
|||||||
this.applianceDatabase = new ApplianceDatabase(this.server, this.applianceService);
|
this.applianceDatabase = new ApplianceDatabase(this.server, this.applianceService);
|
||||||
this.dataSource = new ApplianceDataSource(this.applianceDatabase);
|
this.dataSource = new ApplianceDataSource(this.applianceDatabase);
|
||||||
|
|
||||||
Observable.fromEvent(this.filter.nativeElement, 'keyup')
|
fromEvent(this.filter.nativeElement, 'keyup').pipe(
|
||||||
.debounceTime(150)
|
debounceTime(150),
|
||||||
.distinctUntilChanged()
|
distinctUntilChanged()
|
||||||
|
)
|
||||||
.subscribe(() => {
|
.subscribe(() => {
|
||||||
if (!this.dataSource) { return; }
|
if (!this.dataSource) { return; }
|
||||||
this.dataSource.filter = this.filter.nativeElement.value;
|
this.dataSource.filter = this.filter.nativeElement.value;
|
||||||
@ -95,12 +89,12 @@ export class ApplianceDataSource extends DataSource<Appliance> {
|
|||||||
this.filterChange,
|
this.filterChange,
|
||||||
];
|
];
|
||||||
|
|
||||||
return Observable.merge(...displayDataChanges).map(() => {
|
return merge(...displayDataChanges).pipe(map(() => {
|
||||||
return this.applianceDatabase.data.slice().filter((item: Appliance) => {
|
return this.applianceDatabase.data.slice().filter((item: Appliance) => {
|
||||||
const searchStr = (item.name).toLowerCase();
|
const searchStr = (item.name).toLowerCase();
|
||||||
return searchStr.indexOf(this.filter.toLowerCase()) !== -1;
|
return searchStr.indexOf(this.filter.toLowerCase()) !== -1;
|
||||||
});
|
});
|
||||||
});
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
disconnect() {}
|
disconnect() {}
|
||||||
|
@ -4,7 +4,7 @@ import { inject } from "@angular/core/testing";
|
|||||||
|
|
||||||
import { mock, instance, capture, when } from "ts-mockito";
|
import { mock, instance, capture, when } from "ts-mockito";
|
||||||
import { HotkeyModule, HotkeysService, Hotkey } from "angular2-hotkeys";
|
import { HotkeyModule, HotkeysService, Hotkey } from "angular2-hotkeys";
|
||||||
import { Observable } from "rxjs";
|
import { Observable, of } from "rxjs";
|
||||||
|
|
||||||
import { ProjectMapShortcutsComponent } from './project-map-shortcuts.component';
|
import { ProjectMapShortcutsComponent } from './project-map-shortcuts.component';
|
||||||
import { ToasterService, } from "../../../services/toaster.service";
|
import { ToasterService, } from "../../../services/toaster.service";
|
||||||
@ -18,6 +18,7 @@ import { ProjectService } from "../../../services/project.service";
|
|||||||
import { MockedProjectService } from "../../../services/project.service.spec";
|
import { MockedProjectService } from "../../../services/project.service.spec";
|
||||||
import { SettingsService } from "../../../services/settings.service";
|
import { SettingsService } from "../../../services/settings.service";
|
||||||
import { MockedToasterService } from "../../../services/toaster.service.spec";
|
import { MockedToasterService } from "../../../services/toaster.service.spec";
|
||||||
|
import { mapTo } from "rxjs/internal/operators";
|
||||||
|
|
||||||
|
|
||||||
describe('ProjectMapShortcutsComponent', () => {
|
describe('ProjectMapShortcutsComponent', () => {
|
||||||
@ -82,7 +83,7 @@ describe('ProjectMapShortcutsComponent', () => {
|
|||||||
|
|
||||||
when(selectionManagerMock.getSelectedNodes()).thenReturn([node]);
|
when(selectionManagerMock.getSelectedNodes()).thenReturn([node]);
|
||||||
when(nodeServiceMock.delete(server, node))
|
when(nodeServiceMock.delete(server, node))
|
||||||
.thenReturn(Observable.of(node).mapTo(null));
|
.thenReturn(of(node).pipe(mapTo(null)));
|
||||||
|
|
||||||
component.project = project;
|
component.project = project;
|
||||||
component.server = server;
|
component.server = server;
|
||||||
|
@ -1,15 +1,9 @@
|
|||||||
import { Component, Inject, OnDestroy, OnInit, ViewChild, ViewEncapsulation } from '@angular/core';
|
import { Component, Inject, OnDestroy, OnInit, ViewChild, ViewEncapsulation } from '@angular/core';
|
||||||
import { ActivatedRoute, ParamMap } from '@angular/router';
|
import { ActivatedRoute, ParamMap } from '@angular/router';
|
||||||
|
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable, Subject, Subscription, from } from 'rxjs';
|
||||||
import { Subject } from "rxjs/Subject";
|
import { webSocket } from "rxjs/webSocket";
|
||||||
|
import { map, mergeMap } from "rxjs/operators";
|
||||||
import 'rxjs/add/operator/switchMap';
|
|
||||||
import 'rxjs/add/operator/mergeMap';
|
|
||||||
import 'rxjs/add/observable/forkJoin';
|
|
||||||
import 'rxjs/add/observable/fromPromise';
|
|
||||||
import 'rxjs/add/observable/dom/webSocket';
|
|
||||||
|
|
||||||
|
|
||||||
import { Project } from '../../models/project';
|
import { Project } from '../../models/project';
|
||||||
import { Node } from '../../cartography/models/node';
|
import { Node } from '../../cartography/models/node';
|
||||||
@ -39,7 +33,6 @@ import { ProjectWebServiceHandler } from "../../handlers/project-web-service-han
|
|||||||
import { SelectionManager } from "../../cartography/managers/selection-manager";
|
import { SelectionManager } from "../../cartography/managers/selection-manager";
|
||||||
import { InRectangleHelper } from "../../cartography/components/map/helpers/in-rectangle-helper";
|
import { InRectangleHelper } from "../../cartography/components/map/helpers/in-rectangle-helper";
|
||||||
import { DrawingsDataSource } from "../../cartography/datasources/drawings-datasource";
|
import { DrawingsDataSource } from "../../cartography/datasources/drawings-datasource";
|
||||||
import { Subscription } from "rxjs/Subscription";
|
|
||||||
import { SettingsService } from "../../services/settings.service";
|
import { SettingsService } from "../../services/settings.service";
|
||||||
import { ProgressService } from "../../common/progress/progress.service";
|
import { ProgressService } from "../../common/progress/progress.service";
|
||||||
|
|
||||||
@ -102,19 +95,19 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
const routeSub = this.route.paramMap.subscribe((paramMap: ParamMap) => {
|
const routeSub = this.route.paramMap.subscribe((paramMap: ParamMap) => {
|
||||||
const server_id = parseInt(paramMap.get('server_id'), 10);
|
const server_id = parseInt(paramMap.get('server_id'), 10);
|
||||||
Observable
|
|
||||||
.fromPromise(this.serverService.get(server_id))
|
from(this.serverService.get(server_id)).pipe(
|
||||||
.flatMap((server: Server) => {
|
mergeMap((server: Server) => {
|
||||||
this.server = server;
|
this.server = server;
|
||||||
return this.projectService.get(server, paramMap.get('project_id')).map((project) => {
|
return this.projectService.get(server, paramMap.get('project_id')).pipe(map((project) => {
|
||||||
return project;
|
return project;
|
||||||
});
|
}));
|
||||||
})
|
}),
|
||||||
.flatMap((project: Project) => {
|
mergeMap((project: Project) => {
|
||||||
this.project = project;
|
this.project = project;
|
||||||
|
|
||||||
if (this.project.status === 'opened') {
|
if (this.project.status === 'opened') {
|
||||||
return new Observable((observer) => {
|
return new Observable<Project>((observer) => {
|
||||||
observer.next(this.project);
|
observer.next(this.project);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@ -122,6 +115,7 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
|
|||||||
this.server, this.project.project_id);
|
this.server, this.project.project_id);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
)
|
||||||
.subscribe((project: Project) => {
|
.subscribe((project: Project) => {
|
||||||
this.onProjectLoad(project);
|
this.onProjectLoad(project);
|
||||||
}, (error) => {
|
}, (error) => {
|
||||||
@ -172,17 +166,19 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
const subscription = this.symbolService
|
const subscription = this.symbolService
|
||||||
.load(this.server)
|
.load(this.server)
|
||||||
.flatMap(() => {
|
.pipe(
|
||||||
|
mergeMap(() => {
|
||||||
return this.projectService.nodes(this.server, project.project_id);
|
return this.projectService.nodes(this.server, project.project_id);
|
||||||
})
|
}),
|
||||||
.flatMap((nodes: Node[]) => {
|
mergeMap((nodes: Node[]) => {
|
||||||
this.nodesDataSource.set(nodes);
|
this.nodesDataSource.set(nodes);
|
||||||
return this.projectService.links(this.server, project.project_id);
|
return this.projectService.links(this.server, project.project_id);
|
||||||
})
|
}),
|
||||||
.flatMap((links: Link[]) => {
|
mergeMap((links: Link[]) => {
|
||||||
this.linksDataSource.set(links);
|
this.linksDataSource.set(links);
|
||||||
return this.projectService.drawings(this.server, project.project_id);
|
return this.projectService.drawings(this.server, project.project_id);
|
||||||
})
|
})
|
||||||
|
)
|
||||||
.subscribe((drawings: Drawing[]) => {
|
.subscribe((drawings: Drawing[]) => {
|
||||||
this.drawingsDataSource.set(drawings);
|
this.drawingsDataSource.set(drawings);
|
||||||
|
|
||||||
@ -195,7 +191,7 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setUpWS(project: Project) {
|
setUpWS(project: Project) {
|
||||||
this.ws = Observable.webSocket(
|
this.ws = webSocket(
|
||||||
this.projectService.notificationsPath(this.server, project.project_id));
|
this.projectService.notificationsPath(this.server, project.project_id));
|
||||||
|
|
||||||
this.subscriptions.push(
|
this.subscriptions.push(
|
||||||
|
@ -1,8 +1,11 @@
|
|||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { MatIconModule, MatSortModule, MatTableModule, MatTooltipModule } from "@angular/material";
|
import { MatIconModule, MatSortModule, MatTableModule, MatTooltipModule } from "@angular/material";
|
||||||
|
import { RouterTestingModule } from "@angular/router/testing";
|
||||||
|
import { NoopAnimationsModule } from "@angular/platform-browser/animations";
|
||||||
|
|
||||||
|
import { Observable, of } from "rxjs";
|
||||||
|
|
||||||
import { ProjectsComponent } from './projects.component';
|
import { ProjectsComponent } from './projects.component';
|
||||||
import { RouterTestingModule } from "@angular/router/testing";
|
|
||||||
import { ServerService } from "../../services/server.service";
|
import { ServerService } from "../../services/server.service";
|
||||||
import { MockedServerService } from "../../services/server.service.spec";
|
import { MockedServerService } from "../../services/server.service.spec";
|
||||||
import { ProjectService } from "../../services/project.service";
|
import { ProjectService } from "../../services/project.service";
|
||||||
@ -10,9 +13,7 @@ import { MockedProjectService } from "../../services/project.service.spec";
|
|||||||
import { SettingsService } from "../../services/settings.service";
|
import { SettingsService } from "../../services/settings.service";
|
||||||
import { MockedSettingsService } from "../../services/settings.service.spec";
|
import { MockedSettingsService } from "../../services/settings.service.spec";
|
||||||
import { ProgressService } from "../../common/progress/progress.service";
|
import { ProgressService } from "../../common/progress/progress.service";
|
||||||
import { NoopAnimationsModule } from "@angular/platform-browser/animations";
|
|
||||||
import { Server } from "../../models/server";
|
import { Server } from "../../models/server";
|
||||||
import { Observable } from "rxjs/Observable";
|
|
||||||
import { Settings } from "../../services/settings.service";
|
import { Settings } from "../../services/settings.service";
|
||||||
import { Project } from "../../models/project";
|
import { Project } from "../../models/project";
|
||||||
|
|
||||||
@ -58,7 +59,7 @@ describe('ProjectsComponent', () => {
|
|||||||
|
|
||||||
spyOn(serverService, 'get').and.returnValue(Promise.resolve(server));
|
spyOn(serverService, 'get').and.returnValue(Promise.resolve(server));
|
||||||
spyOn(settingsService, 'getAll').and.returnValue(settings);
|
spyOn(settingsService, 'getAll').and.returnValue(settings);
|
||||||
spyOn(projectService, 'list').and.returnValue(Observable.of([]));
|
spyOn(projectService, 'list').and.returnValue(of([]));
|
||||||
|
|
||||||
spyOn(progressService, 'activate');
|
spyOn(progressService, 'activate');
|
||||||
spyOn(progressService, 'deactivate');
|
spyOn(progressService, 'deactivate');
|
||||||
@ -82,7 +83,7 @@ describe('ProjectsComponent', () => {
|
|||||||
project = new Project();
|
project = new Project();
|
||||||
project.project_id = "1";
|
project.project_id = "1";
|
||||||
|
|
||||||
spyOn(projectService, 'open').and.returnValue(Observable.of(project));
|
spyOn(projectService, 'open').and.returnValue(of(project));
|
||||||
|
|
||||||
component.server = server;
|
component.server = server;
|
||||||
});
|
});
|
||||||
@ -104,7 +105,7 @@ describe('ProjectsComponent', () => {
|
|||||||
project = new Project();
|
project = new Project();
|
||||||
project.project_id = "1";
|
project.project_id = "1";
|
||||||
|
|
||||||
spyOn(projectService, 'close').and.returnValue(Observable.of(project));
|
spyOn(projectService, 'close').and.returnValue(of(project));
|
||||||
|
|
||||||
component.server = server;
|
component.server = server;
|
||||||
});
|
});
|
||||||
|
@ -2,13 +2,15 @@ import { Component, OnInit, ViewChild } from '@angular/core';
|
|||||||
import { ActivatedRoute, ParamMap } from '@angular/router';
|
import { ActivatedRoute, ParamMap } from '@angular/router';
|
||||||
import { MatSort, MatSortable } from "@angular/material";
|
import { MatSort, MatSortable } from "@angular/material";
|
||||||
|
|
||||||
|
import { DataSource } from "@angular/cdk/collections";
|
||||||
|
|
||||||
|
import { map, switchMap } from "rxjs//operators";
|
||||||
|
import { BehaviorSubject, Observable, merge } from "rxjs";
|
||||||
|
|
||||||
import { Project } from "../../models/project";
|
import { Project } from "../../models/project";
|
||||||
import { ProjectService } from "../../services/project.service";
|
import { ProjectService } from "../../services/project.service";
|
||||||
import { Server } from "../../models/server";
|
import { Server } from "../../models/server";
|
||||||
import { ServerService } from "../../services/server.service";
|
import { ServerService } from "../../services/server.service";
|
||||||
import { BehaviorSubject } from "rxjs/BehaviorSubject";
|
|
||||||
import { DataSource } from "@angular/cdk/collections";
|
|
||||||
import { Observable } from "rxjs/Observable";
|
|
||||||
import { SettingsService, Settings } from "../../services/settings.service";
|
import { SettingsService, Settings } from "../../services/settings.service";
|
||||||
import { ProgressService } from "../../common/progress/progress.service";
|
import { ProgressService } from "../../common/progress/progress.service";
|
||||||
|
|
||||||
@ -45,10 +47,12 @@ export class ProjectsComponent implements OnInit {
|
|||||||
this.dataSource = new ProjectDataSource(this.projectDatabase, this.sort);
|
this.dataSource = new ProjectDataSource(this.projectDatabase, this.sort);
|
||||||
|
|
||||||
this.route.paramMap
|
this.route.paramMap
|
||||||
.switchMap((params: ParamMap) => {
|
.pipe(
|
||||||
|
switchMap((params: ParamMap) => {
|
||||||
const server_id = params.get('server_id');
|
const server_id = params.get('server_id');
|
||||||
return this.serverService.get(parseInt(server_id, 10));
|
return this.serverService.get(parseInt(server_id, 10));
|
||||||
})
|
})
|
||||||
|
)
|
||||||
.subscribe((server: Server) => {
|
.subscribe((server: Server) => {
|
||||||
this.server = server;
|
this.server = server;
|
||||||
this.refresh();
|
this.refresh();
|
||||||
@ -127,7 +131,7 @@ export class ProjectDataSource extends DataSource<any> {
|
|||||||
this.sort.sortChange,
|
this.sort.sortChange,
|
||||||
];
|
];
|
||||||
|
|
||||||
return Observable.merge(...displayDataChanges).map(() => {
|
return merge(...displayDataChanges).pipe(map(() => {
|
||||||
if (!this.sort.active || this.sort.direction === '') {
|
if (!this.sort.active || this.sort.direction === '') {
|
||||||
return this.projectDatabase.data;
|
return this.projectDatabase.data;
|
||||||
}
|
}
|
||||||
@ -141,7 +145,7 @@ export class ProjectDataSource extends DataSource<any> {
|
|||||||
|
|
||||||
return (valueA < valueB ? -1 : 1) * (this.sort.direction === 'asc' ? 1 : -1);
|
return (valueA < valueB ? -1 : 1) * (this.sort.direction === 'asc' ? 1 : -1);
|
||||||
});
|
});
|
||||||
});
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
disconnect() {}
|
disconnect() {}
|
||||||
|
@ -2,15 +2,15 @@ import { Component, Inject, OnInit } from '@angular/core';
|
|||||||
import { DataSource } from "@angular/cdk/collections";
|
import { DataSource } from "@angular/cdk/collections";
|
||||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
|
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
|
||||||
|
|
||||||
import { Observable } from "rxjs/Observable";
|
import { Observable, BehaviorSubject, merge } from "rxjs";
|
||||||
import { BehaviorSubject } from "rxjs/BehaviorSubject";
|
import { map } from "rxjs/operators";
|
||||||
|
|
||||||
import 'rxjs/add/operator/startWith';
|
// import 'rxjs/add/operator/startWith';
|
||||||
import 'rxjs/add/observable/merge';
|
// import 'rxjs/add/observable/merge';
|
||||||
import 'rxjs/add/operator/map';
|
// import 'rxjs/add/operator/map';
|
||||||
import 'rxjs/add/operator/debounceTime';
|
// import 'rxjs/add/operator/debounceTime';
|
||||||
import 'rxjs/add/operator/distinctUntilChanged';
|
// import 'rxjs/add/operator/distinctUntilChanged';
|
||||||
import 'rxjs/add/observable/fromEvent';
|
// import 'rxjs/add/observable/fromEvent';
|
||||||
|
|
||||||
import { Server } from "../../models/server";
|
import { Server } from "../../models/server";
|
||||||
import { ServerService } from "../../services/server.service";
|
import { ServerService } from "../../services/server.service";
|
||||||
@ -121,9 +121,10 @@ export class ServerDataSource extends DataSource<Server> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
connect(): Observable<Server[]> {
|
connect(): Observable<Server[]> {
|
||||||
return Observable.merge(this.serverDatabase.dataChange).map(() => {
|
return merge(this.serverDatabase.dataChange).pipe(
|
||||||
|
map(() => {
|
||||||
return this.serverDatabase.data;
|
return this.serverDatabase.data;
|
||||||
});
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
disconnect() {}
|
disconnect() {}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { inject, TestBed } from "@angular/core/testing";
|
import { inject, TestBed } from "@angular/core/testing";
|
||||||
|
|
||||||
import { Subject } from "rxjs/Subject";
|
import { Subject } from "rxjs";
|
||||||
|
|
||||||
import { ProjectWebServiceHandler, WebServiceMessage } from "./project-web-service-handler";
|
import { ProjectWebServiceHandler, WebServiceMessage } from "./project-web-service-handler";
|
||||||
import { NodesDataSource } from "../cartography/datasources/nodes-datasource";
|
import { NodesDataSource } from "../cartography/datasources/nodes-datasource";
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Injectable } from "@angular/core";
|
import { Injectable } from "@angular/core";
|
||||||
import { Subject } from "rxjs/Subject";
|
import { Subject } from "rxjs";
|
||||||
|
|
||||||
import { NodesDataSource } from "../cartography/datasources/nodes-datasource";
|
import { NodesDataSource } from "../cartography/datasources/nodes-datasource";
|
||||||
import { LinksDataSource } from "../cartography/datasources/links-datasource";
|
import { LinksDataSource } from "../cartography/datasources/links-datasource";
|
||||||
|
@ -4,7 +4,7 @@ import 'rxjs/add/operator/map';
|
|||||||
import { Server } from "../models/server";
|
import { Server } from "../models/server";
|
||||||
import { HttpServer } from "./http-server.service";
|
import { HttpServer } from "./http-server.service";
|
||||||
import {Appliance} from "../models/appliance";
|
import {Appliance} from "../models/appliance";
|
||||||
import {Observable} from "rxjs/Observable";
|
import {Observable} from "rxjs";
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class ApplianceService {
|
export class ApplianceService {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { HttpHeaders, HttpClient, HttpParams, HttpErrorResponse } from '@angular/common/http';
|
import { HttpHeaders, HttpClient, HttpParams, HttpErrorResponse } from '@angular/common/http';
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
import {Server} from "../models/server";
|
import {Server} from "../models/server";
|
||||||
import { catchError } from "rxjs/operators";
|
import { catchError } from "rxjs/operators";
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Project } from '../models/project';
|
import { Project } from '../models/project';
|
||||||
import { Node } from '../cartography/models/node';
|
import { Node } from '../cartography/models/node';
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
import 'rxjs/add/operator/map';
|
import 'rxjs/add/operator/map';
|
||||||
import { Server } from "../models/server";
|
import { Server } from "../models/server";
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { TestBed, inject } from '@angular/core/testing';
|
import { TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
import { HttpTestingController, HttpClientTestingModule } from '@angular/common/http/testing';
|
import { HttpTestingController, HttpClientTestingModule } from '@angular/common/http/testing';
|
||||||
@ -8,7 +8,7 @@ import { getTestServer } from './testing';
|
|||||||
import { ProjectService } from './project.service';
|
import { ProjectService } from './project.service';
|
||||||
import { SettingsService } from "./settings.service";
|
import { SettingsService } from "./settings.service";
|
||||||
import { MockedSettingsService } from "./settings.service.spec";
|
import { MockedSettingsService } from "./settings.service.spec";
|
||||||
import { Observable } from "rxjs/Observable";
|
import { Observable, of } from "rxjs";
|
||||||
import { Project } from "../models/project";
|
import { Project } from "../models/project";
|
||||||
import { AppTestingModule } from "../testing/app-testing/app-testing.module";
|
import { AppTestingModule } from "../testing/app-testing/app-testing.module";
|
||||||
|
|
||||||
@ -21,15 +21,15 @@ export class MockedProjectService {
|
|||||||
public projects: Project[] = [];
|
public projects: Project[] = [];
|
||||||
|
|
||||||
list(server: Server) {
|
list(server: Server) {
|
||||||
return Observable.of(this.projects);
|
return of(this.projects);
|
||||||
}
|
}
|
||||||
|
|
||||||
open(server: Server, project: Project) {
|
open(server: Server, project: Project) {
|
||||||
return Observable.of(project);
|
return of(project);
|
||||||
}
|
}
|
||||||
|
|
||||||
close(server: Server, project: Project) {
|
close(server: Server, project: Project) {
|
||||||
return Observable.of(project);
|
return of(project);
|
||||||
}
|
}
|
||||||
|
|
||||||
isReadOnly(project) {
|
isReadOnly(project) {
|
||||||
|
@ -1,13 +1,12 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Project } from '../models/project';
|
import { Project } from '../models/project';
|
||||||
import { Node } from '../cartography/models/node';
|
import { Node } from '../cartography/models/node';
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
import 'rxjs/add/operator/map';
|
|
||||||
import { Link } from "../cartography/models/link";
|
import { Link } from "../cartography/models/link";
|
||||||
import { Server } from "../models/server";
|
import { Server } from "../models/server";
|
||||||
import { HttpServer } from "./http-server.service";
|
import { HttpServer } from "./http-server.service";
|
||||||
import {Drawing} from "../cartography/models/drawing";
|
import { Drawing } from "../cartography/models/drawing";
|
||||||
import { SettingsService } from "./settings.service";
|
import { SettingsService } from "./settings.service";
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
|
|||||||
|
|
||||||
import {IndexedDbService} from "./indexed-db.service";
|
import {IndexedDbService} from "./indexed-db.service";
|
||||||
import {Server} from "../models/server";
|
import {Server} from "../models/server";
|
||||||
import { Observable } from "rxjs/Observable";
|
import { Observable } from "rxjs";
|
||||||
|
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { PersistenceService, StorageType } from "angular-persistence";
|
import { PersistenceService, StorageType } from "angular-persistence";
|
||||||
import { Subject } from "rxjs/Subject";
|
import { Subject } from "rxjs";
|
||||||
import { BehaviorSubject } from "rxjs/BehaviorSubject";
|
import { BehaviorSubject } from "rxjs";
|
||||||
|
|
||||||
|
|
||||||
export interface Settings {
|
export interface Settings {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import {Server} from "../models/server";
|
import {Server} from "../models/server";
|
||||||
import {Observable} from "rxjs/Observable";
|
import {Observable} from "rxjs";
|
||||||
import {HttpServer} from "./http-server.service";
|
import {HttpServer} from "./http-server.service";
|
||||||
import {Snapshot} from "../models/snapshot";
|
import {Snapshot} from "../models/snapshot";
|
||||||
|
|
||||||
|
@ -1,10 +1,5 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { BehaviorSubject, forkJoin, Observable } from 'rxjs';
|
||||||
import { BehaviorSubject } from "rxjs/BehaviorSubject";
|
|
||||||
|
|
||||||
import 'rxjs/add/operator/map';
|
|
||||||
import 'rxjs/add/observable/forkJoin';
|
|
||||||
import 'rxjs/add/observable/of';
|
|
||||||
|
|
||||||
import { Symbol } from '../cartography/models/symbol';
|
import { Symbol } from '../cartography/models/symbol';
|
||||||
import { Server } from "../models/server";
|
import { Server } from "../models/server";
|
||||||
@ -26,7 +21,7 @@ export class SymbolService {
|
|||||||
load(server: Server): Observable<Symbol[]> {
|
load(server: Server): Observable<Symbol[]> {
|
||||||
const subscription = this.list(server).subscribe((symbols: Symbol[]) => {
|
const subscription = this.list(server).subscribe((symbols: Symbol[]) => {
|
||||||
const streams = symbols.map(symbol => this.raw(server, symbol.symbol_id));
|
const streams = symbols.map(symbol => this.raw(server, symbol.symbol_id));
|
||||||
Observable.forkJoin(streams).subscribe((results) => {
|
forkJoin(streams).subscribe((results) => {
|
||||||
symbols.forEach((symbol: Symbol, i: number) => {
|
symbols.forEach((symbol: Symbol, i: number) => {
|
||||||
symbol.raw = results[i];
|
symbol.raw = results[i];
|
||||||
});
|
});
|
||||||
|
@ -11,7 +11,8 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"test.ts"
|
"test.ts",
|
||||||
|
"polyfills.ts"
|
||||||
],
|
],
|
||||||
"include": [
|
"include": [
|
||||||
"**/*.spec.ts",
|
"**/*.spec.ts",
|
||||||
|
@ -14,8 +14,7 @@
|
|||||||
"eofline": true,
|
"eofline": true,
|
||||||
"forin": true,
|
"forin": true,
|
||||||
"import-blacklist": [
|
"import-blacklist": [
|
||||||
true,
|
true
|
||||||
"rxjs"
|
|
||||||
],
|
],
|
||||||
"import-spacing": true,
|
"import-spacing": true,
|
||||||
"indent": [
|
"indent": [
|
||||||
|
Loading…
Reference in New Issue
Block a user