Skip to content

Commit 4e1d62b

Browse files
authored
Remove free-pro-team support from Spanish translation of Insights doc (#16730)
* Remove free-pro-team support from Spanish translation of Insights doc * Throw errors for mismatched products in non-English content pages as well
1 parent 8917055 commit 4e1d62b

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

lib/page.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class Page {
6565
// only the homepage will not have this.parentProduct
6666
.filter(availableVersion => this.parentProduct && !this.parentProduct.versions.includes(availableVersion))
6767

68-
if (versionsParentProductIsNotAvailableIn.length && this.languageCode === 'en') {
68+
if (versionsParentProductIsNotAvailableIn.length) {
6969
throw new Error(`\`versions\` frontmatter in ${this.fullPath} contains ${versionsParentProductIsNotAvailableIn}, which ${this.parentProduct.id} product is not available in!`)
7070
}
7171

tests/unit/page.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ describe('catches errors thrown in Page class', () => {
389389
expect(getPage).toThrowError('versions')
390390
})
391391

392-
test('page with a version in frontmatter that its parent product is not available in', () => {
392+
test('English page with a version in frontmatter that its parent product is not available in', () => {
393393
function getPage () {
394394
return new Page({
395395
relativePath: 'admin/some-category/some-article-with-mismatched-versions-frontmatter.md',
@@ -400,4 +400,16 @@ describe('catches errors thrown in Page class', () => {
400400

401401
expect(getPage).toThrowError(/`versions` frontmatter.*? product is not available in/)
402402
})
403+
404+
test('non-English page with a version in frontmatter that its parent product is not available in', () => {
405+
function getPage () {
406+
return new Page({
407+
relativePath: 'admin/some-category/some-article-with-mismatched-versions-frontmatter.md',
408+
basePath: path.join(__dirname, '../fixtures/products'),
409+
languageCode: 'es'
410+
})
411+
}
412+
413+
expect(getPage).toThrowError(/`versions` frontmatter.*? product is not available in/)
414+
})
403415
})

translations/es-XL/content/insights/installing-and-configuring-github-insights/updating-github-insights.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ redirect_from:
66
- /github/installing-and-configuring-github-insights/updating-github-insights
77
permissions: 'Las personas con permisos de lectura para el repositorio de `github/insights-releases` y el acceso administrativo al servidor de aplicaciones pueden actualizar {% data variables.product.prodname_insights %}.'
88
versions:
9-
free-pro-team: '*'
109
enterprise-server: '*'
1110
---
1211

0 commit comments

Comments
 (0)