- Notifications
You must be signed in to change notification settings - Fork929
feat(site): display version message#8435
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
14 commits Select commitHold shift + click to select a range
5bc48df
Add base
BrunoQuaresma42643b6
Add more info to outdated tooltip
BrunoQuaresma3936a13
Fix link
BrunoQuaresma3496e4d
Fix test
BrunoQuaresmae01ac01
feat(coderd): allow template version message to be set to empty
mafredri273061a
fix(coderd): fix bug in template creation that resets the message
mafredriebd8e0d
make gen
mafredri5904c6d
fix patch in template editor
mafredri9cdce40
fix comment
mafredri46ac0d6
Fix test
BrunoQuaresma434cf2b
Fix fmt
BrunoQuaresma4fff5e2
Fix storybook
BrunoQuaresma4d610e1
Merge branch 'main' into bq/add-version-message
BrunoQuaresmae4196c4
Merge branch 'main' into bq/add-version-message
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
Add more info to outdated tooltip
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
commit42643b63f703d211ed7e20e681bc8195d8b50ae5
There are no files selected for viewing
79 changes: 76 additions & 3 deletionssite/src/components/Tooltips/WorkspaceOutdatedTooltip.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 |
---|---|---|
@@ -10,6 +10,11 @@ import { | ||
import InfoIcon from "@mui/icons-material/InfoOutlined" | ||
import { makeStyles } from "@mui/styles" | ||
import { colors } from "theme/colors" | ||
import { useQuery } from "@tanstack/react-query" | ||
import { getTemplate, getTemplateVersion } from "api/api" | ||
import Box from "@mui/material/Box" | ||
import Skeleton from "@mui/material/Skeleton" | ||
import Link from "@mui/material/Link" | ||
export const Language = { | ||
outdatedLabel: "Outdated", | ||
@@ -20,13 +25,24 @@ export const Language = { | ||
interface TooltipProps { | ||
onUpdateVersion: () => void | ||
templateId: string | ||
ariaLabel?: string | ||
} | ||
export const WorkspaceOutdatedTooltip: FC<TooltipProps> = ({ | ||
onUpdateVersion, | ||
ariaLabel, | ||
templateId, | ||
}) => { | ||
const styles = useStyles() | ||
const { data: activeVersion } = useQuery({ | ||
queryFn: async () => { | ||
const template = await getTemplate(templateId) | ||
const activeVersion = await getTemplateVersion(template.active_version_id) | ||
return activeVersion | ||
}, | ||
queryKey: ["templates", templateId, "activeVersion"], | ||
}) | ||
return ( | ||
<HelpTooltip | ||
@@ -37,6 +53,63 @@ export const WorkspaceOutdatedTooltip: FC< | ||
> | ||
<HelpTooltipTitle>{Language.outdatedLabel}</HelpTooltipTitle> | ||
<HelpTooltipText>{Language.versionTooltipText}</HelpTooltipText> | ||
<Box | ||
sx={{ | ||
display: "flex", | ||
flexDirection: "column", | ||
gap: 1, | ||
py: 1, | ||
fontSize: 13, | ||
}} | ||
> | ||
<Box> | ||
<Box | ||
sx={{ | ||
color: (theme) => theme.palette.text.primary, | ||
fontWeight: 600, | ||
}} | ||
> | ||
New version | ||
</Box> | ||
<Box> | ||
{activeVersion ? ( | ||
<Link | ||
href={`/templates/docker/versions/${activeVersion.name}`} | ||
BrunoQuaresma marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
target="_blank" | ||
sx={{ color: (theme) => theme.palette.primary.light }} | ||
> | ||
{activeVersion.name} | ||
</Link> | ||
) : ( | ||
<Skeleton variant="text" height={20} width={100} /> | ||
)} | ||
</Box> | ||
</Box> | ||
<Box> | ||
<Box | ||
sx={{ | ||
color: (theme) => theme.palette.text.primary, | ||
fontWeight: 600, | ||
}} | ||
> | ||
Message | ||
</Box> | ||
<Box> | ||
{activeVersion ? ( | ||
activeVersion.message === "" ? ( | ||
"No message" | ||
) : ( | ||
activeVersion.message | ||
) | ||
) : ( | ||
<Skeleton variant="text" height={20} width={150} /> | ||
)} | ||
</Box> | ||
</Box> | ||
</Box> | ||
<HelpTooltipLinksGroup> | ||
<HelpTooltipAction | ||
icon={RefreshIcon} | ||
1 change: 1 addition & 0 deletionssite/src/components/WorkspaceStats/WorkspaceStats.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
1 change: 1 addition & 0 deletionssite/src/components/WorkspacesTable/WorkspacesRow.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
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.