This commit is contained in:
Scott Erickson 2016-07-07 16:34:15 -07:00
parent c0f163938e
commit 1da82fa851
2 changed files with 7 additions and 1 deletions
app
templates/editor/modal
views/editor/modal

View file

@ -36,6 +36,9 @@ block modal-footer-content
button.btn.btn-sm#agreement-button(data-i18n="versions.cla_agree") I AGREE button.btn.btn-sm#agreement-button(data-i18n="versions.cla_agree") I AGREE
if view.isPatch if view.isPatch
.alert.alert-info(data-i18n="versions.owner_approve") An owner will need to approve it before your changes will become visible. .alert.alert-info(data-i18n="versions.owner_approve") An owner will need to approve it before your changes will become visible.
.save-error-area
if view.savingPatchError
.alert.alert-danger Unable to save patch: #{view.savingPatchError}
.buttons .buttons
button.btn(data-dismiss="modal", data-i18n="common.cancel") Cancel button.btn(data-dismiss="modal", data-i18n="common.cancel") Cancel

View file

@ -46,6 +46,7 @@ module.exports = class SaveVersionModal extends ModalView
} }
submitPatch: -> submitPatch: ->
@savingPatchError = false
forms.clearFormAlerts @$el forms.clearFormAlerts @$el
patch = new Patch() patch = new Patch()
patch.set 'delta', @model.getDelta() patch.set 'delta', @model.getDelta()
@ -60,8 +61,10 @@ module.exports = class SaveVersionModal extends ModalView
return unless res return unless res
@enableModalInProgress(@$el) @enableModalInProgress(@$el)
res.error => res.error (jqxhr) =>
@disableModalInProgress(@$el) @disableModalInProgress(@$el)
@savingPatchError = jqxhr.responseJSON?.message or 'Unknown error.'
@renderSelectors '.save-error-area'
res.success => res.success =>
@hide() @hide()