Skip to content

Commit 7aac429

Browse files
author
Naman Munet
committed
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 <[email protected]>
1 parent b99a246 commit 7aac429

File tree

14 files changed

+80
-75
lines changed

14 files changed

+80
-75
lines changed

src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-notification-list/rgw-bucket-notification-list.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ export class RgwBucketNotificationListComponent extends ListWithDetails implemen
7373
flexGrow: 2
7474
},
7575
{
76-
name: $localize`Topic`,
77-
prop: 'Topic',
76+
name: $localize`Destination`,
77+
prop: 'Destination',
7878
flexGrow: 1,
7979
cellTransformation: CellTemplate.copy
8080
},

src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-tiering-form/rgw-bucket-tiering-form.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ export class RgwBucketTieringFormComponent extends CdForm implements OnInit {
285285
}
286286

287287
goToCreateStorageClass() {
288-
this.router.navigate(['rgw/tiering/create']);
288+
this.router.navigate(['rgw/storage-class/create']);
289289
this.closeModal();
290290
}
291291
}

src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-storage-class-form/rgw-storage-class-form.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ export class RgwStorageClassFormComponent extends CdForm implements OnInit {
134134
private rgwZoneService: RgwZoneService
135135
) {
136136
super();
137-
this.resource = $localize`Tiering Storage Class`;
138-
this.editing = this.router.url.startsWith(`/rgw/tiering/${URLVerbs.EDIT}`);
137+
this.resource = $localize`Storage Class`;
138+
this.editing = this.router.url.startsWith(`/rgw/storage-class/${URLVerbs.EDIT}`);
139139
this.action = this.editing ? this.actionLabels.EDIT : this.actionLabels.CREATE;
140140
}
141141

@@ -619,7 +619,7 @@ export class RgwStorageClassFormComponent extends CdForm implements OnInit {
619619
}
620620
}
621621
goToListView() {
622-
this.router.navigate([`rgw/tiering`]);
622+
this.router.navigate([`rgw/storage-class`]);
623623
}
624624

625625
getTierTargetByStorageClass(placementTargetInfo: PlacementTarget, storageClass: string) {

src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-storage-class-list/rgw-storage-class-list.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
</cd-help-text>
55
</legend>
66
<cd-table
7+
#table
78
[data]="storageClassList"
89
columnMode="flex"
910
[columns]="columns"

src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-storage-class-list/rgw-storage-class-list.component.ts

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, NgZone, OnInit } from '@angular/core';
1+
import { Component, NgZone, OnInit, ViewChild } from '@angular/core';
22
import { CdTableAction } from '~/app/shared/models/cd-table-action';
33
import { CdTableColumn } from '~/app/shared/models/cd-table-column';
44
import { CdTableSelection } from '~/app/shared/models/cd-table-selection';
@@ -23,15 +23,19 @@ import { URLBuilderService } from '~/app/shared/services/url-builder.service';
2323
import { Permission } from '~/app/shared/models/permissions';
2424
import { BucketTieringUtils } from '../utils/rgw-bucket-tiering';
2525
import { Router } from '@angular/router';
26+
import { Observable, Subscriber } from 'rxjs';
27+
import { TableComponent } from '~/app/shared/datatable/table/table.component';
2628

27-
const BASE_URL = 'rgw/tiering';
29+
const BASE_URL = 'rgw/storage-class';
2830
@Component({
2931
selector: 'cd-rgw-storage-class-list',
3032
templateUrl: './rgw-storage-class-list.component.html',
3133
styleUrls: ['./rgw-storage-class-list.component.scss'],
3234
providers: [{ provide: URLBuilderService, useValue: new URLBuilderService(BASE_URL) }]
3335
})
3436
export class RgwStorageClassListComponent extends ListWithDetails implements OnInit {
37+
@ViewChild('table', { static: true })
38+
table: TableComponent;
3539
columns: CdTableColumn[];
3640
selection = new CdTableSelection();
3741
permission: Permission;
@@ -108,7 +112,7 @@ export class RgwStorageClassListComponent extends ListWithDetails implements OnI
108112
name: this.actionLabels.EDIT,
109113
permission: 'update',
110114
icon: Icons.edit,
111-
routerLink: () => [`/rgw/tiering/edit/${getStorageUri()}`]
115+
routerLink: () => [`/${BASE_URL}/edit/${getStorageUri()}`]
112116
},
113117
{
114118
name: this.actionLabels.REMOVE,
@@ -170,17 +174,30 @@ export class RgwStorageClassListComponent extends ListWithDetails implements OnI
170174
const storage_class = this.selection.first().storage_class;
171175
const placement_target = this.selection.first().placement_target;
172176
this.cdsModalService.show(DeleteConfirmationModalComponent, {
173-
itemDescription: $localize`Tiering Storage Class`,
177+
itemDescription: $localize`Storage class`,
174178
itemNames: [storage_class],
175179
actionDescription: 'remove',
176-
submitActionObservable: () =>
177-
this.taskWrapper.wrapTaskAroundCall({
178-
task: new FinishedTask('rgw/zonegroup/storage-class', {
179-
placement_target: placement_target,
180-
storage_class: storage_class
181-
}),
182-
call: this.rgwStorageClassService.removeStorageClass(placement_target, storage_class)
183-
})
180+
submitActionObservable: () => {
181+
return new Observable((observer: Subscriber<any>) => {
182+
this.taskWrapper
183+
.wrapTaskAroundCall({
184+
task: new FinishedTask('rgw/zonegroup/storage-class', {
185+
placement_target: placement_target,
186+
storage_class: storage_class
187+
}),
188+
call: this.rgwStorageClassService.removeStorageClass(placement_target, storage_class)
189+
})
190+
.subscribe({
191+
error: (error: any) => {
192+
observer.error(error);
193+
},
194+
complete: () => {
195+
observer.complete();
196+
this.table.refreshBtn();
197+
}
198+
});
199+
});
200+
}
184201
});
185202
}
186203

src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-topic-details/rgw-topic-details.component.html

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,6 @@
1111
class="bold">Push endpoint arguments</td>
1212
<td>{{ selection?.dest?.push_endpoint_args }}</td>
1313
</tr>
14-
<tr>
15-
<td i18n
16-
class="bold w-25">Push endpoint topic</td>
17-
<td class="w-75">{{ selection?.dest?.push_endpoint_topic}}</td>
18-
</tr>
19-
<tr>
20-
<td i18n
21-
class="bold w-25">Push endpoint</td>
22-
<td class="w-75">{{ selection?.dest?.push_endpoint }}</td>
23-
</tr>
2414
<tr>
2515
<td i18n
2616
class="bold w-25">Stored secret</td>

src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-topic-form/rgw-topic-form.component.html

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
{{ action | titlecase }} {{ resource | upperFirst }}
1010
<cd-help-text>
1111
<span i18n>
12-
Configure the push endpoint parameters to send notifications. On successful creation, you'll receive the topic's unique Amazon Resource Name
12+
Configure the push endpoint parameters to send notifications. On successful creation, you'll receive the destination's unique Amazon Resource Name
1313
</span>
1414
</cd-help-text>
1515
</div>
1616

1717
<div class="form-item form-item-append"
1818
cdsRow>
19-
<!-- Topic Type-->
19+
<!-- Destination Type-->
2020
<div cdsCol>
2121
<cds-select formControlName="endpointType"
2222
label="Type"
@@ -25,15 +25,13 @@
2525
id="endpointType"
2626
(change)="onEndpointTypeChange();"
2727
[invalid]="topicForm.controls.endpointType.invalid && topicForm.controls.endpointType.dirty"
28-
[invalidText]="topicTypeError"
29-
helperText="This user will manage and configure the topic’s settings."
30-
i18n-helperText>
28+
[invalidText]="topicTypeError">
3129
<option i18n
3230
*ngIf="endpointType === null"
3331
value="null">Loading... </option>
3432
<option i18n
3533
*ngIf="endpointType !== null"
36-
value="">-- Select a Topic type --</option>
34+
value="">-- Select a destination type --</option>
3735
<option *ngFor="let data of endpointType"
3836
i18n>{{ data | upperFirst }} </option>
3937
</cds-select>
@@ -53,9 +51,7 @@
5351
cdRequiredField="Owner"
5452
[invalid]="topicForm.controls.owner.invalid && topicForm.controls.owner.dirty"
5553
id="owner"
56-
helperText="This owner will define and control the topic’s settings"
57-
[invalidText]="ownerError"
58-
i18n-helperText>
54+
[invalidText]="ownerError">
5955
<option i18n
6056
*ngIf="owners === null"
6157
value="null">Loading... </option>
@@ -78,16 +74,15 @@
7874
<div class="form-item form-item-append"
7975
cdsRow>
8076

81-
<!-- Topic Name -->
77+
<!-- Destination Name -->
8278
<div cdsCol>
8379
<cds-text-label
8480
labelInputID="name"
8581
i18n
8682
i18n-helperText
8783
cdRequiredField="Name"
8884
[invalid]="topicForm.controls.name.invalid && topicForm.controls.name.dirty"
89-
[invalidText]="nameError"
90-
helperText="Enter a Topic name">Name
85+
[invalidText]="nameError">Name
9186

9287
<input cdsText
9388
type="text"
@@ -162,13 +157,13 @@
162157
<div cdsCol>
163158
<cds-text-label
164159
labelInputID="fqdn"
165-
cdRequiredField="RGW Gateway Hostname"
160+
cdRequiredField="Destination address"
166161
[invalid]="topicForm.controls.fqdn.invalid && topicForm.controls.fqdn.dirty"
167162
[invalidText]="fqdnError"
168-
helperText="Enter the FQDN to configure the topic's settings and behavior"
163+
helperText="Enter the FQDN/hostname/IP address for the push endpoint"
169164
i18n-helperText
170165
i18n>
171-
RGW Gateway hostname
166+
Destination address
172167
<input cdsText
173168
type="text"
174169
id="fqdn"
@@ -188,7 +183,7 @@
188183
<cds-number
189184
id="Port"
190185
formControlName="port"
191-
cdRequiredField="Port"
186+
cdRequiredField="Destination port"
192187
label="Port"
193188
i18n-label
194189
[min]="1"
@@ -424,7 +419,7 @@
424419
cdsCol
425420
class="cd-header">
426421
Additional common attributes
427-
<cd-help-text>Configure additional attributes to customize the topic's behavior and settings</cd-help-text>
422+
<cd-help-text>Configure additional attributes to customize the destination behavior and settings</cd-help-text>
428423
</legend>
429424

430425
<!-- Persistent-->
@@ -445,7 +440,7 @@
445440
<cds-text-label labelInputID="opaque_data"
446441
i18n
447442
i18n-helperText
448-
helperText="A user-defined metadata added to all notifications that are triggered by the topic.">
443+
helperText="A user-defined metadata added to all notifications that are triggered by the destination.">
449444
Opaque data
450445
<input cdsText
451446
type="text"

src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-topic-form/rgw-topic-form.component.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import {
2626
Endpoint
2727
} from '~/app/shared/models/topic.model';
2828

29-
const BASE_URL = 'rgw/topic';
29+
const BASE_URL = 'rgw/destination';
3030
@Component({
3131
selector: 'cd-rgw-topic-form',
3232
templateUrl: './rgw-topic-form.component.html',
@@ -65,9 +65,9 @@ export class RgwTopicFormComponent extends CdForm implements OnInit, AfterViewCh
6565
private route: ActivatedRoute
6666
) {
6767
super();
68-
this.editing = this.router.url.startsWith(`/rgw/topic/${URLVerbs.EDIT}`);
68+
this.editing = this.router.url.startsWith(`/${BASE_URL}/${URLVerbs.EDIT}`);
6969
this.action = this.editing ? this.actionLabels.EDIT : this.actionLabels.CREATE;
70-
this.resource = $localize`topic`;
70+
this.resource = $localize`notification destination`;
7171
}
7272

7373
ngAfterViewChecked(): void {
@@ -397,8 +397,8 @@ export class RgwTopicFormComponent extends CdForm implements OnInit, AfterViewCh
397397
return this.topicForm.setErrors({ cdSubmitButton: true });
398398
}
399399
const notificationTitle = this.editing
400-
? $localize`Topic updated successfully`
401-
: $localize`Topic created successfully`;
400+
? $localize`Notification destination updated successfully`
401+
: $localize`Notification destination created successfully`;
402402
const formValue = this.topicForm.getRawValue();
403403
const topicPolicy = this.getTopicPolicy();
404404
const payload = this.generatePayload(formValue, topicPolicy);

src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-topic-list/rgw-topic-list.component.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<ng-container>
22
<cd-table #table
3+
headerTitle="Notification destination"
4+
headerDescription="Delivers bucket and object change notifications to external services like Kafka or AMQP."
35
[autoReload]="false"
46
[data]="topics$ | async"
57
[columns]="columns"

src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-topic-list/rgw-topic-list.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { Topic } from '~/app/shared/models/topic.model';
2222
import { BehaviorSubject, Observable, of, Subscriber } from 'rxjs';
2323
import { catchError, shareReplay, switchMap } from 'rxjs/operators';
2424

25-
const BASE_URL = 'rgw/topic';
25+
const BASE_URL = 'rgw/destination';
2626
@Component({
2727
selector: 'cd-rgw-topic-list',
2828
templateUrl: './rgw-topic-list.component.html',
@@ -129,13 +129,13 @@ export class RgwTopicListComponent extends ListWithDetails implements OnInit {
129129
const key = this.selection.first().key;
130130
const name = this.selection.first().name;
131131
this.modalService.show(DeleteConfirmationModalComponent, {
132-
itemDescription: $localize`Topic`,
132+
itemDescription: $localize`Notification destination`,
133133
itemNames: [name],
134134
submitActionObservable: () => {
135135
return new Observable((observer: Subscriber<any>) => {
136136
this.taskWrapper
137137
.wrapTaskAroundCall({
138-
task: new FinishedTask('rgw/topic/delete', {
138+
task: new FinishedTask(`${BASE_URL}/delete`, {
139139
name: [name]
140140
}),
141141
call: this.rgwTopicService.delete(key)

0 commit comments

Comments
 (0)