Skip to content

Commit

Permalink
FMRPA-164 | Making notes consistent across booking process
Browse files Browse the repository at this point in the history
  • Loading branch information
Jalen Sowell authored and Jalen Sowell committed Oct 17, 2023
1 parent 7ca8bf1 commit f6cd74f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
14 changes: 12 additions & 2 deletions app/scripts/controllers/plan.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ app.controller('PlanController', ['$scope', '$http','$routeParams', '$location',
$location.path("/plan/where");
};

$scope.$watch('howLong', function(newVal) {
$scope.isRoundTrip = newVal && newVal.minutes > 0;
});

$scope.goPlanWhere = function(){
planService.backToConfirm = true;
$location.path('/plan/where');
Expand Down Expand Up @@ -510,7 +514,7 @@ app.controller('PlanController', ['$scope', '$http','$routeParams', '$location',
// When
if ($scope.fromMoment) params.date = $scope.fromMoment.format('dddd-MM-D');
if ($scope.fromTimeUpdated) params.start_time = $scope.fromMoment.format('h:mm:ss');

switch($scope.step) {
case 'where':
// delete params.purpose;
Expand Down Expand Up @@ -671,6 +675,8 @@ app.controller('PlanController', ['$scope', '$http','$routeParams', '$location',
res.success((result) => {
$scope.stopSpin();
$location.path('/plan/my_rides');
planService.driverInstructions = '';
planService.driverInstructionsReturn = '';
}).error((err) => {
$scope.stopSpin();
console.log(err);
Expand Down Expand Up @@ -702,6 +708,8 @@ app.controller('PlanController', ['$scope', '$http','$routeParams', '$location',
break;
case 'summary':
step = 'instructions_for_driver';
$scope.driverInstructions = planService.driverInstructions;
$scope.driverInstructionsReturn = planService.driverInstructionsReturn;
break;
}
}
Expand All @@ -726,6 +734,8 @@ app.controller('PlanController', ['$scope', '$http','$routeParams', '$location',
case 'assistant':
case 'instructions_for_driver':
case 'summary':
$scope.driverInstructions = planService.driverInstructions;
$scope.driverInstructionsReturn = planService.driverInstructionsReturn;
break;
}

Expand Down Expand Up @@ -2110,7 +2120,7 @@ app.controller('PlanController', ['$scope', '$http','$routeParams', '$location',

case 'instructions_for_driver':
$scope.driverInstructions = planService.driverInstructions;
planService.driverInstructionsReturn = '';
$scope.driverInstructions = planService.driverInstructionsReturn;
$scope.$watch('howLong', function(newVal) {
// Show return leg note text box if selected howLong value is more than 0
$scope.isRoundTrip = newVal && newVal.minutes > 0;
Expand Down
4 changes: 2 additions & 2 deletions app/views/plan-summary.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@
.input-group
%textarea#driverNotesInput.form-control{style: 'width: 100%;', cols: '4', maxlength: '75', ng: {model: 'planService.driverInstructions'}}

.row{'ng-init' => 'returnNoteInteracted = false', 'ng-show' => 'planService.driverInstructionsReturn || returnNoteInteracted', style: 'margin-top: 30px'}
.row{ng: {show: 'isRoundTrip'}, style: 'margin-top: 30px'}
.col-lg-6.col-lg-offset-3.col-md-8.col-md-offset-2.col-sm-10.col-sm-offset-1.col-xs-12
%label{for: 'returnDriverNotesInput'}
Return Driver's Notes:
.input-group
%textarea#returnDriverNotesInput.form-control{style: 'width: 100%;', cols: '4', maxlength: '45', ng: {model: 'planService.driverInstructionsReturn', change: 'returnNoteInteracted = true'}}
%textarea#returnDriverNotesInput.form-control{style: 'width: 100%;', cols: '4', maxlength: '75', ng: {model: 'planService.driverInstructionsReturn'}}

.row.unstuck-foot.btn-spacing
.col-lg-6.col-lg-offset-3.col-md-8.col-md-offset-2.col-sm-10.col-sm-offset-1.col-xs-12
Expand Down

0 comments on commit f6cd74f

Please sign in to comment.