Commit 52825704 authored by rajkumar's avatar rajkumar
Browse files

New Webin Portal changes :

1) Adding Reset password functionality.
2) Adding Back button for easy screen navigation.
3) Adding UI for study registration.
parent 00f7e498
......@@ -6837,8 +6837,7 @@
"ansi-regex": {
"version": "2.1.1",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"aproba": {
"version": "1.2.0",
......@@ -6859,14 +6858,12 @@
"balanced-match": {
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
......@@ -6881,20 +6878,17 @@
"code-point-at": {
"version": "1.1.0",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"concat-map": {
"version": "0.0.1",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"core-util-is": {
"version": "1.0.2",
......@@ -7011,8 +7005,7 @@
"inherits": {
"version": "2.0.3",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"ini": {
"version": "1.3.5",
......@@ -7024,7 +7017,6 @@
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
......@@ -7039,7 +7031,6 @@
"version": "3.0.4",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
......@@ -7047,14 +7038,12 @@
"minimist": {
"version": "0.0.8",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"minipass": {
"version": "2.3.5",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"safe-buffer": "^5.1.2",
"yallist": "^3.0.0"
......@@ -7073,7 +7062,6 @@
"version": "0.5.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"minimist": "0.0.8"
}
......@@ -7161,8 +7149,7 @@
"number-is-nan": {
"version": "1.0.1",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"object-assign": {
"version": "4.1.1",
......@@ -7174,7 +7161,6 @@
"version": "1.4.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"wrappy": "1"
}
......@@ -7260,8 +7246,7 @@
"safe-buffer": {
"version": "5.1.2",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"safer-buffer": {
"version": "2.1.2",
......@@ -7297,7 +7282,6 @@
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
......@@ -7317,7 +7301,6 @@
"version": "3.0.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"ansi-regex": "^2.0.0"
}
......@@ -7361,14 +7344,12 @@
"wrappy": {
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"yallist": {
"version": "3.0.3",
"bundled": true,
"dev": true,
"optional": true
"dev": true
}
}
},
......@@ -10758,8 +10739,7 @@
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz",
"integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==",
"dev": true,
"optional": true
"dev": true
},
"pify": {
"version": "4.0.1",
......@@ -13764,7 +13744,6 @@
"resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz",
"integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==",
"dev": true,
"optional": true,
"requires": {
"is-extglob": "^2.1.1"
}
......@@ -13780,8 +13759,7 @@
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
"integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==",
"dev": true,
"optional": true
"dev": true
},
"readdirp": {
"version": "3.4.0",
......
......@@ -46,12 +46,19 @@ import { AccountInfoComponent } from './accountInfo/accountInfo.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';
import { ResetPasswordRequestDialogComponent } from './reset-password-request-dialog/reset-password-request-dialog.component';
import { ResetPasswordPageComponent } from './reset-password-page/reset-password-page.component';
import { RegisterStudyComponent } from './register-study/register-study.component';
const appRoutes: Routes = [
{
path: 'login',
component: LoginComponent,
},
{
path: 'resetPassword',
component: ResetPasswordPageComponent,
},
{
path: 'logout',
component: LogoutComponent,
......@@ -92,9 +99,12 @@ const appRoutes: Routes = [
canActivate: [WebinAuthenticationGuardService],
},
{
path: 'register',
path: 'accountInfo',
component: AccountInfoComponent,
},
{
path: 'registerStudy',
component: RegisterStudyComponent,
},
{
path: '**',
......@@ -133,6 +143,9 @@ const appRoutes: Routes = [
ContactDialogModalComponent,
UniqueContactEmailDirective,
MatchPasswordDirective,
ResetPasswordRequestDialogComponent,
ResetPasswordPageComponent,
RegisterStudyComponent
],
bootstrap: [
AppComponent,
......@@ -157,7 +170,9 @@ const appRoutes: Routes = [
entryComponents: [
ReportEditDialogComponent,
SubmissionResultDialogComponent,
ContactDialogModalComponent
ContactDialogModalComponent,
ResetPasswordRequestDialogComponent
]
})
export class AppModule { }
......@@ -32,3 +32,9 @@
padding-bottom: 5px;
padding-left: 5px;
}
.back-div{
float: left;
padding-top: 2px;
cursor: pointer;
}
\ No newline at end of file
<div class="body">
<div class="mat-h3 mat-tittle">Download spreadsheet template for annotated sequences</div>
<div>
<div class="back-div" ><mat-icon matTooltip="Back" routerLink="">arrow_back_ios</mat-icon></div>
<div class="mat-h3 mat-tittle">Download spreadsheet template for annotated sequences</div>
</div>
<mat-divider></mat-divider>
<div class="container">
......
......@@ -2,17 +2,18 @@
<div class="mat-h3 mat-tittle">Contact Details</div>
<form (ngSubmit)="doAction()" #cf="ngForm">
<div *ngIf="action!='Delete' && action!='Success' && action!='Error'">
<mat-checkbox matInput name="mainContact" [(ngModel)]="contactObj.mainContact">Is Primary Contact</mat-checkbox>
<mat-checkbox matInput name="mainContact" [(ngModel)]="contactObj.mainContact" >Is Primary Contact</mat-checkbox>
<mat-checkbox matInput name="consortiumContact" [(ngModel)]="contactObj.consortiumContact" style="padding-left: 20px;" >Is Consortium Contact</mat-checkbox>
<input type="hidden" name="submissionAccountId" [(ngModel)]="contactObj.submissionAccountId"/>
<mat-form-field>
<input matInput name="emailAddress" [(ngModel)]="contactObj.emailAddress" #emailVal="ngModel" placeholder="Email Address" appUniqueContactEmail="{{emails}}|{{action}}|{{contactObj.emailAddress}}" required email/>
<mat-error *ngIf="cf.controls['emailAddress']?.errors?.nonUniqueEmail">
<input matInput *ngIf="action==='Update'" [readonly]="true" name="emailAddress" [(ngModel)]="contactObj.emailAddress" #emailVal="ngModel" placeholder="Email Address" appUniqueContactEmail="{{emails}}|{{action}}|{{contactObj.emailAddress}}" required email/>
<input matInput *ngIf="action!='Update'" name="emailAddress" [(ngModel)]="contactObj.emailAddress" #emailVal="ngModel" placeholder="Email Address" appUniqueContactEmail="{{emails}}|{{action}}|{{contactObj.emailAddress}}" required email/>
<mat-error *ngIf="cf.controls['emailAddress']?.errors?.nonUniqueEmail">
Email address is used by other contact
</mat-error>
<mat-error *ngIf="cf.controls['emailAddress']?.errors?.required || cf.controls['emailAddress']?.errors?.invalid ">
<mat-error *ngIf="cf.controls['emailAddress']?.errors?.required || cf.controls['emailAddress']?.invalid">
Please enter a valid email address
</mat-error>
......@@ -34,15 +35,17 @@
</mat-form-field>
</div>
</div>
<div class="mat-body" *ngIf="action==='Delete'">
Delete will remove the contact with email "{{contactObj.emailAddress}}" from the Account. Please click the {{action}} Contact button to proceed.
</div>
<div class="mat-body" *ngIf="action==='Success'">
Successfully saved subbmission account with id : {{contactObj.id}}.
Successfully saved the account with id : {{contactObj.id}}.
</div>
<div class="mat-body" *ngIf="action==='Error'">
{{contactObj.error.errorMessage}}
{{contactObj.error}}
</div>
<br>
<div style="text-align:center" *ngIf="action!='Error' && action!='Success'">
<button mat-raised-button color=primary [disabled]="cf.invalid">{{action}} Contact</button>
<button type="button" mat-raised-button style="margin-left: 5px;" (click)="closePopup()">Cancel</button>
......
......@@ -22,8 +22,10 @@ export class ContactDialogModalComponent implements OnInit {
contactObj={};
constructor( private formBuilder: FormBuilder, public dialogRef: MatDialogRef<ContactDialogModalComponent>,
@Optional() @Inject(MAT_DIALOG_DATA) public data: any,private util: UtilService) {
constructor( private formBuilder: FormBuilder,
public dialogRef: MatDialogRef<ContactDialogModalComponent>,
@Optional() @Inject(MAT_DIALOG_DATA) public data: any,
private util: UtilService) {
this.action = data.action;
this.emails=data.emailList;
if(this.action!="Error"){
......@@ -53,7 +55,13 @@ export class ContactDialogModalComponent implements OnInit {
var name= contact["firstName"] + " " + (contact["middleInitials"] || "") + " "+ contact["surname"];
if(contact["consortiumContact"]){
name=contact["consortium"];
contact.firstName="";
contact.surname="";
contact.middleInitials="";
}else{
contact.consortium="";
}
contact["name"]=name;
return contact;
}
......@@ -70,4 +78,6 @@ export class ContactDialogModalComponent implements OnInit {
to.name=from.name;
to.submissionAccountId=from.submissionAccountId;
}
}
......@@ -28,4 +28,8 @@ span:hover {
margin:10px;
}
mat-card-subtitle{
text-align: center;
}
\ No newline at end of file
......@@ -7,12 +7,12 @@
<div fxLayout="row wrap" fxLayoutGap="10px" fxLayoutAlign="center end">
<ng-container *ngIf="!isEga()" >
<mat-card *ngIf="false">
<mat-card>
<mat-card-subtitle>
Account Management
</mat-card-subtitle>
<div class="cat-element">
<span [routerLink]="['/register']">
<span [routerLink]="['/accountInfo']">
<mat-icon class="account_box">account_box</mat-icon>
<p class="mat-small mat-caption">Account Information</p>
</span>
......@@ -30,6 +30,10 @@
<mat-icon class="note_add">note_add</mat-icon>
<p class="mat-small mat-caption">Xml Submission</p>
</span>
<span [routerLink]="['/registerStudy']" >
<mat-icon class=note_add>note_add</mat-icon>
<p class="mat-small mat-caption">Register study (project)</p>
</span>
</div>
</mat-card>
</ng-container>
......
......@@ -5,3 +5,14 @@
.login-card {
width: 325px;
}
input[type="password"]{
box-shadow: none;
height: auto;
}
input[type="password"]:focus{
border: none;
box-shadow: none;
}
\ No newline at end of file
......@@ -16,12 +16,12 @@
<input type="password" matInput placeholder="Password" required [(ngModel)]="password" name="password">
</mat-form-field>
</p>
<!-- <p>
<a href="">Forgot Password ? </a>
</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>
<button mat-raised-button color="primary" type="button" style="margin-left: 5px;" [routerLink]="['/accountInfo']">Register</button>
<p>
<a (click)="openResetPasswordRequestDialog({})">Forgot Password ? </a>
</p>
</div>
<p class="app-error" *ngIf="error">
<i class="material-icons">error</i>
......
......@@ -15,6 +15,8 @@ import { WebinAuthenticationService } from '../webin-authentication.service';
import { HttpErrorResponse } from '@angular/common/http';
import { mergeMap } from 'rxjs/operators';
import { RouterModule } from '@angular/router';
import { MatDialog } from '@angular/material/dialog';
import { ResetPasswordRequestDialogComponent } from '../reset-password-request-dialog/reset-password-request-dialog.component'
......@@ -32,7 +34,8 @@ export class LoginComponent implements OnInit {
constructor(
private _router: Router,
private _webinAuthenticationService: WebinAuthenticationService) { }
private _webinAuthenticationService: WebinAuthenticationService,
public dialog: MatDialog) { }
ngOnInit() {
// console.log('LoginComponent.ngOnInit');
......@@ -79,4 +82,13 @@ export class LoginComponent implements OnInit {
}
);
}
openResetPasswordRequestDialog(obj){
const dialogRef = this.dialog.open(ResetPasswordRequestDialogComponent, {
width: '400px',
backdropClass: 'custom-dialog-backdrop-class',
panelClass: 'custom-dialog-panel-class',
data: {resetObj:obj}
});
}
}
......@@ -23,3 +23,9 @@ mat-form-field.mat-form-field {
font-family: Roboto;
}
.back-div{
float: left;
padding-top: 2px;
cursor: pointer;
}
<div class="body">
<div>
<div class="back-div" ><mat-icon matTooltip="Back" routerLink="">arrow_back_ios</mat-icon></div>
<div class="mat-h3 mat-tittle">{{ ReportType.getPluralName(reportType) | titlecase }} Report</div>
</div>
<mat-divider></mat-divider>
<div class="container">
<p class="mat-body" >
......
......@@ -4,4 +4,10 @@
.container{
padding: 10px 0px 0px 0px;
}
.back-div{
float: left;
padding-top: 2px;
cursor: pointer;
}
\ No newline at end of file
......@@ -10,8 +10,10 @@
-->
<div class="body">
<div class="mat-h3 mat-tittle">Submit XML</div>
<div>
<div class="back-div" ><mat-icon matTooltip="Back" routerLink="">arrow_back_ios</mat-icon></div>
<div class="mat-h3 mat-tittle">Submit XML</div>
</div>
<mat-divider></mat-divider>
<div class="container">
......
......@@ -3,6 +3,7 @@ import { HttpClient } from '@angular/common/http';
import { environment } from '../../environments/environment';
import { tap, startWith, map,debounceTime, catchError } from 'rxjs/operators';
import { throwError } from 'rxjs';
import { HttpHeaders } from '../../../node_modules/@angular/common/http';
......@@ -57,16 +58,44 @@ import { throwError } from 'rxjs';
}
async saveNewContact(contact){
return this.httpClient.post(environment.webinAdminServiceUrl+'/'+'submission-contact/create',contact).
return this.httpClient.post(environment.webinAdminServiceUrl+'/'+'submission-contact',contact).
pipe(
map((data: Response) => {
return data;
})
)
}
async sendResetPasswordRequest(resetPassReq){
return this.httpClient.post(environment.webinAdminServiceUrl+'/'+'request-password-change',resetPassReq).
pipe(
map((data: Response) => {
return data;
})
)
}
async resetPassword(resetPassReq,token){
return this.httpClient.put(environment.webinAdminServiceUrl+'/'+'change-password?token='+token,resetPassReq).
pipe(
map((data: Response) => {
return data;
})
)
}
async getPubMed(prefix) {
var url=environment.pupMedUrl +"?query="+prefix+"&resultType=lite&cursorMark=*&format=json";
return this.httpClient.get(url).pipe(map((data:any) => {
return data;
}));
}
getId(){
return Math.floor(1000 + Math.random() * 9000);
}
}
}
......@@ -36,11 +36,17 @@ export class WebinAuthenticationGuardService implements CanActivate {
// console.log('WebinAuthenticationGuardService: not authenticated');
const url = state.url;
console.log("URL ::");
console.log(url);
if (url.startsWith("/?page=")) {
// console.log('WebinAuthenticationGuardService: set redirectUrl', url);
this.webinAuthenticationService.redirectUrl = url;
}
this.router.navigate(['login']);
this.router.navigate(['login']);
return false;
}
}
......@@ -30,7 +30,9 @@ export class WebinAuthenticationInterceptor implements HttpInterceptor {
!req.url.startsWith(environment.webinReportServiceUrl + "/checklists") &&
!req.url.startsWith(environment.webinAuthenticationTokenUrl) &&
!(req.url.startsWith(environment.webinAdminServiceUrl + "/submission-account") && req.method==="POST") &&
!req.url.startsWith(environment.webinAdminServiceUrl + "/country")) {
!req.url.startsWith(environment.webinAdminServiceUrl + "/country") &&
!req.url.startsWith(environment.pupMedUrl) &&
!req.url.startsWith(environment.webinAdminServiceUrl + "/requestPasswordChange") ) {
//console.log('Webin authentication interceptor');
const webinAuthenticationService = this.injector.get(WebinAuthenticationService);
console.log(webinAuthenticationService.getAuthorizationTokenHeader())
......
......@@ -110,7 +110,7 @@ export class WebinAuthenticationService implements WebinAuthenticationServiceInt
this.loginDate = today;
this.logoutDate = new Date(today.getFullYear(), today.getMonth(), today.getDate() + 7);
const body = { authRealms: [ 'SRA', 'EGA' ], password: password, username: this.username };
const body = { authRealms: [ 'ENA', 'EGA' ], password: password, username: this.username };
const headers: HttpHeaders = new HttpHeaders()
.append('Content-Type', 'application/json')
.append('Accept', '*/*');
......@@ -127,7 +127,7 @@ export class WebinAuthenticationService implements WebinAuthenticationServiceInt
this.loginDate = today;
this.logoutDate = new Date(today.getFullYear(), today.getMonth(), today.getDate() + 7);
const body = { authRealms: [ 'SRA', 'EGA' ], password: password, username: this.username };
const body = { authRealms: [ 'ENA', 'EGA' ], password: password, username: this.username };
const headers: HttpHeaders = new HttpHeaders()
.append('Content-Type', 'application/json')
.append('Accept', '*/*');
......
......@@ -11,5 +11,6 @@ export const environment = {
webinAuthenticationTokenUrl: 'https://www.ebi.ac.uk/ena/auth/token',
webinReportServiceUrl: 'https://wwwdev.ebi.ac.uk/ena/submit/report',
webinXmlReportServiceUrl: 'https://wwwdev.ebi.ac.uk/ena/submit/drop-box',
webinGdprServiceUrl: 'TODO'
webinAdminServiceUrl: 'http://localhost:8210/ena/webinauth/admin',
webinGdprServiceUrl: 'TODO'
};
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