From 4a165a9af128c79883f2dbf9cb8392341b117a42 Mon Sep 17 00:00:00 2001 From: Tiago Melo Date: Thu, 2 May 2019 14:17:09 +0000 Subject: [PATCH] mgr/dashboard: Use ng-bootstrap-form-validation Signed-off-by: Tiago Melo --- .../mgr/dashboard/frontend/package-lock.json | 8 ++ .../mgr/dashboard/frontend/package.json | 1 + .../dashboard/frontend/src/app/app.module.ts | 4 +- .../src/app/ceph/block/block.module.ts | 4 +- ...scsi-target-discovery-modal.component.html | 28 +++--- .../iscsi-target-form.component.html | 68 ++++++------- ...i-target-iqn-settings-modal.component.html | 3 +- .../ceph/block/mirroring/mirroring.module.ts | 4 +- .../pool-edit-mode-modal.component.html | 5 +- .../pool-edit-peer-modal.component.html | 24 ++--- .../rbd-configuration-form.component.html | 92 +++++++++--------- .../block/rbd-form/rbd-form.component.html | 38 +++----- .../rbd-snapshot-form.component.html | 7 +- .../rbd-trash-move-modal.component.html | 7 +- .../rbd-trash-restore-modal.component.html | 5 +- .../src/app/ceph/cluster/cluster.module.ts | 4 +- .../configuration-form.component.html | 9 +- .../mgr-module-form.component.html | 17 ++-- .../cluster/mgr-modules/mgr-modules.module.ts | 4 +- .../osd-recv-speed-modal.component.html | 17 ++-- .../osd-reweight-modal.component.html | 4 +- .../nfs-form-client.component.html | 5 +- .../ceph/nfs/nfs-form/nfs-form.component.html | 58 +++++------ .../frontend/src/app/ceph/nfs/nfs.module.ts | 4 +- .../erasure-code-profile-form.component.html | 45 ++++----- ...rasure-code-profile-form.component.spec.ts | 9 +- .../pool/pool-form/pool-form.component.html | 95 +++++++++---------- .../pool-form/pool-form.component.spec.ts | 4 +- .../frontend/src/app/ceph/pool/pool.module.ts | 4 +- .../rgw-bucket-form.component.html | 14 ++- .../rgw-user-capability-modal.component.html | 10 +- .../rgw-user-form.component.html | 52 ++++------ .../rgw-user-s3-key-modal.component.html | 11 +-- .../rgw-user-subuser-modal.component.html | 18 ++-- .../frontend/src/app/ceph/rgw/rgw.module.ts | 4 +- .../frontend/src/app/core/auth/auth.module.ts | 4 +- .../app/core/auth/login/login.component.html | 10 +- .../auth/role-form/role-form.component.html | 10 +- .../auth/user-form/user-form.component.html | 22 ++--- .../shared/components/components.module.ts | 4 +- ...critical-confirmation-modal.component.html | 3 +- .../components/select/select.component.html | 6 +- .../mgr/dashboard/frontend/src/styles.scss | 30 ++++++ 43 files changed, 369 insertions(+), 406 deletions(-) diff --git a/src/pybind/mgr/dashboard/frontend/package-lock.json b/src/pybind/mgr/dashboard/frontend/package-lock.json index 350dee8d791..753c114c281 100644 --- a/src/pybind/mgr/dashboard/frontend/package-lock.json +++ b/src/pybind/mgr/dashboard/frontend/package-lock.json @@ -10949,6 +10949,14 @@ "tslib": "^1.9.0" } }, + "ng-bootstrap-form-validation": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/ng-bootstrap-form-validation/-/ng-bootstrap-form-validation-4.0.0.tgz", + "integrity": "sha512-Whoc9To21hKMtI+yZRVsS19TJMKd5OFVsxJS42LvcOls/uNQBT7LYmS3CGWlwDSGOo85utx3hDHuGzjb78AIoA==", + "requires": { + "tslib": "^1.9.0" + } + }, "ng2-charts": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/ng2-charts/-/ng2-charts-1.6.0.tgz", diff --git a/src/pybind/mgr/dashboard/frontend/package.json b/src/pybind/mgr/dashboard/frontend/package.json index cc659f66773..b84a8d680c7 100644 --- a/src/pybind/mgr/dashboard/frontend/package.json +++ b/src/pybind/mgr/dashboard/frontend/package.json @@ -75,6 +75,7 @@ "lodash": "4.17.11", "moment": "2.24.0", "ng-block-ui": "2.1.1", + "ng-bootstrap-form-validation": "4.0.0", "ng2-charts": "1.6.0", "ng2-tree": "2.0.0-rc.11", "ngx-bootstrap": "4.3.0", diff --git a/src/pybind/mgr/dashboard/frontend/src/app/app.module.ts b/src/pybind/mgr/dashboard/frontend/src/app/app.module.ts index 3da5eada655..2f94a0aeee1 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/app.module.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/app.module.ts @@ -7,6 +7,7 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { JwtModule } from '@auth0/angular-jwt'; import { I18n } from '@ngx-translate/i18n-polyfill'; import { BlockUIModule } from 'ng-block-ui'; +import { NgBootstrapFormValidationModule } from 'ng-bootstrap-form-validation'; import { AccordionModule } from 'ngx-bootstrap/accordion'; import { BsDropdownModule } from 'ngx-bootstrap/dropdown'; import { TabsModule } from 'ngx-bootstrap/tabs'; @@ -50,7 +51,8 @@ registerLocaleData(LocaleHelper.getLocaleData(), LocaleHelper.getLocale()); config: { tokenGetter: jwtTokenGetter } - }) + }), + NgBootstrapFormValidationModule.forRoot() ], exports: [SharedModule], providers: [ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/block.module.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/block.module.ts index ca56b9623ae..29b5692e5be 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/block.module.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/block.module.ts @@ -3,6 +3,7 @@ import { NgModule } from '@angular/core'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { RouterModule, Routes } from '@angular/router'; +import { NgBootstrapFormValidationModule } from 'ng-bootstrap-form-validation'; import { TreeModule } from 'ng2-tree'; import { BsDatepickerModule } from 'ngx-bootstrap/datepicker'; import { BsDropdownModule } from 'ngx-bootstrap/dropdown'; @@ -62,7 +63,8 @@ import { RbdTrashRestoreModalComponent } from './rbd-trash-restore-modal/rbd-tra ModalModule.forRoot(), SharedModule, RouterModule, - TreeModule + TreeModule, + NgBootstrapFormValidationModule ], declarations: [ RbdListComponent, 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 4e3679c3721..1940ff36118 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 @@ -9,8 +9,7 @@ novalidate>