Skip to content
Permalink
Browse files
fix issue with cron rendering
  • Loading branch information
bradrydzewski committed Jun 15, 2021
1 parent d9e6fc7 commit 9a35313019c79ff53cb0639fd8c80d5fe4e455fb
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 1 deletion.
@@ -39,6 +39,8 @@ const BuildList = (props) => {
commit={build.after}
branch={build.target}
target={build.deploy_to}
parent={build.parent}
cron={build.cron}
refs={build.ref}
/>
<div className={cx('timing')}>
@@ -5,6 +5,7 @@ import React from 'react';
import Avatar from 'components/shared/avatar';
import {
CommitLabel,
CronLabel,
BranchLabel,
BuildLabel,
EnvironmentLabel,
@@ -93,7 +94,19 @@ const RollbackActivity = (props) => (
</div>
<div className={cx('chunk')} data-type="chunk">
<span>to build</span>
{wrapBuildLink(<BuildLabel className={cx('label')} build={props.number} />, props)}
{wrapBuildLink(<BuildLabel className={cx('label')} build={props.parent} />, props)}
</div>
</div>
);

const CronActivity = (props) => (
<div className={cx('activity', props.className || '')}>
<div className={cx('chunk')} data-type="chunk">
<Avatar path={props.avatar} alt={props.actor} text={props.actor} className={cx('avatar')} />
</div>
<div className={cx('chunk')} data-type="chunk">
<span>executed scheduled task</span>
<CronLabel className={cx('label')} name={props.cron} />
</div>
</div>
);
@@ -129,6 +142,8 @@ const SimpleActivity = (props) => {
return PromoteActivity(props);
case 'rollback':
return RollbackActivity(props);
case 'cron':
return CronActivity(props);
default:
return PushActivity(props);
}
@@ -3,6 +3,7 @@ export {
BranchLabel,
BuildLabel,
CommitLabel,
CronLabel,
EnvironmentLabel,
PullRequestLabel,
TagLabel,
@@ -7,6 +7,7 @@ import { ReactComponent as Number } from 'svg/scm/number.svg';
import { ReactComponent as PullRequest } from 'svg/scm/pr.svg';
import { ReactComponent as Tag } from 'svg/scm/tag.svg';
import { ReactComponent as Box } from 'svg/scm/box.svg';
import { ReactComponent as Clock } from 'svg/clock.svg';

import styles from './label.module.scss';

@@ -117,6 +118,21 @@ export const EnvironmentLabel = ({ className, environment }) => {
);
};

/**
* CronLabel renders a label for a cron execution.
* @param {object} props Component props
* @param {string} props.className
* @param {string} props.name
*/
export const CronLabel = ({ className, name }) => {
return (
<div className={cx('root', className || '')}>
<Clock />
{name}
</div>
);
};

/**
* BuildLabel renders a label for a build.
* @param {object} props Component props
@@ -129,6 +129,8 @@ const Header = (props) => {
branch={data.target}
target={data.deploy_to}
refs={data.ref}
cron={data.cron}
parent={build.parent}
deeplink
/>
</div>

0 comments on commit 9a35313

Please sign in to comment.