Skip to content

Commit 90d31a5

Browse files
authored
feat: add spacing between title and table when title is set (#718)
* feat: add spacing between title and table when title is set * fix: removed margin prop from table header
1 parent 6ebd2c9 commit 90d31a5

File tree

5 files changed

+7
-18
lines changed

5 files changed

+7
-18
lines changed

projects/dashboards/src/widgets/header/widget-header.model.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,4 @@ export class WidgetHeaderModel {
4949
} as ModelModelPropertyTypeInstance
5050
})
5151
public link?: LinkWidgetModel;
52-
53-
@ModelProperty({
54-
key: 'top-margin',
55-
type: BOOLEAN_PROPERTY.type
56-
})
57-
public topMargin?: boolean = false;
5852
}

projects/distributed-tracing/src/shared/dashboard/widgets/table/table-widget-base.model.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,6 @@ import { TableWidgetControlCheckboxOptionModel } from './table-widget-control-ch
2323
import { TableWidgetControlSelectOptionModel } from './table-widget-control-select-option.model';
2424

2525
export abstract class TableWidgetBaseModel extends BaseModel {
26-
@ModelProperty({
27-
key: 'title',
28-
displayName: 'Title',
29-
type: STRING_PROPERTY.type
30-
})
31-
// @deprecated
32-
public title?: string;
33-
3426
@ModelProperty({
3527
// tslint:disable-next-line: no-object-literal-type-assertion
3628
type: {

projects/distributed-tracing/src/shared/dashboard/widgets/table/table-widget-renderer.component.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
.table-content-container {
44
@include flex-layout(column);
5+
6+
&.titled {
7+
padding-top: 12px;
8+
}
59
}
610

711
.table {

projects/distributed-tracing/src/shared/dashboard/widgets/table/table-widget-renderer.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,12 @@ import { TableWidgetModel } from './table-widget.model';
4747
changeDetection: ChangeDetectionStrategy.OnPush,
4848
template: `
4949
<ht-titled-content
50+
class="table-title"
5051
[title]="this.model.header?.title | htDisplayTitle"
5152
[link]="this.model.header?.link?.url"
5253
[linkLabel]="this.model.header?.link?.displayText"
5354
>
54-
<div class="table-content-container">
55+
<div class="table-content-container" [class.titled]="this.model.header?.title !== undefined">
5556
<ht-table-controls
5657
class="table-controls"
5758
[searchEnabled]="!!this.api.model.getSearchAttribute()"
@@ -68,7 +69,6 @@ import { TableWidgetModel } from './table-widget.model';
6869
6970
<ht-table
7071
class="table"
71-
[ngClass]="{ 'header-margin': this.model.header?.topMargin }"
7272
[columnConfigs]="this.columnConfigs$ | async"
7373
[metadata]="this.metadata$ | async"
7474
[mode]="this.model.mode"

projects/observability/src/pages/apis/backend-detail/overview/backend-overview.component.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,8 +452,7 @@ export class BackendOverviewComponent {
452452
style: TableStyle.Embedded,
453453
header: {
454454
type: 'widget-header',
455-
title: 'Services',
456-
'top-margin': true
455+
title: 'Services'
457456
},
458457
pageable: false,
459458
columns: [

0 commit comments

Comments
 (0)