Commit bdc097d0 authored by rajkumar's avatar rajkumar
Browse files

Merge remote-tracking branch 'remotes/origin/txon-registration'

# Conflicts:
#	build.gradle
#	frontend/src/app/accountInfo/accountInfo.component.html
parents d88d4a21 5c5f7744
......@@ -19,7 +19,7 @@ enum Environment{
localdev, localtest, dev , test , prod
}
ext.version_base = '1.0.2'
ext.version_base = '1.0.5'
ext.environment = project.hasProperty('env') ? env : Environment.dev.toString()
version = version_base + "-$ext.environment"
group = 'uk.ac.ebi.ena.webin-portal'
......
This diff is collapsed.
......@@ -30,13 +30,16 @@
"@angular/platform-browser-dynamic": "8.2.14",
"@angular/router": "8.2.14",
"@types/file-saver": "^1.3.1",
"body-parser": "^1.19.0",
"core-js": "^2.5.7",
"cors": "^2.8.5",
"enum": "^2.5.0",
"file-saver": "^2.0.0-rc.4",
"hammerjs": "^2.0.8",
"moment": "^2.27.0",
"rxjs": "^6.5.5",
"tslib": "^1.9.0",
"twit": "^2.2.11",
"zone.js": "~0.9.1"
},
"devDependencies": {
......
.body{
padding:10px 20px 10px 10px;
.body {
padding: 10px 20px 10px 10px;
}
.container{
padding: 10px 0px 0px 0px;
.container {
padding: 10px 0px 0px 0px;
}
.column {
float: left;
width: 50%;
}
float: left;
width: 50%;
}
mat-form-field {
width: 100%;
width: 100%;
}
mat-card{
margin:10px;
mat-card {
margin: 10px;
}
mat-form-field.mat-form-field {
font-size: 14px;
font-family: Roboto;
}
font-size: 14px;
font-family: Roboto;
}
mat-icon{
cursor: pointer;
mat-icon {
cursor: pointer;
}
.mat-row:nth-child(even){
background-color:#f8f8f8;
.mat-row:nth-child(even) {
background-color: #f8f8f8;
}
.mat-header-cell{
font-weight: bold;
font-size: 14px;
color: #000000c7;
.mat-header-cell {
font-weight: bold;
font-size: 14px;
color: #000000c7;
}
input[type="password"]{
box-shadow: none;
height: auto;
}
input[type="password"] {
box-shadow: none;
height: auto;
}
input[type="password"]:focus{
border: none;
box-shadow: none;
input[type="password"]:focus {
border: none;
box-shadow: none;
}
.back-div{
float: left;
padding-top: 2px;
cursor: pointer;
}
.back-div {
float: left;
padding-top: 2px;
cursor: pointer;
}
input[readonly]{
background-color: #f5f5f5;
}
\ No newline at end of file
input[readonly] {
background-color: #f5f5f5;
}
......@@ -3,127 +3,151 @@
<div class="mat-h3 mat-tittle">Account Management</div>
</div>
<mat-divider></mat-divider>
<form (ngSubmit)="submitAccount(f)" #f="ngForm" [appMatchPassword]="['webinPassword', 'confirmPassword']" autocomplete="off">
<div class="container">
<form (ngSubmit)="submitAccount(f)" #f="ngForm" [appMatchPassword]="['webinPassword', 'confirmPassword']"
autocomplete="off">
<div class="container">
<mat-card>
<div class="row">
<mat-card-subtitle>Account Details</mat-card-subtitle>
<mat-card>
<div class="row">
<mat-card-subtitle>Account Details</mat-card-subtitle>
<div class="column">
<mat-form-field class="app-field-padding" *ngIf="editMode">
<input name="id" [readonly]="true" matInput placeholder="Submission Account Id" required [(ngModel)]="id">
</mat-form-field>
<mat-form-field class="app-field-padding">
<input name="centerName" matInput placeholder="Center Name" required [(ngModel)]="centerName">
<mat-hint *ngIf="editMode">
Changing Center Name will not affect existing submissions
</mat-hint>
</mat-form-field>
<mat-form-field class="app-field-padding">
<input matInput placeholder="Laboratory Name" [(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" [matAutocomplete]="auto" name="country" #countryVal="ngModel" [(ngModel)]="country" (ngModelChange)="getCountries(country)" autocomplete="new-password">
</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" *ngIf="!editMode">
<mat-form-field class="app-field-padding">
<input matInput [disabled]="editMode" type="password" placeholder="Password" required [(ngModel)]="webinPassword" name="webinPassword" autocomplete="new-password">
</mat-form-field>
<mat-form-field class="app-field-padding">
<input matInput [disabled]="editMode" type="password" placeholder="Confirm Password" required [(ngModel)]="confirmPassword" name="confirmPassword" autocomplete="new-c-password">
<mat-error *ngIf="f.controls['confirmPassword']?.errors?.passwordMismatch">
Passwords do not match
</mat-error>
</mat-form-field>
</div>
<div class="column" *ngIf="editMode" style=" padding-top: 20px;">
<a (click)="openResetPasswordRequestDialog({'submissionAccountId':id,'loggedIn':true})">Change Password </a>
<div class="column">
<mat-form-field class="app-field-padding" *ngIf="editMode">
<input name="id" [readonly]="true" matInput placeholder="Submission Account Id" required
[(ngModel)]="id" />
</mat-form-field>
<mat-form-field class="app-field-padding">
<input name="centerName" matInput placeholder="Center Name" required [(ngModel)]="centerName" />
<mat-hint *ngIf="editMode">
Changing Center Name will not affect existing submissions
</mat-hint>
</mat-form-field>
<mat-form-field class="app-field-padding">
<input matInput placeholder="Laboratory Name" [(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" [matAutocomplete]="auto" name="country" #countryVal="ngModel"
[(ngModel)]="country" (ngModelChange)="getCountries(country)" autocomplete="new-password" />
</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" *ngIf="!editMode">
<mat-form-field class="app-field-padding">
<input matInput [disabled]="editMode" type="password" placeholder="Password" required
[(ngModel)]="webinPassword" name="webinPassword" autocomplete="new-password" />
</mat-form-field>
<mat-form-field class="app-field-padding">
<input matInput [disabled]="editMode" type="password" placeholder="Confirm Password" required
[(ngModel)]="confirmPassword" name="confirmPassword" autocomplete="new-c-password" />
<mat-error *ngIf="f.controls['confirmPassword']?.errors?.passwordMismatch">
Passwords do not match
</mat-error>
</mat-form-field>
</div>
<div class="column" *ngIf="editMode" style="padding-top: 20px">
<a (click)="
openResetPasswordRequestDialog({
submissionAccountId: id,
loggedIn: true
})
">Change Password
</a>
</div>
</div>
</div>
</mat-card>
<mat-card class="mat-body">
<div class=row>
<mat-card-subtitle>Contact Information</mat-card-subtitle>
<a (click)="openDialog('Add',{'submissionAccountId':id})">Add At Least One Contact<mat-icon>add_circle</mat-icon></a>
</mat-card>
<table mat-table *ngIf="dataSource" #table [dataSource]="dataSource" class="mat-elevation-z8">
<mat-card class="mat-body">
<div class="row">
<mat-card-subtitle>Contact Information</mat-card-subtitle>
<a (click)="openDialog('Add', { submissionAccountId: id })">Add At Least One Contact<mat-icon>add_circle
</mat-icon></a>
<ng-container matColumnDef="firstName">
<th mat-header-cell *matHeaderCellDef> Name </th>
<td mat-cell *matCellDef="let element"> {{element.name}} </td>
</ng-container>
<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="emailAddress">
<th mat-header-cell *matHeaderCellDef> Email </th>
<td mat-cell *matCellDef="let element"> {{element.emailAddress}} </td>
</ng-container>
<ng-container matColumnDef="emailAddress">
<th mat-header-cell *matHeaderCellDef>Email</th>
<td mat-cell *matCellDef="let element">
{{ element.emailAddress }}
</td>
</ng-container>
<ng-container matColumnDef="mainContact">
<th mat-header-cell *matHeaderCellDef> Primary Contact </th>
<td mat-cell *matCellDef="let element">
<mat-checkbox *ngIf="element.mainContact" matInput [checked]=true disabled style="padding-left: 20px;"></mat-checkbox>
<mat-checkbox *ngIf="!element.mainContact" matInput [checked]=false disabled style="padding-left: 20px;"></mat-checkbox>
</td>
</ng-container>
<ng-container matColumnDef="mainContact">
<th mat-header-cell *matHeaderCellDef>Primary Contact</th>
<td mat-cell *matCellDef="let element">
<mat-checkbox *ngIf="element.mainContact" matInput [checked]="true" disabled style="padding-left: 20px">
</mat-checkbox>
<mat-checkbox *ngIf="!element.mainContact" 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="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>
<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>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
<!--<mat-error *ngIf="mainContact <= 0 ">
<!--<mat-error *ngIf="mainContact <= 0 ">
Please enter atlease one primary contact to save the account.
</mat-error>-->
</div>
</mat-card>
</div>
</mat-card>
<mat-card class="mat-body">
<div class="row">
<mat-card-subtitle>Metagenomics Consent</mat-card-subtitle>
<p>By keeping this box checked you give consent to the EBI MGnify team to analyse those data for which you have requested a pre-publication confidential hold. Note that the data as well as the analysis results will remain confidential until the specified release date of the associated sequencing study. If you are also requesting assembly of your data by MGnify, you also give consent to MGnify to submit these assemblies to your ENA study on your behalf. MGnify will not change any metadata or data you have already submitted but may need to perform updates to submissions performed by their team in exceptional circumstances. This service provides pre-publication state-of-the-art analysis results, along with visualisations, that you may use in subsequent publications. The service is described in <a href="http://europepmc.org/article/MED/31696235">http://europepmc.org/article/MED/31696235</a> and we kindly request, should you use these analyses in your publications, that you cite this paper.</p>
<mat-checkbox matInput name="metagenomicsConsented" [(ngModel)]="metagenomicsConsented" style="padding-left: 20px;">* I give consent and confirm that the data submitted through this account is NOT sensitive, restricted-access or human-identifiable:</mat-checkbox>
<mat-card class="mat-body">
<div class="row">
<mat-card-subtitle>Metagenomics Consent</mat-card-subtitle>
<p>
By keeping this box checked you give consent to the EBI Metagenomics
team to analyse those data for which you have requested a
pre-publication confidential hold. Note that the data as well as the
analysis results will remain confidential until the specified
release date of the associated sequencing study. This service
provides pre-publication state-of-the-art analysis results, along
with visualisations, that you may use in subsequent publications.
The service is described in
http://europepmc.org/abstract/MED/29069476 and we kindly request,
should you use these analyes in your publications, that you cite
this paper.
</p>
<mat-checkbox matInput name="metagenomicsConsented" [(ngModel)]="metagenomicsConsented"
style="padding-left: 20px">* I give consent and confirm that the data submitted through this
account is NOT sensitive, restricted-access or
human-identifiable:</mat-checkbox>
</div>
</mat-card>
</div>
</mat-card>
</div>
<div style="text-align:Center">
<button mat-raised-button color="accent" [disabled]="f.invalid || mainContact <= 0">Save</button>
<button mat-raised-button style="margin-left: 5px;" routerLink="">Cancel</button>
</div>
</form>
<div style="text-align: Center">
<button mat-raised-button color="accent" [disabled]="f.invalid || mainContact <= 0">
Save
</button>
<button mat-raised-button style="margin-left: 5px" routerLink="">
Cancel
</button>
</div>
</form>
</div>
......@@ -13,14 +13,14 @@ import { Component, ViewEncapsulation, ViewChild } from '@angular/core';
import { WebinAuthenticationService } from '../webin-authentication.service';
import { ReportType } from '../report-type.enum';
import { MatIconModule } from '@angular/material'
import {MatExpansionModule} from '@angular/material/expansion';
import { MatExpansionModule } from '@angular/material/expansion';
@Component({
selector: 'app-main',
templateUrl: './accountInfo.component.html',
styleUrls: ['./accountInfo.component.css'],
encapsulation: ViewEncapsulation.None,
})
export class AccountInfoComponent {
......
......@@ -9,261 +9,294 @@
* specific language governing permissions and limitations under the License.
*/
import { Component, ViewEncapsulation, ViewChild } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { ContactDialogModalComponent } from '../contact-dialog-modal/contact-dialog-modal.component';
import { MatTableDataSource } from '@angular/material';
import { UtilService } from '../util/Util-services'
import { getLocaleDayNames } from '@angular/common';
import { mergeMap, catchError } from 'rxjs/operators';
import { Router, ActivatedRoute } from '@angular/router';
import { WebinAuthenticationService } from '../webin-authentication.service';
import { Compiler } from '@angular/core';
import { ResetPasswordRequestDialogComponent } from '../reset-password-request-dialog/reset-password-request-dialog.component'
import { Component, ViewEncapsulation, ViewChild } from "@angular/core";
import { MatDialog } from "@angular/material/dialog";
import { ContactDialogModalComponent } from "../contact-dialog-modal/contact-dialog-modal.component";
import { MatTableDataSource } from "@angular/material";
import { UtilService } from "../util/Util-services";
import { getLocaleDayNames } from "@angular/common";
import { mergeMap, catchError } from "rxjs/operators";
import { Router, ActivatedRoute } from "@angular/router";
import { WebinAuthenticationService } from "../webin-authentication.service";
import { Compiler } from "@angular/core";
import { ResetPasswordRequestDialogComponent } from "../reset-password-request-dialog/reset-password-request-dialog.component";
import { NonSubmissionResultDialogComponent } from "../non-submission-result-dialog/non-submission-result-dialog.component";
import { HttpErrorResponse } from "@angular/common/http";
@Component({
selector: 'app-main',
templateUrl: './accountInfo.component.html',
styleUrls: ['./accountInfo.component.css'],
selector: "app-main",
templateUrl: "./accountInfo.component.html",
styleUrls: ["./accountInfo.component.css"],
encapsulation: ViewEncapsulation.None,
})
export class AccountInfoComponent {
id: string;
centerName: string;
address: string;
laboratoryName: string;
country: string;
contactArray= [];
deletedContacts=[];
newContacts=[];
contactArray = [];
deletedContacts = [];
newContacts = [];
mainContact: number;
dataSource: MatTableDataSource<any>;
displayedColumns: string[] = ['firstName', 'emailAddress','mainContact','edit','remove'];
displayedColumns: string[] = [
"firstName",
"emailAddress",
"mainContact",
"edit",
"remove",
];
metagenomeSubmitter = false;
metagenomicsConsented = false;
/* Used for storing added emails, this will be used for validation */
emails= [];
emails = [];
countries=<any>[];
countries = <any>[];
editMode=false;
editMode = false;
constructor(private _router: Router, private _activatedRoute: ActivatedRoute, public dialog: MatDialog,private util: UtilService,private _webinAuthenticationService: WebinAuthenticationService,private _compiler: Compiler) {
constructor(
private _router: Router,
private _activatedRoute: ActivatedRoute,
public dialog: MatDialog,
private util: UtilService,
private _webinAuthenticationService: WebinAuthenticationService,
private _compiler: Compiler
) {
_compiler.clearCache();
this.mainContact=0;
if(_webinAuthenticationService.authenticated){
this.mainContact = 0;
if (_webinAuthenticationService.authenticated) {
this.loadUserInfo(_webinAuthenticationService.username);
this.editMode=true;
this.editMode = true;
}
}
}
ngOnInit() {
this.util.getCountries(null);
this._activatedRoute.fragment.subscribe((fragment: string) =>{
if(fragment==="metagenome_registration"){
this.metagenomeSubmitter=true;
this._activatedRoute.fragment.subscribe((fragment: string) => {
if (fragment === "metagenome_registration") {
this.metagenomeSubmitter = true;
}
})
}
ngOnDestroy() {
});
}
openDialog(action,obj): void {
ngOnDestroy() { }
openDialog(action, obj): void {
const dialogRef = this.dialog.open(ContactDialogModalComponent, {
width: '500px',
backdropClass: 'custom-dialog-backdrop-class',
panelClass: 'custom-dialog-panel-class',
data: {action: action, emailList:this.emails,contactObj:obj}
width: "500px",
backdropClass: "custom-dialog-backdrop-class",
panelClass: "custom-dialog-panel-class",
data: { action: action, emailList: this.emails, contactObj: obj },
});
dialogRef.afterClosed().subscribe(result => {
if(result.event!='close'){
let contactObj=result.data;
if(result.event==='Add'){
dialogRef.afterClosed().subscribe((result) => {
if (result.event != "close") {
let contactObj = result.data;
if (result.event === "Add") {
this.addContactRow(contactObj);
if(this.editMode){
if (this.editMode) {
this.newContacts.push(contactObj);
}
}
if(result.event==='Update'){
if (result.event === "Update") {
this.updateContactRow(contactObj);
}
if(result.event==='Delete'){
if (result.event === "Delete") {
this.deleteContactRow(contactObj);
}
if(result.event==='CloseSuccess'){
if(!this.editMode){
this._router.navigateByUrl('');
} else{
this._router.navigateByUrl('/accountInfo');
if (result.event === "CloseSuccess") {
if (!this.editMode) {
this._router.navigateByUrl("");
} else {
this._router.navigateByUrl("/accountInfo");
}
}
if(typeof contactObj!="undefined"){
this.updateMainContact(contactObj)
if (typeof contactObj != "undefined") {
this.updateMainContact(contactObj);
this.dataSource = new MatTableDataSource<any>(this.contactArray);
}
this.updateEmailsArray();