Skip to content

Commit

Permalink
Pull request #172: Development
Browse files Browse the repository at this point in the history
Merge in ITB/gitb from development to master

* commit 'ed4b4c8ce5e0982ca0d823b17fb93daa6b3db038':
  Update for release 1.24.1
  [ITB-1700] Display specific logout pending indicator when logout is pending
  Preparation for next development cycle
  • Loading branch information
costas80 committed Oct 18, 2024
2 parents 3970b56 + ed4b4c8 commit 7cf5ccb
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 43 deletions.
2 changes: 1 addition & 1 deletion gitb-ui/app/models/Constants.scala
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,6 @@ object Constants {

// When ending in "-snapshot", this is considered a non-published release.
val VersionNumber = "1.24.1"
val VersionNumberPostfixForResources = ""
val VersionNumberPostfixForResources = ".1"

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@if (dataService.showNavigationControls) {
<div class="breacrumbContainer">
<div class="breacrumbContainer" [class.disable-events]="logoutInProgress">
@if (breadcrumbs != undefined) {
@for (crumb of breadcrumbsToShow; track $index) {
@if (crumb.label != undefined) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@if (pending) {
<span [ngClass]="{'mini-tab': !icon}"><i class="fa-solid fa-spinner fa-spin-override fa-lg"></i></span>
<span [class.mini-tab]="!icon" [class.large]="large"><i class="fa-solid fa-spinner fa-spin-override fa-lg"></i></span>
@if (!pending || !icon) {
<ng-content></ng-content>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ import { Component, Input } from '@angular/core';

@Component({
selector: 'app-pending-block',
templateUrl: './pending-block.component.html'
templateUrl: './pending-block.component.html',
styles: '.large { font-size: xx-large; }'
})
export class PendingBlockComponent {

@Input() pending = true
@Input() icon = false
@Input() large = false

constructor() { }

Expand Down
2 changes: 1 addition & 1 deletion gitb-ui/ui/src/app/pages/home/home.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="row">
<div class="col-12">
@if (pageContent == undefined) {
<div class="container"><span class="tab" style="font-size: xx-large;"><i class="fa-solid fa-spinner fa-spin-override fa-lg"></i></span></div>
<div class="container"><app-pending-block [icon]="true" [large]="true"></app-pending-block></div>
} @else {
<div id="content" [innerHtml]="pageContent | sanitizeHtml"></div>
}
Expand Down
31 changes: 17 additions & 14 deletions gitb-ui/ui/src/app/pages/index/index.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,15 @@
</div>
</section>
@if (dataService.showNavigationControls) {
<app-breadcrumb></app-breadcrumb>
<app-breadcrumb [logoutInProgress]="logoutInProgress"></app-breadcrumb>
}
<div class="page-root">
@if (logoutInProgress) {
<div class="logout-notification">
<app-pending-block [pending]="true"></app-pending-block>
<div class="logout-message">Logout in progress</div>
</div>
}
<div class="page-root" [class.disable-events]="logoutInProgress">
@if (dataService.showNavigationControls) {
<div class="page-menu">
<app-menu-item (click)="routingService.toHome()" [type]="MenuItem.home" label="Home" icon="fa-solid fa-house" [expanded]="menuExpanded"></app-menu-item>
Expand All @@ -51,7 +57,14 @@
</div>
}
<div class="page-content" appFileDropTarget>
<router-outlet></router-outlet>
@if (!dataService.showNavigationControls && isAuthenticated() && !logoutInProgress) {
<div class="container">
<div class="initial-load-indicator">
<app-pending-block [icon]="true" [large]="true"></app-pending-block>
</div>
</div>
}
<router-outlet></router-outlet>
</div>
</div>
</div>
Expand Down Expand Up @@ -92,14 +105,4 @@
</div>
</div>
</div>
</div>
<ng-template #logoutTemplate>
<div class="modal-body">
<div class="logout-notification">
<app-pending-block [pending]="true"></app-pending-block>
<div class="logout-message">
Please wait while you are being logged out
</div>
</div>
</div>
</ng-template>
</div>
16 changes: 16 additions & 0 deletions gitb-ui/ui/src/app/pages/index/index.component.less
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,24 @@
}

.logout-notification {
border: 1px solid @gray-dark-1;
border-radius: @border-radius;
box-shadow: 5px 6px 5px -3px @gray;
opacity: 1;
background-color: @gray-light-1;
display: flex;
justify-content: center;
align-items: center;
padding: 10px 0px;
position: absolute;
left: 50%;
top: 128px;
transform: translate(-50%);
z-index: 1;
min-width: 300px;
max-width: 800%;
}

.initial-load-indicator {
margin: 30px 0px;
}
17 changes: 0 additions & 17 deletions gitb-ui/ui/src/app/pages/index/index.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,29 +52,12 @@ export class IndexComponent implements OnInit, OnDestroy {
this.version = this.dataService.configuration.versionNumber
this.logoutSubscription = this.authProviderService.onLogout$.subscribe(() => {
this.logoutInProgress = true
this.showLogoutNotification()
})
this.logoutCompleteSubscription = this.authProviderService.onLogoutComplete$.subscribe(() => {
this.logoutInProgress = false
})
}

showLogoutNotification() {
if (this.logoutTemplate) {
this.modalService.show(this.logoutTemplate, {
backdrop: 'static',
keyboard: false
})
}
}

closeLogoutNotification() {
if (this.logoutModal) {
this.logoutModal.hide()
}
}


ngOnDestroy(): void {
if (this.logoutSubscription) this.logoutSubscription.unsubscribe()
if (this.bannerSubscription) this.bannerSubscription.unsubscribe()
Expand Down
8 changes: 1 addition & 7 deletions gitb-ui/ui/src/app/pages/login/login.component.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
<div class="page-with-margins">
@if (loginInProgress) {
<div>
<div class="container">
<span class="tab" style="font-size: xx-large;"><i class="fa-solid fa-spinner fa-spin-override fa-lg"></i></span>
</div>
</div>
} @else if (dataService.configuration) {
@if (!loginInProgress && dataService.configuration) {
<div>
@if (dataService.configuration.ssoEnabled && dataService.actualUser != undefined) {
<div>
Expand Down

0 comments on commit 7cf5ccb

Please sign in to comment.