Skip to content

Commit

Permalink
reenabled travis test, minor layout changes, reactivated parseYamle
Browse files Browse the repository at this point in the history
  • Loading branch information
RINO767 authored and RINO767 committed Dec 18, 2018
1 parent 6e71449 commit ab5ec78
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ branches:
before_script:
- npm install -g @angular/cli
script:
# - ng test --watch=false --browsers=ChromeHeadlessNoSandbox --environment=prod --reporters=progress,kjhtml
- npm run travis-test
- ng build --prod
after_success:
- ci/publish_docker.sh
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"start": "ng serve",
"build": "ng build",
"test": "ng test --browsers=Chrome --source-map=false",
"travis-test": "ng test --watch=false --environemt=prod --browsers=ChromeHeadlessNoSandbox --reporters=progress,kjhtml",
"lint": "ng lint",
"e2e": "ng e2e",
"compodoc": "npx compodoc",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<!--</div>-->
<!--</div>-->
<!--</div>-->
<div class="columns is-gapless is-mobile" style="height:100%;">
<div class="columns is-gapless is-mobile" style="height:100%; width: 100%; overflow-x: hidden">
<!-- Editor Side -->
<div class="column is-half">
<div class="editor-container">
Expand Down Expand Up @@ -49,8 +49,7 @@
</div>
<div id="editor"
class=""
style="height:100%;"
onChange="onEditorChange()">
style="height:100%;">
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ export class YamlEditorComponent implements OnInit {
highlightActiveLine: false,
fadeFoldWidgets: true,
showLineNumbers: true,
fontSize: 16,
wrap: false,
fontSize: 14,
tabSize: 2,
wrap: true,
mode: 'ace/mode/yaml'
};

Expand Down
30 changes: 14 additions & 16 deletions src/app/services/yaml-data.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ import {Injectable} from '@angular/core';
import {RuntimeConfigService} from './runtime-config.service';
import {ToastService} from '../app-dialog/services/toast.service';
import {Job, YamlService} from 'cloudiator-rest-api';
import {Observable, of} from 'rxjs';
import {Observable, of, throwError} from 'rxjs';
import {select, Store} from '@ngrx/store';
import {RootStoreState, RuntimeConfigSelectors} from '../root-store';
import {ToastType} from '../model/toast';
import {catchError} from 'rxjs/operators';

@Injectable({
providedIn: 'root'
Expand All @@ -24,20 +26,16 @@ export class YamlDataService {
}

public parseYaml(yaml: string): Observable<Job> {

// ToDo: Absolutely dangerous, spams server with jobs if yaml is valid.

// return this.yamlApiService.parseYAML(yaml)
// .pipe(catchError(err => {
// switch (err.status) {
// case 400:
// case 504:
// this.toastService.show({text: 'Server had an internal Error', type: ToastType.DANGER}, true);
// return throwError(err);
// default:
// return throwError(err);
// }
// }))
return of(<Job>{id: '4ebd98ce-09e5-4fb7-b439-e82eb2a7de69'});
return this.yamlApiService.parseYAML(yaml)
.pipe(catchError(err => {
switch (err.status) {
case 400:
case 504:
this.toastService.show({text: 'Server had an internal Error', type: ToastType.DANGER}, true);
return throwError(err);
default:
return throwError(err);
}
}));
}
}

0 comments on commit ab5ec78

Please sign in to comment.