1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2024-12-30 10:11:23 +02:00

fix: non multi pipline steps is not display

This commit is contained in:
CrabHo 2021-03-11 13:50:37 +08:00
parent 0aa66ce743
commit 87928d2600

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.vars.environ };
}
toggleOpen = () => {
@ -30,27 +30,22 @@ class ProcListHolder extends Component {
const groupExpandStatus = this.state.open
? styles.collapsed
: styles.expanded;
let name = "default";
if (vars.environ) {
name = Object.entries(vars.environ).map(renderEnviron);
} else if (renderName && vars.name !== "woodpecker") {
name = vars.name;
}
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>
);