]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Use ng-bootstrap for Tooltip 35311/head
authorTiago Melo <tmelo@suse.com>
Fri, 29 May 2020 09:55:29 +0000 (09:55 +0000)
committerTiago Melo <tmelo@suse.com>
Fri, 5 Jun 2020 08:58:29 +0000 (08:58 +0000)
Fixes: https://tracker.ceph.com/issues/45754
Signed-off-by: Tiago Melo <tmelo@suse.com>
29 files changed:
src/pybind/mgr/dashboard/frontend/src/app/app.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/block.module.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/mirroring.module.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-configuration-form/rbd-configuration-form.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-details/rbd-details.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-details/rbd-details.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-form/rbd-form.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/cluster.module.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-form/silence-form.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-form/silence-form.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form-client/nfs-form-client.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs.module.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool.module.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-form/rgw-user-form.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-form/rgw-user-form.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw.module.ts
src/pybind/mgr/dashboard/frontend/src/app/core/layouts/workbench-layout/workbench-layout.component.ts
src/pybind/mgr/dashboard/frontend/src/app/core/navigation/navigation.module.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/components/components.module.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/components/select-badges/select-badges.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/components/select/select.component.html
src/pybind/mgr/dashboard/frontend/src/app/shared/components/select/select.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/components/usage-bar/usage-bar.component.html
src/pybind/mgr/dashboard/frontend/src/app/shared/components/usage-bar/usage-bar.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/styles.scss

index 20bbac20fba00faf0a491ba524fe5a52213559d8..5f483cc94561df3feddbc3f8dca0f79c6f888070 100644 (file)
@@ -1,6 +1,6 @@
 import { Component } from '@angular/core';
 
-import { NgbPopoverConfig } from '@ng-bootstrap/ng-bootstrap';
+import { NgbPopoverConfig, NgbTooltipConfig } from '@ng-bootstrap/ng-bootstrap';
 
 @Component({
   selector: 'cd-root',
@@ -8,9 +8,11 @@ import { NgbPopoverConfig } from '@ng-bootstrap/ng-bootstrap';
   styleUrls: ['./app.component.scss']
 })
 export class AppComponent {
-  constructor(config: NgbPopoverConfig) {
-    config.autoClose = 'outside';
-    config.container = 'body';
-    config.placement = 'bottom';
+  constructor(popoverConfig: NgbPopoverConfig, tooltipConfig: NgbTooltipConfig) {
+    popoverConfig.autoClose = 'outside';
+    popoverConfig.container = 'body';
+    popoverConfig.placement = 'bottom';
+
+    tooltipConfig.container = 'body';
   }
 }
index c568b0bcd1a60b487e8e06c7b870e40adc730ed8..f63bb3d53d63a29604111be0d3f0a6603585aa6c 100644 (file)
@@ -3,14 +3,13 @@ import { NgModule } from '@angular/core';
 import { FormsModule, ReactiveFormsModule } from '@angular/forms';
 import { RouterModule, Routes } from '@angular/router';
 
-import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap';
+import { NgbNavModule, NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap';
 import { TreeModule } from 'angular-tree-component';
 import { NgBootstrapFormValidationModule } from 'ng-bootstrap-form-validation';
 import { BsDatepickerModule } from 'ngx-bootstrap/datepicker';
 import { BsDropdownModule } from 'ngx-bootstrap/dropdown';
 import { ModalModule } from 'ngx-bootstrap/modal';
 import { ProgressbarModule } from 'ngx-bootstrap/progressbar';
-import { TooltipModule } from 'ngx-bootstrap/tooltip';
 
 import { ActionLabels, URLVerbs } from '../../shared/constants/app.constants';
 import { FeatureTogglesGuardService } from '../../shared/services/feature-toggles-guard.service';
@@ -64,7 +63,7 @@ import { RbdTrashRestoreModalComponent } from './rbd-trash-restore-modal/rbd-tra
     ProgressbarModule.forRoot(),
     BsDropdownModule.forRoot(),
     BsDatepickerModule.forRoot(),
-    TooltipModule.forRoot(),
+    NgbTooltipModule,
     ModalModule.forRoot(),
     SharedModule,
     RouterModule,
index f56595584795b6c14ae7ed5c99794512ebf814ec..ecbf6c41ada94a27b5664ea0f3987099fcc9b4ab 100644 (file)
@@ -8,7 +8,6 @@ import { NgBootstrapFormValidationModule } from 'ng-bootstrap-form-validation';
 import { BsDropdownModule } from 'ngx-bootstrap/dropdown';
 import { ModalModule } from 'ngx-bootstrap/modal';
 import { ProgressbarModule } from 'ngx-bootstrap/progressbar';
-import { TooltipModule } from 'ngx-bootstrap/tooltip';
 
 import { SharedModule } from '../../../shared/shared.module';
 
@@ -42,7 +41,6 @@ import { PoolListComponent } from './pool-list/pool-list.component';
     ProgressbarModule.forRoot(),
     BsDropdownModule.forRoot(),
     ModalModule.forRoot(),
-    TooltipModule.forRoot(),
     NgBootstrapFormValidationModule
   ],
   declarations: [
index ebffe8a5a8c94ce9273072ada64fc6ef35cec08f..e334098a9015c42ff4183152eed7210c0c58a943 100644 (file)
@@ -5,7 +5,6 @@ import { By } from '@angular/platform-browser';
 
 import { ComponentLoaderFactory } from 'ngx-bootstrap/component-loader';
 import { PositioningService } from 'ngx-bootstrap/positioning';
-import { TooltipConfig, TooltipModule } from 'ngx-bootstrap/tooltip';
 
 import { configureTestBed, FormHelper, i18nProviders } from '../../../../testing/unit-test-helper';
 import { DirectivesModule } from '../../../shared/directives/directives.module';
@@ -24,12 +23,11 @@ describe('RbdConfigurationFormComponent', () => {
   let fh: FormHelper;
 
   configureTestBed({
-    imports: [ReactiveFormsModule, TooltipModule, DirectivesModule, SharedModule],
+    imports: [ReactiveFormsModule, DirectivesModule, SharedModule],
     declarations: [RbdConfigurationFormComponent],
     providers: [
       ComponentLoaderFactory,
       PositioningService,
-      TooltipConfig,
       RbdConfigurationService,
       FormatterService,
       DimlessBinaryPerSecondPipe,
index 6189e97ebf2201c8eaa021b88e05327cda1e4aa3..731879031020fb574f5b4ba448411f48a3b9ac57 100644 (file)
@@ -62,7 +62,7 @@
               <td>
                 <span *ngIf="selection.features_name?.indexOf('fast-diff') === -1">
                   <span class="form-text text-muted"
-                        [tooltip]="usageNotAvailableTooltipTpl"
+                        [ngbTooltip]="usageNotAvailableTooltipTpl"
                         placement="right"
                         i18n>N/A</span>
                 </span>
@@ -77,7 +77,7 @@
               <td>
                 <span *ngIf="selection.features_name?.indexOf('fast-diff') === -1">
                   <span class="form-text text-muted"
-                        [tooltip]="usageNotAvailableTooltipTpl"
+                        [ngbTooltip]="usageNotAvailableTooltipTpl"
                         placement="right"
                         i18n>N/A</span>
                 </span>
              let-value="value">
   <ng-container *ngIf="+value; else global">
     <strong i18n
-            i18n-tooltip
-            tooltip="This setting overrides the global value">Image</strong>
+            i18n-ngbTooltip
+            ngbTooltip="This setting overrides the global value">Image</strong>
   </ng-container>
   <ng-template #global>
     <span i18n
-          i18n-tooltip
-          tooltip="This is the global value. No value for this option has been set for this image.">Global</span>
+          i18n-ngbTooltip
+          ngbTooltip="This is the global value. No value for this option has been set for this image.">Global</span>
   </ng-template>
 </ng-template>
index c555cb10254392f3565c79bc38c8578703055c52..409fe50d14e2d6e116df4aee2a7bdadd6bbc6e32 100644 (file)
@@ -1,8 +1,7 @@
 import { ComponentFixture, TestBed } from '@angular/core/testing';
 import { RouterTestingModule } from '@angular/router/testing';
 
-import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap';
-import { TooltipModule } from 'ngx-bootstrap/tooltip';
+import { NgbNavModule, NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap';
 
 import { configureTestBed } from '../../../../testing/unit-test-helper';
 import { SharedModule } from '../../../shared/shared.module';
@@ -16,7 +15,7 @@ describe('RbdDetailsComponent', () => {
 
   configureTestBed({
     declarations: [RbdDetailsComponent, RbdSnapshotListComponent, RbdConfigurationListComponent],
-    imports: [SharedModule, TooltipModule.forRoot(), RouterTestingModule, NgbNavModule]
+    imports: [SharedModule, NgbTooltipModule, RouterTestingModule, NgbNavModule]
   });
 
   beforeEach(() => {
index 31a984079a86d24385592707353ca9d13221e181..f0ba4ad48e4934c7d5b2e1c78633f0062f6c5b79 100644 (file)
@@ -3,7 +3,6 @@ import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testin
 import { ReactiveFormsModule } from '@angular/forms';
 import { ActivatedRoute, Router } from '@angular/router';
 import { RouterTestingModule } from '@angular/router/testing';
-import { TooltipModule } from 'ngx-bootstrap/tooltip';
 
 import { ToastrModule } from 'ngx-toastr';
 
@@ -35,8 +34,7 @@ describe('RbdFormComponent', () => {
       ReactiveFormsModule,
       RouterTestingModule,
       ToastrModule.forRoot(),
-      SharedModule,
-      TooltipModule
+      SharedModule
     ],
     declarations: [RbdFormComponent, RbdConfigurationFormComponent],
     providers: [
index 2a425a7b08cbf920221644b41650f728d1150f66..38b6061fad1fa6e6223fd76620287932f9475391 100644 (file)
@@ -3,10 +3,9 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
 import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
 import { RouterTestingModule } from '@angular/router/testing';
 
-import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap';
+import { NgbNavModule, NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap';
 import { BsDropdownModule } from 'ngx-bootstrap/dropdown';
 import { ModalModule } from 'ngx-bootstrap/modal';
-import { TooltipModule } from 'ngx-bootstrap/tooltip';
 import { ToastrModule } from 'ngx-toastr';
 import { BehaviorSubject, of } from 'rxjs';
 
@@ -47,7 +46,7 @@ describe('RbdListComponent', () => {
       BsDropdownModule.forRoot(),
       NgbNavModule,
       ModalModule.forRoot(),
-      TooltipModule.forRoot(),
+      NgbTooltipModule,
       ToastrModule.forRoot(),
       RouterTestingModule,
       HttpClientTestingModule
index ab71ef5bc666d95e62da39ab36a2c89763c62f3c..f597a57ace7eb8f7207875c8bb546f1da6df64f3 100644 (file)
@@ -3,14 +3,13 @@ import { NgModule } from '@angular/core';
 import { FormsModule, ReactiveFormsModule } from '@angular/forms';
 import { RouterModule } from '@angular/router';
 
-import { NgbNavModule, NgbTypeaheadModule } from '@ng-bootstrap/ng-bootstrap';
+import { NgbNavModule, NgbTooltipModule, NgbTypeaheadModule } from '@ng-bootstrap/ng-bootstrap';
 import { TreeModule } from 'angular-tree-component';
 import { NgBootstrapFormValidationModule } from 'ng-bootstrap-form-validation';
 import { BsDatepickerModule } from 'ngx-bootstrap/datepicker';
 import { BsDropdownModule } from 'ngx-bootstrap/dropdown';
 import { ModalModule } from 'ngx-bootstrap/modal';
 import { TimepickerModule } from 'ngx-bootstrap/timepicker';
-import { TooltipModule } from 'ngx-bootstrap/tooltip';
 
 import { OrchestratorDocModalComponent } from '../../shared/components/orchestrator-doc-modal/orchestrator-doc-modal.component';
 import { SharedModule } from '../../shared/shared.module';
@@ -76,7 +75,7 @@ import { TelemetryComponent } from './telemetry/telemetry.component';
     BsDropdownModule.forRoot(),
     BsDatepickerModule.forRoot(),
     ModalModule.forRoot(),
-    TooltipModule.forRoot(),
+    NgbTooltipModule,
     MgrModulesModule,
     NgbTypeaheadModule,
     TimepickerModule.forRoot(),
index cd491bf67f5c21d8d4280da2d1852feb32d0964a..60076414b62b0fadab5490c2b4d5f8816f3dec87 100644 (file)
@@ -5,7 +5,7 @@
     <ng-container *ngFor="let config of matcherConfig">
       <div class="input-group-prepend">
         <span class="input-group-text"
-              [tooltip]="config.tooltip">
+              [ngbTooltip]="config.tooltip">
           <i [ngClass]="[config.icon]"></i>
         </span>
       </div>
       <button type="button"
               class="btn btn-light"
               id="matcher-edit-{{index}}"
-              i18n-tooltip
-              tooltip="Edit"
+              i18n-ngbTooltip
+              ngbTooltip="Edit"
               (click)="showMatcherModal(index)">
         <i [ngClass]="[icons.edit]"></i>
       </button>
       <button type="button"
               class="btn btn-light"
               id="matcher-delete-{{index}}"
-              i18n-tooltip
-              tooltip="Delete"
+              i18n-ngbTooltip
+              ngbTooltip="Delete"
               (click)="deleteMatcher(index)">
         <i [ngClass]="[icons.trash]"></i>
       </button>
index c0446c0bac75b49fc63f39533d4cf049c4ef7106..b331140d655dcb550cee513b1171324a7b604210 100644 (file)
@@ -5,10 +5,10 @@ import { By } from '@angular/platform-browser';
 import { ActivatedRoute, Router, Routes } from '@angular/router';
 import { RouterTestingModule } from '@angular/router/testing';
 
+import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap';
 import * as _ from 'lodash';
 import { BsDatepickerDirective, BsDatepickerModule } from 'ngx-bootstrap/datepicker';
 import { BsModalService } from 'ngx-bootstrap/modal';
-import { TooltipModule } from 'ngx-bootstrap/tooltip';
 import { ToastrModule } from 'ngx-toastr';
 import { of, throwError } from 'rxjs';
 
@@ -62,7 +62,7 @@ describe('SilenceFormComponent', () => {
       BsDatepickerModule.forRoot(),
       SharedModule,
       ToastrModule.forRoot(),
-      TooltipModule.forRoot(),
+      NgbTooltipModule,
       ReactiveFormsModule
     ],
     providers: [
index 03fdc53c8d9a41fc783733b16ec6b10b3cbf45bf..f2cb26b18826054772ab9bb02bc857be5671de1c 100644 (file)
@@ -19,7 +19,7 @@
             {{ (index + 1) | ordinal }}
             <span class="float-right clickable"
                   (click)="removeClient(index)"
-                  tooltip="Remove">&times;</span>
+                  ngbTooltip="Remove">&times;</span>
           </div>
 
           <div class="card-body">
index 568e47280f17cc8eaf48d643f02833c0cc5a385b..e72b1cd39a77ef17be1e721ada2bb0dea581ff10 100644 (file)
@@ -3,7 +3,7 @@ import { NgModule } from '@angular/core';
 import { ReactiveFormsModule } from '@angular/forms';
 import { RouterModule } from '@angular/router';
 
-import { NgbNavModule, NgbTypeaheadModule } from '@ng-bootstrap/ng-bootstrap';
+import { NgbNavModule, NgbTooltipModule, NgbTypeaheadModule } from '@ng-bootstrap/ng-bootstrap';
 import { NgBootstrapFormValidationModule } from 'ng-bootstrap-form-validation';
 
 import { SharedModule } from '../../shared/shared.module';
@@ -21,7 +21,8 @@ import { NfsListComponent } from './nfs-list/nfs-list.component';
     NgbNavModule,
     CommonModule,
     NgbTypeaheadModule,
-    NgBootstrapFormValidationModule
+    NgBootstrapFormValidationModule,
+    NgbTooltipModule
   ],
   declarations: [
     NfsListComponent,
index 8e6fd0aa6b3059340f1e9427780f4e0e7d946503..b21e94f8e1a64b494e9d614144e40ca1146613a7 100644 (file)
                   <button class="btn btn-light"
                           type="button"
                           *ngIf="!editing"
-                          tooltip="This profile can't be deleted as it is in use."
-                          i18n-tooltip
-                          triggers=""
-                          #ecpDeletionBtn="bs-tooltip"
+                          ngbTooltip="This profile can't be deleted as it is in use."
+                          i18n-ngbTooltip
+                          triggers="manual"
+                          #ecpDeletionBtn="ngbTooltip"
                           (click)="deleteErasureCodeProfile()">
                     <i [ngClass]="[icons.trash]"
                        aria-hidden="true"></i>
                     <button class="btn btn-light"
                             *ngIf="isReplicated && !editing"
                             type="button"
-                            tooltip="This rule can't be deleted as it is in use."
-                            i18n-tooltip
-                            triggers=""
-                            #crushDeletionBtn="bs-tooltip"
+                            ngbTooltip="This rule can't be deleted as it is in use."
+                            i18n-ngbTooltip
+                            triggers="manual"
+                            #crushDeletionBtn="ngbTooltip"
                             (click)="deleteCrushRule()">
                       <i [ngClass]="[icons.trash]"
                          aria-hidden="true"></i>
index 81efd8af31c80b448052189d937bdf13e2fe01de..eab97750c6c4f6606c5f85d82099e803f1feac4e 100644 (file)
@@ -873,7 +873,7 @@ describe('PoolFormComponent', () => {
         });
 
         it('should not open the tooltip nor the crush info', () => {
-          expect(component.crushDeletionBtn.isOpen).toBe(false);
+          expect(component.crushDeletionBtn.isOpen()).toBe(false);
           expect(component.data.crushInfo).toBe(false);
         });
 
@@ -895,13 +895,13 @@ describe('PoolFormComponent', () => {
 
         it('should not have called delete and opened the tooltip', () => {
           expect(crushRuleService.delete).not.toHaveBeenCalled();
-          expect(component.crushDeletionBtn.isOpen).toBe(true);
+          expect(component.crushDeletionBtn.isOpen()).toBe(true);
           expect(component.data.crushInfo).toBe(true);
         });
 
         it('should hide the tooltip when clicking on delete again', () => {
           component.deleteCrushRule();
-          expect(component.crushDeletionBtn.isOpen).toBe(false);
+          expect(component.crushDeletionBtn.isOpen()).toBe(false);
         });
 
         it('should hide the tooltip when clicking on add', () => {
@@ -911,12 +911,12 @@ describe('PoolFormComponent', () => {
             }
           }));
           component.addCrushRule();
-          expect(component.crushDeletionBtn.isOpen).toBe(false);
+          expect(component.crushDeletionBtn.isOpen()).toBe(false);
         });
 
         it('should hide the tooltip when changing the crush rule', () => {
           selectRuleByIndex(0);
-          expect(component.crushDeletionBtn.isOpen).toBe(false);
+          expect(component.crushDeletionBtn.isOpen()).toBe(false);
         });
       });
     });
@@ -1029,7 +1029,7 @@ describe('PoolFormComponent', () => {
         });
 
         it('should not open the tooltip nor the crush info', () => {
-          expect(component.ecpDeletionBtn.isOpen).toBe(false);
+          expect(component.ecpDeletionBtn.isOpen()).toBe(false);
           expect(component.data.erasureInfo).toBe(false);
         });
 
@@ -1055,13 +1055,13 @@ describe('PoolFormComponent', () => {
 
         it('should not have called delete and opened the tooltip', () => {
           expect(ecpService.delete).not.toHaveBeenCalled();
-          expect(component.ecpDeletionBtn.isOpen).toBe(true);
+          expect(component.ecpDeletionBtn.isOpen()).toBe(true);
           expect(component.data.erasureInfo).toBe(true);
         });
 
         it('should hide the tooltip when clicking on delete again', () => {
           component.deleteErasureCodeProfile();
-          expect(component.ecpDeletionBtn.isOpen).toBe(false);
+          expect(component.ecpDeletionBtn.isOpen()).toBe(false);
         });
 
         it('should hide the tooltip when clicking on add', () => {
@@ -1071,12 +1071,12 @@ describe('PoolFormComponent', () => {
             }
           }));
           component.addErasureCodeProfile();
-          expect(component.ecpDeletionBtn.isOpen).toBe(false);
+          expect(component.ecpDeletionBtn.isOpen()).toBe(false);
         });
 
         it('should hide the tooltip when changing the crush rule', () => {
           setSelectedEcp('someEcpName');
-          expect(component.ecpDeletionBtn.isOpen).toBe(false);
+          expect(component.ecpDeletionBtn.isOpen()).toBe(false);
         });
       });
     });
index b06f6d054a444a492ded52954c97e97521be847f..460a4157d47c2a4b9561dd569c7742f5182bb7a4 100644 (file)
@@ -2,12 +2,10 @@ import { Component, EventEmitter, OnInit, Type, ViewChild } from '@angular/core'
 import { FormControl, Validators } from '@angular/forms';
 import { ActivatedRoute, Router } from '@angular/router';
 
-import { NgbNav } from '@ng-bootstrap/ng-bootstrap';
-
+import { NgbNav, NgbTooltip } from '@ng-bootstrap/ng-bootstrap';
 import { I18n } from '@ngx-translate/i18n-polyfill';
 import * as _ from 'lodash';
 import { BsModalService } from 'ngx-bootstrap/modal';
-import { TooltipDirective } from 'ngx-bootstrap/tooltip';
 import { Observable, Subscription } from 'rxjs';
 
 import { CrushRuleService } from '../../../shared/api/crush-rule.service';
@@ -56,9 +54,9 @@ interface FormFieldDescription {
 })
 export class PoolFormComponent extends CdForm implements OnInit {
   @ViewChild('crushInfoTabs') crushInfoTabs: NgbNav;
-  @ViewChild('crushDeletionBtn') crushDeletionBtn: TooltipDirective;
+  @ViewChild('crushDeletionBtn') crushDeletionBtn: NgbTooltip;
   @ViewChild('ecpInfoTabs') ecpInfoTabs: NgbNav;
-  @ViewChild('ecpDeletionBtn') ecpDeletionBtn: TooltipDirective;
+  @ViewChild('ecpDeletionBtn') ecpDeletionBtn: NgbTooltip;
 
   permission: Permission;
   form: CdFormGroup;
@@ -336,8 +334,8 @@ export class PoolFormComponent extends CdForm implements OnInit {
     });
     this.form.get('crushRule').valueChanges.subscribe((rule) => {
       // The crush rule can only be changed if type 'replicated' is set.
-      if (this.crushDeletionBtn && this.crushDeletionBtn.isOpen) {
-        this.crushDeletionBtn.hide();
+      if (this.crushDeletionBtn && this.crushDeletionBtn.isOpen()) {
+        this.crushDeletionBtn.close();
       }
       if (!rule) {
         return;
@@ -353,8 +351,8 @@ export class PoolFormComponent extends CdForm implements OnInit {
     });
     this.form.get('erasureProfile').valueChanges.subscribe((profile) => {
       // The ec profile can only be changed if type 'erasure' is set.
-      if (this.ecpDeletionBtn && this.ecpDeletionBtn.isOpen) {
-        this.ecpDeletionBtn.hide();
+      if (this.ecpDeletionBtn && this.ecpDeletionBtn.isOpen()) {
+        this.ecpDeletionBtn.close();
       }
       if (!profile) {
         return;
@@ -583,7 +581,7 @@ export class PoolFormComponent extends CdForm implements OnInit {
   }
 
   private hideOpenTooltips() {
-    const hideTooltip = (btn: TooltipDirective) => btn && btn.isOpen && btn.hide();
+    const hideTooltip = (btn: NgbTooltip) => btn && btn.isOpen() && btn.close();
     hideTooltip(this.ecpDeletionBtn);
     hideTooltip(this.crushDeletionBtn);
   }
@@ -657,7 +655,7 @@ export class PoolFormComponent extends CdForm implements OnInit {
   }: {
     value: any;
     usage: string[];
-    deletionBtn: TooltipDirective;
+    deletionBtn: NgbTooltip;
     dataName: string;
     getTabs: () => NgbNav;
     tabPosition: string;
index 6e15ba7ac9338b41f9417e5a4388b4ef0dea9280..4a936bf6ee8c650cd4ba72e0814ad3054a3928c6 100644 (file)
@@ -3,10 +3,9 @@ import { NgModule } from '@angular/core';
 import { ReactiveFormsModule } from '@angular/forms';
 import { RouterModule, Routes } from '@angular/router';
 
-import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap';
+import { NgbNavModule, NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap';
 import { NgBootstrapFormValidationModule } from 'ng-bootstrap-form-validation';
 import { BsDropdownModule } from 'ngx-bootstrap/dropdown';
-import { TooltipModule } from 'ngx-bootstrap/tooltip';
 
 import { ActionLabels, URLVerbs } from '../../shared/constants/app.constants';
 import { SharedModule } from '../../shared/shared.module';
@@ -27,7 +26,7 @@ import { PoolListComponent } from './pool-list/pool-list.component';
     RouterModule,
     ReactiveFormsModule,
     BsDropdownModule,
-    TooltipModule.forRoot(),
+    NgbTooltipModule,
     BlockModule,
     NgBootstrapFormValidationModule
   ],
index 1c48f90139aa5dff22af33aea84a0507f9f87d76..164f6c2b3e8f91109fdadf659a084ea11419eddf 100644 (file)
                   <span class="input-group-append">
                     <button type="button"
                             class="btn btn-light tc_showSubuserButton"
-                            i18n-tooltip
-                            tooltip="Edit"
+                            i18n-ngbTooltip
+                            ngbTooltip="Edit"
                             (click)="showSubuserModal(i)">
                       <i [ngClass]="[icons.edit]"></i>
                     </button>
                     <button type="button"
                             class="btn btn-light tc_deleteSubuserButton"
-                            i18n-tooltip
-                            tooltip="Delete"
+                            i18n-ngbTooltip
+                            ngbTooltip="Delete"
                             (click)="deleteSubuser(i)">
                       <i [ngClass]="[icons.destroy]"></i>
                     </button>
                   <span class="input-group-append">
                     <button type="button"
                             class="btn btn-light tc_showS3KeyButton"
-                            i18n-tooltip
-                            tooltip="Show"
+                            i18n-ngbTooltip
+                            ngbTooltip="Show"
                             (click)="showS3KeyModal(i)">
                       <i [ngClass]="[icons.show]"></i>
                     </button>
                     <button type="button"
                             class="btn btn-light tc_deleteS3KeyButton"
-                            i18n-tooltip
-                            tooltip="Delete"
+                            i18n-ngbTooltip
+                            ngbTooltip="Delete"
                             (click)="deleteS3Key(i)">
                       <i [ngClass]="[icons.destroy]"></i>
                     </button>
                   <span class="input-group-append">
                     <button type="button"
                             class="btn btn-light tc_showSwiftKeyButton"
-                            i18n-tooltip
-                            tooltip="Show"
+                            i18n-ngbTooltip
+                            ngbTooltip="Show"
                             (click)="showSwiftKeyModal(i)">
                       <i [ngClass]="[icons.show]"></i>
                     </button>
                   <span class="input-group-append">
                     <button type="button"
                             class="btn btn-light tc_editCapButton"
-                            i18n-tooltip
-                            tooltip="Edit"
+                            i18n-ngbTooltip
+                            ngbTooltip="Edit"
                             (click)="showCapabilityModal(i)">
                       <i [ngClass]="[icons.edit]"></i>
                     </button>
                     <button type="button"
                             class="btn btn-light tc_deleteCapButton"
-                            i18n-tooltip
-                            tooltip="Delete"
+                            i18n-ngbTooltip
+                            ngbTooltip="Delete"
                             (click)="deleteCapability(i)">
                       <i [ngClass]="[icons.destroy]"></i>
                     </button>
                   <button type="button"
                           class="btn btn-light float-right tc_addCapButton"
                           [disabled]="hasAllCapabilities()"
-                          i18n-tooltip
-                          tooltip="All capabilities are already added."
-                          [isDisabled]="!hasAllCapabilities()"
-                          triggers="pointerenter pointerleave"
+                          i18n-ngbTooltip
+                          ngbTooltip="All capabilities are already added."
+                          [disableTooltip]="!hasAllCapabilities()"
+                          triggers="pointerenter:pointerleave"
                           (click)="showCapabilityModal()">
                     <i [ngClass]="[icons.add]"></i>
                     <ng-container i18n>{{ actionLabels.ADD | titlecase }}
index 516bddd03065151f623d9eb120ded17969ea4b13..eb4a9619cf70fb8c32756e3a02a79b29db5b28a0 100644 (file)
@@ -4,8 +4,8 @@ import { FormControl, ReactiveFormsModule } from '@angular/forms';
 import { Router } from '@angular/router';
 import { RouterTestingModule } from '@angular/router/testing';
 
+import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap';
 import { BsModalService } from 'ngx-bootstrap/modal';
-import { TooltipModule } from 'ngx-bootstrap/tooltip';
 import { ToastrModule } from 'ngx-toastr';
 import { of as observableOf } from 'rxjs';
 
@@ -33,7 +33,7 @@ describe('RgwUserFormComponent', () => {
       RouterTestingModule,
       SharedModule,
       ToastrModule.forRoot(),
-      TooltipModule.forRoot()
+      NgbTooltipModule
     ],
     providers: [BsModalService, i18nProviders]
   });
index 26371d7df3315a38f52f7aab8a4e04bfb8699e4c..970661139526dd9ede4b552fde148310051bf1e8 100644 (file)
@@ -3,11 +3,10 @@ import { NgModule } from '@angular/core';
 import { FormsModule, ReactiveFormsModule } from '@angular/forms';
 import { RouterModule, Routes } from '@angular/router';
 
-import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap';
+import { NgbNavModule, NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap';
 import { NgBootstrapFormValidationModule } from 'ng-bootstrap-form-validation';
 import { BsDropdownModule } from 'ngx-bootstrap/dropdown';
 import { ModalModule } from 'ngx-bootstrap/modal';
-import { TooltipModule } from 'ngx-bootstrap/tooltip';
 
 import { ActionLabels, URLVerbs } from '../../shared/constants/app.constants';
 import { AuthGuardService } from '../../shared/services/auth-guard.service';
@@ -45,10 +44,10 @@ import { RgwUserSwiftKeyModalComponent } from './rgw-user-swift-key-modal/rgw-us
     PerformanceCounterModule,
     BsDropdownModule.forRoot(),
     NgbNavModule,
-    TooltipModule.forRoot(),
     ModalModule.forRoot(),
     RouterModule,
-    NgBootstrapFormValidationModule
+    NgBootstrapFormValidationModule,
+    NgbTooltipModule
   ],
   exports: [
     Rgw501Component,
index 66589c9609c76ce174fa77213d1b64d022c7152e..5ad4535474a795a0550e6a5d28b6c8143f676ea4 100644 (file)
@@ -1,7 +1,6 @@
 import { Component, OnDestroy, OnInit } from '@angular/core';
 import { Router } from '@angular/router';
 
-import { TooltipConfig } from 'ngx-bootstrap/tooltip';
 import { Subscription } from 'rxjs';
 
 import { SummaryService } from '../../../shared/services/summary.service';
@@ -10,16 +9,7 @@ import { TaskManagerService } from '../../../shared/services/task-manager.servic
 @Component({
   selector: 'cd-workbench-layout',
   templateUrl: './workbench-layout.component.html',
-  styleUrls: ['./workbench-layout.component.scss'],
-  providers: [
-    {
-      provide: TooltipConfig,
-      useFactory: (): TooltipConfig =>
-        Object.assign(new TooltipConfig(), {
-          container: 'body'
-        })
-    }
-  ]
+  styleUrls: ['./workbench-layout.component.scss']
 })
 export class WorkbenchLayoutComponent implements OnInit, OnDestroy {
   private subs = new Subscription();
index 6f0637473954a698a0f91995115bfda2249d0a9c..bee03ba03a4fff09f9b48fbea50b478a3f67e1c2 100644 (file)
@@ -4,7 +4,6 @@ import { RouterModule } from '@angular/router';
 
 import { CollapseModule } from 'ngx-bootstrap/collapse';
 import { BsDropdownModule } from 'ngx-bootstrap/dropdown';
-import { TooltipModule } from 'ngx-bootstrap/tooltip';
 import { SimplebarAngularModule } from 'simplebar-angular';
 
 import { AppRoutingModule } from '../../app-routing.module';
@@ -25,7 +24,6 @@ import { NotificationsComponent } from './notifications/notifications.component'
     AuthModule,
     CollapseModule.forRoot(),
     BsDropdownModule.forRoot(),
-    TooltipModule.forRoot(),
     AppRoutingModule,
     SharedModule,
     SimplebarAngularModule,
index 592a36b70b4b0b832d8d4959c6e4a01a6c097ebc..c9f851e7f211a4ad8aea36ca1fa63f7c3ee273b2 100644 (file)
@@ -3,14 +3,13 @@ import { NgModule } from '@angular/core';
 import { FormsModule, ReactiveFormsModule } from '@angular/forms';
 import { RouterModule } from '@angular/router';
 
-import { NgbAlertModule, NgbPopoverModule } from '@ng-bootstrap/ng-bootstrap';
+import { NgbAlertModule, NgbPopoverModule, NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap';
 import { NgBootstrapFormValidationModule } from 'ng-bootstrap-form-validation';
 import { ClickOutsideModule } from 'ng-click-outside';
 import { ChartsModule } from 'ng2-charts';
 import { BsDropdownModule } from 'ngx-bootstrap/dropdown';
 import { ModalModule } from 'ngx-bootstrap/modal';
 import { ProgressbarModule } from 'ngx-bootstrap/progressbar';
-import { TooltipModule } from 'ngx-bootstrap/tooltip';
 import { SimplebarAngularModule } from 'simplebar-angular';
 
 import { DirectivesModule } from '../directives/directives.module';
@@ -46,7 +45,7 @@ import { ViewCacheComponent } from './view-cache/view-cache.component';
     NgbAlertModule,
     NgbPopoverModule,
     ProgressbarModule.forRoot(),
-    TooltipModule.forRoot(),
+    NgbTooltipModule,
     ChartsModule,
     ReactiveFormsModule,
     PipesModule,
index 683140cb7e56bc3afc775299432790948be52c55..8986901b3b442823650b91094b071ea5d2b44ce3 100644 (file)
@@ -1,9 +1,8 @@
 import { ComponentFixture, TestBed } from '@angular/core/testing';
 import { ReactiveFormsModule, Validators } from '@angular/forms';
 
-import { NgbPopoverModule } from '@ng-bootstrap/ng-bootstrap';
+import { NgbPopoverModule, NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap';
 import { I18n } from '@ngx-translate/i18n-polyfill';
-import { TooltipModule } from 'ngx-bootstrap/tooltip';
 
 import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper';
 import { SelectMessages } from '../select/select-messages.model';
@@ -16,7 +15,7 @@ describe('SelectBadgesComponent', () => {
 
   configureTestBed({
     declarations: [SelectBadgesComponent, SelectComponent],
-    imports: [NgbPopoverModule, TooltipModule, ReactiveFormsModule],
+    imports: [NgbPopoverModule, NgbTooltipModule, ReactiveFormsModule],
     providers: i18nProviders
   });
 
index 7d520b4174a8d3b9e817ba9d292ca31d4e6ea4eb..5f5712c7bfebc8961c7c9f3fe5e7d81a8b0a594e 100644 (file)
@@ -53,7 +53,7 @@
   <div class="is-invalid"
        *ngIf="data.length === selectionLimit">
     <span class="form-text text-muted text-center text-warning"
-          [tooltip]="messages.selectionLimit.tooltip"
+          [ngbTooltip]="messages.selectionLimit.tooltip"
           *ngIf="data.length === selectionLimit">
       {{ messages.selectionLimit.text }}
     </span>
index c4c5a8b01c51806d1022aae9be907cc89ed69c86..45bb8d38ba748526f5b8dc4459b59ba291ba13f4 100644 (file)
@@ -1,8 +1,7 @@
 import { ComponentFixture, TestBed } from '@angular/core/testing';
 import { ReactiveFormsModule, Validators } from '@angular/forms';
 
-import { NgbPopoverModule } from '@ng-bootstrap/ng-bootstrap';
-import { TooltipModule } from 'ngx-bootstrap/tooltip';
+import { NgbPopoverModule, NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap';
 
 import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper';
 import { SelectOption } from './select-option.model';
@@ -20,7 +19,7 @@ describe('SelectComponent', () => {
 
   configureTestBed({
     declarations: [SelectComponent],
-    imports: [NgbPopoverModule, TooltipModule, ReactiveFormsModule],
+    imports: [NgbPopoverModule, NgbTooltipModule, ReactiveFormsModule],
     providers: i18nProviders
   });
 
index e75d09087843ece0bc4cb07495568dda8024b877..e6d3ef251dcd98efe8e3d3242bb5c9f33cc86eb0 100644 (file)
@@ -13,7 +13,7 @@
 
 <div class="progress"
      data-placement="left"
-     [tooltip]="usageTooltipTpl">
+     [ngbTooltip]="usageTooltipTpl">
   <div class="progress-bar bg-info"
        role="progressbar"
        [style.width]="usedPercentage + '%'">
index 334e601f471c75f7f483e8b15980ec6f318ac446..2cc510b9d41e4bf86b99b39edf495197d5f79f0d 100644 (file)
@@ -1,6 +1,6 @@
 import { ComponentFixture, TestBed } from '@angular/core/testing';
 
-import { TooltipModule } from 'ngx-bootstrap/tooltip';
+import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap';
 
 import { configureTestBed } from '../../../../testing/unit-test-helper';
 import { PipesModule } from '../../pipes/pipes.module';
@@ -11,7 +11,7 @@ describe('UsageBarComponent', () => {
   let fixture: ComponentFixture<UsageBarComponent>;
 
   configureTestBed({
-    imports: [PipesModule, TooltipModule.forRoot()],
+    imports: [PipesModule, NgbTooltipModule],
     declarations: [UsageBarComponent]
   });
 
index 672480c19363dc038cce48f9c9a67a3e93815874..ab63ed5ae57f7df2641051121918585528f3a37d 100644 (file)
@@ -387,10 +387,6 @@ cd-modal {
   background: $color-transparent-black !important;
 }
 
-.tooltip-wide .tooltip-inner {
-  width: 400px;
-}
-
 .tooltip-inner {
   background-color: white;
   border: 1px solid grey;