Skip to content

Commit

Permalink
Merge pull request #1999 from jrjohnson/1986-cidescription
Browse files Browse the repository at this point in the history
Fix multiple issues with CI overview description field
  • Loading branch information
stopfstedt authored Aug 18, 2016
2 parents e36fefb + 6f65d3f commit cf832d5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
4 changes: 2 additions & 2 deletions app/components/curriculum-inventory-report-overview.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ export default Component.extend(Validations, ValidationErrorDisplay, {
});
},
revertDescriptionChanges(){
const program = this.get('report');
this.set('report', program.get('description'));
const report = this.get('report');
this.set('description', report.get('description'));
},
}
});
19 changes: 8 additions & 11 deletions app/templates/components/curriculum-inventory-report-overview.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
{{inplace-select value=report.year displayValueOverride=report.yearLabel options=yearOptions save="changeYear"}}
{{/if}}
</div>

<div class="block">
<label>{{t "general.program"}}:</label>
<span>{{report.program.title}} ({{report.program.shortTitle}})</span>
Expand All @@ -41,21 +41,18 @@
{{report.description}}
{{else}}
{{#editable-field
value=shortTitle
value=description
save=(action 'changeDescription')
close=(action 'revertDescriptionChanges')
clickPrompt=(if report.description report.description (t 'general.clickToEdit'))
as |isSaving save close|
}}
{{one-way-textarea
value=description
update=(action (mut description))
onenter=save
onescape=close
disabled=isSaving
focusOut=(action 'addErrorDisplayFor' 'description')
keyPress=(action 'addErrorDisplayFor' 'description')
}}
<textarea
onchange={{action (mut description) value="target.value"}}
value={{description}}
disabled={{isSaving}}
onkeypress={{action 'addErrorDisplayFor' 'description'}}
>{{description}}</textarea>
{{#if (and (v-get this 'description' 'isInvalid') (is-in showErrorsFor 'description'))}}
<span class="validation-error-message">{{v-get this 'description' 'message'}}</span>
{{/if}}
Expand Down

0 comments on commit cf832d5

Please sign in to comment.