Skip to content

Commit 4dcfcb6

Browse files
upcoming: [DPS-33104] DataStream: routes, feature flag, tabs (#12155)
* upcoming: [DPS-33104] DataStream: routes, feature flag, tabs * [DPS-33104] CR: Fix braces * [DPS-33104] CR: remove braces, idx, default export * [DPS-33104] CR: update header's spacing * [DPS-33104] CR: remove react-router-dom dependencies * [DPS-33104] CR: replace TabLinkList with TanStackTabLinkList --------- Co-authored-by: Jaalah Ramos <125309814+jaalah-akamai@users.noreply.github.com>
1 parent f3639f9 commit 4dcfcb6

12 files changed

Lines changed: 159 additions & 0 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@linode/manager": Upcoming Features
3+
---
4+
5+
DataStream: routes, feature flag, tabs ([#12155](https://github.com/linode/manager/pull/12155))

packages/manager/eslint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,7 @@ export const baseConfig = [
403403
// for each new features added to the migration router, add its directory here
404404
'src/features/Betas/**/*',
405405
'src/features/Domains/**/*',
406+
'src/features/DataStream/**/*',
406407
'src/features/Firewalls/**/*',
407408
'src/features/Images/**/*',
408409
'src/features/Longview/**/*',

packages/manager/src/components/PrimaryNav/PrimaryNav.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export type NavEntity =
3838
| 'Cloud Load Balancers'
3939
| 'Dashboard'
4040
| 'Databases'
41+
| 'DataStream'
4142
| 'Domains'
4243
| 'Firewalls'
4344
| 'Help & Support'
@@ -239,6 +240,12 @@ export const PrimaryNav = (props: PrimaryNavProps) => {
239240
display: 'Longview',
240241
href: '/longview',
241242
},
243+
{
244+
display: 'DataStream',
245+
hide: !flags.aclpLogs?.enabled,
246+
href: '/datastream',
247+
isBeta: flags.aclpLogs?.beta,
248+
},
242249
],
243250
name: 'Monitor',
244251
},

packages/manager/src/dev-tools/FeatureFlagTool.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const options: { flag: keyof Flags; label: string }[] = [
2222
{ flag: 'aclp', label: 'CloudPulse' },
2323
{ flag: 'aclpAlerting', label: 'CloudPulse Alerting' },
2424
{ flag: 'aclpIntegration', label: 'ACLP Integration' },
25+
{ flag: 'aclpLogs', label: 'ACLP Logs' },
2526
{ flag: 'apl', label: 'Akamai App Platform' },
2627
{ flag: 'blockStorageEncryption', label: 'Block Storage Encryption (BSE)' },
2728
{ flag: 'disableLargestGbPlans', label: 'Disable Largest GB Plans' },

packages/manager/src/featureFlags.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ export interface Flags {
110110
aclpAlerting: AclpAlerting;
111111
aclpAlertServiceTypeConfig: AclpAlertServiceTypeConfig[];
112112
aclpIntegration: boolean;
113+
aclpLogs: BetaFeatureFlag;
113114
aclpReadEndpoint: string;
114115
aclpResourceTypeMap: CloudPulseResourceTypeMapFlag[];
115116
apicliButtonCopy: string;
@@ -244,6 +245,7 @@ export type ProductInformationBannerLocation =
244245
| 'Account'
245246
| 'Betas'
246247
| 'Databases'
248+
| 'DataStream'
247249
| 'Domains'
248250
| 'Firewalls'
249251
| 'Identity and Access'
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
import * as React from 'react';
2+
3+
import { DocumentTitleSegment } from 'src/components/DocumentTitle';
4+
import { LandingHeader } from 'src/components/LandingHeader';
5+
import { ProductInformationBanner } from 'src/components/ProductInformationBanner/ProductInformationBanner';
6+
import { SuspenseLoader } from 'src/components/SuspenseLoader';
7+
import { SafeTabPanel } from 'src/components/Tabs/SafeTabPanel';
8+
import { TabPanels } from 'src/components/Tabs/TabPanels';
9+
import { Tabs } from 'src/components/Tabs/Tabs';
10+
import { TanStackTabLinkList } from 'src/components/Tabs/TanStackTabLinkList';
11+
import { useTabs } from 'src/hooks/useTabs';
12+
13+
const Destinations = React.lazy(() =>
14+
import('./Destinations/Destinations').then((module) => ({
15+
default: module.Destinations,
16+
}))
17+
);
18+
19+
const Streams = React.lazy(() =>
20+
import('./Streams/Streams').then((module) => ({
21+
default: module.Streams,
22+
}))
23+
);
24+
25+
export const DataStreamLanding = React.memo(() => {
26+
const landingHeaderProps = {
27+
breadcrumbProps: {
28+
pathname: '/datastream',
29+
},
30+
entity: 'DataStream',
31+
title: 'DataStream',
32+
};
33+
34+
const { handleTabChange, tabIndex, tabs } = useTabs([
35+
{
36+
to: '/datastream/streams',
37+
title: 'Streams',
38+
},
39+
{
40+
to: '/datastream/destinations',
41+
title: 'Destinations',
42+
},
43+
]);
44+
45+
return (
46+
<>
47+
<ProductInformationBanner bannerLocation="DataStream" />
48+
<DocumentTitleSegment segment="DataStream" />
49+
<LandingHeader {...landingHeaderProps} spacingBottom={4} />
50+
51+
<Tabs index={tabIndex} onChange={handleTabChange}>
52+
<TanStackTabLinkList tabs={tabs} />
53+
54+
<React.Suspense fallback={<SuspenseLoader />}>
55+
<TabPanels>
56+
<SafeTabPanel index={0}>
57+
<Streams />
58+
</SafeTabPanel>
59+
<SafeTabPanel index={1}>
60+
<Destinations />
61+
</SafeTabPanel>
62+
</TabPanels>
63+
</React.Suspense>
64+
</Tabs>
65+
</>
66+
);
67+
});
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import * as React from 'react';
2+
3+
export const Destinations = () => {
4+
return <p>Content for Destinations tab</p>;
5+
};
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import * as React from 'react';
2+
3+
export const Streams = () => {
4+
return <p>Content for Streams tab</p>;
5+
};
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { NotFound } from '@linode/ui';
2+
import { Outlet } from '@tanstack/react-router';
3+
import React from 'react';
4+
5+
import { SuspenseLoader } from 'src/components/SuspenseLoader';
6+
import { useFlags } from 'src/hooks/useFlags';
7+
8+
export const DataStreamRoute = () => {
9+
const flags = useFlags();
10+
const { aclpLogs } = flags;
11+
return (
12+
<React.Suspense fallback={<SuspenseLoader />}>
13+
{aclpLogs?.enabled ? <Outlet /> : <NotFound />}
14+
</React.Suspense>
15+
);
16+
};
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { createLazyRoute } from '@tanstack/react-router';
2+
3+
import { DataStreamLanding } from 'src/features/DataStream/DataStreamLanding';
4+
5+
export const dataStreamLandingLazyRoute = createLazyRoute('/datastream')({
6+
component: DataStreamLanding,
7+
});

0 commit comments

Comments
 (0)