Commit b6905226 authored by Vitali Stupin's avatar Vitali Stupin
Browse files

Adding sonar, remove empty css

parent 76b386e4
......@@ -44,3 +44,6 @@ testem.log
# System Files
.DS_Store
Thumbs.db
### Sonar ###
.scannerwork
......@@ -9,6 +9,19 @@ sudo -H npm install -g @angular/cli
git clone <this_repository>
cd <this_repository_name>
npm ci
npm run lint
npm run test-headless
```
## Sonarqube
By default `http://localhost:9000` is used as a sonarqube server.
If you have a remote sonarqube server, update `sonar-project.properties` cunfiguration file and run the test with:
```
npm run sonar
```
Alternatively you can provide hostname and access token with command line:
```
./node_modules/sonar-scanner/bin/sonar-scanner -Dsonar.host.url=<server> -Dsonar.login=<token>
```
## Updating angular version
......
......@@ -75,6 +75,7 @@
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"codeCoverage": true,
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
......
......@@ -8790,6 +8790,12 @@
"socks": "~2.3.2"
}
},
"sonar-scanner": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/sonar-scanner/-/sonar-scanner-3.1.0.tgz",
"integrity": "sha1-UcHBEB9UuYq8XYVlIJsdkjKXk0M=",
"dev": true
},
"source-list-map": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz",
......
......@@ -6,8 +6,10 @@
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"test-headless": "ng test --watch=false --browsers=ChromiumHeadless",
"lint": "ng lint",
"e2e": "ng e2e"
"e2e": "ng e2e",
"sonar": "sonar-scanner"
},
"private": true,
"dependencies": {
......@@ -44,6 +46,7 @@
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.4.0",
"sonar-scanner": "^3.1.0",
"ts-node": "~7.0.0",
"tslint": "~5.11.0",
"typescript": "~3.2.2"
......
sonar.projectKey=xtss-catalogue
sonar.sources=src
sonar.sourceEncoding=UTF-8
sonar.exclusions=**/node_modules/**,**/*.spec.ts
sonar.tests=src
sonar.test.inclusions=**/*.spec.ts
sonar.typescript.lcov.reportPaths=coverage/methods/lcov.info
sonar.host.url=http://localhost:9000
#sonar.host.url=https://<some-remote-server>
#sonar.login=<secret-token>
......@@ -2,8 +2,7 @@ import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
templateUrl: './app.component.html'
})
export class AppComponent {
}
......@@ -3,8 +3,7 @@ import { LanguagesService } from '../languages.service';
@Component({
selector: 'app-header',
templateUrl: './header.component.html',
styleUrls: ['./header.component.css']
templateUrl: './header.component.html'
})
export class HeaderComponent implements OnInit {
......
......@@ -3,8 +3,7 @@ import { SubsystemsService } from '../../subsystems.service';
@Component({
selector: 'app-search',
templateUrl: './search.component.html',
styleUrls: ['./search.component.css']
templateUrl: './search.component.html'
})
export class SearchComponent implements OnInit {
limit: string;
......
......@@ -8,8 +8,7 @@ import { filter } from 'rxjs/operators';
@Component({
selector: 'app-subsystem-list',
templateUrl: './subsystem-list.component.html',
styleUrls: ['./subsystem-list.component.css']
templateUrl: './subsystem-list.component.html'
})
export class SubsystemListComponent implements OnInit, AfterViewInit, OnDestroy {
subsystems: Subsystem[];
......
......@@ -8,8 +8,7 @@ import { filter } from 'rxjs/operators';
@Component({
selector: 'app-subsystem',
templateUrl: './subsystem.component.html',
styleUrls: ['./subsystem.component.css']
templateUrl: './subsystem.component.html'
})
export class SubsystemComponent implements OnInit, AfterViewInit, OnDestroy {
subsystemId = '';
......
......@@ -98,7 +98,7 @@ export class SubsystemsService {
return (error: any): Observable<T> => {
this.emitWarning('Error while loading data from server!');
// Let the app keep running by returning an empty result.
return of(result as T);
return of(result);
};
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment