Commit 1b2f187c authored by Vitali Stupin's avatar Vitali Stupin

Merge pull request #2 in XTSS/xtss-catalogue from develop to release

* commit 'b6905226':
  Adding sonar, remove empty css
  Debouncing search while typing filter
  fixing lint warnings
  Refactoring
  Updating packages
  Better scroll restoration
parents 488c5328 b6905226
......@@ -44,3 +44,6 @@ testem.log
# System Files
.DS_Store
Thumbs.db
### Sonar ###
.scannerwork
......@@ -3,26 +3,38 @@
## Building
```
sudo apt install nodejs
sudo apt install npm
sudo npm install -g npm@latest
sudo npm install -g @angular/cli
sudo apt install nodejs npm
sudo -H npm install -g npm@latest
sudo -H npm install -g @angular/cli
git clone <this_repository>
npm install
cd <this_repository_name>
npm ci
npm run lint
npm run test-headless
```
## Testing locally
## 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:
```
ng serve --host 0.0.0.0
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>
```
## Update angular
## Updating angular version
```
ng update @angular/cli @angular/core
```
## Deploy for local manual testing
```
ng serve --host 0.0.0.0
```
## Build for production
```
ng build --prod --base-href /methods/
ng build --prod --base-href /catalogue/
```
# Methods
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 7.3.2.
## Development server
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
## Code scaffolding
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
## Build
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
## Running unit tests
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
## Running end-to-end tests
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
## Further help
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
......@@ -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",
......
......@@ -156,19 +156,19 @@
}
},
"@angular-devkit/schematics": {
"version": "7.3.3",
"resolved": "https://registry.npmjs.org/@angular-devkit/schematics/-/schematics-7.3.3.tgz",
"integrity": "sha512-SdDq9eKwceb6WLwci1fywtZ/kARR5CYyzi5dZIR1lOxrz00682uUBqH/X39mKdqc6eVqR7rtPceqNm6nQpOIMg==",
"version": "7.3.6",
"resolved": "https://registry.npmjs.org/@angular-devkit/schematics/-/schematics-7.3.6.tgz",
"integrity": "sha512-YXF7QusmMy3D9H0vNczc1n5BkuEHLwt7cW33euNeGNgTIsD0n6DrUhgClurXicnr2GNPSDYE5+3115lmJkhyrg==",
"dev": true,
"requires": {
"@angular-devkit/core": "7.3.3",
"@angular-devkit/core": "7.3.6",
"rxjs": "6.3.3"
},
"dependencies": {
"@angular-devkit/core": {
"version": "7.3.3",
"resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-7.3.3.tgz",
"integrity": "sha512-fosULDtMoDWrOyUzTmBkJccOy7zodo02kENyKai7vOv9EWfv9jytkVdNc+jl0ys9OE2QadvSYBo49jhnZxFXfQ==",
"version": "7.3.6",
"resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-7.3.6.tgz",
"integrity": "sha512-aoarMK0DJIdwjVA0OuQIN7b8nKPcF9n5vSMF7MFmhKpTw5/uV3SynQZbm3YCgylu/2CMuiTzKuAunnWWdli//g==",
"dev": true,
"requires": {
"ajv": "6.9.1",
......@@ -190,24 +190,24 @@
}
},
"@angular/animations": {
"version": "7.2.7",
"resolved": "https://registry.npmjs.org/@angular/animations/-/animations-7.2.7.tgz",
"integrity": "sha512-eU/wSkBmukZXCCe/epUl02xsKPauF+deMbncxBE+w/NmmWjJ77Q09iZAcgzM92RVXj2LsVYQXsNEBGT3X0hRZw==",
"version": "7.2.9",
"resolved": "https://registry.npmjs.org/@angular/animations/-/animations-7.2.9.tgz",
"integrity": "sha512-cdIf/UWwhNlw6Ep3pRxRk12F8q/GyTbcHDF4qbgg7lZEDPYS32KS1lpHY1pgSuSOIPZUT+iLPOxAZ6cu7Am1vA==",
"requires": {
"tslib": "^1.9.0"
}
},
"@angular/cli": {
"version": "7.3.3",
"resolved": "https://registry.npmjs.org/@angular/cli/-/cli-7.3.3.tgz",
"integrity": "sha512-dw1iBOYbQRN2l/BH21zDItDFC9KXgqeK0A/koDLDukjrUAnW/XVATjxGi+7EPlTpABTFhqu/rHZDy8aBglLDXQ==",
"version": "7.3.6",
"resolved": "https://registry.npmjs.org/@angular/cli/-/cli-7.3.6.tgz",
"integrity": "sha512-u5lBcYVQRk9cez/DozJvFOYomeko9b5kE+NElyFhPtM3GF1SBcXKb5QyNxH/zSOc850VL7KPe7ZfC6kW3Phhyw==",
"dev": true,
"requires": {
"@angular-devkit/architect": "0.13.3",
"@angular-devkit/core": "7.3.3",
"@angular-devkit/schematics": "7.3.3",
"@schematics/angular": "7.3.3",
"@schematics/update": "0.13.3",
"@angular-devkit/architect": "0.13.6",
"@angular-devkit/core": "7.3.6",
"@angular-devkit/schematics": "7.3.6",
"@schematics/angular": "7.3.6",
"@schematics/update": "0.13.6",
"@yarnpkg/lockfile": "1.1.0",
"ini": "1.3.5",
"inquirer": "6.2.1",
......@@ -219,19 +219,19 @@
},
"dependencies": {
"@angular-devkit/architect": {
"version": "0.13.3",
"resolved": "https://registry.npmjs.org/@angular-devkit/architect/-/architect-0.13.3.tgz",
"integrity": "sha512-89VL75bq3+h3m0jhzWNqXqW+HQcrihnM3i6eiUE6P81LcllP159JMlusAvB1LHLNc6Cc62wTq4BJr7KDILkPOA==",
"version": "0.13.6",
"resolved": "https://registry.npmjs.org/@angular-devkit/architect/-/architect-0.13.6.tgz",
"integrity": "sha512-Cg9z4lmCvjt5uD00E/0tBRz3ESjYicmqT3NL/BIsNVNb+s1GwCCoPSOIM8Ss4nyGDtrdono1XKSOmkJnlzF3Cw==",
"dev": true,
"requires": {
"@angular-devkit/core": "7.3.3",
"@angular-devkit/core": "7.3.6",
"rxjs": "6.3.3"
}
},
"@angular-devkit/core": {
"version": "7.3.3",
"resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-7.3.3.tgz",
"integrity": "sha512-fosULDtMoDWrOyUzTmBkJccOy7zodo02kENyKai7vOv9EWfv9jytkVdNc+jl0ys9OE2QadvSYBo49jhnZxFXfQ==",
"version": "7.3.6",
"resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-7.3.6.tgz",
"integrity": "sha512-aoarMK0DJIdwjVA0OuQIN7b8nKPcF9n5vSMF7MFmhKpTw5/uV3SynQZbm3YCgylu/2CMuiTzKuAunnWWdli//g==",
"dev": true,
"requires": {
"ajv": "6.9.1",
......@@ -253,25 +253,25 @@
}
},
"@angular/common": {
"version": "7.2.7",
"resolved": "https://registry.npmjs.org/@angular/common/-/common-7.2.7.tgz",
"integrity": "sha512-U1l2CIcmpTAJMWcyTXI9qt1E8CxwKNW1vr6XWZo4X5ziCIzf7RvClzK7Ci5KZKkoPJrJqBJu661Q75Yt22dJsg==",
"version": "7.2.9",
"resolved": "https://registry.npmjs.org/@angular/common/-/common-7.2.9.tgz",
"integrity": "sha512-SBIinZi/R0mKWjbKvcBhwRpAVIY/7/AnzIEkMb5JnGExersYhDD02otW3ZwPStpl7HrhgWk8ueWnxVFFXRz5gA==",
"requires": {
"tslib": "^1.9.0"
}
},
"@angular/compiler": {
"version": "7.2.7",
"resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-7.2.7.tgz",
"integrity": "sha512-e61YVxW5x4w+X4yjGaptYoJIja7HwH0+8FFEaH6VuPl/DrK8wP4HDMhLo4NzdgeZKLR2jBIQSqLmoM8W7UXcqw==",
"version": "7.2.9",
"resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-7.2.9.tgz",
"integrity": "sha512-jAKV4C5BW2pnke10fiDZNbLCQOs2QK37mUJWe5jnZqCAM4Y3edXlfifOkbi0hvA4WJMDXKmUdydY6Xo/Z+cWbA==",
"requires": {
"tslib": "^1.9.0"
}
},
"@angular/compiler-cli": {
"version": "7.2.7",
"resolved": "https://registry.npmjs.org/@angular/compiler-cli/-/compiler-cli-7.2.7.tgz",
"integrity": "sha512-UPWROJzBLejgNf+aqgEUXYts8UiFOl2IavDhS/olA9irszv2lNFj9Yqr8OKdy0jK/lKaipZog3VZEx8g5dNeBA==",
"version": "7.2.9",
"resolved": "https://registry.npmjs.org/@angular/compiler-cli/-/compiler-cli-7.2.9.tgz",
"integrity": "sha512-3itdcfszdyXTHYEsO4eBu4WEx10hU8JpOgUcZyw+OYgwLQLyjEXOD9dfYZZpE/+2F0omoMLseCTHTP//uux+Iw==",
"dev": true,
"requires": {
"canonical-path": "1.0.0",
......@@ -501,47 +501,47 @@
}
},
"@angular/core": {
"version": "7.2.7",
"resolved": "https://registry.npmjs.org/@angular/core/-/core-7.2.7.tgz",
"integrity": "sha512-E7qjMQdS77SbRROKu13VsfL+MJN52eTlrU0SzEAFGUOgdvbmDYJOaEwjqrouKpYZ0pul8KOoalvlPB7oVflC7A==",
"version": "7.2.9",
"resolved": "https://registry.npmjs.org/@angular/core/-/core-7.2.9.tgz",
"integrity": "sha512-tW1jHjCnvtquJ3XEnmqRNMoV7MXAZ2yfnCXE25+odRZjNVMiTcKWvRLd/XjBzjCg2OvwREXcQpB7/s+Av10uAQ==",
"requires": {
"tslib": "^1.9.0"
}
},
"@angular/forms": {
"version": "7.2.7",
"resolved": "https://registry.npmjs.org/@angular/forms/-/forms-7.2.7.tgz",
"integrity": "sha512-2gBs+BG2cMPsHq9JVEzmu2Ev539zjfHmr6cna2W38KLXeGbNf42rbbMUXpYD8cndY0QTYcnwfMpRNIl9zKRZnw==",
"version": "7.2.9",
"resolved": "https://registry.npmjs.org/@angular/forms/-/forms-7.2.9.tgz",
"integrity": "sha512-2hpu2Gl8suwG5FmOczk/oBBE1x7QypM58XE1ms0V6uYlL+g/JIg0AWMMOldI5KYUnxwoCikgsdGzzt8XPbvRkQ==",
"requires": {
"tslib": "^1.9.0"
}
},
"@angular/language-service": {
"version": "7.2.7",
"resolved": "https://registry.npmjs.org/@angular/language-service/-/language-service-7.2.7.tgz",
"integrity": "sha512-d3iCBpOfgLNSGMrtqZvN6NHZIEnKD2MV8Hz4WsRLU4WY0RbshZj5dqx2nO3YRT2tACpAvhWBQoYvtLpTCPzsMA==",
"version": "7.2.9",
"resolved": "https://registry.npmjs.org/@angular/language-service/-/language-service-7.2.9.tgz",
"integrity": "sha512-+8P3yGqrCZy8PaoxUUlC6cowxPAIbuW4HwhvHvYV3G99LDQUC/bxUPSPhqbrAvDiFr3VeXqivzXgFCTo69S1WQ==",
"dev": true
},
"@angular/platform-browser": {
"version": "7.2.7",
"resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-7.2.7.tgz",
"integrity": "sha512-9C3ffZs0ZUw+dYg1oJKiONf64UKTdAzIOaTQXTrVrCa3oN7Jb2tUfmpenmB+ATRxwhL2n7Yi725YWwxY2FwqvQ==",
"version": "7.2.9",
"resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-7.2.9.tgz",
"integrity": "sha512-h7RaXllauFLa1SPcje/cK7IbwCqV6ViyeHEUAAWljrM2OWRU1zRYtDk/gcphRj4tWhhHVfQsJ9+0p3NoPP5LZw==",
"requires": {
"tslib": "^1.9.0"
}
},
"@angular/platform-browser-dynamic": {
"version": "7.2.7",
"resolved": "https://registry.npmjs.org/@angular/platform-browser-dynamic/-/platform-browser-dynamic-7.2.7.tgz",
"integrity": "sha512-3nlcwCZOzlKw/4CMJ4zy1JEVy8Ky4KyLRRePLledOMdsGbuDIoq/kyAnBzg295Xe9ovBxv8cmuSkShci+s/x8g==",
"version": "7.2.9",
"resolved": "https://registry.npmjs.org/@angular/platform-browser-dynamic/-/platform-browser-dynamic-7.2.9.tgz",
"integrity": "sha512-QJQ1NmzaX2nAX9u6vkc/cZSBEqio/YQojaZqlbRyAn391rpzb9cGVvqYzUU9DqCeXbxKgA1xbmLiNMQ/M7xMHg==",
"requires": {
"tslib": "^1.9.0"
}
},
"@angular/router": {
"version": "7.2.7",
"resolved": "https://registry.npmjs.org/@angular/router/-/router-7.2.7.tgz",
"integrity": "sha512-59+M8+IH7V2NPPqWw2mwdg+kh/jfwQcXE0tB8iZ5V2ldACPucY/Td6qiT5H6t7EkELtvkKJwS6vKFV22qdRp3w==",
"version": "7.2.9",
"resolved": "https://registry.npmjs.org/@angular/router/-/router-7.2.9.tgz",
"integrity": "sha512-vNk2x6i1iLNQM1KYnRhbC2DJQvNmlu9lVGzcZzRiS7zDT5DFvbiYA1M7ixUlbehLDEGVKlJEZNIdKWErWW8xYw==",
"requires": {
"tslib": "^1.9.0"
}
......@@ -747,20 +747,20 @@
}
},
"@schematics/angular": {
"version": "7.3.3",
"resolved": "https://registry.npmjs.org/@schematics/angular/-/angular-7.3.3.tgz",
"integrity": "sha512-HbH8vajYPka0xGcFAN5IUBx8n8SFMQLFb9di2dJCOBaEakbKVkk8qtOpil54oFQbx7DFCvutq/p0u42JfEbuMQ==",
"version": "7.3.6",
"resolved": "https://registry.npmjs.org/@schematics/angular/-/angular-7.3.6.tgz",
"integrity": "sha512-Q4VXAjVaCDb2zXFXoIdOfNPsn+EQjqDBHK4a97omytnSNAmu1erl3l2FkEMi6x/VuzK2mQSzBbmHJIgauMmOAA==",
"dev": true,
"requires": {
"@angular-devkit/core": "7.3.3",
"@angular-devkit/schematics": "7.3.3",
"@angular-devkit/core": "7.3.6",
"@angular-devkit/schematics": "7.3.6",
"typescript": "3.2.4"
},
"dependencies": {
"@angular-devkit/core": {
"version": "7.3.3",
"resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-7.3.3.tgz",
"integrity": "sha512-fosULDtMoDWrOyUzTmBkJccOy7zodo02kENyKai7vOv9EWfv9jytkVdNc+jl0ys9OE2QadvSYBo49jhnZxFXfQ==",
"version": "7.3.6",
"resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-7.3.6.tgz",
"integrity": "sha512-aoarMK0DJIdwjVA0OuQIN7b8nKPcF9n5vSMF7MFmhKpTw5/uV3SynQZbm3YCgylu/2CMuiTzKuAunnWWdli//g==",
"dev": true,
"requires": {
"ajv": "6.9.1",
......@@ -782,13 +782,13 @@
}
},
"@schematics/update": {
"version": "0.13.3",
"resolved": "https://registry.npmjs.org/@schematics/update/-/update-0.13.3.tgz",
"integrity": "sha512-sCOFQ62dd7VdEGiSUJNZshNI31ODwpJjn2WIvFgZLt6sdHHun67s/JOvOUq4mxx6I74oD6RPJPF4AP5sigVxxg==",
"version": "0.13.6",
"resolved": "https://registry.npmjs.org/@schematics/update/-/update-0.13.6.tgz",
"integrity": "sha512-TkeigdQTHG40ZGj4CAAzQHh7/rSotg0J6nkBBtc4Y+9md7IGg6dzSFJAvYbDX5JZ9tk7DpukdRHOVVopS/J0AQ==",
"dev": true,
"requires": {
"@angular-devkit/core": "7.3.3",
"@angular-devkit/schematics": "7.3.3",
"@angular-devkit/core": "7.3.6",
"@angular-devkit/schematics": "7.3.6",
"@yarnpkg/lockfile": "1.1.0",
"ini": "1.3.5",
"pacote": "9.4.0",
......@@ -798,9 +798,9 @@
},
"dependencies": {
"@angular-devkit/core": {
"version": "7.3.3",
"resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-7.3.3.tgz",
"integrity": "sha512-fosULDtMoDWrOyUzTmBkJccOy7zodo02kENyKai7vOv9EWfv9jytkVdNc+jl0ys9OE2QadvSYBo49jhnZxFXfQ==",
"version": "7.3.6",
"resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-7.3.6.tgz",
"integrity": "sha512-aoarMK0DJIdwjVA0OuQIN7b8nKPcF9n5vSMF7MFmhKpTw5/uV3SynQZbm3YCgylu/2CMuiTzKuAunnWWdli//g==",
"dev": true,
"requires": {
"ajv": "6.9.1",
......@@ -5055,18 +5055,18 @@
}
},
"strip-ansi": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.0.0.tgz",
"integrity": "sha512-Uu7gQyZI7J7gn5qLn1Np3G9vcYGTVqB+lFTytnDJv83dd8T22aGH451P3jueT2/QemInJDfxHB5Tde5OzgG1Ow==",
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.1.0.tgz",
"integrity": "sha512-TjxrkPONqO2Z8QDCpeE2j6n0M6EwxzyDgzEeGp+FbdvaJAt//ClYi6W5my+3ROlC/hZX2KACUwDfK49Ka5eDvg==",
"dev": true,
"requires": {
"ansi-regex": "^4.0.0"
"ansi-regex": "^4.1.0"
},
"dependencies": {
"ansi-regex": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.0.0.tgz",
"integrity": "sha512-iB5Dda8t/UqpPI/IjsejXu5jOGDrzn41wJyljwPH65VCIbk6+1BzFIMJGFwTNrYXT1CrD+B4l19U7awiQ8rk7w==",
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz",
"integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==",
"dev": true
}
}
......@@ -8771,9 +8771,9 @@
}
},
"socks": {
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/socks/-/socks-2.2.3.tgz",
"integrity": "sha512-+2r83WaRT3PXYoO/1z+RDEBE7Z2f9YcdQnJ0K/ncXXbV5gJ6wYfNAebYFYiiUjM6E4JyXnPY8cimwyvFYHVUUA==",
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/socks/-/socks-2.3.2.tgz",
"integrity": "sha512-pCpjxQgOByDHLlNqlnh/mNSAxIUkyBBuwwhTcV+enZGbDaClPvHdvm6uvOwZfFJkam7cGhBNbb4JxiP8UZkRvQ==",
"dev": true,
"requires": {
"ip": "^1.1.5",
......@@ -8781,15 +8781,21 @@
}
},
"socks-proxy-agent": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-4.0.1.tgz",
"integrity": "sha512-Kezx6/VBguXOsEe5oU3lXYyKMi4+gva72TwJ7pQY5JfqUx2nMk7NXA6z/mpNqIlfQjWYVfeuNvQjexiTaTn6Nw==",
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-4.0.2.tgz",
"integrity": "sha512-NT6syHhI9LmuEMSK6Kd2V7gNv5KFZoLE7V5udWmn0de+3Mkj3UMA/AJPLyeNUVmElCurSHtUdM3ETpR3z770Wg==",
"dev": true,
"requires": {
"agent-base": "~4.2.0",
"socks": "~2.2.0"
"agent-base": "~4.2.1",
"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,19 +6,21 @@
"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": {
"@angular/animations": "^7.2.7",
"@angular/common": "^7.2.7",
"@angular/compiler": "^7.2.7",
"@angular/core": "^7.2.7",
"@angular/forms": "^7.2.7",
"@angular/platform-browser": "^7.2.7",
"@angular/platform-browser-dynamic": "^7.2.7",
"@angular/router": "^7.2.7",
"@angular/animations": "^7.2.9",
"@angular/common": "^7.2.9",
"@angular/compiler": "^7.2.9",
"@angular/core": "^7.2.9",
"@angular/forms": "^7.2.9",
"@angular/platform-browser": "^7.2.9",
"@angular/platform-browser-dynamic": "^7.2.9",
"@angular/router": "^7.2.9",
"@ngx-translate/core": "^11.0.1",
"@ngx-translate/http-loader": "^4.0.0",
"bootstrap": "^4.3.1",
......@@ -29,9 +31,9 @@
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.13.3",
"@angular/cli": "~7.3.3",
"@angular/compiler-cli": "^7.2.7",
"@angular/language-service": "^7.2.7",
"@angular/cli": "~7.3.6",
"@angular/compiler-cli": "^7.2.9",
"@angular/language-service": "^7.2.9",
"@types/jasmine": "~2.8.8",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
......@@ -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>
......@@ -15,4 +15,4 @@ const routes: Routes = [
imports: [ RouterModule.forRoot(routes, {scrollPositionRestoration: 'enabled'}) ],
exports: [ RouterModule ]
})
export class AppRoutingModule {}
\ No newline at end of file
export class AppRoutingModule {}
......@@ -2,4 +2,4 @@
<router-outlet></router-outlet>
</div>
\ No newline at end of file
</div>
import { TestBed, async } from '@angular/core/testing';
import {RouterTestingModule} from '@angular/router/testing'
import {RouterTestingModule} from '@angular/router/testing';
import { AppComponent } from './app.component';
describe('AppComponent', () => {
......
......@@ -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 {
}
......@@ -42,4 +42,4 @@ export class AppModule { }
export function HttpLoaderFactory(http: HttpClient) {
// Providing path as a workaround for ngx-translate bug with --base-href option
return new TranslateHttpLoader(http, './assets/i18n/');
}
\ No newline at end of file
}
export const MAX_LIMIT = 1000000;
export const DEFAULT_LIMIT = 10;
export const INSTANCES = {
EE: 'https://www.x-tee.ee/catalogue/EE/wsdls/',
'ee-test': 'https://www.x-tee.ee/catalogue/ee-test/wsdls/',
'ee-dev': 'https://www.x-tee.ee/catalogue/ee-dev/wsdls/'
};
export const API_SERVICE = 'index.json';
export const LANGUAGES = {
EST: 'est',
ENG: 'eng'
};
export const PREVIEW_SIZE = 5;
export const FILTER_DEBOUNCE = 200;
......@@ -7,4 +7,4 @@
</li>
</ul>
</div>
</div>
\ No newline at end of file
</div>
......@@ -3,25 +3,23 @@ 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 {
constructor(private languagesService: LanguagesService) { }
ngOnInit() {
getLangs(): string[] {
return this.languagesService.getLangs();
}
getLangs():string[] {
return this.languagesService.getLangs()
}
getLang():string {
return this.languagesService.getLang()
getLang(): string {
return this.languagesService.getLang();
}
setLang(lang: string) {
return this.languagesService.setLang(lang)
return this.languagesService.setLang(lang);
}
ngOnInit() {}
}
import { Injectable } from '@angular/core';
import {TranslateService} from "@ngx-translate/core";
import {TranslateService} from '@ngx-translate/core';
import { Title } from '@angular/platform-browser';
import { Subscription } from 'rxjs';
import { take } from 'rxjs/operators';
const LANGUAGES = {
'EST': 'est',
'ENG': 'eng'
}
import { LANGUAGES } from './config';
@Injectable({
providedIn: 'root'
})
export class LanguagesService {
private selectedLang = ''
private translateSubscription: Subscription
private selectedLang = '';
private translateSubscription: Subscription;
constructor(
private translate: TranslateService,
private title: Title
) {
this.selectedLang = this.getDefaultLang()