-
Notifications
You must be signed in to change notification settings - Fork 894
feat: Add "Outdated" tooltip and "Update version" button in the Workspaces page #2322
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
Changes from 1 commit
e5cbcd8
9d92df2
58d6a6a
b4bc684
ca18646
d982d55
e6145bd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ import TableRow from "@material-ui/core/TableRow" | |
import TextField from "@material-ui/core/TextField" | ||
import AddCircleOutline from "@material-ui/icons/AddCircleOutline" | ||
import KeyboardArrowRight from "@material-ui/icons/KeyboardArrowRight" | ||
import RefreshIcon from "@material-ui/icons/Refresh" | ||
import SearchIcon from "@material-ui/icons/Search" | ||
import useTheme from "@material-ui/styles/useTheme" | ||
import dayjs from "dayjs" | ||
|
@@ -26,6 +27,7 @@ import { CloseDropdown, OpenDropdown } from "../../components/DropdownArrows/Dro | |
import { EmptyState } from "../../components/EmptyState/EmptyState" | ||
import { | ||
HelpTooltip, | ||
HelpTooltipAction, | ||
HelpTooltipLink, | ||
HelpTooltipLinksGroup, | ||
HelpTooltipText, | ||
|
@@ -54,6 +56,11 @@ export const Language = { | |
workspaceTooltipLink1: "Create workspaces", | ||
workspaceTooltipLink2: "Connect with SSH", | ||
workspaceTooltipLink3: "Editors and IDEs", | ||
outdatedLabel: "Outdated", | ||
upToDateLabel: "Up to date", | ||
versionTooltipText: | ||
"Looks like the version you are using for this workspace is outdated and there is a newest version that you could use.", | ||
updateVersionLabel: "Update version", | ||
} | ||
|
||
const WorkspaceHelpTooltip: React.FC = () => { | ||
|
@@ -76,6 +83,20 @@ const WorkspaceHelpTooltip: React.FC = () => { | |
) | ||
} | ||
|
||
const OutdatedHelpTooltip: React.FC<{ onUpdateVersion: () => void }> = ({ onUpdateVersion }) => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this file is getting really big. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, it is but, for now, I think it is ok. What do you think? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can leave it for now. I want to talk about directory structure at the next FE Variety - maybe we can look at pulling stuff apart then. |
||
return ( | ||
<HelpTooltip size="small"> | ||
<HelpTooltipTitle>{Language.outdatedLabel}</HelpTooltipTitle> | ||
<HelpTooltipText>{Language.versionTooltipText}</HelpTooltipText> | ||
<HelpTooltipLinksGroup> | ||
<HelpTooltipAction icon={RefreshIcon} onClick={onUpdateVersion}> | ||
{Language.updateVersionLabel} | ||
</HelpTooltipAction> | ||
</HelpTooltipLinksGroup> | ||
</HelpTooltip> | ||
) | ||
} | ||
|
||
interface FilterFormValues { | ||
query: string | ||
} | ||
|
@@ -256,9 +277,16 @@ export const WorkspacesPageView: FC<WorkspacesPageViewProps> = ({ loading, works | |
<TableCell>{workspace.template_name}</TableCell> | ||
<TableCell> | ||
{workspace.outdated ? ( | ||
<span style={{ color: theme.palette.error.main }}>outdated</span> | ||
<span className={styles.outdatedLabel}> | ||
{Language.outdatedLabel} | ||
<OutdatedHelpTooltip | ||
onUpdateVersion={() => { | ||
console.log("UPDATE!!") | ||
}} | ||
/> | ||
</span> | ||
) : ( | ||
<span style={{ color: theme.palette.text.secondary }}>up to date</span> | ||
<span style={{ color: theme.palette.text.secondary }}>{Language.upToDateLabel}</span> | ||
)} | ||
</TableCell> | ||
<TableCell> | ||
|
@@ -341,4 +369,10 @@ const useStyles = makeStyles((theme) => ({ | |
arrowCell: { | ||
display: "flex", | ||
}, | ||
outdatedLabel: { | ||
color: theme.palette.error.main, | ||
display: "flex", | ||
alignItems: "center", | ||
gap: theme.spacing(0.5), | ||
}, | ||
})) |
Uh oh!
There was an error while loading. Please reload this page.