Skip to content

Commit 13ab9c3

Browse files
giuseppe-stedutomdonadoni
authored andcommitted
fix(workflow-details): make step labels less prominent (reanahub#397)
Closes reanahub#352
1 parent 660584e commit 13ab9c3

File tree

3 files changed

+19
-13
lines changed

3 files changed

+19
-13
lines changed

reana-ui/src/components/WorkflowBadges.js

+10-4
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@
99
*/
1010

1111
import styles from "./WorkflowBadges.module.scss";
12+
import PropTypes from "prop-types";
1213
import { Label } from "semantic-ui-react";
1314
import { JupyterNotebookIcon } from "~/components";
1415
import { INTERACTIVE_SESSION_URL } from "~/client";
1516
import { LauncherLabel } from "~/components";
1617
import { getReanaToken } from "~/selectors";
1718
import { useSelector } from "react-redux";
1819

19-
export default function WorkflowBadges({ workflow }) {
20+
export default function WorkflowBadges({ workflow, badgeSize = "tiny" }) {
2021
const reanaToken = useSelector(getReanaToken);
2122
const {
2223
size,
@@ -32,23 +33,23 @@ export default function WorkflowBadges({ workflow }) {
3233
{workflow.duration && (
3334
<Label
3435
basic
35-
size="tiny"
36+
size={badgeSize}
3637
content={`CPU ${workflow.duration}`}
3738
icon="clock"
3839
/>
3940
)}
4041
{hasDiskUsage && (
4142
<Label
4243
basic
43-
size="tiny"
44+
size={badgeSize}
4445
content={`Disk ${size.human_readable}`}
4546
icon="hdd"
4647
/>
4748
)}
4849
<LauncherLabel url={launcherURL} />
4950
{isSessionOpen && (
5051
<Label
51-
size="tiny"
52+
size={badgeSize}
5253
content={"Notebook"}
5354
icon={
5455
<i className="icon">
@@ -64,3 +65,8 @@ export default function WorkflowBadges({ workflow }) {
6465
</div>
6566
);
6667
}
68+
69+
WorkflowBadges.propTypes = {
70+
workflow: PropTypes.object.isRequired,
71+
badgeSize: PropTypes.string,
72+
};

reana-ui/src/pages/workflowDetails/WorkflowDetails.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,11 @@ export default function WorkflowDetails() {
160160
</div>
161161
</div>
162162
<div className={styles.badges}>
163-
<WorkflowBadges className={styles.badges} workflow={workflow} />
163+
<WorkflowBadges
164+
className={styles.badges}
165+
workflow={workflow}
166+
badgeSize="medium"
167+
/>
164168
</div>
165169
<Tab
166170
menu={{ secondary: true, pointing: true }}

reana-ui/src/pages/workflowDetails/components/WorkflowLogs.js

+4-8
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ function JobLogs({ logs }) {
7171

7272
const steps = Object.entries(logs).map(([id, log]) => ({
7373
key: id,
74-
text: log.job_name || log.backend_job_id,
74+
text:
75+
(log.job_name || log.backend_job_id) +
76+
(log.duration !== null ? ` (${log.duration})` : ``),
7577
icon: {
7678
name: "dot circle outline",
7779
size: "small",
@@ -100,14 +102,8 @@ function JobLogs({ logs }) {
100102
</div>
101103
{log && (
102104
<div className={styles["step-tags"]}>
103-
<Label color={statusMapping[log.status].color}>
105+
<Label basic color={statusMapping[log.status].color}>
104106
{log.status}
105-
{log.duration && (
106-
<span className={styles["step-duration"]}>
107-
{" "}
108-
{statusMapping[log.status].preposition} {log.duration}
109-
</span>
110-
)}
111107
</Label>
112108
<Label>
113109
<Icon name="cloud" />

0 commit comments

Comments
 (0)