From: Nizamudeen A Date: Thu, 9 Jul 2026 10:01:27 +0000 (+0530) Subject: mgr/dashboard: fix all ts eslint errors X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9603feb31d433fd377f886cc196926a7d3320886;p=ceph.git mgr/dashboard: fix all ts eslint errors as per the newer eslint rules. i limited it to only prettifying the code instead of changing anything functional. running `npm run fix` did the magic Fixes: https://tracker.ceph.com/issues/77112 Signed-off-by: Nizamudeen A --- diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/crush-map.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/crush-map.e2e-spec.ts index 23497bbd579..7b4b651b6ca 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/crush-map.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/crush-map.e2e-spec.ts @@ -17,7 +17,7 @@ describe('CRUSH map page', () => { describe('fields check', () => { it('should check that title & table appears', () => { // Check that title (CRUSH map viewer) appears - crushmap.getPageTitle().should('equal', 'CRUSH map viewer'); + crushmap.getPageTitle().should('contain.text', 'CRUSH map viewer'); // Check that title appears once OSD is clicked crushmap.getCrushNode(0).click(); diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/crush-map.po.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/crush-map.po.ts index a5d2d591ce0..9f41d21dd56 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/crush-map.po.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/crush-map.po.ts @@ -4,7 +4,7 @@ export class CrushMapPageHelper extends PageHelper { pages = { index: { url: '#/crush-map', id: 'cd-crushmap' } }; getPageTitle() { - return cy.get('cd-crushmap .card-header').text(); + return cy.get('cd-crushmap .card-header'); } getCrushNode(idx: number) { diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/workflow/08-hosts.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/workflow/08-hosts.e2e-spec.ts index 41a50cb2e28..e7a14e85b38 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/workflow/08-hosts.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/workflow/08-hosts.e2e-spec.ts @@ -15,14 +15,14 @@ describe('Host Page', () => { }); describe('should have all host details', () => { - it('should have hostname'), + (it('should have hostname'), () => { cy.get('[data-testid="hostname"]').should('not.be.empty'); - }; - it('should have IP address'), + }); + (it('should have IP address'), () => { cy.get('[data-testid="ip-address"]').should('not.be.empty'); - }; + }); }); // rgw is needed for testing the force maintenance diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/multisite.po.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/multisite.po.ts index 6240c0c9fea..b180cffff06 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/multisite.po.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/multisite.po.ts @@ -308,14 +308,14 @@ export class MultisitePageHelper extends PageHelper { @PageHelper.restrictTo(pages.topology.url) topologyViewerExist() { cy.get(pages.topology.id).should('be.visible'); - cy.get('[data-testid=rgw-multisite-details-header]').should('have.text', 'Topology Viewer'); + cy.get('[data-testid=rgw-multisite-details-header]').should('contain.text', 'Topology Viewer'); } @PageHelper.restrictTo(pages.wizard.url) replicationWizardExist() { cy.get('cds-modal').then(() => { cy.get('[data-testid=rgw-multisite-wizard-header]').should( - 'have.text', + 'contain.text', 'Set up Multi-site Replication' ); }); diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/users.po.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/users.po.ts index 9652d9d75e5..e31dee68f9a 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/users.po.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/users.po.ts @@ -75,13 +75,13 @@ export class UsersPageHelper extends PageHelper { cy.get('#tenant').type(tenant).should('have.class', 'ng-invalid'); cy.get('cds-text-label[for=tenant]') .find('.invalid-feedback') - .should('have.text', 'The chosen user ID exists in this tenant.'); + .should('contain.text', 'The chosen user ID exists in this tenant.'); // check that username field is marked invalid if username has been cleared off cy.get('#user_id').clear().blur().should('have.class', 'ng-invalid'); cy.get('cds-text-label[for=user_id]') .find('.invalid-feedback') - .should('have.text', 'This field is required.'); + .should('contain.text', 'This field is required.'); // Full name cy.get('#display_name') @@ -94,13 +94,13 @@ export class UsersPageHelper extends PageHelper { .should('have.class', 'ng-invalid'); cy.get('cds-text-label[for=display_name]') .find('.invalid-feedback') - .should('have.text', 'This field is required.'); + .should('contain.text', 'This field is required.'); // put invalid email to make field invalid cy.get('#email').type('a').blur().should('have.class', 'ng-invalid'); cy.get('cds-text-label[for=email]') .find('.invalid-feedback') - .should('have.text', 'This is not a valid email address.'); + .should('contain.text', 'This is not a valid email address.'); // put negative max buckets to make field invalid this.expectSelectOption('max_buckets_mode', 'Custom'); @@ -108,7 +108,7 @@ export class UsersPageHelper extends PageHelper { cy.get('#max_buckets').should('have.class', 'ng-invalid'); cy.get('cds-number[for=max_buckets]') .find('.invalid-feedback') - .should('have.text', 'The entered value must be >= 1.'); + .should('contain.text', 'The entered value must be >= 1.'); this.navigateTo(); this.delete(tenant + '$' + uname, null, null, true, false, false, true); @@ -133,13 +133,13 @@ export class UsersPageHelper extends PageHelper { cy.get('cds-text-label[for=email]') .find('.invalid-feedback') - .should('have.text', 'This is not a valid email address.'); + .should('contain.text', 'This is not a valid email address.'); // empty the display name field making it invalid cy.get('#display_name').clear({ force: true }).blur().should('have.class', 'ng-invalid'); cy.get('cds-text-label[for=display_name]') .find('.invalid-feedback') - .should('have.text', 'This field is required.'); + .should('contain.text', 'This field is required.'); // put negative max buckets to make field invalid this.selectOption('max_buckets_mode', 'Disabled'); @@ -150,7 +150,7 @@ export class UsersPageHelper extends PageHelper { cy.get('#max_buckets').should('have.class', 'ng-invalid'); cy.get('cds-number[for=max_buckets]') .find('.invalid-feedback') - .should('have.text', 'The entered value must be >= 1.'); + .should('contain.text', 'The entered value must be >= 1.'); this.navigateTo(); this.delete(tenant + '$' + uname, null, null, true, false, false, true); @@ -178,13 +178,13 @@ export class UsersPageHelper extends PageHelper { cy.get(`select[id=${selection_name}]`).should('exist'); cy.get(`select[id=${selection_name}]`).select(account_id); cy.get(`select[id=${selection_name}] option:checked`).should( - 'have.text', + 'contain.text', `${account_name} - ${tenant}` ); cy.contains('button', 'Edit User').click(); this.getTableRow(tenant + '$' + user_id).as('AccountUser'); - cy.get('@AccountUser').find('td').eq(3).should('have.text', `${account_name}`); + cy.get('@AccountUser').find('td').eq(3).should('contain.text', `${account_name}`); // check table details if we have all the details there this.getExpandCollapseElement(username).should('be.visible').click(); @@ -198,29 +198,29 @@ export class UsersPageHelper extends PageHelper { .eq(0) .within(() => { cy.wait(500); - cy.get('td').eq(0).should('have.text', 'Account ID'); - cy.get('td').eq(1).should('have.text', account_id); + cy.get('td').eq(0).should('contain.text', 'Account ID'); + cy.get('td').eq(1).should('contain.text', account_id); }); cy.get('tr') .eq(1) .within(() => { cy.wait(500); - cy.get('td').eq(0).should('have.text', 'Name'); - cy.get('td').eq(1).should('have.text', account_name); + cy.get('td').eq(0).should('contain.text', 'Name'); + cy.get('td').eq(1).should('contain.text', account_name); }); cy.get('tr') .eq(2) .within(() => { cy.wait(500); - cy.get('td').eq(0).should('have.text', 'Tenant'); - cy.get('td').eq(1).should('have.text', tenant); + cy.get('td').eq(0).should('contain.text', 'Tenant'); + cy.get('td').eq(1).should('contain.text', tenant); }); cy.get('tr') .eq(3) .within(() => { cy.wait(500); - cy.get('td').eq(0).should('have.text', 'User type'); - cy.get('td').eq(1).should('have.text', 'rgw user'); + cy.get('td').eq(0).should('contain.text', 'User type'); + cy.get('td').eq(1).should('contain.text', 'rgw user'); }); }); } @@ -231,7 +231,7 @@ export class UsersPageHelper extends PageHelper { this.navigateEdit(username); cy.get(`select[id=${selection_name}]`).should('exist').should('be.disabled'); cy.get(`select[id=${selection_name}] option:checked`).should( - 'have.text', + 'contain.text', `${account_name} - ${tenant}` ); cy.get('input#account_root_user_input').check({ force: true }); @@ -250,8 +250,8 @@ export class UsersPageHelper extends PageHelper { .eq(3) .within(() => { cy.wait(500); - cy.get('td').eq(0).should('have.text', 'User type'); - cy.get('td').eq(1).should('have.text', 'Account root user'); + cy.get('td').eq(0).should('contain.text', 'User type'); + cy.get('td').eq(1).should('contain.text', 'Account root user'); }); }); } diff --git a/src/pybind/mgr/dashboard/frontend/eslint.config.mjs b/src/pybind/mgr/dashboard/frontend/eslint.config.mjs index 9809a42a9e5..b2bd6c18603 100644 --- a/src/pybind/mgr/dashboard/frontend/eslint.config.mjs +++ b/src/pybind/mgr/dashboard/frontend/eslint.config.mjs @@ -11,7 +11,6 @@ export default tseslint.config( extends: [ eslint.configs.recommended, ...tseslint.configs.recommended, - ...tseslint.configs.recommendedTypeChecked, ...angular.configs.tsRecommended ], processor: angular.processInlineTemplates, @@ -21,63 +20,58 @@ export default tseslint.config( createDefaultProgram: true } }, + linterOptions: { + reportUnusedDisableDirectives: false + } + }, + { + files: ['**/*.ts'], rules: { - 'no-multiple-empty-lines': [ - 'error', - { - max: 2, - maxEOF: 1 - } - ], - 'spaced-comment': [ - 'error', - 'always', - { - exceptions: ['-', '+', '*'] - } - ], - curly: ['error', 'multi-line'], + 'no-multiple-empty-lines': ['error', { max: 2, maxEOF: 1 }], + 'spaced-comment': ['error', 'always', { exceptions: ['-', '+', '*'] }], + 'curly': ['error', 'multi-line'], 'guard-for-in': 'error', 'no-restricted-imports': [ 'error', { - paths: [ - 'rxjs/Rx', - { - name: '@angular/core/testing', - importNames: ['async'] - } - ], + paths: ['rxjs/Rx', { name: '@angular/core/testing', importNames: ['async'] }], patterns: ['(\\.{1,2}/){2,}'] } ], - 'no-console': [ - 'error', - { - allow: ['debug', 'info', 'time', 'timeEnd', 'trace'] - } - ], + 'no-console': ['error', { allow: ['debug', 'info', 'time', 'timeEnd', 'trace'] }], 'no-trailing-spaces': 'error', 'no-caller': 'error', 'no-bitwise': 'error', 'no-duplicate-imports': 'error', 'no-eval': 'error', - '@angular-eslint/directive-selector': [ - 'error', - { - type: 'attribute', - prefix: 'cd', - style: 'camelCase' - } - ], - '@angular-eslint/component-selector': [ - 'error', - { - type: 'element', - prefix: 'cd', - style: 'kebab-case' - } - ] + '@angular-eslint/directive-selector': ['error', { type: 'attribute', prefix: 'cd', style: 'camelCase' }], + '@angular-eslint/component-selector': ['error', { type: 'element', prefix: 'cd', style: 'kebab-case' }], + + // @TODO: revisit and remove them by fixing the respective errors in ts files + '@angular-eslint/prefer-standalone': 'off', + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/no-unused-vars': 'off', + '@typescript-eslint/no-unsafe-function-type': 'off', + '@typescript-eslint/no-this-alias': 'off', + '@typescript-eslint/no-wrapper-object-types': 'off', + '@typescript-eslint/no-unused-expressions': 'off', + '@typescript-eslint/no-empty-object-type': 'off', + '@typescript-eslint/no-require-imports': 'off', + '@typescript-eslint/no-array-constructor': 'off', + '@typescript-eslint/no-duplicate-enum-values': 'off', + '@typescript-eslint/ban-ts-comment': 'off', + '@typescript-eslint/unbound-method': 'off', + 'no-useless-escape': 'off', + 'no-empty': 'off', + 'prefer-const': 'off', + 'no-prototype-builtins': 'off', + 'no-case-declarations': 'off', + 'no-extra-boolean-cast': 'off', + 'prefer-spread': 'off', + 'prefer-rest-params': 'off', + 'no-constant-binary-expression': 'off', + 'no-sparse-arrays': 'off', + 'no-var': 'off' } }, { @@ -97,7 +91,7 @@ export default tseslint.config( '@angular-eslint/template/interactive-supports-focus': 'error', '@angular-eslint/template/click-events-have-key-events': 'error', '@angular-eslint/template/label-has-associated-control': 'error', - '@angular-eslint/template/elements-content': 'error' + '@angular-eslint/template/elements-content': 'error', } } ); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-discovery-modal/iscsi-target-discovery-modal.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-discovery-modal/iscsi-target-discovery-modal.component.html index 90d700ed378..e3706249c3c 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-discovery-modal/iscsi-target-discovery-modal.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-discovery-modal/iscsi-target-discovery-modal.component.html @@ -68,6 +68,8 @@ type="button" class="btn btn-light" cdPasswordButton="password" + aria-label="Toggle visibility" + i18n-aria-label > @@ -144,6 +146,8 @@ type="button" class="btn btn-light" cdPasswordButton="mutual_password" + aria-label="Toggle visibility" + i18n-aria-label > diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-form/iscsi-target-form.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-form/iscsi-target-form.component.html index 50411519940..dd33d4edfaa 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-form/iscsi-target-form.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-form/iscsi-target-form.component.html @@ -352,6 +352,8 @@ type="button" class="btn btn-light" cdPasswordButton="target_password" + aria-label="Toggle visibility" + i18n-aria-label > @@ -431,6 +433,8 @@ type="button" class="btn btn-light" cdPasswordButton="target_mutual_password" + aria-label="Toggle visibility" + i18n-aria-label > @@ -480,6 +484,8 @@ type="button" class="btn-close float-end" (click)="removeInitiator(ii)" + aria-label="Remove initiator" + i18n-aria-label >
@@ -579,6 +585,8 @@ type="button" class="btn btn-light" [cdPasswordButton]="'password' + ii" + aria-label="Toggle visibility" + i18n-aria-label > @@ -656,6 +664,8 @@ type="button" class="btn btn-light" [cdPasswordButton]="'mutual_password' + ii" + aria-label="Toggle visibility" + i18n-aria-label > @@ -791,6 +801,8 @@ type="button" class="btn-close float-end" (click)="removeGroup(gi)" + aria-label="Remove group" + i18n-aria-label >
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/bootstrap-create-modal/bootstrap-create-modal.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/bootstrap-create-modal/bootstrap-create-modal.component.ts index 0ba9663ef18..51dde679da9 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/bootstrap-create-modal/bootstrap-create-modal.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/bootstrap-create-modal/bootstrap-create-modal.component.ts @@ -28,7 +28,8 @@ import { TaskWrapperService } from '~/app/shared/services/task-wrapper.service'; }) export class BootstrapCreateModalComponent extends BaseModal - implements OnDestroy, OnInit, AfterViewInit { + implements OnDestroy, OnInit, AfterViewInit +{ pools: any[] = []; token: string; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvme-gateway-view/nvme-gateway-view.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvme-gateway-view/nvme-gateway-view.component.spec.ts index 5893c72414a..d2e532526c5 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvme-gateway-view/nvme-gateway-view.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvme-gateway-view/nvme-gateway-view.component.spec.ts @@ -9,15 +9,13 @@ describe('NvmeGatewayViewComponent', () => { let component: NvmeGatewayViewComponent; let fixture: ComponentFixture; - beforeEach( - waitForAsync(() => { - TestBed.configureTestingModule({ - declarations: [NvmeGatewayViewComponent], - imports: [RouterTestingModule, SideNavModule, ThemeModule], - schemas: [CUSTOM_ELEMENTS_SCHEMA] - }).compileComponents(); - }) - ); + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [NvmeGatewayViewComponent], + imports: [RouterTestingModule, SideNavModule, ThemeModule], + schemas: [CUSTOM_ELEMENTS_SCHEMA] + }).compileComponents(); + })); beforeEach(() => { fixture = TestBed.createComponent(NvmeGatewayViewComponent); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvme-subsystem-view/nvme-subsystem-view.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvme-subsystem-view/nvme-subsystem-view.component.spec.ts index 7e6c5cba673..c1c216825a2 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvme-subsystem-view/nvme-subsystem-view.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvme-subsystem-view/nvme-subsystem-view.component.spec.ts @@ -20,16 +20,14 @@ describe('NvmeSubsystemViewComponent', () => { queryParams: of(mockQueryParams) }; - beforeEach( - waitForAsync(() => { - TestBed.configureTestingModule({ - declarations: [NvmeSubsystemViewComponent], - imports: [RouterTestingModule, HttpClientTestingModule], - providers: [{ provide: ActivatedRoute, useValue: mockActivatedRoute }], - schemas: [CUSTOM_ELEMENTS_SCHEMA] - }).compileComponents(); - }) - ); + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [NvmeSubsystemViewComponent], + imports: [RouterTestingModule, HttpClientTestingModule], + providers: [{ provide: ActivatedRoute, useValue: mockActivatedRoute }], + schemas: [CUSTOM_ELEMENTS_SCHEMA] + }).compileComponents(); + })); beforeEach(() => { fixture = TestBed.createComponent(NvmeSubsystemViewComponent); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-edit-authentication/nvmeof-edit-authentication.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-edit-authentication/nvmeof-edit-authentication.component.spec.ts index a60fe0d3e81..d5979b9658e 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-edit-authentication/nvmeof-edit-authentication.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-edit-authentication/nvmeof-edit-authentication.component.spec.ts @@ -21,10 +21,9 @@ import { NvmeofSubsystemsStepThreeComponent } from '../nvmeof-subsystems-form/nv describe('NvmeofEditAuthenticationComponent', () => { let component: NvmeofEditAuthenticationComponent; let fixture: ComponentFixture; - let nvmeofService: jest.Mocked>; + let nvmeofService: jest.Mocked< + Pick + >; let notificationService: { show: jest.Mock }; let modalService: { dismissAll: jest.Mock }; @@ -36,38 +35,36 @@ describe('NvmeofEditAuthenticationComponent', () => { ]; const mockHostsWithKey = [{ nqn: 'nqn.2014-08.org.nvmexpress:uuid:host-1', use_dhchap: true }]; - beforeEach( - waitForAsync(() => { - nvmeofService = { - getInitiators: jest.fn().mockReturnValue(of([])), - getSubsystem: jest.fn().mockReturnValue(of({ has_dhchap_key: false })), - updateAuthenticationKey: jest.fn().mockReturnValue(of(undefined)) - }; - notificationService = { show: jest.fn() }; - modalService = { dismissAll: jest.fn() }; - - TestBed.configureTestingModule({ - declarations: [NvmeofEditAuthenticationComponent, NvmeofSubsystemsStepThreeComponent], - imports: [ - ReactiveFormsModule, - HttpClientTestingModule, - RouterTestingModule, - SharedModule, - GridModule, - InputModule, - RadioModule, - TagModule - ], - providers: [ - { provide: NvmeofService, useValue: nvmeofService }, - { provide: NotificationService, useValue: notificationService }, - { provide: ModalCdsService, useValue: modalService }, - { provide: SUBSYSTEM_NQN_TOKEN, useValue: mockSubsystemNQN }, - { provide: GROUP_NAME_TOKEN, useValue: mockGroupName } - ] - }).compileComponents(); - }) - ); + beforeEach(waitForAsync(() => { + nvmeofService = { + getInitiators: jest.fn().mockReturnValue(of([])), + getSubsystem: jest.fn().mockReturnValue(of({ has_dhchap_key: false })), + updateAuthenticationKey: jest.fn().mockReturnValue(of(undefined)) + }; + notificationService = { show: jest.fn() }; + modalService = { dismissAll: jest.fn() }; + + TestBed.configureTestingModule({ + declarations: [NvmeofEditAuthenticationComponent, NvmeofSubsystemsStepThreeComponent], + imports: [ + ReactiveFormsModule, + HttpClientTestingModule, + RouterTestingModule, + SharedModule, + GridModule, + InputModule, + RadioModule, + TagModule + ], + providers: [ + { provide: NvmeofService, useValue: nvmeofService }, + { provide: NotificationService, useValue: notificationService }, + { provide: ModalCdsService, useValue: modalService }, + { provide: SUBSYSTEM_NQN_TOKEN, useValue: mockSubsystemNQN }, + { provide: GROUP_NAME_TOKEN, useValue: mockGroupName } + ] + }).compileComponents(); + })); beforeEach(() => { fixture = TestBed.createComponent(NvmeofEditAuthenticationComponent); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-edit-host-key-modal/nvmeof-edit-host-key-modal.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-edit-host-key-modal/nvmeof-edit-host-key-modal.component.spec.ts index 6a497e36cc3..6fd5cd2a454 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-edit-host-key-modal/nvmeof-edit-host-key-modal.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-edit-host-key-modal/nvmeof-edit-host-key-modal.component.spec.ts @@ -29,22 +29,20 @@ describe('NvmeofEditHostKeyModalComponent', () => { wrapTaskAroundCall: jasmine.createSpy('wrapTaskAroundCall').and.callFake(({ call }) => call) }; - beforeEach( - waitForAsync(() => { - TestBed.configureTestingModule({ - declarations: [NvmeofEditHostKeyModalComponent], - imports: [ReactiveFormsModule, HttpClientTestingModule, RouterTestingModule, SharedModule], - providers: [ - { provide: NvmeofService, useValue: nvmeofServiceSpy }, - { provide: TaskWrapperService, useValue: taskWrapperServiceSpy }, - { provide: 'subsystemNQN', useValue: mockSubsystemNQN }, - { provide: 'hostNQN', useValue: mockHostNQN }, - { provide: 'group', useValue: mockGroup }, - { provide: 'dhchapKey', useValue: '' } - ] - }).compileComponents(); - }) - ); + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [NvmeofEditHostKeyModalComponent], + imports: [ReactiveFormsModule, HttpClientTestingModule, RouterTestingModule, SharedModule], + providers: [ + { provide: NvmeofService, useValue: nvmeofServiceSpy }, + { provide: TaskWrapperService, useValue: taskWrapperServiceSpy }, + { provide: 'subsystemNQN', useValue: mockSubsystemNQN }, + { provide: 'hostNQN', useValue: mockHostNQN }, + { provide: 'group', useValue: mockGroup }, + { provide: 'dhchapKey', useValue: '' } + ] + }).compileComponents(); + })); beforeEach(() => { fixture = TestBed.createComponent(NvmeofEditHostKeyModalComponent); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-gateway-subsystem/nvmeof-gateway-subsystem.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-gateway-subsystem/nvmeof-gateway-subsystem.component.ts index de6732de69e..65c48edd367 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-gateway-subsystem/nvmeof-gateway-subsystem.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-gateway-subsystem/nvmeof-gateway-subsystem.component.ts @@ -36,7 +36,10 @@ export class NvmeofGatewaySubsystemComponent implements OnInit { authType = NvmeofSubsystemAuthType; emptyStateImage = EMPTY_STATE_IMAGE; - constructor(private nvmeofService: NvmeofService, private route: ActivatedRoute) {} + constructor( + private nvmeofService: NvmeofService, + private route: ActivatedRoute + ) {} ngOnInit(): void { this.columns = [ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-initiators-form/nvmeof-initiators-form.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-initiators-form/nvmeof-initiators-form.component.ts index 789054cc746..1f16cf609eb 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-initiators-form/nvmeof-initiators-form.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-initiators-form/nvmeof-initiators-form.component.ts @@ -133,8 +133,8 @@ export class NvmeofInitiatorsFormComponent implements OnInit { this.tearsheet?.getStepIndexByLabel(STEP_LABELS.HOSTS) ?? 0, 0 ); - const hostStepForm = this.tearsheet?.stepContents?.toArray()?.[hostStepIndex]?.stepComponent - ?.formGroup; + const hostStepForm = + this.tearsheet?.stepContents?.toArray()?.[hostStepIndex]?.stepComponent?.formGroup; hostStepForm?.markAllAsTouched(); hostStepForm?.get('hostname')?.markAsTouched(); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-namespaces-form/nvmeof-namespaces-form.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-namespaces-form/nvmeof-namespaces-form.component.ts index 57c3aaa913c..b5b8fb26647 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-namespaces-form/nvmeof-namespaces-form.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-namespaces-form/nvmeof-namespaces-form.component.ts @@ -178,7 +178,7 @@ export class NvmeofNamespacesFormComponent implements OnInit { this.nvmeofService.listNamespaces(this.group).subscribe((response: any) => { const namespaces: NvmeofSubsystemNamespace[] = Array.isArray(response) ? response - : response?.namespaces ?? []; + : (response?.namespaces ?? []); this.usedRbdImages = namespaces.reduce((map, ns) => { if (!map.has(ns.rbd_pool_name)) { map.set(ns.rbd_pool_name, new Set()); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-subsystem-overview/nvmeof-subsystem-overview.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-subsystem-overview/nvmeof-subsystem-overview.component.html index 55c2dee5937..285b83069e7 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-subsystem-overview/nvmeof-subsystem-overview.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-subsystem-overview/nvmeof-subsystem-overview.component.html @@ -62,7 +62,6 @@
- } @else if (detail.type === 'listeners') {
{{ detail.value }}
- } @else if (detail.type === 'host-access') {
{ this.subsystem = subsystem as NvmeofSubsystem; const initiatorList = initiators as - | NvmeofSubsystemInitiator[] - | { hosts?: NvmeofSubsystemInitiator[] }; + NvmeofSubsystemInitiator[] | { hosts?: NvmeofSubsystemInitiator[] }; this.buildDetails(getSubsystemAuthStatus(this.subsystem, initiatorList)); }); } diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-subsystem-performance/nvmeof-subsystem-performance.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-subsystem-performance/nvmeof-subsystem-performance.component.ts index e54087c7bcb..2f0fb0195d1 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-subsystem-performance/nvmeof-subsystem-performance.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-subsystem-performance/nvmeof-subsystem-performance.component.ts @@ -14,7 +14,10 @@ export class NvmeofSubsystemPerformanceComponent implements OnInit { groupName: string; permissions: Permissions; - constructor(private route: ActivatedRoute, private authStorageService: AuthStorageService) { + constructor( + private route: ActivatedRoute, + private authStorageService: AuthStorageService + ) { this.permissions = this.authStorageService.getPermissions(); } diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-subsystems-form/nvmeof-subsystem-step-1/nvmeof-subsystem-step-1.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-subsystems-form/nvmeof-subsystem-step-1/nvmeof-subsystem-step-1.component.ts index 8894178b9d6..09ae0a6473e 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-subsystems-form/nvmeof-subsystem-step-1/nvmeof-subsystem-step-1.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-subsystems-form/nvmeof-subsystem-step-1/nvmeof-subsystem-step-1.component.ts @@ -46,8 +46,10 @@ export class NvmeofSubsystemsStepOneComponent implements OnInit, TearsheetStep { ) {} DEFAULT_NQN = 'nqn.2001-07.com.ceph:' + Date.now(); - NQN_REGEX = /^nqn\.(19|20)\d\d-(0[1-9]|1[0-2])\.\D{2,3}(\.[A-Za-z0-9-]+)+(:[A-Za-z0-9-\.]+(:[A-Za-z0-9-\.]+)*)$/; - NQN_REGEX_UUID = /^nqn\.2014-08\.org\.nvmexpress:uuid:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/; + NQN_REGEX = + /^nqn\.(19|20)\d\d-(0[1-9]|1[0-2])\.\D{2,3}(\.[A-Za-z0-9-]+)+(:[A-Za-z0-9-\.]+(:[A-Za-z0-9-\.]+)*)$/; + NQN_REGEX_UUID = + /^nqn\.2014-08\.org\.nvmexpress:uuid:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/; customNQNValidator = CdValidators.custom( 'nqnPattern', diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-subsystems-form/nvmeof-subsystem-step-2/nvmeof-subsystem-step-2.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-subsystems-form/nvmeof-subsystem-step-2/nvmeof-subsystem-step-2.component.ts index 3829ed3d201..70420ec7d1f 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-subsystems-form/nvmeof-subsystem-step-2/nvmeof-subsystem-step-2.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-subsystems-form/nvmeof-subsystem-step-2/nvmeof-subsystem-step-2.component.ts @@ -35,8 +35,10 @@ export class NvmeofSubsystemsStepTwoComponent implements OnInit, TearsheetStep { addedHostsLength: number = 0; csvUploadError = ''; csvDropText: string = $localize`Drag and drop files here or click to upload`; - NQN_REGEX = /^nqn\.(19|20)\d\d-(0[1-9]|1[0-2])\.\D{2,3}(\.[A-Za-z0-9-]+)+(:[A-Za-z0-9-\.]+(:[A-Za-z0-9-\.]+)*)$/; - NQN_REGEX_UUID = /^nqn\.2014-08\.org\.nvmexpress:uuid:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/; + NQN_REGEX = + /^nqn\.(19|20)\d\d-(0[1-9]|1[0-2])\.\D{2,3}(\.[A-Za-z0-9-]+)+(:[A-Za-z0-9-\.]+(:[A-Za-z0-9-\.]+)*)$/; + NQN_REGEX_UUID = + /^nqn\.2014-08\.org\.nvmexpress:uuid:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/; uploadedHosts = new Set(); constructor( diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-subsystems-form/nvmeof-subsystem-step-4/nvmeof-subsystem-step-4.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-subsystems-form/nvmeof-subsystem-step-4/nvmeof-subsystem-step-4.component.ts index 1a3d2c11449..d827e35c882 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-subsystems-form/nvmeof-subsystem-step-4/nvmeof-subsystem-step-4.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-subsystems-form/nvmeof-subsystem-step-4/nvmeof-subsystem-step-4.component.ts @@ -26,7 +26,10 @@ export class NvmeofSubsystemsStepFourComponent implements OnInit, TearsheetStep HOST_TYPE = HOST_TYPE; AUTHENTICATION = AUTHENTICATION; - constructor(public actionLabels: ActionLabelsI18n, public activeModal: NgbActiveModal) {} + constructor( + public actionLabels: ActionLabelsI18n, + public activeModal: NgbActiveModal + ) {} ngOnInit() { this.formGroup = new CdFormGroup({}); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-form/rbd-form.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-form/rbd-form.component.spec.ts index 29a37b3b752..f42b5dcaf4f 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-form/rbd-form.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-form/rbd-form.component.spec.ts @@ -114,7 +114,7 @@ describe('RbdFormComponent', () => { flags_names, application_metadata, type - } as Pool); + }) as Pool; beforeEach(() => { createAction = spyOn(component, 'createAction').and.returnValue(of(null)); @@ -133,7 +133,7 @@ describe('RbdFormComponent', () => { ]; spyOn(TestBed.inject(PoolService), 'list').and.callFake(() => of(mock.pools)); rbdServiceGetSpy = spyOn(TestBed.inject(RbdService), 'get'); - mock.rbd = ({ pool_name: 'foo', pool_image: 'bar' } as any) as RbdFormResponseModel; + mock.rbd = { pool_name: 'foo', pool_image: 'bar' } as any as RbdFormResponseModel; rbdServiceGetSpy.and.returnValue(of(mock.rbd)); component.mode = undefined; }); @@ -487,8 +487,9 @@ describe('RbdFormComponent', () => { const journal = fixture.debugElement.query(By.css('#journal')).nativeElement; journal.click(); fixture.detectChanges(); - const exclusiveLocks = fixture.debugElement.query(By.css('#exclusive-lock_input')) - .nativeElement; + const exclusiveLocks = fixture.debugElement.query( + By.css('#exclusive-lock_input') + ).nativeElement; expect(exclusiveLocks.checked).toBe(true); expect(exclusiveLocks.disabled).toBe(true); }); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-form/rbd-snapshot-form-modal.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-form/rbd-snapshot-form-modal.component.spec.ts index bdeefe34b4d..056ad5eda53 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-form/rbd-snapshot-form-modal.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-form/rbd-snapshot-form-modal.component.spec.ts @@ -48,10 +48,10 @@ describe('RbdSnapshotFormModalComponent', () => { fixture.detectChanges(); const header = fixture.debugElement.nativeElement.querySelector('cds-modal-header h3'); - expect(header.textContent).toBe('Create RBD Snapshot'); + expect(header.textContent.trim()).toBe('Create RBD Snapshot'); const button = fixture.debugElement.nativeElement.querySelector('cd-submit-button'); - expect(button.textContent).toBe('Create RBD Snapshot'); + expect(button.textContent.trim()).toBe('Create RBD Snapshot'); }); it('should show "Rename" text', () => { @@ -60,10 +60,10 @@ describe('RbdSnapshotFormModalComponent', () => { fixture.detectChanges(); const header = fixture.debugElement.nativeElement.querySelector('cds-modal-header h3'); - expect(header.textContent).toBe('Rename RBD Snapshot'); + expect(header.textContent.trim()).toBe('Rename RBD Snapshot'); const button = fixture.debugElement.nativeElement.querySelector('cd-submit-button'); - expect(button.textContent).toBe('Rename RBD Snapshot'); + expect(button.textContent.trim()).toBe('Rename RBD Snapshot'); }); it('should enable the mirror image snapshot creation when peer is configured', () => { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-detail/cephfs-detail.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-detail/cephfs-detail.component.ts index 80dd7560dc2..9b9545d81ce 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-detail/cephfs-detail.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-detail/cephfs-detail.component.ts @@ -33,7 +33,10 @@ export class CephfsDetailComponent implements OnChanges, OnInit { objectValues = Object.values; - constructor(private dimlessBinary: DimlessBinaryPipe, private dimless: DimlessPipe) {} + constructor( + private dimlessBinary: DimlessBinaryPipe, + private dimless: DimlessPipe + ) {} ngOnChanges() { this.setStandbys(); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-directories/cephfs-directories.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-directories/cephfs-directories.component.ts index 82d6bf2caad..c31e2af2a25 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-directories/cephfs-directories.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-directories/cephfs-directories.component.ts @@ -499,8 +499,8 @@ export class CephfsDirectoriesComponent implements OnInit, OnChanges { this.selectedDir.quotas[key] === 0 ? this.actionLabels.SET : values[key] === 0 - ? this.actionLabels.UNSET - : $localize`Updated`; + ? this.actionLabels.UNSET + : $localize`Updated`; this.cephfsService.quota(this.id, path, values).subscribe(() => { if (onSuccess) { onSuccess(); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-filesystem-selector/cephfs-filesystem-selector.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-filesystem-selector/cephfs-filesystem-selector.component.ts index d22fb82c2c3..54611bed9b0 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-filesystem-selector/cephfs-filesystem-selector.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-filesystem-selector/cephfs-filesystem-selector.component.ts @@ -82,9 +82,8 @@ export class CephfsFilesystemSelectorComponent implements OnInit { if (!listResponse?.length) { return of([]); } - const detailRequests = listResponse.map( - (fs): Observable => - this.cephfsService.getCephfs(fs.id).pipe(catchError(() => of(null))) + const detailRequests = listResponse.map((fs): Observable => + this.cephfsService.getCephfs(fs.id).pipe(catchError(() => of(null))) ); return forkJoin(detailRequests).pipe( map((details: Array) => diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-mirroring-wizard/cephfs-mirroring-wizard.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-mirroring-wizard/cephfs-mirroring-wizard.component.spec.ts index 67397af8de5..6406f138eff 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-mirroring-wizard/cephfs-mirroring-wizard.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-mirroring-wizard/cephfs-mirroring-wizard.component.spec.ts @@ -25,15 +25,15 @@ describe('CephfsMirroringWizardComponent', () => { ]; beforeEach(async () => { - wizardStepsService = ({ + wizardStepsService = { setTotalSteps: jest.fn(), setCurrentStep: jest.fn(), steps$: new BehaviorSubject(mockSteps) - } as unknown) as jest.Mocked; + } as unknown as jest.Mocked; - router = ({ + router = { navigate: jest.fn() - } as unknown) as jest.Mocked; + } as unknown as jest.Mocked; await TestBed.configureTestingModule({ imports: [ReactiveFormsModule, RadioModule], diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-snapshotschedule-form/cephfs-snapshotschedule-form.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-snapshotschedule-form/cephfs-snapshotschedule-form.component.ts index 91a6deb95d8..9f5951277a6 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-snapshotschedule-form/cephfs-snapshotschedule-form.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-snapshotschedule-form/cephfs-snapshotschedule-form.component.ts @@ -187,9 +187,10 @@ export class CephfsSnapshotscheduleFormComponent extends CdForm implements OnIni // retention policies schedule.retention && Object.entries(schedule.retention).forEach(([frequency, interval], idx) => { - const freqKey = Object.keys(RetentionFrequency)[ - Object.values(RetentionFrequency).indexOf(frequency as any) - ]; + const freqKey = + Object.keys(RetentionFrequency)[ + Object.values(RetentionFrequency).indexOf(frequency as any) + ]; this.retentionPolicies.push( new FormGroup({ retentionInterval: new FormControl(interval), @@ -284,9 +285,9 @@ export class CephfsSnapshotscheduleFormComponent extends CdForm implements OnIni const values = this.snapScheduleForm.value as SnapshotScheduleFormValue; if (this.isEdit) { - const retentionPoliciesToAdd = (this.snapScheduleForm.get( - 'retentionPolicies' - ) as FormArray).controls + const retentionPoliciesToAdd = ( + this.snapScheduleForm.get('retentionPolicies') as FormArray + ).controls ?.filter( (ctrl) => !ctrl.get('retentionInterval').disabled && !ctrl.get('retentionFrequency').disabled diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-snapshotschedule-list/cephfs-snapshotschedule-list.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-snapshotschedule-list/cephfs-snapshotschedule-list.component.ts index 6cb73db368e..e940ddf83bb 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-snapshotschedule-list/cephfs-snapshotschedule-list.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-snapshotschedule-list/cephfs-snapshotschedule-list.component.ts @@ -37,7 +37,8 @@ import { ModalCdsService } from '~/app/shared/services/modal-cds.service'; }) export class CephfsSnapshotscheduleListComponent extends CdForm - implements OnInit, OnChanges, OnDestroy { + implements OnInit, OnChanges, OnDestroy +{ @Input() fsName!: string; @Input() id!: number; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-subvolume-form/cephfs-subvolume-form.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-subvolume-form/cephfs-subvolume-form.component.ts index 813d64e5310..f1b5dd23c03 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-subvolume-form/cephfs-subvolume-form.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-subvolume-form/cephfs-subvolume-form.component.ts @@ -129,8 +129,9 @@ export class CephfsSubvolumeFormComponent extends CdForm implements OnInit { private isSnapshotVisibilityEnabled(option?: ConfigFormModel) { const values = option?.value ?? []; - const clientValue = values.find((entry) => entry.section === SNAPSHOT_VISIBILITY_CONFIG_SECTION) - ?.value; + const clientValue = values.find( + (entry) => entry.section === SNAPSHOT_VISIBILITY_CONFIG_SECTION + )?.value; return String(clientValue).toLowerCase() === 'true'; } diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/create-cluster/create-cluster.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/create-cluster/create-cluster.component.html index 224ecef3b4f..b0a47a83de1 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/create-cluster/create-cluster.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/create-cluster/create-cluster.component.html @@ -237,7 +237,6 @@
- } @else { { stepFixture.detectChanges(); const skipBtn = stepFixture.debugElement.query(By.css('#skipStepBtn')).nativeElement; expect(skipBtn).not.toBe(null); - expect(skipBtn.innerHTML).toBe('Skip'); + expect(skipBtn.textContent.trim()).toBe('Skip'); }); it('should skip the Create OSDs step', () => { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/crushmap/crushmap.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/crushmap/crushmap.component.spec.ts index a75b6766b0c..b18d10387fd 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/crushmap/crushmap.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/crushmap/crushmap.component.spec.ts @@ -34,7 +34,7 @@ describe('CrushmapComponent', () => { it('should display right title', () => { const span = debugElement.nativeElement.querySelector('.card-header'); - expect(span.textContent).toBe('CRUSH map viewer'); + expect(span.textContent.trim()).toBe('CRUSH map viewer'); }); it('should display "No nodes!" if ceph tree nodes is empty array', fakeAsync(() => { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/crushmap/crushmap.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/crushmap/crushmap.component.ts index 716576798ae..296806be5d9 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/crushmap/crushmap.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/crushmap/crushmap.component.ts @@ -52,7 +52,10 @@ export class CrushmapComponent implements OnDestroy, OnInit { metadataKeyMap: { [key: number]: any } = {}; data$: Observable; - constructor(private crushRuleService: CrushRuleService, private timerService: TimerService) {} + constructor( + private crushRuleService: CrushRuleService, + private timerService: TimerService + ) {} ngOnInit() { this.sub = this.timerService diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/host-details/host-details.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/host-details/host-details.component.ts index 9384acdca68..28a7602e133 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/host-details/host-details.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/host-details/host-details.component.ts @@ -19,7 +19,10 @@ export class HostDetailsComponent implements OnInit, OnDestroy { hostname = ''; sidebarItems: SidebarItem[] = []; - constructor(private route: ActivatedRoute, private authStorageService: AuthStorageService) {} + constructor( + private route: ActivatedRoute, + private authStorageService: AuthStorageService + ) {} ngOnInit(): void { const permissions = this.authStorageService.getPermissions(); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/multi-cluster/multi-cluster.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/multi-cluster/multi-cluster.component.ts index dcd232d9a7f..cb87db30c4b 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/multi-cluster/multi-cluster.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/multi-cluster/multi-cluster.component.ts @@ -446,9 +446,8 @@ export class MultiClusterComponent implements OnInit, OnDestroy { (errorEntry) => errorEntry.url === clusterDetails.url ); if (errorIndex !== -1) { - this.prometheusConnectionErrors[ - errorIndex - ].reconnectionError = reconnectionError; + this.prometheusConnectionErrors[errorIndex].reconnectionError = + reconnectionError; } }, next: (response: any) => { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-details/osd-details.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-details/osd-details.component.ts index 97ec8c7b3f4..a00b6898115 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-details/osd-details.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-details/osd-details.component.ts @@ -23,7 +23,10 @@ export class OsdDetailsComponent implements OnChanges { }; grafanaPermission: Permission; - constructor(private osdService: OsdService, private authStorageService: AuthStorageService) { + constructor( + private osdService: OsdService, + private authStorageService: AuthStorageService + ) { this.grafanaPermission = this.authStorageService.getPermissions().grafana; } diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.spec.ts index 21f3b36dea5..a021853e16c 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.spec.ts @@ -517,13 +517,7 @@ describe('OsdListComponent', () => { const expectOsdServiceMethodCalled = ( actionName: string, osdServiceMethodName: - | 'markOut' - | 'markIn' - | 'markDown' - | 'markLost' - | 'purge' - | 'destroy' - | 'delete' + 'markOut' | 'markIn' | 'markDown' | 'markLost' | 'purge' | 'destroy' | 'delete' ): void => { const osdServiceSpy = spyOn(osdService, osdServiceMethodName).and.callFake(() => EMPTY); openActionModal(actionName); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.ts index 1e213685305..7cdd9abb7b2 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.ts @@ -62,7 +62,8 @@ export class ServiceFormComponent extends CdForm implements OnInit { readonly SNMP_ENGINE_ID_PATTERN = /^[0-9A-Fa-f]{10,64}/g; readonly INGRESS_SUPPORTED_SERVICE_TYPES = ['rgw', 'nfs']; readonly SMB_CONFIG_URI_PATTERN = /^(http:|https:|rados:|rados:mon-config-key:)/; - readonly OAUTH2_ISSUER_URL_PATTERN = /^(https?:\/\/)?([a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)+)(:[0-9]{1,5})?(\/.*)?$/; + readonly OAUTH2_ISSUER_URL_PATTERN = + /^(https?:\/\/)?([a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)+)(:[0-9]{1,5})?(\/.*)?$/; readonly SSL_CIPHERS_PATTERN = /^[a-zA-Z0-9\-:]+$/; readonly DEFAULT_SSL_PROTOCOL_ITEM = [{ content: 'TLSv1.3', selected: true }]; @ViewChild(NgbTypeahead, { static: false }) diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/upgrade/upgrade.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/upgrade/upgrade.component.spec.ts index 89ba7e06187..e77e3b5d767 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/upgrade/upgrade.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/upgrade/upgrade.component.spec.ts @@ -116,9 +116,8 @@ describe('UpgradeComponent', () => { upgradeInfoSpy.and.returnValue(of(upgradeInfoPayload)); component.ngOnInit(); fixture.detectChanges(); - const noUpgradesSpan = fixture.debugElement.nativeElement.querySelector( - '#no-upgrades-available' - ); + const noUpgradesSpan = + fixture.debugElement.nativeElement.querySelector('#no-upgrades-available'); expect(noUpgradesSpan.textContent).toBe(' Cluster is up-to-date '); }); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard-v3/dashboard-pie/dashboard-pie.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard-v3/dashboard-pie/dashboard-pie.component.ts index 93f4fbb25a1..e8082ef1fdc 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard-v3/dashboard-pie/dashboard-pie.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard-v3/dashboard-pie/dashboard-pie.component.ts @@ -57,7 +57,10 @@ export class DashboardPieComponent implements OnChanges, OnInit { } ]; - constructor(private cssHelper: CssHelper, private dimlessBinary: DimlessBinaryPipe) { + constructor( + private cssHelper: CssHelper, + private dimlessBinary: DimlessBinaryPipe + ) { this.chartConfig = { chartType: 'doughnut', labels: [], diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.spec.ts index bb64ce3af95..e8a5ada4bfc 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.spec.ts @@ -222,8 +222,8 @@ describe('NfsFormComponent', () => { describe('pathExistence', () => { beforeEach(() => { - component['nfsService']['lsDir'] = jest.fn( - (): Observable => of({ paths: ['/path1'] }) + component['nfsService']['lsDir'] = jest.fn((): Observable => + of({ paths: ['/path1'] }) ); component.nfsForm.get('name').setValue('CEPH'); component.setPathValidation(); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.ts index b4cd2840fdc..5b214b873f9 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.ts @@ -498,8 +498,9 @@ export class NfsFormComponent extends CdForm implements OnInit { ) .subscribe({ error: (error) => { - const fsalDescr = this.nfsService.nfsFsal.find((f) => f.value === this.storageBackend) - .descr; + const fsalDescr = this.nfsService.nfsFsal.find( + (f) => f.value === this.storageBackend + ).descr; this.storageBackendError = $localize`${fsalDescr} backend is not available. ${error}`; } }); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/overview/alerts-card/overview-alerts-card.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/overview/alerts-card/overview-alerts-card.component.ts index 4200b2f2b2e..903044d9abd 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/overview/alerts-card/overview-alerts-card.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/overview/alerts-card/overview-alerts-card.component.ts @@ -72,8 +72,8 @@ export class OverviewAlertsCardComponent implements OnInit { const icon = !hasAlerts ? AlertIcon.success : hasCritical - ? AlertIcon.error - : AlertIcon.warning; + ? AlertIcon.error + : AlertIcon.warning; const statusText = hasAlerts ? $localize`Need attention` : $localize`No active alerts`; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/erasure-code-profile-form/erasure-code-profile-form-modal.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/erasure-code-profile-form/erasure-code-profile-form-modal.component.spec.ts index 3ed8e7df2bb..b4900c5080b 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/erasure-code-profile-form/erasure-code-profile-form-modal.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/erasure-code-profile-form/erasure-code-profile-form-modal.component.spec.ts @@ -69,20 +69,13 @@ describe('ErasureCodeProfileFormModalComponent', () => { */ nodes: [ // Root node - Mocks.getCrushNode('default', -1, 'root', 11, [ - -2, - -3, - -6, - -7, - -8, - -9, - -10, - -11, - -12, - -13, - -14, - -15 - ]), + Mocks.getCrushNode( + 'default', + -1, + 'root', + 11, + [-2, -3, -6, -7, -8, -9, -10, -11, -12, -13, -14, -15] + ), // SSD host Mocks.getCrushNode('ssd-host', -2, 'host', 1, [1, 0, 2]), Mocks.getCrushNode('osd.0', 0, 'osd', 0, undefined, 'ssd'), diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/erasure-code-profile-form/erasure-code-profile-form-modal.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/erasure-code-profile-form/erasure-code-profile-form-modal.component.ts index 73df23f78c4..448175b4553 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/erasure-code-profile-form/erasure-code-profile-form-modal.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/erasure-code-profile-form/erasure-code-profile-form-modal.component.ts @@ -30,7 +30,8 @@ import { TaskWrapperService } from '~/app/shared/services/task-wrapper.service'; }) export class ErasureCodeProfileFormModalComponent extends CrushNodeSelectionClass - implements OnInit { + implements OnInit +{ @ViewChild(FormGroupDirective) formDir: FormGroupDirective; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.spec.ts index af791f8c927..c6779becfb2 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.spec.ts @@ -1498,15 +1498,9 @@ describe('PoolFormComponent', () => { form.get(controlName).markAsPristine(); beforeEach(() => { - [ - 'algorithm', - 'maxBlobSize', - 'minBlobSize', - 'mode', - 'pgNum', - 'ratio', - 'name' - ].forEach((name) => markControlAsPreviouslySet(name)); + ['algorithm', 'maxBlobSize', 'minBlobSize', 'mode', 'pgNum', 'ratio', 'name'].forEach( + (name) => markControlAsPreviouslySet(name) + ); fixture.detectChanges(); }); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/bucket-tag-modal/bucket-tag-modal.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/bucket-tag-modal/bucket-tag-modal.component.ts index e888af4759e..74b9b17d7ee 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/bucket-tag-modal/bucket-tag-modal.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/bucket-tag-modal/bucket-tag-modal.component.ts @@ -22,7 +22,10 @@ export class BucketTagModalComponent extends BaseModal { currentKeyTags: string[]; storedKey: string; - constructor(private formBuilder: CdFormBuilder, public actionLabels: ActionLabelsI18n) { + constructor( + private formBuilder: CdFormBuilder, + public actionLabels: ActionLabelsI18n + ) { super(); this.createForm(); } diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/models/rgw-multisite-zonegroup-deletion-form/rgw-multisite-zonegroup-deletion-form.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/models/rgw-multisite-zonegroup-deletion-form/rgw-multisite-zonegroup-deletion-form.component.ts index ccb17bed8ac..76bd9db986f 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/models/rgw-multisite-zonegroup-deletion-form/rgw-multisite-zonegroup-deletion-form.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/models/rgw-multisite-zonegroup-deletion-form/rgw-multisite-zonegroup-deletion-form.component.ts @@ -19,7 +19,8 @@ import { NotificationService } from '~/app/shared/services/notification.service' }) export class RgwMultisiteZonegroupDeletionFormComponent extends CdForm - implements OnInit, AfterViewInit { + implements OnInit, AfterViewInit +{ zonegroupData$: any; poolList$: any; zonesPools: Array = []; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/models/rgw-storage-class.model.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/models/rgw-storage-class.model.ts index bb9cb0143e0..de216e293db 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/models/rgw-storage-class.model.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/models/rgw-storage-class.model.ts @@ -226,7 +226,7 @@ export const STORAGE_CLASS_CONSTANTS = { export const DEFAULT_PLACEMENT = 'default-placement'; -export type TIER_TYPE = typeof TIER_TYPE[keyof typeof TIER_TYPE]; +export type TIER_TYPE = (typeof TIER_TYPE)[keyof typeof TIER_TYPE]; export const TIER_TYPE_DISPLAY = { LOCAL: 'Local', diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-details/rgw-bucket-details.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-details/rgw-bucket-details.component.ts index a138b9d91a6..e8c04744be9 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-details/rgw-bucket-details.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-details/rgw-bucket-details.component.ts @@ -28,7 +28,10 @@ export class RgwBucketDetailsComponent implements OnChanges { replicationData: RgwBucketReplication; bucketRateLimit: RgwRateLimitConfig; - constructor(private rgwBucketService: RgwBucketService, private cd: ChangeDetectorRef) {} + constructor( + private rgwBucketService: RgwBucketService, + private cd: ChangeDetectorRef + ) {} ngOnChanges() { this.updateBucketDetails(this.extraxtDetailsfromResponse.bind(this)); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.spec.ts index 75a3e5d0dd6..ff9ed509c84 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.spec.ts @@ -93,9 +93,8 @@ describe('RgwBucketFormComponent', () => { expect(component.zonegroup).toBe(payload.zonegroup); const placementTargets = []; for (const placementTarget of payload['placement_targets']) { - placementTarget[ - 'description' - ] = `${placementTarget['name']} (pool: ${placementTarget['data_pool']})`; + placementTarget['description'] = + `${placementTarget['name']} (pool: ${placementTarget['data_pool']})`; placementTargets.push(placementTarget); } expect(component.placementTargets).toEqual(placementTargets); @@ -166,9 +165,8 @@ describe('RgwBucketFormComponent', () => { }); fixture.detectChanges(); fixture.whenStable().then(() => { - const mfaTokenSerial = fixture.debugElement.nativeElement.querySelector( - '#mfa-token-serial' - ); + const mfaTokenSerial = + fixture.debugElement.nativeElement.querySelector('#mfa-token-serial'); const mfaTokenPin = fixture.debugElement.nativeElement.querySelector('#mfa-token-pin'); if (expectedVisibility) { expect(mfaTokenSerial).toBeTruthy(); @@ -349,8 +347,9 @@ describe('RgwBucketFormComponent', () => { beforeEach(() => { component.loading = LoadingStatus.Ready; fixture.detectChanges(); - childComponent = fixture.debugElement.query(By.directive(RgwRateLimitComponent)) - .componentInstance; + childComponent = fixture.debugElement.query( + By.directive(RgwRateLimitComponent) + ).componentInstance; }); it('Scenario 1: tenanted owner with tenanted bucket name', () => { const rateLimitSpy = spyOn(rgwBucketService, 'updateBucketRateLimit').and.returnValue( diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-tiering-form/rgw-bucket-tiering-form.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-tiering-form/rgw-bucket-tiering-form.component.spec.ts index 6bfe176a6a0..dff6fccae34 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-tiering-form/rgw-bucket-tiering-form.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-tiering-form/rgw-bucket-tiering-form.component.spec.ts @@ -52,7 +52,7 @@ describe('RgwBucketTieringFormComponent', () => { fixture = TestBed.createComponent(RgwBucketTieringFormComponent); component = fixture.componentInstance; fixture.detectChanges(); - rgwBucketService = (TestBed.inject(RgwBucketService) as unknown) as MockRgwBucketService; + rgwBucketService = TestBed.inject(RgwBucketService) as unknown as MockRgwBucketService; }); it('should create', () => { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-multisite-import/rgw-multisite-import.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-multisite-import/rgw-multisite-import.component.ts index 20bc2a911b8..2714bf65942 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-multisite-import/rgw-multisite-import.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-multisite-import/rgw-multisite-import.component.ts @@ -23,7 +23,8 @@ import { debounceTime, distinctUntilChanged, filter, map } from 'rxjs/operators' }) export class RgwMultisiteImportComponent implements OnInit { readonly endpoints = /^((https?:\/\/)|(www.))(?:([a-zA-Z]+)|(\d+\.\d+.\d+.\d+)):\d{2,4}$/; - readonly ipv4Rgx = /^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/i; + readonly ipv4Rgx = + /^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/i; readonly ipv6Rgx = /^(?:[a-f0-9]{1,4}:){7}[a-f0-9]{1,4}$/i; @ViewChild(NgbTypeahead, { static: false }) typeahead: NgbTypeahead; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-multisite-sync-flow-modal/rgw-multisite-sync-flow-modal.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-multisite-sync-flow-modal/rgw-multisite-sync-flow-modal.component.spec.ts index a991659e347..0af104c85e4 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-multisite-sync-flow-modal/rgw-multisite-sync-flow-modal.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-multisite-sync-flow-modal/rgw-multisite-sync-flow-modal.component.spec.ts @@ -50,7 +50,7 @@ describe('RgwMultisiteSyncFlowModalComponent', () => { }).compileComponents(); fixture = TestBed.createComponent(RgwMultisiteSyncFlowModalComponent); - multisiteServiceMock = (TestBed.inject(RgwMultisiteService) as unknown) as MultisiteServiceMock; + multisiteServiceMock = TestBed.inject(RgwMultisiteService) as unknown as MultisiteServiceMock; component = fixture.componentInstance; component.groupType = FlowType.symmetrical; component.groupExpandedRow = { groupName: 'new', bucket: 'bucket1' }; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-multisite-sync-pipe-modal/rgw-multisite-sync-pipe-modal.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-multisite-sync-pipe-modal/rgw-multisite-sync-pipe-modal.component.spec.ts index 83ec05914f6..d0b244332a8 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-multisite-sync-pipe-modal/rgw-multisite-sync-pipe-modal.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-multisite-sync-pipe-modal/rgw-multisite-sync-pipe-modal.component.spec.ts @@ -52,7 +52,7 @@ describe('RgwMultisiteSyncPipeModalComponent', () => { }).compileComponents(); fixture = TestBed.createComponent(RgwMultisiteSyncPipeModalComponent); - multisiteServiceMock = (TestBed.inject(RgwMultisiteService) as unknown) as MultisiteServiceMock; + multisiteServiceMock = TestBed.inject(RgwMultisiteService) as unknown as MultisiteServiceMock; component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-multisite-wizard/rgw-multisite-wizard.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-multisite-wizard/rgw-multisite-wizard.component.ts index 44e1131746d..fd6ec99edd7 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-multisite-wizard/rgw-multisite-wizard.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-multisite-wizard/rgw-multisite-wizard.component.ts @@ -133,9 +133,10 @@ export class RgwMultisiteWizardComponent extends BaseModal implements OnInit { .flat() .filter((cluster) => cluster['url'] !== currentUrl); this.isMultiClusterConfigured = this.clusterDetailsArray.length > 0; - this.stepTitles = (this.isMultiClusterConfigured - ? STEP_TITLES_MULTI_CLUSTER_CONFIGURED - : STEP_TITLES_SINGLE_CLUSTER + this.stepTitles = ( + this.isMultiClusterConfigured + ? STEP_TITLES_MULTI_CLUSTER_CONFIGURED + : STEP_TITLES_SINGLE_CLUSTER ).map((label, index) => ({ label, onClick: () => (this.currentStep.stepIndex = index) diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-notification-form/rgw-notification-form.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-notification-form/rgw-notification-form.component.spec.ts index 9f16d6b40d2..aac07b9f0db 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-notification-form/rgw-notification-form.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-notification-form/rgw-notification-form.component.spec.ts @@ -58,7 +58,7 @@ describe('RgwNotificationFormComponent', () => { fixture = TestBed.createComponent(RgwNotificationFormComponent); component = fixture.componentInstance; - rgwBucketService = (TestBed.inject(RgwBucketService) as unknown) as MockRgwBucketService; + rgwBucketService = TestBed.inject(RgwBucketService) as unknown as MockRgwBucketService; fixture.detectChanges(); }); @@ -66,7 +66,7 @@ describe('RgwNotificationFormComponent', () => { expect(component).toBeTruthy(); }); it('should call setNotification when submitting form', () => { - rgwBucketService = (TestBed.inject(RgwBucketService) as unknown) as MockRgwBucketService; + rgwBucketService = TestBed.inject(RgwBucketService) as unknown as MockRgwBucketService; component['notificationList'] = []; component.notificationForm.patchValue({ id: 'notif-1', diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-overview-dashboard/rgw-overview-dashboard.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-overview-dashboard/rgw-overview-dashboard.component.spec.ts index 3fde88d9c12..7a7bd3d549b 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-overview-dashboard/rgw-overview-dashboard.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-overview-dashboard/rgw-overview-dashboard.component.spec.ts @@ -119,9 +119,8 @@ describe('RgwOverviewDashboardComponent', () => { }); it('should render all cards', () => { - const productiveCards = fixture.debugElement.nativeElement.querySelectorAll( - 'cd-productive-card' - ); + const productiveCards = + fixture.debugElement.nativeElement.querySelectorAll('cd-productive-card'); expect(productiveCards.length).toBe(3); }); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-topic-form/rgw-topic-form.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-topic-form/rgw-topic-form.component.ts index ae67b26770f..9b8c46ef2d5 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-topic-form/rgw-topic-form.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-topic-form/rgw-topic-form.component.ts @@ -309,7 +309,7 @@ export class RgwTopicFormComponent extends CdForm implements OnInit, AfterViewCh const defaults: typeof this.topicForm.value = _.clone(this.topicForm.value); const keys = Object.keys(this.topicForm.value) as (keyof typeof topic)[]; - let value: Pick = _.pick(topic, keys); + let value: Pick = _.pick(topic, keys); value = _.merge(defaults, value); if (!this.owners.includes(value['owner'])) { @@ -371,8 +371,8 @@ export class RgwTopicFormComponent extends CdForm implements OnInit, AfterViewCh urlObj.protocol === UrlProtocol.HTTPS ? URLPort.HTTPS : urlObj.protocol === UrlProtocol.HTTP - ? URLPort.HTTP - : ''; + ? URLPort.HTTP + : ''; } return port; } diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-accounts-form/rgw-user-accounts-form.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-accounts-form/rgw-user-accounts-form.component.spec.ts index c138789b473..73031ea9518 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-accounts-form/rgw-user-accounts-form.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-accounts-form/rgw-user-accounts-form.component.spec.ts @@ -41,9 +41,9 @@ describe('RgwUserAccountsFormComponent', () => { }).compileComponents(); fixture = TestBed.createComponent(RgwUserAccountsFormComponent); - rgwUserAccountsService = (TestBed.inject( + rgwUserAccountsService = TestBed.inject( RgwUserAccountsService - ) as unknown) as MockRgwUserAccountsService; + ) as unknown as MockRgwUserAccountsService; component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-capability-modal/rgw-user-capability-modal.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-capability-modal/rgw-user-capability-modal.component.ts index 438e4af2f5a..23a1adb5053 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-capability-modal/rgw-user-capability-modal.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-capability-modal/rgw-user-capability-modal.component.ts @@ -30,7 +30,10 @@ export class RgwUserCapabilityModalComponent extends BaseModal { resource: string; action: string; - constructor(private formBuilder: CdFormBuilder, public actionLabels: ActionLabelsI18n) { + constructor( + private formBuilder: CdFormBuilder, + public actionLabels: ActionLabelsI18n + ) { super(); this.resource = $localize`capability`; this.createForm(); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-details/rgw-user-details.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-details/rgw-user-details.component.spec.ts index 4267f6c03b6..d26a67e42a5 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-details/rgw-user-details.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-details/rgw-user-details.component.spec.ts @@ -39,14 +39,14 @@ describe('RgwUserDetailsComponent', () => { const detailsTab = fixture.debugElement.nativeElement.querySelectorAll( '.cds--data-table--sort.cds--data-table--no-border tr td' ); - expect(detailsTab[10].textContent).toEqual('System user'); - expect(detailsTab[11].textContent).toEqual('Yes'); + expect(detailsTab[10].textContent.trim()).toEqual('System user'); + expect(detailsTab[11].textContent.trim()).toEqual('Yes'); component.selection.system = false; component.ngOnChanges(); fixture.detectChanges(); - expect(detailsTab[11].textContent).toEqual('No'); + expect(detailsTab[11].textContent.trim()).toEqual('No'); }); it('should show mfa ids only if length > 0', () => { @@ -67,8 +67,8 @@ describe('RgwUserDetailsComponent', () => { const detailsTab = fixture.debugElement.nativeElement.querySelectorAll( '.cds--data-table--sort.cds--data-table--no-border tr td' ); - expect(detailsTab[16].textContent).toEqual('MFAs(Id)'); - expect(detailsTab[17].textContent).toEqual('testMFA1, testMFA2'); + expect(detailsTab[16].textContent.trim()).toEqual('MFAs(Id)'); + expect(detailsTab[17].textContent.trim()).toEqual('testMFA1, testMFA2'); }); it('should test updateKeysSelection', () => { component.selection = { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-details/rgw-user-details.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-details/rgw-user-details.component.ts index 959b4cea865..4932911ca61 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-details/rgw-user-details.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-details/rgw-user-details.component.ts @@ -44,7 +44,10 @@ export class RgwUserDetailsComponent implements OnChanges, OnInit { icons = Icons; - constructor(private rgwUserService: RgwUserService, private cdsModalService: ModalCdsService) {} + constructor( + private rgwUserService: RgwUserService, + private cdsModalService: ModalCdsService + ) {} ngOnInit() { this.keysColumns = [ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-form/rgw-user-form.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-form/rgw-user-form.component.spec.ts index b93adfae175..ca0f88cbcd4 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-form/rgw-user-form.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-form/rgw-user-form.component.spec.ts @@ -213,8 +213,9 @@ describe('RgwUserFormComponent', () => { beforeEach(() => { component.loading = LoadingStatus.Ready; fixture.detectChanges(); - childComponent = fixture.debugElement.query(By.directive(RgwRateLimitComponent)) - .componentInstance; + childComponent = fixture.debugElement.query( + By.directive(RgwRateLimitComponent) + ).componentInstance; }); it('disable creation (create)', () => { spyOn(rgwUserService, 'create'); @@ -334,8 +335,9 @@ describe('RgwUserFormComponent', () => { notificationService = TestBed.inject(NotificationService); spyOn(notificationService, 'show'); fixture.detectChanges(); - let childComponent = fixture.debugElement.query(By.directive(RgwRateLimitComponent)) - .componentInstance; + let childComponent = fixture.debugElement.query( + By.directive(RgwRateLimitComponent) + ).componentInstance; jest.spyOn(childComponent, 'getRateLimitFormValue'); }); @@ -706,8 +708,9 @@ describe('RgwUserFormComponent', () => { beforeEach(() => { component.loading = LoadingStatus.Ready; fixture.detectChanges(); - childComponent = fixture.debugElement.query(By.directive(RgwRateLimitComponent)) - .componentInstance; + childComponent = fixture.debugElement.query( + By.directive(RgwRateLimitComponent) + ).componentInstance; }); it('create with account id & account root user', () => { spyOn(rgwUserService, 'create'); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-s3-key-modal/rgw-user-s3-key-modal.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-s3-key-modal/rgw-user-s3-key-modal.component.ts index 95bb177e2fe..02bc25fb454 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-s3-key-modal/rgw-user-s3-key-modal.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-s3-key-modal/rgw-user-s3-key-modal.component.ts @@ -29,7 +29,10 @@ export class RgwUserS3KeyModalComponent extends BaseModal { resource: string; action: string; - constructor(private formBuilder: CdFormBuilder, public actionLabels: ActionLabelsI18n) { + constructor( + private formBuilder: CdFormBuilder, + public actionLabels: ActionLabelsI18n + ) { super(); this.resource = $localize`S3 Key`; this.createForm(); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-subuser-modal/rgw-user-subuser-modal.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-subuser-modal/rgw-user-subuser-modal.component.ts index 9ea8603681e..4280df80e4b 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-subuser-modal/rgw-user-subuser-modal.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-subuser-modal/rgw-user-subuser-modal.component.ts @@ -30,7 +30,10 @@ export class RgwUserSubuserModalComponent extends BaseModal { resource: string; action: string; - constructor(private formBuilder: CdFormBuilder, private actionLabels: ActionLabelsI18n) { + constructor( + private formBuilder: CdFormBuilder, + private actionLabels: ActionLabelsI18n + ) { super(); this.resource = $localize`Subuser`; this.createForm(); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/shared/smart-list/smart-list.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/shared/smart-list/smart-list.component.ts index 66ee5d61b34..63b6ad26906 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/shared/smart-list/smart-list.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/shared/smart-list/smart-list.component.ts @@ -41,7 +41,10 @@ export class SmartListComponent implements OnInit, OnChanges { isEmpty = _.isEmpty; - constructor(private osdService: OsdService, private hostService: HostService) {} + constructor( + private osdService: OsdService, + private hostService: HostService + ) {} isSmartError(data: any): data is SmartError { return _.get(data, 'error') !== undefined; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb.model.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb.model.ts index 25c09205efe..0a0e7055864 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb.model.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb.model.ts @@ -4,7 +4,7 @@ import { USER } from '~/app/shared/constants/app.constants'; export interface SMBCluster { resource_type: typeof CLUSTER_RESOURCE; cluster_id: string; - auth_mode: typeof AUTHMODE[keyof typeof AUTHMODE]; + auth_mode: (typeof AUTHMODE)[keyof typeof AUTHMODE]; domain_settings?: DomainSettings; user_group_settings?: JoinSource[]; custom_dns?: string[]; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/login-password-form/login-password-form.component.html b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/login-password-form/login-password-form.component.html index bcc66f68433..9fe7ad723a6 100755 --- a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/login-password-form/login-password-form.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/login-password-form/login-password-form.component.html @@ -22,6 +22,8 @@ class="btn btn-outline-light btn-password" cdPasswordButton="oldpassword" type="button" + aria-label="Toggle visibility" + i18n-aria-label >
@@ -97,6 +101,8 @@ class="btn btn-outline-light btn-password" cdPasswordButton="confirmnewpassword" type="button" + aria-label="Toggle visibility" + i18n-aria-label >
this.userForm.getValue('username'), (_valid: boolean, credits: number, valuation: string) => { - this.passwordStrengthLevelClass = this.passwordPolicyService.mapCreditsToCssClass( - credits - ); + this.passwordStrengthLevelClass = + this.passwordPolicyService.mapCreditsToCssClass(credits); this.passwordValuation = _.defaultTo(valuation, ''); } ) diff --git a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-password-form/user-password-form.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-password-form/user-password-form.component.ts index 9b07dbaada2..22b4cc41e90 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-password-form/user-password-form.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-password-form/user-password-form.component.ts @@ -88,9 +88,8 @@ export class UserPasswordFormComponent { * These values are not needed in this component after carbonization. * @TODO: Need to remove once the LoginPasswordFormComponent is carbonized. */ - this.passwordStrengthLevelClass = this.passwordPolicyService.mapCreditsToCssClass( - credits - ); + this.passwordStrengthLevelClass = + this.passwordPolicyService.mapCreditsToCssClass(credits); this.passwordValuation = _.defaultTo(valuation, ''); this.INVALID_TEXTS['passwordPolicy'] = _.defaultTo(valuation, ''); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/core/layouts/workbench-layout/workbench-layout.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/core/layouts/workbench-layout/workbench-layout.component.ts index d7983d6247f..496c4b1e15d 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/core/layouts/workbench-layout/workbench-layout.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/core/layouts/workbench-layout/workbench-layout.component.ts @@ -91,8 +91,7 @@ export class WorkbenchLayoutComponent implements OnInit, OnDestroy { route = route.firstChild; } const pageHeader = route?.routeConfig?.data?.['pageHeader'] as - | { title?: string; description?: string } - | undefined; + { title?: string; description?: string } | undefined; this.pageHeaderTitle = pageHeader?.title ?? null; this.pageHeaderDescription = pageHeader?.description ?? null; } diff --git a/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/dashboard-help/dashboard-help.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/dashboard-help/dashboard-help.component.ts index 11c6c938c5e..6a85bb4564e 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/dashboard-help/dashboard-help.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/dashboard-help/dashboard-help.component.ts @@ -17,7 +17,10 @@ export class DashboardHelpComponent implements OnInit { docsUrl: string; icons = Icons; - constructor(private docService: DocService, private modalCdsService: ModalCdsService) {} + constructor( + private docService: DocService, + private modalCdsService: ModalCdsService + ) {} ngOnInit() { this.docService.subscribeOnce('dashboard', (url: string) => { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/identity/identity.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/identity/identity.component.ts index 8f3f452ad5f..3eff23b1898 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/identity/identity.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/identity/identity.component.ts @@ -15,7 +15,10 @@ export class IdentityComponent implements OnInit { username: string; icons = Icons; - constructor(private authStorageService: AuthStorageService, private authService: AuthService) {} + constructor( + private authStorageService: AuthStorageService, + private authService: AuthService + ) {} ngOnInit() { this.username = this.authStorageService.getUsername(); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/host.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/host.service.ts index b9233e0a461..57a10ba7296 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/host.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/host.service.ts @@ -25,7 +25,10 @@ export class HostService extends ApiClient { predefinedLabels = ['mon', 'mgr', 'osd', 'mds', 'rgw', 'nfs', 'iscsi', 'rbd', 'grafana']; - constructor(private http: HttpClient, private deviceService: DeviceService) { + constructor( + private http: HttpClient, + private deviceService: DeviceService + ) { super(); } diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/osd.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/osd.service.ts index 85a75073dea..d21bf139521 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/osd.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/osd.service.ts @@ -72,7 +72,10 @@ export class OsdService { ] }; - constructor(private http: HttpClient, private deviceService: DeviceService) {} + constructor( + private http: HttpClient, + private deviceService: DeviceService + ) {} create(driveGroups: Object[], trackingId: string, method = 'drive_groups') { const request = { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/pool.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/pool.service.ts index 44616cdb3e6..29b6898c0db 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/pool.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/pool.service.ts @@ -29,7 +29,10 @@ export class PoolService { } }; - constructor(private http: HttpClient, private rbdConfigurationService: RbdConfigurationService) {} + constructor( + private http: HttpClient, + private rbdConfigurationService: RbdConfigurationService + ) {} create(pool: any) { return this.http.post(this.apiPath, pool, { observe: 'response' }); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rbd-mirroring.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rbd-mirroring.service.ts index 9dc574e4875..53ae0656e9b 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rbd-mirroring.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rbd-mirroring.service.ts @@ -19,7 +19,10 @@ export class RbdMirroringService { // Observable streams summaryData$ = this.summaryDataSource.asObservable(); - constructor(private http: HttpClient, private timerService: TimerService) {} + constructor( + private http: HttpClient, + private timerService: TimerService + ) {} startPolling(): Subscription { return this.timerService diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rbd.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rbd.service.ts index 0ffa8fcff1c..848e7d2048c 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rbd.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rbd.service.ts @@ -15,7 +15,10 @@ import { RbdPool } from './rbd.model'; providedIn: 'root' }) export class RbdService extends ApiClient { - constructor(private http: HttpClient, private rbdConfigurationService: RbdConfigurationService) { + constructor( + private http: HttpClient, + private rbdConfigurationService: RbdConfigurationService + ) { super(); } diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-bucket.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-bucket.service.ts index cb7f7023d39..e702717a4b9 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-bucket.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-bucket.service.ts @@ -27,7 +27,10 @@ export class RgwBucketService extends ApiClient { totalUsedCapacity$ = this.totalUsedCapacitySubject.asObservable(); averageObjectSize$ = this.averageObjectSizeSubject.asObservable(); - constructor(private http: HttpClient, private rgwDaemonService: RgwDaemonService) { + constructor( + private http: HttpClient, + private rgwDaemonService: RgwDaemonService + ) { super(); } diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-realm.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-realm.service.ts index b2e0f1afe2a..aa1bb812c9a 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-realm.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-realm.service.ts @@ -11,7 +11,10 @@ import { RgwDaemonService } from './rgw-daemon.service'; export class RgwRealmService { private url = 'api/rgw/realm'; - constructor(private http: HttpClient, public rgwDaemonService: RgwDaemonService) {} + constructor( + private http: HttpClient, + public rgwDaemonService: RgwDaemonService + ) {} create(realm: RgwRealm, defaultRealm: boolean) { let requestBody = { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-site.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-site.service.ts index 49589c83f4e..18b71dfecd9 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-site.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-site.service.ts @@ -15,7 +15,10 @@ import { cdEncode } from '~/app/shared/decorators/cd-encode'; export class RgwSiteService { private url = 'api/rgw/site'; - constructor(private http: HttpClient, private rgwDaemonService: RgwDaemonService) {} + constructor( + private http: HttpClient, + private rgwDaemonService: RgwDaemonService + ) {} get(query?: string) { return this.rgwDaemonService.request((params: HttpParams) => { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-topic.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-topic.service.ts index 6dcc48882f4..23a62a5844a 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-topic.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-topic.service.ts @@ -13,7 +13,10 @@ import { RgwDaemonService } from './rgw-daemon.service'; export class RgwTopicService extends ApiClient { baseURL = 'api/rgw/topic'; - constructor(private http: HttpClient, private rgwDaemonService: RgwDaemonService) { + constructor( + private http: HttpClient, + private rgwDaemonService: RgwDaemonService + ) { super(); } diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-user-accounts.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-user-accounts.service.ts index 4c53a46c054..209be1aa9d1 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-user-accounts.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-user-accounts.service.ts @@ -10,7 +10,10 @@ import { Account } from '~/app/ceph/rgw/models/rgw-user-accounts'; export class RgwUserAccountsService { private url = 'api/rgw/accounts'; - constructor(private http: HttpClient, private rgwDaemonService: RgwDaemonService) {} + constructor( + private http: HttpClient, + private rgwDaemonService: RgwDaemonService + ) {} list(detailed?: boolean): Observable { return this.rgwDaemonService.request((params: HttpParams) => { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-user.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-user.service.ts index 118467619de..aaa0b70e4b1 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-user.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-user.service.ts @@ -16,7 +16,10 @@ import { cdEncode } from '~/app/shared/decorators/cd-encode'; export class RgwUserService { private url = 'api/rgw/user'; - constructor(private http: HttpClient, private rgwDaemonService: RgwDaemonService) {} + constructor( + private http: HttpClient, + private rgwDaemonService: RgwDaemonService + ) {} /** * Get the list of users. diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/smb.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/smb.service.ts index 2b984f4a5c4..854c5e6fc70 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/smb.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/smb.service.ts @@ -28,7 +28,10 @@ export class SmbService { modalData$ = this.modalDataSubject.asObservable(); dataUploader = signal(null); - constructor(private http: HttpClient, private notificationService: NotificationService) {} + constructor( + private http: HttpClient, + private notificationService: NotificationService + ) {} passData(data: DomainSettings) { this.modalDataSubject.next(data); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/config-option/config-option.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/config-option/config-option.component.spec.ts index 200a2761567..b57df61273c 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/config-option/config-option.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/config-option/config-option.component.spec.ts @@ -51,8 +51,7 @@ describe('ConfigOptionComponent', () => { name: 'osd_debug_deep_scrub_sleep', type: 'float', level: 'dev', - desc: - 'Inject an expensive sleep during deep scrub IO to make it easier to induce preemption', + desc: 'Inject an expensive sleep during deep scrub IO to make it easier to induce preemption', long_desc: '', default: 0, daemon_default: '', diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/delete-confirmation-modal/delete-confirmation-modal.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/delete-confirmation-modal/delete-confirmation-modal.component.spec.ts index a3c5c97d5ab..0ed00099349 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/delete-confirmation-modal/delete-confirmation-modal.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/delete-confirmation-modal/delete-confirmation-modal.component.spec.ts @@ -18,7 +18,11 @@ export class MockModule {} @Component({ template: ` - - `, diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/cd-validators.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/cd-validators.ts index 288151c24fa..beb3ad0cfd1 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/cd-validators.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/cd-validators.ts @@ -312,18 +312,22 @@ export class CdValidators { ) { conditionalValidators = conditionalValidators.concat(permanentValidators); - formControl.setValidators((control: AbstractControl): { - [key: string]: any; - } => { - const value = condition.call(this); - if (value) { - return Validators.compose(conditionalValidators)(control); - } - if (permanentValidators.length > 0) { - return Validators.compose(permanentValidators)(control); + formControl.setValidators( + ( + control: AbstractControl + ): { + [key: string]: any; + } => { + const value = condition.call(this); + if (value) { + return Validators.compose(conditionalValidators)(control); + } + if (permanentValidators.length > 0) { + return Validators.compose(permanentValidators)(control); + } + return null; } - return null; - }); + ); watchControls.forEach((control: AbstractControl) => { control.valueChanges.subscribe(() => { @@ -566,7 +570,8 @@ export class CdValidators { let errorName: string; // - Bucket names cannot be formatted as IP address. constraints.push(() => { - const ipv4Rgx = /^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/i; + const ipv4Rgx = + /^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/i; const ipv6Rgx = /^(?:[a-f0-9]{1,4}:){7}[a-f0-9]{1,4}$/i; const name = control.value; let notIP = true; @@ -707,7 +712,8 @@ export class CdValidators { static oauthAddressTest(): ValidatorFn { // Pattern matches: IPv4 addresses or hostnames (with or without dots, like 'localhost') - const OAUTH2_HTTPS_ADDRESS_PATTERN = /^((\d{1,3}\.){3}\d{1,3}|([a-zA-Z0-9-_]+\.)*[a-zA-Z0-9-_]+)$/; + const OAUTH2_HTTPS_ADDRESS_PATTERN = + /^((\d{1,3}\.){3}\d{1,3}|([a-zA-Z0-9-_]+\.)*[a-zA-Z0-9-_]+)$/; return (control: AbstractControl): Record | null => { if (!control.value) { return null; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/formly-array-type/formly-array-type.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/formly-array-type/formly-array-type.component.spec.ts index 25825697672..452d08b6003 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/formly-array-type/formly-array-type.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/formly-array-type/formly-array-type.component.spec.ts @@ -8,7 +8,12 @@ import { configureTestBed } from '~/testing/unit-test-helper'; @Component({ template: `
- +
` }) class MockFormComponent { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/formly-input-type/formly-input-type.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/formly-input-type/formly-input-type.component.spec.ts index 0818807d08c..3f7299177ee 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/formly-input-type/formly-input-type.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/formly-input-type/formly-input-type.component.spec.ts @@ -8,7 +8,12 @@ import { configureTestBed } from '~/testing/unit-test-helper'; @Component({ template: `
- +
` }) class MockFormComponent { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/formly-input-wrapper/formly-input-wrapper.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/formly-input-wrapper/formly-input-wrapper.component.spec.ts index 52358d66002..c806eec8319 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/formly-input-wrapper/formly-input-wrapper.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/formly-input-wrapper/formly-input-wrapper.component.spec.ts @@ -8,7 +8,12 @@ import { configureTestBed } from '~/testing/unit-test-helper'; @Component({ template: `
- +
` }) class MockFormComponent { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/formly-object-type/formly-object-type.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/formly-object-type/formly-object-type.component.spec.ts index 37756ad52ff..fbe7abc7a5a 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/formly-object-type/formly-object-type.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/formly-object-type/formly-object-type.component.spec.ts @@ -8,7 +8,12 @@ import { configureTestBed } from '~/testing/unit-test-helper'; @Component({ template: `
- +
` }) class MockFormComponent { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/formly-textarea-type/formly-textarea-type.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/formly-textarea-type/formly-textarea-type.component.spec.ts index 11eaa20755c..bd721e4eed2 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/formly-textarea-type/formly-textarea-type.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/formly-textarea-type/formly-textarea-type.component.spec.ts @@ -8,7 +8,12 @@ import { configureTestBed } from '~/testing/unit-test-helper'; @Component({ template: `
- +
` }) class MockFormComponent { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/models/image-spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/models/image-spec.ts index c6260011a9f..b4a64c03a84 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/models/image-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/models/image-spec.ts @@ -9,7 +9,11 @@ export class ImageSpec { return new this(poolName, namespace, imageName); } - constructor(public poolName: string, public namespace: string, public imageName: string) {} + constructor( + public poolName: string, + public namespace: string, + public imageName: string + ) {} private getNameSpace() { return this.namespace ? `${this.namespace}/` : ''; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/models/nvmeof.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/models/nvmeof.ts index 912cd4d3cbe..3316570ebd3 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/models/nvmeof.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/models/nvmeof.ts @@ -156,8 +156,7 @@ export enum RbdImageCreation { } export type NvmeofNamespaceListResponse = - | NvmeofSubsystemNamespace[] - | { namespaces: NvmeofSubsystemNamespace[] }; + NvmeofSubsystemNamespace[] | { namespaces: NvmeofSubsystemNamespace[] }; export type NvmeofInitiatorCandidate = { content: string; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/models/overview.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/models/overview.ts index dfab93e2199..a35b972971c 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/models/overview.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/models/overview.ts @@ -10,11 +10,11 @@ type ResileincyHealthType = { severity: ResiliencyState; }; -type ResiliencyState = typeof DATA_RESILIENCY_STATE[keyof typeof DATA_RESILIENCY_STATE]; +type ResiliencyState = (typeof DATA_RESILIENCY_STATE)[keyof typeof DATA_RESILIENCY_STATE]; -type PG_STATES = typeof PG_STATES[number]; +type PG_STATES = (typeof PG_STATES)[number]; -type SCRUBBING_STATES = typeof SCRUBBING_STATES[number]; +type SCRUBBING_STATES = (typeof SCRUBBING_STATES)[number]; export type TrendPoint = { timestamp: Date; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/ordinal.pipe.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/ordinal.pipe.ts index 82aecc98445..5006ab5ce0b 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/ordinal.pipe.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/ordinal.pipe.ts @@ -15,12 +15,12 @@ export class OrdinalPipe implements PipeTransform { (Math.floor(num / 10) === 1 ? 'th' : num % 10 === 1 - ? 'st' - : num % 10 === 2 - ? 'nd' - : num % 10 === 3 - ? 'rd' - : 'th') + ? 'st' + : num % 10 === 2 + ? 'nd' + : num % 10 === 3 + ? 'rd' + : 'th') ); } } diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/api-interceptor.service.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/api-interceptor.service.spec.ts index 03dd0decdda..07bcb2bf315 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/api-interceptor.service.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/api-interceptor.service.spec.ts @@ -221,7 +221,7 @@ describe('ApiInterceptorService', () => { it('should use different application icon (default Ceph) in error message', fakeAsync(() => { const msg = 'Cannot connect to Alertmanager'; httpError(undefined, { status: 500 }, (resp) => { - (resp.application = 'Prometheus'), (resp.message = msg); + ((resp.application = 'Prometheus'), (resp.message = msg)); }); expectSaveToHaveBeenCalled(true); flush(); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/auth-guard.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/auth-guard.service.ts index 1f1c3adf2bb..b2d89969e7c 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/auth-guard.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/auth-guard.service.ts @@ -7,7 +7,10 @@ import { AuthStorageService } from './auth-storage.service'; providedIn: 'root' }) export class AuthGuardService { - constructor(private router: Router, private authStorageService: AuthStorageService) {} + constructor( + private router: Router, + private authStorageService: AuthStorageService + ) {} canActivate(_route: ActivatedRouteSnapshot, state: RouterStateSnapshot) { if (this.authStorageService.isLoggedIn()) { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/change-password-guard.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/change-password-guard.service.ts index 662ecaa6361..4e27e104d3e 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/change-password-guard.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/change-password-guard.service.ts @@ -11,7 +11,10 @@ import { AuthStorageService } from './auth-storage.service'; providedIn: 'root' }) export class ChangePasswordGuardService { - constructor(private router: Router, private authStorageService: AuthStorageService) {} + constructor( + private router: Router, + private authStorageService: AuthStorageService + ) {} canActivate(_route: ActivatedRouteSnapshot, state: RouterStateSnapshot) { // Redirect to '/login-change-password' when the following constraints diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/data-gateway.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/data-gateway.service.ts index bc84f002e4d..08bf481502d 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/data-gateway.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/data-gateway.service.ts @@ -13,7 +13,10 @@ export class DataGatewayService { cache: { [keys: string]: Observable } = {}; selected: any; - constructor(private http: HttpClient, private crudFormAdapater: CrudFormAdapterService) {} + constructor( + private http: HttpClient, + private crudFormAdapater: CrudFormAdapterService + ) {} list(dataPath: string): Observable { const cacheable = this.getCacheable(dataPath, 'get'); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/feature-toggles.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/feature-toggles.service.ts index bb7f2a0d614..476ef420e11 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/feature-toggles.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/feature-toggles.service.ts @@ -24,7 +24,10 @@ export class FeatureTogglesService { readonly REFRESH_INTERVAL: number = 30000; private featureToggleMap$: FeatureTogglesMap$; - constructor(private http: HttpClient, private timerService: TimerService) { + constructor( + private http: HttpClient, + private timerService: TimerService + ) { this.featureToggleMap$ = this.timerService.get( () => this.http.get(this.API_URL), this.REFRESH_INTERVAL diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/js-error-handler.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/js-error-handler.service.ts index de42d005e08..f6c21378a99 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/js-error-handler.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/js-error-handler.service.ts @@ -6,7 +6,10 @@ import { LoggingService } from '../api/logging.service'; @Injectable() export class JsErrorHandler implements ErrorHandler { - constructor(private injector: Injector, private router: Router) {} + constructor( + private injector: Injector, + private router: Router + ) {} handleError(error: any) { const loggingService = this.injector.get(LoggingService); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/language.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/language.service.ts index d2705ee3604..87329e14ecc 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/language.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/language.service.ts @@ -7,7 +7,10 @@ import { environment } from '~/environments/environment'; providedIn: 'root' }) export class LanguageService { - constructor(private http: HttpClient, @Inject(LOCALE_ID) protected localeId: string) {} + constructor( + private http: HttpClient, + @Inject(LOCALE_ID) protected localeId: string + ) {} getLocale(): string { return this.localeId || environment.default_lang; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/ngzone-scheduler.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/ngzone-scheduler.service.ts index a2c6b6c95d5..efeeab6346d 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/ngzone-scheduler.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/ngzone-scheduler.service.ts @@ -44,5 +44,8 @@ export class EnterNgZoneScheduler extends NgZoneScheduler { providedIn: 'root' }) export class NgZoneSchedulerService { - constructor(public leave: LeaveNgZoneScheduler, public enter: EnterNgZoneScheduler) {} + constructor( + public leave: LeaveNgZoneScheduler, + public enter: EnterNgZoneScheduler + ) {} } diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/summary.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/summary.service.ts index f8282ae9758..a724d781e7b 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/summary.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/summary.service.ts @@ -19,7 +19,10 @@ export class SummaryService { // Observable streams summaryData$ = this.summaryDataSource.asObservable(); - constructor(private http: HttpClient, private timerService: TimerService) {} + constructor( + private http: HttpClient, + private timerService: TimerService + ) {} startPolling(): Subscription { return this.timerService diff --git a/src/pybind/mgr/dashboard/frontend/src/styles/_carbon-defaults.scss b/src/pybind/mgr/dashboard/frontend/src/styles/_carbon-defaults.scss index 7d920f0c66a..398684d12a4 100644 --- a/src/pybind/mgr/dashboard/frontend/src/styles/_carbon-defaults.scss +++ b/src/pybind/mgr/dashboard/frontend/src/styles/_carbon-defaults.scss @@ -1,7 +1,7 @@ @use '@carbon/styles/scss/config' with ( $font-path: '~@ibm/plex', $flex-grid-columns: 16, - $use-flexbox-grid: true, + $use-flexbox-grid: true ); @use '@carbon/layout'; @use '@carbon/colors'; @@ -11,8 +11,8 @@ @use '@carbon/styles/scss/themes'; @use '@carbon/styles/scss/theme' with ( $theme: default.$theme, - $fallback: compat.$g90, - ); + $fallback: compat.$g90 +); /****************************************** Component token overrides should go here