From d26e0af8a9a9e8bc487232c0ae43e862ddee3349 Mon Sep 17 00:00:00 2001 From: Afreen Misbah Date: Tue, 6 Jan 2026 16:17:16 +0530 Subject: [PATCH] mgr/dashboard: Add full page tearsheet component Fixes https://tracker.ceph.com/issues/74327 - added "full" page tearsheet - the full page tearsheet uses a cancel confirmation modal hence added that as well - as per latest carbon guidelines for tearsheet https://carbondesignsystem.com/community/patterns/create-flows/#anatomy-of-a-full-page - not added - influencer title and toggle (should be added as per reqs) Signed-off-by: Afreen Misbah --- .../workbench-layout.component.html | 4 +- .../workbench-layout.component.scss | 10 +++ .../confirmation-modal.component.html | 2 + .../confirmation-modal.component.ts | 2 + .../tearsheet/tearsheet.component.html | 85 ++++++++++++++++++- .../tearsheet/tearsheet.component.scss | 37 +++++++- .../tearsheet/tearsheet.component.ts | 29 ++++++- 7 files changed, 160 insertions(+), 9 deletions(-) diff --git a/src/pybind/mgr/dashboard/frontend/src/app/core/layouts/workbench-layout/workbench-layout.component.html b/src/pybind/mgr/dashboard/frontend/src/app/core/layouts/workbench-layout/workbench-layout.component.html index c8a42e6522c1e..3881a424eff1c 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/core/layouts/workbench-layout/workbench-layout.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/core/layouts/workbench-layout/workbench-layout.component.html @@ -12,7 +12,9 @@ - + diff --git a/src/pybind/mgr/dashboard/frontend/src/app/core/layouts/workbench-layout/workbench-layout.component.scss b/src/pybind/mgr/dashboard/frontend/src/app/core/layouts/workbench-layout/workbench-layout.component.scss index d037420b0a77a..2716021cfb668 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/core/layouts/workbench-layout/workbench-layout.component.scss +++ b/src/pybind/mgr/dashboard/frontend/src/app/core/layouts/workbench-layout/workbench-layout.component.scss @@ -10,6 +10,16 @@ .container-fluid { overflow: auto; padding-top: 48px; + + &:has(.tearsheet--full) { + padding-left: 0; + padding-right: 0; + overflow: hidden; + + .breadcrumbs--padding { + padding-left: var(--cds-spacing-07); + } + } } .rgw-dashboard { 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 8fffca31e28db..423d92838bb03 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 @@ -20,8 +20,10 @@ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/confirmation-modal/confirmation-modal.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/confirmation-modal/confirmation-modal.component.ts index 0c816fe0b7e23..64ee069e43357 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/confirmation-modal/confirmation-modal.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/confirmation-modal/confirmation-modal.component.ts @@ -22,6 +22,7 @@ export class ConfirmationModalComponent extends BaseModal implements OnInit, OnD constructor( @Optional() @Inject('titleText') public titleText: string, @Optional() @Inject('buttonText') public buttonText: string, + @Optional() @Inject('cancelText') public cancelText: string = $localize`Cancel`, @Optional() @Inject('onSubmit') public onSubmit: Function, // One of them is needed @@ -33,6 +34,7 @@ export class ConfirmationModalComponent extends BaseModal implements OnInit, OnD @Optional() @Inject('bodyData') public bodyData?: object, @Optional() @Inject('onCancel') public onCancel?: Function, @Optional() @Inject('bodyContext') public bodyContext?: object, + @Optional() @Inject('submitBtnType') public submitBtnType: string = 'primary', @Optional() @Inject('showSubmit') public showSubmit = true, @Optional() @Inject('showCancel') public showCancel = true ) { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/tearsheet/tearsheet.component.html b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/tearsheet/tearsheet.component.html index 9508fafadb6ac..4a917b3229cc1 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/tearsheet/tearsheet.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/tearsheet/tearsheet.component.html @@ -1,16 +1,92 @@ + + @if(type === 'full') { +
+
+ +
+

+ {{title}} +

+

+ {{description}} +

+
+
+ +
+ + +
+
+ +
+ + +
+ + + + + @if (currentStep === lastStep) { + + } + @else { + + } + +
+
+
+
+} +@else { + (overlaySelected)="closeTearsheet()">

+ class="cds--type-heading-04 tearsheet-header-title"> {{title}}

-

+

{{description}}

@@ -43,7 +119,7 @@