]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
pacifc: Revert "mgr/dashboard: unselect rows in datatables" 55415/head
authorNizamudeen A <nia@redhat.com>
Thu, 1 Feb 2024 16:40:21 +0000 (22:10 +0530)
committerNizamudeen A <nia@redhat.com>
Thu, 1 Feb 2024 16:41:22 +0000 (22:11 +0530)
This is already reverted in reef and quincy. Since its not needed
reverting it in pacific as well

Fixes: https://tracker.ceph.com/issues/57829
This reverts commit 3bdb929bab8f3eda32dcf9e46bb54a221ea54d3b.

Signed-off-by: Nizamudeen A <nia@redhat.com>
src/pybind/mgr/dashboard/frontend/cypress/integration/block/mirroring.po.ts
src/pybind/mgr/dashboard/frontend/cypress/integration/cluster/hosts.po.ts
src/pybind/mgr/dashboard/frontend/cypress/integration/cluster/services.po.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.ts

index e24a3ebc037abbc8b1b2fd619fe89e57e86d3f54..8450763d301a50f320a183ddbf5036c6d7bc1d71 100644 (file)
@@ -13,7 +13,7 @@ export class MirroringPageHelper extends PageHelper {
    */
   @PageHelper.restrictTo(pages.index.url)
   editMirror(name: string, option: string) {
-    // Select the pool in the table
+    // Clicks the pool in the table
     this.getFirstTableCell(name).click();
 
     // Clicks the Edit Mode button
@@ -28,8 +28,5 @@ export class MirroringPageHelper extends PageHelper {
     cy.contains('.modal-dialog', 'Edit pool mirror mode').should('not.exist');
     const val = option.toLowerCase(); // used since entries in table are lower case
     this.getFirstTableCell(val).should('be.visible');
-
-    // unselect the pool in the table
-    this.getFirstTableCell(name).click();
   }
 }
index 33fe756ff857781e32b11751262542c06a15cb1c..0c5da93316c46bed897c15779bd0ba1107e39243 100644 (file)
@@ -106,8 +106,8 @@ export class HostsPageHelper extends PageHelper {
   @PageHelper.restrictTo(pages.index.url)
   maintenance(hostname: string, exit = false, force = false) {
     this.clearTableSearchInput();
-    this.getTableCell(this.columnIndex.hostname, hostname).click();
     if (force) {
+      this.getTableCell(this.columnIndex.hostname, hostname).click();
       this.clickActionButton('enter-maintenance');
 
       cy.get('cd-modal').within(() => {
@@ -124,6 +124,7 @@ export class HostsPageHelper extends PageHelper {
     }
     if (exit) {
       this.getTableCell(this.columnIndex.hostname, hostname)
+        .click()
         .parent()
         .find(`datatable-body-cell:nth-child(${this.columnIndex.status})`)
         .then(($ele) => {
@@ -141,6 +142,7 @@ export class HostsPageHelper extends PageHelper {
           expect(status).to.not.include('maintenance');
         });
     } else {
+      this.getTableCell(this.columnIndex.hostname, hostname).click();
       this.clickActionButton('enter-maintenance');
 
       this.getTableCell(this.columnIndex.hostname, hostname)
index 481d6bc9b4d3a66d7a0df5b9c3a3fd25e5e45954..b3918572f3df6ee7281ce7a5ee0a4a1b66f12e5f 100644 (file)
@@ -195,10 +195,6 @@ export class ServicesPageHelper extends PageHelper {
     cy.get('cd-service-daemon-list').within(() => {
       this.getTableRow(daemon).click();
       this.clickActionButton(action);
-
-      // unselect it to avoid colliding with any other selection
-      // in different steps
-      this.getTableRow(daemon).click();
     });
   }
 }
index f0f649780afed5270d91d24d2e183ab16b58937c..98ed0bf63a164652309f770e289fc3e22344a2f1 100644 (file)
@@ -568,33 +568,15 @@ describe('TableComponent', () => {
       expect(executingElement.nativeElement.textContent.trim()).toBe(`(${state})`);
     };
 
-    it('should display executing template', () => {
+    it.only('should display executing template', () => {
       testExecutingTemplate();
     });
 
-    it('should display executing template with custom classes', () => {
+    it.only('should display executing template with custom classes', () => {
       testExecutingTemplate({ valueClass: 'a b', executingClass: 'c d' });
     });
   });
 
-  describe('test unselect functionality of rows', () => {
-    beforeEach(() => {
-      component.autoReload = -1;
-      component.selectionType = 'single';
-      fixture.detectChanges();
-    });
-
-    it('should unselect row on clicking on it again', () => {
-      const rowCellDebugElement = fixture.debugElement.query(By.css('datatable-body-cell'));
-
-      rowCellDebugElement.triggerEventHandler('click', null);
-      expect(component.selection.selected.length).toEqual(1);
-
-      rowCellDebugElement.triggerEventHandler('click', null);
-      expect(component.selection.selected.length).toEqual(0);
-    });
-  });
-
   describe('reload data', () => {
     beforeEach(() => {
       component.ngOnInit();
index 6a37468c272222b9139134ff01c55a146c70cab1..873b0de0bdd622c33d48724c33f85fa233b6eae1 100644 (file)
@@ -329,10 +329,6 @@ export class TableComponent implements AfterContentChecked, OnInit, OnChanges, O
     } else {
       this.useData();
     }
-
-    if (this.selectionType === 'single') {
-      this.table.selectCheck = this.singleSelectCheck.bind(this);
-    }
   }
 
   initUserConfig() {
@@ -766,10 +762,6 @@ export class TableComponent implements AfterContentChecked, OnInit, OnChanges, O
     this.updateSelection.emit(_.clone(this.selection));
   }
 
-  private singleSelectCheck(row: any) {
-    return this.selection.selected.indexOf(row) === -1;
-  }
-
   toggleColumn(column: CdTableColumn) {
     const prop: TableColumnProp = column.prop;
     const hide = !column.isHidden;