Skip to content

Commit b5dddd4

Browse files
committed
move deprecation date calculation from client side to server side
1 parent a8f16c6 commit b5dddd4

File tree

3 files changed

+3
-33
lines changed

3 files changed

+3
-33
lines changed

javascripts/deprecation-banner.js

Lines changed: 0 additions & 30 deletions
This file was deleted.

javascripts/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import explorer from './explorer'
55
import search from './search'
66
import nav from './nav'
77
import browserDateFormatter from 'browser-date-formatter'
8-
import deprecationBanner from './deprecation-banner'
98
import sidebar from './sidebar'
109
import wrapCodeTerms from './wrap-code-terms'
1110
import print from './print'
@@ -24,7 +23,6 @@ document.addEventListener('DOMContentLoaded', async () => {
2423
search()
2524
nav()
2625
browserDateFormatter()
27-
deprecationBanner()
2826
sidebar()
2927
wrapCodeTerms()
3028
print()

lib/enterprise-server-releases.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,12 @@ const all = supported.concat(deprecated)
3636
const latest = supported[0]
3737
const oldestSupported = supported[supported.length - 1]
3838
const nextDeprecationDate = dates[oldestSupported].deprecationDate
39+
const isOldestReleaseDeprecated = new Date() > new Date(nextDeprecationDate)
3940
const deprecatedOnNewSite = deprecated.filter(version => versionSatisfiesRange(version, '>=2.13'))
4041
const firstVersionDeprecatedOnNewSite = '2.13'
4142
// starting from 2.18, we updated the archival script to create stubbed HTML redirect files
4243
const lastVersionWithoutStubbedRedirectFiles = '2.17'
43-
// last version using paths like /enterprise/<verison>/<user>/<product>/<category>/<article>
44+
// last version using paths like /enterprise/<release>/<user>/<product>/<category>/<article>
4445
// instead of /enterprise-server@<release>/<product>/<category>/<article>
4546
const lastReleaseWithLegacyFormat = '2.18'
4647

@@ -51,6 +52,7 @@ module.exports = {
5152
latest,
5253
oldestSupported,
5354
nextDeprecationDate,
55+
isOldestReleaseDeprecated,
5456
deprecatedOnNewSite,
5557
dates,
5658
firstVersionDeprecatedOnNewSite,

0 commit comments

Comments
 (0)