Skip to content

Commit

Permalink
Made SMS element From/To properties required. Both UI and server side…
Browse files Browse the repository at this point in the history
… validation were used. Fixes #240.
  • Loading branch information
otsakir committed May 6, 2015
1 parent af62397 commit 8958a3c
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
"method": {"enum": ["GET","POST"]},
"statusCallback": {"type": "string"}
},
"required": ["name","kind","label","title","text"]
"required": ["name","kind","label","title","text","to","from"]
}

2 changes: 2 additions & 0 deletions restcomm/restcomm.rvd/src/main/webapp/languages/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,9 @@
"smsStepSmsTextLabel": "SMS text",
"smsStepSmsTextLabelPopover": "Type the SMS message to send. Use RVD variables like '$variablename'",
"smsStepToLabel": "To",
"smsStepToRequiredLabel": "Required field",
"smsStepFromLabel": "From",
"smsStepFromRequiredLabel": "Required field",
"smsStepContinueToTooltip": "Choose the module to continue to after processing sms step. If nothing is selected call flow will continue to the next step.",
"smsStepContinueToLabel": "Continue to",
"smsStepChooseTargetLabel": "Choose a target",
Expand Down
2 changes: 2 additions & 0 deletions restcomm/restcomm.rvd/src/main/webapp/languages/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,9 @@
"smsStepSmsTextLabel": "Texto SMS",
"smsStepSmsTextLabelPopover": "Escreva a mensagem SMS para enviar. Utilize variáveis RVD como '$variablename'",
"smsStepToLabel": "Para",
"smsStepToRequiredLabel":"TRANSLATE: Required field",
"smsStepFromLabel": "De",
"smsStepFromRequiredLabel":"TRANSLATE: Required field",
"smsStepContinueToTooltip": "Escolha o módulo para continuar após o processamento do sms. Caso nada seja selecionado, o fluxo da chamada continuará para o próximo passo.",
"smsStepContinueToLabel": "Continuar com",
"smsStepChooseTargetLabel": "Selecione um destino",
Expand Down
67 changes: 37 additions & 30 deletions restcomm/restcomm.rvd/src/main/webapp/templates/steps/smsStep.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,41 +15,48 @@
</div>
</div>
</div>
<div class="row">
<div class="form-group row">
<div class='col-md-4'>
<!-- <span class="help-block">Destination phone number</span> -->
<div lookup-context class="input-group form-group input-group-sm">
<span class="input-group-addon">{{'smsStepToLabel' | translate}}<!-- &nbsp;<i class="fa fa-info-circle rvd-clickable" popover='Takes a valid E.164 phone number as a value. RestComm will send an SMS message to this number. When sending an SMS during an incoming call, it defaults to the caller. When sending an SMS during an outgoing call, it defaults to the called party.' popover-placement='top'></i>--></span>
<input type='text' name='to' ng-model='step.to' lookup-target auto-clear class="form-control"></input>
<variable-lookup variable="step.to" view="input-group"></variable-lookup>
<form name="formTo" novalidate>
<div lookup-context class="input-group input-group-sm">
<span class="input-group-addon">{{'smsStepToLabel' | translate}}<!-- &nbsp;<i class="fa fa-info-circle rvd-clickable" popover='Takes a valid E.164 phone number as a value. RestComm will send an SMS message to this number. When sending an SMS during an incoming call, it defaults to the caller. When sending an SMS during an outgoing call, it defaults to the called party.' popover-placement='top'></i>--></span>
<input type='text' name='to' ng-model='step.to' lookup-target auto-clear class="form-control" required></input>
<variable-lookup variable="step.to" view="input-group"></variable-lookup>
</div>
<div ng-show="formTo.to.$invalid" class="validation-error pull-left">{{'smsStepToRequiredLabel' | translate}}</div>
</form>
</div>
<div class="col-md-8">
<div class="input-group form-group input-group-sm">
<span class="input-group-addon help-tooltip" tooltip-trigger='mouseenter' tooltip-popup-delay='1000' tooltip="{{'smsStepContinueToTooltip' | translate}}">{{'smsStepContinueToLabel' | translate}}</span>

<select sync-model name='next' null-if-empty ng-model='step.next' ng-options='target.name as target.label for target in getAllTargets()' class="form-control">
<option value=""></option>
</select>
</div>
<!-- <span class="help-block">Source phone number</span> -->
<div lookup-context class="input-group form-group input-group-sm">
<span class="input-group-addon">{{'smsStepFromLabel' | translate}}<!-- &nbsp;<i class="fa fa-info-circle rvd-clickable" popover='Takes a valid E.164 phone number as a value. When sending an SMS during an incoming call, it defaults to the calling party. When sending an SMS during an outgoing call, it defaults to the called party.' popover-placement='top'></i>--></span>
<input type='text' name='from' ng-model='step.from' lookup-target auto-clear class="form-control"></input>
<variable-lookup variable="step.from" view="input-group"></variable-lookup>
</div>
<div class="validation-error" ng-show="form.next.$invalid">{{'smsStepChooseTargetLabel' | translate}}</div>
</div>
</div>
<div class="form-group row">
<div class='col-md-4'>
<form name="formFrom" novalidate>
<div lookup-context class="input-group input-group-sm">
<span class="input-group-addon">{{'smsStepFromLabel' | translate}}<!-- &nbsp;<i class="fa fa-info-circle rvd-clickable" popover='Takes a valid E.164 phone number as a value. When sending an SMS during an incoming call, it defaults to the calling party. When sending an SMS during an outgoing call, it defaults to the called party.' popover-placement='top'></i>--></span>
<input type='text' name='from' ng-model='step.from' lookup-target auto-clear class="form-control" required></input>
<variable-lookup variable="step.from" view="input-group"></variable-lookup>
</div>
<div ng-show="formFrom.from.$invalid" class="validation-error pull-left">{{'smsStepFromRequiredLabel' | translate}}</div>
</form>
</div>

<div class='col-md-8'>
<!-- <div class='row help-block'>
<div class="col-md-11">Next module <i class="fa fa-info-circle rvd-clickable" popover='After processing this step continue to the module selected. Leave the default value to continue to the following step' popover-placement='top'></i></div>
</div> -->
<!-- <span class='help-block'>Next module <i class="fa fa-info-circle rvd-clickable" popover='After processing this step continue to the module selected. Leave the default value to continue to the following step' popover-placement='top'></i> </span> -->
<div class="input-group form-group input-group-sm">
<span class="input-group-addon help-tooltip" tooltip-trigger='mouseenter' tooltip-popup-delay='1000' tooltip="{{'smsStepContinueToTooltip' | translate}}">{{'smsStepContinueToLabel' | translate}}</span>

<select sync-model name='next' null-if-empty ng-model='step.next' ng-options='target.name as target.label for target in getAllTargets()' class="form-control">
<option value=""></option>
</select>
</div>
<div class="validation-error" ng-show="form.next.$invalid">{{'smsStepChooseTargetLabel' | translate}}</div>
<div class="input-group form-group input-group-sm">
<span class="input-group-addon help-tooltip" tooltip-trigger='mouseenter' tooltip-popup-delay='1000' tooltip="{{'smsStepStatusCalbackTooltip' | translate}}">{{'smsStepStatusCallbackLabel' | translate}}</span>
<input type='text' auto-clear name='statusCallback' ng-model='step.statusCallback' class="form-control" placeholder="{{'smsStepStatusCallbackInputPlaceholder' | translate}}"></input>
</div>
</div>
</div>

<!-- <span class='help-block'>&nbsp;</span> -->
<div class="input-group form-group input-group-sm">
<span class="input-group-addon help-tooltip" tooltip-trigger='mouseenter' tooltip-popup-delay='1000' tooltip="{{'smsStepStatusCalbackTooltip' | translate}}">{{'smsStepStatusCallbackLabel' | translate}}</span>
<input type='text' auto-clear name='statusCallback' ng-model='step.statusCallback' class="form-control" placeholder="{{'smsStepStatusCallbackInputPlaceholder' | translate}}"></input>
</div>

</div>
</div>
</div>

0 comments on commit 8958a3c

Please sign in to comment.