From 9c87de7be44a120876570f6c6662c22163bd31b0 Mon Sep 17 00:00:00 2001 From: G4br13l3 Date: Mon, 3 Jul 2017 15:14:30 +0100 Subject: [PATCH] Migration launching fixed. News-box resized and repositioned; requests' codes handling updated. --- .../newsbox/newsbox.component.html | 4 +-- .../newsbox/newsbox.component.ts | 32 +++++++++++++------ .../teleporter/teleporter.component.ts | 10 +++--- src/views/login.html | 2 +- 4 files changed, 32 insertions(+), 16 deletions(-) diff --git a/src/app/administration/newsbox/newsbox.component.html b/src/app/administration/newsbox/newsbox.component.html index 0dbd1e3f..79e48286 100644 --- a/src/app/administration/newsbox/newsbox.component.html +++ b/src/app/administration/newsbox/newsbox.component.html @@ -1,9 +1,9 @@ -
+
 News
-
+
diff --git a/src/app/administration/newsbox/newsbox.component.ts b/src/app/administration/newsbox/newsbox.component.ts index 7b214b11..d79d6ae8 100644 --- a/src/app/administration/newsbox/newsbox.component.ts +++ b/src/app/administration/newsbox/newsbox.component.ts @@ -1,4 +1,4 @@ -import {Component, OnInit, EventEmitter, Input, ViewChild} from '@angular/core'; +import {Component, OnInit, Input} from '@angular/core'; import {AgentService,DBService} from "../../core/services/"; @@ -11,10 +11,12 @@ declare var angular:any @Component({ selector: 'news-box', templateUrl: "./newsbox.component.html", - styleUrls: [] }) -class NewsBoxComponent { +class NewsBoxComponent implements OnInit { + + @Input() boxHeight: String; + @Input() boxMarginTop: String; private orientdbVersion; @@ -39,6 +41,16 @@ class NewsBoxComponent { } + ngOnInit() { + if(this.boxHeight === undefined) { + this.boxHeight = "420px"; + } + + if(this.boxMarginTop === undefined) { + this.boxMarginTop = "40px"; + } + } + makeRequestAccordingVersionAndEdition() { // agent @@ -61,11 +73,13 @@ class NewsBoxComponent { var self = this; var xmlHttp = new XMLHttpRequest(); xmlHttp.onreadystatechange = function() { - if (xmlHttp.readyState == 4 && xmlHttp.status == 200) { - callback.call(self, xmlHttp.responseText); - } - else { - self.newsHTMLPlainText = self.errorHTMLPLainText; + if (xmlHttp.readyState == 4) { + if (xmlHttp.status == 200) { + callback.call(self, xmlHttp.responseText); + } + else { + self.newsHTMLPlainText = self.errorHTMLPLainText; + } } } xmlHttp.open("GET", theUrl, true); // true for asynchronous @@ -85,7 +99,7 @@ class NewsBoxComponent { angular.module('newsbox.component', []).directive( `newsBox`, - downgradeComponent({component: NewsBoxComponent})); + downgradeComponent({component: NewsBoxComponent, inputs: ["boxHeight", "boxMarginTop"]})); export {NewsBoxComponent}; diff --git a/src/app/administration/teleporter/teleporter.component.ts b/src/app/administration/teleporter/teleporter.component.ts index e7914b38..27418899 100644 --- a/src/app/administration/teleporter/teleporter.component.ts +++ b/src/app/administration/teleporter/teleporter.component.ts @@ -302,11 +302,13 @@ class TeleporterComponent implements AfterViewChecked { // invalidate the old migration config this.modellingConfig = undefined; this.selectedElement = undefined; - this.graphPanel.invalidateMigrationConfig(); + if(this.graphPanel !== undefined) { + this.graphPanel.invalidateMigrationConfig(); + } - this.teleporterService.launch(this.config).then((data) => { - this.step = "running"; - this.jobRunning = true; + this.step = "running"; + this.jobRunning = true; + this.teleporterService.launch(this.config).then(() => { this.status(); }).catch(function (error) { alert("Error during migration!") diff --git a/src/views/login.html b/src/views/login.html index cb2bef68..cd404f5d 100644 --- a/src/views/login.html +++ b/src/views/login.html @@ -95,7 +95,7 @@
-
+