Commit 00f7e498 authored by rajkumar's avatar rajkumar
Browse files

New Webin Portal User registration changes :

1) Updating popup fields to match JSON
2) Updating the Dashbord screen to show all elements in the screen without expandables
3) Updating the reports for fixing the Action link.
parent b9a08feb
......@@ -24,7 +24,8 @@ ext.environment = project.hasProperty('env') ? env : Environment.dev.toString()
version = version_base + "-$ext.environment"
group = 'uk.ac.ebi.ena.webin-portal'
ext.sshKeyFile = file(hasProperty('sshKeyFile') ? sshKeyFile : "${System.properties['user.home']}/.ssh/id_rsa")
ext.sshKeyFile = file(hasProperty('sshKeyFile') ? sshKeyFile : "${System.properties['user.home']}/.ssh/id_rsa.ppk")
ext.gitlab_project_id ='977'
ext.envAngularBuildScriptMap = [
......@@ -136,7 +137,8 @@ publishing {
// Developer token in Gitlab.
credentials(HttpHeaderCredentials) {
name = "Private-Token"
value = project.ext.properties.gitlab_private_token
value = "-35Eh5MFLnrPuDYUnNq4"
//value = project.ext.properties.gitlab_private_token
}
authentication {
header( HttpHeaderAuthentication )
......
......@@ -6893,7 +6893,8 @@
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"core-util-is": {
"version": "1.0.2",
......@@ -7053,6 +7054,7 @@
"version": "2.3.5",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"safe-buffer": "^5.1.2",
"yallist": "^3.0.0"
......@@ -7071,6 +7073,7 @@
"version": "0.5.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"minimist": "0.0.8"
}
......@@ -7171,6 +7174,7 @@
"version": "1.4.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"wrappy": "1"
}
......@@ -7256,7 +7260,8 @@
"safe-buffer": {
"version": "5.1.2",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"safer-buffer": {
"version": "2.1.2",
......@@ -7292,6 +7297,7 @@
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
......@@ -7355,12 +7361,14 @@
"wrappy": {
"version": "1.0.2",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"yallist": {
"version": "3.0.3",
"bundled": true,
"dev": true
"dev": true,
"optional": true
}
}
},
......@@ -10750,7 +10758,8 @@
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz",
"integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==",
"dev": true
"dev": true,
"optional": true
},
"pify": {
"version": "4.0.1",
......@@ -13755,6 +13764,7 @@
"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"
}
......@@ -13770,7 +13780,8 @@
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
"integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==",
"dev": true
"dev": true,
"optional": true
},
"readdirp": {
"version": "3.4.0",
......
......@@ -42,7 +42,7 @@ 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 { 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';
......@@ -76,6 +76,11 @@ const appRoutes: Routes = [
component: ReportComponent,
canActivate: [WebinAuthenticationGuardService],
},
{
path: 'report/:reportType/:id',
component: ReportComponent,
canActivate: [WebinAuthenticationGuardService],
},
{
path: 'app-submit',
component: SubmitComponent,
......@@ -88,7 +93,7 @@ const appRoutes: Routes = [
},
{
path: 'register',
component: RegisterComponent,
component: AccountInfoComponent,
},
{
......@@ -124,7 +129,7 @@ const appRoutes: Routes = [
ReportActionComponent,
GdprComponent,
ChecklistComponent,
RegisterComponent,
AccountInfoComponent,
ContactDialogModalComponent,
UniqueContactEmailDirective,
MatchPasswordDirective,
......
......@@ -2,15 +2,17 @@
<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="primaryContact" [(ngModel)]="contactObj.primaryContact">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="email" [(ngModel)]="contactObj.email" #emailVal="ngModel" placeholder="Email Address" appUniqueContactEmail="{{emails}}|{{action}}|{{contactObj.email}}" required email/>
<mat-error *ngIf="cf.controls['email']?.errors?.nonUniqueEmail">
<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">
Email address is used by other contact
</mat-error>
<mat-error *ngIf="cf.controls['email']?.errors?.required || cf.controls['email']?.errors?.invalid ">
<mat-error *ngIf="cf.controls['emailAddress']?.errors?.required || cf.controls['emailAddress']?.errors?.invalid ">
Please enter a valid email address
</mat-error>
......@@ -20,7 +22,7 @@
<input matInput name="firstName" [(ngModel)]="contactObj.firstName" placeholder="First Name" required>
</mat-form-field>
<mat-form-field>
<input matInput name="middleName" [(ngModel)]="contactObj.middleName" placeholder="Middle Name">
<input matInput name="middleInitials" [(ngModel)]="contactObj.middleInitials" placeholder="Middle Name">
</mat-form-field>
<mat-form-field>
<input matInput name="surname" [(ngModel)]="contactObj.surname" placeholder="Surame" required>
......@@ -28,15 +30,15 @@
</div>
<div *ngIf="contactObj.consortiumContact">
<mat-form-field>
<input matInput name="consortiumName" [(ngModel)]="contactObj.consortiumName" placeholder="Consortium Name" required>
<input matInput name="consortium" [(ngModel)]="contactObj.consortium" placeholder="Consortium Name" required>
</mat-form-field>
</div>
</div>
<div class="mat-body" *ngIf="action==='Delete'">
Delete will remove the contact with email "{{contactObj.email}}" from the Account. Please click the {{action}} Contact button to proceed.
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 created subbmission account with id : {{contactObj.id}}.
Successfully saved subbmission account with id : {{contactObj.id}}.
</div>
<div class="mat-body" *ngIf="action==='Error'">
{{contactObj.error.errorMessage}}
......
......@@ -2,6 +2,7 @@ import { Component, OnInit, Optional, Inject } from '@angular/core';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import {FormControl, FormGroupDirective, NgForm, Validators, FormGroup, FormBuilder} from '@angular/forms';
import {ErrorStateMatcher} from '@angular/material/core';
import {UtilService} from '../util/Util-services'
@Component({
......@@ -22,7 +23,7 @@ export class ContactDialogModalComponent implements OnInit {
contactObj={};
constructor( private formBuilder: FormBuilder, public dialogRef: MatDialogRef<ContactDialogModalComponent>,
@Optional() @Inject(MAT_DIALOG_DATA) public data: any) {
@Optional() @Inject(MAT_DIALOG_DATA) public data: any,private util: UtilService) {
this.action = data.action;
this.emails=data.emailList;
if(this.action!="Error"){
......@@ -38,7 +39,7 @@ export class ContactDialogModalComponent implements OnInit {
doAction(){
if(this.action==="Add") {
this.contactObj["id"]=this.getId();
this.contactObj["id"]=this.util.getId();
}
let contact=this.updateName(this.contactObj);
this.dialogRef.close({ event: this.action, data: contact });
......@@ -48,14 +49,10 @@ export class ContactDialogModalComponent implements OnInit {
this.dialogRef.close({event: 'close'});
}
getId(){
return Math.floor(1000 + Math.random() * 9000);
}
updateName(contact){
var name= contact["firstName"] + " " + contact["middleName"] + " "+ contact["surname"];
var name= contact["firstName"] + " " + (contact["middleInitials"] || "") + " "+ contact["surname"];
if(contact["consortiumContact"]){
name=contact["consortiumName"];
name=contact["consortium"];
}
contact["name"]=name;
return contact;
......@@ -63,13 +60,14 @@ export class ContactDialogModalComponent implements OnInit {
copyObjectValue(from,to){
to.id=from.id;
to.email=from.email;
to.emailAddress=from.emailAddress;
to.firstName=from.firstName;
to.middleName=from.middleName;
to.middleInitials=from.middleInitials;
to.surname=from.surname;
to.consortiumName=from.consortiumName;
to.primaryfrom=from.primaryContact;
to.consortium=from.consortium;
to.mainContact=from.mainContact;
to.consortiumContact=from.consortiumContact;
to.name=from.name;
to.submissionAccountId=from.submissionAccountId;
}
}
......@@ -17,7 +17,7 @@
}
.cat-element span mat-icon{
font-size: 50px;
padding-right: 25px;
padding-right: 50px;
}
span:hover {
......
......@@ -3,64 +3,56 @@
<mat-divider></mat-divider>
<div class="container">
<mat-accordion>
<ng-container *ngIf="!isEga()">
<div class="category" hidden>
<mat-expansion-panel>
<mat-expansion-panel-header>
<mat-panel-title>
<div fxLayout="row wrap" fxLayoutGap="10px" fxLayoutAlign="center end">
<ng-container *ngIf="!isEga()" >
<mat-card *ngIf="false">
<mat-card-subtitle>
Account Management
</mat-panel-title>
</mat-expansion-panel-header>
</mat-card-subtitle>
<div class="cat-element">
<span>
<span [routerLink]="['/register']">
<mat-icon class="account_box">account_box</mat-icon>
<p class="mat-small mat-caption">Account Information</p>
</span>
</div>
</mat-expansion-panel>
</div>
</mat-card>
</ng-container>
<div class="category">
<mat-expansion-panel expanded>
<mat-expansion-panel-header>
<mat-panel-title> Submissions </mat-panel-title>
</mat-expansion-panel-header>
<ng-container>
<mat-card>
<mat-card-subtitle> Submissions </mat-card-subtitle>
<div class="cat-element">
<span [routerLink]="['/app-submit']">
<mat-icon class="note_add">note_add</mat-icon>
<p class="mat-small mat-caption">Xml Submission</p>
</span>
</div>
</mat-expansion-panel>
</div>
</mat-card>
</ng-container>
<ng-container *ngIf="!isEga()">
<div class="category">
<mat-expansion-panel>
<mat-expansion-panel-header>
<mat-panel-title>Spreadsheet Templates</mat-panel-title>
</mat-expansion-panel-header>
<mat-card>
<mat-card-subtitle>Spreadsheet Templates</mat-card-subtitle>
<div class="cat-element">
<span [routerLink]="['/app-checklist','sequence',true]">
<mat-icon class="system_update_alt">system_update_alt</mat-icon>
<p class="mat-small mat-caption">Annotated Sequences</p>
</span>
</div>
</mat-expansion-panel>
</div>
</ng-container>
</mat-card>
</ng-container>
</div>
<!-------------------------Reports------------------------->
<div>
<div class="category">
<mat-expansion-panel>
<mat-expansion-panel-header>
<mat-panel-title>Reports</mat-panel-title>
</mat-expansion-panel-header>
<mat-card>
<mat-card-subtitle>Reports</mat-card-subtitle>
<div class="cat-element">
<span [routerLink]="['/report',ReportType.studies]" >
<mat-icon class=insert_chart>insert_chart</mat-icon>
......@@ -72,36 +64,35 @@
<p class="mat-small mat-caption">Samples Report</p>
</span>
<span [routerLink]="['/report',ReportType.runs]" >
<mat-icon class=insert_chart>insert_chart</mat-icon>
<p class="mat-small mat-caption">Runs Report</p>
</span>
<span [routerLink]="['/report',ReportType.analyses]" >
<mat-icon class=insert_chart>insert_chart</mat-icon>
<p class="mat-small mat-caption">Analysis Report</p>
</span>
<ng-container *ngIf="!isEga()">
<span [routerLink]="['/report',ReportType.runFiles]" >
<span [routerLink]="['/report',ReportType.analysisFiles]" >
<mat-icon class=insert_chart>insert_chart</mat-icon>
<p class="mat-small mat-caption">Run File Report</p>
<p class="mat-small mat-caption">Analysis File Report</p>
</span>
<span [routerLink]="['/report',ReportType.analysisFiles]" >
<span [routerLink]="['/report',ReportType.analysisProcess]" >
<mat-icon class=insert_chart>insert_chart</mat-icon>
<p class="mat-small mat-caption">Analysis File Report</p>
<p class="mat-small mat-caption">Analysis Process Report</p>
</span>
<span [routerLink]="['/report',ReportType.runProcess]" >
<span [routerLink]="['/report',ReportType.runs]" >
<mat-icon class=insert_chart>insert_chart</mat-icon>
<p class="mat-small mat-caption">Run Process Report</p>
<p class="mat-small mat-caption">Runs Report</p>
</span>
<span [routerLink]="['/report',ReportType.runFiles]" >
<mat-icon class=insert_chart>insert_chart</mat-icon>
<p class="mat-small mat-caption">Run File Report</p>
</span>
<span [routerLink]="['/report',ReportType.analysisProcess]" >
<span [routerLink]="['/report',ReportType.runProcess]" >
<mat-icon class=insert_chart>insert_chart</mat-icon>
<p class="mat-small mat-caption">Analysis Process Report</p>
<p class="mat-small mat-caption">Run Process Report</p>
</span>
<span [routerLink]="['/report',ReportType.unsubmittedFiles]" >
......@@ -122,12 +113,15 @@
<mat-icon class=insert_chart>insert_chart</mat-icon>
<p class="mat-small mat-caption">Datasets</p>
</span>
</ng-container>
</div>
</mat-expansion-panel>
</mat-card>
</div>
</mat-accordion>
</div>
</div>
......@@ -16,6 +16,9 @@
<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>
......
......@@ -17,6 +17,7 @@ import { mergeMap } from 'rxjs/operators';
import { RouterModule } from '@angular/router';
@Component({
selector: 'app-login',
templateUrl: './login.component.html',
......@@ -55,6 +56,7 @@ export class LoginComponent implements OnInit {
subscribe(
data => {
// console.log('WebinAuthenticationService.loginToken succeeded');
console.log(data)
this._webinAuthenticationService.token = data;
const redirectUrl = this._webinAuthenticationService.redirectUrl;
if (redirectUrl) {
......
.body{
padding:10px 20px 10px 10px;
}
.container{
padding: 10px 0px 0px 0px;
}
.column {
float: left;
width: 50%;
}
mat-form-field {
width: 100%;
}
mat-card{
margin:10px;
}
mat-form-field.mat-form-field {
font-size: 14px;
font-family: Roboto;
}
mat-icon{
cursor: pointer;
}
.mat-row:nth-child(even){
background-color:#f8f8f8;
}
.mat-header-cell{
font-weight: bold;
font-size: 14px;
color: #000000c7;
}
input[type="password"]{
box-shadow: none;
height: auto;
}
input[type="password"]:focus{
border: none;
box-shadow: none;
}
\ No newline at end of file
<div class="body">
<div class="mat-h3 mat-tittle">Registration</div>
<mat-divider></mat-divider>
<form (ngSubmit)="submitAccount(f)" #f="ngForm" [appMatchPassword]="['webinPassword', 'confirmPassword']">
<div class="container">
<mat-card>
<mat-card-subtitle>Account Details</mat-card-subtitle>
<div class="row">
<div class="column">
<mat-form-field class="app-field-padding">
<input name="centerName" matInput placeholder="Center Name" required [(ngModel)]="centerName">
</mat-form-field>
<mat-form-field class="app-field-padding">
<input matInput placeholder="Laboratory Name" required [(ngModel)]="laboratoryName" name="laboratoryName">
</mat-form-field>
<mat-form-field class="app-field-padding">
<input matInput placeholder="Address" required [(ngModel)]="address" name="address">
</mat-form-field>
<!--<mat-form-field class="app-field-padding">
<input matInput placeholder="Country" required [(ngModel)]="country" name="country">
</mat-form-field>-->
<mat-form-field class="app-field-padding">
<input matInput placeholder="Country" [matAutocomplete]="auto" name="country" #countryVal="ngModel" [(ngModel)]="country" (ngModelChange)="doFilterCountry(country)">
</mat-form-field>
<mat-autocomplete #auto="matAutocomplete">
<mat-option *ngFor="let country of countries" [value]="country">
{{country}}
</mat-option>
</mat-autocomplete>
</div>
<div class="column">
<mat-form-field class="app-field-padding">
<input matInput type="password" placeholder="Password" required [(ngModel)]="webinPassword" name="webinPassword">
</mat-form-field>
<mat-form-field class="app-field-padding">
<input matInput type="password" placeholder="Confirm Password" required [(ngModel)]="confirmPassword" name="confirmPassword">
<mat-error *ngIf="f.controls['confirmPassword']?.errors?.passwordMismatch">
Password and Confirm password dose not match
</mat-error>
</mat-form-field>
</div>
</div>
</mat-card>
<mat-card class="mat-body">
<mat-card-subtitle>Contact Information</mat-card-subtitle>
<a (click)="openDialog('Add',{})">Add new contact <mat-icon>add_circle</mat-icon></a>
<table mat-table *ngIf="dataSource" #table [dataSource]="dataSource" class="mat-elevation-z8">
<ng-container matColumnDef="firstName">
<th mat-header-cell *matHeaderCellDef> Name </th>
<td mat-cell *matCellDef="let element"> {{element.name}} </td>
</ng-container>
<ng-container matColumnDef="email">
<th mat-header-cell *matHeaderCellDef> Email </th>
<td mat-cell *matCellDef="let element"> {{element.email}} </td>
</ng-container>
<ng-container matColumnDef="primaryContact">
<th mat-header-cell *matHeaderCellDef> Primary Contact </th>
<td mat-cell *matCellDef="let element">
<mat-checkbox *ngIf="element.primaryContact" matInput [checked]=true disabled style="padding-left: 20px;"></mat-checkbox>
<mat-checkbox *ngIf="!element.primaryContact" matInput [checked]=false disabled style="padding-left: 20px;"></mat-checkbox>
</td>
</ng-container>
<ng-container matColumnDef="edit">
<th mat-header-cell *matHeaderCellDef> Edit </th>
<td mat-cell *matCellDef="let element">
<mat-icon (click)="openDialog('Update',element)">edit</mat-icon>
</td>
</ng-container>
<ng-container matColumnDef="remove">
<th mat-header-cell *matHeaderCellDef> Remove </th>
<td mat-cell *matCellDef="let element">
<mat-icon (click)="openDialog('Delete',element)">delete</mat-icon>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>