Skip to content

ref(crons): Remove inline grid column values for styled component #69070

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

Merged
merged 1 commit into from
Apr 17, 2024
Merged
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
27 changes: 19 additions & 8 deletions static/app/views/monitors/components/monitorCreateForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export default function MonitorCreateForm() {
submitLabel={t('Create')}
>
<FieldContainer>
<MultiColumnInput columns="230px 230px 1fr">
<ProjectOwnerNameInputs>
<StyledSentryProjectSelectorField
name="project"
projects={filteredProjects}
Expand All @@ -125,7 +125,7 @@ export default function MonitorCreateForm() {
stacked
inline={false}
/>
</MultiColumnInput>
</ProjectOwnerNameInputs>
<LabelText>{t('SCHEDULE')}</LabelText>
<ScheduleOptions>
<Observer>
Expand All @@ -146,7 +146,7 @@ export default function MonitorCreateForm() {
>
<PanelBody withPadding>
<ScheduleLabel>{t('Crontab Schedule')}</ScheduleLabel>
<MultiColumnInput columns="1fr 1fr">
<CrontabInputs>
<StyledTextField
name="config.schedule"
placeholder="* * * * *"
Expand All @@ -168,7 +168,7 @@ export default function MonitorCreateForm() {
<CronstrueText>
{parsedSchedule ?? t('(invalid schedule)')}
</CronstrueText>
</MultiColumnInput>
</CrontabInputs>
</PanelBody>
</SchedulePanel>
<SchedulePanel
Expand All @@ -177,7 +177,7 @@ export default function MonitorCreateForm() {
>
<PanelBody withPadding>
<ScheduleLabel>{t('Interval Schedule')}</ScheduleLabel>
<MultiColumnInput columns="auto 1fr 2fr">
<IntervalInputs>
<Label>{t('Every')}</Label>
<StyledNumberField
name="config.schedule.frequency"
Expand All @@ -200,7 +200,7 @@ export default function MonitorCreateForm() {
stacked
inline={false}
/>
</MultiColumnInput>
</IntervalInputs>
</PanelBody>
</SchedulePanel>
</Fragment>
Expand Down Expand Up @@ -273,11 +273,22 @@ const ScheduleOptions = styled('div')`
grid-template-columns: 1fr 1fr;
`;

const MultiColumnInput = styled('div')<{columns?: string}>`
const MultiColumnInput = styled('div')`
display: grid;
align-items: center;
gap: ${space(1)};
grid-template-columns: ${p => p.columns};
`;

const ProjectOwnerNameInputs = styled(MultiColumnInput)`
grid-template-columns: 230px 230px 1fr;
`;

const CrontabInputs = styled(MultiColumnInput)`
grid-template-columns: 1fr 1fr;
`;

const IntervalInputs = styled(MultiColumnInput)`
grid-template-columns: auto 1fr 2fr;
`;

const CronstrueText = styled(LabelText)`
Expand Down
Loading