From 15d3c3748694b66174d048138221c5327ac1a6b2 Mon Sep 17 00:00:00 2001 From: Shota Suzuki Date: Wed, 13 Feb 2019 00:19:44 +0900 Subject: [PATCH 1/2] Update status-filter --- digdag-ui/console.jsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/digdag-ui/console.jsx b/digdag-ui/console.jsx index 49b660b3dc..2a896c339d 100644 --- a/digdag-ui/console.jsx +++ b/digdag-ui/console.jsx @@ -686,10 +686,12 @@ class StatusFilter extends React.Component { return (
- Status:  - +
+ + +
{childrenWithProps}
) From b4e86b6235316416ab17752554ab9d3f385f1051 Mon Sep 17 00:00:00 2001 From: Shota Suzuki Date: Wed, 13 Feb 2019 00:22:52 +0900 Subject: [PATCH 2/2] Linting --- digdag-ui/console.jsx | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/digdag-ui/console.jsx b/digdag-ui/console.jsx index 2a896c339d..338dff05c7 100644 --- a/digdag-ui/console.jsx +++ b/digdag-ui/console.jsx @@ -644,12 +644,12 @@ class ProjectsView extends React.Component { class StatusFilter extends React.Component { static Status = class Status { - static ALL = "All"; - static SUCCESS = "Success"; - static FAILURE = "Failure"; - static PENDING = "Pending"; - static CANCELED = "Canceled"; - static CANCELING = "Canceling"; + static ALL = 'All'; + static SUCCESS = 'Success'; + static FAILURE = 'Failure'; + static PENDING = 'Pending'; + static CANCELED = 'Canceled'; + static CANCELING = 'Canceling'; static allStatus () { return [Status.ALL, Status.SUCCESS, Status.FAILURE, Status.PENDING, Status.CANCELED, Status.CANCELING] @@ -660,20 +660,20 @@ class StatusFilter extends React.Component { selectedStatus: StatusFilter.Status.ALL }; - filterSessionsByStatus(sessions, selectedStatus) { + filterSessionsByStatus (sessions, selectedStatus) { switch (selectedStatus) { case StatusFilter.Status.SUCCESS: - return sessions.filter(s => s.lastAttempt.done && s.lastAttempt.success); + return sessions.filter(s => s.lastAttempt.done && s.lastAttempt.success) case StatusFilter.Status.FAILURE: - return sessions.filter(s => s.lastAttempt.done && !s.lastAttempt.success); + return sessions.filter(s => s.lastAttempt.done && !s.lastAttempt.success) case StatusFilter.Status.PENDING: - return sessions.filter(s => !s.lastAttempt.done); + return sessions.filter(s => !s.lastAttempt.done) case StatusFilter.Status.CANCELED: - return sessions.filter(s => s.lastAttempt.cancelRequested && s.lastAttempt.done); + return sessions.filter(s => s.lastAttempt.cancelRequested && s.lastAttempt.done) case StatusFilter.Status.CANCELING: - return sessions.filter(s => s.lastAttempt.cancelRequested && !s.lastAttempt.done); + return sessions.filter(s => s.lastAttempt.cancelRequested && !s.lastAttempt.done) default: - return sessions; + return sessions } } @@ -681,14 +681,14 @@ class StatusFilter extends React.Component { const childrenWithProps = React.Children.map(this.props.children, child => { return React.cloneElement(child, { sessions: this.filterSessionsByStatus(this.props.sessions, this.state.selectedStatus) - }); - }); + }) + }) return ( -
-
- - this.setState({ selectedStatus: e.target.value })}> {StatusFilter.Status.allStatus().map(s => )}