-
Notifications
You must be signed in to change notification settings - Fork 981
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix version orders #6057
Fix version orders #6057
Changes from 35 commits
2964275
2c6d652
779b415
bd4419d
275bd32
8187bd2
232566c
5a41120
710cfd8
3707f86
433941c
c606808
b5a8c7d
0e6d786
7c2f7a1
9a91cfb
37fdc03
6791be9
9257248
274dac1
a56dc30
80c9466
35322f9
e836844
b7e7940
c45db61
cd7b4be
4f4efd3
2e8b117
0a8bc7e
c460460
e0c44d4
dfe7fd0
18a7e20
9646d9f
9651162
24e4930
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,18 @@ | |
* customDisplay for dbt Cloud should be a version ahead of latest dbt Core release (GA or beta). | ||
*/ | ||
exports.versions = [ | ||
{ | ||
version: "2.1", | ||
EOLDate: "2026-04-15", | ||
}, | ||
{ | ||
version: "1.10.1", | ||
EOLDate: "2026-04-15", | ||
}, | ||
{ | ||
version: "1.10", | ||
EOLDate: "2026-04-15", | ||
}, | ||
{ | ||
version: "1.9.1", | ||
customDisplay: "Cloud (Versionless)", | ||
|
@@ -30,7 +42,7 @@ exports.versions = [ | |
version: "1.6", | ||
EOLDate: "2024-07-31", | ||
}, | ||
] | ||
]; | ||
|
||
/** | ||
* Controls doc page visibility in the sidebar based on the current version | ||
|
@@ -43,11 +55,11 @@ exports.versions = [ | |
*/ | ||
exports.versionedPages = [ | ||
{ | ||
"page": "/reference/resource-configs/target_database", | ||
"page": "reference/resource-configs/target_database", | ||
"lastVersion": "1.8", | ||
}, | ||
{ | ||
"page": "/reference/resource-configs/target_schema", | ||
"page": "reference/resource-configs/target_schema", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Keep these changes, page paths should not have leading forward slash. Remove all other changes in this file. |
||
"lastVersion": "1.8", | ||
}, | ||
{ | ||
|
@@ -201,5 +213,10 @@ exports.versionedCategories = [ | |
{ | ||
"category": "Build your metrics", | ||
"firstVersion": "1.6", | ||
} | ||
}, | ||
// TODO: Delete demo entry below | ||
{ | ||
"category": "Project configs", | ||
"firstVersion": "1.8", | ||
}, | ||
] |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Delete this page before merge |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
title: "Version Testing" | ||
id: "version-testing" | ||
--- | ||
|
||
<VersionBlock firstVersion="1.6" lastVersion="1.9.1"> | ||
## first version - 1.6 | last version - 1.9.1 | ||
</VersionBlock> | ||
|
||
<VersionBlock firstVersion="2.1"> | ||
## first version - 2.1 | ||
</VersionBlock> | ||
|
||
<VersionBlock firstVersion="1.10"> | ||
## first version - 1.10 | ||
</VersionBlock> |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,25 @@ | ||
import React, { useState, useEffect, useContext } from 'react' | ||
import VersionContext from '../../stores/VersionContext'; | ||
import { availableInCurrentVersion } from '../../utils/available-in-current-version'; | ||
|
||
export default function VersionBlock({ firstVersion = 0, lastVersion = undefined, children }) { | ||
const { version } = useContext(VersionContext) | ||
export default function VersionBlock({ firstVersion = "0", lastVersion = undefined, children }) { | ||
const { version } = useContext(VersionContext); | ||
|
||
const [loading, setLoading] = useState(true) | ||
const [loading, setLoading] = useState(true); | ||
|
||
// Hide versionBlock components until version ready | ||
useEffect(() => { | ||
version && setLoading(false) | ||
}, [version]) | ||
version && setLoading(false); | ||
}, [version]); | ||
|
||
// Only check version if current version set | ||
if(version) { | ||
const currentVersionVal = parseFloat(version) | ||
const firstVersionVal = parseFloat(firstVersion) | ||
{/* | ||
* If last version set, check if current version greater than last version | ||
* Or if current version less than first version | ||
* If either is true, hide block | ||
* Else, if current version less than first version, hide block | ||
*/} | ||
if(lastVersion) { | ||
if((currentVersionVal > parseFloat(lastVersion)) | ||
|| (currentVersionVal < firstVersionVal)) | ||
return null | ||
} else { | ||
if(currentVersionVal < firstVersionVal) { | ||
return null | ||
} | ||
|
||
} | ||
if (version) { | ||
if (!availableInCurrentVersion( | ||
version, | ||
firstVersion, | ||
lastVersion | ||
)) return null; | ||
} | ||
|
||
return loading | ||
? null | ||
: <>{children}</> | ||
return loading ? null : <>{children}</>; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functionality not used, confirmed with Docs team we can remove the
Var
component: https://dbt-labs.slack.com/archives/C02NCQ9483C/p1726157412409069