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

fix: Remove "Starts at Manual" label#4179

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
kylecarbs merged 2 commits intomainfrommanualfix
Oct 3, 2022
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
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -72,6 +72,22 @@ WorkspaceOffLong.args = {
},
}

export const WorkspaceOn = Template.bind({})
WorkspaceOn.args = {
deadlineMinusEnabled: () => true,
deadlinePlusEnabled: () => true,
workspace: {
...Mocks.MockWorkspace,

latest_build: {
...Mocks.MockWorkspaceBuild,
transition: "start",
deadline: "2022-05-17T23:59:00.00Z",
},
ttl_ms: 2 * 365 * 24 * 60 * 60 * 1000, // 2 years
},
}

export const CannotEdit = Template.bind({})
CannotEdit.args = {
workspace: {
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -31,6 +31,16 @@ export const shouldDisplayPlusMinus = (workspace: Workspace): boolean => {
return isWorkspaceOn(workspace) && Boolean(workspace.latest_build.deadline)
}

export const shouldDisplayScheduleLabel = (workspace: Workspace): boolean => {
if (shouldDisplayPlusMinus(workspace)) {
return true
}
if (isWorkspaceOn(workspace)) {
return false
}
return Boolean(workspace.autostart_schedule)
}

export interface WorkspaceScheduleButtonProps {
workspace: Workspace
onDeadlinePlus: () => void
Expand DownExpand Up@@ -60,41 +70,45 @@ export const WorkspaceScheduleButton: React.FC<WorkspaceScheduleButtonProps> = (

return (
<span className={styles.wrapper}>
<span className={styles.label}>
<WorkspaceScheduleLabel workspace={workspace} />
{canUpdateWorkspace && shouldDisplayPlusMinus(workspace) && (
<span className={styles.actions}>
<IconButton
className={styles.iconButton}
size="small"
disabled={!deadlineMinusEnabled()}
onClick={onDeadlineMinus}
>
<Tooltip title={t("workspaceScheduleButton.editDeadlineMinus")}>
<RemoveIcon />
</Tooltip>
</IconButton>
<IconButton
className={styles.iconButton}
size="small"
disabled={!deadlinePlusEnabled()}
onClick={onDeadlinePlus}
>
<Tooltip title={t("workspaceScheduleButton.editDeadlinePlus")}>
<AddIcon />
</Tooltip>
</IconButton>
</span>
)}
</span>
{shouldDisplayScheduleLabel(workspace) && (
<span className={styles.label}>
<WorkspaceScheduleLabel workspace={workspace} />
{canUpdateWorkspace && shouldDisplayPlusMinus(workspace) && (
<span className={styles.actions}>
<IconButton
className={styles.iconButton}
size="small"
disabled={!deadlineMinusEnabled()}
onClick={onDeadlineMinus}
>
<Tooltip title={t("workspaceScheduleButton.editDeadlineMinus")}>
<RemoveIcon />
</Tooltip>
</IconButton>
<IconButton
className={styles.iconButton}
size="small"
disabled={!deadlinePlusEnabled()}
onClick={onDeadlinePlus}
>
<Tooltip title={t("workspaceScheduleButton.editDeadlinePlus")}>
<AddIcon />
</Tooltip>
</IconButton>
</span>
)}
</span>
)}
<>
<Button
ref={anchorRef}
startIcon={<ScheduleIcon />}
onClick={() => {
setIsOpen(true)
}}
className={styles.scheduleButton}
className={`${styles.scheduleButton} ${
shouldDisplayScheduleLabel(workspace) ? "label" : ""
}`}
>
{t("workspaceScheduleButton.schedule")}
</Button>
Expand DownExpand Up@@ -124,8 +138,8 @@ const useStyles = makeStyles((theme) => ({
wrapper: {
display: "inline-flex",
alignItems: "center",
border: `1px solid ${theme.palette.divider}`,
borderRadius: `${theme.shape.borderRadius}px`,
border: `1px solid ${theme.palette.divider}`,

[theme.breakpoints.down("sm")]: {
flexDirection: "column",
Expand DownExpand Up@@ -153,15 +167,22 @@ const useStyles = makeStyles((theme) => ({
},
scheduleButton: {
border: "none",
borderLeft: `1px solid ${theme.palette.divider}`,
borderRadius: `0px ${theme.shape.borderRadius}px ${theme.shape.borderRadius}px 0px`,
borderRadius: `${theme.shape.borderRadius}px`,
flexShrink: 0,

"&.label": {
borderLeft: `1px solid ${theme.palette.divider}`,
borderRadius: `0px ${theme.shape.borderRadius}px ${theme.shape.borderRadius}px 0px`,
},

[theme.breakpoints.down("sm")]: {
width: "100%",
borderLeft: 0,
borderTop: `1px solid ${theme.palette.divider}`,
borderRadius: `0 0 ${theme.shape.borderRadius}px ${theme.shape.borderRadius}px`,

"&.label": {
borderRadius: `0 0 ${theme.shape.borderRadius}px ${theme.shape.borderRadius}px`,
borderLeft: 0,
borderTop: `1px solid ${theme.palette.divider}`,
},
},
},
iconButton: {
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp