Skip to content

Commit 516106b

Browse files
authored
Rename "helpfulness" to survey (github#19727)
1 parent f8ec871 commit 516106b

12 files changed

Lines changed: 68 additions & 68 deletions

File tree

components/SupportSection.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Helpfulness } from 'components/Helpfulness'
1+
import { Survey } from 'components/Survey'
22
import { Contribution } from 'components/Contribution'
33
import { Support } from 'components/Support'
44
import { useMainContext } from './context/MainContext'
@@ -16,7 +16,7 @@ export const SupportSection = () => {
1616
<section className="mt-lg-9 py-7 px-3 px-md-6 no-print color-bg-tertiary">
1717
<div className="container-xl gutter-lg-spacious clearfix">
1818
<div className="col-12 col-lg-6 col-xl-4 mb-6 mb-xl-0 float-left">
19-
{!isDeprecated && <Helpfulness />}
19+
{!isDeprecated && <Survey />}
2020
</div>
2121
<div className="col-12 col-lg-6 col-xl-4 mb-6 mb-xl-0 float-left">
2222
{!isDeprecated && <Contribution />}
Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { ThumbsdownIcon, ThumbsupIcon } from '@primer/octicons-react'
22
import { useTranslation } from 'components/hooks/useTranslation'
33

4-
export const Helpfulness = () => {
5-
const { t } = useTranslation('helpfulness')
4+
export const Survey = () => {
5+
const { t } = useTranslation('survey')
66

77
return (
8-
<form className="js-helpfulness f5">
8+
<form className="js-survey f5">
99
<h2 data-help-start data-help-yes data-help-no className="mb-1 f4">
1010
{t`able_to_find`}
1111
</h2>
@@ -15,24 +15,24 @@ export const Helpfulness = () => {
1515
<p className="radio-group" data-help-start data-help-yes data-help-no>
1616
<input
1717
hidden
18-
id="helpfulness-yes"
18+
id="survey-yes"
1919
type="radio"
20-
name="helpfulness-vote"
20+
name="survey-vote"
2121
value="Yes"
2222
aria-label={t('yes')}
2323
/>
24-
<label className="btn x-radio-label mr-1" htmlFor="helpfulness-yes">
24+
<label className="btn x-radio-label mr-1" htmlFor="survey-yes">
2525
<ThumbsupIcon size={24} className="color-text-tertiary" />
2626
</label>
2727
<input
2828
hidden
29-
id="helpfulness-no"
29+
id="survey-no"
3030
type="radio"
31-
name="helpfulness-vote"
31+
name="survey-vote"
3232
value="No"
3333
aria-label={t`no`}
3434
/>
35-
<label className="btn x-radio-label" htmlFor="helpfulness-no">
35+
<label className="btn x-radio-label" htmlFor="survey-no">
3636
<ThumbsdownIcon size={24} className="color-text-tertiary" />
3737
</label>
3838
</p>
@@ -42,28 +42,28 @@ export const Helpfulness = () => {
4242
<p className="color-text-secondary f6" hidden data-help-no>
4343
{t('no_feedback')}
4444
</p>
45-
<input type="text" className="d-none" name="helpfulness-token" aria-hidden="true" />
45+
<input type="text" className="d-none" name="survey-token" aria-hidden="true" />
4646
<p hidden data-help-no>
47-
<label className="d-block mb-1 f6" htmlFor="helpfulness-comment">
47+
<label className="d-block mb-1 f6" htmlFor="survey-comment">
4848
<span>{t('comment_label')}</span>
4949
<span className="text-normal color-text-tertiary float-right ml-1">{t('optional')}</span>
5050
</label>
5151
<textarea
5252
className="form-control input-sm width-full"
53-
name="helpfulness-comment"
54-
id="helpfulness-comment"
53+
name="survey-comment"
54+
id="survey-comment"
5555
></textarea>
5656
</p>
5757
<p>
58-
<label className="d-block mb-1 f6" htmlFor="helpfulness-email" hidden data-help-no>
58+
<label className="d-block mb-1 f6" htmlFor="survey-email" hidden data-help-no>
5959
{t('email_label')}
6060
<span className="text-normal color-text-tertiary float-right ml-1">{t('optional')}</span>
6161
</label>
6262
<input
6363
type="email"
6464
className="form-control input-sm width-full"
65-
name="helpfulness-email"
66-
id="helpfulness-email"
65+
name="survey-email"
66+
id="survey-email"
6767
placeholder={t('email_placeholder')}
6868
hidden
6969
data-help-yes

data/ui.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ support:
4949
still_need_help: Still need help?
5050
contact_support: Contact support
5151
ask_community: Ask the GitHub community
52-
helpfulness:
52+
survey:
5353
able_to_find: Did this doc help you?
5454
yes: Yes
5555
no: No

includes/support-section.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<section class="mt-lg-9 py-7 px-3 px-md-6 no-print color-bg-tertiary">
22
<div class="container-xl gutter-lg-spacious d-flex flex-wrap">
33
<div class="col-12 col-lg-6 col-xl-4 mb-6 mb-xl-0">
4-
{% include helpfulness %}
4+
{% include survey %}
55
</div>
66
<div class="col-12 col-lg-6 col-xl-4 mb-6 mb-xl-0">
77
{% include contribution %}
Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{% unless enterpriseServerReleases.isOldestReleaseDeprecated and currentVersion contains enterpriseServerReleases.oldestSupported %}
2-
<form class="js-helpfulness f5">
2+
<form class="js-survey f5">
33
<h2
44
data-help-start
55
data-help-yes
66
data-help-no
77
class="mb-1 f4"
88
>
9-
{% data ui.helpfulness.able_to_find %}
9+
{% data ui.survey.able_to_find %}
1010
</h2>
1111
<p class="f6">
1212
<a href="/github/site-policy/github-privacy-statement">Privacy policy</a>
@@ -19,73 +19,73 @@
1919
>
2020
<input
2121
hidden
22-
id="helpfulness-yes"
22+
id="survey-yes"
2323
type="radio"
24-
name="helpfulness-vote"
24+
name="survey-vote"
2525
value="Yes"
26-
aria-label="{% data ui.helpfulness.yes %}"
26+
aria-label="{% data ui.survey.yes %}"
2727
/>
28-
<label class="btn x-radio-label" for="helpfulness-yes">
28+
<label class="btn x-radio-label" for="survey-yes">
2929
{% octicon "thumbsup" height="24" %}
3030
</label>
3131
<input
3232
hidden
33-
id="helpfulness-no"
33+
id="survey-no"
3434
type="radio"
35-
name="helpfulness-vote"
35+
name="survey-vote"
3636
value="No"
37-
aria-label="{% data ui.helpfulness.no %}"
37+
aria-label="{% data ui.survey.no %}"
3838
/>
39-
<label class="btn x-radio-label" for="helpfulness-no">
39+
<label class="btn x-radio-label" for="survey-no">
4040
{% octicon "thumbsdown" height="24" %}
4141
</label>
4242
</p>
4343
<p class="color-text-secondary f6" hidden data-help-yes>
44-
{% data ui.helpfulness.yes_feedback %}
44+
{% data ui.survey.yes_feedback %}
4545
</p>
4646
<p class="color-text-secondary f6" hidden data-help-no>
47-
{% data ui.helpfulness.no_feedback %}
47+
{% data ui.survey.no_feedback %}
4848
</p>
4949
<input
5050
type="text"
5151
class="d-none"
52-
name="helpfulness-token"
52+
name="survey-token"
5353
aria-hidden="true"
5454
/>
5555
<p hidden data-help-no>
5656
<label
5757
class="d-block mb-1 f6"
58-
for="helpfulness-comment"
58+
for="survey-comment"
5959
>
60-
<span>{% data ui.helpfulness.comment_label %}</span>
60+
<span>{% data ui.survey.comment_label %}</span>
6161
<span class="text-normal color-text-tertiary float-right ml-1">
62-
{% data ui.helpfulness.optional %}
62+
{% data ui.survey.optional %}
6363
</span>
6464
</label>
6565
<textarea
6666
class="form-control input-sm width-full"
67-
name="helpfulness-comment"
68-
id="helpfulness-comment"
67+
name="survey-comment"
68+
id="survey-comment"
6969
></textarea>
7070
</p>
7171
<p>
7272
<label
7373
class="d-block mb-1 f6"
74-
for="helpfulness-email"
74+
for="survey-email"
7575
hidden
7676
data-help-no
7777
>
78-
{% data ui.helpfulness.email_label %}
78+
{% data ui.survey.email_label %}
7979
<span class="text-normal color-text-tertiary float-right ml-1">
80-
{% data ui.helpfulness.optional %}
80+
{% data ui.survey.optional %}
8181
</span>
8282
</label>
8383
<input
8484
type="email"
8585
class="form-control input-sm width-full"
86-
name="helpfulness-email"
87-
id="helpfulness-email"
88-
placeholder="{% data ui.helpfulness.email_placeholder %}"
86+
name="survey-email"
87+
id="survey-email"
88+
placeholder="{% data ui.survey.email_placeholder %}"
8989
hidden
9090
data-help-yes
9191
data-help-no
@@ -98,11 +98,11 @@
9898
data-help-no
9999
>
100100
<button type="submit" class="btn btn-sm">
101-
{% data ui.helpfulness.send %}
101+
{% data ui.survey.send %}
102102
</button>
103103
</p>
104104
<p class="color-text-secondary f6" hidden data-help-end>
105-
{% data ui.helpfulness.feedback %}
105+
{% data ui.survey.feedback %}
106106
</p>
107107
</form>
108108
{% endunless %}

javascripts/events.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ export default function initializeEvents () {
235235
initClipboardEvent()
236236
initNavigateEvent()
237237
// print event in ./print.js
238-
// survey event in ./helpfulness.js
238+
// survey event in ./survey.js
239239
// experiment event in ./experiment.js
240240
// search event in ./search.js
241241
// redirect event in middleware/record-redirect.js

javascripts/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import sidebar from './sidebar'
1111
import wrapCodeTerms from './wrap-code-terms'
1212
import print from './print'
1313
import localization from './localization'
14-
import helpfulness from './helpfulness'
14+
import survey from './survey'
1515
import experiment from './experiment'
1616
import copyCode from './copy-code'
1717
import initializeEvents from './events'
@@ -44,6 +44,6 @@ document.addEventListener('DOMContentLoaded', async () => {
4444
releaseNotes()
4545
initializeEvents()
4646
experiment()
47-
helpfulness()
47+
survey()
4848
toggleImages()
4949
})
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function submitForm (form) {
2727
Array.from(formData.entries())
2828
.map(
2929
([key, value]) => [
30-
key.replace('helpfulness-', ''),
30+
key.replace('survey-', ''),
3131
value || undefined // Convert empty strings to undefined
3232
]
3333
)
@@ -45,10 +45,10 @@ function trackEvent ({ token, vote, email, comment }) {
4545
})
4646
}
4747

48-
export default function helpfulness () {
49-
const form = document.querySelector('.js-helpfulness')
50-
const texts = Array.from(document.querySelectorAll('.js-helpfulness input, .js-helpfulness textarea'))
51-
const votes = Array.from(document.querySelectorAll('.js-helpfulness [type=radio]'))
48+
export default function survey () {
49+
const form = document.querySelector('.js-survey')
50+
const texts = Array.from(document.querySelectorAll('.js-survey input, .js-survey textarea'))
51+
const votes = Array.from(document.querySelectorAll('.js-survey [type=radio]'))
5252
if (!form || !texts.length || !votes.length) return
5353

5454
form.addEventListener('submit', evt => {

stylesheets/index.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ $marketing-font-path: "/dist/fonts/";
2222
@import "font-mktg.scss";
2323
@import "gradient.scss";
2424
@import "headings.scss";
25-
@import "helpfulness.scss";
25+
@import "survey.scss";
2626
@import "images.scss";
2727
@import "lists.scss";
2828
@import "nav.scss";
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Helpfulness survey override */
1+
/* Survey override */
22
:checked + .x-radio-label {
33
background: var(--color-auto-blue-5);
44

0 commit comments

Comments
 (0)