Skip to content

Commit fa90485

Browse files
author
Pedro Pimentel
committed
Add change requests
1 parent d8e0e28 commit fa90485

2 files changed

Lines changed: 4 additions & 18 deletions

File tree

packages/@aws-cdk/aws-cloudwatch/lib/dashboard.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ export interface DashboardProps {
7676
*/
7777
export class Dashboard extends Resource {
7878
/**
79-
* The name of this queue
79+
* The name of this dashboard
8080
* @attribute
8181
*/
82-
public readonly dashboardName?: string | undefined;
82+
public readonly dashboardName: string;
8383
private readonly rows: IWidget[] = [];
8484

8585
constructor(scope: Construct, id: string, props: DashboardProps = {}) {
@@ -113,7 +113,8 @@ export class Dashboard extends Resource {
113113
}),
114114
});
115115

116-
this.dashboardName = dashboard.dashboardName;
116+
this.dashboardName = this.getResourceNameAttribute(dashboard.ref);
117+
// dashboard.dashboardName;
117118

118119
(props.widgets || []).forEach(row => {
119120
this.addWidgets(...row);

packages/@aws-cdk/aws-cloudwatch/test/dashboard.test.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -161,21 +161,6 @@ describe('Dashboard', () => {
161161

162162
});
163163

164-
test('DashboardName is exposed correctly when provided', () => {
165-
// GIVEN
166-
const app = new App();
167-
const stack = new Stack(app, 'MyStack');
168-
169-
// WHEN
170-
const dash = new Dashboard(stack, 'MyDashboard', {
171-
dashboardName: 'MyCustomDashboardName',
172-
});
173-
174-
// THEN
175-
expect(dash.dashboardName).toEqual('MyCustomDashboardName');
176-
177-
});
178-
179164
test('throws if DashboardName is not valid', () => {
180165
// GIVEN
181166
const app = new App();

0 commit comments

Comments
 (0)