Skip to content

Commit

Permalink
add global version callout component (#6673)
Browse files Browse the repository at this point in the history
  • Loading branch information
mirnawong1 authored Dec 23, 2024
2 parents c81c5e9 + 6b4c631 commit 702651b
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 4 deletions.
2 changes: 1 addition & 1 deletion website/docs/docs/collaborate/govern/model-versions.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This functionality is new in v1.5 — if you have thoughts, participate in [the

</VersionBlock>

import VersionsCallout from '/snippets/_version-callout.md';
import VersionsCallout from '/snippets/_model-version-callout.md';

<VersionsCallout />

Expand Down
2 changes: 1 addition & 1 deletion website/docs/reference/project-configs/version.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ required: True
keyword: project version, project versioning, dbt project versioning
---

import VersionsCallout from '/snippets/_version-callout.md';
import VersionsCallout from '/snippets/_model-version-callout.md';

<VersionsCallout />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ default_value: {NULL}
id: "dbt_valid_to_current"
---

Available from dbt v1.9 or with [the dbt Cloud "Latest" release track](/docs/dbt-versions/cloud-release-tracks) dbt Cloud.
<VersionCallout version="1.9" />

<File name='snapshots/schema.yml'>

Expand Down
2 changes: 1 addition & 1 deletion website/docs/reference/resource-properties/versions.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ required: no
keyword: governance, model version, model versioning, dbt model versioning
---

import VersionsCallout from '/snippets/_version-callout.md';
import VersionsCallout from '/snippets/_model-version-callout.md';

<VersionsCallout />

Expand Down
File renamed without changes.
23 changes: 23 additions & 0 deletions website/src/components/versionCallout/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import React from 'react';
import Admonition from '@theme/Admonition';

const VersionCallout = ({ version }) => {
if (!version) {
return null;
}

return (
<div>
<Admonition type="tip" icon="💡" title="Did you know...">
<span>
Available from dbt v{version} or with the{' '}
<a href="/docs/dbt-versions/cloud-release-tracks">
dbt Cloud "Latest" release track
</a>{' '}.
</span>
</Admonition>
</div>
);
};

export default VersionCallout;
2 changes: 2 additions & 0 deletions website/src/theme/MDXComponents/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import Lifecycle from '@site/src/components/lifeCycle';
import DetailsToggle from '@site/src/components/detailsToggle';
import Expandable from '@site/src/components/expandable';
import ConfettiTrigger from '@site/src/components/confetti/';
import VersionCallout from '@site/src/components/versionCallout';

const MDXComponents = {
Head,
Expand Down Expand Up @@ -97,5 +98,6 @@ const MDXComponents = {
Expandable: Expandable,
ConfettiTrigger: ConfettiTrigger,
SortableTable: SortableTable,
VersionCallout: VersionCallout,
};
export default MDXComponents;

0 comments on commit 702651b

Please sign in to comment.