Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,11 @@ const StyledInputLabel = styled(Label)<InputLabelProps>`
`;

export const InputLabel = StyledInputLabel;

export const StyledExpressionLabel = styled(Label)<InputLabelProps>`
display: block;
font-size: ${({ theme }) => theme.font.size.md};
font-weight: ${({ theme }) => theme.font.weight.medium};
color: ${({ theme }) => theme.font.color.primary};
margin-bottom: ${({ theme }) => theme.spacing(3)};
`;
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { useDateTimeFormat } from '@/localization/hooks/useDateTimeFormat';
import { InputHint } from '@/ui/input/components/InputHint';
import { InputLabel } from '@/ui/input/components/InputLabel';
import {
InputLabel,
StyledExpressionLabel,
} from '@/ui/input/components/InputLabel';
import type { WorkflowCronTrigger } from '@/workflow/types/Workflow';
import { describeCronExpression } from '@/workflow/workflow-trigger/utils/cron-to-human/describeCronExpression';
import styled from '@emotion/styled';
Expand Down Expand Up @@ -61,18 +64,28 @@ const getNextExecutions = (cronExpression: string): Date[] => {
return [];
}
};

const StyledContainer = styled.div`
background: ${({ theme }) => theme.background.primary};
display: flex;
flex-direction: column;
gap: ${({ theme }) => theme.spacing(3)};
margin-top: ${({ theme }) => theme.spacing(2)};
gap: ${({ theme }) => theme.spacing(4)};
`;

const StyledSection = styled.div`
display: flex;
flex-direction: column;
gap: ${({ theme }) => theme.spacing(1)};
background: ${({ theme }) => theme.background.secondary};
border: 1px solid ${({ theme }) => theme.border.color.light};
border-radius: ${({ theme }) => theme.border.radius.sm};
padding: ${({ theme }) => theme.spacing(2)};
`;

const StyledExecutionItem = styled.div`
color: ${({ theme }) => theme.font.color.secondary};
font-family: monospace;
font-size: ${({ theme }) => theme.font.size.xs};
margin-bottom: ${({ theme }) => theme.spacing(0.5)};
`;

const StyledScheduleDescription = styled.div`
Expand All @@ -86,13 +99,6 @@ const StyledScheduleSubtext = styled.div`
font-size: ${({ theme }) => theme.font.size.xs};
`;

const StyledExecutionItem = styled.div`
color: ${({ theme }) => theme.font.color.secondary};
font-family: monospace;
font-size: ${({ theme }) => theme.font.size.xs};
margin-bottom: ${({ theme }) => theme.spacing(0.5)};
`;

type CronExpressionHelperProps = {
trigger: WorkflowCronTrigger;
isVisible?: boolean;
Expand Down Expand Up @@ -155,7 +161,7 @@ export const CronExpressionHelper = ({

{nextExecutions.length > 0 && (
<StyledSection>
<InputLabel>{t`Upcoming execution times (${timeZone})`}</InputLabel>
<StyledExpressionLabel>{t`Upcoming execution times (${timeZone})`}</StyledExpressionLabel>
{nextExecutions.slice(0, 3).map((execution, index) => (
<StyledExecutionItem key={index}>
{formatDateTimeString({
Expand Down