Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
Audit system for numeric inputs and use new component
Browse files Browse the repository at this point in the history
  • Loading branch information
captain-enjoyable committed Sep 26, 2016
1 parent 1e229d9 commit 70a9190
Show file tree
Hide file tree
Showing 15 changed files with 21 additions and 18 deletions.
2 changes: 1 addition & 1 deletion app/inventory/adjust/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
property="transactionType" content=adjustmentTypes
optionValuePath="type" optionLabelPath="name"
}}
{{em-input property="adjustmentQuantity" label=(t 'labels.quantity') class="col-sm-3 required"}}
{{number-input property="adjustmentQuantity" label=(t 'labels.quantity') class="col-sm-3 required"}}
</div>
{{em-text label=(t 'inventory.labels.reason') property="reason" rows=3}}
<div class="row">
Expand Down
4 changes: 2 additions & 2 deletions app/inventory/batch/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@
selection=selectedInventoryItem
showQuantity=false
}}
{{em-input property="quantity" label=(t 'labels.quantity') class="col-sm-2 required test-inv-quantity"}}
{{number-input property="quantity" label=(t 'labels.quantity') class="col-sm-2 required test-inv-quantity"}}
<div class="form-group col-sm-1">
<label class="control-label">{{t 'inventory.labels.unit'}}</label>
{{#if showDistributionUnit}}
<p class="form-control-static">{{model.inventoryItem.distributionUnit}}</p>
{{/if}}
</div>
{{em-input property="purchaseCost" label=(t 'inventory.labels.purchaseCost') class="col-sm-2 required test-inv-cost"}}
{{number-input property="purchaseCost" label=(t 'inventory.labels.purchaseCost') class="col-sm-2 required test-inv-cost"}}
</div>
<div class="row">
{{em-input property="vendorItemNo" label=(t 'inventory.labels.vendorItemNumber') class="col-sm-4"}}
Expand Down
3 changes: 2 additions & 1 deletion app/inventory/request/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
content=inventoryList
selection=selectedInventoryItem
}}
{{em-input property="quantity" label=quantityLabel class="col-sm-3 test-inv-quantity"}}

{{number-input property="quantity" label=quantityLabel class="col-sm-3 test-inv-quantity"}}
<div class="form-group col-sm-1">
<label class="control-label"></label>
<h4 class="form-control-static">
Expand Down
2 changes: 1 addition & 1 deletion app/inventory/transfer/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
{{select-or-typeahead class="required" property="transferLocation" label=(t 'inventory.labels.transferTo') list=warehouseList selection=model.transferLocation }}
{{select-or-typeahead property="transferAisleLocation" label=(t 'inventory.labels.transferToAisle') list=aisleLocationList selection=model.transferAisleLocation }}
<div class="row">
{{em-input property="adjustmentQuantity" label=(t 'labels.quantity') class="col-sm-3 required"}}
{{number-input property="adjustmentQuantity" label=(t 'labels.quantity') class="col-sm-3 required"}}
</div>
<div class="row">
{{date-picker property="dateCompleted" label=(t 'inventory.labels.dateTransferred') class="col-sm-4 required"}}
Expand Down
2 changes: 1 addition & 1 deletion app/invoices/payment/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</div>
{{/if}}
{{/if}}
{{em-input property="amount" label=(t 'labels.amount') class="required payment-amount"}}
{{number-input property="amount" label=(t 'labels.amount') class="required payment-amount"}}
{{date-picker property="datePaid" label=(t 'labels.datePaid') maxDate="now" class="required"}}
{{select-or-typeahead property="expenseAccount" label=(t 'labels.creditTo') list=expenseAccountList selection=model.expenseAccount }}
{{em-text property="notes" label=(t 'labels.notes')}}
Expand Down
2 changes: 1 addition & 1 deletion app/medication/edit/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
{{date-picker property="prescriptionDate" label=(t 'labels.prescriptionDate') class="col-sm-4"}}
</div>
<div class="row">
{{em-input property="quantity" label=quantityLabel class=quantityClass }}
{{number-input property="quantity" label=quantityLabel class=quantityClass }}
{{em-input property="refills" label=(t 'medication.labels.refills') class="col-xs-3"}}
</div>
{{#unless model.hideFulfillRequest}}
Expand Down
2 changes: 1 addition & 1 deletion app/patients/socialwork/expense/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
prompt=" "
}}
{{em-input label=(t 'patients.labels.sources') property="sources"}}
{{em-input label=(t 'patients.labels.cost') property="cost" class="required"}}
{{number-input label=(t 'patients.labels.cost') property="cost" class="required"}}
{{/em-form}}
{{/modal-dialog}}
2 changes: 1 addition & 1 deletion app/patients/socialwork/family-info/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
{{em-input label=(t labels.occupation)property="occupation" class="col-xs-6"}}
</div>
<div class="row">
{{em-input label=(t labels.income) property="income" class="col-xs-6"}}
{{number-input label=(t labels.income) property="income" class="col-xs-6"}}
{{em-input label=(t labels.insurance) property="insurance" class="col-xs-6"}}
</div>
{{/em-form}}
Expand Down
2 changes: 1 addition & 1 deletion app/pricing/edit/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{{#em-form model=model submitButton=false }}
{{em-input label=(t 'labels.name') property="name" class="required price-name"}}
<div class="row">
{{em-input label=(t 'labels.price') property="price" class="required col-xs-2 price-amount"}}
{{number-input label=(t 'labels.price') property="price" class="required col-xs-2 price-amount"}}
{{select-or-typeahead property="expenseAccount" label=(t 'labels.department') list=expenseAccountList selection=model.expenseAccount className="col-xs-4 price-department"}}
</div>
<div class="row">
Expand Down
2 changes: 1 addition & 1 deletion app/pricing/override/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
class="required pricing-profile"
prompt=" "
}}
{{em-input label=(t 'labels.price') property="price" class="required pricing-override-price"}}
{{number-input label=(t 'labels.price') property="price" class="required pricing-override-price"}}
{{/em-form}}
{{/modal-dialog}}
4 changes: 2 additions & 2 deletions app/pricing/profiles/edit/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
updateButtonText=updateButtonText }}
{{#em-form model=model submitButton=false }}
{{em-input property="name" label="Name" class="required pricing-profile-name"}}
{{em-input property="discountPercentage" label="Discount Percentage" class="pricing-profile-percentage"}}
{{em-input property="discountAmount" label="Discount Amount" class="pricing-profile-discount"}}
{{number-input property="discountPercentage" label="Discount Percentage" class="pricing-profile-percentage"}}
{{number-input property="discountAmount" label="Discount Amount" class="pricing-profile-discount"}}
{{/em-form}}
{{/modal-dialog}}
2 changes: 1 addition & 1 deletion app/procedures/charge/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{{#em-form model=model submitButton=false }}
{{pricing-typeahead property="itemName" label=(t 'inventory.labels.item') content=pricingList selection=selectedItem class="required charge-item-name"}}
<div class="row">
{{em-input label=(t 'labels.quantity') property="quantity" class="col-xs-3 required"}}
{{number-input label=(t 'labels.quantity') property="quantity" class="col-xs-3 required"}}
{{date-picker property="dateCharged" label="Date Charged" class="col-xs-4 required"}}
</div>
{{/em-form}}
Expand Down
2 changes: 1 addition & 1 deletion app/templates/inv-purchase.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</div>
{{/if}}
<div class="row">
{{em-input property="purchaseCost" label=(t 'inventory.labels.purchaseCost') class="required col-sm-4 test-inv-cost"}}
{{number-input property="purchaseCost" label=(t 'inventory.labels.purchaseCost') class="required col-sm-4 test-inv-cost"}}
{{em-input property="lotNumber" label=(t 'inventory.labels.serialNumber') class="col-sm-4"}}
</div>
<div class="row">
Expand Down
6 changes: 3 additions & 3 deletions app/visits/vitals/edit/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{{date-picker property="dateRecorded" label=(t "vitals.labels.dateRecorded") class="col-sm-6" format="l h:mm A" showTime=true }}
</div>
<div class="row">
{{em-input class="col-sm-3 required temperature-text" property="temperature" label=temperatureLabel }}
{{number-input class="col-sm-3 required temperature-text" property="temperature" label=temperatureLabel }}
</div>
<div class="row">
{{em-input class="col-sm-3 weight-text" property="weight" label=(t "vitals.labels.weight")}}
Expand All @@ -20,8 +20,8 @@
{{em-input class="col-sm-3 required dbp-text" property="dbp" label=(t "vitals.labels.dbp")}}
</div>
<div class="row">
{{em-input class="col-sm-3 required heart-rate-text" property="heartRate" label=(t "vitals.labels.heartRate")}}
{{em-input class="col-sm-3 required respiratory-rate-text" property="respiratoryRate" label=(t "vitals.labels.respiratoryRate")}}
{{number-input class="col-sm-3 required heart-rate-text" property="heartRate" label=(t "vitals.labels.heartRate")}}
{{number-input class="col-sm-3 required respiratory-rate-text" property="respiratoryRate" label=(t "vitals.labels.respiratoryRate")}}
</div>
{{/em-form}}
{{/modal-dialog}}
2 changes: 2 additions & 0 deletions tests/integration/components/number-input-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ test('the number-input renders', function(assert) {
test('the number input sanitizes the data', function(assert) {
assert.expect(1);

this.set('model', Ember.Object.create({ petType: 'cats' }));

this.set('sanitizeFunction', (value) => {
assert.equal(value, 'dragons', 'it passes the value to the sanitize function');
});
Expand Down

0 comments on commit 70a9190

Please sign in to comment.