Commit c939cf9d authored by Rajkumar-D's avatar Rajkumar-D
Browse files

Changes to display server messages

parent b458db67
Pipeline #278426 passed with stages
in 5 minutes
......@@ -22,4 +22,12 @@ input[type="password"]{
input[type="password"]:focus{
border: none;
box-shadow: none;
}
.message{
color: red;
border: solid 1px;
border-radius: 10px;
padding: 10px;
background-color: #ffcb8e26;
}
\ No newline at end of file
......@@ -11,6 +11,7 @@
<p>A dedicated submission API for COVID-19 genomes is available <a
href="https://www.ebi.ac.uk/ena/submit/webin-cli">here.</a> </p>
<div *ngIf="serverMessage" class="message"> {{serverMessage}}</div>
</mat-card-subtitle>
</div>
</mat-card>
......
......@@ -32,6 +32,7 @@ export class LoginComponent implements OnInit {
username: string;
password: string;
error = false;
serverMessage: string;
constructor(
private _router: Router,
......@@ -47,7 +48,7 @@ export class LoginComponent implements OnInit {
//this._router.navigateByUrl('');
}
this.getTweet();
this.getServerMessage();
}
login() {
......@@ -102,12 +103,11 @@ export class LoginComponent implements OnInit {
});
}
getTweet() {
getServerMessage() {
this.util.getServerMessage().subscribe((versionData: any) => {
this.serverMessage = versionData;
});
/* this.util.getTweet().subscribe((data:any) => {
console.log(data);
},(error) => {
console.log(error);
}); */
}
}
......@@ -146,15 +146,11 @@ export class UtilService {
return { "isError": isError, "title": title, "message": message, "redirectPath": redirectPath }
}
getTweet() {
/* var url="https://api.twitter.com/1.1/search/tweets.json?q=enasequence&result_type=popular";
var twitterToken="AAAAAAAAAAAAAAAAAAAAACHPOQAAAAAAK%2FQU%2BR0MB%2BcMXOiWrljWlX3%2BZ%2BU%3DFV9fOpABfT8s69ntGFAUNPwEf6fgcvNk3svOBfYXlKRsuEvUWd";
var headers = new Headers();
headers.append('Authorization', 'Bearer '+twitterToken);
return this.httpClient.jsonp(url,'callback');*/
getServerMessage() {
var url = environment.webinRestUrl + "/cli/comment";
return this.httpClient.get(url, {
responseType: 'text'
})
}
......
......@@ -21,8 +21,6 @@ export class WebinAuthenticationInterceptor implements HttpInterceptor {
constructor(private injector: Injector) { }
//twitterToken="AAAAAAAAAAAAAAAAAAAAACHPOQAAAAAAK%2FQU%2BR0MB%2BcMXOiWrljWlX3%2BZ%2BU%3DFV9fOpABfT8s69ntGFAUNPwEf6fgcvNk3svOBfYXlKRsuEvUWd"
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
console.log(req.url);
......@@ -40,10 +38,6 @@ export class WebinAuthenticationInterceptor implements HttpInterceptor {
//console.log(webinAuthenticationService.getAuthorizationTokenHeader())
const authReq = req.clone({ headers: req.headers.set('Authorization', webinAuthenticationService.getAuthorizationTokenHeader()) });
return next.handle(authReq);
} else if (req.url.startsWith("https://api.twitter.com/1.1")) {
//const tweetReq = req.clone({headers: req.headers.set('Authorization', this.twitterToken)});
//return next.handle(tweetReq);
} else {
return next.handle(req);
}
......
......@@ -6,7 +6,7 @@
export const environment = {
production: false,
title: 'Webin Submissions Portal (DEV)',
webinRestUrl: 'http://ves-ebi-5b:8110/ena/submit/drop-box',
webinRestUrl: 'https://wwwdev.ebi.ac.uk/ena/dev/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',
......
......@@ -6,7 +6,7 @@
export const environment = {
production: false,
title: 'Webin Submissions Portal (DEV)',
webinRestUrl: 'http://ves-ebi-5b:8110/ena/submit/drop-box',
webinRestUrl: 'https://wwwdev.ebi.ac.uk/ena/dev/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',
......
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