Skip to content

Commit 3df5d5c

Browse files
Merge pull request #1662 from rocket-admin/frontend_rename_widget_to_panel
rename "widget" and "chart" to "panel" in dashboard UI and analytics
2 parents 858b0d9 + 1e84c0e commit 3df5d5c

6 files changed

Lines changed: 26 additions & 26 deletions

File tree

frontend/src/app/components/dashboards/dashboard-view/dashboard-view.component.html

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<div class="dashboard-view-page">
44
<div class="dashboard-header">
55
<div class="header-left">
6-
<button mat-icon-button (click)="navigateBack()" matTooltip="Back to dashboards">
6+
<button type="button" mat-icon-button (click)="navigateBack()" matTooltip="Back to dashboards">
77
<mat-icon>arrow_back</mat-icon>
88
</button>
99
<div class="header-info">
@@ -22,11 +22,11 @@ <h1 class="mat-h1">{{ dashboard()?.name || 'Loading...' }}</h1>
2222
data-testid="edit-mode-toggle">
2323
Edit mode
2424
</mat-slide-toggle>
25-
<button mat-flat-button color="primary"
25+
<button type="button" mat-flat-button color="primary"
2626
(click)="openAddPanelDialog()"
2727
data-testid="add-panel-button">
2828
<mat-icon>add</mat-icon>
29-
Add chart
29+
Add panel
3030
</button>
3131
</div>
3232
}
@@ -41,11 +41,11 @@ <h1 class="mat-h1">{{ dashboard()?.name || 'Loading...' }}</h1>
4141
@if (!loading() && gridsterItems().length === 0) {
4242
<div class="no-panels">
4343
<mat-icon class="no-panels-icon">bar_chart</mat-icon>
44-
<h3>No charts yet</h3>
45-
<p>Add charts to visualize your data from saved queries.</p>
46-
<button mat-flat-button color="primary" (click)="openAddPanelDialog()">
44+
<h3>No panels yet</h3>
45+
<p>Add panels to visualize your data from saved queries.</p>
46+
<button type="button" mat-flat-button color="primary" (click)="openAddPanelDialog()">
4747
<mat-icon>add</mat-icon>
48-
Add chart
48+
Add panel
4949
</button>
5050
</div>
5151
}
@@ -56,19 +56,19 @@ <h3>No charts yet</h3>
5656
<gridster-item [item]="item" class="panel-item" [class.edit-mode]="editMode()">
5757
<div class="panel-header">
5858
<span class="panel-title">{{ panelRef.savedQuery()?.name || 'Loading...' }}</span>
59-
<button mat-icon-button [matMenuTriggerFor]="panelMenu" class="panel-menu-button">
59+
<button type="button" mat-icon-button [matMenuTriggerFor]="panelMenu" class="panel-menu-button">
6060
<mat-icon>more_vert</mat-icon>
6161
</button>
6262
<mat-menu #panelMenu="matMenu">
6363
<a mat-menu-item [routerLink]="['/panels', connectionId(), item.widget.query_id]">
6464
<mat-icon>tune</mat-icon>
65-
<span>Configure chart</span>
65+
<span>Configure panel</span>
6666
</a>
67-
<button mat-menu-item (click)="openEditPanelDialog(item.widget)">
67+
<button type="button" mat-menu-item (click)="openEditPanelDialog(item.widget)">
6868
<mat-icon>swap_horiz</mat-icon>
6969
<span>Change query</span>
7070
</button>
71-
<button mat-menu-item (click)="openDeletePanelDialog(item.widget)" class="delete-action">
71+
<button type="button" mat-menu-item (click)="openDeletePanelDialog(item.widget)" class="delete-action">
7272
<mat-icon color="warn">delete</mat-icon>
7373
<span>Delete</span>
7474
</button>

frontend/src/app/components/dashboards/dashboard-view/dashboard-view.component.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,9 @@ export class DashboardViewComponent implements OnInit {
191191
},
192192
});
193193
this.angulartics2.eventTrack.next({
194-
action: 'Dashboards: add widget dialog opened',
194+
action: 'Dashboards: add panel dialog opened',
195195
});
196-
posthog.capture('Dashboards: add widget dialog opened');
196+
posthog.capture('Dashboards: add panel dialog opened');
197197

198198
const result = await dialogRef.afterClosed().toPromise();
199199
if (result) {
@@ -211,9 +211,9 @@ export class DashboardViewComponent implements OnInit {
211211
},
212212
});
213213
this.angulartics2.eventTrack.next({
214-
action: 'Dashboards: edit widget dialog opened',
214+
action: 'Dashboards: edit panel dialog opened',
215215
});
216-
posthog.capture('Dashboards: edit widget dialog opened');
216+
posthog.capture('Dashboards: edit panel dialog opened');
217217

218218
const result = await dialogRef.afterClosed().toPromise();
219219
if (result) {
@@ -231,9 +231,9 @@ export class DashboardViewComponent implements OnInit {
231231
},
232232
});
233233
this.angulartics2.eventTrack.next({
234-
action: 'Dashboards: delete widget dialog opened',
234+
action: 'Dashboards: delete panel dialog opened',
235235
});
236-
posthog.capture('Dashboards: delete widget dialog opened');
236+
posthog.capture('Dashboards: delete panel dialog opened');
237237

238238
const result = await dialogRef.afterClosed().toPromise();
239239
if (result) {

frontend/src/app/components/dashboards/panel-delete-dialog/panel-delete-dialog.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ export class PanelDeleteDialogComponent {
3434
);
3535
if (result) {
3636
this.angulartics2.eventTrack.next({
37-
action: 'Dashboards: widget deleted successfully',
37+
action: 'Dashboards: panel deleted successfully',
3838
});
39-
posthog.capture('Dashboards: widget deleted successfully');
39+
posthog.capture('Dashboards: panel deleted successfully');
4040
this.dialogRef.close(true);
4141
}
4242
this.submitting.set(false);

frontend/src/app/components/dashboards/panel-edit-dialog/panel-edit-dialog.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<form [formGroup]="form" (ngSubmit)="onSubmit()">
2-
<h2 mat-dialog-title>{{ isEdit ? 'Edit panel' : 'Add chart' }}</h2>
2+
<h2 mat-dialog-title>{{ isEdit ? 'Edit panel' : 'Add panel' }}</h2>
33

44
<mat-dialog-content>
55
@if (savedQueries().length > 0) {
@@ -27,7 +27,7 @@ <h2 mat-dialog-title>{{ isEdit ? 'Edit panel' : 'Add chart' }}</h2>
2727
<div class="no-queries-message">
2828
<mat-icon class="no-queries-icon">code</mat-icon>
2929
<h3>No saved queries yet</h3>
30-
<p>Create a saved query first to add it as a chart on this dashboard.</p>
30+
<p>Create a saved query first to add it as a panel on this dashboard.</p>
3131
<a mat-stroked-button color="primary"
3232
[routerLink]="['/panels', data.connectionId, 'new']"
3333
(click)="dialogRef.close()">

frontend/src/app/components/dashboards/panel-edit-dialog/panel-edit-dialog.component.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ export class PanelEditDialogComponent implements OnInit {
7979
);
8080
if (result) {
8181
this.angulartics2.eventTrack.next({
82-
action: 'Dashboards: widget updated successfully',
82+
action: 'Dashboards: panel updated successfully',
8383
});
84-
posthog.capture('Dashboards: widget updated successfully');
84+
posthog.capture('Dashboards: panel updated successfully');
8585
this.dialogRef.close(true);
8686
}
8787
} else {
@@ -96,9 +96,9 @@ export class PanelEditDialogComponent implements OnInit {
9696
const result = await this._dashboards.createWidget(this.data.connectionId, this.data.dashboardId, payload);
9797
if (result) {
9898
this.angulartics2.eventTrack.next({
99-
action: 'Dashboards: widget created successfully',
99+
action: 'Dashboards: panel created successfully',
100100
});
101-
posthog.capture('Dashboards: widget created successfully');
101+
posthog.capture('Dashboards: panel created successfully');
102102
this.dialogRef.close(true);
103103
}
104104
}

frontend/src/app/components/dashboards/panel-renderers/text-panel/text-panel.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
} @else {
66
<div class="no-content-container">
77
<p>No content</p>
8-
<p class="hint">Edit this widget to add text content.</p>
8+
<p class="hint">Edit this panel to add text content.</p>
99
</div>
1010
}

0 commit comments

Comments
 (0)