diff --git a/src/Frontend/Jp.AdminUI/.vscode/launch.json b/src/Frontend/Jp.AdminUI/.vscode/launch.json index c8db865f..4f798068 100644 --- a/src/Frontend/Jp.AdminUI/.vscode/launch.json +++ b/src/Frontend/Jp.AdminUI/.vscode/launch.json @@ -4,7 +4,18 @@ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ - + { + "type": "node", + "request": "launch", + "name": "Launch Program", + "program": "${workspaceFolder}/node_modules/protractor/bin/protractor", + "args":["${workspaceFolder}/e2e/protractor.conf.js"], + "preLaunchTask": "npm: e2e", + "outFiles": [ + "${workspaceFolder}/dist/out-tsc/**/*.js" + ] + }, + { "type": "chrome", "request": "launch", @@ -13,4 +24,4 @@ "webRoot": "${workspaceFolder}" } ] -} \ No newline at end of file +} diff --git a/src/Frontend/Jp.AdminUI/.vscode/tasks.json b/src/Frontend/Jp.AdminUI/.vscode/tasks.json new file mode 100644 index 00000000..b80b5a20 --- /dev/null +++ b/src/Frontend/Jp.AdminUI/.vscode/tasks.json @@ -0,0 +1,17 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "type": "npm", + "script": "e2e", + "problemMatcher": [] + }, + { + "type": "npm", + "script": "start", + "problemMatcher": [] + }, + ] +} diff --git a/src/Frontend/Jp.AdminUI/e2e/app.e2e-spec.ts b/src/Frontend/Jp.AdminUI/e2e/app.e2e-spec.ts index ce748401..b194eeb5 100644 --- a/src/Frontend/Jp.AdminUI/e2e/app.e2e-spec.ts +++ b/src/Frontend/Jp.AdminUI/e2e/app.e2e-spec.ts @@ -11,7 +11,7 @@ describe("jpproject WebApp", function () { it("should display sign-in page", () => { page.navigateTo(); - expect(page.getParagraphText()).toEqual("SIGN IN TO CONTINUE."); + expect(page.getButtonText()).toEqual("Login"); expect(page.getUrl()).toContain("/login"); }); }); diff --git a/src/Frontend/Jp.AdminUI/e2e/app.po.ts b/src/Frontend/Jp.AdminUI/e2e/app.po.ts index 647d0297..330d3672 100644 --- a/src/Frontend/Jp.AdminUI/e2e/app.po.ts +++ b/src/Frontend/Jp.AdminUI/e2e/app.po.ts @@ -9,7 +9,7 @@ export class JpProjectWebAppPage { return browser.getCurrentUrl(); } - getParagraphText() { - return element(by.css("login-container text-center py-2")).getText(); + getButtonText() { + return element(by.css(".login-container .card-body .mt-3")).getText(); } } diff --git a/src/Frontend/Jp.AdminUI/protractor.conf.js b/src/Frontend/Jp.AdminUI/e2e/protractor.conf.js similarity index 92% rename from src/Frontend/Jp.AdminUI/protractor.conf.js rename to src/Frontend/Jp.AdminUI/e2e/protractor.conf.js index 7ee3b5ee..d8e4c9b7 100644 --- a/src/Frontend/Jp.AdminUI/protractor.conf.js +++ b/src/Frontend/Jp.AdminUI/e2e/protractor.conf.js @@ -4,9 +4,9 @@ const { SpecReporter } = require('jasmine-spec-reporter'); exports.config = { - allScriptsTimeout: 11000, + allScriptsTimeout: 30000, specs: [ - './e2e/**/*.e2e-spec.ts' + './*.e2e-spec.ts' ], capabilities: { 'browserName': 'chrome' diff --git a/src/Frontend/Jp.AdminUI/e2e/tsconfig.e2e.json b/src/Frontend/Jp.AdminUI/e2e/tsconfig.e2e.json index 1d9e5edf..890914a2 100644 --- a/src/Frontend/Jp.AdminUI/e2e/tsconfig.e2e.json +++ b/src/Frontend/Jp.AdminUI/e2e/tsconfig.e2e.json @@ -2,6 +2,8 @@ "extends": "../tsconfig.json", "compilerOptions": { "outDir": "../out-tsc/e2e", + "mapRoot": "../out-tsc/e2e", + "sourceMap": true, "baseUrl": "./", "module": "commonjs", "target": "es5", diff --git a/src/Frontend/Jp.AdminUI/karma.conf.js b/src/Frontend/Jp.AdminUI/karma.conf.js index 02645a02..8e61e10c 100644 --- a/src/Frontend/Jp.AdminUI/karma.conf.js +++ b/src/Frontend/Jp.AdminUI/karma.conf.js @@ -3,14 +3,14 @@ module.exports = function (config) { config.set({ - basePath: './', - frameworks: ['jasmine', '@angular/cli'], + basePath: '', + frameworks: ['jasmine', '@angular-devkit/build-angular'], plugins: [ require('karma-jasmine'), require('karma-chrome-launcher'), require('karma-jasmine-html-reporter'), require('karma-coverage-istanbul-reporter'), - require('@angular/cli/plugins/karma') + require('@angular-devkit/build-angular/plugins/karma') ], client:{ clearContext: false // leave Jasmine Spec Runner output visible in browser @@ -18,23 +18,18 @@ module.exports = function (config) { files: [ { pattern: './src/test.ts', watched: false }, { pattern: 'src/assets/**/*', watched: false, included: false, served: true }, + { pattern: 'src/assets/i18n/*.json', watched: false, included: false, served: true }, ], proxies: { '/assets/': '/base/src/assets/' }, - preprocessors: { - './src/test.ts': ['@angular/cli'] - }, - mime: { - 'text/x-typescript': ['ts','tsx'] + angularCli: { + environment: 'dev' }, coverageIstanbulReporter: { - reports: [ 'html', 'lcovonly' ], + reports: ['html', 'lcovonly', 'text-summary'], fixWebpackSourcePaths: true }, - angularCli: { - environment: 'dev' - }, reporters: ['progress', 'kjhtml'], port: 9876, colors: true, @@ -42,9 +37,6 @@ module.exports = function (config) { autoWatch: true, browsers: ['Chrome'], singleRun: false, - captureTimeout: 60000, // it was already there - browserDisconnectTimeout : 60000, - browserDisconnectTolerance : 1, - browserNoActivityTimeout : 60000 //by default 10000 + restartOnFileChange: true }); }; diff --git a/src/Frontend/Jp.AdminUI/package-lock.json b/src/Frontend/Jp.AdminUI/package-lock.json index f935129c..03fd43b0 100644 --- a/src/Frontend/Jp.AdminUI/package-lock.json +++ b/src/Frontend/Jp.AdminUI/package-lock.json @@ -15702,9 +15702,9 @@ } }, "webdriver-manager": { - "version": "12.1.5", - "resolved": "https://registry.npmjs.org/webdriver-manager/-/webdriver-manager-12.1.5.tgz", - "integrity": "sha512-f1apDjMpZ8SHlXtXGzqBxOjV+WQcDRz5PN7pWScgjXS7vhUIFcM3V89Shetf4A04n8DDR2MxiVQq6JproFcRZw==", + "version": "12.1.7", + "resolved": "https://registry.npmjs.org/webdriver-manager/-/webdriver-manager-12.1.7.tgz", + "integrity": "sha512-XINj6b8CYuUYC93SG3xPkxlyUc3IJbD6Vvo75CVGuG9uzsefDzWQrhz0Lq8vbPxtb4d63CZdYophF8k8Or/YiA==", "dev": true, "requires": { "adm-zip": "^0.4.9", diff --git a/src/Frontend/Jp.AdminUI/package.json b/src/Frontend/Jp.AdminUI/package.json index fefcead9..3c4adf27 100644 --- a/src/Frontend/Jp.AdminUI/package.json +++ b/src/Frontend/Jp.AdminUI/package.json @@ -11,6 +11,7 @@ "build": "ng build --prod", "test": "ng test", "lint": "ng lint", + "lintfix": "ng lint --fix=true", "modernizr": "modernizr -c modernizr-config.json -d src/modernizr.js", "postinstall": "node ./node_modules/protractor/bin/webdriver-manager update", "e2e": "ng e2e", @@ -116,6 +117,6 @@ "ts-node": "^8.3.0", "tslint": "^5.14.0", "typescript": ">=3.4.0 <3.5.0", - "webdriver-manager": "12.1.5" + "webdriver-manager": "12.1.7" } } diff --git a/src/Frontend/Jp.AdminUI/src/app/core/settings/settings.service.spec.ts b/src/Frontend/Jp.AdminUI/src/app/core/settings/settings.service.spec.ts index 75a8d4e7..cc52e65e 100644 --- a/src/Frontend/Jp.AdminUI/src/app/core/settings/settings.service.spec.ts +++ b/src/Frontend/Jp.AdminUI/src/app/core/settings/settings.service.spec.ts @@ -3,12 +3,14 @@ import { TestBed, async, inject } from "@angular/core/testing"; import { SettingsService } from "./settings.service"; import { HttpClientModule } from "@angular/common/http"; +import { OAuthModule } from 'angular-oauth2-oidc'; +import { VersionService } from '@shared/services/version.service'; describe("Service: Settings", () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [HttpClientModule], - providers: [SettingsService] + imports: [HttpClientModule, OAuthModule.forRoot()], + providers: [SettingsService, VersionService] }); }); diff --git a/src/Frontend/Jp.AdminUI/src/app/core/settings/settings.service.ts b/src/Frontend/Jp.AdminUI/src/app/core/settings/settings.service.ts index bbd6e425..35ee0677 100644 --- a/src/Frontend/Jp.AdminUI/src/app/core/settings/settings.service.ts +++ b/src/Frontend/Jp.AdminUI/src/app/core/settings/settings.service.ts @@ -12,7 +12,7 @@ declare var $: any; @Injectable() export class SettingsService { - private user: UserProfile; + public user: UserProfile; public app: any; public layout: any; userProfileObservable: Observable; diff --git a/src/Frontend/Jp.AdminUI/src/app/core/translator/translator.service.ts b/src/Frontend/Jp.AdminUI/src/app/core/translator/translator.service.ts index 676eb327..acff90fc 100644 --- a/src/Frontend/Jp.AdminUI/src/app/core/translator/translator.service.ts +++ b/src/Frontend/Jp.AdminUI/src/app/core/translator/translator.service.ts @@ -15,6 +15,7 @@ export class TranslatorService { { code: "ru", text: "Russian" }, { code: "zh-cn", text: "Chinese Simplified" }, { code: "zh-tw", text: "Chinese Traditional" }, + { code: "el", text: "Greek"} ]; constructor(public translate: TranslateService) { diff --git a/src/Frontend/Jp.AdminUI/src/app/panel/api-resources/scope/api-scopes.component.html b/src/Frontend/Jp.AdminUI/src/app/panel/api-resources/scope/api-scopes.component.html index ec6feba9..d8db9d8a 100644 --- a/src/Frontend/Jp.AdminUI/src/app/panel/api-resources/scope/api-scopes.component.html +++ b/src/Frontend/Jp.AdminUI/src/app/panel/api-resources/scope/api-scopes.component.html @@ -107,7 +107,7 @@