Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix/api feedback form #1573

Merged
merged 15 commits into from
Sep 16, 2016
Merged

Hotfix/api feedback form #1573

merged 15 commits into from
Sep 16, 2016

Conversation

frenchbread
Copy link
Contributor

Closes #1525.

@55 55 added this to the Sprint 31 milestone Sep 14, 2016
@55 55 self-assigned this Sep 14, 2016
@@ -9,6 +9,7 @@ AutoForm.hooks({
},
onSuccess () {
sAlert.success('Thank you! Your feedback has been successfully sent.');
Copy link
Contributor

@brylie brylie Sep 14, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add i18n token here. Use the following pattern, for clarity and consistency:

// Get feedback success message translation
const message = TAPi18n.__('feedbackForm_successMessage');

// Alert user of success
sAlert.success(message);

@bajiat
Copy link
Contributor

bajiat commented Sep 14, 2016

@NNN Re-assigning Brylie for the PR review, because we would need to get this forward and there has been no visible activity in discussion.

type="insert"
omitFields="authorId, createdAt, apiBackendId"
}}
<h4 class="modal-title" id="feedbackFormModalLabel">{{_ "feedback_feedbackForm_title"}}</h4>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Break this into nested lines, for readability and to shorten the line length:

<h4 class="modal-title" id="feedbackFormModalLabel">
  {{_ "feedback_feedbackForm_title"}}
</h4>

@brylie
Copy link
Contributor

brylie commented Sep 14, 2016

This looks good. There is just one missing i18n string and some markup lint. I can merge this today, if you can make the suggested changes in the next 30 minutes.

@brylie brylie assigned brylie and unassigned 55 Sep 14, 2016
@frenchbread
Copy link
Contributor Author

Suggested changes are done. Please review

@@ -8,7 +8,7 @@ AutoForm.hooks({
},
},
onSuccess () {
sAlert.success('Thank you! Your feedback has been successfully sent.');
sAlert.success(TAPi18n.__('feedbackForm_successMessage'));
Copy link
Contributor

@brylie brylie Sep 15, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this line is compact, it does not follow convention for other translated user alerts.

Refactor the code to follow this pattern:

// Get the success message translation
const message = TAPi18n.__('feedbackForm_successMessage');

// Alert the user of success
sAlert.success(message);

The reason is to make lines of code easier to read:

  • shorter lines
  • sAlert.success(message) is very close to English 'alert success message'

Search for other uses of sAlert in our project, to get a sense of how it is typically used.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've commented on an outdated diff. That file has already been changed.

@brylie brylie merged commit 319bc3c into develop Sep 16, 2016
@brylie brylie deleted the hotfix/api-feedback-form branch September 16, 2016 03:34
@ilarimikkonen ilarimikkonen added this to In Review in apinf/platform Apr 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants