Skip to content

Commit

Permalink
Migration launching fixed. News-box resized and repositioned; request…
Browse files Browse the repository at this point in the history
…s' codes handling updated.
  • Loading branch information
G4br13l3 committed Jul 3, 2017
1 parent 22e82c2 commit 9c87de7
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/app/administration/newsbox/newsbox.component.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<div class="panel panel-default" style="margin-top: 100px; margin-left: 30px;">
<div class="panel panel-default" [ngStyle]="{'margin-top': boxMarginTop, 'margin-left': '30px'}">
<div class="panel-heading">
<i class="fa fa-newspaper-o" aria-hidden="true"></i>
&nbsp;<b>News</b>
</div>
<div class="panel-body" style="height: 400px; overflow: auto; padding: 20px;">
<div class="panel-body" [ngStyle]="{'height': boxHeight, 'overflow': 'auto', 'padding': '20px'}">

<div [innerHTML]="newsHTMLPlainText">
</div>
Expand Down
32 changes: 23 additions & 9 deletions src/app/administration/newsbox/newsbox.component.ts
Original file line number Diff line number Diff line change
@@ -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/";


Expand All @@ -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;

Expand All @@ -39,6 +41,16 @@ class NewsBoxComponent {

}

ngOnInit() {
if(this.boxHeight === undefined) {
this.boxHeight = "420px";
}

if(this.boxMarginTop === undefined) {
this.boxMarginTop = "40px";
}
}

makeRequestAccordingVersionAndEdition() {

// agent
Expand All @@ -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
Expand All @@ -85,7 +99,7 @@ class NewsBoxComponent {

angular.module('newsbox.component', []).directive(
`newsBox`,
downgradeComponent({component: NewsBoxComponent}));
downgradeComponent({component: NewsBoxComponent, inputs: ["boxHeight", "boxMarginTop"]}));


export {NewsBoxComponent};
10 changes: 6 additions & 4 deletions src/app/administration/teleporter/teleporter.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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!")
Expand Down
2 changes: 1 addition & 1 deletion src/views/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
</div>
</div>
</div>
<div class="col-md-6">
<div class="col-md-5 col-sm-5 col-lg-6">
<news-box></news-box>
</div>

Expand Down

0 comments on commit 9c87de7

Please sign in to comment.