-
Notifications
You must be signed in to change notification settings - Fork 436
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add contact form to each page so users can leave feedback on each page (
#4033) * Add feedback input boxes to feedback partial so customers can leave docs feedback Signed-off-by: Ian Maddaus <[email protected]> * Update partials to handle new feedback partial Signed-off-by: Ian Maddaus <[email protected]> * Update scss files Signed-off-by: Ian Maddaus <[email protected]> * Update pages that shouldn't have feedback form Signed-off-by: Ian Maddaus <[email protected]> * Fixing JS, SASS, HTML Signed-off-by: Ian Maddaus <[email protected]> * Update feedback page Signed-off-by: Ian Maddaus <[email protected]> * Swap var for const Signed-off-by: Ian Maddaus <[email protected]> * Add buttons for contacting support Signed-off-by: Ian Maddaus <[email protected]> * Update Automate CLI TOC Signed-off-by: Ian Maddaus <[email protected]> * Change breakpoint Signed-off-by: Ian Maddaus <[email protected]> * Minor reformating Signed-off-by: Ian Maddaus <[email protected]> * Hide for print Signed-off-by: Ian Maddaus <[email protected]> * WIP Signed-off-by: Ian Maddaus <[email protected]> * Add recaptcha Signed-off-by: Ian Maddaus <[email protected]> * Additional cleanup Signed-off-by: Ian Maddaus <[email protected]> * Update input labels Signed-off-by: Ian Maddaus <[email protected]> --------- Signed-off-by: Ian Maddaus <[email protected]>
- Loading branch information
Showing
38 changed files
with
407 additions
and
291 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,9 +19,21 @@ feedback. There are several ways to get feedback to chef-docs. For | |
members of the Chef community, customers, or people who just want to | ||
send feedback, choose any of the following options: | ||
|
||
## Feedback Form | ||
|
||
Every page in [docs.chef.io](https://docs.chef.io) has a feedback form | ||
at the bottom of the page. Please feel free to include any thoughts or | ||
suggestions for improving the documentation on a page. Be as detailed as possible. | ||
|
||
Use the feedback form at the bottom of this page for submitting general feedback | ||
about Chef's documentation. | ||
|
||
These forms are not for customer support. If you need support, | ||
contact [Chef support](https://supportlink.chef.io/). | ||
|
||
|
||
Send an email to <Chef-Docs@progress.com> for documentation bugs, | ||
Send an email to <chef-docs@progress.com> for documentation bugs, | ||
ideas, thoughts, and suggestions. This email address is | ||
not a support email address, however. If you need support, | ||
contact [Chef support](https://supportlink.chef.io/). | ||
|
@@ -34,11 +46,13 @@ itself, consider opening an issue in the relevant [product repository]({{< relre | |
|
||
## GitHub Pull Request | ||
|
||
You can open a pull request on <https://github.com/chef/chef-web-docs>. Every page on <docs.chef.io> has a link to the Markdown page in the repository that it's sourced from. We require a DCO sign-off | ||
to submit pull requests except for obvious fixes. See | ||
our [Contributing page](https://github.com/chef/chef/blob/main/CONTRIBUTING.md#developer-certification-of-origin-dco) | ||
for more information about our DCO policy. If you have questions | ||
about the chef-web-docs repo, send an email to <[email protected]> and we're | ||
You can open a pull request on <https://github.com/chef/chef-web-docs>. | ||
Every page on <https://docs.chef.io> has a link to the Markdown page in the repository | ||
that it's sourced from. We require a DCO sign-off to submit pull requests | ||
except for obvious fixes. See our | ||
[Contributing page](https://github.com/chef/chef/blob/main/CONTRIBUTING.md#developer-certification-of-origin-dco) | ||
for more information about our DCO policy. If you have questions about the | ||
chef-web-docs repo, send an email to <[email protected]> and we're | ||
happy to assist. | ||
|
||
Thanks in advance for any feedback you choose to send. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,6 @@ layout = "sitemap" | |
gh_repo = "chef-web-docs" | ||
st_robots = "noindex, follow" | ||
toc = false | ||
feedback=false | ||
+++ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -104,7 +104,7 @@ Here is a list of some example names for you to use (the last names are translat | |
- [email protected] | ||
- [email protected] | ||
|
||
Use `Chef-Docs@progress.com` for the Chef Technical Documentation team. | ||
Use `chef-docs@progress.com` for the Chef Technical Documentation team. | ||
|
||
#### Example Phone Numbers | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<!-- This needs to be removed at some point in favor of the one here: ' | ||
https://github.com/chef/automate/blob/main/components/docs-chef-io/layouts/partials/cli_chef_automate_toc.html | ||
This can be deleted after the one above in the automate repo is updated. | ||
--> | ||
|
||
<aside class="sticky sidebar hide-for-print" data-sticky data-top-anchor="utility-bar:bottom" data-btm-anchor="page-content:bottom"> | ||
<div id="table-of-contents"> | ||
<span> | ||
<span class="mini-toc-nav">Table Of Contents</span> | ||
<button class="close-button hide-for-large" aria-label="Close menu" type="button" data-close> | ||
<span aria-hidden="true">×</span> | ||
</button> | ||
</span> | ||
<a href="#{{ anchorize ( .Title )}}">{{ .Title }}</a> | ||
<ul> | ||
<li> | ||
<a href = "#automate-cli-commands">Automate CLI Commands</a> | ||
<ul> | ||
{{ range .Site.Data.automate.cli_chef_automate.commands }} | ||
{{ $command := "" }} | ||
{{ if and (eq $.Page.Title "Automate CLI (HA)") (or (not .compatible_with) (eq .compatible_with "AutomateHA")) }} | ||
{{ $command = .name }} | ||
{{ end }} | ||
{{ if and (eq $.Page.Title "Automate CLI (Standalone)") (or (not .compatible_with) (eq .compatible_with "Automate")) }} | ||
{{ $command = .name }} | ||
{{ end }} | ||
|
||
{{ if ne $command "" }} | ||
{{ if ne $command "chef-automate"}} | ||
{{ $command := replaceRE `chef-automate ` "" $command }} | ||
<li> | ||
<a href = "#{{ .name | urlize}}">{{ $command }}</a> | ||
</li> | ||
{{ else}} | ||
<li> | ||
<a href = "#{{ .name | urlize}}">{{ $command }}</a> | ||
</li> | ||
{{ end }} | ||
{{ end }} | ||
{{ end }} | ||
</ul> | ||
</li> | ||
<li> | ||
<a href = "#error-codes">Error Codes</a> | ||
</li> | ||
</ul> | ||
</div> | ||
</aside> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
/* | ||
Feedback Buttons | ||
*/ | ||
|
||
const yesButton = document.querySelector('.feedback-yes'); | ||
const noButton = document.querySelector('.feedback-no'); | ||
|
||
|
@@ -43,3 +47,99 @@ if (noButton !== null ) { | |
sendFeedback(0); | ||
}); | ||
} | ||
|
||
/* | ||
Feedback Form | ||
*/ | ||
|
||
const feedbackCharactersMinimumId = $("#feedback-min-characters"); | ||
const feedbackButtonId = $("#feedback-form-submit-feedback"); | ||
const feedbackId = $("#feedback-form-feedback"); | ||
const minFeedbackLength = 100 | ||
|
||
/* | ||
function feedbackLength() | ||
feedback-form-feedback input requires 100 character minimum | ||
Submit button feedback-form-submit-feedback is disabled until min character requirement is met | ||
feedback-min-characters label updates as number of characters changes | ||
*/ | ||
|
||
function feedbackLength(){ | ||
const feedbackLength = feedbackId.val().length; | ||
|
||
if (feedbackLength >= minFeedbackLength){ | ||
feedbackButtonId.prop("disabled", false); | ||
feedbackCharactersMinimumId.text("0 characters left"); | ||
} else { | ||
const remainingCharLength = minFeedbackLength - feedbackLength | ||
feedbackCharactersMinimumId.text(remainingCharLength + " characters left"); | ||
feedbackButtonId.prop("disabled", true); | ||
} | ||
} | ||
|
||
/* | ||
function submitContactFormFeedback | ||
Submit data to AWS from feedback-form | ||
On successful submit: | ||
- show success message | ||
- reset text in feedback-form-feedback | ||
- reset text in feedback-form-email | ||
- disable submit button feedback-form-submit-feedback | ||
On failed submit: | ||
- show failure message | ||
*/ | ||
function validate(event) { | ||
event.preventDefault(); | ||
grecaptcha.execute(); | ||
} | ||
|
||
function submitContactFormFeedback(event) { | ||
|
||
const reCaptchaResponse = grecaptcha.getResponse(); | ||
const emailId = $("#feedback-form-email"); | ||
const responseMessageId = $("#feedback-form-thank-you-message"); | ||
|
||
const email = emailId.val(); | ||
const feedback = feedbackId.val(); | ||
const pageUrl = $("#feedback-form-page-url").val(); | ||
const ghUrl = $("#feedback-form-gh-url").val(); | ||
const pageTitle = $("#feedback-form-page-title").val(); | ||
const product = $("#feedback-form-chef-product").val(); | ||
const data = { | ||
email : email, | ||
feedback : feedback, | ||
pageUrl : pageUrl, | ||
ghUrl : ghUrl, | ||
pageTitle : pageTitle, | ||
product : product, | ||
reCaptchaResponse : reCaptchaResponse | ||
}; | ||
|
||
// console.log(data); | ||
|
||
$.ajax({ | ||
type: "POST", | ||
url : "https://nhvuhdbe97.execute-api.us-west-2.amazonaws.com/default/docs-feedback-form", | ||
dataType: "json", | ||
crossDomain: "true", | ||
contentType: "application/json", | ||
data: JSON.stringify(data), | ||
|
||
success: function () { | ||
// clear form and show a success message | ||
// console.log("User input successfully submitted!") | ||
emailId.val(""); | ||
feedbackId.val(""); | ||
responseMessageId.show(); | ||
feedbackButtonId.prop("disabled", true); | ||
}, | ||
error: function(jqXHR, textStatus, errorThrown) { | ||
// show an error message | ||
// console.log("Failure"); | ||
// console.log(JSON.stringify(jqXHR)); | ||
// console.log("AJAX error: " + textStatus + ' : ' + errorThrown); | ||
responseMessageId.text("Unsuccessful :( You can also try sending an email to [email protected]."); | ||
responseMessageId.show(); | ||
} | ||
}); | ||
} |
Oops, something went wrong.