From: Volker Theile Date: Mon, 3 Sep 2018 14:29:29 +0000 (+0200) Subject: mgr/dashboard: Make deletion dialog more touch device friendly X-Git-Tag: v14.0.1~338^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F23897%2Fhead;p=ceph.git mgr/dashboard: Make deletion dialog more touch device friendly * Refactor deletion dialog * Add directives.module.ts to be able to use 'autofocus' in deletion dialog Signed-off-by: Volker Theile --- diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.component.ts index 1c14a8b6ebdba..2a4ac07d79e4b 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.component.ts @@ -201,7 +201,6 @@ export class RbdListComponent implements OnInit { this.modalRef = this.modalService.show(DeletionModalComponent); this.modalRef.content.setUp({ metaType: 'RBD', - pattern: `${poolName}/${imageName}`, deletionObserver: () => this.taskWrapper.wrapTaskAroundCall({ task: new FinishedTask('rbd/delete', { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-list.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-list.component.ts index 09bfdaea5f9a7..c22ace30b2e92 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-list.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-list.component.ts @@ -256,7 +256,6 @@ export class RbdSnapshotListComponent implements OnInit, OnChanges { this.modalRef = this.modalService.show(DeletionModalComponent); this.modalRef.content.setUp({ metaType: 'RBD snapshot', - pattern: snapshotName, deletionMethod: () => this._asyncTask('deleteSnapshot', 'rbd/snap/delete', snapshotName), modalRef: this.modalRef }); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/role-list/role-list.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/role-list/role-list.component.ts index 5919d38f32b01..cc668434e3bac 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/role-list/role-list.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/role-list/role-list.component.ts @@ -94,7 +94,6 @@ export class RoleListComponent implements OnInit { const name = this.selection.first().name; this.modalRef.content.setUp({ metaType: 'Role', - pattern: `${name}`, deletionMethod: () => this.deleteRole(name), modalRef: this.modalRef }); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-list/user-list.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-list/user-list.component.ts index e4bbf9ff3e0bb..ea62fc24a6c6b 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-list/user-list.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-list/user-list.component.ts @@ -103,7 +103,6 @@ export class UserListComponent implements OnInit { this.modalRef = this.modalService.show(DeletionModalComponent); this.modalRef.content.setUp({ metaType: 'User', - pattern: `${username}`, deletionMethod: () => this.deleteUser(username), modalRef: this.modalRef }); 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 ae30c292ecafe..6d1376b1a2a02 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 @@ -5,6 +5,7 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { ChartsModule } from 'ng2-charts/ng2-charts'; import { AlertModule, ModalModule, PopoverModule, TooltipModule } from 'ngx-bootstrap'; +import { DirectivesModule } from '../directives/directives.module'; import { PipesModule } from '../pipes/pipes.module'; import { ConfirmationModalComponent } from './confirmation-modal/confirmation-modal.component'; import { DeletionModalComponent } from './deletion-modal/deletion-modal.component'; @@ -31,7 +32,8 @@ import { WarningPanelComponent } from './warning-panel/warning-panel.component'; ChartsModule, ReactiveFormsModule, PipesModule, - ModalModule.forRoot() + ModalModule.forRoot(), + DirectivesModule ], declarations: [ ViewCacheComponent, diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/deletion-modal/deletion-modal.component.html b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/deletion-modal/deletion-modal.component.html index ca2f4ca5138de..a6dc08babdad4 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/deletion-modal/deletion-modal.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/deletion-modal/deletion-modal.component.html @@ -11,41 +11,27 @@ novalidate>