Skip to content

Commit

Permalink
merge validation to main
Browse files Browse the repository at this point in the history
  • Loading branch information
b4pm-devops committed Dec 19, 2024
2 parents 357dd0c + 1ebb25c commit 5ad0169
Show file tree
Hide file tree
Showing 11 changed files with 336 additions and 246 deletions.
2 changes: 1 addition & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
{
"type": "initial",
"maximumWarning": "6mb",
"maximumError": "11mb"
"maximumError": "12mb"
},
{
"type": "anyComponentStyle",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"ngx-markdown": "^15.1.2",
"ngx-mat-select-search": "7.0.5",
"ngx-papaparse": "8.0.0",
"plotly.js-dist-min": "2.32.0",
"plotly.js-dist-min": "2.35.2",
"rxjs": "7.8.1",
"socket.io-client": "4.7.2",
"tslib": "2.6.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
</mat-expansion-panel>

<mat-expansion-panel
id="numerical-parameters-panel"
class="expansion-panel"
[expanded]="IsExpand('numerical')"
(opened)="SetIsExpand('numerical', true)"
Expand Down Expand Up @@ -90,6 +91,7 @@
</mat-expansion-panel>

<mat-expansion-panel
id="input-parameters-panel"
class="expansion-panel"
[expanded]="IsExpand('inputs')"
(opened)="SetIsExpand('inputs', true)"
Expand Down Expand Up @@ -135,6 +137,7 @@
</mat-expansion-panel>

<mat-expansion-panel
id="output-parameters-panel"
class="expansion-panel"
[expanded]="IsExpand('outputs')"
(opened)="SetIsExpand('outputs', true)"
Expand Down
2 changes: 1 addition & 1 deletion src/app/modules/header/header.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ export class HeaderComponent implements OnInit, OnDestroy {
if (error.statusCode == 502 || error.statusCode == 0) {
this.snackbarService.showError('No response from server');
} else {
this.snackbarService.showError('Error at logout : ' + error.statusText);
this.snackbarService.showError('Error Keycloak logout : ' + error.description);
}
}
});
Expand Down
64 changes: 34 additions & 30 deletions src/app/modules/login/login.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export class LoginComponent implements OnInit {

this.route.queryParams.subscribe({
next: (params) => {
if (params.hasOwnProperty('autologon')) {
if (Object.keys(params).includes('autologon')) {
this.autoLogon = true;
}
this.loggerService.log(`autologon : ${this.autoLogon}`);
Expand All @@ -89,32 +89,7 @@ export class LoginComponent implements OnInit {
next: (keycloakAvailable) => {

if (!keycloakAvailable) {

this.showLogin = true;
this.samlService.getSSOUrl().subscribe(ssoUrl => {
this.ssoUrl = ssoUrl;

if (this.autoLogon === true && this.ssoUrl !== '') {
document.location.href = this.ssoUrl;
} else {

this.githubOauthService.getGithubOAuthAvailable().subscribe(response => {
this.showGitHubLogin = response;
if(!this.showGitHubLogin){
this.loginWithCredential = true;
this.isLocalPlatform = true;
}
this.showLogin = true;
}, error => {
this.showLogin = true;
});
this.showLogin = true;
}
},
error => {
this.ssoUrl = '';
this.showLogin = true;
});
this.checkGithubAvailable();
}
else{
// go to keycloak login page
Expand All @@ -129,7 +104,7 @@ export class LoginComponent implements OnInit {
if (error.statusCode == 502) {
this.router.navigate([Routing.NO_SERVER]);
} else {
this.snackbarService.showError('Error at Keycloak login : ' + error.name);
this.snackbarService.showError('Error during Keycloak redirection login : ' + error.description);
}
this.loadingLogin = false;
}
Expand All @@ -139,10 +114,11 @@ export class LoginComponent implements OnInit {


}, error: (errorReceived) => {
if (errorReceived.status == 502) {
if (errorReceived.statusCode == 502) {
this.router.navigate([Routing.NO_SERVER]);
} else {
this.snackbarService.showError('Error getting application info : ' + errorReceived.statusText);
this.snackbarService.showError('Error login with keycloak: ' + errorReceived.description);
this.router.navigate([Routing.NO_SERVER]);
}

}
Expand All @@ -158,6 +134,34 @@ export class LoginComponent implements OnInit {
});
}

checkGithubAvailable() {
this.showLogin = true;
this.samlService.getSSOUrl().subscribe(ssoUrl => {
this.ssoUrl = ssoUrl;

if (this.autoLogon === true && this.ssoUrl !== '') {
document.location.href = this.ssoUrl;
} else {

this.githubOauthService.getGithubOAuthAvailable().subscribe(response => {
this.showGitHubLogin = response;
if(!this.showGitHubLogin){
this.loginWithCredential = true;
this.isLocalPlatform = true;
}
this.showLogin = true;
}, () => {
this.showLogin = true;
});
this.showLogin = true;
}
},
() => {
this.ssoUrl = '';
this.showLogin = true;
});
}

displayLoginWithCredential() {
if (this.showGitHubLogin) {
if (this.loginWithCredential) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ <h1 class="bookmarks-title">Bookmarks</h1>
id="refresh"
mat-raised-button
style="text-align: right;"
matTooltip="Reload markdown from file"
(click)="refresh(documentItem)">
matTooltip="Reload markdown from file system"
(click)="refresh()">
<i class="fa-solid fa-rotate fa-fw cursor-pointer"></i>
</span>
<span
Expand Down Expand Up @@ -69,7 +69,16 @@ <h1 id="{{documentItem.name}}" style="text-align: center;">
<div style="padding: 5px">
<div class="missing-documentation">
<div style="font-size: 12px; line-height: unset">
This discipline has no documentation provided yet
<span>This discipline has no documentation provided from ontology yet.</span>
<br>
<span
class="cursor-pointer"
mat-raised-button
matTooltip="Reload markdown from file system"
(click)="refresh()">
You can reload this markdown from file system if existing
<i class="fa-solid fa-rotate fa-fw "></i>
</span>
</div>
</div>
</div>
Expand Down
Loading

0 comments on commit 5ad0169

Please sign in to comment.