Skip to content

Commit

Permalink
Fix existing feedback page.
Browse files Browse the repository at this point in the history
  • Loading branch information
sbruens committed Sep 29, 2023
1 parent 3c65231 commit 1a9b480
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/www/ui_components/feedback-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,12 @@ Polymer({
},
},

ready: function() {
var appRoot = dom(this).getOwnerRoot().host;
ready: function () {
let appRoot = dom(this).getOwnerRoot().host;

Check warning on line 141 in src/www/ui_components/feedback-view.js

View check run for this annotation

Codecov / codecov/patch

src/www/ui_components/feedback-view.js#L140-L141

Added lines #L140 - L141 were not covered by tests
window.addEventListener(
'location-changed',
function() {
function () {
appRoot = appRoot ?? dom(this).getOwnerRoot().host;

Check warning on line 145 in src/www/ui_components/feedback-view.js

View check run for this annotation

Codecov / codecov/patch

src/www/ui_components/feedback-view.js#L144-L145

Added lines #L144 - L145 were not covered by tests
if (appRoot.page !== 'feedback') return;
// Workaround:
// https://github.com/PolymerElements/paper-dropdown-menu/issues/159#issuecomment-229958448
Expand All @@ -154,11 +155,11 @@ Polymer({
);
},

_emailValueChanged: function() {
_emailValueChanged: function () {

Check warning on line 158 in src/www/ui_components/feedback-view.js

View check run for this annotation

Codecov / codecov/patch

src/www/ui_components/feedback-view.js#L158

Added line #L158 was not covered by tests
this.hasEnteredEmail = !!this.$.email.value;
},

_computeSubmitButtonLabel: function(submitting, localize) {
_computeSubmitButtonLabel: function (submitting, localize) {

Check warning on line 162 in src/www/ui_components/feedback-view.js

View check run for this annotation

Codecov / codecov/patch

src/www/ui_components/feedback-view.js#L162

Added line #L162 was not covered by tests
// If localize hasn't been defined yet, just return '' for now - Polymer will call this
// again once localize has been defined at which point we will return the right value.
if (!localize) return '';
Expand All @@ -168,11 +169,11 @@ Polymer({

// Returns whether the window's locale is English (i.e. EN, en-US) and the user has
// entered their email address.
_computeShouldShowLanguageDisclaimer: function(hasEnteredEmail) {
_computeShouldShowLanguageDisclaimer: function (hasEnteredEmail) {

Check warning on line 172 in src/www/ui_components/feedback-view.js

View check run for this annotation

Codecov / codecov/patch

src/www/ui_components/feedback-view.js#L172

Added line #L172 was not covered by tests
return !window.navigator.language.match(/^en/i) && hasEnteredEmail;
},

getValidatedFormData: function() {
getValidatedFormData: function () {

Check warning on line 176 in src/www/ui_components/feedback-view.js

View check run for this annotation

Codecov / codecov/patch

src/www/ui_components/feedback-view.js#L176

Added line #L176 was not covered by tests
var inputs = [this.$.categoryList, this.$.feedback, this.$.email];
for (var i = 0, input = inputs[i]; input; input = inputs[++i]) {
if (input.validate && !input.validate()) {
Expand All @@ -189,7 +190,7 @@ Polymer({
};
},

resetForm: function() {
resetForm: function () {

Check warning on line 193 in src/www/ui_components/feedback-view.js

View check run for this annotation

Codecov / codecov/patch

src/www/ui_components/feedback-view.js#L193

Added line #L193 was not covered by tests
this.$.categoryList.category = 'general';
this.$.feedback.value = '';
this.$.email.value = '';
Expand Down

0 comments on commit 1a9b480

Please sign in to comment.