- Notifications
You must be signed in to change notification settings - Fork929
feat: Improve empty states for workspaces and templates#1950
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes from1 commit
Commits
Show all changes
15 commits Select commitHold shift + click to select a range
7711138
Add empty state for workspace
BrunoQuaresmad1ddfae
Improve template empty
BrunoQuaresma8796128
Increase template page top spacing
BrunoQuaresma65678ab
Make footer more soft
BrunoQuaresmad812056
Merge branch 'main' of github.com:coder/coder into bq/improve-empty-s…
BrunoQuaresmadf6bc50
Add empty state to the form
BrunoQuaresmaeaf4a78
Add no templates storybook
BrunoQuaresma8d5e771
Update site/src/pages/TemplatesPage/TemplatesPageView.tsx
BrunoQuaresmab7dbfff
Improve verbiage
BrunoQuaresmac3ca61b
Add template link to the Language obj
BrunoQuaresmadfef339
Update message if user has no permission to create template
BrunoQuaresma5300bf8
Update no perm text
BrunoQuaresma114f65a
Fix workspace page view stories
BrunoQuaresma12a55cb
Fix tests
BrunoQuaresma57e909d
Remove unecessary language and fix tests
BrunoQuaresmaFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
Improve template empty
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
commitd1ddfaecba7a6f6a1333c5e6946577a05f41b865
There are no files selected for viewing
18 changes: 13 additions & 5 deletionssite/src/components/CodeExample/CodeExample.tsx
This file contains hidden or 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
12 changes: 9 additions & 3 deletionssite/src/components/EmptyState/EmptyState.tsx
This file contains hidden or 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
41 changes: 23 additions & 18 deletionssite/src/pages/TemplatesPage/TemplatesPageView.tsx
This file contains hidden or 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 |
---|---|---|
@@ -8,9 +8,10 @@ import TableRow from "@material-ui/core/TableRow" | ||
import dayjs from "dayjs" | ||
import relativeTime from "dayjs/plugin/relativeTime" | ||
import { FC } from "react" | ||
import * as TypesGen from "../../api/typesGenerated" | ||
import { AvatarData } from "../../components/AvatarData/AvatarData" | ||
import { CodeExample } from "../../components/CodeExample/CodeExample" | ||
import { EmptyState } from "../../components/EmptyState/EmptyState" | ||
import { Margins } from "../../components/Margins/Margins" | ||
import { Stack } from "../../components/Stack/Stack" | ||
import { TableLoader } from "../../components/TableLoader/TableLoader" | ||
@@ -27,6 +28,16 @@ export const Language = { | ||
emptyViewCreateCTA: "Create a template", | ||
emptyViewCreate: "to standardize development workspaces for your team.", | ||
emptyViewNoPerms: "No templates have been created! Contact your Coder administrator.", | ||
emptyMessage: "Create your first template", | ||
emptyDescription: ( | ||
<> | ||
To create a workspace you need to have a template. You can{" "} | ||
<Link target="_blank" href="https://github.com/coder/coder/blob/main/docs/templates.md"> | ||
create one from scratch | ||
</Link>{" "} | ||
or use a built-in template by typing the following Coder CLI command: | ||
BrunoQuaresma marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
</> | ||
), | ||
} | ||
export interface TemplatesPageViewProps { | ||
@@ -53,8 +64,14 @@ export const TemplatesPageView: FC<TemplatesPageViewProps> = (props) => { | ||
{!props.loading && !props.templates?.length && ( | ||
<TableRow> | ||
<TableCell colSpan={999}> | ||
<EmptyState | ||
message={Language.emptyMessage} | ||
description={Language.emptyDescription} | ||
descriptionClassName={styles.emptyDescription} | ||
cta={<CodeExample code="coder template init" />} | ||
/> | ||
{/* {props.canCreateTemplate ? ( | ||
BrunoQuaresma marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
<span> | ||
<Link component={RouterLink} to="/templates/new"> | ||
{Language.emptyViewCreateCTA} | ||
@@ -63,8 +80,7 @@ export const TemplatesPageView: FC<TemplatesPageViewProps> = (props) => { | ||
</span> | ||
) : ( | ||
<span>{Language.emptyViewNoPerms}</span> | ||
)} */} | ||
</TableCell> | ||
</TableRow> | ||
)} | ||
@@ -94,18 +110,7 @@ const useStyles = makeStyles((theme) => ({ | ||
root: { | ||
marginTop: theme.spacing(3), | ||
}, | ||
emptyDescription: { | ||
maxWidth: theme.spacing(62), | ||
}, | ||
})) |
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.