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

refactor(site): remove version and last built from workspace header#10495

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 3 commits intomainfrombq/tiny-ws-header-refactor
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
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
4 changes: 2 additions & 2 deletionssite/src/components/Stats/Stats.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
import { type CSSObject, type Interpolation, type Theme } from "@emotion/react";
import Box from "@mui/material/Box";
import { type ComponentProps, type FC } from "react";
import {ReactNode,type ComponentProps, type FC } from "react";

export const Stats: FC<ComponentProps<typeof Box>> = (props) => {
return <Box {...props} css={styles.stats} />;
Expand All@@ -9,7 +9,7 @@ export const Stats: FC<ComponentProps<typeof Box>> = (props) => {
export const StatsItem: FC<
{
label: string;
value:string | number | JSX.Element;
value:ReactNode;
} & ComponentProps<typeof Box>
> = ({ label, value, ...divProps }) => {
return (
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,7 +20,7 @@ export const Language = {
outdatedLabel: "Outdated",
versionTooltipText:
"This workspace version is outdated and a newer version is available.",
updateVersionLabel: "Update version",
updateVersionLabel: "Update",
};

interface TooltipProps {
Expand Down
9 changes: 8 additions & 1 deletionsite/src/pages/WorkspacePage/BuildRow.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -58,7 +58,11 @@ export const BuildRow: React.FC<BuildRowProps> = ({ build }) => {
</span>
</Stack>

<Stack direction="row" spacing={1}>
<Stack
direction="row"
spacing={1}
css={{ "& strong": { fontWeight: 600 } }}
>
<span css={styles.buildInfo}>
Reason: <strong>{build.reason}</strong>
</span>
Expand DownExpand Up@@ -94,6 +98,9 @@ const styles = {
buildSummary: (theme) => ({
...(theme.typography.body1 as CSSObject),
fontFamily: "inherit",
"& strong": {
fontWeight: 600,
},
}),

buildInfo: (theme) => ({
Expand Down
42 changes: 5 additions & 37 deletionssite/src/pages/WorkspacePage/WorkspaceStats.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,9 +4,7 @@ import Link from "@mui/material/Link";
import { WorkspaceOutdatedTooltip } from "components/WorkspaceOutdatedTooltip/WorkspaceOutdatedTooltip";
import { type FC } from "react";
import { Link as RouterLink } from "react-router-dom";
import { createDayString } from "utils/createDayString";
import {
getDisplayWorkspaceBuildInitiatedBy,
getDisplayWorkspaceTemplateName,
isWorkspaceOn,
workspaceUpdatePolicy,
Expand DownExpand Up@@ -38,12 +36,6 @@ import { Stack } from "components/Stack/Stack";
const Language = {
workspaceDetails: "Workspace Details",
templateLabel: "Template",
statusLabel: "Workspace Status",
versionLabel: "Version",
lastBuiltLabel: "Last built",
outdated: "Outdated",
upToDate: "Up to date",
byLabel: "Last built by",
costLabel: "Daily cost",
updatePolicy: "Update policy",
};
Expand DownExpand Up@@ -72,9 +64,6 @@ export const WorkspaceStats: FC<WorkspaceStatsProps> = ({
onDeadlinePlus,
}) => {
const theme = useTheme();
const initiatedBy = getDisplayWorkspaceBuildInitiatedBy(
workspace.latest_build,
);
const displayTemplateName = getDisplayWorkspaceTemplateName(workspace);
const deadlinePlusEnabled = maxDeadlineIncrease >= 1;
const deadlineMinusEnabled = maxDeadlineDecrease >= 1;
Expand DownExpand Up@@ -103,24 +92,12 @@ export const WorkspaceStats: FC<WorkspaceStatsProps> = ({
css={styles.statsItem}
label={Language.templateLabel}
value={
<Link
component={RouterLink}
to={`/templates/${workspace.template_name}`}
>
{displayTemplateName}
</Link>
}
/>
<StatsItem
css={styles.statsItem}
label={Language.versionLabel}
value={
<>
<div css={{ display: "flex", alignItems: "center", gap: 2 }}>
<Link
component={RouterLink}
to={`/templates/${workspace.template_name}/versions/${workspace.latest_build.template_version_name}`}
to={`/templates/${workspace.template_name}`}
>
{workspace.latest_build.template_version_name}
{displayTemplateName}
</Link>

{workspace.outdated && (
Expand All@@ -131,19 +108,10 @@ export const WorkspaceStats: FC<WorkspaceStatsProps> = ({
ariaLabel="update version"
/>
)}
</>
}
/>
<StatsItem
css={styles.statsItem}
label={Language.lastBuiltLabel}
value={
<>
{upperFirst(createDayString(workspace.latest_build.created_at))}{" "}
by {initiatedBy}
</>
</div>
}
/>

{shouldDisplayScheduleLabel(workspace) && (
<StatsItem
css={styles.statsItem}
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp