Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FOGL-5832]: Changed alert text for https protocol and handled the case of 404 status code of ping request #110

Merged
merged 4 commits into from
Aug 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ export function pingServiceFactory(ping: PingService, sharedService: SharedServi
sharedService.isServiceUp.next(true);
})
.catch(error => {
// Set isService to true, if response status code is non zero and not undefined
if (error && error.status && error.status !== 0) {
// Set isService to true, if response status code is not undefined and not 0 & not 404
if (error && error.status && !(error.status === 0 || error.status === 404)) {
sharedService.isServiceUp.next(true);
} else {
sharedService.isServiceUp.next(false);
Expand Down
5 changes: 2 additions & 3 deletions src/app/components/core/settings/settings.component.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<div class="container is-fluid">
<article class="message is-warning alert-box">
<div *ngIf="showAlertMessage && !canPing()" class="message-body">
You are trying to connect an instance secured with HTTPS, you must provide your own valid TLS certificate for
production operation. A self-signed certificate is included within Fledge, and you will need to configure your
browser to
You are trying to connect over HTTPS. To secure an instance, you must provide your own valid TLS certificate for production operations.
A self-signed certificate is included within Fledge, and you will need to configure your browser to
accept it as valid. To do this, click this <a (click)="openSSLCertWarningPage()"
class="alert-link"><u><b>link</b></u></a> and in that page accept
the certificate.
Expand Down
1 change: 0 additions & 1 deletion src/app/components/layout/login/login.component.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.grey-link {
color: grey;
text-decoration: underline;
font-size: smaller;
}
2 changes: 1 addition & 1 deletion src/app/components/layout/navbar/navbar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ export class NavbarComponent implements OnInit, AfterViewInit, OnDestroy {
}
// If response code is non zero and not undefined, set isAlive and isAuth to true,
// else set service to down and pingInfo accordingly
if (error && error.status && error.status !== 0) {
if (error && error.status && !(error.status === 0 || error.status === 404)) {
this.pingInfo.isAlive = true;
this.pingInfo.isAuth = true;
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/app/services/ping.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class PingService {
return Promise.resolve(res);
})
.catch(err => {
if (err.status === 0) {
if (err.status === 0 || err.status === 404) {
this.pingResponse.next(false);
} else {
this.pingResponse.next(true);
Expand Down