Skip to content

Commit 535ef89

Browse files
feat: [DPS-36767] - Embedded metrics dashboard as contextual view in stream (#13492)
* feat: [DPS-36767] - Embedded metrics dashboard as contextual view in stream UI * Added changeset: Stream Metrics tab with embedded metrics dashboard * Hide metrics tab and url behind a flag * Hide tabs when stream query failed * CR changes 1 * merge conflicts fix
1 parent 5476c17 commit 535ef89

25 files changed

Lines changed: 400 additions & 108 deletions
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@linode/manager": Added
3+
---
4+
5+
Stream Metrics tab with embedded metrics dashboard ([#13492](https://github.com/linode/manager/pull/13492))

packages/manager/cypress/e2e/core/delivery/destinations-non-empty-landing-page.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ function editDestinationViaActionMenu(
9292
mockGetDestination(destination);
9393
// Edit destination redirect
9494
ui.actionMenuItem.findByTitle('Edit').click();
95-
cy.url().should('endWith', `/destinations/${destination.id}/edit`);
95+
cy.url().should('endWith', `/destinations/${destination.id}/summary`);
9696
});
9797
}
9898

@@ -181,15 +181,15 @@ describe('destinations landing checks for non-empty state', () => {
181181
});
182182
});
183183

184-
it('navigates to edit page when clicking destination label', () => {
184+
it('navigates to summary page when clicking destination label', () => {
185185
cy.visitWithLogin('/logs/delivery/destinations');
186186
cy.wait('@getDestinations');
187187

188188
const destination = mockAkamaiObjectStorageDestinations[0];
189189
mockGetDestination(destination).as('getDestination');
190190

191191
cy.findByText(destination.label).click();
192-
cy.url().should('endWith', `/destinations/${destination.id}/edit`);
192+
cy.url().should('endWith', `/destinations/${destination.id}/summary`);
193193
cy.wait('@getDestination');
194194
});
195195

@@ -255,7 +255,7 @@ describe('destinations landing checks for non-empty state', () => {
255255
mockGetDestination(destination).as('getDestination');
256256

257257
cy.findByText(destination.label).click();
258-
cy.url().should('endWith', `/destinations/${destination.id}/edit`);
258+
cy.url().should('endWith', `/destinations/${destination.id}/summary`);
259259
cy.wait('@getDestination');
260260
});
261261

packages/manager/cypress/e2e/core/delivery/edit-destination.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ describe('Edit Destination', () => {
4343
describe('given Akamai Object Storage type destination', () => {
4444
beforeEach(() => {
4545
cy.visitWithLogin(
46-
`/logs/delivery/destinations/${mockAkamaiObjectStorageDestination.id}/edit`
46+
`/logs/delivery/destinations/${mockAkamaiObjectStorageDestination.id}/summary`
4747
);
4848
mockGetDestination(mockAkamaiObjectStorageDestination);
4949
});
@@ -201,7 +201,7 @@ describe('Edit Destination', () => {
201201
describe('given Custom HTTPS type destination', () => {
202202
beforeEach(() => {
203203
cy.visitWithLogin(
204-
`/logs/delivery/destinations/${mockCustomHttpsDestination.id}/edit`
204+
`/logs/delivery/destinations/${mockCustomHttpsDestination.id}/summary`
205205
);
206206
mockGetDestination(mockCustomHttpsDestination);
207207
});

packages/manager/cypress/e2e/core/delivery/edit-stream.spec.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,7 @@ describe('Edit Stream', () => {
4646
mockGetStream(mockAuditLogsStream);
4747

4848
// Visit the Edit Stream page
49-
cy.visitWithLogin(
50-
`/logs/delivery/streams/${mockAuditLogsStream.id}/edit/`
51-
);
49+
cy.visitWithLogin(`/logs/delivery/streams/${mockAuditLogsStream.id}`);
5250

5351
const updatedLabel = randomLabel();
5452

@@ -207,9 +205,7 @@ describe('Edit Stream', () => {
207205
mockGetClusters([cluster1, cluster2, cluster3, cluster4]);
208206

209207
// Visit the Edit Stream page
210-
cy.visitWithLogin(
211-
`/logs/delivery/streams/${mockLKEAuditLogsStream.id}/edit/`
212-
);
208+
cy.visitWithLogin(`/logs/delivery/streams/${mockLKEAuditLogsStream.id}`);
213209

214210
const updatedLabel = randomLabel();
215211

packages/manager/cypress/e2e/core/delivery/streams-non-empty-landing-page.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ function editStreamViaActionMenu(tableAlias: string, stream: Stream) {
8888
mockGetStream(stream);
8989
// Edit stream redirect
9090
ui.actionMenuItem.findByTitle('Edit').click();
91-
cy.url().should('endWith', `/streams/${stream.id}/edit`);
91+
cy.url().should('endWith', `/streams/${stream.id}/summary`);
9292
});
9393
}
9494

@@ -180,7 +180,7 @@ describe('Streams non-empty landing page', () => {
180180

181181
// Redirect to stream edit page via name
182182
cy.findByText(exampleStream.label).click();
183-
cy.url().should('endWith', `/streams/${exampleStream.id}/edit`);
183+
cy.url().should('endWith', `/streams/${exampleStream.id}/summary`);
184184
cy.wait(['@getStream', '@getDestinations']);
185185

186186
// Redirect to stream edit page via menu item

packages/manager/src/featureFlags.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ interface AclpLogsFlag extends BetaFeatureFlag {
134134
* This property indicates whether to show Custom HTTPS destination type
135135
*/
136136
customHttpsEnabled?: boolean;
137+
/**
138+
* This property indicates whether to show the "Metrics" tab on Logs Stream details page or not
139+
*/
140+
metricsEnabled?: boolean;
137141
/**
138142
* This property indicates whether the feature is new or not
139143
*/

packages/manager/src/features/Delivery/Destinations/DestinationForm/DestinationEdit.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,14 +216,14 @@ describe('DestinationEdit', () => {
216216
});
217217
});
218218

219-
describe('given Test Connection and Edit Destination buttons', () => {
219+
describe('given Test Connection and Save Changes buttons', () => {
220220
const testConnectionButtonText = 'Test Connection';
221221
const saveDestinationButtonText = 'Save Changes';
222222
const editDestinationSpy = vi.fn();
223223
const verifyDestinationSpy = vi.fn();
224224

225225
describe('when Test Connection button clicked and connection verified positively', () => {
226-
it("should enable Edit Destination button and perform proper call when it's clicked", async () => {
226+
it("should enable Save Changes button and perform proper call when it's clicked", async () => {
227227
server.use(
228228
http.get(`*/monitor/streams/destinations/${destinationId}`, () => {
229229
return HttpResponse.json(mockDestination);
@@ -269,7 +269,7 @@ describe('DestinationEdit', () => {
269269
});
270270

271271
describe('when Test Connection button clicked and connection verified negatively', () => {
272-
it('should not enable Edit Destination button', async () => {
272+
it('should not enable Save Changes button', async () => {
273273
server.use(
274274
http.get(`*/monitor/streams/destinations/${destinationId}`, () => {
275275
return HttpResponse.json(mockDestination);

packages/manager/src/features/Delivery/Destinations/DestinationForm/DestinationEdit.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import type { DestinationFormType } from 'src/features/Delivery/Shared/types';
2525
export const DestinationEdit = () => {
2626
const navigate = useNavigate();
2727
const { destinationId } = useParams({
28-
from: '/logs/delivery/destinations/$destinationId/edit',
28+
from: '/logs/delivery/destinations/$destinationId/summary',
2929
});
3030
const { mutateAsync: updateDestination, isPending: isUpdatingDestination } =
3131
useUpdateDestinationMutation();
@@ -37,7 +37,7 @@ export const DestinationEdit = () => {
3737

3838
const landingHeaderProps: LandingHeaderProps = {
3939
breadcrumbProps: {
40-
pathname: '/logs/delivery/destinations/edit',
40+
pathname: '/logs/delivery/destinations/summary',
4141
crumbOverrides: [
4242
{
4343
label: 'Delivery',
@@ -48,7 +48,7 @@ export const DestinationEdit = () => {
4848
},
4949
docsLink: 'https://techdocs.akamai.com/cloud-computing/docs/log-delivery',
5050
removeCrumbX: [1, 2],
51-
title: `Edit Destination ${destinationId}`,
51+
title: `Destination ${destinationId}`,
5252
};
5353

5454
const form = useForm<DestinationFormType>({
@@ -136,7 +136,7 @@ export const DestinationEdit = () => {
136136

137137
return (
138138
<>
139-
<DocumentTitleSegment segment="Edit Destination" />
139+
<DocumentTitleSegment segment="Destination" />
140140
<LandingHeader {...landingHeaderProps} />
141141
<FormProvider {...form}>
142142
<DestinationForm

packages/manager/src/features/Delivery/Destinations/DestinationForm/destinationEditLazyRoute.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { createLazyRoute } from '@tanstack/react-router';
33
import { DestinationEdit } from 'src/features/Delivery/Destinations/DestinationForm/DestinationEdit';
44

55
export const destinationEditLazyRoute = createLazyRoute(
6-
'/logs/delivery/destinations/$destinationId/edit'
6+
'/logs/delivery/destinations/$destinationId/summary'
77
)({
88
component: DestinationEdit,
99
});

packages/manager/src/features/Delivery/Destinations/DestinationTableRow.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const DestinationTableRow = React.memo(
2525
<TableCell>
2626
<LinkWithTooltipAndEllipsis
2727
pendoId="Logs Delivery Destinations-Name"
28-
to={`/logs/delivery/destinations/${id}/edit`}
28+
to={`/logs/delivery/destinations/${id}/summary`}
2929
>
3030
{destination.label}
3131
</LinkWithTooltipAndEllipsis>

0 commit comments

Comments
 (0)