-
Notifications
You must be signed in to change notification settings - Fork 364
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
feat: [M3-6464] β Add resource links to empty Volumes landing page #9065
Merged
dwiley-akamai
merged 6 commits into
linode:develop
from
dwiley-akamai:M3-6464-volumes-empty-state-links
May 2, 2023
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
e82097c
new VolumesLandingEmptyState component and styles file + associated cβ¦
DevDW 4c1eaff
Adjustments
DevDW 7336b16
volumesGuidesMoreLinkText -- have what is passed to the event match tβ¦
DevDW 23ddfb8
Address copy feedback; fix .svg styling; cleanup; changelog
DevDW 3758c1f
Feedback: PointerIcon, docsLink, JSX variable name capitalizations, sβ¦
DevDW 339f431
Merge in latest develop
DevDW File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
packages/manager/src/features/Volumes/VolumesLandingEmptyState.styles.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { styled } from '@mui/material/styles'; | ||
import VolumeIcon from 'src/assets/icons/entityIcons/volume.svg'; | ||
|
||
const StyledVolumeIcon = styled(VolumeIcon)(() => ({ | ||
transform: 'scale(0.75)', | ||
})); | ||
|
||
export { StyledVolumeIcon }; |
170 changes: 170 additions & 0 deletions
170
packages/manager/src/features/Volumes/VolumesLandingEmptyState.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,170 @@ | ||
import * as React from 'react'; | ||
import { useHistory } from 'react-router-dom'; | ||
import DocsIcon from 'src/assets/icons/docs.svg'; | ||
import ExternalLinkIcon from 'src/assets/icons/external-link.svg'; | ||
import PointerIcon from 'src/assets/icons/pointer.svg'; | ||
import YoutubeIcon from 'src/assets/icons/youtube.svg'; | ||
import List from 'src/components/core/List'; | ||
import ListItem from 'src/components/core/ListItem'; | ||
import Typography from 'src/components/core/Typography'; | ||
import Link from 'src/components/Link'; | ||
import Placeholder from 'src/components/Placeholder'; | ||
import LinksSection from 'src/features/linodes/LinodesLanding/LinksSection'; | ||
import LinkSubSection from 'src/features/linodes/LinodesLanding/LinksSubSection'; | ||
import { | ||
docsLink, | ||
getLinkOnClick, | ||
guidesMoreLinkText, | ||
youtubeChannelLink, | ||
youtubeMoreLinkLabel, | ||
youtubeMoreLinkText, | ||
} from 'src/utilities/emptyStateLandingUtils'; | ||
import { sendEvent } from 'src/utilities/ga'; | ||
import { StyledVolumeIcon } from './VolumesLandingEmptyState.styles'; | ||
|
||
const guidesLinkData = [ | ||
{ | ||
to: 'https://www.linode.com/docs/products/storage/block-storage/', | ||
text: 'Overview of Block Storage', | ||
}, | ||
{ | ||
to: 'https://www.linode.com/docs/products/storage/block-storage/guides/', | ||
text: 'Create and Manage Block Storage Volumes', | ||
}, | ||
{ | ||
to: | ||
'https://www.linode.com/docs/products/storage/block-storage/guides/configure-volume/', | ||
text: 'Configure a Volume on a Compute Instance', | ||
}, | ||
]; | ||
|
||
const youtubeLinkData = [ | ||
{ | ||
to: 'https://www.youtube.com/watch?v=7ti25oK7UMA', | ||
text: 'How to Use Block Storage with Your Linode', | ||
}, | ||
{ | ||
to: 'https://www.youtube.com/watch?v=8G0cNZZIxNc', | ||
text: 'Block Storage Vs Object Storage', | ||
}, | ||
{ | ||
to: 'https://www.youtube.com/watch?v=Z9jZv_IHO2s', | ||
text: | ||
'How to use Block Storage to Increase Space on Your Nextcloud Instance', | ||
}, | ||
]; | ||
|
||
const gaCategory = 'Volumes landing page empty'; | ||
const linkGAEventTemplate = { | ||
category: gaCategory, | ||
action: 'Click:link', | ||
}; | ||
|
||
const GuideLinks = ( | ||
<List> | ||
{guidesLinkData.map((linkData) => ( | ||
<ListItem key={linkData.to}> | ||
<Link | ||
to={linkData.to} | ||
onClick={getLinkOnClick(linkGAEventTemplate, linkData.text)} | ||
> | ||
{linkData.text} | ||
</Link> | ||
</ListItem> | ||
))} | ||
</List> | ||
); | ||
|
||
const YoutubeLinks = ( | ||
<List> | ||
{youtubeLinkData.map((linkData) => ( | ||
<ListItem key={linkData.to}> | ||
<Link | ||
onClick={getLinkOnClick(linkGAEventTemplate, linkData.text)} | ||
to={linkData.to} | ||
> | ||
{linkData.text} | ||
<ExternalLinkIcon /> | ||
</Link> | ||
</ListItem> | ||
))} | ||
</List> | ||
); | ||
|
||
const VolumesLandingEmptyState = () => { | ||
const { push } = useHistory(); | ||
|
||
return ( | ||
<Placeholder | ||
title="Volumes" | ||
subtitle="NVM block storage service" | ||
icon={StyledVolumeIcon} | ||
isEntity | ||
buttonProps={[ | ||
{ | ||
onClick: () => { | ||
sendEvent({ | ||
category: gaCategory, | ||
action: 'Click:button', | ||
label: 'Create Volume', | ||
}); | ||
push('/volumes/create'); | ||
}, | ||
children: 'Create Volume', | ||
}, | ||
]} | ||
linksSection={ | ||
<div style={{ maxWidth: '762px' }}> | ||
<LinksSection> | ||
<LinkSubSection | ||
title="Getting Started Guides" | ||
icon={<DocsIcon />} | ||
MoreLink={(props) => ( | ||
<Link | ||
onClick={getLinkOnClick( | ||
linkGAEventTemplate, | ||
guidesMoreLinkText | ||
)} | ||
to={docsLink} | ||
{...props} | ||
> | ||
{guidesMoreLinkText} | ||
<PointerIcon /> | ||
</Link> | ||
)} | ||
> | ||
{GuideLinks} | ||
</LinkSubSection> | ||
<LinkSubSection | ||
title="Video Playlist" | ||
icon={<YoutubeIcon />} | ||
external | ||
MoreLink={(props) => ( | ||
<Link | ||
onClick={getLinkOnClick( | ||
linkGAEventTemplate, | ||
youtubeMoreLinkLabel | ||
)} | ||
to={youtubeChannelLink} | ||
{...props} | ||
> | ||
{youtubeMoreLinkText} | ||
<ExternalLinkIcon style={{ marginLeft: 8 }} /> | ||
</Link> | ||
)} | ||
> | ||
{YoutubeLinks} | ||
</LinkSubSection> | ||
</LinksSection> | ||
</div> | ||
} | ||
> | ||
<Typography variant="subtitle1"> | ||
Attach scalable, fault-tolerant, and performant block storage volumes to | ||
your Linode Compute Instances or Kubernetes Clusters. | ||
</Typography> | ||
</Placeholder> | ||
); | ||
}; | ||
|
||
export { VolumesLandingEmptyState }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really didn't want to do this, but no other approach was fruitful. I tried defining a
StyledLinksSection
in this file'sstyles.ts
counterpart, but the styling wasn't getting applied even with!important
's. Placing this styling at other levels, such as inLinksSection.tsx
orPlaceholder.tsx
, would impact all empty state landing pages.This specific
maxWidth
value approximately matches the width of the Database empty state landing page.