Bug 1079227 - Loop feedback form should always allow comments. r=nperriault

This commit is contained in:
Mark Banner 2015-01-07 11:52:57 +00:00
Родитель a94876fd8e
Коммит bf113904c7
5 изменённых файлов: 8 добавлений и 34 удалений

Просмотреть файл

@ -76,7 +76,7 @@ loop.shared.views.FeedbackView = (function(l10n) {
video_quality: l10n.get("feedback_category_video_quality"),
disconnected : l10n.get("feedback_category_was_disconnected"),
confusing: l10n.get("feedback_category_confusing"),
other: l10n.get("feedback_category_other")
other: l10n.get("feedback_category_other2")
};
},
@ -119,8 +119,7 @@ loop.shared.views.FeedbackView = (function(l10n) {
handleCategoryChange: function(event) {
var category = event.target.value;
this.setState({
category: category,
description: category == "other" ? "" : this._getCategories()[category]
category: category
});
if (category == "other") {
this.refs.description.getDOMNode().focus();
@ -131,10 +130,6 @@ loop.shared.views.FeedbackView = (function(l10n) {
this.setState({description: event.target.value});
},
handleDescriptionFieldFocus: function(event) {
this.setState({category: "other", description: ""});
},
handleFormSubmit: function(event) {
event.preventDefault();
// XXX this feels ugly, we really want a feedbackActions object here.
@ -146,8 +141,6 @@ loop.shared.views.FeedbackView = (function(l10n) {
},
render: function() {
var descriptionDisplayValue = this.state.category === "other" ?
this.state.description : "";
return (
React.createElement(FeedbackLayout, {title: l10n.get("feedback_what_makes_you_sad"),
reset: this.props.reset},
@ -157,8 +150,7 @@ loop.shared.views.FeedbackView = (function(l10n) {
React.createElement("input", {type: "text", ref: "description", name: "description",
className: "feedback-description",
onChange: this.handleDescriptionFieldChange,
onFocus: this.handleDescriptionFieldFocus,
value: descriptionDisplayValue,
value: this.state.description,
placeholder:
l10n.get("feedback_custom_category_text_placeholder")})
),

Просмотреть файл

@ -76,7 +76,7 @@ loop.shared.views.FeedbackView = (function(l10n) {
video_quality: l10n.get("feedback_category_video_quality"),
disconnected : l10n.get("feedback_category_was_disconnected"),
confusing: l10n.get("feedback_category_confusing"),
other: l10n.get("feedback_category_other")
other: l10n.get("feedback_category_other2")
};
},
@ -119,8 +119,7 @@ loop.shared.views.FeedbackView = (function(l10n) {
handleCategoryChange: function(event) {
var category = event.target.value;
this.setState({
category: category,
description: category == "other" ? "" : this._getCategories()[category]
category: category
});
if (category == "other") {
this.refs.description.getDOMNode().focus();
@ -131,10 +130,6 @@ loop.shared.views.FeedbackView = (function(l10n) {
this.setState({description: event.target.value});
},
handleDescriptionFieldFocus: function(event) {
this.setState({category: "other", description: ""});
},
handleFormSubmit: function(event) {
event.preventDefault();
// XXX this feels ugly, we really want a feedbackActions object here.
@ -146,8 +141,6 @@ loop.shared.views.FeedbackView = (function(l10n) {
},
render: function() {
var descriptionDisplayValue = this.state.category === "other" ?
this.state.description : "";
return (
<FeedbackLayout title={l10n.get("feedback_what_makes_you_sad")}
reset={this.props.reset}>
@ -157,8 +150,7 @@ loop.shared.views.FeedbackView = (function(l10n) {
<input type="text" ref="description" name="description"
className="feedback-description"
onChange={this.handleDescriptionFieldChange}
onFocus={this.handleDescriptionFieldFocus}
value={descriptionDisplayValue}
value={this.state.description}
placeholder={
l10n.get("feedback_custom_category_text_placeholder")} />
</p>

Просмотреть файл

@ -74,7 +74,7 @@ feedback_category_audio_quality=Audio quality
feedback_category_video_quality=Video quality
feedback_category_was_disconnected=Was disconnected
feedback_category_confusing=Confusing
feedback_category_other=Other:
feedback_category_other2=Other
feedback_custom_category_text_placeholder=What went wrong?
feedback_submit_button=Submit
feedback_back_button=Back

Просмотреть файл

@ -133,16 +133,6 @@ describe("loop.shared.views.FeedbackView", function() {
expect(comp.getDOMNode().querySelector("form button").disabled).eql(false);
});
it("should empty the description field when a predefined category is " +
"chosen",
function() {
clickSadFace(comp);
fillSadFeedbackForm(comp, "confusing");
expect(comp.getDOMNode().querySelector(".feedback-description").value).eql("");
});
it("should enable the form submit button once a predefined category is " +
"chosen",
function() {

Просмотреть файл

@ -271,7 +271,7 @@ feedback_category_audio_quality=Audio quality
feedback_category_video_quality=Video quality
feedback_category_was_disconnected=Was disconnected
feedback_category_confusing=Confusing
feedback_category_other=Other:
feedback_category_other2=Other
feedback_custom_category_text_placeholder=What went wrong?
feedback_submit_button=Submit
feedback_back_button=Back