Skip to content

Commit a8f16c6

Browse files
authored
Do not include feedback links in deprecated GHES versions (#16485)
* do not render if this is the oldest supported GHES release * add tests
1 parent 4ae0a54 commit a8f16c6

3 files changed

Lines changed: 21 additions & 1 deletion

File tree

includes/contribution.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
<div class="mt-3 f5">
1+
{% unless currentVersion contains enterpriseServerReleases.oldestSupported %}
2+
<div class="mt-3 f5 contribution">
23
<h4>{% data ui.contribution_cta.title %}</h4>
34
<p class="text-gray f6">{% data ui.contribution_cta.body %}</p>
45
<a class="btn btn-outline" href={{ "https://github.com/github/docs/edit/main/content/" | append: page.relativePath }}>
@@ -7,3 +8,4 @@ <h4>{% data ui.contribution_cta.title %}</h4>
78
</a>
89
<p class="text-gray f6 mt-2">{% data ui.contribution_cta.or %} <a href="https://github.com/github/docs/blob/main/CONTRIBUTING.md" target="_blank">{% data ui.contribution_cta.to_guidelines %}</a></p>
910
</div>
11+
{% endunless %}

includes/helpfulness.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{% unless currentVersion contains enterpriseServerReleases.oldestSupported %}
12
<form class="js-helpfulness mt-4 f5" id="helpfulness-{{ helpId }}">
23
<h4
34
data-help-start
@@ -132,3 +133,4 @@
132133
{% data ui.helpfulness.feedback %}
133134
</p>
134135
</form>
136+
{% endunless %}

tests/routing/deprecated-enterprise-versions.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,22 @@ describe('deprecation banner', () => {
9696
})
9797
})
9898

99+
describe('does not render helpfulness prompt or contribution button', () => {
100+
test('does not render helpfulness prompt', async () => {
101+
let $ = await getDOM(`/en/enterprise/${enterpriseServerReleases.oldestSupported}/github`)
102+
expect($('.js-helpfulness').length).toBe(0)
103+
$ = await getDOM(`/en/enterprise/${enterpriseServerReleases.latest}/github`)
104+
expect($('.js-helpfulness').length).toBeGreaterThan(0)
105+
})
106+
107+
test('does not render contribution button', async () => {
108+
let $ = await getDOM(`/en/enterprise/${enterpriseServerReleases.oldestSupported}/github`)
109+
expect($('.contribution').length).toBe(0)
110+
$ = await getDOM(`/en/enterprise/${enterpriseServerReleases.latest}/github`)
111+
expect($('.contribution').length).toBeGreaterThan(0)
112+
})
113+
})
114+
99115
describe('JS and CSS assets', () => {
100116
it('returns the expected CSS file > 2.18', async () => {
101117
const result = await supertest(app)

0 commit comments

Comments
 (0)