-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(billing services): create/update working
This commit moves the CREATE and UPDATE controls to using the same form template, now located at `/billing_services/form.html`. The methods both work as expected.
- Loading branch information
Showing
13 changed files
with
296 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
101 changes: 0 additions & 101 deletions
101
client/src/partials/billing_services/create/create.html
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
<!-- billing service form --> | ||
<div class="row"> | ||
<div class="col-md-8"> | ||
<form name="BillingServicesForm" bh-submit="BillingServicesFormCtrl.submit(BillingServicesForm)" novalidate autocomplete="off"> | ||
<div class="panel panel-primary"> | ||
<div class="panel-heading"> | ||
{{ BillingServicesFormCtrl.title | translate }} | ||
</div> | ||
|
||
<!-- | ||
@hack - styling looks better this way (nicer error messages) | ||
@todo - propose to the team this should be part of the overall config | ||
--> | ||
<div class="panel-body" style="padding-bottom:5px;"> | ||
|
||
<!-- account input --> | ||
<div class="form-group" ng-class="{ 'has-error' : BillingServicesForm.$submitted && BillingServicesForm.account.$invalid }"> | ||
<label class="control-label"> | ||
{{ "COLUMNS.ACCOUNT" | translate }} | ||
</label> | ||
<input | ||
class="form-control" | ||
name="account" | ||
ng-model="BillingServicesFormCtrl.model.account" | ||
placeholder="{{ 'PLACEHOLDERS.ENTER.ACCOUNT' | translate }}" | ||
uib-typeahead="account as account.label for account in BillingServicesFormCtrl.accounts | filter:$viewValue | limitTo:6" | ||
typeahead-template-url="partials/templates/typeahead/accounts.html" | ||
required> | ||
<div class="help-block" ng-messages="BillingServicesForm.account.$error" ng-show="BillingServicesForm.$submitted"> | ||
<div ng-messages-include="partials/templates/messages.tmpl.html"></div> | ||
</div> | ||
</div> | ||
|
||
<!-- label input --> | ||
<div class="form-group" ng-class="{ 'has-error' : BillingServicesForm.$submitted && BillingServicesForm.label.$invalid }"> | ||
<label class="control-label"> | ||
{{ "COLUMNS.LABEL" | translate }} | ||
</label> | ||
<input | ||
class="form-control" | ||
name="label" | ||
ng-model="BillingServicesFormCtrl.model.label" | ||
required> | ||
<div class="help-block" ng-messages="BillingServicesForm.label.$error" ng-show="BillingServicesForm.$submitted"> | ||
<div ng-messages-include="partials/templates/messages.tmpl.html"></div> | ||
</div> | ||
</div> | ||
|
||
<!-- description textarea --> | ||
<div class="form-group" ng-class="{ 'has-error' : BillingServicesForm.$submitted && BillingServicesForm.description.$invalid }"> | ||
<label class="control-label"> | ||
{{ "COLUMNS.DESCRIPTION" | translate }} | ||
</label> | ||
<!-- | ||
@todo - propose to the team that all text-areas should have "resize:vertical" styles | ||
--> | ||
<textarea | ||
style="resize:vertical;" | ||
class="form-control" | ||
name="description" | ||
ng-model="BillingServicesFormCtrl.model.description" | ||
placeholder="{{ 'INPUT.DESCRIPTION' | translate }}" | ||
required> | ||
</textarea> | ||
<div class="help-block" ng-messages="BillingServicesForm.description.$error" ng-show="BillingServicesForm.$submitted"> | ||
<div ng-messages-include="partials/templates/messages.tmpl.html"></div> | ||
</div> | ||
</div> | ||
|
||
<!-- value input --> | ||
<div class="form-group" ng-class="{ 'has-error' : BillingServicesForm.$submitted && BillingServicesForm.value.$invalid }"> | ||
<label class="control-label"> | ||
{{ "COLUMNS.VALUE" | translate }} (%) | ||
</label> | ||
<input | ||
type="number" | ||
class="form-control" | ||
name="value" | ||
ng-model="BillingServicesFormCtrl.model.value" | ||
required> | ||
<div class="help-block" ng-messages="BillingServicesForm.value.$error" ng-show="BillingServicesForm.$submitted"> | ||
<div ng-messages-include="partials/templates/messages.tmpl.html"></div> | ||
</div> | ||
</div> | ||
|
||
<!-- a validation section for the form --> | ||
<div | ||
class="form-group" | ||
ng-class="{ | ||
'has-error' : BillingServicesForm.$submitted && (BillingServicesForm.$invalid || BillingServicesFormCtrl.error), | ||
'has-success' : BillingServicesFormCtrl.created || BillingServicesFormCtrl.updated | ||
}"> | ||
|
||
<div class="help-block"> | ||
|
||
<!-- show success message if the form is successfully submitted --> | ||
<p ng-show="BillingServicesFormCtrl.created"> | ||
<span class="glyphicon glyphicon-ok-sign"></span> {{ "BILLING_SERVICES.CREATED" | translate }} | ||
<a ui-sref="billingServices.list" href=""> | ||
<span class="glyphicon glyphicon-link"></span> {{ "BILLING_SERVICES.VIEW" | translate }} | ||
</a> | ||
</p> | ||
|
||
<p ng-show="BillingServicesFormCtrl.updated"> | ||
<span class="glyphicon glyphicon-ok-sign"></span> {{ "BILLING_SERVICES.UPDATED" | translate }} | ||
<a ui-sref="billingServices.list" href=""> | ||
<span class="glyphicon glyphicon-link"></span> {{ "BILLING_SERVICES.VIEW" | translate }} | ||
</a> | ||
</p> | ||
|
||
<!-- there are (client-side) errors on the form --> | ||
<p ng-show="BillingServicesForm.$submitted && BillingServicesForm.$invalid"> | ||
<span class="glyphicon glyphicon-alert"></span> {{ "FORM.ERRORED" | translate }} | ||
</p> | ||
|
||
<!-- show http errors sent from the server --> | ||
<p ng-show="BillingServicesForm.$submitted && BillingServicesFormCtrl.error"> | ||
<span class="glyphicon glyphicon-alert"></span> {{ BillingServicesFormCtrl.error.code | translate }} | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="panel-footer"> | ||
<!-- form submit button --> | ||
<bh-loading-button loading-state="BillingServicesForm.$loading"> | ||
</bh-loading-button> | ||
|
||
<button ui-sref="billingServices.list" class="btn btn-default"> | ||
{{ "FORM.BACK" | translate }} | ||
</button> | ||
</div> | ||
</div> | ||
</form> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.