Skip to content

Commit

Permalink
fix failed status on left nav
Browse files Browse the repository at this point in the history
  • Loading branch information
dragandragan1988 committed Jan 7, 2020
1 parent 80bd459 commit 2ce7ffa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ window.ChaiBioTech.ngApp.controller('ExperimentMenuOverlayCtrl', [
$scope.errorExport = false
$scope.exporting = false
$scope.isIdle = false
$scope.runningExpId = 0

$scope.deleteExperiment = ->
#exp = new Experiment id: $stateParams.id
Expand Down Expand Up @@ -103,7 +104,7 @@ window.ChaiBioTech.ngApp.controller('ExperimentMenuOverlayCtrl', [
$scope.status = 'NOT_STARTED'
$scope.runStatus = 'Not run yet.'
if data.experiment.started_at and !data.experiment.completed_at
if data.experiment.completion_status
if !$scope.isIdle and (parseInt($scope.runningExpId) is parseInt($scope.exp.id))
$scope.status = 'RUNNING'
$scope.runStatus = 'Currently running.'
else
Expand Down Expand Up @@ -136,8 +137,9 @@ window.ChaiBioTech.ngApp.controller('ExperimentMenuOverlayCtrl', [
$scope.lidOpen = if data?.optics?.lid_open == "true" then true else false
state = data?.experiment_controller?.machine?.state
oldState = oldData?.experiment_controller?.machine?.state
$scope.getExperiment() if state isnt oldState
return if !data
return if !data.experiment_controller
$scope.isIdle = if data.experiment_controller.machine.state == 'idle' then true else false
$scope.runningExpId = data.experiment_controller.experiment?.id
$scope.getExperiment() if (state isnt oldState) or (!$scope.isIdle and $scope.status isnt 'RUNNING')
])
4 changes: 2 additions & 2 deletions frontend/javascripts/app/views/experiment/left-menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
<div class="side-menu-content-container">
<div class="side-menu-name-container">
<edit-exp-name status="status"></edit-exp-name>
<div ng-if="status == 'COMPLETED'" ng-show="exp.time_valid" class="side-menu-exp-status XB1 run-on-status">
<div ng-show="exp.time_valid && status == 'COMPLETED'" class="side-menu-exp-status XB1 run-on-status">
{{runStatus}} {{exp.started_at}}
<label class="side-menu-exp-status-text success XB1" ng-show="exp.completion_status === 'success'">Completed</label>
<label class="side-menu-exp-status-text failed XB1" ng-show="exp.completion_status !== 'success'">Failed</label>
</div>
<div ng-if="status == 'COMPLETED'" ng-show="!exp.time_valid" class="side-menu-exp-status XB1 run-on-status">
<div ng-show="!exp.time_valid && status == 'COMPLETED'" class="side-menu-exp-status XB1 run-on-status">
Run previously
<label class="side-menu-exp-status-text success" ng-show="exp.completion_status === 'success'">Completed</label>
<label class="side-menu-exp-status-text failed" ng-show="exp.completion_status !== 'success'">Failed</label>
Expand Down

0 comments on commit 2ce7ffa

Please sign in to comment.