Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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
BrunoQuaresma merged 14 commits intomainfrombq/add-version-message
Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
Show all changes
14 commits
Select commitHold shift + click to select a range
5bc48df
Add base
BrunoQuaresmaJul 11, 2023
42643b6
Add more info to outdated tooltip
BrunoQuaresmaJul 11, 2023
3936a13
Fix link
BrunoQuaresmaJul 12, 2023
3496e4d
Fix test
BrunoQuaresmaJul 12, 2023
e01ac01
feat(coderd): allow template version message to be set to empty
mafredriJul 12, 2023
273061a
fix(coderd): fix bug in template creation that resets the message
mafredriJul 12, 2023
ebd8e0d
make gen
mafredriJul 12, 2023
5904c6d
fix patch in template editor
mafredriJul 12, 2023
9cdce40
fix comment
mafredriJul 12, 2023
46ac0d6
Fix test
BrunoQuaresmaJul 12, 2023
434cf2b
Fix fmt
BrunoQuaresmaJul 12, 2023
4fff5e2
Fix storybook
BrunoQuaresmaJul 12, 2023
4d610e1
Merge branch 'main' into bq/add-version-message
BrunoQuaresmaJul 12, 2023
e4196c4
Merge branch 'main' into bq/add-version-message
BrunoQuaresmaJul 12, 2023
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
PrevPrevious commit
NextNext commit
Add more info to outdated tooltip
  • Loading branch information
@BrunoQuaresma
BrunoQuaresma committedJul 11, 2023
commit42643b63f703d211ed7e20e681bc8195d8b50ae5
79 changes: 76 additions & 3 deletionssite/src/components/Tooltips/WorkspaceOutdatedTooltip.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -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",
Expand All@@ -20,13 +25,24 @@ export const Language = {

interface TooltipProps {
onUpdateVersion: () => void
templateId: string
ariaLabel?: string
}

export const WorkspaceOutdatedTooltip: FC<
React.PropsWithChildren<TooltipProps>
> = ({ onUpdateVersion, ariaLabel }) => {
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
Expand All@@ -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}`}
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}
Expand Down
1 change: 1 addition & 0 deletionssite/src/components/WorkspaceStats/WorkspaceStats.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -102,6 +102,7 @@ export const WorkspaceStats: FC<WorkspaceStatsProps> = ({

{workspace.outdated && (
<WorkspaceOutdatedTooltip
templateId={workspace.template_id}
onUpdateVersion={handleUpdate}
ariaLabel="update version"
/>
Expand Down
1 change: 1 addition & 0 deletionssite/src/components/WorkspacesTable/WorkspacesRow.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -35,6 +35,7 @@ export const WorkspacesRow: FC<{
{workspace.name}
{workspace.outdated && (
<WorkspaceOutdatedTooltip
templateId={workspace.template_id}
onUpdateVersion={() => {
onUpdateWorkspace(workspace)
}}
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp