Commit 6eb6f9d2 authored by rajkumar's avatar rajkumar
Browse files

New Webin Portal Dashboard Changes :

1) Adding Registration page changes.
parent a1f6c5a6
......@@ -42,6 +42,10 @@ import { WebinGdprGuardService } from './webin-gdpr-guard.service';
import { WebinAuthenticationInterceptor } from './webin-authentication.interceptor';
import { RouterModule, Routes } from '@angular/router';
import { RegisterComponent } from './register/register.component';
import { ContactDialogModalComponent } from './contact-dialog-modal/contact-dialog-modal.component';
import { UniqueContactEmailDirective } from './directives/unique-contact-email.directive';
import { MatchPasswordDirective } from './directives/match-password.directive';
const appRoutes: Routes = [
{
......@@ -82,6 +86,11 @@ const appRoutes: Routes = [
component: ChecklistComponent,
canActivate: [WebinAuthenticationGuardService],
},
{
path: 'register',
component: RegisterComponent,
},
{
path: '**',
component: DashboardComponent,
......@@ -115,6 +124,10 @@ const appRoutes: Routes = [
ReportActionComponent,
GdprComponent,
ChecklistComponent,
RegisterComponent,
ContactDialogModalComponent,
UniqueContactEmailDirective,
MatchPasswordDirective,
],
bootstrap: [
AppComponent,
......@@ -139,6 +152,7 @@ const appRoutes: Routes = [
entryComponents: [
ReportEditDialogComponent,
SubmissionResultDialogComponent,
ContactDialogModalComponent
]
})
export class AppModule { }
......@@ -6,6 +6,7 @@
<div class="container">
<mat-accordion>
<ng-container *ngIf="!isEga()">
<div class="category" hidden>
<mat-expansion-panel>
<mat-expansion-panel-header>
......@@ -21,9 +22,9 @@
</div>
</mat-expansion-panel>
</div>
</ng-container>
<div class="category">
<mat-expansion-panel expanded>
<mat-expansion-panel-header>
......@@ -36,10 +37,9 @@
</span>
</div>
</mat-expansion-panel>
</div>
<ng-container *ngIf="!isEga()">
<div class="category">
<mat-expansion-panel>
<mat-expansion-panel-header>
......@@ -53,6 +53,7 @@
</div>
</mat-expansion-panel>
</div>
</ng-container>
<!-------------------------Reports------------------------->
<div class="category">
......
......@@ -10,7 +10,6 @@
*/
import { Component, ViewEncapsulation, ViewChild } from '@angular/core';
import { MatTabGroup } from '@angular/material/tabs';
import { WebinAuthenticationService } from '../webin-authentication.service';
import { ReportType } from '../report-type.enum';
import { MatIconModule } from '@angular/material'
......
......@@ -10,7 +10,6 @@
*/
import { Component, ViewEncapsulation, ViewChild } from '@angular/core';
import { MatTabGroup } from '@angular/material/tabs';
import { WebinAuthenticationService } from '../webin-authentication.service';
import { ReportType } from '../report-type.enum';
import { MatIconModule } from '@angular/material'
......
......@@ -20,8 +20,8 @@
<nav class="float-left columns medium-6 large-6" style="margin-top: 0;">
<ul id="local-nav" class="dropdown menu float-left" data-description="navigational">
<li><a href="https://www.ebi.ac.uk/ena/browser/support">Support <i class="icon icon-generic" data-icon="x"></i></a></li> <!-- ** Application specific content ** -->
<li><a href="logout">Logout
<span *ngIf="isAuthenticated()">({{getAccount()}})</span> <!-- ** Application specific content ** -->
<li *ngIf="isAuthenticated()"><a href="logout">Logout
<span >({{getAccount()}})</span> <!-- ** Application specific content ** -->
</a></li>
</ul>
</nav>
......
......@@ -16,8 +16,10 @@
<input type="password" matInput placeholder="Password" required [(ngModel)]="password" name="password">
</mat-form-field>
</p>
<div style="text-align: center;">
<button mat-raised-button color="accent" type="submit" name="action" >Login</button>
<button mat-raised-button color="primary" type="button" style="margin-left: 5px;" [routerLink]="['/register']">Register</button>
</div>
<p class="app-error" *ngIf="error">
<i class="material-icons">error</i>
Invalid Webin submission account or password
......
......@@ -14,6 +14,7 @@ import { Router } from '@angular/router';
import { WebinAuthenticationService } from '../webin-authentication.service';
import { HttpErrorResponse } from '@angular/common/http';
import { mergeMap } from 'rxjs/operators';
import { RouterModule } from '@angular/router';
@Component({
......
......@@ -18,6 +18,7 @@ import { MockWebinReportService } from '../mock/mock-webin-report.service';
import { WebinAuthenticationService } from '../webin-authentication.service';
import { MockWebinAuthenticationService } from '../mock/mock-webin-authentication.service';
import { ReportComponent } from './report.component';
import { RouterTestingModule } from "@angular/router/testing";
describe('ReportComponent', () => {
let component: ReportComponent;
......@@ -29,7 +30,8 @@ describe('ReportComponent', () => {
ReportComponent,
MockReportActionComponent
],
imports: [ UiModule ],
imports: [ UiModule, RouterTestingModule ],
providers: [
{
provide: WebinAuthenticationService,
......
......@@ -26,7 +26,9 @@ export class WebinAuthenticationInterceptor implements HttpInterceptor {
console.log(req.url);
if (!req.url.startsWith(environment.webinAuthenticationServiceUrl) &&
!req.url.startsWith(environment.webinReportServiceUrl + "/checklist-groups") &&
!req.url.startsWith(environment.webinReportServiceUrl + "/checklists")) {
!req.url.startsWith(environment.webinReportServiceUrl + "/checklists") &&
!req.url.startsWith(environment.webinAuthenticationTokenUrl) &&
!req.url.endsWith( "/submission-account")) {
// console.log('Webin authentication interceptor');
const webinAuthenticationService = this.injector.get(WebinAuthenticationService);
const authReq = req.clone({headers: req.headers.set('Authorization', webinAuthenticationService.getAuthorizationTokenHeader())});
......
......@@ -131,7 +131,7 @@ export class WebinAuthenticationService implements WebinAuthenticationServiceInt
const headers: HttpHeaders = new HttpHeaders()
.append('Content-Type', 'application/json')
.append('Accept', '*/*');
return this._http.post(baseUrl, body, { headers, withCredentials: false, responseType: 'text' });
var txt=this._http.post(baseUrl, body, { headers, withCredentials: false, responseType: 'text' });
return txt;
}
}
......@@ -52,7 +52,7 @@ export class WebinXmlReportService implements WebinXmlReportServiceInterface {
private getXml(xmlType: string, id: string): Observable<string> {
const url: string = this._baseUrl + '/' + xmlType + '/' + id + '?format=xml';
console.log(url);
//console.log(url);
return this.http.get(url, {responseType: 'text' });
}
}
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