Merge pull request #169 from CrabHo/fix/procs-name

fix: steps of non multi pipline is not display
This commit is contained in:
Laszlo Fogas 2021-03-15 08:47:55 +01:00 committed by GitHub
commit 4e94ded326
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,7 +18,7 @@ const renderEnviron = data => {
class ProcListHolder extends Component {
constructor(props, context) {
super(props, context);
this.state = { open: false };
this.state = { open: !this.props.renderName };
}
toggleOpen = () => {
@ -26,31 +26,26 @@ class ProcListHolder extends Component {
};
render() {
const { vars, renderName, children } = this.props;
const { vars, children } = this.props;
const groupExpandStatus = this.state.open
? styles.collapsed
: styles.expanded;
let name = (
<div>
<div>{vars.name === "woodpecker" ? "default" : vars.name}</div>
{vars.environ ? Object.entries(vars.environ).map(renderEnviron) : ""}
</div>
);
return (
<div className={styles.list}>
{renderName && vars.name !== "drone" ? (
<div
onClick={this.toggleOpen}
className={`${styles.group} ${groupExpandStatus}`}
>
<StatusText status={vars.state} text={vars.name} />
</div>
) : null}
{vars.environ ? (
<div
onClick={this.toggleOpen}
className={`${styles.group} ${groupExpandStatus}`}
>
<StatusText
status={vars.state}
text={Object.entries(vars.environ).map(renderEnviron)}
/>
</div>
) : null}
<div
onClick={this.toggleOpen}
className={`${styles.group} ${groupExpandStatus}`}
>
<StatusText status={vars.state} text={name} />
</div>
<div className={!this.state.open ? styles.hide : ""}>{children}</div>
</div>
);