From accf26494ded2760d1be93becc1e7aea37a4c628 Mon Sep 17 00:00:00 2001 From: Paul Gottschling Date: Sat, 16 Nov 2024 12:01:49 -0500 Subject: [PATCH] Provisionally update the docs for v17 (#504) The docs versioning policy for v17 onward is to switch the default docs version to the newly released major version when we roll it out to Cloud customers. However, this means that once we release the new major version, users who visit the tab for that version see a message that the version is an upcoming release. This change edits the docs engine to not display the "upcoming release" message for v17, while keeping v16 as the default docs version. It also adds an "Edge" submodule for `master`. Since we no longer support v14, this change removes the v14 submodule. --- .gitmodules | 10 +++++----- config.json | 7 ++++++- content/14.x | 1 - content/15.x | 2 +- content/16.x | 2 +- content/17.x | 2 +- content/edge | 1 + layouts/DocsPage/DocsPage.tsx | 10 +--------- layouts/DocsPage/Versions.tsx | 7 +++++++ 9 files changed, 23 insertions(+), 19 deletions(-) delete mode 160000 content/14.x create mode 160000 content/edge diff --git a/.gitmodules b/.gitmodules index a4e47f19f9..83c584ba7e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,3 @@ -[submodule "content/14.x"] - path = content/14.x - url = https://github.com/gravitational/teleport - branch = branch/v14 [submodule "content/15.x"] path = content/15.x url = https://github.com/gravitational/teleport @@ -13,4 +9,8 @@ [submodule "content/17.x"] path = content/17.x url = https://github.com/gravitational/teleport - branch = master + branch = branch/v17 + +[submodule "content/edge"] + path = content/edge + url = https://github.com/gravitational/teleport diff --git a/config.json b/config.json index 3c97a47a4a..d67cc093fb 100644 --- a/config.json +++ b/config.json @@ -62,7 +62,8 @@ }, { "name": "14.x", - "branch": "branch/v14" + "branch": "branch/v14", + "deprecated": true }, { "name": "15.x", @@ -75,6 +76,10 @@ }, { "name": "17.x", + "branch": "branch/v17" + }, + { + "name": "edge", "branch": "master" } ] diff --git a/content/14.x b/content/14.x deleted file mode 160000 index 473214eb45..0000000000 --- a/content/14.x +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 473214eb450361cb068a09af2bca21267a474391 diff --git a/content/15.x b/content/15.x index b084c7e60f..b5629ef03d 160000 --- a/content/15.x +++ b/content/15.x @@ -1 +1 @@ -Subproject commit b084c7e60f7f9185737bb4a53eb4be451bc299aa +Subproject commit b5629ef03df75e3f01b87619364a457818a5cc85 diff --git a/content/16.x b/content/16.x index 728efa3d97..d59d530c10 160000 --- a/content/16.x +++ b/content/16.x @@ -1 +1 @@ -Subproject commit 728efa3d97009aec05db0ef93fc540f78a4834e1 +Subproject commit d59d530c10385d73b896b93263bee4d04a4330ca diff --git a/content/17.x b/content/17.x index a98b0430ad..a19666acca 160000 --- a/content/17.x +++ b/content/17.x @@ -1 +1 @@ -Subproject commit a98b0430add9e1cfdff68acf90960aef396d5822 +Subproject commit a19666acca10e0cda5c033e9a499574f38a5cdb1 diff --git a/content/edge b/content/edge new file mode 160000 index 0000000000..f3e36e719f --- /dev/null +++ b/content/edge @@ -0,0 +1 @@ +Subproject commit f3e36e719f64a6532bb4ef2d431abaca19a42648 diff --git a/layouts/DocsPage/DocsPage.tsx b/layouts/DocsPage/DocsPage.tsx index 3ced583faf..128750a278 100644 --- a/layouts/DocsPage/DocsPage.tsx +++ b/layouts/DocsPage/DocsPage.tsx @@ -63,7 +63,6 @@ const DocsPage = ({ const icon = navigation[categoryId]?.icon || "book"; const isOldVersion = available.indexOf(current) < available.indexOf(latest); - const isBetaVersion = available.indexOf(current) > available.indexOf(latest); let path = getPath(latest); @@ -104,7 +103,7 @@ const DocsPage = ({ )}
- {(isOldVersion || isBetaVersion) && ( + {isOldVersion && ( {isOldVersion && ( <> @@ -113,13 +112,6 @@ const DocsPage = ({ version instead. )} - {isBetaVersion && ( - <> - This chapter covers an upcoming release: {current}. We - recommend the latest{" "} - version instead. - - )} )} diff --git a/layouts/DocsPage/Versions.tsx b/layouts/DocsPage/Versions.tsx index 0d2fdaff17..ef22978b01 100644 --- a/layouts/DocsPage/Versions.tsx +++ b/layouts/DocsPage/Versions.tsx @@ -7,6 +7,9 @@ import styles from "./Versions.module.css"; // renders strikethrough for deprecated versions const renderVersion = (version: VersionsDropdown) => { + if (version.value === "edge") { + return "Edge version"; + } if (version.deprecated) return Version {version.value}; if (version.value === "Older Versions") return version.value; @@ -25,6 +28,10 @@ const validVersion = (thisVersion: string, latestVersion: string) => { const currentMajorVersion = majorVersionRe.exec(thisVersion); const latestMajorVersion = majorVersionRe.exec(latestVersion); + if (thisVersion === "edge") { + return true; + } + // Can't calculate validity, so the version is invalid. This happens, e.g., // if we're dealing with a dropdown option like "Older Versions". if (currentMajorVersion == null || latestMajorVersion == null) {