// Custom scrollbar styling for better Carbon integration
&::-webkit-scrollbar {
- width: 8px;
+ width: var(--cds-spacing-03);
}
&::-webkit-scrollbar-track {
i18n>Cluster Status</span>
<ng-container *ngIf="healthData.health?.status !== 'HEALTH_OK'; else healthOk">
<a class="cds--link cds--type-body-compact-01"
- routerLink="/dashboard"
+ routerLink="/overview"
[ngStyle]="healthData.health.status | healthColor">
{{ healthData.health.status | healthLabel | titlecase }}
<i class="fa fa-exclamation-triangle"></i>
it('should load the view once check for upgrade is done', () => {
component.ngOnInit();
fixture.detectChanges();
- const upgradeSection = fixture.debugElement.nativeElement.querySelector(
- '#newVersionAvailable'
- );
+ const upgradeSection = fixture.debugElement.nativeElement.querySelector('#newVersionAvailable');
expect(upgradeSection).not.toBeNull();
});
import { CardGroupComponent } from './card-group/card-group.component';
import { HelpTextComponent } from './help-text/help-text.component';
import { FormAdvancedFieldsetComponent } from './form-advanced-fieldset/form-advanced-fieldset.component';
-import { UpgradableComponent } from './upgradable/upgradable.component';
import { ProgressComponent } from './progress/progress.component';
import { SidePanelComponent } from './side-panel/side-panel.component';
import { ChartsModule } from '@carbon/charts-angular';
CardGroupComponent,
HelpTextComponent,
FormAdvancedFieldsetComponent,
- UpgradableComponent,
ProgressComponent,
SidePanelComponent,
IconComponent,
CardGroupComponent,
HelpTextComponent,
FormAdvancedFieldsetComponent,
- UpgradableComponent,
ProgressComponent,
SidePanelComponent,
IconComponent,
+++ /dev/null
-<div *ngIf="upgradeStatus$ | async as status; else isUpgradable">
- <ng-container *ngIf="status.is_paused || status.in_progress; else isUpgradable">
- <h5 *ngIf="status.is_paused; else inProgress"
- i18n>
- Upgrade is paused
- </h5>
- <ng-template #inProgress>
- <a href="#/upgrade/progress"
- i18n>
- <i [ngClass]="[icons.spin, icons.spinner]"></i>
- Upgrading {{executingTask?.progress}}%
- </a>
- </ng-template>
- </ng-container>
-</div>
-
-<ng-template #isUpgradable>
- <div *ngIf="upgradeInfo$ | async as info"
- i18n>
- <h5 *ngIf="info.versions.length > 0"
- (click)="upgradeModal()">
- <i [ngClass]="icons.up"></i>
- Upgrade available
- </h5>
- </div>
-</ng-template>
+++ /dev/null
-import { ComponentFixture, TestBed } from '@angular/core/testing';
-
-import { UpgradableComponent } from './upgradable.component';
-import { HttpClientTestingModule } from '@angular/common/http/testing';
-
-describe('UpgradableComponent', () => {
- let component: UpgradableComponent;
- let fixture: ComponentFixture<UpgradableComponent>;
-
- beforeEach(async () => {
- await TestBed.configureTestingModule({
- declarations: [UpgradableComponent],
- imports: [HttpClientTestingModule]
- }).compileComponents();
-
- fixture = TestBed.createComponent(UpgradableComponent);
- component = fixture.componentInstance;
- fixture.detectChanges();
- });
-
- it('should create', () => {
- expect(component).toBeTruthy();
- });
-});
+++ /dev/null
-import { Component, OnDestroy, OnInit } from '@angular/core';
-import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
-import { Observable, Subscription } from 'rxjs';
-import { UpgradeService } from '../../api/upgrade.service';
-import { UpgradeInfoInterface, UpgradeStatusInterface } from '../../models/upgrade.interface';
-import { OrchestratorService } from '../../api/orchestrator.service';
-import { Icons } from '~/app/shared/enum/icons.enum';
-import { SummaryService } from '../../services/summary.service';
-import { ExecutingTask } from '../../models/executing-task';
-
-@Component({
- selector: 'cd-upgradable',
- templateUrl: './upgradable.component.html',
- styleUrls: ['./upgradable.component.scss'],
- standalone: false
-})
-export class UpgradableComponent implements OnInit, OnDestroy {
- orchAvailable: boolean = false;
- upgradeInfo$: Observable<UpgradeInfoInterface>;
- upgradeStatus$: Observable<UpgradeStatusInterface>;
- upgradeModalRef: NgbModalRef;
- executingTask: ExecutingTask;
- private subs = new Subscription();
-
- icons = Icons;
-
- constructor(
- private orchestratorService: OrchestratorService,
- private summaryService: SummaryService,
- private upgradeService: UpgradeService
- ) {}
-
- ngOnInit() {
- this.orchestratorService.status().subscribe((status: any) => {
- this.orchAvailable = status.available;
- if (this.orchAvailable && status.upgrade_status?.available) {
- this.upgradeInfo$ = this.upgradeService.listCached();
- this.upgradeStatus$ = this.upgradeService.status();
- }
- });
-
- this.subs.add(
- this.summaryService.subscribe((summary) => {
- this.executingTask = summary.executing_tasks.filter((tasks) =>
- tasks.name.includes('progress/Upgrade')
- )[0];
- })
- );
- }
-
- ngOnDestroy() {
- this.subs?.unsubscribe();
- }
-
- upgradeModal() {
- this.upgradeModalRef = this.upgradeService.startUpgradeModal();
- }
-}