Commit 9c1564e9 authored by Rajkumar-D's avatar Rajkumar-D
Browse files

Merge remote-tracking branch 'origin/Policy-branch'

parents adabfa0f 883973bc
Pipeline #278359 passed with stages
in 5 minutes and 28 seconds
......@@ -268,10 +268,15 @@
target="_blank">these instructions</a>.
</p>
</div>
<input type="file" required name="spreadSheet" [(ngModel)]="form.spreadSheet" observeFiles />
<button mat-raised-button color="accent" [disabled]="form.invalid">
Submit Completed Spreadsheet
</button>
<div>
<input type="file" required name="spreadSheet" [(ngModel)]="form.spreadSheet" observeFiles />
<mat-form-field *ngIf="isBroker()" appearance="outline" style="width:7%; margin-right: 5px;">
<input matInput placeholder="Center name" name="centerName" [(ngModel)]="centerName">
</mat-form-field>
<button mat-raised-button color="accent" [disabled]="form.invalid">
Submit Completed Spreadsheet
</button>
</div>
</form>
</mat-expansion-panel>
</mat-accordion>
......
......@@ -476,9 +476,13 @@ export class ChecklistComponent implements OnInit {
null,
null,
null,
null);
null,
form.value.centerName);
let redirectPath = "/app-checklist/sample/true"
this.util.showSubmissionResponse(this, SubmissionResultDialogComponent, observable, redirectPath);
}
isBroker(): boolean {
return this._webinAuthenticationService.isBroker();
}
}
......@@ -122,6 +122,9 @@
</p>
<form (ngSubmit)="uploadFile(form)" #form="ngForm">
<input type="file" required name="spreadSheet" [(ngModel)]="form.spreadSheet" observeFiles />
<mat-form-field *ngIf="isBroker()" appearance="outline" style="width:7%; margin-right: 5px;">
<input matInput placeholder="Center name" name="centerName" [(ngModel)]="centerName">
</mat-form-field>
<button mat-raised-button color="accent" [disabled]="form.invalid ">Submit Completed
Spreadsheet</button>
</form>
......
......@@ -27,6 +27,8 @@ export class ReadSubmissionComponent implements OnInit {
selectedFieldType: string;
selectedFieldName: string;
fieldType = {};
centerName: String;
constructor(private _webinReportService: WebinReportService,
private util: UtilService,
private _webinRestService: WebinRestService,
......@@ -127,7 +129,8 @@ export class ReadSubmissionComponent implements OnInit {
null,
null,
null,
null);
null,
this.centerName);
let redirectPath = "/read-submission";
this.util.showSubmissionResponse(this, SubmissionResultDialogComponent, observable, redirectPath)
}
......@@ -146,4 +149,8 @@ export class ReadSubmissionComponent implements OnInit {
}
return showField;
}
isBroker(): boolean {
return this._webinAuthenticationService.isBroker();
}
}
......@@ -83,4 +83,9 @@
.full-width-dashboard:not(:hover){
outline: 0;
}
/* For center name text box. */
::ng-deep .mat-form-field-flex > .mat-form-field-infix {
padding: 0.3em 0em 0.7em 0em !important;
}
\ No newline at end of file
......@@ -186,8 +186,12 @@
</mat-spinner>
</div>
<div style="text-align:Center">
<button mat-raised-button color="accent" [disabled]="f.invalid">Save</button>
<mat-form-field *ngIf="isBroker()" appearance="outline" style="width:7%; margin-right: 5px;">
<input matInput placeholder="Center name" name="centerName" [(ngModel)]="centerName">
</mat-form-field>
<button mat-raised-button color="accent" [disabled]="f.invalid">Submit</button>
<button *ngIf="action==='Edit'" mat-raised-button style="margin-left: 5px;"
routerLink="/report/studies">Cancel</button>
<button *ngIf="action!='Edit'" mat-raised-button style="margin-left: 5px;" routerLink="">Cancel</button>
......
......@@ -351,4 +351,8 @@ export class StudyManagementComponent implements OnInit {
isEga(): boolean {
return this._webinAuthenticationService.ega;
}
isBroker(): boolean {
return this._webinAuthenticationService.isBroker();
}
}
......@@ -65,7 +65,12 @@
</div>
</div>
<button mat-raised-button color="accent" [disabled]="!canSubmit()" (click)="submit()">Submit</button>
<div style="text-align:Center">
<mat-form-field *ngIf="isBroker()" appearance="outline" style="width:7%; margin-right: 5px;">
<input matInput placeholder="Center name" name="centerName" [(ngModel)]="centerName">
</mat-form-field>
<button mat-raised-button color="accent" [disabled]="!canSubmit()" (click)="submit()">Submit</button>
</div>
</mat-card>
<!-- <ng-container *ngIf="!isEga()">
......
......@@ -36,6 +36,7 @@ export class SubmitComponent {
dacFile: File;
policyFile: File;
datasetFile: File;
centerName: String;
constructor(
private _webinAuthenticationService: WebinAuthenticationService,
......@@ -114,7 +115,8 @@ export class SubmitComponent {
this.analysisFile,
this.dacFile,
this.policyFile,
this.datasetFile
this.datasetFile,
this.centerName
);
this.dialog.open(SubmissionResultDialogComponent, {
......@@ -122,4 +124,8 @@ export class SubmitComponent {
data: { "observable": observable, "redirectPath": "/app-submit" },
});
}
isBroker(): boolean {
return this._webinAuthenticationService.isBroker();
}
}
......@@ -65,7 +65,8 @@ export class TaxonomyManagementComponent implements OnInit {
private _webinRestService: WebinRestService,
private _webinAuthService: WebinAuthenticationService,
public dialog: MatDialog,
private util: UtilService
private util: UtilService,
private _webinAuthenticationService: WebinAuthenticationService
) { }
ngOnInit() { }
......@@ -421,4 +422,8 @@ export class TaxonomyManagementComponent implements OnInit {
},
],
};
isBroker(): boolean {
return this._webinAuthenticationService.isBroker();
}
}
......@@ -84,11 +84,11 @@ export class UtilService {
}
downloadExcelTemplate(checklistJson) {
return this.httpClient.post(environment.webinXmlReportServiceUrl + '/tab/spreadsheet', checklistJson, { responseType: 'arraybuffer' });
return this.httpClient.post(environment.webinRestUrl + '/tab/spreadsheet', checklistJson, { responseType: 'arraybuffer' });
}
downloadTsvTemplate(checklistJson) {
return this.httpClient.post(environment.webinXmlReportServiceUrl + '/tab/tsv', checklistJson, { responseType: 'arraybuffer' });
return this.httpClient.post(environment.webinRestUrl + '/tab/tsv', checklistJson, { responseType: 'arraybuffer' });
}
getFileName(checklist, extension) {
......
......@@ -43,7 +43,7 @@ export class XmlService {
'</PROJECT_SET>'])
var action = { name: "add" };
let dateStr = this.getFormatedReleseDate(new Date(form.releaseDate));
const observable: Observable<string> = this._webinRestService.updateXml(ReportType.projects, projectXml, 'Add', dateStr)
const observable: Observable<string> = this._webinRestService.updateXml(ReportType.projects, projectXml, 'Add', dateStr, form)
return observable;
}
......@@ -61,7 +61,7 @@ export class XmlService {
'</DAC_SET>'])
var action = { name: "add" };
//let dateStr = this.getFormatedReleseDate(new Date(form.releaseDate));
const observable: Observable<string> = this._webinRestService.updateXml(ReportType.dacs, dacXml, 'Add')
const observable: Observable<string> = this._webinRestService.updateXml(ReportType.dacs, dacXml, 'Add', form)
return observable;
}
......@@ -213,7 +213,7 @@ export class XmlService {
let dateStr = this.getFormatedReleseDate(new Date(form.releaseDate))
var action = { name: "Edit", id: form.id };
const observable: Observable<string> = this._webinRestService.updateXml(ReportType.projects, new Blob([xmlDocStr]), action, dateStr)
const observable: Observable<string> = this._webinRestService.updateXml(ReportType.projects, new Blob([xmlDocStr]), action, dateStr, form)
//this.handleServerResponse(observable);
return observable;
}
......
......@@ -27,10 +27,10 @@ export class WebinAuthenticationInterceptor implements HttpInterceptor {
console.log(req.url);
if (!req.url.startsWith(environment.webinAuthenticationServiceUrl) &&
if (!req.url.startsWith(environment.webinAuthUrl + "/login") &&
!req.url.startsWith(environment.webinReportServiceUrl + "/checklist-groups") &&
!req.url.startsWith(environment.webinReportServiceUrl + "/checklists") &&
!req.url.startsWith(environment.webinAuthenticationTokenUrl) &&
!req.url.startsWith(environment.webinAuthUrl + "/token") &&
!(req.url.startsWith(environment.webinAdminServiceUrl + "/submission-account") && req.method === "POST") &&
!req.url.startsWith(environment.webinAdminServiceUrl + "/country") &&
!req.url.startsWith(environment.pupMedUrl) &&
......
......@@ -108,7 +108,7 @@ export class WebinAuthenticationService implements WebinAuthenticationServiceInt
}
login(username: string, password: string): Observable<WebinAuthenticationResultInterface> {
const baseUrl: string = environment.webinAuthenticationServiceUrl;
const baseUrl: string = environment.webinAuthUrl + "/login";
// console.log('Webin authentication login', baseUrl);
this.username = username;
......@@ -125,7 +125,7 @@ export class WebinAuthenticationService implements WebinAuthenticationServiceInt
}
loginToken(username: string, password: string): Observable<string> {
const baseUrl: string = environment.webinAuthenticationTokenUrl;
const baseUrl: string = environment.webinAuthUrl + "/token";
// console.log('Webin authentication token', baseUrl);
this.username = username;
......@@ -153,4 +153,11 @@ export class WebinAuthenticationService implements WebinAuthenticationServiceInt
sessionStorage.setItem('submissionAccount', JSON.stringify(data));
});
}
isBroker(): boolean {
var submissionAccount = JSON.parse(
sessionStorage.getItem('submissionAccount')
);
return submissionAccount["brokerName"] != "";
}
}
......@@ -24,7 +24,7 @@ import { WebinAuthenticationService } from './webin-authentication.service';
@Injectable()
export class WebinRestService implements WebinRestServiceInterface {
private _baseUrl = environment.webinServiceUrl;
private _baseUrl = environment.webinRestUrl + "/submit/";
private _xmlParser = new DOMParser();
......@@ -45,18 +45,18 @@ export class WebinRestService implements WebinRestServiceInterface {
}
}
private post(formData: FormData): Observable<string> {
private post(formData: FormData, parameters?): Observable<string> {
const headers = this.headers();
return this._http.post(this._baseUrl, formData, { headers, responseType: 'text' });
return this._http.post(this._baseUrl + "?" + parameters, formData, { headers, responseType: 'text' });
}
private postTaxon(formData: FormData): Observable<string> {
const headers = this.headers();
return this._http.post(environment.webinXmlReportServiceUrl + "/portal/register/taxonomy", formData, { headers, responseType: 'text' });
return this._http.post(environment.webinRestUrl + "/portal/register/taxonomy", formData, { headers, responseType: 'text' });
}
private postEmail(mail) {
return this._http.post(environment.webinXmlReportServiceUrl + '/email', mail);
return this._http.post(environment.webinRestUrl + '/email', mail);
}
submitProjectXml(formData) {
......@@ -74,7 +74,8 @@ export class WebinRestService implements WebinRestServiceInterface {
reportType: ReportType,
xml: Blob,
action: Object,
releaseDate?: any): Observable<string> {
releaseDate?: any,
form?): Observable<string> {
console.log('** Update XML **');
const formData: FormData = new FormData();
var mode = action["name"];
......@@ -148,8 +149,12 @@ export class WebinRestService implements WebinRestServiceInterface {
}
}
let postParam = "";
if (form) {
postParam = this.getCenterNamePostParam(form.centerName);
}
console.log('** webin submission form data **', formData);
return this.post(formData);
return this.post(formData, postParam);
}
......@@ -164,7 +169,8 @@ export class WebinRestService implements WebinRestServiceInterface {
analysisXml: Blob,
dacXml: Blob,
policyXml: Blob,
datasetXml: Blob): Observable<string> {
datasetXml: Blob,
centerName?): Observable<string> {
console.log('** Submit XML **');
const formData: FormData = new FormData();
......@@ -178,7 +184,19 @@ export class WebinRestService implements WebinRestServiceInterface {
this.appendXml(formData, 'DAC', dacXml);
this.appendXml(formData, 'POLICY', policyXml);
this.appendXml(formData, 'DATASET', datasetXml);
return this.post(formData);
let postParam = "";
if (centerName) {
postParam = this.getCenterNamePostParam(centerName);
}
return this.post(formData, postParam);
}
getCenterNamePostParam(centerName) {
if (centerName) {
return "CENTER_NAME=" + centerName;
}
}
parseResult(data: string) {
......
......@@ -18,7 +18,7 @@ import { WebinXmlReportServiceInterface } from './webin-xml-report.service.inter
@Injectable()
export class WebinXmlReportService implements WebinXmlReportServiceInterface {
private _baseUrl = environment.webinXmlReportServiceUrl;
private _baseUrl = environment.webinRestUrl;
constructor(private http: HttpClient) { }
......
......@@ -5,16 +5,12 @@
export const environment = {
production: false,
envName: 'dev',
title: 'Webin submissions portal (DEV)',
webinServiceUrl: 'https://wwwdev.ebi.ac.uk/ena/dev/submit/drop-box/submit',
webinUpdateRequestUrl: 'https://wwwdev.ebi.ac.uk/ena/dev/submit/drop-box/email/update-request/',
webinAuthenticationServiceUrl: 'https://wwwdev.ebi.ac.uk/ena/dev/submit/webin/auth/login',
webinAuthenticationTokenUrl: 'https://wwwdev.ebi.ac.uk/ena/dev/submit/webin/auth/token',
webinRestUrl: 'http://ves-ebi-5b:8110/ena/submit/drop-box',
webinAuthUrl: 'https://wwwdev.ebi.ac.uk/ena/dev/submit/webin/auth',
webinReportServiceUrl: 'https://wwwdev.ebi.ac.uk/ena/dev/submit/report',
webinXmlReportServiceUrl: 'https://wwwdev.ebi.ac.uk/ena/dev/submit/drop-box',
webinAdminServiceUrl: 'https://wwwdev.ebi.ac.uk/ena/dev/submit/webin/auth/admin',
webinGdprServiceUrl: 'TODO',
pupMedUrl: 'https://www.ebi.ac.uk/europepmc/webservices/rest/search',
taxonomySubmissionEmail: 'ena-collaborations@ebi.ac.uk'
};
taxonomySubmissionEmail: 'ena-collaborations@ebi.ac.uk',
};
\ No newline at end of file
export const environment = {
production: true,
envName: 'prod',
title: 'Webin submissions portal',
webinServiceUrl: 'https://www.ebi.ac.uk/ena/submit/drop-box/submit/',
webinUpdateRequestUrl: 'https://www.ebi.ac.uk/ena/submit/drop-box/email/update-request/',
webinAuthenticationServiceUrl: 'https://www.ebi.ac.uk/ena/submit/webin/auth/login',
webinAuthenticationTokenUrl: 'https://www.ebi.ac.uk/ena/submit/webin/auth/token',
production: false,
title: 'Webin submissions portal (TEST)',
webinRestUrl: 'https://www.ebi.ac.uk/ena/submit/drop-box',
webinAuthUrl: 'https://www.ebi.ac.uk/ena/submit/webin/auth',
webinReportServiceUrl: 'https://www.ebi.ac.uk/ena/submit/report',
webinXmlReportServiceUrl: 'https://www.ebi.ac.uk/ena/submit/drop-box',
webinAdminServiceUrl: 'https://www.ebi.ac.uk/ena/submit/webin/auth/admin',
webinGdprServiceUrl: 'TODO',
pupMedUrl: 'https://www.ebi.ac.uk/europepmc/webservices/rest/search',
taxonomySubmissionEmail: 'ena-collaborations@ebi.ac.uk'
};
taxonomySubmissionEmail: 'ena-collaborations@ebi.ac.uk',
};
\ No newline at end of file
......@@ -5,16 +5,12 @@
export const environment = {
production: false,
envName: 'test',
title: 'Webin submissions portal (TEST)',
webinServiceUrl: 'https://wwwdev.ebi.ac.uk/ena/submit/drop-box/submit/',
webinUpdateRequestUrl: 'https://wwwdev.ebi.ac.uk/ena/submit/drop-box/email/update-request/',
webinAuthenticationServiceUrl: 'https://wwwdev.ebi.ac.uk/ena/submit/webin/auth/login',
webinAuthenticationTokenUrl: 'https://wwwdev.ebi.ac.uk/ena/submit/webin/auth/token',
webinRestUrl: 'https://wwwdev.ebi.ac.uk/ena/submit/drop-box',
webinAuthUrl: 'https://wwwdev.ebi.ac.uk/ena/submit/webin/auth',
webinReportServiceUrl: 'https://wwwdev.ebi.ac.uk/ena/submit/report',
webinXmlReportServiceUrl: 'https://wwwdev.ebi.ac.uk/ena/submit/drop-box',
webinGdprServiceUrl: 'TODO',
webinAdminServiceUrl: 'https://wwwdev.ebi.ac.uk/ena/submit/webin/auth/admin',
webinGdprServiceUrl: 'TODO',
pupMedUrl: 'https://www.ebi.ac.uk/europepmc/webservices/rest/search',
taxonomySubmissionEmail: 'ena-collaborations@ebi.ac.uk'
};
taxonomySubmissionEmail: 'ena-collaborations@ebi.ac.uk',
};
\ No newline at end of file
......@@ -6,15 +6,12 @@
export const environment = {
production: false,
title: 'Webin submissions portal (DEV)',
webinServiceUrl: 'http://ves-ebi-5b:8110/ena/submit/drop-box/submit/',
webinUpdateRequestUrl: 'http://ves-ebi-5b:8110/ena/submit/drop-box/email/update-request/',
webinAuthenticationServiceUrl: 'https://wwwdev.ebi.ac.uk/ena/dev/submit/webin/auth/login',
webinAuthenticationTokenUrl: 'https://wwwdev.ebi.ac.uk/ena/dev/submit/webin/auth/token',
webinReportServiceUrl: 'http://ves-ebi-5b:8221/ena/submit/report',
webinXmlReportServiceUrl: 'http://ves-ebi-5b:8110/ena/submit/drop-box',
webinRestUrl: 'http://ves-ebi-5b:8110/ena/submit/drop-box',
webinAuthUrl: 'https://wwwdev.ebi.ac.uk/ena/dev/submit/webin/auth',
webinReportServiceUrl: 'https://wwwdev.ebi.ac.uk/ena/dev/submit/report',
webinAdminServiceUrl: 'https://wwwdev.ebi.ac.uk/ena/dev/submit/webin/auth/admin',
webinGdprServiceUrl: 'TODO',
pupMedUrl: 'https://www.ebi.ac.uk/europepmc/webservices/rest/search',
taxonomySubmissionEmail: 'ena-collaborations@ebi.ac.uk'
taxonomySubmissionEmail: 'ena-collaborations@ebi.ac.uk',
};
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