Skip to content
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 Terminus Changelog #9351

Merged
merged 27 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
9ef9826
add a console log for releases
jazzsequence Dec 17, 2024
a80758e
fix broken console logging
jazzsequence Dec 17, 2024
5c3c687
Merge a80758edeb926417d37ab9386588fd8ecc9dfba3 into 57cefcd7ca1b711d2…
jazzsequence Dec 17, 2024
faa5bf0
Apply Prettier formatting
Dec 17, 2024
11765e1
update the graphql query to fix sorting
jazzsequence Dec 17, 2024
9c483c5
Merge 11765e1f810ca20c8814ae1abd486f86cab2b9dc into 57cefcd7ca1b711d2…
jazzsequence Dec 17, 2024
f4b7767
Apply Prettier formatting
Dec 17, 2024
777f1f2
remove the graphql filter
jazzsequence Dec 17, 2024
3b65566
Merge 777f1f21440873ade875f5994a6e6bf63030eee0 into 57cefcd7ca1b711d2…
jazzsequence Dec 17, 2024
b40b416
Apply Prettier formatting
Dec 17, 2024
e29d07c
don't display releases older than a year
jazzsequence Dec 17, 2024
ca13ff0
Merge e29d07c850f617c006cc510cb66610d515973f43 into 57cefcd7ca1b711d2…
jazzsequence Dec 17, 2024
fc0e5a9
Apply Prettier formatting
Dec 17, 2024
d91e971
arbitrary change to trigger build
jazzsequence Dec 17, 2024
e9b1c6f
filter releases earlier
jazzsequence Dec 17, 2024
cd2c5f0
Merge e9b1c6fe424594ff366dbc558bd2f6249372dfe0 into 57cefcd7ca1b711d2…
jazzsequence Dec 17, 2024
d5d22f2
Apply Prettier formatting
Dec 17, 2024
73b4cbb
maybe fix filtering
jazzsequence Dec 17, 2024
d5231aa
Merge 73b4cbb25225d640a4de359856a41f719c8b6ee7 into 57cefcd7ca1b711d2…
jazzsequence Dec 17, 2024
e07b24f
Apply Prettier formatting
Dec 17, 2024
fe53735
maybe fix filtering again
jazzsequence Dec 18, 2024
2975738
Merge fe53735c5ba599584e4e8d7c848afd47f07e42b1 into 57cefcd7ca1b711d2…
jazzsequence Dec 18, 2024
45ede8d
Apply Prettier formatting
Dec 18, 2024
74bcaff
change the title and remove the heading
jazzsequence Dec 18, 2024
90c94f6
Merge branch 'experimental-debug-terminus-releases' of github.com:pan…
jazzsequence Dec 18, 2024
1815a4f
Align title in template file
rachelwhitton Dec 18, 2024
27abb5a
Align title in template file
rachelwhitton Dec 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions source/content/terminus/11-updates.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Terminus Guide
subtitle: Current Terminus Release, Changelog, and Updates
subtitle: Terminus Changelog
description: Stay up to date on the latest Terminus version.
terminuspage: true
type: terminuspage
Expand All @@ -16,8 +16,6 @@ product: [terminus]
integration: [--]
---

<TerminusVersion text="Update to the Current Release" />

## Changelog

<Releases />
Expand Down
78 changes: 45 additions & 33 deletions src/components/releases.js
Original file line number Diff line number Diff line change
@@ -1,49 +1,61 @@
import React from "react"
import { StaticQuery, graphql } from "gatsby"
import { MDXRenderer } from "gatsby-plugin-mdx"
import { MDXProvider } from "@mdx-js/react"
import React from 'react';
import { StaticQuery, graphql } from 'gatsby';
import { MDXRenderer } from 'gatsby-plugin-mdx';
import { MDXProvider } from '@mdx-js/react';
import { subYears, parseISO, isAfter } from 'date-fns';

import { headline1, headline2, headline3 } from "./releaseHeadlines"
import { headline1, headline2, headline3 } from './releaseHeadlines';

const shortcodes = {
h1: headline1,
h2: headline2,
h3: headline3,
}
};

const Releases = ({ data }) => (
<>
{data.allTerminusReleasesJson.edges.map((release, i) => {
return (
<div key={i}>
<h3 className="toc-ignore" id={release.node.tag_name}>
{release.node.tag_name}
</h3>
<MDXProvider components={shortcodes}>
<MDXRenderer>
{release.node.fields.markdownBody.childMdx.body}
</MDXRenderer>
</MDXProvider>
<hr />
</div>
)
})}
</>
)
const Releases = ({ data }) => {
const oneYearAgo = subYears(new Date(), 1);

export default props => (
// Safe Filtering: Ensure `published_at` exists before filtering
const filteredReleases = data.allTerminusReleasesJson.edges.filter(
(release) => {
const publishedDate = release.node.published_at;
return publishedDate && isAfter(parseISO(publishedDate), oneYearAgo);
},
);

return (
<>
{filteredReleases.length > 0 ? (
filteredReleases.map((release, i) => (
<div key={i}>
<h3 className="toc-ignore" id={release.node.tag_name}>
{release.node.tag_name}
</h3>
<MDXProvider components={shortcodes}>
<MDXRenderer>
{release.node.fields.markdownBody.childMdx.body}
</MDXRenderer>
</MDXProvider>
<hr />
</div>
))
) : (
<p>No recent releases found.</p>
)}
</>
);
};

export default (props) => (
<StaticQuery
query={graphql`
query {
allTerminusReleasesJson(
sort: { fields: [tag_name], order: DESC }
filter: { fields: { original_id: { gt: 5224487 } } }
) {
allTerminusReleasesJson(sort: { fields: [published_at], order: DESC }) {
edges {
node {
id
tag_name
body
published_at
fields {
markdownBody {
childMdx {
Expand All @@ -56,6 +68,6 @@ export default props => (
}
}
`}
render={data => <Releases data={data} {...props} />}
render={(data) => <Releases data={data} {...props} />}
/>
)
);
28 changes: 16 additions & 12 deletions src/components/terminusVersion.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
import React from "react"
import { useStaticQuery, graphql } from "gatsby"
import React from 'react';
import { useStaticQuery, graphql } from 'gatsby';

function TerminusVersion({ text }) {
const { terminusReleasesJson } = useStaticQuery(
graphql`
query {
terminusReleasesJson {
tag_name
const { allTerminusReleasesJson } = useStaticQuery(graphql`
query {
allTerminusReleasesJson(sort: { fields: [published_at], order: DESC }) {
edges {
node {
tag_name
}
}
}
`
)
}
`);

const latestRelease = allTerminusReleasesJson.edges[0].node.tag_name;

return (
<h2>
{text} {terminusReleasesJson.tag_name}
{text} {latestRelease}
</h2>
)
);
}

export default TerminusVersion
export default TerminusVersion;
2 changes: 1 addition & 1 deletion src/templates/terminusCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const items = [
{
id: 'docs-terminus-updates',
link: '/terminus/updates',
title: 'Current Terminus Release and Changelog',
title: 'Terminus Changelog',
},

{
Expand Down
2 changes: 1 addition & 1 deletion src/templates/terminuspage.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const items = [
{
id: 'docs-terminus-updates',
link: '/terminus/updates',
title: 'Current Terminus Release and Changelog',
title: 'Terminus Changelog',
},

{
Expand Down
Loading