Commit 8f523731 authored by Eduardo Sanz García's avatar Eduardo Sanz García
Browse files

chore: cleanup

parent 2a0ae6f3
Pipeline #4535 failed with stages
in 2 minutes and 1 second
......@@ -3,10 +3,12 @@
"version": 1,
"newProjectRoot": "projects",
"projects": {
"angular-aap-auth": {
"ng-ebi-authorization": {
"root": "",
"sourceRoot": "src",
"projectType": "application",
"prefix": "auth",
"schematics": {},
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
......@@ -27,6 +29,12 @@
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
......@@ -35,44 +43,38 @@
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
]
"buildOptimizer": true
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "angular-aap-auth:build"
"browserTarget": "ng-ebi-authorization:build"
},
"configurations": {
"production": {
"browserTarget": "angular-aap-auth:build:production"
"browserTarget": "ng-ebi-authorization:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "angular-aap-auth:build"
"browserTarget": "ng-ebi-authorization:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"karmaConfig": "./karma.conf.js",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
"scripts": [],
"karmaConfig": "src/karma.conf.js",
"styles": [
"src/styles.css"
],
"scripts": [],
"assets": [
"src/assets",
"src/favicon.ico"
......@@ -93,16 +95,15 @@
}
}
},
"angular-aap-auth-e2e": {
"root": "",
"sourceRoot": "",
"ng-ebi-authorization-e2e": {
"root": "e2e/",
"projectType": "application",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "./protractor.conf.js",
"devServerTarget": "angular-aap-auth:serve"
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "ng-ebi-authorization:serve"
}
},
"lint": {
......@@ -119,14 +120,5 @@
}
}
},
"defaultProject": "angular-aap-auth",
"schematics": {
"@schematics/angular:component": {
"prefix": "app",
"styleext": "css"
},
"@schematics/angular:directive": {
"prefix": "app"
}
}
}
\ No newline at end of file
"defaultProject": "ng-ebi-authorization"
}
......@@ -6,9 +6,9 @@
"ng": "ng",
"start": "ng serve --aot",
"build": "ng build --prod --aot",
"test": "ng test --karma-config=karma_chrome.conf.js --watch",
"test": "ng test --karma-config=src/karma_chrome.conf.js --watch",
"test:sr": "ng test --code-coverage=true --progress=false",
"test:sr:chromium": "ng test --code-coverage=true --progress=false --karma-config=karma_chromium.conf.js",
"test:sr:chromium": "ng test --code-coverage=true --progress=false --karma-config=src/karma_chromium.conf.js",
"lint": "ng lint",
"docs": "typedoc --module amd --out docs/ src/public_api.ts",
"e2e": "ng e2e",
......
......@@ -12,7 +12,7 @@ import {
} from './app.component';
import {
CommonStub
} from 'app/../../testing/common';
} from 'testing/common';
describe('AppComponent', () => {
beforeEach(async (() => {
......
......@@ -12,16 +12,16 @@ import {
import {
AuthService,
User
} from 'app/modules/auth/auth.service';
} from './modules/auth/auth.service';
import {
TokenService
} from 'app/modules/auth/token.service';
} from './modules/auth/token.service';
import {
JwtHelperService,
} from '@auth0/angular-jwt';
@Component({
selector: 'app-root',
selector: 'auth-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
......
......@@ -5,9 +5,10 @@ import {
NgModule
} from '@angular/core';
// Modules
import {
AppComponent
} from './app.component';
environment
} from 'src/environments/environment';
import {
AuthModule
} from './modules/auth/auth.module';
......@@ -15,6 +16,11 @@ import {
JwtModule
} from '@auth0/angular-jwt';
// Components
import {
AppComponent
} from './app.component';
export function getToken(): string {
return localStorage.getItem('jwt_token') || '';
}
......@@ -33,7 +39,7 @@ export function removeToken(): void {
imports: [
BrowserModule,
AuthModule.forRoot({
aapURL: 'https://api.aai.ebi.ac.uk',
aapURL: environment.aapURL,
tokenGetter: getToken,
tokenUpdater: updateToken,
// tokenRemover: removeToken // Optional
......
......@@ -18,7 +18,7 @@ import {
import {
VALID_TOKEN,
EXPIRED_TOKEN
} from 'app/../../testing/tokens';
} from 'testing/tokens';
import {
AAP_CONFIG,
DEFAULT_CONF
......
......@@ -158,7 +158,7 @@ export class AuthService {
* @returns The SSO URL.
*
*/
public getSSOURL(options?: LoginOptions): string {
public getSSOURL(options?: LoginOptions): string {
let extra = '';
if (options) {
this._filterLoginOptions(options);
......@@ -270,7 +270,9 @@ export class AuthService {
return;
}
this._storageUpdater(event.data);
event.source.close();
if (event.source) {
event.source.close();
}
this._updateUser();
// Triggers updating other windows
......
......@@ -13,7 +13,7 @@ import {
import {
VALID_TOKEN,
EXPIRED_TOKEN
} from 'app/../../testing/tokens';
} from 'testing/tokens';
describe('TokenService (valid token)', () => {
beforeEach(() => {
......
......@@ -4,5 +4,6 @@
// The list of which env maps to which file can be found in `.angular-cli.json`.
export const environment = {
aapURL: 'https://api.aai.ebi.ac.uk',
production: false
};
......@@ -9,6 +9,6 @@
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
<body>
<app-root></app-root>
<auth-root></auth-root>
</body>
</html>
......@@ -20,7 +20,7 @@ module.exports = function (config) {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, 'coverage'),
dir: require('path').join(__dirname, '../coverage'),
reports: [ 'text-summary', 'text', 'html', 'lcovonly' ],
fixWebpackSourcePaths: true
},
......
......@@ -20,7 +20,7 @@ module.exports = function (config) {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, 'coverage'),
dir: require('path').join(__dirname, '../coverage'),
reports: [ 'text-summary', 'text', 'html', 'lcovonly' ],
fixWebpackSourcePaths: true
},
......
......@@ -2,12 +2,10 @@
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
"baseUrl": "./",
"module": "es2015",
"types": []
},
"exclude": [
"test.ts",
"src/test.ts",
"**/*.spec.ts"
]
}
......@@ -2,8 +2,6 @@
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/spec",
"baseUrl": "./",
"module": "commonjs",
"types": [
"jasmine",
"node"
......
......@@ -7,7 +7,7 @@ import {
} from '@auth0/angular-jwt';
import {
AuthModule
} from '../src/app/modules/auth/auth.module';
} from 'src/app/modules/auth/auth.module';
export const jwt_token = 'test';
export function getToken(): string {
......
{
"compileOnSave": false,
"angularCompilerOptions": {
"preserveWhitespaces": false
"preserveWhitespaces": "off"
},
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"module": "es2015",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
......
......@@ -120,13 +120,13 @@
"directive-selector": [
true,
"attribute",
"app",
"auth",
"camelCase"
],
"component-selector": [
true,
"element",
"app",
"auth",
"kebab-case"
],
"no-output-on-prefix": true,
......
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