Skip to content

Don't show logs panel if task never running - #1503

Merged
ssalinas merged 6 commits into
masterfrom
dont-link-nonexistent-logs
Apr 28, 2017
Merged

Don't show logs panel if task never running#1503
ssalinas merged 6 commits into
masterfrom
dont-link-nonexistent-logs

Conversation

@PtrTeixeira

Copy link
Copy Markdown
Contributor

If a task is currently stopped and never reached the RUNNING state,
don't show the "Logs" section, or include a link to
"tail_of_finished_service.log".

If a task is currently stopped and never reached the RUNNING state,
don't show the "Logs" section, or include a link to
"tail_of_finished_service.log".
Instead of showing a red label with "Task lost" when a task failed to
start (eg, due to it attempting to accept an invalid offer), show a blue
(info) label with the label "Task aborted."

const labelText = (status, currentState, cleanupType) => {
if (status === TaskStatus.NEVER_RAN) {
return 'Task aborted';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 for this, I think this will make things a lot clearer for users

@ssalinas

Copy link
Copy Markdown
Contributor

Good to go ahead and test in staging whenever you like @PtrTeixeira

If the directory is linked directory is empty - either there never was
anything there or whatever was there has now been cleaned up - don't
show a link to the latest log on the task detail page.
Was previously checking the `length` property to determine if a given
array had contents. This didn't work because in cases where the
directory had been cleaned up, the query to get that field would respond
with an error code, which resulted in `files` being `null` or
`undefined`, rather than the empty array.
@ssalinas ssalinas modified the milestone: 0.15.0 Apr 19, 2017
In some cases the whole object can be null, not just a field of it. This
checks that the object is present before accessing its fields, which
should hopefully prevent more exceptions from being thrown due to state
oddities.
React requires that a component evaluate to either null, a dom element,
or a react component when it renders. The `TaskLatestLog` component was
rendering as `false`, rather than `null`, in cases when files were not
loaded - in particular, when following links directly into a directory
rather than the task page itself.
@ssalinas
ssalinas merged commit 389be84 into master Apr 28, 2017
@ssalinas
ssalinas deleted the dont-link-nonexistent-logs branch April 28, 2017 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants