From 2b4e6288c2bd921debfaa38458414b6faa812d90 Mon Sep 17 00:00:00 2001 From: Tatjana Dehler Date: Fri, 30 Oct 2020 12:39:32 +0100 Subject: [PATCH] mgr/dashboard: add form button panel Fixes: https://tracker.ceph.com/issues/48016 Signed-off-by: Tatjana Dehler --- .../cypress/integration/block/images.po.ts | 10 ++-- .../integration/cluster/configuration.po.ts | 4 +- .../cypress/integration/ui/role-mgmt.po.ts | 4 +- .../cypress/integration/ui/user-mgmt.po.ts | 4 +- ...scsi-target-discovery-modal.component.html | 12 ++-- .../iscsi-target-discovery-modal.component.ts | 2 + .../iscsi-target-form.component.html | 10 ++-- ...target-image-settings-modal.component.html | 10 +--- ...i-target-image-settings-modal.component.ts | 7 ++- ...i-target-iqn-settings-modal.component.html | 10 +--- ...csi-target-iqn-settings-modal.component.ts | 7 ++- .../bootstrap-import-modal.component.html | 10 +--- .../bootstrap-import-modal.component.ts | 2 + .../edit-site-name-modal.component.html | 10 +--- .../edit-site-name-modal.component.ts | 2 + .../pool-edit-mode-modal.component.html | 10 +--- .../pool-edit-mode-modal.component.ts | 2 + .../pool-edit-peer-modal.component.html | 10 +--- .../pool-edit-peer-modal.component.ts | 2 + .../block/rbd-form/rbd-form.component.html | 10 ++-- .../rbd-namespace-form-modal.component.html | 10 +--- .../rbd-namespace-form-modal.component.ts | 2 + .../rbd-snapshot-form-modal.component.html | 11 +--- .../rbd-trash-move-modal.component.html | 10 +--- .../rbd-trash-move-modal.component.ts | 2 + .../rbd-trash-purge-modal.component.html | 11 +--- .../rbd-trash-purge-modal.component.ts | 2 + .../rbd-trash-restore-modal.component.html | 10 +--- .../rbd-trash-restore-modal.component.ts | 2 + .../configuration-form.component.html | 11 ++-- .../configuration-form.component.ts | 2 + .../hosts/host-form/host-form.component.html | 10 ++-- .../mgr-module-form.component.html | 14 ++--- .../mgr-module-form.component.ts | 2 + .../osd-creation-preview-modal.component.html | 6 +- ...osd-devices-selection-modal.component.html | 8 +-- ...-devices-selection-modal.component.spec.ts | 2 +- .../osd-flags-indiv-modal.component.html | 12 ++-- .../osd-flags-indiv-modal.component.ts | 2 + .../osd-flags-modal.component.html | 12 ++-- .../osd-flags-modal.component.ts | 2 + .../osd/osd-form/osd-form.component.html | 13 ++--- .../osd/osd-form/osd-form.component.spec.ts | 2 +- .../osd-pg-scrub-modal.component.html | 11 ++-- .../osd-recv-speed-modal.component.html | 12 ++-- .../osd-recv-speed-modal.component.ts | 2 + .../osd-reweight-modal.component.html | 11 +--- .../osd-reweight-modal.component.spec.ts | 2 + .../osd-reweight-modal.component.ts | 2 + .../osd-scrub-modal.component.html | 10 +--- .../osd-scrub-modal.component.ts | 2 + .../silence-form/silence-form.component.html | 9 +-- .../silence-matcher-modal.component.html | 11 +--- .../silence-matcher-modal.component.ts | 8 ++- .../service-form/service-form.component.html | 8 +-- .../telemetry/telemetry.component.html | 15 ++--- .../cluster/telemetry/telemetry.component.ts | 2 + .../ceph/nfs/nfs-form/nfs-form.component.html | 11 ++-- .../crush-rule-form-modal.component.html | 7 +-- ...ure-code-profile-form-modal.component.html | 7 +-- .../pool/pool-form/pool-form.component.html | 11 ++-- .../rgw-bucket-form.component.html | 10 ++-- .../rgw-user-capability-modal.component.html | 7 +-- .../rgw-user-form.component.html | 10 ++-- .../rgw-user-s3-key-modal.component.html | 9 ++- .../rgw-user-subuser-modal.component.html | 8 +-- .../login-password-form.component.html | 20 ++----- .../auth/role-form/role-form.component.html | 10 ++-- .../auth/user-form/user-form.component.html | 10 ++-- .../user-password-form.component.html | 10 ++-- .../shared/components/components.module.ts | 7 ++- .../confirmation-modal.component.html | 12 ++-- .../confirmation-modal.component.spec.ts | 12 ++-- ...critical-confirmation-modal.component.html | 12 +--- .../form-button-panel.component.html | 10 ++++ .../form-button-panel.component.scss | 0 .../form-button-panel.component.spec.ts | 25 +++++++++ .../form-button-panel.component.ts | 55 +++++++++++++++++++ .../form-modal/form-modal.component.html | 8 +-- 79 files changed, 335 insertions(+), 337 deletions(-) create mode 100644 src/pybind/mgr/dashboard/frontend/src/app/shared/components/form-button-panel/form-button-panel.component.html create mode 100644 src/pybind/mgr/dashboard/frontend/src/app/shared/components/form-button-panel/form-button-panel.component.scss create mode 100644 src/pybind/mgr/dashboard/frontend/src/app/shared/components/form-button-panel/form-button-panel.component.spec.ts create mode 100644 src/pybind/mgr/dashboard/frontend/src/app/shared/components/form-button-panel/form-button-panel.component.ts diff --git a/src/pybind/mgr/dashboard/frontend/cypress/integration/block/images.po.ts b/src/pybind/mgr/dashboard/frontend/cypress/integration/block/images.po.ts index f744920c3cd..bf6cbc05263 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/integration/block/images.po.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/integration/block/images.po.ts @@ -22,7 +22,7 @@ export class ImagesPageHelper extends PageHelper { cy.get('#size').type(size); // Click the create button and wait for image to be made - cy.contains('button', 'Create RBD').click(); + cy.get('[data-cy=submitBtn]').click(); this.getFirstTableCell(name).should('exist'); } @@ -35,7 +35,7 @@ export class ImagesPageHelper extends PageHelper { cy.get('#name').clear().type(newName); cy.get('#size').clear().type(newSize); // click the size box and send new size - cy.contains('button', 'Edit RBD').click(); + cy.get('[data-cy=submitBtn]').click(); this.getExpandCollapseElement(newName).click(); cy.get('.table.table-striped.table-bordered').contains('td', newSize); @@ -53,7 +53,7 @@ export class ImagesPageHelper extends PageHelper { cy.get('.table-actions button.dropdown-toggle').first().click(); cy.get('button.move-to-trash').click(); - cy.contains('button', 'Move Image').should('be.visible').click(); + cy.get('[data-cy=submitBtn]').should('be.visible').click(); // Clicks trash tab cy.contains('.nav-link', 'Trash').click(); @@ -79,7 +79,7 @@ export class ImagesPageHelper extends PageHelper { cy.get('cd-modal #name').clear().type(newName); } - cy.contains('button', 'Restore Image').click(); + cy.get('[data-cy=submitBtn]').click(); // clicks images tab cy.contains('.nav-link', 'Images').click(); @@ -102,7 +102,7 @@ export class ImagesPageHelper extends PageHelper { this.selectOption('poolName', pool); cy.get('#poolName').should('have.class', 'ng-valid'); // check if pool is selected } - cy.get('#purgeFormButton').click(); + cy.get('[data-cy=submitBtn]').click(); // Wait for image to delete and check it is not present this.getFirstTableCell(name).should('not.exist'); diff --git a/src/pybind/mgr/dashboard/frontend/cypress/integration/cluster/configuration.po.ts b/src/pybind/mgr/dashboard/frontend/cypress/integration/cluster/configuration.po.ts index eb160b052e1..f309120c60d 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/integration/cluster/configuration.po.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/integration/cluster/configuration.po.ts @@ -20,7 +20,7 @@ export class ConfigurationPageHelper extends PageHelper { cy.get(`#${i}`).clear(); } // Clicks save button and checks that values are not present for the selected config - cy.contains('button', 'Save').click(); + cy.get('[data-cy=submitBtn]').click(); // Enter config setting name into filter box this.seachTable(name); @@ -57,7 +57,7 @@ export class ConfigurationPageHelper extends PageHelper { // Clicks save button then waits until the desired config is visible, clicks it, // then checks that each desired value appears with the desired number - cy.contains('button', 'Save').click(); + cy.get('[data-cy=submitBtn]').click(); // Enter config setting name into filter box this.seachTable(name); diff --git a/src/pybind/mgr/dashboard/frontend/cypress/integration/ui/role-mgmt.po.ts b/src/pybind/mgr/dashboard/frontend/cypress/integration/ui/role-mgmt.po.ts index 2cbdef39b98..1cc3630a463 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/integration/ui/role-mgmt.po.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/integration/ui/role-mgmt.po.ts @@ -16,7 +16,7 @@ export class RoleMgmtPageHelper extends PageHelper { cy.get('#description').type(description); // Click the create button and wait for role to be made - cy.contains('button', 'Create Role').click(); + cy.get('[data-cy=submitBtn]').click(); cy.get('.breadcrumb-item.active').should('not.have.text', 'Create'); this.getFirstTableCell(name).should('exist'); @@ -31,7 +31,7 @@ export class RoleMgmtPageHelper extends PageHelper { cy.get('#description').clear().type(description); // Click the edit button and check new values are present in table - cy.contains('button', 'Edit Role').click(); + cy.get('[data-cy=submitBtn]').click(); cy.get('.breadcrumb-item.active').should('not.have.text', 'Edit'); this.getFirstTableCell(name).should('exist'); diff --git a/src/pybind/mgr/dashboard/frontend/cypress/integration/ui/user-mgmt.po.ts b/src/pybind/mgr/dashboard/frontend/cypress/integration/ui/user-mgmt.po.ts index 5afcdf37ca5..fb2b7912944 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/integration/ui/user-mgmt.po.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/integration/ui/user-mgmt.po.ts @@ -17,7 +17,7 @@ export class UserMgmtPageHelper extends PageHelper { cy.get('#email').type(email); // Click the create button and wait for user to be made - cy.contains('button', 'Create User').click(); + cy.get('[data-cy=submitBtn]').click(); this.getFirstTableCell(username).should('exist'); } @@ -31,7 +31,7 @@ export class UserMgmtPageHelper extends PageHelper { cy.get('#email').clear().type(email); // Click the edit button and check new values are present in table - const editButton = cy.contains('button', 'Edit User'); + const editButton = cy.get('[data-cy=submitBtn]'); editButton.click(); this.getFirstTableCell(email).should('exist'); this.getFirstTableCell(name).should('exist'); 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 f4189cc372b..c7724e9ec9a 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 @@ -126,14 +126,10 @@ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-discovery-modal/iscsi-target-discovery-modal.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-discovery-modal/iscsi-target-discovery-modal.component.ts index fd00db7c142..68958cfaa2b 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-discovery-modal/iscsi-target-discovery-modal.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-discovery-modal/iscsi-target-discovery-modal.component.ts @@ -4,6 +4,7 @@ import { FormControl, Validators } from '@angular/forms'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { IscsiService } from '~/app/shared/api/iscsi.service'; +import { ActionLabelsI18n } from '~/app/shared/constants/app.constants'; import { NotificationType } from '~/app/shared/enum/notification-type.enum'; import { CdFormGroup } from '~/app/shared/forms/cd-form-group'; import { CdValidators } from '~/app/shared/forms/cd-validators'; @@ -27,6 +28,7 @@ export class IscsiTargetDiscoveryModalComponent implements OnInit { constructor( private authStorageService: AuthStorageService, public activeModal: NgbActiveModal, + public actionLabels: ActionLabelsI18n, private iscsiService: IscsiService, private notificationService: NotificationService ) { 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 825e821144a..ed719e41612 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 @@ -690,12 +690,10 @@ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-image-settings-modal/iscsi-target-image-settings-modal.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-image-settings-modal/iscsi-target-image-settings-modal.component.html index b3732d2f597..3c34a2b85f2 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-image-settings-modal/iscsi-target-image-settings-modal.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-image-settings-modal/iscsi-target-image-settings-modal.component.html @@ -83,13 +83,9 @@ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-image-settings-modal/iscsi-target-image-settings-modal.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-image-settings-modal/iscsi-target-image-settings-modal.component.ts index 4521a0db197..e9c9c7d90da 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-image-settings-modal/iscsi-target-image-settings-modal.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-image-settings-modal/iscsi-target-image-settings-modal.component.ts @@ -5,6 +5,7 @@ import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import _ from 'lodash'; import { IscsiService } from '~/app/shared/api/iscsi.service'; +import { ActionLabelsI18n } from '~/app/shared/constants/app.constants'; import { CdFormGroup } from '~/app/shared/forms/cd-form-group'; @Component({ @@ -23,7 +24,11 @@ export class IscsiTargetImageSettingsModalComponent implements OnInit { settingsForm: CdFormGroup; - constructor(public activeModal: NgbActiveModal, public iscsiService: IscsiService) {} + constructor( + public activeModal: NgbActiveModal, + public iscsiService: IscsiService, + public actionLabels: ActionLabelsI18n + ) {} ngOnInit() { const fg: Record = { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-iqn-settings-modal/iscsi-target-iqn-settings-modal.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-iqn-settings-modal/iscsi-target-iqn-settings-modal.component.html index 76490e1d4de..a5d1269f6df 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-iqn-settings-modal/iscsi-target-iqn-settings-modal.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-iqn-settings-modal/iscsi-target-iqn-settings-modal.component.html @@ -23,13 +23,9 @@ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-iqn-settings-modal/iscsi-target-iqn-settings-modal.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-iqn-settings-modal/iscsi-target-iqn-settings-modal.component.ts index 4a6ac9df9f4..36fdb9026c3 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-iqn-settings-modal/iscsi-target-iqn-settings-modal.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-iqn-settings-modal/iscsi-target-iqn-settings-modal.component.ts @@ -5,6 +5,7 @@ import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import _ from 'lodash'; import { IscsiService } from '~/app/shared/api/iscsi.service'; +import { ActionLabelsI18n } from '~/app/shared/constants/app.constants'; import { CdFormGroup } from '~/app/shared/forms/cd-form-group'; @Component({ @@ -19,7 +20,11 @@ export class IscsiTargetIqnSettingsModalComponent implements OnInit { settingsForm: CdFormGroup; - constructor(public activeModal: NgbActiveModal, public iscsiService: IscsiService) {} + constructor( + public activeModal: NgbActiveModal, + public iscsiService: IscsiService, + public actionLabels: ActionLabelsI18n + ) {} ngOnInit() { const fg: Record = {}; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/bootstrap-import-modal/bootstrap-import-modal.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/bootstrap-import-modal/bootstrap-import-modal.component.html index 00a3745362d..3770ef099a6 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/bootstrap-import-modal/bootstrap-import-modal.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/bootstrap-import-modal/bootstrap-import-modal.component.html @@ -87,13 +87,9 @@ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/bootstrap-import-modal/bootstrap-import-modal.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/bootstrap-import-modal/bootstrap-import-modal.component.ts index df3cc2bee03..d79096f6be6 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/bootstrap-import-modal/bootstrap-import-modal.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/bootstrap-import-modal/bootstrap-import-modal.component.ts @@ -8,6 +8,7 @@ import { last } from 'rxjs/operators'; import { Pool } from '~/app/ceph/pool/pool'; import { RbdMirroringService } from '~/app/shared/api/rbd-mirroring.service'; +import { ActionLabelsI18n } from '~/app/shared/constants/app.constants'; import { CdFormGroup } from '~/app/shared/forms/cd-form-group'; import { FinishedTask } from '~/app/shared/models/finished-task'; import { TaskWrapperService } from '~/app/shared/services/task-wrapper.service'; @@ -33,6 +34,7 @@ export class BootstrapImportModalComponent implements OnInit, OnDestroy { constructor( public activeModal: NgbActiveModal, + public actionLabels: ActionLabelsI18n, private rbdMirroringService: RbdMirroringService, private taskWrapper: TaskWrapperService ) { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/edit-site-name-modal/edit-site-name-modal.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/edit-site-name-modal/edit-site-name-modal.component.html index 403a5d8cd3a..f0c91976802 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/edit-site-name-modal/edit-site-name-modal.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/edit-site-name-modal/edit-site-name-modal.component.html @@ -30,13 +30,9 @@ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/edit-site-name-modal/edit-site-name-modal.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/edit-site-name-modal/edit-site-name-modal.component.ts index 71c41a1267a..aa43bd0e8db 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/edit-site-name-modal/edit-site-name-modal.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/edit-site-name-modal/edit-site-name-modal.component.ts @@ -4,6 +4,7 @@ import { FormControl } from '@angular/forms'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { RbdMirroringService } from '~/app/shared/api/rbd-mirroring.service'; +import { ActionLabelsI18n } from '~/app/shared/constants/app.constants'; import { CdFormGroup } from '~/app/shared/forms/cd-form-group'; import { FinishedTask } from '~/app/shared/models/finished-task'; import { TaskWrapperService } from '~/app/shared/services/task-wrapper.service'; @@ -20,6 +21,7 @@ export class EditSiteNameModalComponent implements OnInit { constructor( public activeModal: NgbActiveModal, + public actionLabels: ActionLabelsI18n, private rbdMirroringService: RbdMirroringService, private taskWrapper: TaskWrapperService ) { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/pool-edit-mode-modal/pool-edit-mode-modal.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/pool-edit-mode-modal/pool-edit-mode-modal.component.html index 98bb65c9f1c..2e88059ba0c 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/pool-edit-mode-modal/pool-edit-mode-modal.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/pool-edit-mode-modal/pool-edit-mode-modal.component.html @@ -34,13 +34,9 @@ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/pool-edit-mode-modal/pool-edit-mode-modal.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/pool-edit-mode-modal/pool-edit-mode-modal.component.ts index f435e84b75f..137e787174d 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/pool-edit-mode-modal/pool-edit-mode-modal.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/pool-edit-mode-modal/pool-edit-mode-modal.component.ts @@ -5,6 +5,7 @@ import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { Subscription } from 'rxjs'; import { RbdMirroringService } from '~/app/shared/api/rbd-mirroring.service'; +import { ActionLabelsI18n } from '~/app/shared/constants/app.constants'; import { CdFormGroup } from '~/app/shared/forms/cd-form-group'; import { FinishedTask } from '~/app/shared/models/finished-task'; import { TaskWrapperService } from '~/app/shared/services/task-wrapper.service'; @@ -37,6 +38,7 @@ export class PoolEditModeModalComponent implements OnInit, OnDestroy { constructor( public activeModal: NgbActiveModal, + public actionLabels: ActionLabelsI18n, private rbdMirroringService: RbdMirroringService, private taskWrapper: TaskWrapperService ) { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/pool-edit-peer-modal/pool-edit-peer-modal.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/pool-edit-peer-modal/pool-edit-peer-modal.component.html index 164791e996a..97774ebe3ff 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/pool-edit-peer-modal/pool-edit-peer-modal.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/pool-edit-peer-modal/pool-edit-peer-modal.component.html @@ -91,13 +91,9 @@ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/pool-edit-peer-modal/pool-edit-peer-modal.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/pool-edit-peer-modal/pool-edit-peer-modal.component.ts index 83f1fe89769..6569c3b24b0 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/pool-edit-peer-modal/pool-edit-peer-modal.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/pool-edit-peer-modal/pool-edit-peer-modal.component.ts @@ -4,6 +4,7 @@ import { AbstractControl, FormControl, Validators } from '@angular/forms'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { RbdMirroringService } from '~/app/shared/api/rbd-mirroring.service'; +import { ActionLabelsI18n } from '~/app/shared/constants/app.constants'; import { CdFormGroup } from '~/app/shared/forms/cd-form-group'; import { FinishedTask } from '~/app/shared/models/finished-task'; import { TaskWrapperService } from '~/app/shared/services/task-wrapper.service'; @@ -29,6 +30,7 @@ export class PoolEditPeerModalComponent implements OnInit { constructor( public activeModal: NgbActiveModal, + public actionLabels: ActionLabelsI18n, private rbdMirroringService: RbdMirroringService, private taskWrapper: TaskWrapperService ) { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-form/rbd-form.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-form/rbd-form.component.html index 91a4439b904..6a12cb64f16 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-form/rbd-form.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-form/rbd-form.component.html @@ -328,12 +328,10 @@ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-namespace-form/rbd-namespace-form-modal.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-namespace-form/rbd-namespace-form-modal.component.html index 613a14b5335..debbf8643a3 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-namespace-form/rbd-namespace-form-modal.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-namespace-form/rbd-namespace-form-modal.component.html @@ -70,13 +70,9 @@ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-namespace-form/rbd-namespace-form-modal.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-namespace-form/rbd-namespace-form-modal.component.ts index 5bca4266327..bad32c3c554 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-namespace-form/rbd-namespace-form-modal.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-namespace-form/rbd-namespace-form-modal.component.ts @@ -13,6 +13,7 @@ import { Subject } from 'rxjs'; import { Pool } from '~/app/ceph/pool/pool'; import { PoolService } from '~/app/shared/api/pool.service'; import { RbdService } from '~/app/shared/api/rbd.service'; +import { ActionLabelsI18n } from '~/app/shared/constants/app.constants'; import { NotificationType } from '~/app/shared/enum/notification-type.enum'; import { CdFormGroup } from '~/app/shared/forms/cd-form-group'; import { FinishedTask } from '~/app/shared/models/finished-task'; @@ -39,6 +40,7 @@ export class RbdNamespaceFormModalComponent implements OnInit { constructor( public activeModal: NgbActiveModal, + public actionLabels: ActionLabelsI18n, private authStorageService: AuthStorageService, private notificationService: NotificationService, private poolService: PoolService, diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-form/rbd-snapshot-form-modal.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-form/rbd-snapshot-form-modal.component.html index 1b58ee3610a..3b15b0aae69 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-form/rbd-snapshot-form-modal.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-form/rbd-snapshot-form-modal.component.html @@ -29,14 +29,9 @@ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-move-modal/rbd-trash-move-modal.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-move-modal/rbd-trash-move-modal.component.html index c53e79ac3df..b87dbfe6b6d 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-move-modal/rbd-trash-move-modal.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-move-modal/rbd-trash-move-modal.component.html @@ -44,13 +44,9 @@ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-move-modal/rbd-trash-move-modal.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-move-modal/rbd-trash-move-modal.component.ts index 28b82658162..ccf381f9c88 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-move-modal/rbd-trash-move-modal.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-move-modal/rbd-trash-move-modal.component.ts @@ -4,6 +4,7 @@ import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import moment from 'moment'; import { RbdService } from '~/app/shared/api/rbd.service'; +import { ActionLabelsI18n } from '~/app/shared/constants/app.constants'; import { CdFormBuilder } from '~/app/shared/forms/cd-form-builder'; import { CdFormGroup } from '~/app/shared/forms/cd-form-group'; import { CdValidators } from '~/app/shared/forms/cd-validators'; @@ -34,6 +35,7 @@ export class RbdTrashMoveModalComponent implements OnInit { constructor( private rbdService: RbdService, public activeModal: NgbActiveModal, + public actionLabels: ActionLabelsI18n, private fb: CdFormBuilder, private taskWrapper: TaskWrapperService ) { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-purge-modal/rbd-trash-purge-modal.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-purge-modal/rbd-trash-purge-modal.component.html index 989b69473b6..4958173083b 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-purge-modal/rbd-trash-purge-modal.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-purge-modal/rbd-trash-purge-modal.component.html @@ -39,14 +39,9 @@ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-purge-modal/rbd-trash-purge-modal.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-purge-modal/rbd-trash-purge-modal.component.ts index 3969926ef46..e4df25d15ec 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-purge-modal/rbd-trash-purge-modal.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-purge-modal/rbd-trash-purge-modal.component.ts @@ -5,6 +5,7 @@ import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { Pool } from '~/app/ceph/pool/pool'; import { PoolService } from '~/app/shared/api/pool.service'; import { RbdService } from '~/app/shared/api/rbd.service'; +import { ActionLabelsI18n } from '~/app/shared/constants/app.constants'; import { CdFormBuilder } from '~/app/shared/forms/cd-form-builder'; import { CdFormGroup } from '~/app/shared/forms/cd-form-group'; import { FinishedTask } from '~/app/shared/models/finished-task'; @@ -26,6 +27,7 @@ export class RbdTrashPurgeModalComponent implements OnInit { private authStorageService: AuthStorageService, private rbdService: RbdService, public activeModal: NgbActiveModal, + public actionLabels: ActionLabelsI18n, private fb: CdFormBuilder, private poolService: PoolService, private taskWrapper: TaskWrapperService diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-restore-modal/rbd-trash-restore-modal.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-restore-modal/rbd-trash-restore-modal.component.html index 056ed2509ce..ab64c78285d 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-restore-modal/rbd-trash-restore-modal.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-restore-modal/rbd-trash-restore-modal.component.html @@ -34,13 +34,9 @@ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-restore-modal/rbd-trash-restore-modal.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-restore-modal/rbd-trash-restore-modal.component.ts index a2eae8c1b28..860d66cc017 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-restore-modal/rbd-trash-restore-modal.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-restore-modal/rbd-trash-restore-modal.component.ts @@ -3,6 +3,7 @@ import { Component, OnInit } from '@angular/core'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { RbdService } from '~/app/shared/api/rbd.service'; +import { ActionLabelsI18n } from '~/app/shared/constants/app.constants'; import { CdFormBuilder } from '~/app/shared/forms/cd-form-builder'; import { CdFormGroup } from '~/app/shared/forms/cd-form-group'; import { ExecutingTask } from '~/app/shared/models/executing-task'; @@ -28,6 +29,7 @@ export class RbdTrashRestoreModalComponent implements OnInit { constructor( private rbdService: RbdService, public activeModal: NgbActiveModal, + public actionLabels: ActionLabelsI18n, private fb: CdFormBuilder, private taskWrapper: TaskWrapperService ) {} diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration-form/configuration-form.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration-form/configuration-form.component.html index 3df68d267b8..27225e5b0e0 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration-form/configuration-form.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration-form/configuration-form.component.html @@ -150,13 +150,10 @@ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration-form/configuration-form.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration-form/configuration-form.component.ts index aef0eceb557..18099109d5d 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration-form/configuration-form.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration-form/configuration-form.component.ts @@ -7,6 +7,7 @@ import _ from 'lodash'; import { ConfigurationService } from '~/app/shared/api/configuration.service'; import { ConfigFormModel } from '~/app/shared/components/config-option/config-option.model'; import { ConfigOptionTypes } from '~/app/shared/components/config-option/config-option.types'; +import { ActionLabelsI18n } from '~/app/shared/constants/app.constants'; import { NotificationType } from '~/app/shared/enum/notification-type.enum'; import { CdForm } from '~/app/shared/forms/cd-form'; import { CdFormGroup } from '~/app/shared/forms/cd-form-group'; @@ -30,6 +31,7 @@ export class ConfigurationFormComponent extends CdForm implements OnInit { availSections = ['global', 'mon', 'mgr', 'osd', 'mds', 'client']; constructor( + public actionLabels: ActionLabelsI18n, private route: ActivatedRoute, private router: Router, private configService: ConfigurationService, diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/host-form/host-form.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/host-form/host-form.component.html index 0fcf0cd1a5f..0bb3fb8dbfd 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/host-form/host-form.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/host-form/host-form.component.html @@ -34,12 +34,10 @@ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/mgr-modules/mgr-module-form/mgr-module-form.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/mgr-modules/mgr-module-form/mgr-module-form.component.html index de235b58b6d..89cb7b4d7ee 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/mgr-modules/mgr-module-form/mgr-module-form.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/mgr-modules/mgr-module-form/mgr-module-form.component.html @@ -100,16 +100,10 @@ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/mgr-modules/mgr-module-form/mgr-module-form.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/mgr-modules/mgr-module-form/mgr-module-form.component.ts index b07cc46bb38..c40af28031e 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/mgr-modules/mgr-module-form/mgr-module-form.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/mgr-modules/mgr-module-form/mgr-module-form.component.ts @@ -6,6 +6,7 @@ import _ from 'lodash'; import { forkJoin as observableForkJoin } from 'rxjs'; import { MgrModuleService } from '~/app/shared/api/mgr-module.service'; +import { ActionLabelsI18n } from '~/app/shared/constants/app.constants'; import { NotificationType } from '~/app/shared/enum/notification-type.enum'; import { CdForm } from '~/app/shared/forms/cd-form'; import { CdFormBuilder } from '~/app/shared/forms/cd-form-builder'; @@ -24,6 +25,7 @@ export class MgrModuleFormComponent extends CdForm implements OnInit { moduleOptions: any[] = []; constructor( + public actionLabels: ActionLabelsI18n, private route: ActivatedRoute, private router: Router, private formBuilder: CdFormBuilder, diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-creation-preview-modal/osd-creation-preview-modal.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-creation-preview-modal/osd-creation-preview-modal.component.html index 3431b84d3fc..9b442dbc78d 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-creation-preview-modal/osd-creation-preview-modal.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-creation-preview-modal/osd-creation-preview-modal.component.html @@ -11,9 +11,9 @@
{{ driveGroups | json}}
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-devices-selection-modal/osd-devices-selection-modal.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-devices-selection-modal/osd-devices-selection-modal.component.html index 2cbf29bb249..30effc21b53 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-devices-selection-modal/osd-devices-selection-modal.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-devices-selection-modal/osd-devices-selection-modal.component.html @@ -31,10 +31,10 @@ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-devices-selection-modal/osd-devices-selection-modal.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-devices-selection-modal/osd-devices-selection-modal.component.spec.ts index cbcabfba6f9..60ef65d0517 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-devices-selection-modal/osd-devices-selection-modal.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-devices-selection-modal/osd-devices-selection-modal.component.spec.ts @@ -23,7 +23,7 @@ describe('OsdDevicesSelectionModalComponent', () => { const expectSubmitButton = (enabled: boolean) => { const nativeElement = fixture.debugElement.nativeElement; - const button = nativeElement.querySelector('.modal-footer button'); + const button = nativeElement.querySelector('.modal-footer .tc_submitButton'); expect(button.disabled).toBe(!enabled); }; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-flags-indiv-modal/osd-flags-indiv-modal.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-flags-indiv-modal/osd-flags-indiv-modal.component.html index 78d108d7be4..f8a10ff24de 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-flags-indiv-modal/osd-flags-indiv-modal.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-flags-indiv-modal/osd-flags-indiv-modal.component.html @@ -38,14 +38,10 @@ class="btn btn-light" (click)="resetSelection()" i18n>Restore previous selection - Submit - - + diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-flags-indiv-modal/osd-flags-indiv-modal.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-flags-indiv-modal/osd-flags-indiv-modal.component.ts index 652c9afa58b..e9e0b876f3b 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-flags-indiv-modal/osd-flags-indiv-modal.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-flags-indiv-modal/osd-flags-indiv-modal.component.ts @@ -5,6 +5,7 @@ import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import _ from 'lodash'; import { OsdService } from '~/app/shared/api/osd.service'; +import { ActionLabelsI18n } from '~/app/shared/constants/app.constants'; import { NotificationType } from '~/app/shared/enum/notification-type.enum'; import { Flag } from '~/app/shared/models/flag'; import { Permissions } from '~/app/shared/models/permissions'; @@ -59,6 +60,7 @@ export class OsdFlagsIndivModalComponent implements OnInit { constructor( public activeModal: NgbActiveModal, + public actionLabels: ActionLabelsI18n, private authStorageService: AuthStorageService, private osdService: OsdService, private notificationService: NotificationService diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-flags-modal/osd-flags-modal.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-flags-modal/osd-flags-modal.component.html index df3a3a19264..2ae6460fbb7 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-flags-modal/osd-flags-modal.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-flags-modal/osd-flags-modal.component.html @@ -31,14 +31,10 @@ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-flags-modal/osd-flags-modal.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-flags-modal/osd-flags-modal.component.ts index 05e61324e14..640719382b4 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-flags-modal/osd-flags-modal.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-flags-modal/osd-flags-modal.component.ts @@ -5,6 +5,7 @@ import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import _ from 'lodash'; import { OsdService } from '~/app/shared/api/osd.service'; +import { ActionLabelsI18n } from '~/app/shared/constants/app.constants'; import { NotificationType } from '~/app/shared/enum/notification-type.enum'; import { Permissions } from '~/app/shared/models/permissions'; import { AuthStorageService } from '~/app/shared/services/auth-storage.service'; @@ -115,6 +116,7 @@ export class OsdFlagsModalComponent implements OnInit { constructor( public activeModal: NgbActiveModal, + public actionLabels: ActionLabelsI18n, private authStorageService: AuthStorageService, private osdService: OsdService, private notificationService: NotificationService diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-form/osd-form.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-form/osd-form.component.html index 998d5d9856b..8907b161605 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-form/osd-form.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-form/osd-form.component.html @@ -122,14 +122,11 @@ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-form/osd-form.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-form/osd-form.component.spec.ts index b58b9c0a6f7..120b320ced8 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-form/osd-form.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-form/osd-form.component.spec.ts @@ -49,7 +49,7 @@ describe('OsdFormComponent', () => { ]; const expectPreviewButton = (enabled: boolean) => { - const debugElement = fixtureHelper.getElementByCss('.card-footer button'); + const debugElement = fixtureHelper.getElementByCss('.tc_submitButton'); expect(debugElement.nativeElement.disabled).toBe(!enabled); }; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-pg-scrub-modal/osd-pg-scrub-modal.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-pg-scrub-modal/osd-pg-scrub-modal.component.html index 59c6d81fe04..841f41b575a 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-pg-scrub-modal/osd-pg-scrub-modal.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-pg-scrub-modal/osd-pg-scrub-modal.component.html @@ -34,12 +34,11 @@ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-recv-speed-modal/osd-recv-speed-modal.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-recv-speed-modal/osd-recv-speed-modal.component.html index 6b444b0ee31..6544872726e 100755 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-recv-speed-modal/osd-recv-speed-modal.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-recv-speed-modal/osd-recv-speed-modal.component.html @@ -82,14 +82,10 @@ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-recv-speed-modal/osd-recv-speed-modal.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-recv-speed-modal/osd-recv-speed-modal.component.ts index 6c41d0180ab..6546e086569 100755 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-recv-speed-modal/osd-recv-speed-modal.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-recv-speed-modal/osd-recv-speed-modal.component.ts @@ -7,6 +7,7 @@ import _ from 'lodash'; import { ConfigurationService } from '~/app/shared/api/configuration.service'; import { OsdService } from '~/app/shared/api/osd.service'; import { ConfigOptionTypes } from '~/app/shared/components/config-option/config-option.types'; +import { ActionLabelsI18n } from '~/app/shared/constants/app.constants'; import { NotificationType } from '~/app/shared/enum/notification-type.enum'; import { CdFormGroup } from '~/app/shared/forms/cd-form-group'; import { Permissions } from '~/app/shared/models/permissions'; @@ -27,6 +28,7 @@ export class OsdRecvSpeedModalComponent implements OnInit { constructor( public activeModal: NgbActiveModal, + public actionLabels: ActionLabelsI18n, private authStorageService: AuthStorageService, private configService: ConfigurationService, private notificationService: NotificationService, diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-reweight-modal/osd-reweight-modal.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-reweight-modal/osd-reweight-modal.component.html index e19a3d8cecc..e5aa22311f1 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-reweight-modal/osd-reweight-modal.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-reweight-modal/osd-reweight-modal.component.html @@ -29,14 +29,9 @@ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-reweight-modal/osd-reweight-modal.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-reweight-modal/osd-reweight-modal.component.spec.ts index d240f68fd34..41e05021efc 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-reweight-modal/osd-reweight-modal.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-reweight-modal/osd-reweight-modal.component.spec.ts @@ -1,4 +1,5 @@ import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ReactiveFormsModule } from '@angular/forms'; import { RouterTestingModule } from '@angular/router/testing'; @@ -26,6 +27,7 @@ describe('OsdReweightModalComponent', () => { SubmitButtonComponent, BackButtonComponent ], + schemas: [NO_ERRORS_SCHEMA], providers: [OsdService, NgbActiveModal, CdFormBuilder] }); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-reweight-modal/osd-reweight-modal.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-reweight-modal/osd-reweight-modal.component.ts index 392f3200394..d101079776e 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-reweight-modal/osd-reweight-modal.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-reweight-modal/osd-reweight-modal.component.ts @@ -4,6 +4,7 @@ import { Validators } from '@angular/forms'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { OsdService } from '~/app/shared/api/osd.service'; +import { ActionLabelsI18n } from '~/app/shared/constants/app.constants'; import { CdFormBuilder } from '~/app/shared/forms/cd-form-builder'; import { CdFormGroup } from '~/app/shared/forms/cd-form-group'; @@ -18,6 +19,7 @@ export class OsdReweightModalComponent implements OnInit { reweightForm: CdFormGroup; constructor( + public actionLabels: ActionLabelsI18n, public activeModal: NgbActiveModal, private osdService: OsdService, private fb: CdFormBuilder diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-scrub-modal/osd-scrub-modal.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-scrub-modal/osd-scrub-modal.component.html index 386d53a9173..568c700fa69 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-scrub-modal/osd-scrub-modal.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-scrub-modal/osd-scrub-modal.component.html @@ -13,13 +13,9 @@ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-scrub-modal/osd-scrub-modal.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-scrub-modal/osd-scrub-modal.component.ts index 9a1b58160c5..b2f636708b9 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-scrub-modal/osd-scrub-modal.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-scrub-modal/osd-scrub-modal.component.ts @@ -5,6 +5,7 @@ import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { forkJoin } from 'rxjs'; import { OsdService } from '~/app/shared/api/osd.service'; +import { ActionLabelsI18n } from '~/app/shared/constants/app.constants'; import { NotificationType } from '~/app/shared/enum/notification-type.enum'; import { JoinPipe } from '~/app/shared/pipes/join.pipe'; import { NotificationService } from '~/app/shared/services/notification.service'; @@ -21,6 +22,7 @@ export class OsdScrubModalComponent implements OnInit { constructor( public activeModal: NgbActiveModal, + public actionLabels: ActionLabelsI18n, private osdService: OsdService, private notificationService: NotificationService, private joinPipe: JoinPipe diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-form/silence-form.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-form/silence-form.component.html index 40dded4dbfc..ce8928f7f02 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-form/silence-form.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-form/silence-form.component.html @@ -205,12 +205,9 @@ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-matcher-modal/silence-matcher-modal.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-matcher-modal/silence-matcher-modal.component.html index b0c1798b993..db89adc5369 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-matcher-modal/silence-matcher-modal.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-matcher-modal/silence-matcher-modal.component.html @@ -76,14 +76,9 @@ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-matcher-modal/silence-matcher-modal.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-matcher-modal/silence-matcher-modal.component.ts index 5c24a9bdf1c..bdd616ce9c6 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-matcher-modal/silence-matcher-modal.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-matcher-modal/silence-matcher-modal.component.ts @@ -6,6 +6,7 @@ import _ from 'lodash'; import { merge, Observable, Subject } from 'rxjs'; import { debounceTime, distinctUntilChanged, filter, map } from 'rxjs/operators'; +import { ActionLabelsI18n } from '~/app/shared/constants/app.constants'; import { CdFormBuilder } from '~/app/shared/forms/cd-form-builder'; import { CdFormGroup } from '~/app/shared/forms/cd-form-group'; import { @@ -54,7 +55,8 @@ export class SilenceMatcherModalComponent { constructor( private formBuilder: CdFormBuilder, private silenceMatcher: PrometheusSilenceMatcherService, - public activeModal: NgbActiveModal + public activeModal: NgbActiveModal, + public actionLabels: ActionLabelsI18n ) { this.createForm(); this.subscribeToChanges(); @@ -90,6 +92,10 @@ export class SilenceMatcherModalComponent { ); } + getMode() { + return this.editMode ? this.actionLabels.EDIT : this.actionLabels.ADD; + } + preFillControls(matcher: AlertmanagerSilenceMatcher) { this.form.setValue(matcher); } diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.html index 05918798d1b..6f9d47ce421 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.html @@ -403,11 +403,9 @@ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/telemetry/telemetry.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/telemetry/telemetry.component.html index a128c6f2510..877374967a4 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/telemetry/telemetry.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/telemetry/telemetry.component.html @@ -207,7 +207,7 @@ @@ -293,14 +293,11 @@ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/telemetry/telemetry.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/telemetry/telemetry.component.ts index 4b65089c655..8edb7b6a927 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/telemetry/telemetry.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/telemetry/telemetry.component.ts @@ -7,6 +7,7 @@ import { forkJoin as observableForkJoin } from 'rxjs'; import { MgrModuleService } from '~/app/shared/api/mgr-module.service'; import { TelemetryService } from '~/app/shared/api/telemetry.service'; +import { ActionLabelsI18n } from '~/app/shared/constants/app.constants'; import { NotificationType } from '~/app/shared/enum/notification-type.enum'; import { CdForm } from '~/app/shared/forms/cd-form'; import { CdFormBuilder } from '~/app/shared/forms/cd-form-builder'; @@ -43,6 +44,7 @@ export class TelemetryComponent extends CdForm implements OnInit { step = 1; constructor( + public actionLabels: ActionLabelsI18n, private formBuilder: CdFormBuilder, private mgrModuleService: MgrModuleService, private notificationService: NotificationService, diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.html index 3f596d40080..42fc9675d8f 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.html @@ -485,13 +485,10 @@ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/crush-rule-form-modal/crush-rule-form-modal.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/crush-rule-form-modal/crush-rule-form-modal.component.html index a29ac0e3342..7bf328df4eb 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/crush-rule-form-modal/crush-rule-form-modal.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/crush-rule-form-modal/crush-rule-form-modal.component.html @@ -114,10 +114,9 @@ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/erasure-code-profile-form/erasure-code-profile-form-modal.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/erasure-code-profile-form/erasure-code-profile-form-modal.component.html index 4ed4025601b..92cecabc915 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/erasure-code-profile-form/erasure-code-profile-form-modal.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/erasure-code-profile-form/erasure-code-profile-form-modal.component.html @@ -406,10 +406,9 @@ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.html index a91c3ca4bbe..f62a7283feb 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.html @@ -597,13 +597,10 @@ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.html index 07aa631bf35..310ec3d171f 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.html @@ -289,12 +289,10 @@ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-capability-modal/rgw-user-capability-modal.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-capability-modal/rgw-user-capability-modal.component.html index 215c0cb61d0..24cf4ab5f54 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-capability-modal/rgw-user-capability-modal.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-capability-modal/rgw-user-capability-modal.component.html @@ -61,10 +61,9 @@ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-form/rgw-user-form.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-form/rgw-user-form.component.html index 164f6c2b3e8..25b7bce9530 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-form/rgw-user-form.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-form/rgw-user-form.component.html @@ -619,12 +619,10 @@ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-s3-key-modal/rgw-user-s3-key-modal.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-s3-key-modal/rgw-user-s3-key-modal.component.html index a96a26753df..0f8edcaf5dd 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-s3-key-modal/rgw-user-s3-key-modal.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-s3-key-modal/rgw-user-s3-key-modal.component.html @@ -119,11 +119,10 @@ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-subuser-modal/rgw-user-subuser-modal.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-subuser-modal/rgw-user-subuser-modal.component.html index 8bb3363d321..66c59cb3f2c 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-subuser-modal/rgw-user-subuser-modal.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-subuser-modal/rgw-user-subuser-modal.component.html @@ -1,7 +1,6 @@ {{ action | titlecase }} {{ resource | upperFirst }} -
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 84fc9c663f2..2dc30df52e6 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 @@ -85,19 +85,11 @@ *ngIf="userForm.showError('confirmnewpassword', frm, 'match')" i18n>Password confirmation doesn't match the new password. + - diff --git a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/role-form/role-form.component.html b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/role-form/role-form.component.html index 00260011115..ce395236545 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/role-form/role-form.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/role-form/role-form.component.html @@ -68,12 +68,10 @@ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-form/user-form.component.html b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-form/user-form.component.html index 067f854cf9d..098b15e97af 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-form/user-form.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-form/user-form.component.html @@ -240,12 +240,10 @@ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-password-form/user-password-form.component.html b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-password-form/user-password-form.component.html index cbde4f7d655..64a679a32ba 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-password-form/user-password-form.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-password-form/user-password-form.component.html @@ -111,12 +111,10 @@ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/components.module.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/components.module.ts index cb27f473f97..5defbf36a3a 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/components.module.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/components.module.ts @@ -26,6 +26,7 @@ import { CriticalConfirmationModalComponent } from './critical-confirmation-moda import { DateTimePickerComponent } from './date-time-picker/date-time-picker.component'; import { DocComponent } from './doc/doc.component'; import { DownloadButtonComponent } from './download-button/download-button.component'; +import { FormButtonPanelComponent } from './form-button-panel/form-button-panel.component'; import { FormModalComponent } from './form-modal/form-modal.component'; import { GrafanaComponent } from './grafana/grafana.component'; import { HelperComponent } from './helper/helper.component'; @@ -87,7 +88,8 @@ import { UsageBarComponent } from './usage-bar/usage-bar.component'; OrchestratorDocPanelComponent, DateTimePickerComponent, DocComponent, - DownloadButtonComponent + DownloadButtonComponent, + FormButtonPanelComponent ], providers: [], exports: [ @@ -111,7 +113,8 @@ import { UsageBarComponent } from './usage-bar/usage-bar.component'; OrchestratorDocPanelComponent, DateTimePickerComponent, DocComponent, - DownloadButtonComponent + DownloadButtonComponent, + FormButtonPanelComponent ] }) export class ComponentsModule {} diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/confirmation-modal/confirmation-modal.component.html b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/confirmation-modal/confirmation-modal.component.html index 6d6b5a75739..3e0d1d29900 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/confirmation-modal/confirmation-modal.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/confirmation-modal/confirmation-modal.component.html @@ -12,14 +12,10 @@

diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/confirmation-modal/confirmation-modal.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/confirmation-modal/confirmation-modal.component.spec.ts index d44b646ca07..a76c5d378ed 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/confirmation-modal/confirmation-modal.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/confirmation-modal/confirmation-modal.component.spec.ts @@ -1,7 +1,6 @@ import { Component, NgModule, NO_ERRORS_SCHEMA, TemplateRef, ViewChild } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ReactiveFormsModule } from '@angular/forms'; -import { By } from '@angular/platform-browser'; import { RouterTestingModule } from '@angular/router/testing'; import { NgbActiveModal, NgbModalModule, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; @@ -9,6 +8,7 @@ import { NgbActiveModal, NgbModalModule, NgbModalRef } from '@ng-bootstrap/ng-bo import { ModalService } from '~/app/shared/services/modal.service'; import { configureTestBed, FixtureHelper } from '~/testing/unit-test-helper'; import { BackButtonComponent } from '../back-button/back-button.component'; +import { FormButtonPanelComponent } from '../form-button-panel/form-button-panel.component'; import { ModalComponent } from '../modal/modal.component'; import { SubmitButtonComponent } from '../submit-button/submit-button.component'; import { ConfirmationModalComponent } from './confirmation-modal.component'; @@ -72,11 +72,12 @@ describe('ConfirmationModalComponent', () => { BackButtonComponent, MockComponent, ModalComponent, - SubmitButtonComponent + SubmitButtonComponent, + FormButtonPanelComponent ], schemas: [NO_ERRORS_SCHEMA], imports: [ReactiveFormsModule, MockModule, RouterTestingModule, NgbModalModule], - providers: [NgbActiveModal, SubmitButtonComponent] + providers: [NgbActiveModal, SubmitButtonComponent, FormButtonPanelComponent] }); beforeEach(() => { @@ -161,10 +162,7 @@ describe('ConfirmationModalComponent', () => { it('should use the correct submit action', () => { // In order to ignore the `ElementRef` usage of `SubmitButtonComponent` - spyOn( - fixture.debugElement.query(By.directive(SubmitButtonComponent)).componentInstance, - 'focusButton' - ); + spyOn(fh.getElementByCss('.tc_submitButton').componentInstance, 'focusButton'); fh.clickElement('.tc_submitButton'); expect(component.onSubmit).toHaveBeenCalledTimes(1); expect(component.activeModal.close).toHaveBeenCalledTimes(0); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/critical-confirmation-modal/critical-confirmation-modal.component.html b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/critical-confirmation-modal/critical-confirmation-modal.component.html index 06b66265c2c..29b669b141f 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/critical-confirmation-modal/critical-confirmation-modal.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/critical-confirmation-modal/critical-confirmation-modal.component.html @@ -42,15 +42,9 @@ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/form-button-panel/form-button-panel.component.html b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/form-button-panel/form-button-panel.component.html new file mode 100644 index 00000000000..bef4bb8a748 --- /dev/null +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/form-button-panel/form-button-panel.component.html @@ -0,0 +1,10 @@ +
+ + {{ submitText }} +
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/form-button-panel/form-button-panel.component.scss b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/form-button-panel/form-button-panel.component.scss new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/form-button-panel/form-button-panel.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/form-button-panel/form-button-panel.component.spec.ts new file mode 100644 index 00000000000..b8350485b3b --- /dev/null +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/form-button-panel/form-button-panel.component.spec.ts @@ -0,0 +1,25 @@ +import { NO_ERRORS_SCHEMA } from '@angular/core'; +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { configureTestBed } from '~/testing/unit-test-helper'; +import { FormButtonPanelComponent } from './form-button-panel.component'; + +describe('FormButtonPanelComponent', () => { + let component: FormButtonPanelComponent; + let fixture: ComponentFixture; + + configureTestBed({ + declarations: [FormButtonPanelComponent], + schemas: [NO_ERRORS_SCHEMA] + }); + + beforeEach(() => { + fixture = TestBed.createComponent(FormButtonPanelComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/form-button-panel/form-button-panel.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/form-button-panel/form-button-panel.component.ts new file mode 100644 index 00000000000..7684d191563 --- /dev/null +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/form-button-panel/form-button-panel.component.ts @@ -0,0 +1,55 @@ +import { Location } from '@angular/common'; +import { Component, EventEmitter, Input, Output } from '@angular/core'; +import { FormGroup, NgForm } from '@angular/forms'; + +import { ActionLabelsI18n } from '~/app/shared/constants/app.constants'; +import { ModalService } from '~/app/shared/services/modal.service'; + +@Component({ + selector: 'cd-form-button-panel', + templateUrl: './form-button-panel.component.html', + styleUrls: ['./form-button-panel.component.scss'] +}) +export class FormButtonPanelComponent { + @Output() + submitActionEvent = new EventEmitter(); + @Output() + backActionEvent = new EventEmitter(); + + @Input() + form: FormGroup | NgForm; + @Input() + showSubmit = true; + @Input() + wrappingClass = ''; + @Input() + btnClass = ''; + @Input() + submitText: string = this.actionLabels.CREATE; + @Input() + cancelText: string = this.actionLabels.CANCEL; + @Input() + disabled = false; + + constructor( + private location: Location, + private actionLabels: ActionLabelsI18n, + private modalService: ModalService + ) {} + + submitAction() { + this.submitActionEvent.emit(); + } + + backAction() { + if (this.backActionEvent.observers.length === 0) { + if (this.modalService.hasOpenModals()) { + this.modalService.dismissAll(); + } else { + this.location.back(); + } + } else { + this.backActionEvent.emit(); + } + } +} diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/form-modal/form-modal.component.html b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/form-modal/form-modal.component.html index 3efd823cf14..061747f1130 100755 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/form-modal/form-modal.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/form-modal/form-modal.component.html @@ -60,11 +60,9 @@ -- 2.47.3