Skip to content

Commit

Permalink
GCW:1841:- Disable item edit button if offer is received
Browse files Browse the repository at this point in the history
  • Loading branch information
Darshan-Chauhan committed May 1, 2018
1 parent 9e22a3d commit 315ea93
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions app/controllers/item/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ export default Ember.Controller.extend({
return this.get("i18n").t("items.add_item.description_placeholder").string;
}),

isOfferReviewed: Ember.computed("model", "model.offer.state", function() {
return this.get("model.offer.state") === "received";
}),

formData: Ember.computed("model", {
get: function() {
var item = this.get('model');
Expand Down
2 changes: 1 addition & 1 deletion app/templates/item/edit.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</div>

<div class="small-6 columns">
{{#online-button classNames="add_item_link button expand" offer=model.offer}}{{t "items.add_item.save"}}{{/online-button}}
{{#online-button classNames="add_item_link button expand" disabledOverride=disabled disabled=isOfferReviewed offer=model.offer}}{{t "items.add_item.save"}}{{/online-button}}
</div>
</div>
</div>
Expand Down

0 comments on commit 315ea93

Please sign in to comment.