Skip to content

Commit

Permalink
fixing tests and readding edit description modal trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
cohitre committed Jan 29, 2015
1 parent 78a5a18 commit 420cef2
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 7 deletions.
6 changes: 6 additions & 0 deletions app/templates/detail-views/summary-items/label-base.hbs
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
<i {{bind-attr class=view.iconClasses}}></i> {{view.text}}

{{#if view.isModalEditLink}}
<a class="edit-model-link" {{action "openModal" view.modalEditClass view.model}}>
<i class="icon-edit"></i>
</a>
{{/if}}
3 changes: 3 additions & 0 deletions app/views/detail-views/summary-items/label-base.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ LabelBaseView = Ember.View.extend(
tagName: "dt"
templateName: "detail-views/summary-items/label-base"

isModalEditLink: Ember.computed "modalEditClass", ->
!Ember.isBlank(@get("modalEditClass"))

iconClasses: Ember.computed "icon", ->
icons = ["icon-#{@get("icon")}"]
icons.join(" ")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var OrderSummarySectionView = SummarySectionBase.extend({
model: model,
});

this.addLabel("Internal description", "description");
this.addInternalDescriptionLabel();
this.addSummaryItem("model-description", {
model: model
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var RefundSummarySectionView = SummarySectionBase.extend({
model: model,
});

this.addLabel("Internal description", "description");
this.addInternalDescriptionLabel();
this.addSummaryItem("model-description", {
model: model
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ SummarySectionBase = Ember.View.extend(

addSummaryItem: (name, attrs) ->
@addItem("detail-views/summary-items/#{name}", attrs)

addInternalDescriptionLabel: ->
@addLabel("Internal description",
icon: "description",
model: @get("model"),
modalEditClass: @container.lookupFactory("view:modals/edit-description-modal")
)

)

`export default SummarySectionBase;`
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@ TransactionBaseSummarySection = SummarySectionBaseView.extend(
model = @get("model")
@addLabel("Status", "status")
@addSummaryItem("transaction-status", model: model)

@addLabel "Internal description", "description"
@addInternalDescriptionLabel()
@addSummaryItem("model-description", model: model)

@addLabel "Customer", "customers"
@addSummaryItem("customer", modelBinding: "transaction.customer", transaction: model)

@addLabel("Funding instrument",
textBinding: "summaryView.fundingInstrumentLabelText"
iconBinding: "summaryView.fundingInstrumentLabelIcon"
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/customer-page-add-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,5 +187,5 @@ test('can add card with address', function() {

test('verification renders properly against rev1', function() {
visit(Testing.CUSTOMER_ROUTE)
.check(".status.verified span", "Verified");
.check(".status.succeeded span", "Verified");
});

0 comments on commit 420cef2

Please sign in to comment.