Skip to content

upcoming: [DPS-33112] Add Streams empty state and Create Stream views #12235

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Upcoming Features
---

DataStream: add Streams empty state and Create Stream views ([#12235](https://github.com/linode/manager/pull/12235))
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ const Destinations = React.lazy(() =>
);

const Streams = React.lazy(() =>
import('./Streams/Streams').then((module) => ({
default: module.Streams,
import('./Streams/StreamsLanding').then((module) => ({
default: module.StreamsLanding,
}))
);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { makeStyles } from 'tss-react/mui';

import type { Theme } from '@mui/material/styles';

export const useStyles = makeStyles()((theme: Theme) => ({
root: {
'& .mlMain': {
[theme.breakpoints.down('lg')]: {
flexBasis: '100%',
maxWidth: '100%',
},
},
'& .mlSidebar': {
[theme.breakpoints.down('lg')]: {
background: theme.color.white,
flexBasis: '100%',
maxWidth: '100%',
marginTop: theme.spacingFunction(16),
padding: theme.spacingFunction(8),
},
},
},
}));
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { Stack } from '@linode/ui';
import Grid from '@mui/material/Grid';
import * as React from 'react';

import { DocumentTitleSegment } from 'src/components/DocumentTitle';
import { LandingHeader } from 'src/components/LandingHeader';
import { StreamCreateCheckoutBar } from 'src/features/DataStream/Streams/StreamCreate/StreamCreateCheckoutBar';
import { StreamCreateDataSet } from 'src/features/DataStream/Streams/StreamCreate/StreamCreateDataSet';
import { StreamCreateDelivery } from 'src/features/DataStream/Streams/StreamCreate/StreamCreateDelivery';
import { StreamCreateGeneralInfo } from 'src/features/DataStream/Streams/StreamCreate/StreamCreateGeneralInfo';

import { useStyles } from './StreamCreate.styles';

export const StreamCreate = () => {
const { classes } = useStyles();

const landingHeaderProps = {
breadcrumbProps: {
pathname: '/datastream/streams/create',
crumbOverrides: [
{
label: 'DataStream',
position: 1,
},
],
},
removeCrumbX: 2,
title: 'Create Stream',
};

return (
<Grid className={classes.root} container>
<DocumentTitleSegment segment="Create Stream" />
<LandingHeader {...landingHeaderProps} />

<Grid className="mlMain">
<Stack spacing={2}>
<StreamCreateGeneralInfo />
<StreamCreateDataSet />
<StreamCreateDelivery />
</Stack>
</Grid>
<Grid className="mlSidebar">
<StreamCreateCheckoutBar />
</Grid>
</Grid>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { Divider } from '@linode/ui';
import * as React from 'react';

import { CheckoutBar } from 'src/components/CheckoutBar/CheckoutBar';

export const StreamCreateCheckoutBar = () => {
const onDeploy = () => {};

return (
<CheckoutBar
disabled={true}
heading="Stream Summary"
onDeploy={onDeploy}
priceSelectionText="Select Data Set and define a Destination to view pricing and create a stream."
submitText="Create Stream"
>
<Divider dark spacingBottom={0} spacingTop={16} />
</CheckoutBar>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Box, Paper, Typography } from '@linode/ui';
import React from 'react';

import { DocsLink } from 'src/components/DocsLink/DocsLink';

export const StreamCreateDataSet = () => {
return (
<Paper>
<Box display="flex" justifyContent="space-between">
<Typography variant="h2">Data Set</Typography>
<DocsLink
// TODO: Change the link when proper documentation is ready

Check warning on line 12 in packages/manager/src/features/DataStream/Streams/StreamCreate/StreamCreateDataSet.tsx

View workflow job for this annotation

GitHub Actions / ESLint Review (manager)

[eslint] reported by reviewdog 🐢 Complete the task associated to this "TODO" comment. Raw Output: {"ruleId":"sonarjs/todo-tag","severity":1,"message":"Complete the task associated to this \"TODO\" comment.","line":12,"column":14,"nodeType":null,"messageId":"completeTODO","endLine":12,"endColumn":18}
href="https://techdocs.akamai.com/cloud-computing/docs"
label="Docs"
/>
</Box>
</Paper>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Box, Paper, Typography } from '@linode/ui';
import React from 'react';

import { DocsLink } from 'src/components/DocsLink/DocsLink';

export const StreamCreateDelivery = () => {
return (
<Paper>
<Box display="flex" justifyContent="space-between">
<Typography variant="h2">Delivery</Typography>
<DocsLink
// TODO: Change the link when proper documentation is ready

Check warning on line 12 in packages/manager/src/features/DataStream/Streams/StreamCreate/StreamCreateDelivery.tsx

View workflow job for this annotation

GitHub Actions / ESLint Review (manager)

[eslint] reported by reviewdog 🐢 Complete the task associated to this "TODO" comment. Raw Output: {"ruleId":"sonarjs/todo-tag","severity":1,"message":"Complete the task associated to this \"TODO\" comment.","line":12,"column":14,"nodeType":null,"messageId":"completeTODO","endLine":12,"endColumn":18}
href="https://techdocs.akamai.com/cloud-computing/docs"
label="Docs"
/>
</Box>
</Paper>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Paper, Typography } from '@linode/ui';
import React from 'react';

export const StreamCreateGeneralInfo = () => {
return (
<Paper>
<Typography variant="h2">General Information</Typography>
</Paper>
);
};

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import * as React from 'react';

import { StreamsLandingEmptyState } from 'src/features/DataStream/Streams/StreamsLandingEmptyState';

export const StreamsLanding = () => {
return <StreamsLandingEmptyState />;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { useNavigate } from '@tanstack/react-router';
import * as React from 'react';

import ComputeIcon from 'src/assets/icons/entityIcons/compute.svg';
import { DocumentTitleSegment } from 'src/components/DocumentTitle';
import { ResourcesSection } from 'src/components/EmptyLandingPageResources/ResourcesSection';
import { sendEvent } from 'src/utilities/analytics/utils';

import {
gettingStartedGuides,
headers,
linkAnalyticsEvent,
} from './StreamsLandingEmptyStateData';

export const StreamsLandingEmptyState = () => {
const navigate = useNavigate();

return (
<>
<DocumentTitleSegment segment="Streams" />
<ResourcesSection
buttonProps={[
{
children: 'Create Stream',
onClick: () => {
sendEvent({
action: 'Click:button',
category: linkAnalyticsEvent.category,
label: 'Create Stream',
});
navigate({ to: '/datastream/streams/create' });
},
},
]}
gettingStartedGuidesData={gettingStartedGuides}
headers={headers}
icon={ComputeIcon}
linkAnalyticsEvent={linkAnalyticsEvent}
/>
</>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import {
docsLink,
guidesMoreLinkText,
} from 'src/utilities/emptyStateLandingUtils';

import type {
ResourcesHeaders,
ResourcesLinks,
ResourcesLinkSection,
} from 'src/components/EmptyLandingPageResources/ResourcesLinksTypes';

export const headers: ResourcesHeaders = {
title: 'Streams',
subtitle: '',
description: 'Create a data stream and configure delivery of cloud logs',
};

export const linkAnalyticsEvent: ResourcesLinks['linkAnalyticsEvent'] = {
action: 'Click:link',
category: 'Streams landing page empty',
};

export const gettingStartedGuides: ResourcesLinkSection = {
links: [
{
// TODO: Change the link and text when proper documentation is ready

Check warning on line 26 in packages/manager/src/features/DataStream/Streams/StreamsLandingEmptyStateData.ts

View workflow job for this annotation

GitHub Actions / ESLint Review (manager)

[eslint] reported by reviewdog 🐢 Complete the task associated to this "TODO" comment. Raw Output: {"ruleId":"sonarjs/todo-tag","severity":1,"message":"Complete the task associated to this \"TODO\" comment.","line":26,"column":10,"nodeType":null,"messageId":"completeTODO","endLine":26,"endColumn":14}
text: 'Getting started guide',
to: 'https://techdocs.akamai.com/cloud-computing/docs',
},
],
moreInfo: {
text: guidesMoreLinkText,
to: docsLink,
},
title: 'Getting Started Guides',
};
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import { createLazyRoute } from '@tanstack/react-router';

import { DataStreamLanding } from 'src/features/DataStream/DataStreamLanding';
import { StreamCreate } from 'src/features/DataStream/Streams/StreamCreate/StreamCreate';

export const dataStreamLandingLazyRoute = createLazyRoute('/datastream')({
component: DataStreamLanding,
});

export const streamCreateLazyRoute = createLazyRoute(
'/datastream/streams/create'
)({
component: StreamCreate,
});
9 changes: 8 additions & 1 deletion packages/manager/src/routes/datastream/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ const streamsRoute = createRoute({
import('./dataStreamLazyRoutes').then((m) => m.dataStreamLandingLazyRoute)
);

const streamsCreateRoute = createRoute({
getParentRoute: () => dataStreamRoute,
path: 'streams/create',
}).lazy(() =>
import('./dataStreamLazyRoutes').then((m) => m.streamCreateLazyRoute)
);

const destinationsRoute = createRoute({
getParentRoute: () => dataStreamRoute,
path: 'destinations',
Expand All @@ -35,6 +42,6 @@ const destinationsRoute = createRoute({

export const dataStreamRouteTree = dataStreamRoute.addChildren([
dataStreamLandingRoute,
streamsRoute,
streamsRoute.addChildren([streamsCreateRoute]),
destinationsRoute,
]);