From 7aac42984c7ea24555ba1f8936a550c39902c389 Mon Sep 17 00:00:00 2001 From: Naman Munet Date: Mon, 29 Sep 2025 10:21:06 +0530 Subject: [PATCH] mgr/dashboard: Rename side-nav panel items Fixes: https://tracker.ceph.com/issues/73252 Commit includes changes: 1) Renaming Topic to Notification destination 2) Renaming Tiering to Storage class 3) Renaming Users to User Management 4) fix storage class table refresh after delete 5) Also made changes to internal routing for topic and storage class Signed-off-by: Naman Munet --- .../rgw-bucket-notification-list.component.ts | 4 +- .../rgw-bucket-tiering-form.component.ts | 2 +- .../rgw-storage-class-form.component.ts | 6 +-- .../rgw-storage-class-list.component.html | 1 + .../rgw-storage-class-list.component.ts | 41 +++++++++++++------ .../rgw-topic-details.component.html | 10 ----- .../rgw-topic-form.component.html | 31 ++++++-------- .../rgw-topic-form.component.ts | 10 ++--- .../rgw-topic-list.component.html | 2 + .../rgw-topic-list.component.ts | 6 +-- .../frontend/src/app/ceph/rgw/rgw.module.ts | 8 ++-- .../navigation/navigation.component.html | 16 ++++---- .../navigation/navigation.component.spec.ts | 8 ++-- .../shared/services/task-message.service.ts | 10 ++--- 14 files changed, 80 insertions(+), 75 deletions(-) diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-notification-list/rgw-bucket-notification-list.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-notification-list/rgw-bucket-notification-list.component.ts index ffec0f3d3c3..989d73b9fa5 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-notification-list/rgw-bucket-notification-list.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-notification-list/rgw-bucket-notification-list.component.ts @@ -73,8 +73,8 @@ export class RgwBucketNotificationListComponent extends ListWithDetails implemen flexGrow: 2 }, { - name: $localize`Topic`, - prop: 'Topic', + name: $localize`Destination`, + prop: 'Destination', flexGrow: 1, cellTransformation: CellTemplate.copy }, diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-tiering-form/rgw-bucket-tiering-form.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-tiering-form/rgw-bucket-tiering-form.component.ts index dde30ad0e94..9fd615e3f9d 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-tiering-form/rgw-bucket-tiering-form.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-tiering-form/rgw-bucket-tiering-form.component.ts @@ -285,7 +285,7 @@ export class RgwBucketTieringFormComponent extends CdForm implements OnInit { } goToCreateStorageClass() { - this.router.navigate(['rgw/tiering/create']); + this.router.navigate(['rgw/storage-class/create']); this.closeModal(); } } diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-storage-class-form/rgw-storage-class-form.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-storage-class-form/rgw-storage-class-form.component.ts index 5288e7d3d97..85233492dc2 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-storage-class-form/rgw-storage-class-form.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-storage-class-form/rgw-storage-class-form.component.ts @@ -134,8 +134,8 @@ export class RgwStorageClassFormComponent extends CdForm implements OnInit { private rgwZoneService: RgwZoneService ) { super(); - this.resource = $localize`Tiering Storage Class`; - this.editing = this.router.url.startsWith(`/rgw/tiering/${URLVerbs.EDIT}`); + this.resource = $localize`Storage Class`; + this.editing = this.router.url.startsWith(`/rgw/storage-class/${URLVerbs.EDIT}`); this.action = this.editing ? this.actionLabels.EDIT : this.actionLabels.CREATE; } @@ -619,7 +619,7 @@ export class RgwStorageClassFormComponent extends CdForm implements OnInit { } } goToListView() { - this.router.navigate([`rgw/tiering`]); + this.router.navigate([`rgw/storage-class`]); } getTierTargetByStorageClass(placementTargetInfo: PlacementTarget, storageClass: string) { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-storage-class-list/rgw-storage-class-list.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-storage-class-list/rgw-storage-class-list.component.html index 069c5525cba..c95e3005694 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-storage-class-list/rgw-storage-class-list.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-storage-class-list/rgw-storage-class-list.component.html @@ -4,6 +4,7 @@ [`/rgw/tiering/edit/${getStorageUri()}`] + routerLink: () => [`/${BASE_URL}/edit/${getStorageUri()}`] }, { name: this.actionLabels.REMOVE, @@ -170,17 +174,30 @@ export class RgwStorageClassListComponent extends ListWithDetails implements OnI const storage_class = this.selection.first().storage_class; const placement_target = this.selection.first().placement_target; this.cdsModalService.show(DeleteConfirmationModalComponent, { - itemDescription: $localize`Tiering Storage Class`, + itemDescription: $localize`Storage class`, itemNames: [storage_class], actionDescription: 'remove', - submitActionObservable: () => - this.taskWrapper.wrapTaskAroundCall({ - task: new FinishedTask('rgw/zonegroup/storage-class', { - placement_target: placement_target, - storage_class: storage_class - }), - call: this.rgwStorageClassService.removeStorageClass(placement_target, storage_class) - }) + submitActionObservable: () => { + return new Observable((observer: Subscriber) => { + this.taskWrapper + .wrapTaskAroundCall({ + task: new FinishedTask('rgw/zonegroup/storage-class', { + placement_target: placement_target, + storage_class: storage_class + }), + call: this.rgwStorageClassService.removeStorageClass(placement_target, storage_class) + }) + .subscribe({ + error: (error: any) => { + observer.error(error); + }, + complete: () => { + observer.complete(); + this.table.refreshBtn(); + } + }); + }); + } }); } diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-topic-details/rgw-topic-details.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-topic-details/rgw-topic-details.component.html index 9f583d3a54a..4c6c3ce69fe 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-topic-details/rgw-topic-details.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-topic-details/rgw-topic-details.component.html @@ -11,16 +11,6 @@ class="bold">Push endpoint arguments {{ selection?.dest?.push_endpoint_args }} - - Push endpoint topic - {{ selection?.dest?.push_endpoint_topic}} - - - Push endpoint - {{ selection?.dest?.push_endpoint }} - Stored secret diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-topic-form/rgw-topic-form.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-topic-form/rgw-topic-form.component.html index 07f9b2ccf91..115a408d5fa 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-topic-form/rgw-topic-form.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-topic-form/rgw-topic-form.component.html @@ -9,14 +9,14 @@ {{ action | titlecase }} {{ resource | upperFirst }} - Configure the push endpoint parameters to send notifications. On successful creation, you'll receive the topic's unique Amazon Resource Name + Configure the push endpoint parameters to send notifications. On successful creation, you'll receive the destination's unique Amazon Resource Name
- +
+ [invalidText]="topicTypeError"> + value="">-- Select a destination type -- @@ -53,9 +51,7 @@ cdRequiredField="Owner" [invalid]="topicForm.controls.owner.invalid && topicForm.controls.owner.dirty" id="owner" - helperText="This owner will define and control the topic’s settings" - [invalidText]="ownerError" - i18n-helperText> + [invalidText]="ownerError"> @@ -78,7 +74,7 @@
- +
Name + [invalidText]="nameError">Name - RGW Gateway hostname + Destination address Additional common attributes - Configure additional attributes to customize the topic's behavior and settings + Configure additional attributes to customize the destination behavior and settings @@ -445,7 +440,7 @@ + helperText="A user-defined metadata added to all notifications that are triggered by the destination."> Opaque data { return new Observable((observer: Subscriber) => { this.taskWrapper .wrapTaskAroundCall({ - task: new FinishedTask('rgw/topic/delete', { + task: new FinishedTask(`${BASE_URL}/delete`, { name: [name] }), call: this.rgwTopicService.delete(key) diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw.module.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw.module.ts index 837aaa5ba6c..dd1f0c9d2b2 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw.module.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw.module.ts @@ -389,8 +389,8 @@ const routes: Routes = [ ] }, { - path: 'tiering', - data: { breadcrumbs: 'Tiering' }, + path: 'storage-class', + data: { breadcrumbs: 'Storage class' }, children: [ { path: '', component: RgwStorageClassListComponent }, { @@ -438,8 +438,8 @@ const routes: Routes = [ children: [{ path: '', component: RgwConfigurationPageComponent }] }, { - path: 'topic', - data: { breadcrumbs: 'Topic' }, + path: 'destination', + data: { breadcrumbs: 'Notification destination' }, children: [ { path: '', component: RgwTopicListComponent }, { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/navigation/navigation.component.html b/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/navigation/navigation.component.html index c8256c9054c..68c0f081c20 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/navigation/navigation.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/navigation/navigation.component.html @@ -211,25 +211,25 @@ [useRouter]="true" class="tc_submenuitem tc_submenuitem_rgw_overview">Overview Users + class="tc_submenuitem tc_submenuitem_rgw_users">User management Buckets - Topics - Notification destination + Tiering + class="tc_submenuitem tc_submenuitem_rgw_storage_class">Storage class { '.tc_submenuitem_rgw_daemons', '.tc_submenuitem_rgw_users', '.tc_submenuitem_rgw_buckets', - '.tc_submenuitem_rgw_topics' + '.tc_submenuitem_rgw_notification' ] ] ]; @@ -188,7 +188,7 @@ describe('NavigationComponent', () => { '.tc_submenuitem_rgw_daemons', '.tc_submenuitem_rgw_users', '.tc_submenuitem_rgw_buckets', - '.tc_submenuitem_rgw_topics' + '.tc_submenuitem_rgw_notification' ] ] ]; @@ -248,9 +248,9 @@ describe('NavigationComponent', () => { '.tc_submenuitem_block_iscsi': 'iSCSI', '.tc_submenuitem_block_nvme': 'NVMe/TCP', '.tc_submenuitem_rgw_overview': 'Overview', - '.tc_submenuitem_rgw_users': 'Users', + '.tc_submenuitem_rgw_users': 'User management', '.tc_submenuitem_rgw_buckets': 'Buckets', - '.tc_submenuitem_rgw_topics': 'Topics', + '.tc_submenuitem_rgw_notification': 'Notification destination', '.tc_submenuitem_rgw_multi-site': 'Multi-site', '.tc_submenuitem_rgw_daemons': 'Gateways', '.tc_submenuitem_rgw_nfs': 'NFS', diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/task-message.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/task-message.service.ts index eeec846cfd3..6a43e16f24d 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/task-message.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/task-message.service.ts @@ -410,8 +410,8 @@ export class TaskMessageService { 'nfs/delete': this.newTaskMessage(this.commonOperations.delete, (metadata) => this.nfs(metadata) ), - 'rgw/topic/delete': this.newTaskMessage(this.commonOperations.delete, (metadata) => - this.topic(metadata) + 'rgw/destination/delete': this.newTaskMessage(this.commonOperations.delete, (metadata) => + this.destination(metadata) ), // Grafana tasks 'grafana/dashboards/update': this.newTaskMessage( @@ -624,8 +624,8 @@ export class TaskMessageService { return $localize`SMB users and groups access resource '${metadata.usersGroupsId}'`; } - topic(metadata: any) { - return $localize`Topic '${metadata.name}'`; + destination(metadata: any) { + return $localize`Notification destination '${metadata.name}'`; } notification(metadata: any) { return $localize`Notification '${metadata.name}'`; @@ -635,7 +635,7 @@ export class TaskMessageService { } rgwStorageClass(metadata: any) { - return $localize`Tiering Storage Class '${metadata.storage_class}'`; + return $localize`Storage Class '${metadata.storage_class}'`; } crudMessage(metadata: any) { -- 2.39.5